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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
45132832a05d347ee42103c7351b98c360368bf9 | enrolment/templates/landing-page.html | enrolment/templates/landing-page.html | {% extends './govuk_layout.html' %}
{% load staticfiles %}
{% block css %}
<link href="{% static 'landing-page.css' %}" media="all" rel="stylesheet" />
{% endblock %}
{% block hero_title %}
Get seen by motivated overseas buyers - add your profile to the Great Trade Index
{% endblock %}
{% block content %}
<div class="container">
<div class="ed-landing-page">
<!-- Register block -->
<div class="row-fluid">
<div class="span8 ed-landing-page-login-synopsis">
<p>Get a Great Trade Index profile to generate international sales leads.</p>
</div>
<div class="span4">
<a class="" href="#">
<div class="register-interest-btn">
Get your profile
<span class="a11y">on Export Connect</span>
</div>
</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
{% endblock content %}
| {% extends './govuk_layout.html' %}
{% load staticfiles %}
{% block css %}
<link href="{% static 'landing-page.css' %}" media="all" rel="stylesheet" />
{% endblock %}
{% block hero_title %}
Get seen by motivated overseas buyers - add your profile to the Great Trade Index
{% endblock %}
{% block content %}
<div class="container">
<div class="ed-landing-page">
<!-- Register block -->
<div class="row-fluid">
<div class="span8 ed-landing-page-login-synopsis">
<p>Get a Great Trade Index profile to generate international sales leads.</p>
</div>
<div class="span4">
<a class="" target="_self" href="http://www.sso.dev.directory.uktrade.io/accounts/signup?next=https://directory-ui-dev.herokuapp.com/register">
<div class="register-interest-btn">
Get your profile
<span class="a11y">on Export Connect</span>
</div>
</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
{% endblock content %}
| Add sso signup link to landing page | Add sso signup link to landing page
| HTML | mit | uktrade/directory-ui-supplier,uktrade/directory-ui-supplier,uktrade/directory-ui-supplier | html | ## Code Before:
{% extends './govuk_layout.html' %}
{% load staticfiles %}
{% block css %}
<link href="{% static 'landing-page.css' %}" media="all" rel="stylesheet" />
{% endblock %}
{% block hero_title %}
Get seen by motivated overseas buyers - add your profile to the Great Trade Index
{% endblock %}
{% block content %}
<div class="container">
<div class="ed-landing-page">
<!-- Register block -->
<div class="row-fluid">
<div class="span8 ed-landing-page-login-synopsis">
<p>Get a Great Trade Index profile to generate international sales leads.</p>
</div>
<div class="span4">
<a class="" href="#">
<div class="register-interest-btn">
Get your profile
<span class="a11y">on Export Connect</span>
</div>
</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
{% endblock content %}
## Instruction:
Add sso signup link to landing page
## Code After:
{% extends './govuk_layout.html' %}
{% load staticfiles %}
{% block css %}
<link href="{% static 'landing-page.css' %}" media="all" rel="stylesheet" />
{% endblock %}
{% block hero_title %}
Get seen by motivated overseas buyers - add your profile to the Great Trade Index
{% endblock %}
{% block content %}
<div class="container">
<div class="ed-landing-page">
<!-- Register block -->
<div class="row-fluid">
<div class="span8 ed-landing-page-login-synopsis">
<p>Get a Great Trade Index profile to generate international sales leads.</p>
</div>
<div class="span4">
<a class="" target="_self" href="http://www.sso.dev.directory.uktrade.io/accounts/signup?next=https://directory-ui-dev.herokuapp.com/register">
<div class="register-interest-btn">
Get your profile
<span class="a11y">on Export Connect</span>
</div>
</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
{% endblock content %}
| {% extends './govuk_layout.html' %}
{% load staticfiles %}
{% block css %}
<link href="{% static 'landing-page.css' %}" media="all" rel="stylesheet" />
{% endblock %}
{% block hero_title %}
Get seen by motivated overseas buyers - add your profile to the Great Trade Index
{% endblock %}
{% block content %}
<div class="container">
<div class="ed-landing-page">
<!-- Register block -->
<div class="row-fluid">
<div class="span8 ed-landing-page-login-synopsis">
<p>Get a Great Trade Index profile to generate international sales leads.</p>
</div>
<div class="span4">
- <a class="" href="#">
+ <a class="" target="_self" href="http://www.sso.dev.directory.uktrade.io/accounts/signup?next=https://directory-ui-dev.herokuapp.com/register">
<div class="register-interest-btn">
Get your profile
<span class="a11y">on Export Connect</span>
</div>
</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
{% endblock content %} | 2 | 0.0625 | 1 | 1 |
0d73cc1b38703653c3302d8f9ff4efbeaaa2b406 | credentials/apps/records/models.py | credentials/apps/records/models.py | import uuid
from django.db import models
from django_extensions.db.models import TimeStampedModel
from credentials.apps.catalog.models import CourseRun, Program
from credentials.apps.core.models import User
class UserGrade(TimeStampedModel):
"""
A grade for a specific user and course run
"""
username = models.CharField(max_length=150, blank=False)
course_run = models.ForeignKey(CourseRun)
letter_grade = models.CharField(max_length=255, blank=True)
percent_grade = models.DecimalField(max_digits=5, decimal_places=4, null=False)
verified = models.BooleanField(verbose_name='Verified Learner ID', default=True)
class Meta(object):
unique_together = ('username', 'course_run')
class ProgramCertRecord(TimeStampedModel):
"""
Connects a User with a Program
"""
program = models.ForeignKey(Program, null=True)
user = models.ForeignKey(User)
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
def __str__(self):
return 'ProgramCertificateRecord: {uuid}'.format(uuid=self.uuid)
class Meta(object):
verbose_name = "A viewable record of a program"
| import uuid
from django.db import models
from django_extensions.db.models import TimeStampedModel
from credentials.apps.catalog.models import CourseRun, Program
from credentials.apps.core.models import User
from credentials.apps.credentials.models import ProgramCertificate
class UserGrade(TimeStampedModel):
"""
A grade for a specific user and course run
"""
username = models.CharField(max_length=150, blank=False)
course_run = models.ForeignKey(CourseRun)
letter_grade = models.CharField(max_length=255, blank=True)
percent_grade = models.DecimalField(max_digits=5, decimal_places=4, null=False)
verified = models.BooleanField(verbose_name='Verified Learner ID', default=True)
class Meta(object):
unique_together = ('username', 'course_run')
class ProgramCertRecord(TimeStampedModel):
"""
Connects a User with a Program
"""
certificate = models.ForeignKey(ProgramCertificate, null=True)
program = models.ForeignKey(Program, null=True)
user = models.ForeignKey(User)
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
def __str__(self):
return 'ProgramCertificateRecord: {uuid}'.format(uuid=self.uuid)
class Meta(object):
verbose_name = "A viewable record of a program"
| Revert early removal of certificate field | Revert early removal of certificate field
| Python | agpl-3.0 | edx/credentials,edx/credentials,edx/credentials,edx/credentials | python | ## Code Before:
import uuid
from django.db import models
from django_extensions.db.models import TimeStampedModel
from credentials.apps.catalog.models import CourseRun, Program
from credentials.apps.core.models import User
class UserGrade(TimeStampedModel):
"""
A grade for a specific user and course run
"""
username = models.CharField(max_length=150, blank=False)
course_run = models.ForeignKey(CourseRun)
letter_grade = models.CharField(max_length=255, blank=True)
percent_grade = models.DecimalField(max_digits=5, decimal_places=4, null=False)
verified = models.BooleanField(verbose_name='Verified Learner ID', default=True)
class Meta(object):
unique_together = ('username', 'course_run')
class ProgramCertRecord(TimeStampedModel):
"""
Connects a User with a Program
"""
program = models.ForeignKey(Program, null=True)
user = models.ForeignKey(User)
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
def __str__(self):
return 'ProgramCertificateRecord: {uuid}'.format(uuid=self.uuid)
class Meta(object):
verbose_name = "A viewable record of a program"
## Instruction:
Revert early removal of certificate field
## Code After:
import uuid
from django.db import models
from django_extensions.db.models import TimeStampedModel
from credentials.apps.catalog.models import CourseRun, Program
from credentials.apps.core.models import User
from credentials.apps.credentials.models import ProgramCertificate
class UserGrade(TimeStampedModel):
"""
A grade for a specific user and course run
"""
username = models.CharField(max_length=150, blank=False)
course_run = models.ForeignKey(CourseRun)
letter_grade = models.CharField(max_length=255, blank=True)
percent_grade = models.DecimalField(max_digits=5, decimal_places=4, null=False)
verified = models.BooleanField(verbose_name='Verified Learner ID', default=True)
class Meta(object):
unique_together = ('username', 'course_run')
class ProgramCertRecord(TimeStampedModel):
"""
Connects a User with a Program
"""
certificate = models.ForeignKey(ProgramCertificate, null=True)
program = models.ForeignKey(Program, null=True)
user = models.ForeignKey(User)
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
def __str__(self):
return 'ProgramCertificateRecord: {uuid}'.format(uuid=self.uuid)
class Meta(object):
verbose_name = "A viewable record of a program"
| import uuid
from django.db import models
from django_extensions.db.models import TimeStampedModel
from credentials.apps.catalog.models import CourseRun, Program
from credentials.apps.core.models import User
+ from credentials.apps.credentials.models import ProgramCertificate
class UserGrade(TimeStampedModel):
"""
A grade for a specific user and course run
"""
username = models.CharField(max_length=150, blank=False)
course_run = models.ForeignKey(CourseRun)
letter_grade = models.CharField(max_length=255, blank=True)
percent_grade = models.DecimalField(max_digits=5, decimal_places=4, null=False)
verified = models.BooleanField(verbose_name='Verified Learner ID', default=True)
class Meta(object):
unique_together = ('username', 'course_run')
class ProgramCertRecord(TimeStampedModel):
"""
Connects a User with a Program
"""
+ certificate = models.ForeignKey(ProgramCertificate, null=True)
program = models.ForeignKey(Program, null=True)
user = models.ForeignKey(User)
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
def __str__(self):
return 'ProgramCertificateRecord: {uuid}'.format(uuid=self.uuid)
class Meta(object):
verbose_name = "A viewable record of a program" | 2 | 0.055556 | 2 | 0 |
e70276079f7a0de76c67843acf252e354525dedd | pkgs/development/interpreters/acl2/default.nix | pkgs/development/interpreters/acl2/default.nix | a :
let
fetchurl = a.fetchurl;
version = a.lib.attrByPath ["version"] "v3-5" a;
buildInputs = with a; [
sbcl
];
in
rec {
src = fetchurl {
url = "http://www.cs.utexas.edu/users/moore/acl2/${version}/distrib/acl2.tar.gz";
sha256 = "0zmh1njpp7n7azcyjlygr0h0k51d18s1jkj0dr1jn2bh7mpysajk";
name = "acl2-${version}.tar.gz";
};
inherit buildInputs;
configureFlags = [];
/* doConfigure should be removed if not needed */
phaseNames = ["doDeploy" "doBuild"];
makeFlags = ["LISP='${a.sbcl}/bin/sbcl'"];
installSuffix = "acl2";
doDeploy = (a.simplyShare installSuffix);
doBuild = a.fullDepEntry (''
cd $out/share/${installSuffix}
make LISP=${a.sbcl}/bin/sbcl
make LISP=${a.sbcl}/bin/sbcl regression
ensureDir "$out/bin"
cp saved_acl2 "$out/bin/acl2"
'') ["doDeploy" "addInputs" "defEnsureDir"];
name = "acl2-" + version;
meta = {
description = "An interpreter and a prover for a Lisp dialect";
maintainers = [
];
};
}
| a :
let
fetchurl = a.fetchurl;
version = a.lib.attrByPath ["version"] "v3-5" a;
buildInputs = with a; [
sbcl
];
in
rec {
src = fetchurl {
url = "http://www.cs.utexas.edu/users/moore/acl2/${version}/distrib/acl2.tar.gz";
sha256 = "0zmh1njpp7n7azcyjlygr0h0k51d18s1jkj0dr1jn2bh7mpysajk";
name = "acl2-${version}.tar.gz";
};
inherit buildInputs;
configureFlags = [];
/* doConfigure should be removed if not needed */
phaseNames = ["doDeploy" "doBuild"];
makeFlags = ["LISP='${a.sbcl}/bin/sbcl'"];
installSuffix = "acl2";
doDeploy = (a.simplyShare installSuffix);
doBuild = a.fullDepEntry (''
cd $out/share/${installSuffix}
make LISP=${a.sbcl}/bin/sbcl
make LISP=${a.sbcl}/bin/sbcl regression
ensureDir "$out/bin"
cp saved_acl2 "$out/bin/acl2"
'') ["doDeploy" "addInputs" "defEnsureDir"];
name = "acl2-" + version;
meta = {
description = "An interpreter and a prover for a Lisp dialect";
maintainers = with a.lib.maintainers;
[
raskin
];
platforms = with a.lib.platforms;
linux;
};
}
| Add myself as a maintainer | Add myself as a maintainer
svn path=/nixpkgs/trunk/; revision=19594
| Nix | mit | NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,triton/triton,triton/triton,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
a :
let
fetchurl = a.fetchurl;
version = a.lib.attrByPath ["version"] "v3-5" a;
buildInputs = with a; [
sbcl
];
in
rec {
src = fetchurl {
url = "http://www.cs.utexas.edu/users/moore/acl2/${version}/distrib/acl2.tar.gz";
sha256 = "0zmh1njpp7n7azcyjlygr0h0k51d18s1jkj0dr1jn2bh7mpysajk";
name = "acl2-${version}.tar.gz";
};
inherit buildInputs;
configureFlags = [];
/* doConfigure should be removed if not needed */
phaseNames = ["doDeploy" "doBuild"];
makeFlags = ["LISP='${a.sbcl}/bin/sbcl'"];
installSuffix = "acl2";
doDeploy = (a.simplyShare installSuffix);
doBuild = a.fullDepEntry (''
cd $out/share/${installSuffix}
make LISP=${a.sbcl}/bin/sbcl
make LISP=${a.sbcl}/bin/sbcl regression
ensureDir "$out/bin"
cp saved_acl2 "$out/bin/acl2"
'') ["doDeploy" "addInputs" "defEnsureDir"];
name = "acl2-" + version;
meta = {
description = "An interpreter and a prover for a Lisp dialect";
maintainers = [
];
};
}
## Instruction:
Add myself as a maintainer
svn path=/nixpkgs/trunk/; revision=19594
## Code After:
a :
let
fetchurl = a.fetchurl;
version = a.lib.attrByPath ["version"] "v3-5" a;
buildInputs = with a; [
sbcl
];
in
rec {
src = fetchurl {
url = "http://www.cs.utexas.edu/users/moore/acl2/${version}/distrib/acl2.tar.gz";
sha256 = "0zmh1njpp7n7azcyjlygr0h0k51d18s1jkj0dr1jn2bh7mpysajk";
name = "acl2-${version}.tar.gz";
};
inherit buildInputs;
configureFlags = [];
/* doConfigure should be removed if not needed */
phaseNames = ["doDeploy" "doBuild"];
makeFlags = ["LISP='${a.sbcl}/bin/sbcl'"];
installSuffix = "acl2";
doDeploy = (a.simplyShare installSuffix);
doBuild = a.fullDepEntry (''
cd $out/share/${installSuffix}
make LISP=${a.sbcl}/bin/sbcl
make LISP=${a.sbcl}/bin/sbcl regression
ensureDir "$out/bin"
cp saved_acl2 "$out/bin/acl2"
'') ["doDeploy" "addInputs" "defEnsureDir"];
name = "acl2-" + version;
meta = {
description = "An interpreter and a prover for a Lisp dialect";
maintainers = with a.lib.maintainers;
[
raskin
];
platforms = with a.lib.platforms;
linux;
};
}
| a :
let
fetchurl = a.fetchurl;
version = a.lib.attrByPath ["version"] "v3-5" a;
buildInputs = with a; [
sbcl
];
in
rec {
src = fetchurl {
url = "http://www.cs.utexas.edu/users/moore/acl2/${version}/distrib/acl2.tar.gz";
sha256 = "0zmh1njpp7n7azcyjlygr0h0k51d18s1jkj0dr1jn2bh7mpysajk";
name = "acl2-${version}.tar.gz";
};
inherit buildInputs;
configureFlags = [];
/* doConfigure should be removed if not needed */
phaseNames = ["doDeploy" "doBuild"];
makeFlags = ["LISP='${a.sbcl}/bin/sbcl'"];
installSuffix = "acl2";
doDeploy = (a.simplyShare installSuffix);
doBuild = a.fullDepEntry (''
cd $out/share/${installSuffix}
make LISP=${a.sbcl}/bin/sbcl
make LISP=${a.sbcl}/bin/sbcl regression
ensureDir "$out/bin"
cp saved_acl2 "$out/bin/acl2"
'') ["doDeploy" "addInputs" "defEnsureDir"];
name = "acl2-" + version;
meta = {
description = "An interpreter and a prover for a Lisp dialect";
- maintainers = [
+ maintainers = with a.lib.maintainers;
+ [
+ raskin
];
+ platforms = with a.lib.platforms;
+ linux;
};
} | 6 | 0.146341 | 5 | 1 |
8deaa25bbca433f77d9b19d9b219fb0a32d026e8 | doc/help.md | doc/help.md | npm-help(1) -- Get help about npm commands
==========================================
## Usage
npm help <section>
Where <section> is one of:
* activate
* adduser
* config
* deactivate
* folders
* help (this page)
* install
* json
* link (or ln)
* list (or ls)
* publish
* registry
* tag
* uninstall (or rm)
* build
* npm
* scripts
* json
## Todo
It'd be nice if this page was automatically generated.
| npm-help(1) -- Get help about npm commands
==========================================
## Usage
npm help <section>
Where <section> is one of:
`npm`, `activate`, `adduser`, `config`, `deactivate`, `folders`, `help` (this
page), `install`, `json`, `link` (or `ln`), `list` (or `ls`), `publish`,
`registry`, `tag`, `uninstall` (or `rm`), `build`, `npm`, `scripts`, `json`
## Todo
It'd be nice if this page was automatically generated.
| Make the list a bit easier to look at | Make the list a bit easier to look at
| Markdown | artistic-2.0 | kimshinelove/naver-npm,evocateur/npm,kriskowal/npm,yodeyer/npm,kriskowal/npm,rsp/npm,kemitchell/npm,xalopp/npm,xalopp/npm,midniteio/npm,DIREKTSPEED-LTD/npm,ekmartin/npm,misterbyrne/npm,chadnickbok/npm,thomblake/npm,kemitchell/npm,haggholm/npm,rsp/npm,DIREKTSPEED-LTD/npm,lxe/npm,midniteio/npm,segment-boneyard/npm,kimshinelove/naver-npm,yibn2008/npm,princeofdarkness76/npm,midniteio/npm,yibn2008/npm,segrey/npm,segmentio/npm,evocateur/npm,chadnickbok/npm,DaveEmmerson/npm,segmentio/npm,cchamberlain/npm,TimeToogo/npm,evanlucas/npm,evanlucas/npm,segmentio/npm,cchamberlain/npm-msys2,cchamberlain/npm-msys2,misterbyrne/npm,Volune/npm,yodeyer/npm,kemitchell/npm,yyx990803/npm,ekmartin/npm,kriskowal/npm,cchamberlain/npm,thomblake/npm,DaveEmmerson/npm,evanlucas/npm,chadnickbok/npm,TimeToogo/npm,kimshinelove/naver-npm,DIREKTSPEED-LTD/npm,yodeyer/npm,thomblake/npm,lxe/npm,lxe/npm,misterbyrne/npm,segrey/npm,Volune/npm,yyx990803/npm,DaveEmmerson/npm,ekmartin/npm,cchamberlain/npm-msys2,segrey/npm,haggholm/npm,Volune/npm,princeofdarkness76/npm,haggholm/npm,princeofdarkness76/npm,segment-boneyard/npm,segment-boneyard/npm,TimeToogo/npm,cchamberlain/npm,yyx990803/npm,evocateur/npm,rsp/npm,xalopp/npm,yibn2008/npm | markdown | ## Code Before:
npm-help(1) -- Get help about npm commands
==========================================
## Usage
npm help <section>
Where <section> is one of:
* activate
* adduser
* config
* deactivate
* folders
* help (this page)
* install
* json
* link (or ln)
* list (or ls)
* publish
* registry
* tag
* uninstall (or rm)
* build
* npm
* scripts
* json
## Todo
It'd be nice if this page was automatically generated.
## Instruction:
Make the list a bit easier to look at
## Code After:
npm-help(1) -- Get help about npm commands
==========================================
## Usage
npm help <section>
Where <section> is one of:
`npm`, `activate`, `adduser`, `config`, `deactivate`, `folders`, `help` (this
page), `install`, `json`, `link` (or `ln`), `list` (or `ls`), `publish`,
`registry`, `tag`, `uninstall` (or `rm`), `build`, `npm`, `scripts`, `json`
## Todo
It'd be nice if this page was automatically generated.
| npm-help(1) -- Get help about npm commands
==========================================
## Usage
npm help <section>
- Where <section> is one of:
+ Where <section> is one of:
? ++
+ `npm`, `activate`, `adduser`, `config`, `deactivate`, `folders`, `help` (this
+ page), `install`, `json`, `link` (or `ln`), `list` (or `ls`), `publish`,
+ `registry`, `tag`, `uninstall` (or `rm`), `build`, `npm`, `scripts`, `json`
-
- * activate
- * adduser
- * config
- * deactivate
- * folders
- * help (this page)
- * install
- * json
- * link (or ln)
- * list (or ls)
- * publish
- * registry
- * tag
- * uninstall (or rm)
- * build
- * npm
- * scripts
- * json
## Todo
It'd be nice if this page was automatically generated. | 24 | 0.774194 | 4 | 20 |
c4bed22c1fde789776ebad65029d5d532a0f6350 | index.html | index.html | <!DOCTYPE html>
<html>
<head>
<title>stengaard.eu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="./assets/stengaard.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="welcome">
Don't panic!
</div>
<div class="footer">
<p>© 2015 - Brian Stengaard</p>
<p>Github: <a href="https://github.com/stengaard">@stengaard</a></p>
<p>Keybase: <a href="https://keybase.io/stengaard">@stengaard</a></p>
<p>Twitter: <a href="https://twitter.com/brianstengaard">@brianstengaard</a></p>
<p>Mail: <a href="mailto:brian+public-at-stengaard.eu">brian <at> stengaard.eu</a></p>
<p><a href="./cv">CV</a></p>
</div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>stengaard.eu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="go-import" content="stengaard.eu git github.com/stengaard"/>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="./assets/stengaard.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="welcome">
Don't panic!
</div>
<div class="footer">
<p>© 2015 - Brian Stengaard</p>
<p>Github: <a href="https://github.com/stengaard">@stengaard</a></p>
<p>Keybase: <a href="https://keybase.io/stengaard">@stengaard</a></p>
<p>Twitter: <a href="https://twitter.com/brianstengaard">@brianstengaard</a></p>
<p>Mail: <a href="mailto:brian+public-at-stengaard.eu">brian <at> stengaard.eu</a></p>
<p><a href="./cv">CV</a></p>
</div>
</body>
</html>
| Add go vanity imports for stengaard.eu | Add go vanity imports for stengaard.eu | HTML | mit | stengaard/stengaard.github.io | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>stengaard.eu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="./assets/stengaard.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="welcome">
Don't panic!
</div>
<div class="footer">
<p>© 2015 - Brian Stengaard</p>
<p>Github: <a href="https://github.com/stengaard">@stengaard</a></p>
<p>Keybase: <a href="https://keybase.io/stengaard">@stengaard</a></p>
<p>Twitter: <a href="https://twitter.com/brianstengaard">@brianstengaard</a></p>
<p>Mail: <a href="mailto:brian+public-at-stengaard.eu">brian <at> stengaard.eu</a></p>
<p><a href="./cv">CV</a></p>
</div>
</body>
</html>
## Instruction:
Add go vanity imports for stengaard.eu
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>stengaard.eu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="go-import" content="stengaard.eu git github.com/stengaard"/>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="./assets/stengaard.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="welcome">
Don't panic!
</div>
<div class="footer">
<p>© 2015 - Brian Stengaard</p>
<p>Github: <a href="https://github.com/stengaard">@stengaard</a></p>
<p>Keybase: <a href="https://keybase.io/stengaard">@stengaard</a></p>
<p>Twitter: <a href="https://twitter.com/brianstengaard">@brianstengaard</a></p>
<p>Mail: <a href="mailto:brian+public-at-stengaard.eu">brian <at> stengaard.eu</a></p>
<p><a href="./cv">CV</a></p>
</div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>stengaard.eu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="go-import" content="stengaard.eu git github.com/stengaard"/>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="./assets/stengaard.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="welcome">
Don't panic!
</div>
<div class="footer">
<p>© 2015 - Brian Stengaard</p>
<p>Github: <a href="https://github.com/stengaard">@stengaard</a></p>
<p>Keybase: <a href="https://keybase.io/stengaard">@stengaard</a></p>
<p>Twitter: <a href="https://twitter.com/brianstengaard">@brianstengaard</a></p>
<p>Mail: <a href="mailto:brian+public-at-stengaard.eu">brian <at> stengaard.eu</a></p>
<p><a href="./cv">CV</a></p>
</div>
</body>
</html> | 1 | 0.045455 | 1 | 0 |
122812ff78876fdefec362020cee8d03e810c22b | src/main/resources/templates/email/restorePassword.html | src/main/resources/templates/email/restorePassword.html | <!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>DS Bursa Jagiellońska</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
* {
font-family: Ubuntu;
}
</style>
</head>
<body>
<h1>Resetowanie hasła www.bj-pranie.pl</h1>
<h2>Witaj <span th:text="${name}"/>!</h2>
<span>
Aby zresetować hasło kliknij w link: <b>https://bj-pranie.pl/user/resetPassword?resetPasswordKey=<span th:text="${resetPasswordKey}"/></b>
</span>
<br/>
<br/>
<span>
Jeżeli nie resetowałeś hasła to zignoruj tą wiadomość!
</span>
</body>
</html> | <!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>DS Bursa Jagiellońska</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
* {
font-family: Ubuntu;
}
</style>
</head>
<body>
<h1>Resetowanie hasła www.bj-pranie.pl</h1>
<h2>Witaj <span th:text="${name}"/>!</h2>
<span>
Aby zresetować hasło kliknij <a th:href="@{'https://bj-pranie.pl/user/resetPassword?resetPasswordKey=' + ${resetPasswordKey}}">tutaj</a>.
</span>
<br/>
<br/>
<span>
Jeżeli nie resetowałeś hasła to zignoruj tą wiadomość!
</span>
</body>
</html> | Improve reset password email template. | Improve reset password email template.
| HTML | apache-2.0 | sebastiansokolowski/ReservationSystem-BJ,sebastiansokolowski/ReservationSystem-BJ | html | ## Code Before:
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>DS Bursa Jagiellońska</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
* {
font-family: Ubuntu;
}
</style>
</head>
<body>
<h1>Resetowanie hasła www.bj-pranie.pl</h1>
<h2>Witaj <span th:text="${name}"/>!</h2>
<span>
Aby zresetować hasło kliknij w link: <b>https://bj-pranie.pl/user/resetPassword?resetPasswordKey=<span th:text="${resetPasswordKey}"/></b>
</span>
<br/>
<br/>
<span>
Jeżeli nie resetowałeś hasła to zignoruj tą wiadomość!
</span>
</body>
</html>
## Instruction:
Improve reset password email template.
## Code After:
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>DS Bursa Jagiellońska</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
* {
font-family: Ubuntu;
}
</style>
</head>
<body>
<h1>Resetowanie hasła www.bj-pranie.pl</h1>
<h2>Witaj <span th:text="${name}"/>!</h2>
<span>
Aby zresetować hasło kliknij <a th:href="@{'https://bj-pranie.pl/user/resetPassword?resetPasswordKey=' + ${resetPasswordKey}}">tutaj</a>.
</span>
<br/>
<br/>
<span>
Jeżeli nie resetowałeś hasła to zignoruj tą wiadomość!
</span>
</body>
</html> | <!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>DS Bursa Jagiellońska</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
* {
font-family: Ubuntu;
}
</style>
</head>
<body>
<h1>Resetowanie hasła www.bj-pranie.pl</h1>
<h2>Witaj <span th:text="${name}"/>!</h2>
<span>
- Aby zresetować hasło kliknij w link: <b>https://bj-pranie.pl/user/resetPassword?resetPasswordKey=<span th:text="${resetPasswordKey}"/></b>
? ^ ^^^^ ^^^^ ^^^^^ ^^^^^^^^^ - ^
+ Aby zresetować hasło kliknij <a th:href="@{'https://bj-pranie.pl/user/resetPassword?resetPasswordKey=' + ${resetPasswordKey}}">tutaj</a>.
? ^^ ^^ ^^^^^^^^^ ^ ^^ + +++++ ^ +
</span>
<br/>
<br/>
<span>
Jeżeli nie resetowałeś hasła to zignoruj tą wiadomość!
</span>
</body>
</html> | 2 | 0.083333 | 1 | 1 |
b62469ee1103dd69986570ec314be4c2473639ca | src/app/utils/AffiliationMap.js | src/app/utils/AffiliationMap.js | const map = {
//steemit
ned: 'steemit',
justinw: 'steemit',
elipowell: 'steemit',
vandeberg: 'steemit',
birdinc: 'steemit',
gerbino: 'steemit',
andrarchy: 'steemit',
roadscape: 'steemit',
steemitblog: 'steemit',
steemitdev: 'steemit',
/*
//steem monsters
steemmonsters: 'sm',
'steem.monsters': 'sm',
aggroed: 'sm',
yabapmatt: 'sm',
*/
};
export default map;
| const map = {
//steemit
ned: 'steemit',
justinw: 'steemit',
elipowell: 'steemit',
vandeberg: 'steemit',
gerbino: 'steemit',
andrarchy: 'steemit',
roadscape: 'steemit',
steemitblog: 'steemit',
steemitdev: 'steemit',
/*
//steem monsters
steemmonsters: 'sm',
'steem.monsters': 'sm',
aggroed: 'sm',
yabapmatt: 'sm',
*/
};
export default map;
| Remove birdinc from team list | Remove birdinc from team list | JavaScript | mit | steemit/steemit.com,steemit/steemit.com,TimCliff/steemit.com,TimCliff/steemit.com,TimCliff/steemit.com,steemit/steemit.com | javascript | ## Code Before:
const map = {
//steemit
ned: 'steemit',
justinw: 'steemit',
elipowell: 'steemit',
vandeberg: 'steemit',
birdinc: 'steemit',
gerbino: 'steemit',
andrarchy: 'steemit',
roadscape: 'steemit',
steemitblog: 'steemit',
steemitdev: 'steemit',
/*
//steem monsters
steemmonsters: 'sm',
'steem.monsters': 'sm',
aggroed: 'sm',
yabapmatt: 'sm',
*/
};
export default map;
## Instruction:
Remove birdinc from team list
## Code After:
const map = {
//steemit
ned: 'steemit',
justinw: 'steemit',
elipowell: 'steemit',
vandeberg: 'steemit',
gerbino: 'steemit',
andrarchy: 'steemit',
roadscape: 'steemit',
steemitblog: 'steemit',
steemitdev: 'steemit',
/*
//steem monsters
steemmonsters: 'sm',
'steem.monsters': 'sm',
aggroed: 'sm',
yabapmatt: 'sm',
*/
};
export default map;
| const map = {
//steemit
ned: 'steemit',
justinw: 'steemit',
elipowell: 'steemit',
vandeberg: 'steemit',
- birdinc: 'steemit',
gerbino: 'steemit',
andrarchy: 'steemit',
roadscape: 'steemit',
steemitblog: 'steemit',
steemitdev: 'steemit',
/*
//steem monsters
steemmonsters: 'sm',
'steem.monsters': 'sm',
aggroed: 'sm',
yabapmatt: 'sm',
*/
};
export default map; | 1 | 0.043478 | 0 | 1 |
72e1134073ac0ed786596399087f5170aeab284f | app/js/filters.js | app/js/filters.js | 'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
}
}])
.filter('mapUrl', function() {
return function(e) {
var str = "";
for (var i=0;i<e.length;i++) {
str += typeof e[i].name === 'undefined' ||
e[i].name.localeCompare('') === 0 ?
e[i].latitude + ',' + e[i].longitude + '%7C' :
e[i].name + '%7C';
}
return str;
};
});
| 'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
}
}])
.filter('mapUrl', function() {
return function(e) {
var str = "";
for (var i=0;i<e.length;i++) {
str += typeof e[i].name === 'undefined' ||
e[i].name.localeCompare('') === 0 ?
e[i].latitude + ',' + e[i].longitude + '%7C' :
e[i].name + '%7C';
}
str = str.replace(/ /g, '%20C');
console.log(str);
return str.replace(/%7C$/, '');
};
});
| Improve mapUrl filter. Replace whitespace with %20C. | Improve mapUrl filter. Replace whitespace with %20C.
| JavaScript | mit | paulmatthews/magic-map,paulmatthews/magic-map,paulmatthews/magic-map | javascript | ## Code Before:
'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
}
}])
.filter('mapUrl', function() {
return function(e) {
var str = "";
for (var i=0;i<e.length;i++) {
str += typeof e[i].name === 'undefined' ||
e[i].name.localeCompare('') === 0 ?
e[i].latitude + ',' + e[i].longitude + '%7C' :
e[i].name + '%7C';
}
return str;
};
});
## Instruction:
Improve mapUrl filter. Replace whitespace with %20C.
## Code After:
'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
}
}])
.filter('mapUrl', function() {
return function(e) {
var str = "";
for (var i=0;i<e.length;i++) {
str += typeof e[i].name === 'undefined' ||
e[i].name.localeCompare('') === 0 ?
e[i].latitude + ',' + e[i].longitude + '%7C' :
e[i].name + '%7C';
}
str = str.replace(/ /g, '%20C');
console.log(str);
return str.replace(/%7C$/, '');
};
});
| 'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
}
}])
.filter('mapUrl', function() {
return function(e) {
var str = "";
for (var i=0;i<e.length;i++) {
str += typeof e[i].name === 'undefined' ||
e[i].name.localeCompare('') === 0 ?
e[i].latitude + ',' + e[i].longitude + '%7C' :
e[i].name + '%7C';
}
- return str;
+ str = str.replace(/ /g, '%20C');
+ console.log(str);
+ return str.replace(/%7C$/, '');
};
}); | 4 | 0.181818 | 3 | 1 |
0a2475655fc8f11a848b7a2c948a9bffad1c4c91 | src/browser/shared/workspace.service.ts | src/browser/shared/workspace.service.ts | import { Inject, Injectable, InjectionToken, OnDestroy, Optional } from '@angular/core';
import { from, Observable } from 'rxjs';
import { GEEKS_DIARY_DIR_PATH, NOTES_DIR_PATH, WORKSPACE_DIR_PATH } from '../../core/workspace';
import { IpcActionClient } from '../../libs/ipc';
export class WorkspaceConfig {
rootDirPath?: string = WORKSPACE_DIR_PATH;
geeksDiaryDirPath?: string = GEEKS_DIARY_DIR_PATH;
notesDirPath?: string = NOTES_DIR_PATH;
}
export const WORKSPACE_DEFAULT_CONFIG = new InjectionToken<WorkspaceConfig>('WorkspaceConfig');
@Injectable()
export class WorkspaceService implements OnDestroy {
readonly configs: WorkspaceConfig;
private ipcClient = new IpcActionClient('workspace');
constructor(
@Optional() @Inject(WORKSPACE_DEFAULT_CONFIG) config: WorkspaceConfig,
) {
this.configs = {
...(new WorkspaceConfig()),
...config,
};
}
ngOnDestroy(): void {
this.ipcClient.destroy();
}
initWorkspace(): Observable<void> {
return from(this.ipcClient.performAction('initWorkspace'));
}
}
| import { Inject, Injectable, InjectionToken, OnDestroy, Optional } from '@angular/core';
import { from, Observable } from 'rxjs';
import { ASSETS_DIR_PATH, GEEKS_DIARY_DIR_PATH, NOTES_DIR_PATH, WORKSPACE_DIR_PATH } from '../../core/workspace';
import { IpcActionClient } from '../../libs/ipc';
export class WorkspaceConfig {
rootDirPath?: string = WORKSPACE_DIR_PATH;
geeksDiaryDirPath?: string = GEEKS_DIARY_DIR_PATH;
notesDirPath?: string = NOTES_DIR_PATH;
assetsDirPath?: string = ASSETS_DIR_PATH;
}
export const WORKSPACE_DEFAULT_CONFIG = new InjectionToken<WorkspaceConfig>('WorkspaceConfig');
@Injectable()
export class WorkspaceService implements OnDestroy {
readonly configs: WorkspaceConfig;
private ipcClient = new IpcActionClient('workspace');
constructor(
@Optional() @Inject(WORKSPACE_DEFAULT_CONFIG) config: WorkspaceConfig,
) {
this.configs = {
...(new WorkspaceConfig()),
...config,
};
}
ngOnDestroy(): void {
this.ipcClient.destroy();
}
initWorkspace(): Observable<void> {
return from(this.ipcClient.performAction('initWorkspace'));
}
}
| Add assets directory path config option | Add assets directory path config option
| TypeScript | mit | seokju-na/geeks-diary,seokju-na/geeks-diary,seokju-na/geeks-diary | typescript | ## Code Before:
import { Inject, Injectable, InjectionToken, OnDestroy, Optional } from '@angular/core';
import { from, Observable } from 'rxjs';
import { GEEKS_DIARY_DIR_PATH, NOTES_DIR_PATH, WORKSPACE_DIR_PATH } from '../../core/workspace';
import { IpcActionClient } from '../../libs/ipc';
export class WorkspaceConfig {
rootDirPath?: string = WORKSPACE_DIR_PATH;
geeksDiaryDirPath?: string = GEEKS_DIARY_DIR_PATH;
notesDirPath?: string = NOTES_DIR_PATH;
}
export const WORKSPACE_DEFAULT_CONFIG = new InjectionToken<WorkspaceConfig>('WorkspaceConfig');
@Injectable()
export class WorkspaceService implements OnDestroy {
readonly configs: WorkspaceConfig;
private ipcClient = new IpcActionClient('workspace');
constructor(
@Optional() @Inject(WORKSPACE_DEFAULT_CONFIG) config: WorkspaceConfig,
) {
this.configs = {
...(new WorkspaceConfig()),
...config,
};
}
ngOnDestroy(): void {
this.ipcClient.destroy();
}
initWorkspace(): Observable<void> {
return from(this.ipcClient.performAction('initWorkspace'));
}
}
## Instruction:
Add assets directory path config option
## Code After:
import { Inject, Injectable, InjectionToken, OnDestroy, Optional } from '@angular/core';
import { from, Observable } from 'rxjs';
import { ASSETS_DIR_PATH, GEEKS_DIARY_DIR_PATH, NOTES_DIR_PATH, WORKSPACE_DIR_PATH } from '../../core/workspace';
import { IpcActionClient } from '../../libs/ipc';
export class WorkspaceConfig {
rootDirPath?: string = WORKSPACE_DIR_PATH;
geeksDiaryDirPath?: string = GEEKS_DIARY_DIR_PATH;
notesDirPath?: string = NOTES_DIR_PATH;
assetsDirPath?: string = ASSETS_DIR_PATH;
}
export const WORKSPACE_DEFAULT_CONFIG = new InjectionToken<WorkspaceConfig>('WorkspaceConfig');
@Injectable()
export class WorkspaceService implements OnDestroy {
readonly configs: WorkspaceConfig;
private ipcClient = new IpcActionClient('workspace');
constructor(
@Optional() @Inject(WORKSPACE_DEFAULT_CONFIG) config: WorkspaceConfig,
) {
this.configs = {
...(new WorkspaceConfig()),
...config,
};
}
ngOnDestroy(): void {
this.ipcClient.destroy();
}
initWorkspace(): Observable<void> {
return from(this.ipcClient.performAction('initWorkspace'));
}
}
| import { Inject, Injectable, InjectionToken, OnDestroy, Optional } from '@angular/core';
import { from, Observable } from 'rxjs';
- import { GEEKS_DIARY_DIR_PATH, NOTES_DIR_PATH, WORKSPACE_DIR_PATH } from '../../core/workspace';
+ import { ASSETS_DIR_PATH, GEEKS_DIARY_DIR_PATH, NOTES_DIR_PATH, WORKSPACE_DIR_PATH } from '../../core/workspace';
? +++++++++++++++++
import { IpcActionClient } from '../../libs/ipc';
export class WorkspaceConfig {
rootDirPath?: string = WORKSPACE_DIR_PATH;
geeksDiaryDirPath?: string = GEEKS_DIARY_DIR_PATH;
notesDirPath?: string = NOTES_DIR_PATH;
+ assetsDirPath?: string = ASSETS_DIR_PATH;
}
export const WORKSPACE_DEFAULT_CONFIG = new InjectionToken<WorkspaceConfig>('WorkspaceConfig');
@Injectable()
export class WorkspaceService implements OnDestroy {
readonly configs: WorkspaceConfig;
private ipcClient = new IpcActionClient('workspace');
constructor(
@Optional() @Inject(WORKSPACE_DEFAULT_CONFIG) config: WorkspaceConfig,
) {
this.configs = {
...(new WorkspaceConfig()),
...config,
};
}
ngOnDestroy(): void {
this.ipcClient.destroy();
}
initWorkspace(): Observable<void> {
return from(this.ipcClient.performAction('initWorkspace'));
}
} | 3 | 0.076923 | 2 | 1 |
73e4789517c8de480d1b5e8c05f3dbe9b31883e5 | bouncer/embed_detector.py | bouncer/embed_detector.py | import re
from urllib.parse import urlparse
"""
Hardcoded URL patterns where client is assumed to be embedded.
Only the hostname and path are included in the pattern. The path must be
specified.
These are regular expressions so periods must be escaped.
"""
PATTERNS = [
"h\.readthedocs\.io/.*",
"web\.hypothes\.is/blog/.*",
]
COMPILED_PATTERNS = [re.compile(pat) for pat in PATTERNS]
def url_embeds_client(url):
"""
Test whether ``url`` is known to embed the client.
This currently just tests the URL against the hardcoded regex list
``PATTERNS``.
Only the hostname and path of the URL are tested. Returns false for non-HTTP
URLs.
:return: True if the URL matches a pattern.
"""
parsed_url = urlparse(url)
if not parsed_url.scheme.startswith("http"):
return False
path = parsed_url.path
if not path:
path = "/"
netloc_and_path = parsed_url.netloc + path
for pat in COMPILED_PATTERNS:
if pat.fullmatch(netloc_and_path):
return True
return False
| import fnmatch
import re
from urllib.parse import urlparse
# Hardcoded URL patterns where client is assumed to be embedded.
#
# Only the hostname and path are included in the pattern. The path must be
# specified; use "example.com/*" to match all URLs on a particular domain.
#
# Patterns are shell-style wildcards ('*' matches any number of chars, '?'
# matches a single char).
PATTERNS = [
"h.readthedocs.io/*",
"web.hypothes.is/blog/*",
]
COMPILED_PATTERNS = [re.compile(fnmatch.translate(pat)) for pat in PATTERNS]
def url_embeds_client(url):
"""
Test whether ``url`` is known to embed the client.
This currently just tests the URL against the pattern list ``PATTERNS``.
Only the hostname and path of the URL are tested. Returns false for non-HTTP
URLs.
:return: True if the URL matches a pattern.
"""
parsed_url = urlparse(url)
if not parsed_url.scheme.startswith("http"):
return False
path = parsed_url.path
if not path:
path = "/"
netloc_and_path = parsed_url.netloc + path
for pat in COMPILED_PATTERNS:
if pat.fullmatch(netloc_and_path):
return True
return False
| Use fnmatch patterns instead of regexes for URL patterns | Use fnmatch patterns instead of regexes for URL patterns
fnmatch patterns have enough flexibility for this use case and this avoids the
need to remember to escape periods, which is easy to forget otherwise. The
resulting patterns are also easier to read.
| Python | bsd-2-clause | hypothesis/bouncer,hypothesis/bouncer,hypothesis/bouncer | python | ## Code Before:
import re
from urllib.parse import urlparse
"""
Hardcoded URL patterns where client is assumed to be embedded.
Only the hostname and path are included in the pattern. The path must be
specified.
These are regular expressions so periods must be escaped.
"""
PATTERNS = [
"h\.readthedocs\.io/.*",
"web\.hypothes\.is/blog/.*",
]
COMPILED_PATTERNS = [re.compile(pat) for pat in PATTERNS]
def url_embeds_client(url):
"""
Test whether ``url`` is known to embed the client.
This currently just tests the URL against the hardcoded regex list
``PATTERNS``.
Only the hostname and path of the URL are tested. Returns false for non-HTTP
URLs.
:return: True if the URL matches a pattern.
"""
parsed_url = urlparse(url)
if not parsed_url.scheme.startswith("http"):
return False
path = parsed_url.path
if not path:
path = "/"
netloc_and_path = parsed_url.netloc + path
for pat in COMPILED_PATTERNS:
if pat.fullmatch(netloc_and_path):
return True
return False
## Instruction:
Use fnmatch patterns instead of regexes for URL patterns
fnmatch patterns have enough flexibility for this use case and this avoids the
need to remember to escape periods, which is easy to forget otherwise. The
resulting patterns are also easier to read.
## Code After:
import fnmatch
import re
from urllib.parse import urlparse
# Hardcoded URL patterns where client is assumed to be embedded.
#
# Only the hostname and path are included in the pattern. The path must be
# specified; use "example.com/*" to match all URLs on a particular domain.
#
# Patterns are shell-style wildcards ('*' matches any number of chars, '?'
# matches a single char).
PATTERNS = [
"h.readthedocs.io/*",
"web.hypothes.is/blog/*",
]
COMPILED_PATTERNS = [re.compile(fnmatch.translate(pat)) for pat in PATTERNS]
def url_embeds_client(url):
"""
Test whether ``url`` is known to embed the client.
This currently just tests the URL against the pattern list ``PATTERNS``.
Only the hostname and path of the URL are tested. Returns false for non-HTTP
URLs.
:return: True if the URL matches a pattern.
"""
parsed_url = urlparse(url)
if not parsed_url.scheme.startswith("http"):
return False
path = parsed_url.path
if not path:
path = "/"
netloc_and_path = parsed_url.netloc + path
for pat in COMPILED_PATTERNS:
if pat.fullmatch(netloc_and_path):
return True
return False
| + import fnmatch
import re
from urllib.parse import urlparse
- """
- Hardcoded URL patterns where client is assumed to be embedded.
+ # Hardcoded URL patterns where client is assumed to be embedded.
? ++
-
+ #
- Only the hostname and path are included in the pattern. The path must be
+ # Only the hostname and path are included in the pattern. The path must be
? ++
- specified.
-
- These are regular expressions so periods must be escaped.
- """
+ # specified; use "example.com/*" to match all URLs on a particular domain.
+ #
+ # Patterns are shell-style wildcards ('*' matches any number of chars, '?'
+ # matches a single char).
PATTERNS = [
- "h\.readthedocs\.io/.*",
? - - -
+ "h.readthedocs.io/*",
- "web\.hypothes\.is/blog/.*",
? - - -
+ "web.hypothes.is/blog/*",
]
- COMPILED_PATTERNS = [re.compile(pat) for pat in PATTERNS]
+ COMPILED_PATTERNS = [re.compile(fnmatch.translate(pat)) for pat in PATTERNS]
? ++++++++++++++++++ +
def url_embeds_client(url):
"""
Test whether ``url`` is known to embed the client.
- This currently just tests the URL against the hardcoded regex list
? ^ ^^^^^^^^^^^^
+ This currently just tests the URL against the pattern list ``PATTERNS``.
? ^ +++ ^ ++++++++++++++
- ``PATTERNS``.
Only the hostname and path of the URL are tested. Returns false for non-HTTP
URLs.
:return: True if the URL matches a pattern.
"""
parsed_url = urlparse(url)
if not parsed_url.scheme.startswith("http"):
return False
path = parsed_url.path
if not path:
path = "/"
netloc_and_path = parsed_url.netloc + path
for pat in COMPILED_PATTERNS:
if pat.fullmatch(netloc_and_path):
return True
return False | 25 | 0.568182 | 12 | 13 |
10053e3eae222e2c986d7c38afe37192cf9b7f1d | .travis.yml | .travis.yml | language: node_js
node_js:
- "0.12"
sudo: false
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
env:
global:
- secure: lcTx+1dtANTsN6RROKjT0G9Ih8FDxJ4pQm2JaF9ck0bgfPHufa2lDJiSHtOJag4etTe6H4N7UcUsgThfwzVzUe5TbNjTSo+c7Y2BPxlrKiJg0MTyKoQKRo3wcwVTfnTydEfpq4VJmgVZG4W8/eyZwNNYc2yq5K2kVp9GhhrcTBo=
- secure: d4wWqDoImfQr+VgliuCJo4hEUWXpfZmLI3M4X7TRnKomnQ4B/EQ1okod4+DA8bRxLcGn+3B8ybtu8im4N2rZylWPAPxIOZEABx5i2TngzpRwvPUtyv+4cRqRm2IcYjpAUVbdDYpFnUG4rMv1KxcHDeTUrmhAYH7oF2f4dq02RWw=
| language: node_js
node_js:
- "0.12"
sudo: false
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
env:
global:
- secure: kaCBpZAHLEZIMXzEKFH0u/kMpairsLbNoRObcenRHUzMRxSq02wMbCEEWoufEyRhBaJswORVKn1T/s1Giy1s5UDoRRBD7+xocdiDxYSw7nWEDbaXDzs8XoOnvxA6ouBHBfKhDea5g4SUnwrTW5lBee2ezZweYL2BAQ1R7uwYM4Q=
- secure: BF5K2Yg6p1R6U/q1cytSRPu+I28EOFXpyPJiT+Hu+IHphcX5ikNWD1sdwAZzonLvFHXMTiFyVXgauYBfw1YyIpnIvwOlP0xQf2zRTI4pIBT+RduuG7s247ByX7I2h34lgFPYZuNWqH145b7C6lH9tFgWkPGHfirKNQbCqSPPWjA=
| Use uncompromised SauceLabs key (2nd attempt) | Use uncompromised SauceLabs key (2nd attempt)
| YAML | mit | BladeRunnerJS/emitr | yaml | ## Code Before:
language: node_js
node_js:
- "0.12"
sudo: false
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
env:
global:
- secure: lcTx+1dtANTsN6RROKjT0G9Ih8FDxJ4pQm2JaF9ck0bgfPHufa2lDJiSHtOJag4etTe6H4N7UcUsgThfwzVzUe5TbNjTSo+c7Y2BPxlrKiJg0MTyKoQKRo3wcwVTfnTydEfpq4VJmgVZG4W8/eyZwNNYc2yq5K2kVp9GhhrcTBo=
- secure: d4wWqDoImfQr+VgliuCJo4hEUWXpfZmLI3M4X7TRnKomnQ4B/EQ1okod4+DA8bRxLcGn+3B8ybtu8im4N2rZylWPAPxIOZEABx5i2TngzpRwvPUtyv+4cRqRm2IcYjpAUVbdDYpFnUG4rMv1KxcHDeTUrmhAYH7oF2f4dq02RWw=
## Instruction:
Use uncompromised SauceLabs key (2nd attempt)
## Code After:
language: node_js
node_js:
- "0.12"
sudo: false
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
env:
global:
- secure: kaCBpZAHLEZIMXzEKFH0u/kMpairsLbNoRObcenRHUzMRxSq02wMbCEEWoufEyRhBaJswORVKn1T/s1Giy1s5UDoRRBD7+xocdiDxYSw7nWEDbaXDzs8XoOnvxA6ouBHBfKhDea5g4SUnwrTW5lBee2ezZweYL2BAQ1R7uwYM4Q=
- secure: BF5K2Yg6p1R6U/q1cytSRPu+I28EOFXpyPJiT+Hu+IHphcX5ikNWD1sdwAZzonLvFHXMTiFyVXgauYBfw1YyIpnIvwOlP0xQf2zRTI4pIBT+RduuG7s247ByX7I2h34lgFPYZuNWqH145b7C6lH9tFgWkPGHfirKNQbCqSPPWjA=
| language: node_js
node_js:
- "0.12"
sudo: false
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
env:
global:
- - secure: lcTx+1dtANTsN6RROKjT0G9Ih8FDxJ4pQm2JaF9ck0bgfPHufa2lDJiSHtOJag4etTe6H4N7UcUsgThfwzVzUe5TbNjTSo+c7Y2BPxlrKiJg0MTyKoQKRo3wcwVTfnTydEfpq4VJmgVZG4W8/eyZwNNYc2yq5K2kVp9GhhrcTBo=
- - secure: d4wWqDoImfQr+VgliuCJo4hEUWXpfZmLI3M4X7TRnKomnQ4B/EQ1okod4+DA8bRxLcGn+3B8ybtu8im4N2rZylWPAPxIOZEABx5i2TngzpRwvPUtyv+4cRqRm2IcYjpAUVbdDYpFnUG4rMv1KxcHDeTUrmhAYH7oF2f4dq02RWw=
+ - secure: kaCBpZAHLEZIMXzEKFH0u/kMpairsLbNoRObcenRHUzMRxSq02wMbCEEWoufEyRhBaJswORVKn1T/s1Giy1s5UDoRRBD7+xocdiDxYSw7nWEDbaXDzs8XoOnvxA6ouBHBfKhDea5g4SUnwrTW5lBee2ezZweYL2BAQ1R7uwYM4Q=
+ - secure: BF5K2Yg6p1R6U/q1cytSRPu+I28EOFXpyPJiT+Hu+IHphcX5ikNWD1sdwAZzonLvFHXMTiFyVXgauYBfw1YyIpnIvwOlP0xQf2zRTI4pIBT+RduuG7s247ByX7I2h34lgFPYZuNWqH145b7C6lH9tFgWkPGHfirKNQbCqSPPWjA= | 4 | 0.363636 | 2 | 2 |
fd791ad4b935d210539358d549e3a825d853f9c5 | test/web/alltests/AllTests.java | test/web/alltests/AllTests.java | package web.alltests;
import web.*;
import web.allwebtests.*;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* @author pandyas
*/
public class AllTests extends TestCase {
public AllTests(String arg0) {
super(arg0);
}
public static Test suite()
{
TestSuite suite = new TestSuite();
// Submission tests
//suite.addTest(AllSearchTests.suite());
//suite.addTest(AllSubmissionTests.suite());
suite.addTest(SearchPopulateCellLinesTest.suite());
suite.addTest(SearchPopulateCITest.suite());
suite.addTest(SearchPopulateGeneticDescriptionTest.suite());
suite.addTest(SearchPopulateHistopathologyTest.suite());
suite.addTest(SearchPopulateModelCharacteristicsTest.suite());
suite.addTest(SearchPopulatePublicationTest.suite());
suite.addTest(SearchPopulateTherapyTest.suite());
suite.addTest(SearchPopulateTransIntTest.suite());
suite.addTest(SearchPopulateXenograftTest.suite());
return suite;
}
public static void main(String args[])
{
TestRunner.run(suite());
}
}
| package web.alltests;
import web.*;
import web.allwebtests.*;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* @author pandyas
*/
public class AllTests extends TestCase {
public AllTests(String arg0) {
super(arg0);
}
public static Test suite()
{
TestSuite suite = new TestSuite();
// Submission tests
//suite.addTest(AllSearchTests.suite());
//suite.addTest(AllSubmissionTests.suite());
//suite.addTest(SearchPopulateCellLinesTest.suite());
//suite.addTest(SearchPopulateCITest.suite());
//suite.addTest(SearchPopulateGeneticDescriptionTest.suite());
//suite.addTest(SearchPopulateHistopathologyTest.suite());
//suite.addTest(SearchPopulateModelCharacteristicsTest.suite());
//suite.addTest(SearchPopulatePublicationTest.suite());
//suite.addTest(SearchPopulateTherapyTest.suite());
//suite.addTest(SearchPopulateTransIntTest.suite());
//suite.addTest(SearchPopulateXenograftTest.suite());
return suite;
}
public static void main(String args[])
{
TestRunner.run(suite());
}
}
| Comment out tests unitil we get them to work with SSL | Comment out tests unitil we get them to work with SSL
SVN-Revision: 2967
| Java | bsd-3-clause | NCIP/camod,NCIP/camod,NCIP/camod,NCIP/camod | java | ## Code Before:
package web.alltests;
import web.*;
import web.allwebtests.*;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* @author pandyas
*/
public class AllTests extends TestCase {
public AllTests(String arg0) {
super(arg0);
}
public static Test suite()
{
TestSuite suite = new TestSuite();
// Submission tests
//suite.addTest(AllSearchTests.suite());
//suite.addTest(AllSubmissionTests.suite());
suite.addTest(SearchPopulateCellLinesTest.suite());
suite.addTest(SearchPopulateCITest.suite());
suite.addTest(SearchPopulateGeneticDescriptionTest.suite());
suite.addTest(SearchPopulateHistopathologyTest.suite());
suite.addTest(SearchPopulateModelCharacteristicsTest.suite());
suite.addTest(SearchPopulatePublicationTest.suite());
suite.addTest(SearchPopulateTherapyTest.suite());
suite.addTest(SearchPopulateTransIntTest.suite());
suite.addTest(SearchPopulateXenograftTest.suite());
return suite;
}
public static void main(String args[])
{
TestRunner.run(suite());
}
}
## Instruction:
Comment out tests unitil we get them to work with SSL
SVN-Revision: 2967
## Code After:
package web.alltests;
import web.*;
import web.allwebtests.*;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* @author pandyas
*/
public class AllTests extends TestCase {
public AllTests(String arg0) {
super(arg0);
}
public static Test suite()
{
TestSuite suite = new TestSuite();
// Submission tests
//suite.addTest(AllSearchTests.suite());
//suite.addTest(AllSubmissionTests.suite());
//suite.addTest(SearchPopulateCellLinesTest.suite());
//suite.addTest(SearchPopulateCITest.suite());
//suite.addTest(SearchPopulateGeneticDescriptionTest.suite());
//suite.addTest(SearchPopulateHistopathologyTest.suite());
//suite.addTest(SearchPopulateModelCharacteristicsTest.suite());
//suite.addTest(SearchPopulatePublicationTest.suite());
//suite.addTest(SearchPopulateTherapyTest.suite());
//suite.addTest(SearchPopulateTransIntTest.suite());
//suite.addTest(SearchPopulateXenograftTest.suite());
return suite;
}
public static void main(String args[])
{
TestRunner.run(suite());
}
}
| package web.alltests;
import web.*;
import web.allwebtests.*;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* @author pandyas
*/
public class AllTests extends TestCase {
public AllTests(String arg0) {
super(arg0);
}
public static Test suite()
{
TestSuite suite = new TestSuite();
// Submission tests
//suite.addTest(AllSearchTests.suite());
//suite.addTest(AllSubmissionTests.suite());
- suite.addTest(SearchPopulateCellLinesTest.suite());
+ //suite.addTest(SearchPopulateCellLinesTest.suite());
? ++
- suite.addTest(SearchPopulateCITest.suite());
+ //suite.addTest(SearchPopulateCITest.suite());
? ++
- suite.addTest(SearchPopulateGeneticDescriptionTest.suite());
+ //suite.addTest(SearchPopulateGeneticDescriptionTest.suite());
? ++
- suite.addTest(SearchPopulateHistopathologyTest.suite());
+ //suite.addTest(SearchPopulateHistopathologyTest.suite());
? ++
- suite.addTest(SearchPopulateModelCharacteristicsTest.suite());
+ //suite.addTest(SearchPopulateModelCharacteristicsTest.suite());
? ++
- suite.addTest(SearchPopulatePublicationTest.suite());
+ //suite.addTest(SearchPopulatePublicationTest.suite());
? ++
- suite.addTest(SearchPopulateTherapyTest.suite());
+ //suite.addTest(SearchPopulateTherapyTest.suite());
? ++
- suite.addTest(SearchPopulateTransIntTest.suite());
+ //suite.addTest(SearchPopulateTransIntTest.suite());
? ++
- suite.addTest(SearchPopulateXenograftTest.suite());
+ //suite.addTest(SearchPopulateXenograftTest.suite());
? ++
return suite;
}
public static void main(String args[])
{
TestRunner.run(suite());
}
} | 18 | 0.391304 | 9 | 9 |
3972e46177f177c5b31cdacdff2e9b11832ef9c4 | src/app/library/Util.scala | src/app/library/Util.scala | package library
import play.Play
import java.io.File
object Util {
def getUnameFromSubdomain(subdomain: String) = subdomain.split('.')(0)
def calcUniquifiedFilePath(originalPath: String) = {
def makeNewFileCandidate(dirName: String, fileBaseName: String, fileExtName: String, prefixNum: Integer): String = {
val temporaryPath = s"$dirName/$fileBaseName-$prefixNum.$fileExtName"
(new File(temporaryPath)).exists match {
case true => makeNewFileCandidate(dirName, fileBaseName, fileExtName, prefixNum + 1)
case false => temporaryPath
}
}
(new File(originalPath)).exists match {
case true => {
val dirName = originalPath.substring(0, originalPath.lastIndexOf('/'))
val fileName = originalPath.substring(originalPath.lastIndexOf('/') + 1, originalPath.length)
val fileBaseName = fileName.substring(0, fileName.lastIndexOf('.'))
val fileExtName = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
makeNewFileCandidate(dirName, fileBaseName, fileExtName, 1)
}
case false => originalPath
}
}
def urlifyFilePath(originalPath: String) =
originalPath.substring(Play.application.path.toString.length, originalPath.length).replace("/public/", "/")
}
| package library
import play.Play
import java.io.File
object Util {
// this function is obsolete and will be removed later (because it's migrated from webnikki.jp)
def getUnameFromSubdomain(subdomain: String) = subdomain.split('.')(0)
def getUnameFromPath(path: String) =
path.indexOf("/", 1) match {
case -1 if path.length == 0 => ""
case -1 => path.substring(1)
case _ => path.substring(1, path.indexOf("/", 1))
}
def calcUniquifiedFilePath(originalPath: String) = {
def makeNewFileCandidate(dirName: String, fileBaseName: String, fileExtName: String, prefixNum: Integer): String = {
val temporaryPath = s"$dirName/$fileBaseName-$prefixNum.$fileExtName"
(new File(temporaryPath)).exists match {
case true => makeNewFileCandidate(dirName, fileBaseName, fileExtName, prefixNum + 1)
case false => temporaryPath
}
}
(new File(originalPath)).exists match {
case true => {
val dirName = originalPath.substring(0, originalPath.lastIndexOf('/'))
val fileName = originalPath.substring(originalPath.lastIndexOf('/') + 1, originalPath.length)
val fileBaseName = fileName.substring(0, fileName.lastIndexOf('.'))
val fileExtName = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
makeNewFileCandidate(dirName, fileBaseName, fileExtName, 1)
}
case false => originalPath
}
}
def urlifyFilePath(originalPath: String) =
originalPath.substring(Play.application.path.toString.length, originalPath.length).replace("/public/", "/")
}
| Add getUnameFromPath() for new URL structure. | Add getUnameFromPath() for new URL structure.
| Scala | mit | mahata/webnikki,mahata/webnikki,mahata/webnikki,mahata/webnikki | scala | ## Code Before:
package library
import play.Play
import java.io.File
object Util {
def getUnameFromSubdomain(subdomain: String) = subdomain.split('.')(0)
def calcUniquifiedFilePath(originalPath: String) = {
def makeNewFileCandidate(dirName: String, fileBaseName: String, fileExtName: String, prefixNum: Integer): String = {
val temporaryPath = s"$dirName/$fileBaseName-$prefixNum.$fileExtName"
(new File(temporaryPath)).exists match {
case true => makeNewFileCandidate(dirName, fileBaseName, fileExtName, prefixNum + 1)
case false => temporaryPath
}
}
(new File(originalPath)).exists match {
case true => {
val dirName = originalPath.substring(0, originalPath.lastIndexOf('/'))
val fileName = originalPath.substring(originalPath.lastIndexOf('/') + 1, originalPath.length)
val fileBaseName = fileName.substring(0, fileName.lastIndexOf('.'))
val fileExtName = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
makeNewFileCandidate(dirName, fileBaseName, fileExtName, 1)
}
case false => originalPath
}
}
def urlifyFilePath(originalPath: String) =
originalPath.substring(Play.application.path.toString.length, originalPath.length).replace("/public/", "/")
}
## Instruction:
Add getUnameFromPath() for new URL structure.
## Code After:
package library
import play.Play
import java.io.File
object Util {
// this function is obsolete and will be removed later (because it's migrated from webnikki.jp)
def getUnameFromSubdomain(subdomain: String) = subdomain.split('.')(0)
def getUnameFromPath(path: String) =
path.indexOf("/", 1) match {
case -1 if path.length == 0 => ""
case -1 => path.substring(1)
case _ => path.substring(1, path.indexOf("/", 1))
}
def calcUniquifiedFilePath(originalPath: String) = {
def makeNewFileCandidate(dirName: String, fileBaseName: String, fileExtName: String, prefixNum: Integer): String = {
val temporaryPath = s"$dirName/$fileBaseName-$prefixNum.$fileExtName"
(new File(temporaryPath)).exists match {
case true => makeNewFileCandidate(dirName, fileBaseName, fileExtName, prefixNum + 1)
case false => temporaryPath
}
}
(new File(originalPath)).exists match {
case true => {
val dirName = originalPath.substring(0, originalPath.lastIndexOf('/'))
val fileName = originalPath.substring(originalPath.lastIndexOf('/') + 1, originalPath.length)
val fileBaseName = fileName.substring(0, fileName.lastIndexOf('.'))
val fileExtName = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
makeNewFileCandidate(dirName, fileBaseName, fileExtName, 1)
}
case false => originalPath
}
}
def urlifyFilePath(originalPath: String) =
originalPath.substring(Play.application.path.toString.length, originalPath.length).replace("/public/", "/")
}
| package library
import play.Play
import java.io.File
object Util {
+ // this function is obsolete and will be removed later (because it's migrated from webnikki.jp)
def getUnameFromSubdomain(subdomain: String) = subdomain.split('.')(0)
+
+ def getUnameFromPath(path: String) =
+ path.indexOf("/", 1) match {
+ case -1 if path.length == 0 => ""
+ case -1 => path.substring(1)
+ case _ => path.substring(1, path.indexOf("/", 1))
+ }
def calcUniquifiedFilePath(originalPath: String) = {
def makeNewFileCandidate(dirName: String, fileBaseName: String, fileExtName: String, prefixNum: Integer): String = {
val temporaryPath = s"$dirName/$fileBaseName-$prefixNum.$fileExtName"
(new File(temporaryPath)).exists match {
case true => makeNewFileCandidate(dirName, fileBaseName, fileExtName, prefixNum + 1)
case false => temporaryPath
}
}
(new File(originalPath)).exists match {
case true => {
val dirName = originalPath.substring(0, originalPath.lastIndexOf('/'))
val fileName = originalPath.substring(originalPath.lastIndexOf('/') + 1, originalPath.length)
val fileBaseName = fileName.substring(0, fileName.lastIndexOf('.'))
val fileExtName = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
makeNewFileCandidate(dirName, fileBaseName, fileExtName, 1)
}
case false => originalPath
}
}
def urlifyFilePath(originalPath: String) =
originalPath.substring(Play.application.path.toString.length, originalPath.length).replace("/public/", "/")
} | 8 | 0.235294 | 8 | 0 |
81580b15b47b7fbf38bb55f2bcf51986ce5ed6ea | app/locales/modules/controllers.en.yml | app/locales/modules/controllers.en.yml | en:
controllers:
omniauth_authentication:
needs_ownership_confirmation: 'Please login with your existing account before proceed.'
projects:
contributions:
create:
error: 'Oh noez! There was an error processing your investment. Please try again.'
pay:
credit_card_description: "Back project %{project_name} with %{value} (plus fees)"
echeck_description: "Back project %{project_name} with %{value} (plus fees)"
paypal_description: "Back project %{project_name} with %{value} (plus fees)"
success: "You successfully invested. Thank you!"
users:
completeness_progress: 'Please <a href="%{link}">complete your profile</a> so we can talk you up, and give you full credit for being awesome!'
update:
success: 'Your information has been updated!'
contacts:
create:
success: 'Thank you for your interest! We will be in touch soon.'
| en:
controllers:
unauthorized: 'You are not authorized to access this page.'
omniauth_authentication:
needs_ownership_confirmation: 'Please login with your existing account before proceed.'
projects:
contributions:
create:
error: 'Oh noez! There was an error processing your investment. Please try again.'
pay:
credit_card_description: "Back project %{project_name} with %{value} (plus fees)"
echeck_description: "Back project %{project_name} with %{value} (plus fees)"
paypal_description: "Back project %{project_name} with %{value} (plus fees)"
success: "You successfully invested. Thank you!"
users:
completeness_progress: 'Please <a href="%{link}">complete your profile</a> so we can talk you up, and give you full credit for being awesome!'
update:
success: 'Your information has been updated!'
contacts:
create:
success: 'Thank you for your interest! We will be in touch soon.'
| Add missing translation for unauthorized access | Add missing translation for unauthorized access
| YAML | mit | gustavoguichard/neighborly,gustavoguichard/neighborly,gustavoguichard/neighborly | yaml | ## Code Before:
en:
controllers:
omniauth_authentication:
needs_ownership_confirmation: 'Please login with your existing account before proceed.'
projects:
contributions:
create:
error: 'Oh noez! There was an error processing your investment. Please try again.'
pay:
credit_card_description: "Back project %{project_name} with %{value} (plus fees)"
echeck_description: "Back project %{project_name} with %{value} (plus fees)"
paypal_description: "Back project %{project_name} with %{value} (plus fees)"
success: "You successfully invested. Thank you!"
users:
completeness_progress: 'Please <a href="%{link}">complete your profile</a> so we can talk you up, and give you full credit for being awesome!'
update:
success: 'Your information has been updated!'
contacts:
create:
success: 'Thank you for your interest! We will be in touch soon.'
## Instruction:
Add missing translation for unauthorized access
## Code After:
en:
controllers:
unauthorized: 'You are not authorized to access this page.'
omniauth_authentication:
needs_ownership_confirmation: 'Please login with your existing account before proceed.'
projects:
contributions:
create:
error: 'Oh noez! There was an error processing your investment. Please try again.'
pay:
credit_card_description: "Back project %{project_name} with %{value} (plus fees)"
echeck_description: "Back project %{project_name} with %{value} (plus fees)"
paypal_description: "Back project %{project_name} with %{value} (plus fees)"
success: "You successfully invested. Thank you!"
users:
completeness_progress: 'Please <a href="%{link}">complete your profile</a> so we can talk you up, and give you full credit for being awesome!'
update:
success: 'Your information has been updated!'
contacts:
create:
success: 'Thank you for your interest! We will be in touch soon.'
| en:
controllers:
+ unauthorized: 'You are not authorized to access this page.'
omniauth_authentication:
needs_ownership_confirmation: 'Please login with your existing account before proceed.'
projects:
contributions:
create:
error: 'Oh noez! There was an error processing your investment. Please try again.'
pay:
credit_card_description: "Back project %{project_name} with %{value} (plus fees)"
echeck_description: "Back project %{project_name} with %{value} (plus fees)"
paypal_description: "Back project %{project_name} with %{value} (plus fees)"
success: "You successfully invested. Thank you!"
users:
completeness_progress: 'Please <a href="%{link}">complete your profile</a> so we can talk you up, and give you full credit for being awesome!'
update:
success: 'Your information has been updated!'
contacts:
create:
success: 'Thank you for your interest! We will be in touch soon.' | 1 | 0.05 | 1 | 0 |
e7bbfdd5ed4de6384c2ef480478f8ccff62447aa | README.md | README.md |
*Most friends
*Most played game in last 2 weeks
*Most played game of all time - **not practical due to Steam API limitations
*Most playtime in last 2 weeks - **not practical due to Steam API limitations
*Most total playtime - **not practical due to Steam API limitations
*Most games
*Most achievements - **not practical due to Steam API limitations
*Oldest Steam member
*Newest Steam member
|
*Most friends
*Most played game in last 2 weeks
*Most played game of all time - *not practical due to Steam API limitations*
*Most playtime in last 2 weeks - *not practical due to Steam API limitations*
*Most total playtime - *not practical due to Steam API limitations*
*Most games
*Most achievements - *not practical due to Steam API limitations*
*Oldest Steam member
*Newest Steam member
| Fix readme formatting for realsies | Fix readme formatting for realsies
| Markdown | cc0-1.0 | stevula/steam-friend-thingy,stevula/steam-friend-stats,stevula/steam-friend-stats,stevula/steam-friend-thingy,stevula/steam-friend-thingy,stevula/steam-friend-stats | markdown | ## Code Before:
*Most friends
*Most played game in last 2 weeks
*Most played game of all time - **not practical due to Steam API limitations
*Most playtime in last 2 weeks - **not practical due to Steam API limitations
*Most total playtime - **not practical due to Steam API limitations
*Most games
*Most achievements - **not practical due to Steam API limitations
*Oldest Steam member
*Newest Steam member
## Instruction:
Fix readme formatting for realsies
## Code After:
*Most friends
*Most played game in last 2 weeks
*Most played game of all time - *not practical due to Steam API limitations*
*Most playtime in last 2 weeks - *not practical due to Steam API limitations*
*Most total playtime - *not practical due to Steam API limitations*
*Most games
*Most achievements - *not practical due to Steam API limitations*
*Oldest Steam member
*Newest Steam member
|
*Most friends
-
*Most played game in last 2 weeks
-
- *Most played game of all time - **not practical due to Steam API limitations
? -
+ *Most played game of all time - *not practical due to Steam API limitations*
? +
-
- *Most playtime in last 2 weeks - **not practical due to Steam API limitations
? -
+ *Most playtime in last 2 weeks - *not practical due to Steam API limitations*
? +
-
- *Most total playtime - **not practical due to Steam API limitations
? -
+ *Most total playtime - *not practical due to Steam API limitations*
? +
-
*Most games
-
- *Most achievements - **not practical due to Steam API limitations
? -
+ *Most achievements - *not practical due to Steam API limitations*
? +
-
*Oldest Steam member
-
*Newest Steam member
- | 17 | 0.894737 | 4 | 13 |
0349864c16731a3b06c227d497d6e8fa865492b8 | manage/regression_test.sh | manage/regression_test.sh | if [ -z "$PW_RINFO" ]; then
echo "Enter sudo password: "
read PW_RINFO
fi
EXIT_STATUS=0
function exit_on_error
{
if [ $EXIT_STATUS -ne 0 ];then
echo "$1 returned $EXIT_STATUS! Exiting!"
exit $EXIT_STATUS
fi
}
# Test Admin
fab -p $PW_RINFO target.regression -R admin app.admin.testAll
EXIT_STATUS=$?
exit_on_error "Admin module"
# Test Checker
fab -p $PW_RINFO target.regression -R checker app.checker.testAll
EXIT_STATUS=$?
exit_on_error "Checker module"
| if [ -z "$PW_RINFO" ]; then
echo "Enter sudo password: "
read PW_RINFO
fi
# Test Admin
fab -p $PW_RINFO target.regression -R admin app.admin.testAll
EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ];then
echo "Admin module returned $EXIT_STATUS! Exiting!"
exit $EXIT_STATUS
fi
# Test Checker
fab -p $PW_RINFO target.regression -R checker app.checker.testAll
EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ];then
echo "Checker module returned $EXIT_STATUS! Exiting!"
exit $EXIT_STATUS
fi
| Test greeen status of regression test in jenkins | Test greeen status of regression test in jenkins
| Shell | bsd-2-clause | rinfo/rdl,rinfo/rdl,rinfo/rdl,rinfo/rdl,rinfo/rdl,rinfo/rdl | shell | ## Code Before:
if [ -z "$PW_RINFO" ]; then
echo "Enter sudo password: "
read PW_RINFO
fi
EXIT_STATUS=0
function exit_on_error
{
if [ $EXIT_STATUS -ne 0 ];then
echo "$1 returned $EXIT_STATUS! Exiting!"
exit $EXIT_STATUS
fi
}
# Test Admin
fab -p $PW_RINFO target.regression -R admin app.admin.testAll
EXIT_STATUS=$?
exit_on_error "Admin module"
# Test Checker
fab -p $PW_RINFO target.regression -R checker app.checker.testAll
EXIT_STATUS=$?
exit_on_error "Checker module"
## Instruction:
Test greeen status of regression test in jenkins
## Code After:
if [ -z "$PW_RINFO" ]; then
echo "Enter sudo password: "
read PW_RINFO
fi
# Test Admin
fab -p $PW_RINFO target.regression -R admin app.admin.testAll
EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ];then
echo "Admin module returned $EXIT_STATUS! Exiting!"
exit $EXIT_STATUS
fi
# Test Checker
fab -p $PW_RINFO target.regression -R checker app.checker.testAll
EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ];then
echo "Checker module returned $EXIT_STATUS! Exiting!"
exit $EXIT_STATUS
fi
| if [ -z "$PW_RINFO" ]; then
echo "Enter sudo password: "
read PW_RINFO
fi
- EXIT_STATUS=0
-
- function exit_on_error
- {
- if [ $EXIT_STATUS -ne 0 ];then
- echo "$1 returned $EXIT_STATUS! Exiting!"
- exit $EXIT_STATUS
- fi
- }
-
-
# Test Admin
fab -p $PW_RINFO target.regression -R admin app.admin.testAll
EXIT_STATUS=$?
- exit_on_error "Admin module"
+ if [ $EXIT_STATUS -ne 0 ];then
+ echo "Admin module returned $EXIT_STATUS! Exiting!"
+ exit $EXIT_STATUS
+ fi
# Test Checker
fab -p $PW_RINFO target.regression -R checker app.checker.testAll
EXIT_STATUS=$?
- exit_on_error "Checker module"
+ if [ $EXIT_STATUS -ne 0 ];then
+ echo "Checker module returned $EXIT_STATUS! Exiting!"
+ exit $EXIT_STATUS
+ fi
+ | 22 | 0.814815 | 9 | 13 |
eee4887e401a9265548aff043abbb38ec60165eb | lib/graphql/scalar_type.rb | lib/graphql/scalar_type.rb | module GraphQL
# The parent type for scalars, eg {GraphQL::STRING_TYPE}, {GraphQL::INT_TYPE}
#
class ScalarType < GraphQL::BaseType
defined_by_config :name, :coerce, :coerce_input, :coerce_result, :description
attr_accessor :name, :description
def coerce=(proc)
self.coerce_input = proc
self.coerce_result = proc
end
def coerce_input(value)
@coerce_input_proc.call(value)
end
def coerce_input=(proc)
@coerce_input_proc = proc unless proc.nil?
end
def coerce_result(value)
@coerce_result_proc.call(value)
end
def coerce_result=(proc)
@coerce_result_proc = proc unless proc.nil?
end
def kind
GraphQL::TypeKinds::SCALAR
end
end
end
| module GraphQL
# The parent type for scalars, eg {GraphQL::STRING_TYPE}, {GraphQL::INT_TYPE}
#
# @example defining a type for Time
# TimeType = GraphQL::ObjectType.define do
# name "Time"
# description "Time since epoch in seconds"
#
# coerce_input ->(value) { Time.at(Float(value)) }
# coerce_result ->(value) { value.to_f }
# end
#
class ScalarType < GraphQL::BaseType
defined_by_config :name, :coerce, :coerce_input, :coerce_result, :description
attr_accessor :name, :description
def coerce=(proc)
self.coerce_input = proc
self.coerce_result = proc
end
def coerce_input(value)
@coerce_input_proc.call(value)
end
def coerce_input=(proc)
@coerce_input_proc = proc unless proc.nil?
end
def coerce_result(value)
@coerce_result_proc.call(value)
end
def coerce_result=(proc)
@coerce_result_proc = proc unless proc.nil?
end
def kind
GraphQL::TypeKinds::SCALAR
end
end
end
| Add an example for a custom scalar. | Add an example for a custom scalar.
| Ruby | mit | nevesenin/graphql-ruby,rmosolgo/graphql-ruby,rmosolgo/graphql-ruby,xuorig/graphql-ruby,rmosolgo/graphql-ruby,nevesenin/graphql-ruby,nevesenin/graphql-ruby,tribune/graphql-ruby,nevesenin/graphql-ruby,onlimii/graphql-ruby,xuorig/graphql-ruby,rmosolgo/graphql-ruby,xuorig/graphql-ruby,musicglue/graphql-ruby | ruby | ## Code Before:
module GraphQL
# The parent type for scalars, eg {GraphQL::STRING_TYPE}, {GraphQL::INT_TYPE}
#
class ScalarType < GraphQL::BaseType
defined_by_config :name, :coerce, :coerce_input, :coerce_result, :description
attr_accessor :name, :description
def coerce=(proc)
self.coerce_input = proc
self.coerce_result = proc
end
def coerce_input(value)
@coerce_input_proc.call(value)
end
def coerce_input=(proc)
@coerce_input_proc = proc unless proc.nil?
end
def coerce_result(value)
@coerce_result_proc.call(value)
end
def coerce_result=(proc)
@coerce_result_proc = proc unless proc.nil?
end
def kind
GraphQL::TypeKinds::SCALAR
end
end
end
## Instruction:
Add an example for a custom scalar.
## Code After:
module GraphQL
# The parent type for scalars, eg {GraphQL::STRING_TYPE}, {GraphQL::INT_TYPE}
#
# @example defining a type for Time
# TimeType = GraphQL::ObjectType.define do
# name "Time"
# description "Time since epoch in seconds"
#
# coerce_input ->(value) { Time.at(Float(value)) }
# coerce_result ->(value) { value.to_f }
# end
#
class ScalarType < GraphQL::BaseType
defined_by_config :name, :coerce, :coerce_input, :coerce_result, :description
attr_accessor :name, :description
def coerce=(proc)
self.coerce_input = proc
self.coerce_result = proc
end
def coerce_input(value)
@coerce_input_proc.call(value)
end
def coerce_input=(proc)
@coerce_input_proc = proc unless proc.nil?
end
def coerce_result(value)
@coerce_result_proc.call(value)
end
def coerce_result=(proc)
@coerce_result_proc = proc unless proc.nil?
end
def kind
GraphQL::TypeKinds::SCALAR
end
end
end
| module GraphQL
# The parent type for scalars, eg {GraphQL::STRING_TYPE}, {GraphQL::INT_TYPE}
+ #
+ # @example defining a type for Time
+ # TimeType = GraphQL::ObjectType.define do
+ # name "Time"
+ # description "Time since epoch in seconds"
+ #
+ # coerce_input ->(value) { Time.at(Float(value)) }
+ # coerce_result ->(value) { value.to_f }
+ # end
#
class ScalarType < GraphQL::BaseType
defined_by_config :name, :coerce, :coerce_input, :coerce_result, :description
attr_accessor :name, :description
def coerce=(proc)
self.coerce_input = proc
self.coerce_result = proc
end
def coerce_input(value)
@coerce_input_proc.call(value)
end
def coerce_input=(proc)
@coerce_input_proc = proc unless proc.nil?
end
def coerce_result(value)
@coerce_result_proc.call(value)
end
def coerce_result=(proc)
@coerce_result_proc = proc unless proc.nil?
end
def kind
GraphQL::TypeKinds::SCALAR
end
end
end | 9 | 0.272727 | 9 | 0 |
2bec4520066943799d92fe9e00133ba585bc9b53 | contrib/kakoune.rb | contrib/kakoune.rb | require "formula"
class Kakoune < Formula
homepage "https://github.com/mawww/kakoune"
head "https://github.com/mawww/kakoune.git"
depends_on 'boost'
depends_on 'asciidoc' => :build
def install
cd 'src' do
system "make", "install", "PREFIX=#{prefix}"
end
end
end
| require "formula"
class Kakoune < Formula
homepage "https://github.com/mawww/kakoune"
head "https://github.com/mawww/kakoune.git"
depends_on 'boost'
depends_on 'docbook-xsl' => :build
depends_on 'asciidoc' => [:build, 'with-docbook-xsl']
def install
cd 'src' do
system "make", "install", "PREFIX=#{prefix}"
end
end
end
| Fix compilation on Mac OS Sierra | Fix compilation on Mac OS Sierra
The `xsltproc` utility is missing some xsl files, which are now
installed on the system by the `docbook-xsl` package.
Fixes #939
| Ruby | unlicense | danr/kakoune,ekie/kakoune,ekie/kakoune,lenormf/kakoune,danr/kakoune,Somasis/kakoune,alexherbo2/kakoune,jkonecny12/kakoune,jjthrash/kakoune,lenormf/kakoune,casimir/kakoune,flavius/kakoune,alexherbo2/kakoune,alexherbo2/kakoune,casimir/kakoune,casimir/kakoune,flavius/kakoune,lenormf/kakoune,danr/kakoune,Somasis/kakoune,Somasis/kakoune,occivink/kakoune,jkonecny12/kakoune,casimir/kakoune,occivink/kakoune,jkonecny12/kakoune,alexherbo2/kakoune,jkonecny12/kakoune,Somasis/kakoune,occivink/kakoune,lenormf/kakoune,jjthrash/kakoune,ekie/kakoune,mawww/kakoune,occivink/kakoune,mawww/kakoune,danr/kakoune,mawww/kakoune,flavius/kakoune,jjthrash/kakoune,jjthrash/kakoune,mawww/kakoune,flavius/kakoune,ekie/kakoune | ruby | ## Code Before:
require "formula"
class Kakoune < Formula
homepage "https://github.com/mawww/kakoune"
head "https://github.com/mawww/kakoune.git"
depends_on 'boost'
depends_on 'asciidoc' => :build
def install
cd 'src' do
system "make", "install", "PREFIX=#{prefix}"
end
end
end
## Instruction:
Fix compilation on Mac OS Sierra
The `xsltproc` utility is missing some xsl files, which are now
installed on the system by the `docbook-xsl` package.
Fixes #939
## Code After:
require "formula"
class Kakoune < Formula
homepage "https://github.com/mawww/kakoune"
head "https://github.com/mawww/kakoune.git"
depends_on 'boost'
depends_on 'docbook-xsl' => :build
depends_on 'asciidoc' => [:build, 'with-docbook-xsl']
def install
cd 'src' do
system "make", "install", "PREFIX=#{prefix}"
end
end
end
| require "formula"
class Kakoune < Formula
homepage "https://github.com/mawww/kakoune"
head "https://github.com/mawww/kakoune.git"
depends_on 'boost'
- depends_on 'asciidoc' => :build
? -----
+ depends_on 'docbook-xsl' => :build
? ++++++++
+ depends_on 'asciidoc' => [:build, 'with-docbook-xsl']
def install
cd 'src' do
system "make", "install", "PREFIX=#{prefix}"
end
end
end | 3 | 0.2 | 2 | 1 |
df687c948f1b8bda0cb57478789daeb701dc696a | CHANGELOG.md | CHANGELOG.md |
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* |
**Enhancements:**
* Simpler and more consistent API
* Concurrent Workflow support
* Built in task as sub packages (gotask, shelltask, webtask)
* RestartTask for starting and stopping processes i.e. Go server or Web server
* NewSassTask for creating a task that runs the command line sass tool
* Pipeline recursive directory watches will add new directories as they are added
**Fixes:**
* Better handling of long running Workflows by queueing Pipeline notifications
**Closed issues:**
- Handle directory add after Watching has begun [\#2](https://github.com/dshills/goauto/issues/2)
- Multiple GOPATH support for Transformers [\#1](https://github.com/dshills/goauto/issues/1)
| Update to CHANGLELOG for 0.1.4 | Update to CHANGLELOG for 0.1.4
| Markdown | mit | dshills/goauto | markdown | ## Code Before:
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
## Instruction:
Update to CHANGLELOG for 0.1.4
## Code After:
**Enhancements:**
* Simpler and more consistent API
* Concurrent Workflow support
* Built in task as sub packages (gotask, shelltask, webtask)
* RestartTask for starting and stopping processes i.e. Go server or Web server
* NewSassTask for creating a task that runs the command line sass tool
* Pipeline recursive directory watches will add new directories as they are added
**Fixes:**
* Better handling of long running Workflows by queueing Pipeline notifications
**Closed issues:**
- Handle directory add after Watching has begun [\#2](https://github.com/dshills/goauto/issues/2)
- Multiple GOPATH support for Transformers [\#1](https://github.com/dshills/goauto/issues/1)
|
+ **Enhancements:**
+ * Simpler and more consistent API
+ * Concurrent Workflow support
+ * Built in task as sub packages (gotask, shelltask, webtask)
+ * RestartTask for starting and stopping processes i.e. Go server or Web server
+ * NewSassTask for creating a task that runs the command line sass tool
+ * Pipeline recursive directory watches will add new directories as they are added
+ **Fixes:**
+ * Better handling of long running Workflows by queueing Pipeline notifications
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
+ **Closed issues:**
+
+ - Handle directory add after Watching has begun [\#2](https://github.com/dshills/goauto/issues/2)
+
+ - Multiple GOPATH support for Transformers [\#1](https://github.com/dshills/goauto/issues/1) | 15 | 3.75 | 14 | 1 |
c31d53cd87bb6a9ccf3a35c245f08bb87367100f | lib/relations/JavaScriptPaintWorklet.js | lib/relations/JavaScriptPaintWorklet.js | const replaceDescendantNode = require('../replaceDescendantNode');
const Relation = require('./Relation');
class JavaScriptPaintWorklet extends Relation {
get href() {
return this.node.value;
}
set href(href) {
this.node.value = href;
}
inline() {
super.inline();
const newNode = { type: 'Literal', value: this.to.dataUrl };
replaceDescendantNode(this.parentNode, this.node, newNode);
this.node = newNode;
this.from.markDirty();
return this;
}
attach() {
throw new Error('JavaScriptPaintWorklet.attach(): Not implemented');
}
detach() {
throw new Error('JavaScriptPaintWorklet.detach(): Not implemented');
}
}
module.exports = JavaScriptPaintWorklet;
| const replaceDescendantNode = require('../replaceDescendantNode');
const Relation = require('./Relation');
class JavaScriptPaintWorklet extends Relation {
get href() {
return this.node.value;
}
set href(href) {
this.node.value = href;
}
inline() {
super.inline();
const newNode = { type: 'Literal', value: this.to.dataUrl };
replaceDescendantNode(this.parentNode, this.node, newNode);
this.node = newNode;
this.from.markDirty();
return this;
}
attach() {
throw new Error('JavaScriptPaintWorklet.attach(): Not implemented');
}
detach() {
throw new Error('JavaScriptPaintWorklet.detach(): Not implemented');
}
}
JavaScriptPaintWorklet.prototype.targetType = 'JavaScript';
module.exports = JavaScriptPaintWorklet;
| Add targetType to JavaScripPaintWorklet prototype | Add targetType to JavaScripPaintWorklet prototype
| JavaScript | bsd-3-clause | assetgraph/assetgraph | javascript | ## Code Before:
const replaceDescendantNode = require('../replaceDescendantNode');
const Relation = require('./Relation');
class JavaScriptPaintWorklet extends Relation {
get href() {
return this.node.value;
}
set href(href) {
this.node.value = href;
}
inline() {
super.inline();
const newNode = { type: 'Literal', value: this.to.dataUrl };
replaceDescendantNode(this.parentNode, this.node, newNode);
this.node = newNode;
this.from.markDirty();
return this;
}
attach() {
throw new Error('JavaScriptPaintWorklet.attach(): Not implemented');
}
detach() {
throw new Error('JavaScriptPaintWorklet.detach(): Not implemented');
}
}
module.exports = JavaScriptPaintWorklet;
## Instruction:
Add targetType to JavaScripPaintWorklet prototype
## Code After:
const replaceDescendantNode = require('../replaceDescendantNode');
const Relation = require('./Relation');
class JavaScriptPaintWorklet extends Relation {
get href() {
return this.node.value;
}
set href(href) {
this.node.value = href;
}
inline() {
super.inline();
const newNode = { type: 'Literal', value: this.to.dataUrl };
replaceDescendantNode(this.parentNode, this.node, newNode);
this.node = newNode;
this.from.markDirty();
return this;
}
attach() {
throw new Error('JavaScriptPaintWorklet.attach(): Not implemented');
}
detach() {
throw new Error('JavaScriptPaintWorklet.detach(): Not implemented');
}
}
JavaScriptPaintWorklet.prototype.targetType = 'JavaScript';
module.exports = JavaScriptPaintWorklet;
| const replaceDescendantNode = require('../replaceDescendantNode');
const Relation = require('./Relation');
class JavaScriptPaintWorklet extends Relation {
get href() {
return this.node.value;
}
set href(href) {
this.node.value = href;
}
inline() {
super.inline();
const newNode = { type: 'Literal', value: this.to.dataUrl };
replaceDescendantNode(this.parentNode, this.node, newNode);
this.node = newNode;
this.from.markDirty();
return this;
}
attach() {
throw new Error('JavaScriptPaintWorklet.attach(): Not implemented');
}
detach() {
throw new Error('JavaScriptPaintWorklet.detach(): Not implemented');
}
}
+ JavaScriptPaintWorklet.prototype.targetType = 'JavaScript';
+
module.exports = JavaScriptPaintWorklet; | 2 | 0.064516 | 2 | 0 |
cc42f4c3a2b27caa377b97b3644d47ec355284c3 | image/utilities.sh | image/utilities.sh | set -e
. /build/buildconfig
. /build/bash-library
status "Adding container utlities..."
## Add THE "bash library" into the system
mkdir /usr/local/share/cyLEDGE
cp /build/bash-library /usr/local/share/cyLEDGE/bash-library
## Switch default shell to bash
ln -sf /bin/bash /bin/sh
## This tool runs a command as another user and sets $HOME.
cp /build/bin/setuser /sbin/setuser
## Add the host ip detector as startup script
cp /build/bin/detect-docker-host-ip /etc/my_init.d/
## Set python executable
ln -s /usr/bin/python3 /usr/bin/python
| set -e
. /build/buildconfig
. /build/bash-library
status "Adding container utlities..."
## Add THE "bash library" into the system
mkdir /usr/local/share/cyLEDGE
cp /build/bash-library /usr/local/share/cyLEDGE/bash-library
## Switch default shell to bash
ln -sf /bin/bash /bin/sh
## This tool runs a command as another user and sets $HOME.
cp /build/bin/setuser /sbin/setuser
## Add the host ip detector as startup script
cp /build/bin/detect-docker-host-ip /etc/my_init.d/
. /etc/lsb-release
if [ $DISTRIB_RELEASE != "12.04" ]; then
## Set python executable
ln -s /usr/bin/python3 /usr/bin/python
fi
| Apply fix for python executable only for releases > 12.04 | Apply fix for python executable only for releases > 12.04
| Shell | mit | cyLEDGE/baseimage-docker,cyLEDGE/baseimage-docker | shell | ## Code Before:
set -e
. /build/buildconfig
. /build/bash-library
status "Adding container utlities..."
## Add THE "bash library" into the system
mkdir /usr/local/share/cyLEDGE
cp /build/bash-library /usr/local/share/cyLEDGE/bash-library
## Switch default shell to bash
ln -sf /bin/bash /bin/sh
## This tool runs a command as another user and sets $HOME.
cp /build/bin/setuser /sbin/setuser
## Add the host ip detector as startup script
cp /build/bin/detect-docker-host-ip /etc/my_init.d/
## Set python executable
ln -s /usr/bin/python3 /usr/bin/python
## Instruction:
Apply fix for python executable only for releases > 12.04
## Code After:
set -e
. /build/buildconfig
. /build/bash-library
status "Adding container utlities..."
## Add THE "bash library" into the system
mkdir /usr/local/share/cyLEDGE
cp /build/bash-library /usr/local/share/cyLEDGE/bash-library
## Switch default shell to bash
ln -sf /bin/bash /bin/sh
## This tool runs a command as another user and sets $HOME.
cp /build/bin/setuser /sbin/setuser
## Add the host ip detector as startup script
cp /build/bin/detect-docker-host-ip /etc/my_init.d/
. /etc/lsb-release
if [ $DISTRIB_RELEASE != "12.04" ]; then
## Set python executable
ln -s /usr/bin/python3 /usr/bin/python
fi
| set -e
. /build/buildconfig
. /build/bash-library
status "Adding container utlities..."
## Add THE "bash library" into the system
mkdir /usr/local/share/cyLEDGE
cp /build/bash-library /usr/local/share/cyLEDGE/bash-library
## Switch default shell to bash
ln -sf /bin/bash /bin/sh
## This tool runs a command as another user and sets $HOME.
cp /build/bin/setuser /sbin/setuser
## Add the host ip detector as startup script
cp /build/bin/detect-docker-host-ip /etc/my_init.d/
+ . /etc/lsb-release
+ if [ $DISTRIB_RELEASE != "12.04" ]; then
- ## Set python executable
+ ## Set python executable
? ++
- ln -s /usr/bin/python3 /usr/bin/python
+ ln -s /usr/bin/python3 /usr/bin/python
? ++
+ fi | 7 | 0.28 | 5 | 2 |
1c2ad86ed7c8968cf0a7f164b03bd94ca80f2e7d | app/views/devise/sessions/new.html.erb | app/views/devise/sessions/new.html.erb | <h2>Log in</h2>
<%= devise_error_messages! %>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
| <h2>Log in</h2>
<%= devise_error_messages! %>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
<p>Don't have an account? <%= link_to "Sign up now!", new_user_registration_path %></p>
| Remove devise links partial from login view | Remove devise links partial from login view
| HTML+ERB | mit | Dom-Mc/fetch_it,Dom-Mc/fetch_it,Dom-Mc/fetch_it | html+erb | ## Code Before:
<h2>Log in</h2>
<%= devise_error_messages! %>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
## Instruction:
Remove devise links partial from login view
## Code After:
<h2>Log in</h2>
<%= devise_error_messages! %>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
<p>Don't have an account? <%= link_to "Sign up now!", new_user_registration_path %></p>
| <h2>Log in</h2>
<%= devise_error_messages! %>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
- <%= render "devise/shared/links" %>
+ <p>Don't have an account? <%= link_to "Sign up now!", new_user_registration_path %></p> | 2 | 0.117647 | 1 | 1 |
e9c672cf319a241b9f11ccb99b2ea7d75583bbb0 | .travis.yml | .travis.yml |
language: objective-c
cache: cocoapods
podfile: Example/Podfile
before_install:
- gem install cocoapods
- pod install --project-directory=Example
script:
- xctool test -workspace Example/IRLSize.xcworkspace -scheme IRLSize -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
- pod lib lint
|
language: objective-c
cache: cocoapods
podfile: Example/Podfile
before_install:
- gem install cocoapods
- pod install --project-directory=Example
script:
- xctool -workspace Example/IRLSize.xcworkspace -scheme IRLSize -sdk iphonesimulator test ONLY_ACTIVE_ARCH=NO
- pod lib lint
| Put the test command after the settings. | Put the test command after the settings.
| YAML | mit | detroit-labs/IRLSize,detroit-labs/IRLSize,detroit-labs/IRLSize | yaml | ## Code Before:
language: objective-c
cache: cocoapods
podfile: Example/Podfile
before_install:
- gem install cocoapods
- pod install --project-directory=Example
script:
- xctool test -workspace Example/IRLSize.xcworkspace -scheme IRLSize -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
- pod lib lint
## Instruction:
Put the test command after the settings.
## Code After:
language: objective-c
cache: cocoapods
podfile: Example/Podfile
before_install:
- gem install cocoapods
- pod install --project-directory=Example
script:
- xctool -workspace Example/IRLSize.xcworkspace -scheme IRLSize -sdk iphonesimulator test ONLY_ACTIVE_ARCH=NO
- pod lib lint
|
language: objective-c
cache: cocoapods
podfile: Example/Podfile
before_install:
- gem install cocoapods
- pod install --project-directory=Example
script:
- - xctool test -workspace Example/IRLSize.xcworkspace -scheme IRLSize -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
? -----
+ - xctool -workspace Example/IRLSize.xcworkspace -scheme IRLSize -sdk iphonesimulator test ONLY_ACTIVE_ARCH=NO
? +++++
- pod lib lint | 2 | 0.2 | 1 | 1 |
9922004499e19a90c60bf33e6a13deea8bb74c82 | superdesk/templates/analytics_scheduled_report.html | superdesk/templates/analytics_scheduled_report.html | {% extends "email_layout.html" %}
{% block content %}
{{html_body | safe}}
<br>
<div style="display: flex; flex-direction: row; flex-wrap: wrap;">
{% for report in reports %}
{% if report.type == 'html' %}
{{report.html | safe}}
{% elif report.type == 'image' %}
<div>
<img src="cid:{{report.id}}" width="{{report.width}}px">
</div>
{% endif %}
{% endfor %}
</div>
{% endblock %}
| {% extends "email_layout.html" %}
{% block content %}
{{html_body | safe}}
<br>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
{% for report in reports %}
{% if report.type == 'html' %}
<tr>
<td>
{{report.html | safe}}
</td>
</tr>
{% elif report.type == 'image' %}
<tr>
<td>
<img src="cid:{{report.id}}" style="height: auto !important; max-width: {{report.width}}px !important; width: 100% !important;">
</td>
</tr>
{% endif %}
{% endfor %}
</table>
{% endblock %}
| Use tables instead of flexbox in scheduled report emails | [SDESK-3499](fix-analytics): Use tables instead of flexbox in scheduled report emails
| HTML | agpl-3.0 | ioanpocol/superdesk-core,petrjasek/superdesk-core,superdesk/superdesk-core,superdesk/superdesk-core,mdhaman/superdesk-core,ioanpocol/superdesk-core,superdesk/superdesk-core,ioanpocol/superdesk-core,petrjasek/superdesk-core,petrjasek/superdesk-core,petrjasek/superdesk-core,mdhaman/superdesk-core,mdhaman/superdesk-core,superdesk/superdesk-core | html | ## Code Before:
{% extends "email_layout.html" %}
{% block content %}
{{html_body | safe}}
<br>
<div style="display: flex; flex-direction: row; flex-wrap: wrap;">
{% for report in reports %}
{% if report.type == 'html' %}
{{report.html | safe}}
{% elif report.type == 'image' %}
<div>
<img src="cid:{{report.id}}" width="{{report.width}}px">
</div>
{% endif %}
{% endfor %}
</div>
{% endblock %}
## Instruction:
[SDESK-3499](fix-analytics): Use tables instead of flexbox in scheduled report emails
## Code After:
{% extends "email_layout.html" %}
{% block content %}
{{html_body | safe}}
<br>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
{% for report in reports %}
{% if report.type == 'html' %}
<tr>
<td>
{{report.html | safe}}
</td>
</tr>
{% elif report.type == 'image' %}
<tr>
<td>
<img src="cid:{{report.id}}" style="height: auto !important; max-width: {{report.width}}px !important; width: 100% !important;">
</td>
</tr>
{% endif %}
{% endfor %}
</table>
{% endblock %}
| {% extends "email_layout.html" %}
{% block content %}
{{html_body | safe}}
<br>
- <div style="display: flex; flex-direction: row; flex-wrap: wrap;">
+ <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
{% for report in reports %}
{% if report.type == 'html' %}
+ <tr>
+ <td>
- {{report.html | safe}}
+ {{report.html | safe}}
? ++++++++
+ </td>
+ </tr>
{% elif report.type == 'image' %}
- <div>
? ^^^
+ <tr>
? ^^
- <img src="cid:{{report.id}}" width="{{report.width}}px">
+ <td>
+ <img src="cid:{{report.id}}" style="height: auto !important; max-width: {{report.width}}px !important; width: 100% !important;">
+ </td>
- </div>
? ^^^
+ </tr>
? ^^
{% endif %}
{% endfor %}
- </div>
+ </table>
{% endblock %} | 18 | 1.058824 | 12 | 6 |
45275a48fb434e6a9d895da03e290b84c52694f6 | orbitdeterminator/kep_determination/least_squares.py | orbitdeterminator/kep_determination/least_squares.py |
import numpy as np
import matplotlib.pyplot as plt
# convention:
# a: semi-major axis
# e: eccentricity
# eps: mean longitude at epoch
# Euler angles:
# I: inclination
# Omega: longitude of ascending node
# omega: argument of pericenter |
import math
import numpy as np
import matplotlib.pyplot as plt
# convention:
# a: semi-major axis
# e: eccentricity
# eps: mean longitude at epoch
# Euler angles:
# I: inclination
# Omega: longitude of ascending node
# omega: argument of pericenter
#rotation about the z-axis about an angle `ang`
def rotz(ang):
cos_ang = math.cos(ang)
sin_ang = math.sin(ang)
return np.array(((cos_ang,-sin_ang,0.0), (sin_ang, cos_ang,0.0), (0.0,0.0,1.0)))
#rotation about the x-axis about an angle `ang`
def rotx(ang):
cos_ang = math.cos(ang)
sin_ang = math.sin(ang)
return np.array(((1.0,0.0,0.0), (0.0,cos_ang,-sin_ang), (0.0,sin_ang,cos_ang)))
#rotation from the orbital plane to the inertial frame
#it is composed of the following rotations, in that order:
#1) rotation about the z axis about an angle `omega` (argument of pericenter)
#2) rotation about the x axis about an angle `I` (inclination)
#3) rotation about the z axis about an angle `Omega` (longitude of ascending node)
def op2if(omega,I,Omega):
P2_mul_P3 = np.matmul(rotx(I),rotz(omega))
return np.matmul(rotz(Omega),P2_mul_P3)
omega = math.radians(31.124)
I = math.radians(75.0)
Omega = math.radians(60.0)
# rotation matrix from orbital plane to inertial frame
# two ways to compute it; result should be the same
P_1 = rotz(omega) #rotation about z axis by an angle `omega`
P_2 = rotx(I) #rotation about x axis by an angle `I`
P_3 = rotz(Omega) #rotation about z axis by an angle `Omega`
Rot1 = np.matmul(P_3,np.matmul(P_2,P_1))
Rot2 = op2if(omega,I,Omega)
v = np.array((3.0,-2.0,1.0))
print(I)
print(omega)
print(Omega)
print(Rot1)
print(np.matmul(Rot1,v))
print(Rot2) | Add rotation matrix, from orbital plane to inertial frame | Add rotation matrix, from orbital plane to inertial frame
| Python | mit | aerospaceresearch/orbitdeterminator | python | ## Code Before:
import numpy as np
import matplotlib.pyplot as plt
# convention:
# a: semi-major axis
# e: eccentricity
# eps: mean longitude at epoch
# Euler angles:
# I: inclination
# Omega: longitude of ascending node
# omega: argument of pericenter
## Instruction:
Add rotation matrix, from orbital plane to inertial frame
## Code After:
import math
import numpy as np
import matplotlib.pyplot as plt
# convention:
# a: semi-major axis
# e: eccentricity
# eps: mean longitude at epoch
# Euler angles:
# I: inclination
# Omega: longitude of ascending node
# omega: argument of pericenter
#rotation about the z-axis about an angle `ang`
def rotz(ang):
cos_ang = math.cos(ang)
sin_ang = math.sin(ang)
return np.array(((cos_ang,-sin_ang,0.0), (sin_ang, cos_ang,0.0), (0.0,0.0,1.0)))
#rotation about the x-axis about an angle `ang`
def rotx(ang):
cos_ang = math.cos(ang)
sin_ang = math.sin(ang)
return np.array(((1.0,0.0,0.0), (0.0,cos_ang,-sin_ang), (0.0,sin_ang,cos_ang)))
#rotation from the orbital plane to the inertial frame
#it is composed of the following rotations, in that order:
#1) rotation about the z axis about an angle `omega` (argument of pericenter)
#2) rotation about the x axis about an angle `I` (inclination)
#3) rotation about the z axis about an angle `Omega` (longitude of ascending node)
def op2if(omega,I,Omega):
P2_mul_P3 = np.matmul(rotx(I),rotz(omega))
return np.matmul(rotz(Omega),P2_mul_P3)
omega = math.radians(31.124)
I = math.radians(75.0)
Omega = math.radians(60.0)
# rotation matrix from orbital plane to inertial frame
# two ways to compute it; result should be the same
P_1 = rotz(omega) #rotation about z axis by an angle `omega`
P_2 = rotx(I) #rotation about x axis by an angle `I`
P_3 = rotz(Omega) #rotation about z axis by an angle `Omega`
Rot1 = np.matmul(P_3,np.matmul(P_2,P_1))
Rot2 = op2if(omega,I,Omega)
v = np.array((3.0,-2.0,1.0))
print(I)
print(omega)
print(Omega)
print(Rot1)
print(np.matmul(Rot1,v))
print(Rot2) |
+ import math
import numpy as np
import matplotlib.pyplot as plt
# convention:
# a: semi-major axis
# e: eccentricity
# eps: mean longitude at epoch
# Euler angles:
# I: inclination
# Omega: longitude of ascending node
# omega: argument of pericenter
+
+ #rotation about the z-axis about an angle `ang`
+ def rotz(ang):
+ cos_ang = math.cos(ang)
+ sin_ang = math.sin(ang)
+ return np.array(((cos_ang,-sin_ang,0.0), (sin_ang, cos_ang,0.0), (0.0,0.0,1.0)))
+
+ #rotation about the x-axis about an angle `ang`
+ def rotx(ang):
+ cos_ang = math.cos(ang)
+ sin_ang = math.sin(ang)
+ return np.array(((1.0,0.0,0.0), (0.0,cos_ang,-sin_ang), (0.0,sin_ang,cos_ang)))
+
+ #rotation from the orbital plane to the inertial frame
+ #it is composed of the following rotations, in that order:
+ #1) rotation about the z axis about an angle `omega` (argument of pericenter)
+ #2) rotation about the x axis about an angle `I` (inclination)
+ #3) rotation about the z axis about an angle `Omega` (longitude of ascending node)
+ def op2if(omega,I,Omega):
+ P2_mul_P3 = np.matmul(rotx(I),rotz(omega))
+ return np.matmul(rotz(Omega),P2_mul_P3)
+
+ omega = math.radians(31.124)
+ I = math.radians(75.0)
+ Omega = math.radians(60.0)
+
+ # rotation matrix from orbital plane to inertial frame
+ # two ways to compute it; result should be the same
+ P_1 = rotz(omega) #rotation about z axis by an angle `omega`
+ P_2 = rotx(I) #rotation about x axis by an angle `I`
+ P_3 = rotz(Omega) #rotation about z axis by an angle `Omega`
+
+ Rot1 = np.matmul(P_3,np.matmul(P_2,P_1))
+ Rot2 = op2if(omega,I,Omega)
+
+ v = np.array((3.0,-2.0,1.0))
+
+ print(I)
+ print(omega)
+ print(Omega)
+
+ print(Rot1)
+
+ print(np.matmul(Rot1,v))
+
+ print(Rot2) | 47 | 3.916667 | 47 | 0 |
4428079a68dd0876bd27a1f2e7ccdb35cda23ede | builder/amazon/common/regions.go | builder/amazon/common/regions.go | package common
func listEC2Regions() []string {
return []string{
"ap-northeast-1",
"ap-northeast-2",
"ap-southeast-1",
"ap-southeast-2",
"cn-north-1",
"eu-central-1",
"eu-west-1",
"sa-east-1",
"us-east-1",
"us-gov-west-1",
"us-west-1",
"us-west-2",
}
}
// ValidateRegion returns true if the supplied region is a valid AWS
// region and false if it's not.
func ValidateRegion(region string) bool {
for _, valid := range listEC2Regions() {
if region == valid {
return true
}
}
return false
}
| package common
func listEC2Regions() []string {
return []string{
"ap-northeast-1",
"ap-northeast-2",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"cn-north-1",
"eu-central-1",
"eu-west-1",
"sa-east-1",
"us-east-1",
"us-gov-west-1",
"us-west-1",
"us-west-2",
}
}
// ValidateRegion returns true if the supplied region is a valid AWS
// region and false if it's not.
func ValidateRegion(region string) bool {
for _, valid := range listEC2Regions() {
if region == valid {
return true
}
}
return false
}
| Add support for ap-south-1 in AWS | Add support for ap-south-1 in AWS
Amazon recently announced support for ap-south-1 in Mumbai, adding this
to the list of known regions to Packer
| Go | mpl-2.0 | pecigonzalo/packer,jimmythedog/packer,timsutton/packer,mayflower/packer,markpeek/packer,zhuzhih2017/packer,taliesins/packer,pecigonzalo/packer,taliesins/packer,p1-nico/packer,mkuzmin/packer,youhong316/packer,bryson/packer,paulmey/packer,Akasurde/packer,samdunne/packer,tb3088/packer,paulmey/packer,dayglojesus/packer,tsmolka/packer,sneal/packer,pvandervelde/packer,sneal/packer,jimmythedog/packer,paulmey/packer,c22/packer,grubernaut/packer,dave2/packer,tsmolka/packer,tas50/packer,rnaveiras/packer,dave2/packer,mafrosis/packer,ChrisLundquist/packer,pvanbuijtene/packer,rickard-von-essen/packer,smaato/packer,samdunne/packer,routelastresort/packer,routelastresort/packer,pieter-lazzaro/packer,mitchellh/packer,ChrisLundquist/packer,smaato/packer,markpeek/packer,threatstream/packer,pecigonzalo/packer,youhong316/packer,pvanbuijtene/packer,monkeylittleinc/packer,markpeek/packer,sneal/packer,p1-nico/packer,grubernaut/packer,tsmolka/packer,pvanbuijtene/packer,jen20/packer,smaato/packer,c22/packer,mayflower/packer,hashicorp/packer,tas50/packer,boumenot/packer,mitchellh/packer,mohae/packer,markpeek/packer,mayflower/packer,ChrisLundquist/packer,quantang/packer,atlassian/packer,legal90/packer,youhong316/packer,rnaveiras/packer,ChrisLundquist/packer,markpeek/packer,rnaveiras/packer,dave2/packer,legal90/packer,p1-nico/packer,monkeylittleinc/packer,KohlsTechnology/packer,taliesins/packer,marc-ta/packer,mkuzmin/packer,grange74/packer,mitchellh/packer,arizvisa/packer,dayglojesus/packer,hashicorp/packer,Akasurde/packer,tsmolka/packer,Akasurde/packer,boumenot/packer,ricardclau/packer,arizvisa/packer,sean-/packer,pvandervelde/packer,marc-ta/packer,zhuzhih2017/packer,paulmey/packer,atlassian/packer,pvandervelde/packer,KohlsTechnology/packer,dave2/packer,zhuzhih2017/packer,monkeylittleinc/packer,mkuzmin/packer,life360/packer,atlassian/packer,threatstream/packer,monkeylittleinc/packer,paulmey/packer,threatstream/packer,life360/packer,mitchellh/packer,timsutton/packer,mwhooker/packer,pvandervelde/packer,timsutton/packer,boumenot/packer,jen20/packer,dayglojesus/packer,rickard-von-essen/packer,zhuzhih2017/packer,c22/packer,ricardclau/packer,pvanbuijtene/packer,jimmythedog/packer,arizvisa/packer,ricardclau/packer,paulmey/packer,bryson/packer,dayglojesus/packer,mafrosis/packer,samdunne/packer,bryson/packer,grubernaut/packer,life360/packer,taliesins/packer,grange74/packer,c22/packer,tas50/packer,jen20/packer,c22/packer,tb3088/packer,mayflower/packer,youhong316/packer,mafrosis/packer,sean-/packer,rickard-von-essen/packer,pvanbuijtene/packer,routelastresort/packer,mafrosis/packer,samdunne/packer,p1-nico/packer,routelastresort/packer,KohlsTechnology/packer,Akasurde/packer,pieter-lazzaro/packer,bryson/packer,grubernaut/packer,sneal/packer,monkeylittleinc/packer,c22/packer,quantang/packer,timsutton/packer,marc-ta/packer,mafrosis/packer,jen20/packer,grange74/packer,pieter-lazzaro/packer,jen20/packer,tas50/packer,arizvisa/packer,rickard-von-essen/packer,KohlsTechnology/packer,tb3088/packer,ChrisLundquist/packer,tsmolka/packer,tsmolka/packer,samdunne/packer,tb3088/packer,rnaveiras/packer,quantang/packer,taliesins/packer,legal90/packer,youhong316/packer,timsutton/packer,atlassian/packer,mkuzmin/packer,dayglojesus/packer,p1-nico/packer,jen20/packer,grange74/packer,pecigonzalo/packer,threatstream/packer,tb3088/packer,timsutton/packer,sean-/packer,pieter-lazzaro/packer,taliesins/packer,rnaveiras/packer,legal90/packer,sean-/packer,mkuzmin/packer,rnaveiras/packer,hashicorp/packer,mwhooker/packer,dave2/packer,zhuzhih2017/packer,mitchellh/packer,smaato/packer,grubernaut/packer,dave2/packer,KohlsTechnology/packer,KohlsTechnology/packer,smaato/packer,tas50/packer,bryson/packer,mayflower/packer,zhuzhih2017/packer,marc-ta/packer,sean-/packer,sean-/packer,mwhooker/packer,atlassian/packer,jimmythedog/packer,pvandervelde/packer,youhong316/packer,mohae/packer,mkuzmin/packer,mwhooker/packer,mwhooker/packer,rickard-von-essen/packer,life360/packer,Akasurde/packer,quantang/packer,pvandervelde/packer,grange74/packer,atlassian/packer,mohae/packer,boumenot/packer,arizvisa/packer,markpeek/packer,arizvisa/packer,sneal/packer,pieter-lazzaro/packer,tb3088/packer,quantang/packer,p1-nico/packer,routelastresort/packer,tas50/packer,ricardclau/packer,grubernaut/packer,pieter-lazzaro/packer,mohae/packer,smaato/packer,ricardclau/packer,mohae/packer,jimmythedog/packer,bryson/packer,boumenot/packer,life360/packer,legal90/packer,ChrisLundquist/packer,ricardclau/packer,threatstream/packer,hashicorp/packer | go | ## Code Before:
package common
func listEC2Regions() []string {
return []string{
"ap-northeast-1",
"ap-northeast-2",
"ap-southeast-1",
"ap-southeast-2",
"cn-north-1",
"eu-central-1",
"eu-west-1",
"sa-east-1",
"us-east-1",
"us-gov-west-1",
"us-west-1",
"us-west-2",
}
}
// ValidateRegion returns true if the supplied region is a valid AWS
// region and false if it's not.
func ValidateRegion(region string) bool {
for _, valid := range listEC2Regions() {
if region == valid {
return true
}
}
return false
}
## Instruction:
Add support for ap-south-1 in AWS
Amazon recently announced support for ap-south-1 in Mumbai, adding this
to the list of known regions to Packer
## Code After:
package common
func listEC2Regions() []string {
return []string{
"ap-northeast-1",
"ap-northeast-2",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"cn-north-1",
"eu-central-1",
"eu-west-1",
"sa-east-1",
"us-east-1",
"us-gov-west-1",
"us-west-1",
"us-west-2",
}
}
// ValidateRegion returns true if the supplied region is a valid AWS
// region and false if it's not.
func ValidateRegion(region string) bool {
for _, valid := range listEC2Regions() {
if region == valid {
return true
}
}
return false
}
| package common
func listEC2Regions() []string {
return []string{
"ap-northeast-1",
"ap-northeast-2",
+ "ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"cn-north-1",
"eu-central-1",
"eu-west-1",
"sa-east-1",
"us-east-1",
"us-gov-west-1",
"us-west-1",
"us-west-2",
}
}
// ValidateRegion returns true if the supplied region is a valid AWS
// region and false if it's not.
func ValidateRegion(region string) bool {
for _, valid := range listEC2Regions() {
if region == valid {
return true
}
}
return false
} | 1 | 0.034483 | 1 | 0 |
7456f109bce2b9f07d0c929bef2fd42e6bc4f75d | frontend/scripts/build.sh | frontend/scripts/build.sh | set -e
rm -rf ../backend/dist/*.{css,js}
spago build -u "-g corefn +RTS -N2 -RTS"
zephyr -f Home.main Talk.main Search.main
NODE_ENV=production webpack -p --progress
| set -e
rm -rf ../backend/dist/*.{css,js}
spago build -u "-g corefn +RTS -N2 -RTS"
zephyr -f Home.main Talk.main Search.main +RTS -N2 -RTS
NODE_ENV=production webpack -p --progress
| Set RTS -N2 to zephyr to make circleci happy | Set RTS -N2 to zephyr to make circleci happy
| Shell | bsd-3-clause | rnons/ted2srt,rnons/ted2srt,rnons/ted2srt,rnons/ted2srt | shell | ## Code Before:
set -e
rm -rf ../backend/dist/*.{css,js}
spago build -u "-g corefn +RTS -N2 -RTS"
zephyr -f Home.main Talk.main Search.main
NODE_ENV=production webpack -p --progress
## Instruction:
Set RTS -N2 to zephyr to make circleci happy
## Code After:
set -e
rm -rf ../backend/dist/*.{css,js}
spago build -u "-g corefn +RTS -N2 -RTS"
zephyr -f Home.main Talk.main Search.main +RTS -N2 -RTS
NODE_ENV=production webpack -p --progress
| set -e
rm -rf ../backend/dist/*.{css,js}
spago build -u "-g corefn +RTS -N2 -RTS"
- zephyr -f Home.main Talk.main Search.main
+ zephyr -f Home.main Talk.main Search.main +RTS -N2 -RTS
? ++++++++++++++
NODE_ENV=production webpack -p --progress | 2 | 0.222222 | 1 | 1 |
93057b0bf30e1d4c4449fb5f3322042bf74d76e5 | satchmo/shop/management/commands/satchmo_copy_static.py | satchmo/shop/management/commands/satchmo_copy_static.py | from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
static_dest = os.path.join(os.getcwd(), 'static')
shutil.copytree(static_src, static_dest)
print "Copied %s to %s" % (static_src, static_dest)
| from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
static_dest = os.path.join(os.getcwd(), 'static')
if os.path.exists(static_dest):
print "Static directory exists. You must manually copy the files you need."
else:
shutil.copytree(static_src, static_dest)
print "Copied %s to %s" % (static_src, static_dest)
| Add an error check to static copying | Add an error check to static copying
| Python | bsd-3-clause | grengojbo/satchmo,grengojbo/satchmo | python | ## Code Before:
from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
static_dest = os.path.join(os.getcwd(), 'static')
shutil.copytree(static_src, static_dest)
print "Copied %s to %s" % (static_src, static_dest)
## Instruction:
Add an error check to static copying
## Code After:
from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
static_dest = os.path.join(os.getcwd(), 'static')
if os.path.exists(static_dest):
print "Static directory exists. You must manually copy the files you need."
else:
shutil.copytree(static_src, static_dest)
print "Copied %s to %s" % (static_src, static_dest)
| from django.core.management.base import NoArgsCommand
import os
import shutil
class Command(NoArgsCommand):
help = "Copy the satchmo static directory and files to the local project."
def handle_noargs(self, **options):
import satchmo
static_src = os.path.join(satchmo.__path__[0],'static')
static_dest = os.path.join(os.getcwd(), 'static')
+ if os.path.exists(static_dest):
+ print "Static directory exists. You must manually copy the files you need."
+ else:
- shutil.copytree(static_src, static_dest)
+ shutil.copytree(static_src, static_dest)
? ++++
- print "Copied %s to %s" % (static_src, static_dest)
+ print "Copied %s to %s" % (static_src, static_dest)
? ++++
| 7 | 0.538462 | 5 | 2 |
6176fac570a41c8e5743ae98ce3d0c03cd2e86fa | .travis.yml | .travis.yml | language: php
php: [5.3.3, 5.3, 5.4, 5.5, 5.6, hhvm]
matrix:
allow_failures:
- php: 5.6
before_script:
- composer selfupdate
- export COMPOSER_ROOT_VERSION=2.0.0-RC3
- composer install --prefer-source
script:
- bin/phpspec run
- ./vendor/bin/behat --format=pretty
| language: php
php: [5.3.3, 5.3, 5.4, 5.5, 5.6, hhvm, hhvm-nightly]
matrix:
allow_failures:
- php: 5.6
- php: hhvm
before_script:
- composer selfupdate
- export COMPOSER_ROOT_VERSION=2.0.0-RC3
- composer install --prefer-source
script:
- bin/phpspec run
- ./vendor/bin/behat --format=pretty
| Use HHVM nightly since 3.1 has regressions in the Reflection API. | Use HHVM nightly since 3.1 has regressions in the Reflection API.
| YAML | mit | ghamoron/phpspec,Elfiggo/phpspec,docteurklein/phpspec,javi-dev/phpspec,sroze/phpspec,ulabox/phpspec,localheinz/phpspec,localheinz/phpspec,javi-dev/phpspec,ghamoron/phpspec,gnugat-forks/phpspec,rawkode/phpspec,jon-acker/phpspec,Elfiggo/phpspec,danielkmariam/phpspec,sroze/phpspec,carlosV2/phpspec,nosun/phpspec,jon-acker/phpspec,pamil/phpspec,iakio/phpspec,danielkmariam/phpspec,pamil/phpspec,shanethehat/phpspec,Harrisonbro/phpspec,nosun/phpspec,bestform/phpspec,shanethehat/phpspec,gnugat-forks/phpspec,Dragonrun1/phpspec,iakio/phpspec,ulabox/phpspec,rawkode/phpspec,Harrisonbro/phpspec,carlosV2/phpspec,Dragonrun1/phpspec,docteurklein/phpspec,bestform/phpspec | yaml | ## Code Before:
language: php
php: [5.3.3, 5.3, 5.4, 5.5, 5.6, hhvm]
matrix:
allow_failures:
- php: 5.6
before_script:
- composer selfupdate
- export COMPOSER_ROOT_VERSION=2.0.0-RC3
- composer install --prefer-source
script:
- bin/phpspec run
- ./vendor/bin/behat --format=pretty
## Instruction:
Use HHVM nightly since 3.1 has regressions in the Reflection API.
## Code After:
language: php
php: [5.3.3, 5.3, 5.4, 5.5, 5.6, hhvm, hhvm-nightly]
matrix:
allow_failures:
- php: 5.6
- php: hhvm
before_script:
- composer selfupdate
- export COMPOSER_ROOT_VERSION=2.0.0-RC3
- composer install --prefer-source
script:
- bin/phpspec run
- ./vendor/bin/behat --format=pretty
| language: php
- php: [5.3.3, 5.3, 5.4, 5.5, 5.6, hhvm]
+ php: [5.3.3, 5.3, 5.4, 5.5, 5.6, hhvm, hhvm-nightly]
? ++++++++++++++
matrix:
allow_failures:
- php: 5.6
+ - php: hhvm
before_script:
- composer selfupdate
- export COMPOSER_ROOT_VERSION=2.0.0-RC3
- composer install --prefer-source
script:
- bin/phpspec run
- ./vendor/bin/behat --format=pretty | 3 | 0.1875 | 2 | 1 |
3848f2fc9b1d3e602aef5977d7d19f438a44bb89 | src/containers/Projects/index.js | src/containers/Projects/index.js | /* eslint-disable no-unused-vars*/
import React, { Component } from 'react';
/* eslint-enable no-unused-vars*/
import { Jumbotron } from 'react-bootstrap';
const Projects = () => (
<div>
<Jumbotron style={ {
paddingLeft: '10px',
borderRadius: '2em',
boxShadow: '10px 5px 5px #888888',
margin: '0 15px' } }
>
<h2>{'A few things I\'ve been working on'}</h2>
</Jumbotron>
<div
style={ {
width: '30%',
height: 'auto',
marginTop: '2%',
marginLeft: '10%' } }
>
<a href={"https://github.com/pl12133/react-solitaire"}>
<image
style={ {
width: '100%',
borderRadius: '1em' } }
src='dist/solitaire-demo.gif'
/>
</a>
</div>
</div>
);
export default Projects;
| /* eslint-disable no-unused-vars*/
import React, { Component } from 'react';
/* eslint-enable no-unused-vars*/
import { Jumbotron } from 'react-bootstrap';
const Projects = () => (
<div>
<Jumbotron style={ {
paddingLeft: '10px',
borderRadius: '2em',
boxShadow: '10px 5px 5px #888888',
margin: '0 15px' } }
>
<h2>{'A few things I\'ve been working on'}</h2>
</Jumbotron>
<div
style={ {
width: '30%',
height: 'auto',
marginTop: '2%',
marginLeft: '10%' } }
>
<a href={"https://pl12133.github.io/react-solitaire"}>
<image
style={ {
width: '100%',
borderRadius: '1em' } }
src='dist/solitaire-demo.gif'
/>
</a>
</div>
</div>
);
export default Projects;
| Change URL of project image | Change URL of project image
| JavaScript | mit | pl12133/pl12133.github.io,pl12133/pl12133.github.io | javascript | ## Code Before:
/* eslint-disable no-unused-vars*/
import React, { Component } from 'react';
/* eslint-enable no-unused-vars*/
import { Jumbotron } from 'react-bootstrap';
const Projects = () => (
<div>
<Jumbotron style={ {
paddingLeft: '10px',
borderRadius: '2em',
boxShadow: '10px 5px 5px #888888',
margin: '0 15px' } }
>
<h2>{'A few things I\'ve been working on'}</h2>
</Jumbotron>
<div
style={ {
width: '30%',
height: 'auto',
marginTop: '2%',
marginLeft: '10%' } }
>
<a href={"https://github.com/pl12133/react-solitaire"}>
<image
style={ {
width: '100%',
borderRadius: '1em' } }
src='dist/solitaire-demo.gif'
/>
</a>
</div>
</div>
);
export default Projects;
## Instruction:
Change URL of project image
## Code After:
/* eslint-disable no-unused-vars*/
import React, { Component } from 'react';
/* eslint-enable no-unused-vars*/
import { Jumbotron } from 'react-bootstrap';
const Projects = () => (
<div>
<Jumbotron style={ {
paddingLeft: '10px',
borderRadius: '2em',
boxShadow: '10px 5px 5px #888888',
margin: '0 15px' } }
>
<h2>{'A few things I\'ve been working on'}</h2>
</Jumbotron>
<div
style={ {
width: '30%',
height: 'auto',
marginTop: '2%',
marginLeft: '10%' } }
>
<a href={"https://pl12133.github.io/react-solitaire"}>
<image
style={ {
width: '100%',
borderRadius: '1em' } }
src='dist/solitaire-demo.gif'
/>
</a>
</div>
</div>
);
export default Projects;
| /* eslint-disable no-unused-vars*/
import React, { Component } from 'react';
/* eslint-enable no-unused-vars*/
import { Jumbotron } from 'react-bootstrap';
const Projects = () => (
<div>
<Jumbotron style={ {
paddingLeft: '10px',
borderRadius: '2em',
boxShadow: '10px 5px 5px #888888',
margin: '0 15px' } }
>
<h2>{'A few things I\'ve been working on'}</h2>
</Jumbotron>
<div
style={ {
width: '30%',
height: 'auto',
marginTop: '2%',
marginLeft: '10%' } }
>
- <a href={"https://github.com/pl12133/react-solitaire"}>
? ^ ---------
+ <a href={"https://pl12133.github.io/react-solitaire"}>
? ++++++++ ^
<image
style={ {
width: '100%',
borderRadius: '1em' } }
src='dist/solitaire-demo.gif'
/>
</a>
</div>
</div>
);
export default Projects; | 2 | 0.055556 | 1 | 1 |
f88527069993753a3497fac83be151c7b52bab48 | projects/angular-dual-listbox/tsconfig.lib.prod.json | projects/angular-dual-listbox/tsconfig.lib.prod.json | {
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": true
}
}
| {
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": true,
"compilationMode": "partial"
}
}
| Enable partial compilation for Ivy | Enable partial compilation for Ivy
| JSON | mit | czeckd/angular-dual-listbox,czeckd/angular-dual-listbox,czeckd/angular-dual-listbox | json | ## Code Before:
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": true
}
}
## Instruction:
Enable partial compilation for Ivy
## Code After:
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": true,
"compilationMode": "partial"
}
}
| {
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
- "enableIvy": true
+ "enableIvy": true,
? +
+ "compilationMode": "partial"
}
} | 3 | 0.333333 | 2 | 1 |
96467786cb297badbe1294a3bba0f92ba839f93a | content/fr/products/products/signaler-un-cybercrime.md | content/fr/products/products/signaler-un-cybercrime.md | ---
title: Signaler un cybercrime
translationKey: report-cybercrime
description: >
Explorer la possibilité de mettre en place un service permettant aux Canadiens
et aux entreprises de signaler plus aisément les crimes informatiques et
facilitant le travail d'analyse et d'enquête de la police.
phase: alpha
contact:
- email: daniel.tse@tbs-sct.gc.ca
name: Daniel Tse
partners:
- name: Gendarmerie royale du Canada
url: 'http://www.rcmp-grc.gc.ca/fr'
status: in-flight
links:
- name: GitHub
url: 'https://github.com/cds-snc/report-a-cybercrime'
---
| ---
title: Signaler un crime informatique
translationKey: report-cybercrime
description: >
Explorer la possibilité de mettre en place un service permettant aux Canadiens
et aux entreprises de signaler plus aisément les crimes informatiques et
facilitant le travail d'analyse et d'enquête de la police.
phase: alpha
contact:
- email: daniel.tse@tbs-sct.gc.ca
name: Daniel Tse
partners:
- name: Gendarmerie royale du Canada
url: 'http://www.rcmp-grc.gc.ca/fr'
status: in-flight
links:
- name: GitHub
url: 'https://github.com/cds-snc/report-a-cybercrime'
---
| Update French name to be consistent with others | Update French name to be consistent with others | Markdown | mit | cds-snc/digital-canada-ca,cds-snc/digital-canada-ca | markdown | ## Code Before:
---
title: Signaler un cybercrime
translationKey: report-cybercrime
description: >
Explorer la possibilité de mettre en place un service permettant aux Canadiens
et aux entreprises de signaler plus aisément les crimes informatiques et
facilitant le travail d'analyse et d'enquête de la police.
phase: alpha
contact:
- email: daniel.tse@tbs-sct.gc.ca
name: Daniel Tse
partners:
- name: Gendarmerie royale du Canada
url: 'http://www.rcmp-grc.gc.ca/fr'
status: in-flight
links:
- name: GitHub
url: 'https://github.com/cds-snc/report-a-cybercrime'
---
## Instruction:
Update French name to be consistent with others
## Code After:
---
title: Signaler un crime informatique
translationKey: report-cybercrime
description: >
Explorer la possibilité de mettre en place un service permettant aux Canadiens
et aux entreprises de signaler plus aisément les crimes informatiques et
facilitant le travail d'analyse et d'enquête de la police.
phase: alpha
contact:
- email: daniel.tse@tbs-sct.gc.ca
name: Daniel Tse
partners:
- name: Gendarmerie royale du Canada
url: 'http://www.rcmp-grc.gc.ca/fr'
status: in-flight
links:
- name: GitHub
url: 'https://github.com/cds-snc/report-a-cybercrime'
---
| ---
- title: Signaler un cybercrime
+ title: Signaler un crime informatique
translationKey: report-cybercrime
description: >
Explorer la possibilité de mettre en place un service permettant aux Canadiens
et aux entreprises de signaler plus aisément les crimes informatiques et
facilitant le travail d'analyse et d'enquête de la police.
phase: alpha
contact:
- email: daniel.tse@tbs-sct.gc.ca
name: Daniel Tse
partners:
- name: Gendarmerie royale du Canada
url: 'http://www.rcmp-grc.gc.ca/fr'
status: in-flight
links:
- name: GitHub
url: 'https://github.com/cds-snc/report-a-cybercrime'
---
| 2 | 0.1 | 1 | 1 |
9f9c1ea2a8179a4d3b5f054a87fa43795bdec783 | bin/deploy.sh | bin/deploy.sh |
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR"/..
source .env
if [ "$ENV" = "production" ]; then
# Update repository
git checkout master
git fetch -tp
git pull
fi
# Build and start container
docker build -t "$PROJECT_NAME:$ENV" .
docker network inspect "$PROJECT_NAME" &>/dev/null ||
docker network create --driver bridge "$PROJECT_NAME"
docker stop "$PROJECT_NAME" || true
docker container prune --force --filter "until=336h"
docker container rm "$PROJECT_NAME" || true
docker run \
--detach \
--restart=always \
--publish="127.0.0.1:$INTERNAL_PORT:$INTERNAL_PORT" \
--mount type=bind,source="$(pwd)"/app/static,target=/var/www/app/app/static \
--mount type=bind,source="$(pwd)"/logs,target=/var/www/app/logs \
--name="$PROJECT_NAME" "$PROJECT_NAME:$ENV"
if [ "$ENV" = "production" ]; then
# Cleanup docker
docker image prune --force --filter "until=336h"
# Update nginx
sudo service nginx reload
fi
|
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR"/..
source .env
if [ "$ENV" = "production" ]; then
# Update repository
git checkout master
git fetch -tp
git pull
fi
# Build and start container
docker build -t "$PROJECT_NAME:$ENV" .
docker network inspect "$PROJECT_NAME" &>/dev/null ||
docker network create --driver bridge "$PROJECT_NAME"
docker stop "$PROJECT_NAME" || true
docker container prune --force --filter "until=336h"
docker container rm "$PROJECT_NAME" || true
docker run \
--detach \
--restart=always \
--publish="127.0.0.1:$INTERNAL_PORT:$INTERNAL_PORT" \
--network="$PROJECT_NAME" \
--mount type=bind,source="$(pwd)"/app/static,target=/var/www/app/app/static \
--mount type=bind,source="$(pwd)"/logs,target=/var/www/app/logs \
--name="$PROJECT_NAME" "$PROJECT_NAME:$ENV"
if [ "$ENV" = "production" ]; then
# Cleanup docker
docker image prune --force --filter "until=336h"
# Update nginx
sudo service nginx reload
fi
| Connect docker container to network | Connect docker container to network
| Shell | mit | albertyw/base-flask,albertyw/base-flask,albertyw/base-flask,albertyw/base-flask | shell | ## Code Before:
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR"/..
source .env
if [ "$ENV" = "production" ]; then
# Update repository
git checkout master
git fetch -tp
git pull
fi
# Build and start container
docker build -t "$PROJECT_NAME:$ENV" .
docker network inspect "$PROJECT_NAME" &>/dev/null ||
docker network create --driver bridge "$PROJECT_NAME"
docker stop "$PROJECT_NAME" || true
docker container prune --force --filter "until=336h"
docker container rm "$PROJECT_NAME" || true
docker run \
--detach \
--restart=always \
--publish="127.0.0.1:$INTERNAL_PORT:$INTERNAL_PORT" \
--mount type=bind,source="$(pwd)"/app/static,target=/var/www/app/app/static \
--mount type=bind,source="$(pwd)"/logs,target=/var/www/app/logs \
--name="$PROJECT_NAME" "$PROJECT_NAME:$ENV"
if [ "$ENV" = "production" ]; then
# Cleanup docker
docker image prune --force --filter "until=336h"
# Update nginx
sudo service nginx reload
fi
## Instruction:
Connect docker container to network
## Code After:
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR"/..
source .env
if [ "$ENV" = "production" ]; then
# Update repository
git checkout master
git fetch -tp
git pull
fi
# Build and start container
docker build -t "$PROJECT_NAME:$ENV" .
docker network inspect "$PROJECT_NAME" &>/dev/null ||
docker network create --driver bridge "$PROJECT_NAME"
docker stop "$PROJECT_NAME" || true
docker container prune --force --filter "until=336h"
docker container rm "$PROJECT_NAME" || true
docker run \
--detach \
--restart=always \
--publish="127.0.0.1:$INTERNAL_PORT:$INTERNAL_PORT" \
--network="$PROJECT_NAME" \
--mount type=bind,source="$(pwd)"/app/static,target=/var/www/app/app/static \
--mount type=bind,source="$(pwd)"/logs,target=/var/www/app/logs \
--name="$PROJECT_NAME" "$PROJECT_NAME:$ENV"
if [ "$ENV" = "production" ]; then
# Cleanup docker
docker image prune --force --filter "until=336h"
# Update nginx
sudo service nginx reload
fi
|
set -exuo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR"/..
source .env
if [ "$ENV" = "production" ]; then
# Update repository
git checkout master
git fetch -tp
git pull
fi
# Build and start container
docker build -t "$PROJECT_NAME:$ENV" .
docker network inspect "$PROJECT_NAME" &>/dev/null ||
docker network create --driver bridge "$PROJECT_NAME"
docker stop "$PROJECT_NAME" || true
docker container prune --force --filter "until=336h"
docker container rm "$PROJECT_NAME" || true
docker run \
--detach \
--restart=always \
--publish="127.0.0.1:$INTERNAL_PORT:$INTERNAL_PORT" \
+ --network="$PROJECT_NAME" \
--mount type=bind,source="$(pwd)"/app/static,target=/var/www/app/app/static \
--mount type=bind,source="$(pwd)"/logs,target=/var/www/app/logs \
--name="$PROJECT_NAME" "$PROJECT_NAME:$ENV"
if [ "$ENV" = "production" ]; then
# Cleanup docker
docker image prune --force --filter "until=336h"
# Update nginx
sudo service nginx reload
fi | 1 | 0.026316 | 1 | 0 |
e5a9a14cfb339bd2c0e86b1fb3c6031721fe6911 | lib/rack/insight/enable-button.rb | lib/rack/insight/enable-button.rb | module Rack::Insight
class EnableButton
include Render
MIME_TYPES = ["text/plain", "text/html", "application/xhtml+xml"]
def initialize(app, insight)
@app = app
@insight = insight
end
def call(env)
@env = env
status, headers, body = @app.call(@env)
if !body.nil? && body.respond_to?('body') && !body.body.empty?
response = Rack::Response.new(body, status, headers)
inject_button(response) if okay_to_modify?(env, response)
response.to_a
else
# Do not inject into assets served by rails or other detritus without a body.
[status, headers, body]
end
end
def okay_to_modify?(env, response)
return false unless response.ok?
req = Rack::Request.new(env)
content_type, charset = response.content_type.split(";")
filters = (env['rack-insight.path_filters'] || []).map { |str| %r(^#{str}) }
filter = filters.find { |filter| env['REQUEST_PATH'] =~ filter }
!filter && MIME_TYPES.include?(content_type) && !req.xhr?
end
def inject_button(response)
full_body = response.body.join
full_body.sub! /<\/body>/, render + "</body>"
response["Content-Length"] = full_body.bytesize.to_s
response.body = [full_body]
end
def render
render_template("enable-button")
end
end
end
| module Rack::Insight
class EnableButton < Struct.new :app, :insight
include Render
CONTENT_TYPE_REGEX = /text\/(html|plain)|application\/xhtml\+xml/
def call(env)
status, headers, response = app.call(env)
if okay_to_modify?(env, headers)
body = response.inject("") do |memo, part|
memo << part
memo
end
index = body.rindex("</body>")
if index
body.insert(index, render)
headers["Content-Length"] = body.bytesize.to_s
response = [body]
end
end
[status, headers, response]
end
def okay_to_modify?(env, headers)
return false unless headers["Content-Type"] =~ CONTENT_TYPE_REGEX
return !(filters.find { |filter| env["REQUEST_PATH"] =~ filter })
end
def filters
(env["rack-insight.path_filters"] || []).map { |str| %r(^#{str}) }
end
def render
render_template("enable-button")
end
end
end
| Complete rewrite of `EnableButton` to ensure compatibility with all other Rack apps | Complete rewrite of `EnableButton` to ensure compatibility with all other Rack apps
| Ruby | mit | pboling/rack-insight,pboling/rack-insight,pboling/rack-insight | ruby | ## Code Before:
module Rack::Insight
class EnableButton
include Render
MIME_TYPES = ["text/plain", "text/html", "application/xhtml+xml"]
def initialize(app, insight)
@app = app
@insight = insight
end
def call(env)
@env = env
status, headers, body = @app.call(@env)
if !body.nil? && body.respond_to?('body') && !body.body.empty?
response = Rack::Response.new(body, status, headers)
inject_button(response) if okay_to_modify?(env, response)
response.to_a
else
# Do not inject into assets served by rails or other detritus without a body.
[status, headers, body]
end
end
def okay_to_modify?(env, response)
return false unless response.ok?
req = Rack::Request.new(env)
content_type, charset = response.content_type.split(";")
filters = (env['rack-insight.path_filters'] || []).map { |str| %r(^#{str}) }
filter = filters.find { |filter| env['REQUEST_PATH'] =~ filter }
!filter && MIME_TYPES.include?(content_type) && !req.xhr?
end
def inject_button(response)
full_body = response.body.join
full_body.sub! /<\/body>/, render + "</body>"
response["Content-Length"] = full_body.bytesize.to_s
response.body = [full_body]
end
def render
render_template("enable-button")
end
end
end
## Instruction:
Complete rewrite of `EnableButton` to ensure compatibility with all other Rack apps
## Code After:
module Rack::Insight
class EnableButton < Struct.new :app, :insight
include Render
CONTENT_TYPE_REGEX = /text\/(html|plain)|application\/xhtml\+xml/
def call(env)
status, headers, response = app.call(env)
if okay_to_modify?(env, headers)
body = response.inject("") do |memo, part|
memo << part
memo
end
index = body.rindex("</body>")
if index
body.insert(index, render)
headers["Content-Length"] = body.bytesize.to_s
response = [body]
end
end
[status, headers, response]
end
def okay_to_modify?(env, headers)
return false unless headers["Content-Type"] =~ CONTENT_TYPE_REGEX
return !(filters.find { |filter| env["REQUEST_PATH"] =~ filter })
end
def filters
(env["rack-insight.path_filters"] || []).map { |str| %r(^#{str}) }
end
def render
render_template("enable-button")
end
end
end
| module Rack::Insight
- class EnableButton
+ class EnableButton < Struct.new :app, :insight
include Render
- MIME_TYPES = ["text/plain", "text/html", "application/xhtml+xml"]
+ CONTENT_TYPE_REGEX = /text\/(html|plain)|application\/xhtml\+xml/
- def initialize(app, insight)
- @app = app
- @insight = insight
+ def call(env)
+ status, headers, response = app.call(env)
+
+ if okay_to_modify?(env, headers)
+ body = response.inject("") do |memo, part|
+ memo << part
+ memo
+ end
+ index = body.rindex("</body>")
+ if index
+ body.insert(index, render)
+ headers["Content-Length"] = body.bytesize.to_s
+ response = [body]
+ end
+ end
+
+ [status, headers, response]
end
+ def okay_to_modify?(env, headers)
+ return false unless headers["Content-Type"] =~ CONTENT_TYPE_REGEX
+ return !(filters.find { |filter| env["REQUEST_PATH"] =~ filter })
- def call(env)
- @env = env
- status, headers, body = @app.call(@env)
-
- if !body.nil? && body.respond_to?('body') && !body.body.empty?
- response = Rack::Response.new(body, status, headers)
- inject_button(response) if okay_to_modify?(env, response)
-
- response.to_a
- else
- # Do not inject into assets served by rails or other detritus without a body.
- [status, headers, body]
- end
end
+ def filters
- def okay_to_modify?(env, response)
- return false unless response.ok?
-
- req = Rack::Request.new(env)
- content_type, charset = response.content_type.split(";")
- filters = (env['rack-insight.path_filters'] || []).map { |str| %r(^#{str}) }
? ---------- ^ ^
+ (env["rack-insight.path_filters"] || []).map { |str| %r(^#{str}) }
? ^ ^
- filter = filters.find { |filter| env['REQUEST_PATH'] =~ filter }
-
- !filter && MIME_TYPES.include?(content_type) && !req.xhr?
- end
-
- def inject_button(response)
- full_body = response.body.join
- full_body.sub! /<\/body>/, render + "</body>"
-
- response["Content-Length"] = full_body.bytesize.to_s
-
- response.body = [full_body]
end
def render
render_template("enable-button")
end
end
end | 60 | 1.176471 | 24 | 36 |
0087ca4409438778da9d5c184a7cbb57e7af43b3 | README.md | README.md |
[](https://greenkeeper.io/)
[](https://travis-ci.org/ChristianMurphy/grunt-remark)
[](https://david-dm.org/ChristianMurphy/grunt-remark)
[](https://david-dm.org/ChristianMurphy/grunt-remark?type=dev)
> Process markdown with [remark](http://remark.js.org/)
## example
``` js
'use strict';
module.exports = grunt => {
grunt.loadNpmTasks('grunt-remark');
grunt.loadTasks('tasks');
grunt.initConfig({
remark: {
src: ['*.md']
}
});
grunt.registerTask('default', ['remark']);
};
```
## options
See full list of options [here](https://github.com/wooorm/unified-engine-gulp#options).
|
[](https://travis-ci.org/ChristianMurphy/grunt-remark)
[](https://greenkeeper.io/)
[](https://david-dm.org/ChristianMurphy/grunt-remark)
[](https://david-dm.org/ChristianMurphy/grunt-remark?type=dev)
> Process markdown with [remark](http://remark.js.org/)
## example
``` js
'use strict';
module.exports = grunt => {
grunt.loadNpmTasks('grunt-remark');
grunt.loadTasks('tasks');
grunt.initConfig({
remark: {
src: ['*.md']
}
});
grunt.registerTask('default', ['remark']);
};
```
## options
See full list of options [here](https://github.com/wooorm/unified-engine-gulp#options).
| Move Greenkeeper badge next to other badges | Move Greenkeeper badge next to other badges
| Markdown | mit | ChristianMurphy/grunt-remark | markdown | ## Code Before:
[](https://greenkeeper.io/)
[](https://travis-ci.org/ChristianMurphy/grunt-remark)
[](https://david-dm.org/ChristianMurphy/grunt-remark)
[](https://david-dm.org/ChristianMurphy/grunt-remark?type=dev)
> Process markdown with [remark](http://remark.js.org/)
## example
``` js
'use strict';
module.exports = grunt => {
grunt.loadNpmTasks('grunt-remark');
grunt.loadTasks('tasks');
grunt.initConfig({
remark: {
src: ['*.md']
}
});
grunt.registerTask('default', ['remark']);
};
```
## options
See full list of options [here](https://github.com/wooorm/unified-engine-gulp#options).
## Instruction:
Move Greenkeeper badge next to other badges
## Code After:
[](https://travis-ci.org/ChristianMurphy/grunt-remark)
[](https://greenkeeper.io/)
[](https://david-dm.org/ChristianMurphy/grunt-remark)
[](https://david-dm.org/ChristianMurphy/grunt-remark?type=dev)
> Process markdown with [remark](http://remark.js.org/)
## example
``` js
'use strict';
module.exports = grunt => {
grunt.loadNpmTasks('grunt-remark');
grunt.loadTasks('tasks');
grunt.initConfig({
remark: {
src: ['*.md']
}
});
grunt.registerTask('default', ['remark']);
};
```
## options
See full list of options [here](https://github.com/wooorm/unified-engine-gulp#options).
| -
- [](https://greenkeeper.io/)
[](https://travis-ci.org/ChristianMurphy/grunt-remark)
+ [](https://greenkeeper.io/)
[](https://david-dm.org/ChristianMurphy/grunt-remark)
[](https://david-dm.org/ChristianMurphy/grunt-remark?type=dev)
> Process markdown with [remark](http://remark.js.org/)
## example
``` js
'use strict';
module.exports = grunt => {
grunt.loadNpmTasks('grunt-remark');
grunt.loadTasks('tasks');
grunt.initConfig({
remark: {
src: ['*.md']
}
});
grunt.registerTask('default', ['remark']);
};
```
## options
See full list of options [here](https://github.com/wooorm/unified-engine-gulp#options). | 3 | 0.103448 | 1 | 2 |
3d802573a82911830ca5da15f2b35aa21e73ae9d | run_deploy.sh | run_deploy.sh | DIR=$(cd $(dirname "$0"); pwd)
# Create environment
$DIR/set_env.sh
cd $WORKSPACE/repo
rvm use 2.1.2
bundle exec berks up
| DIR=$(cd $(dirname "$0"); pwd)
# Create environment
$DIR/set_env.sh
cd $WORKSPACE/repo
rvm use 2.1.2
bundle exec berks up
if [ $? == 0 ];
then
VERSION=`cat $WORKSPACE/repo/metadata.rb | grep -m1 version | sed 's/'\''//g' | awk '{print "v"$2}'`
COOKBOOK=`cat $WORKSPACE/repo/metadata.rb | grep -m1 name | sed 's/'\''//g' | cut -d ' ' -f2`
# Write log to Elasticsearch via logstash for Grafana annotations
echo "{ \"type\": \"chef-deploy\", \"cookbook\": \"${COOKBOOK}\", \"version\": ${VERSION}\" }'" | nc -q1 -u 127.0.0.1 5228
fi
| Add logging of chef deploys to logstash | Add logging of chef deploys to logstash
| Shell | mit | optoro-devops/chef-ci,smedefind/chef-ci | shell | ## Code Before:
DIR=$(cd $(dirname "$0"); pwd)
# Create environment
$DIR/set_env.sh
cd $WORKSPACE/repo
rvm use 2.1.2
bundle exec berks up
## Instruction:
Add logging of chef deploys to logstash
## Code After:
DIR=$(cd $(dirname "$0"); pwd)
# Create environment
$DIR/set_env.sh
cd $WORKSPACE/repo
rvm use 2.1.2
bundle exec berks up
if [ $? == 0 ];
then
VERSION=`cat $WORKSPACE/repo/metadata.rb | grep -m1 version | sed 's/'\''//g' | awk '{print "v"$2}'`
COOKBOOK=`cat $WORKSPACE/repo/metadata.rb | grep -m1 name | sed 's/'\''//g' | cut -d ' ' -f2`
# Write log to Elasticsearch via logstash for Grafana annotations
echo "{ \"type\": \"chef-deploy\", \"cookbook\": \"${COOKBOOK}\", \"version\": ${VERSION}\" }'" | nc -q1 -u 127.0.0.1 5228
fi
| DIR=$(cd $(dirname "$0"); pwd)
# Create environment
$DIR/set_env.sh
cd $WORKSPACE/repo
rvm use 2.1.2
bundle exec berks up
+ if [ $? == 0 ];
+ then
+ VERSION=`cat $WORKSPACE/repo/metadata.rb | grep -m1 version | sed 's/'\''//g' | awk '{print "v"$2}'`
+ COOKBOOK=`cat $WORKSPACE/repo/metadata.rb | grep -m1 name | sed 's/'\''//g' | cut -d ' ' -f2`
+ # Write log to Elasticsearch via logstash for Grafana annotations
+ echo "{ \"type\": \"chef-deploy\", \"cookbook\": \"${COOKBOOK}\", \"version\": ${VERSION}\" }'" | nc -q1 -u 127.0.0.1 5228
+ fi | 7 | 0.875 | 7 | 0 |
f7670bfe76ab2408a1445094c20a1feca91cfd98 | lib/mix/tasks/battle_snake/createdb.ex | lib/mix/tasks/battle_snake/createdb.ex | defmodule Mix.Tasks.BattleSnake.Createdb do
alias BattleSnake.GameForm
use Mix.Task
@shortdoc "creates the mnesia database"
def run(_) do
:stopped = :mnesia.stop
:ok = :mnesia.delete_schema([node()])
:ok = :mnesia.create_schema([node()])
:ok = :mnesia.start()
{:atomic, :ok} = :mnesia.create_table(GameForm, GameForm.table)
end
end
| defmodule Mix.Tasks.BattleSnake.Createdb do
alias BattleSnake.GameForm
use Mix.Task
@shortdoc "creates the mnesia database"
def run(_) do
:stopped = :mnesia.stop
:ok = :mnesia.delete_schema([node()])
:ok = :mnesia.create_schema([node()])
:ok = :mnesia.start()
{:atomic, :ok} = :mnesia.create_table(
GameForm,
[{:disc_copies, [node()]} |
GameForm.table])
end
end
| Maintain a disk copy of the game form table. | Maintain a disk copy of the game form table.
| Elixir | agpl-3.0 | Dkendal/battle_snake,Dkendal/battle_snake,Dkendal/battle_snake,Dkendal/battle_snake,Dkendal/battle_snake | elixir | ## Code Before:
defmodule Mix.Tasks.BattleSnake.Createdb do
alias BattleSnake.GameForm
use Mix.Task
@shortdoc "creates the mnesia database"
def run(_) do
:stopped = :mnesia.stop
:ok = :mnesia.delete_schema([node()])
:ok = :mnesia.create_schema([node()])
:ok = :mnesia.start()
{:atomic, :ok} = :mnesia.create_table(GameForm, GameForm.table)
end
end
## Instruction:
Maintain a disk copy of the game form table.
## Code After:
defmodule Mix.Tasks.BattleSnake.Createdb do
alias BattleSnake.GameForm
use Mix.Task
@shortdoc "creates the mnesia database"
def run(_) do
:stopped = :mnesia.stop
:ok = :mnesia.delete_schema([node()])
:ok = :mnesia.create_schema([node()])
:ok = :mnesia.start()
{:atomic, :ok} = :mnesia.create_table(
GameForm,
[{:disc_copies, [node()]} |
GameForm.table])
end
end
| defmodule Mix.Tasks.BattleSnake.Createdb do
alias BattleSnake.GameForm
use Mix.Task
@shortdoc "creates the mnesia database"
def run(_) do
:stopped = :mnesia.stop
:ok = :mnesia.delete_schema([node()])
:ok = :mnesia.create_schema([node()])
:ok = :mnesia.start()
+
- {:atomic, :ok} = :mnesia.create_table(GameForm, GameForm.table)
? -------------------------
+ {:atomic, :ok} = :mnesia.create_table(
+ GameForm,
+ [{:disc_copies, [node()]} |
+ GameForm.table])
end
end | 6 | 0.428571 | 5 | 1 |
4d5887461621ef8fd89d357508beb14d938ffacc | sass/modules/_alignments.scss | sass/modules/_alignments.scss | .alignleft {
display: inline;
float: left;
margin-right: 1.5em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.5em;
}
.aligncenter {
@include center-block;
} | .alignleft {
display: inline;
float: left;
margin-right: 1.5em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.5em;
}
.aligncenter {
clear: both;
@include center-block;
}
| Add sass missing center alignment clearing | Add sass missing center alignment clearing
| SCSS | mit | carl-alberto/business-portfolio,vaishaliagola27/_s,andbaz/launchbaz,vaishaliagola27/_s,vaishaliagola27/_s,andbaz/launchbaz,carl-alberto/business-portfolio | scss | ## Code Before:
.alignleft {
display: inline;
float: left;
margin-right: 1.5em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.5em;
}
.aligncenter {
@include center-block;
}
## Instruction:
Add sass missing center alignment clearing
## Code After:
.alignleft {
display: inline;
float: left;
margin-right: 1.5em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.5em;
}
.aligncenter {
clear: both;
@include center-block;
}
| .alignleft {
display: inline;
float: left;
margin-right: 1.5em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.5em;
}
.aligncenter {
+ clear: both;
@include center-block;
} | 1 | 0.066667 | 1 | 0 |
c88c3842d1419570756482c693ceed518cba3ff1 | README.md | README.md | Archible
========
A set of Ansible playbooks for provisioning Arch Linux.
Overview
--------
Provisioning is done in 2 stages:
1. Bootstrap ArchLinux base system:
2. Reboot into newly installed system, install and configure additional software.
Quickstart
==========
Boot into Live ArchLinux.
Download and decompress playbook from GitHub:
```
curl -L https://github.com/zoresvit/archible/archive/master.tar.gz | tar xz
cd zoresvit-archible
```
Install Ansible with Python 2 and `passlib` (for creating password):
```
pacman -Sy ansible python2-passlib
```
Run Ansible to provision base system:
```
ansible-playbook -i localhost install.yml
```
After reboot login to the system and run Ansible to install and configure
full-featured ArchLinux:
```
ansible-playbook -i localhost arch.yml
```
Inspired by: https://github.com/pigmonkey/spark
| Archible
========
A set of Ansible playbooks for provisioning Arch Linux.
Instructions
============
Download Arch Linux ISO image and signature:
```
wget http://mirror.rackspace.com/archlinux/iso/$VERSION/archlinux-$VERSION-dual.iso
wget https://www.archlinux.org/iso/$VERSION/archlinux-$VERSION-dual.iso.sig
```
For more download options see [Arch Linux Downloads](https://www.archlinux.org/download/).
Verify the ISO image:
```
gpg --keyserver-options auto-key-retrieve --verify archlinux-$VERSION-dual.iso.sig
```
Write the ISO image to a USB flash drive:
```
dd bs=4M if=archlinux-$VERSION-dual.iso of=/dev/sdX status=progress && sync
```
Boot into Live ArchLinux.
Download and decompress playbook from GitHub:
```
curl -L https://github.com/zoresvit/archible/archive/master.tar.gz | tar xz
cd zoresvit-archible
```
Install Ansible with Python 2 and `passlib` (for creating password):
```
pacman -Sy ansible python2-passlib
```
Run Ansible to provision base system:
```
ansible-playbook -i localhost install.yml
```
After reboot login to the system and run Ansible to install and configure
full-featured ArchLinux:
```
ansible-playbook -i localhost arch.yml
```
Inspired by: https://github.com/pigmonkey/spark
| Add instructions for downloading Arch Linux image | Add instructions for downloading Arch Linux image
| Markdown | mit | zoresvit/archible | markdown | ## Code Before:
Archible
========
A set of Ansible playbooks for provisioning Arch Linux.
Overview
--------
Provisioning is done in 2 stages:
1. Bootstrap ArchLinux base system:
2. Reboot into newly installed system, install and configure additional software.
Quickstart
==========
Boot into Live ArchLinux.
Download and decompress playbook from GitHub:
```
curl -L https://github.com/zoresvit/archible/archive/master.tar.gz | tar xz
cd zoresvit-archible
```
Install Ansible with Python 2 and `passlib` (for creating password):
```
pacman -Sy ansible python2-passlib
```
Run Ansible to provision base system:
```
ansible-playbook -i localhost install.yml
```
After reboot login to the system and run Ansible to install and configure
full-featured ArchLinux:
```
ansible-playbook -i localhost arch.yml
```
Inspired by: https://github.com/pigmonkey/spark
## Instruction:
Add instructions for downloading Arch Linux image
## Code After:
Archible
========
A set of Ansible playbooks for provisioning Arch Linux.
Instructions
============
Download Arch Linux ISO image and signature:
```
wget http://mirror.rackspace.com/archlinux/iso/$VERSION/archlinux-$VERSION-dual.iso
wget https://www.archlinux.org/iso/$VERSION/archlinux-$VERSION-dual.iso.sig
```
For more download options see [Arch Linux Downloads](https://www.archlinux.org/download/).
Verify the ISO image:
```
gpg --keyserver-options auto-key-retrieve --verify archlinux-$VERSION-dual.iso.sig
```
Write the ISO image to a USB flash drive:
```
dd bs=4M if=archlinux-$VERSION-dual.iso of=/dev/sdX status=progress && sync
```
Boot into Live ArchLinux.
Download and decompress playbook from GitHub:
```
curl -L https://github.com/zoresvit/archible/archive/master.tar.gz | tar xz
cd zoresvit-archible
```
Install Ansible with Python 2 and `passlib` (for creating password):
```
pacman -Sy ansible python2-passlib
```
Run Ansible to provision base system:
```
ansible-playbook -i localhost install.yml
```
After reboot login to the system and run Ansible to install and configure
full-featured ArchLinux:
```
ansible-playbook -i localhost arch.yml
```
Inspired by: https://github.com/pigmonkey/spark
| Archible
========
A set of Ansible playbooks for provisioning Arch Linux.
- Overview
- --------
+ Instructions
+ ============
- Provisioning is done in 2 stages:
+ Download Arch Linux ISO image and signature:
- 1. Bootstrap ArchLinux base system:
- 2. Reboot into newly installed system, install and configure additional software.
+ ```
+ wget http://mirror.rackspace.com/archlinux/iso/$VERSION/archlinux-$VERSION-dual.iso
+ wget https://www.archlinux.org/iso/$VERSION/archlinux-$VERSION-dual.iso.sig
+ ```
+ For more download options see [Arch Linux Downloads](https://www.archlinux.org/download/).
+ Verify the ISO image:
- Quickstart
- ==========
+ ```
+ gpg --keyserver-options auto-key-retrieve --verify archlinux-$VERSION-dual.iso.sig
+ ```
+
+ Write the ISO image to a USB flash drive:
+
+ ```
+ dd bs=4M if=archlinux-$VERSION-dual.iso of=/dev/sdX status=progress && sync
+ ```
Boot into Live ArchLinux.
Download and decompress playbook from GitHub:
```
curl -L https://github.com/zoresvit/archible/archive/master.tar.gz | tar xz
cd zoresvit-archible
```
Install Ansible with Python 2 and `passlib` (for creating password):
```
pacman -Sy ansible python2-passlib
```
Run Ansible to provision base system:
```
ansible-playbook -i localhost install.yml
```
After reboot login to the system and run Ansible to install and configure
full-featured ArchLinux:
```
ansible-playbook -i localhost arch.yml
```
Inspired by: https://github.com/pigmonkey/spark | 25 | 0.531915 | 18 | 7 |
e14ca7e0a71e558ae9d8327248012d8109f9e0c5 | needlestack/base.py | needlestack/base.py |
from __future__ import unicode_literals, absolute_import
class SearchBackend(object):
pass
class Field(object):
"""
Base class for any field.
"""
name = None
def __init__(self, **kwargs)
self.options = kwargs
def set_name(self, name):
self.name = name
|
from __future__ import unicode_literals, absolute_import
class SearchBackend(object):
pass
class Field(object):
"""
Base class for any field.
"""
name = None
def __init__(self, **kwargs)
for name, value in kwargs.items():
setattr(self, name, value)
def set_name(self, name):
self.name = name
@classmethod
def from_python(cls, value):
"""
Method for adapt document value from python
to backend specific format.
"""
return value
@classmethod
def to_python(cls, value):
"""
Method for adapt backend specific format to
native python format.
"""
return value
| Add type addaptation methods for generic field class. | Add type addaptation methods for generic field class.
| Python | bsd-3-clause | niwinz/needlestack | python | ## Code Before:
from __future__ import unicode_literals, absolute_import
class SearchBackend(object):
pass
class Field(object):
"""
Base class for any field.
"""
name = None
def __init__(self, **kwargs)
self.options = kwargs
def set_name(self, name):
self.name = name
## Instruction:
Add type addaptation methods for generic field class.
## Code After:
from __future__ import unicode_literals, absolute_import
class SearchBackend(object):
pass
class Field(object):
"""
Base class for any field.
"""
name = None
def __init__(self, **kwargs)
for name, value in kwargs.items():
setattr(self, name, value)
def set_name(self, name):
self.name = name
@classmethod
def from_python(cls, value):
"""
Method for adapt document value from python
to backend specific format.
"""
return value
@classmethod
def to_python(cls, value):
"""
Method for adapt backend specific format to
native python format.
"""
return value
|
from __future__ import unicode_literals, absolute_import
class SearchBackend(object):
pass
class Field(object):
"""
Base class for any field.
"""
name = None
def __init__(self, **kwargs)
- self.options = kwargs
+ for name, value in kwargs.items():
+ setattr(self, name, value)
def set_name(self, name):
self.name = name
+
+ @classmethod
+ def from_python(cls, value):
+ """
+ Method for adapt document value from python
+ to backend specific format.
+ """
+ return value
+
+ @classmethod
+ def to_python(cls, value):
+ """
+ Method for adapt backend specific format to
+ native python format.
+ """
+ return value | 19 | 0.95 | 18 | 1 |
47e219fcb61f80146e9a471d174e5d0e70411299 | app/Console/Kernel.php | app/Console/Kernel.php | <?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//
}
}
| <?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\Hexcores\Api\Console\ApiKeyGenerate::class
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//
}
}
| Add api key generator command. | Add api key generator command.
| PHP | mit | MyanmarAPI/php-endpoint-bootstrap | php | ## Code Before:
<?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//
}
}
## Instruction:
Add api key generator command.
## Code After:
<?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\Hexcores\Api\Console\ApiKeyGenerate::class
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//
}
}
| <?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
- //
+ \Hexcores\Api\Console\ApiKeyGenerate::class
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//
}
} | 2 | 0.071429 | 1 | 1 |
6b0c9389d60f6775bbfcf05c53877de4cdecfc71 | commands.md | commands.md | Setup
=====
$ pod help setup
$ pod setup
This command will create a directory at `~/.cocoa-pods` which will hold your
spec-repos. In addition it will create a clone of the public ‘master’ spec-repo.
Managing PodSpec files
======================
$ pod help spec
pod spec create NAME
Creates a directory for your new pod, named `NAME', with a default
directory structure and accompanying `NAME.podspec'.
pod spec init NAME
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
Use this for existing libraries.
pod spec edit NAME
Opens `NAME.podspec', from a local spec-repo, in the editor specified
in your shell environment by the `$EDITOR' variable. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec lint NAME
Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec push REMOTE
Validates `NAME.podspec' in the current working dir, copies it to the
local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
spec-repo. In case `REMOTE' is omitted, it defaults to `master'.
Manage spec-repos
=================
pod repo add NAME URL
Clones `URL' in the local spec-repos directory at ~/.cocoa-pods. The
remote can later be referred to by `NAME'.
pod repo update NAME
Updates the local clone of the spec-repo `NAME'.
pod repo change NAME URL
Changes the git remote of local spec-repo `NAME' to `URL'.
pod repo cd NAME
Changes the current working dir to the local spec-repo `NAME'.
| Setup
=====
$ pod help setup
$ pod setup
This command will create a directory at `~/.cocoa-pods` which will hold your
spec-repos. In addition it will create a clone of the public ‘master’ spec-repo.
Managing PodSpec files
======================
$ pod help spec
pod spec create NAME
Creates a directory for your new pod, named `NAME', with a default
directory structure and accompanying `NAME.podspec'.
pod spec init NAME
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
Use this for existing libraries.
pod spec lint NAME
Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec push REMOTE
Validates `NAME.podspec' in the current working dir, copies it to the
local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
spec-repo. In case `REMOTE' is omitted, it defaults to `master'.
Manage spec-repos
=================
pod repo add NAME URL
Clones `URL' in the local spec-repos directory at ~/.cocoa-pods. The
remote can later be referred to by `NAME'.
pod repo update NAME
Updates the local clone of the spec-repo `NAME'.
pod repo change NAME URL
Changes the git remote of local spec-repo `NAME' to `URL'.
pod repo cd NAME
Changes the current working dir to the local spec-repo `NAME'.
| Edit is really needed. If people want to mess with a repo, they should just cd there. | Edit is really needed. If people want to mess with a repo, they should just cd there.
| Markdown | mit | ashfurrow/CocoaPods,vivekshukla-mob-ibtech/Repository,AdamCampbell/Core,0xced/CocoaPods,segiddins/CocoaPods,mglidden/CocoaPods,brianmichel/Core,mglidden/CocoaPods,orta/Core,gabro/Core,mglidden/CocoaPods,Ashton-W/Core,dnkoutso/Core,k0nserv/Core,orta/CocoaPods,CocoaPods/Core,SinnerSchraderMobileMirrors/CocoaPods,dacaiguoguogmail/Core,Ashton-W/CocoaPods | markdown | ## Code Before:
Setup
=====
$ pod help setup
$ pod setup
This command will create a directory at `~/.cocoa-pods` which will hold your
spec-repos. In addition it will create a clone of the public ‘master’ spec-repo.
Managing PodSpec files
======================
$ pod help spec
pod spec create NAME
Creates a directory for your new pod, named `NAME', with a default
directory structure and accompanying `NAME.podspec'.
pod spec init NAME
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
Use this for existing libraries.
pod spec edit NAME
Opens `NAME.podspec', from a local spec-repo, in the editor specified
in your shell environment by the `$EDITOR' variable. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec lint NAME
Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec push REMOTE
Validates `NAME.podspec' in the current working dir, copies it to the
local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
spec-repo. In case `REMOTE' is omitted, it defaults to `master'.
Manage spec-repos
=================
pod repo add NAME URL
Clones `URL' in the local spec-repos directory at ~/.cocoa-pods. The
remote can later be referred to by `NAME'.
pod repo update NAME
Updates the local clone of the spec-repo `NAME'.
pod repo change NAME URL
Changes the git remote of local spec-repo `NAME' to `URL'.
pod repo cd NAME
Changes the current working dir to the local spec-repo `NAME'.
## Instruction:
Edit is really needed. If people want to mess with a repo, they should just cd there.
## Code After:
Setup
=====
$ pod help setup
$ pod setup
This command will create a directory at `~/.cocoa-pods` which will hold your
spec-repos. In addition it will create a clone of the public ‘master’ spec-repo.
Managing PodSpec files
======================
$ pod help spec
pod spec create NAME
Creates a directory for your new pod, named `NAME', with a default
directory structure and accompanying `NAME.podspec'.
pod spec init NAME
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
Use this for existing libraries.
pod spec lint NAME
Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec push REMOTE
Validates `NAME.podspec' in the current working dir, copies it to the
local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
spec-repo. In case `REMOTE' is omitted, it defaults to `master'.
Manage spec-repos
=================
pod repo add NAME URL
Clones `URL' in the local spec-repos directory at ~/.cocoa-pods. The
remote can later be referred to by `NAME'.
pod repo update NAME
Updates the local clone of the spec-repo `NAME'.
pod repo change NAME URL
Changes the git remote of local spec-repo `NAME' to `URL'.
pod repo cd NAME
Changes the current working dir to the local spec-repo `NAME'.
| Setup
=====
$ pod help setup
$ pod setup
This command will create a directory at `~/.cocoa-pods` which will hold your
spec-repos. In addition it will create a clone of the public ‘master’ spec-repo.
Managing PodSpec files
======================
$ pod help spec
pod spec create NAME
Creates a directory for your new pod, named `NAME', with a default
directory structure and accompanying `NAME.podspec'.
pod spec init NAME
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
Use this for existing libraries.
-
- pod spec edit NAME
- Opens `NAME.podspec', from a local spec-repo, in the editor specified
- in your shell environment by the `$EDITOR' variable. In case `NAME' is
- omitted, it defaults to the PodSpec in the current working dir.
pod spec lint NAME
Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec push REMOTE
Validates `NAME.podspec' in the current working dir, copies it to the
local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
spec-repo. In case `REMOTE' is omitted, it defaults to `master'.
Manage spec-repos
=================
pod repo add NAME URL
Clones `URL' in the local spec-repos directory at ~/.cocoa-pods. The
remote can later be referred to by `NAME'.
pod repo update NAME
Updates the local clone of the spec-repo `NAME'.
pod repo change NAME URL
Changes the git remote of local spec-repo `NAME' to `URL'.
pod repo cd NAME
Changes the current working dir to the local spec-repo `NAME'. | 5 | 0.098039 | 0 | 5 |
9de5ef891224e1cdc456dac80be88148dc6e34f2 | spec/spec_helper.rb | spec/spec_helper.rb | require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'hashid/rails'
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
require_relative "support/schema"
require_relative "support/fake_model"
| require "simplecov"
SimpleCov.start
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "hashid/rails"
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
require_relative "support/schema"
require_relative "support/fake_model"
| Update simplecov with post 1.0 config | Update simplecov with post 1.0 config
| Ruby | mit | jcypret/hashid-rails,jcypret/hashid-rails | ruby | ## Code Before:
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'hashid/rails'
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
require_relative "support/schema"
require_relative "support/fake_model"
## Instruction:
Update simplecov with post 1.0 config
## Code After:
require "simplecov"
SimpleCov.start
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "hashid/rails"
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
require_relative "support/schema"
require_relative "support/fake_model"
| - require 'codeclimate-test-reporter'
- CodeClimate::TestReporter.start
+ require "simplecov"
+ SimpleCov.start
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
? ^ ^
+ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
? ^ ^
- require 'hashid/rails'
? ^ ^
+ require "hashid/rails"
? ^ ^
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
require_relative "support/schema"
require_relative "support/fake_model" | 8 | 0.888889 | 4 | 4 |
da07be3bdd2a041b258cfbe9861eaa465caf2f7c | README.md | README.md | mk-miner
========
Makefile miner
| Makefile miner
==============
This utility scans a source tree for makefiles and attempts to extract all occurrences of a variable creation and modification, as well as surrounding `if`/`else`/`endif` statements, and presents the results as annotated Haskell-like code. If you are very lucky the results are directly useable in a build system like [Shake](https://github.com/ndmitchell/shake/blob/master/README.md); otherwise you will at least have everything related to a variable collected in one place giving you a chance to make sense of what is going on. I've written the utility for [migrating GHC's build system to Shake](https://github.com/snowleopard/shaking-up-ghc).
For example, if variable `CFLAGS` is assigned in file `Makefile`:
```
CFLAGS = -O2 -Wall
```
and then modified in file `buildrules/compiler/flags.mk`:
```
CFLAGS += -std=c++11
ifeq "($Mode)" "paranoid"
CFLAGS += -Werror
else
CFLAGS += -Wno-unused-variable
endif
```
then the miner will produce the following `results/code/CFLAGS.hs` file:
```Haskell
CFLAGS = [ "-std=c++11 " | ] -- buildrules/compiler/flags.mk
++ [ "-Werror " | "($Mode)" == "paranoid" ] -- buildrules/compiler/flags.mk
++ [ "-Wno-unused-variable " | not $ "($Mode)" == "paranoid" ] -- buildrules/compiler/flags.mk
++ [ "-O2 -Wall " | ] -- Makefile
```
| Add a brief intro to the project. | Add a brief intro to the project. | Markdown | unlicense | snowleopard/mk-miner | markdown | ## Code Before:
mk-miner
========
Makefile miner
## Instruction:
Add a brief intro to the project.
## Code After:
Makefile miner
==============
This utility scans a source tree for makefiles and attempts to extract all occurrences of a variable creation and modification, as well as surrounding `if`/`else`/`endif` statements, and presents the results as annotated Haskell-like code. If you are very lucky the results are directly useable in a build system like [Shake](https://github.com/ndmitchell/shake/blob/master/README.md); otherwise you will at least have everything related to a variable collected in one place giving you a chance to make sense of what is going on. I've written the utility for [migrating GHC's build system to Shake](https://github.com/snowleopard/shaking-up-ghc).
For example, if variable `CFLAGS` is assigned in file `Makefile`:
```
CFLAGS = -O2 -Wall
```
and then modified in file `buildrules/compiler/flags.mk`:
```
CFLAGS += -std=c++11
ifeq "($Mode)" "paranoid"
CFLAGS += -Werror
else
CFLAGS += -Wno-unused-variable
endif
```
then the miner will produce the following `results/code/CFLAGS.hs` file:
```Haskell
CFLAGS = [ "-std=c++11 " | ] -- buildrules/compiler/flags.mk
++ [ "-Werror " | "($Mode)" == "paranoid" ] -- buildrules/compiler/flags.mk
++ [ "-Wno-unused-variable " | not $ "($Mode)" == "paranoid" ] -- buildrules/compiler/flags.mk
++ [ "-O2 -Wall " | ] -- Makefile
```
| - mk-miner
- ========
+ Makefile miner
+ ==============
- Makefile miner
+ This utility scans a source tree for makefiles and attempts to extract all occurrences of a variable creation and modification, as well as surrounding `if`/`else`/`endif` statements, and presents the results as annotated Haskell-like code. If you are very lucky the results are directly useable in a build system like [Shake](https://github.com/ndmitchell/shake/blob/master/README.md); otherwise you will at least have everything related to a variable collected in one place giving you a chance to make sense of what is going on. I've written the utility for [migrating GHC's build system to Shake](https://github.com/snowleopard/shaking-up-ghc).
+
+ For example, if variable `CFLAGS` is assigned in file `Makefile`:
+ ```
+ CFLAGS = -O2 -Wall
+ ```
+ and then modified in file `buildrules/compiler/flags.mk`:
+ ```
+ CFLAGS += -std=c++11
+ ifeq "($Mode)" "paranoid"
+ CFLAGS += -Werror
+ else
+ CFLAGS += -Wno-unused-variable
+ endif
+ ```
+ then the miner will produce the following `results/code/CFLAGS.hs` file:
+ ```Haskell
+ CFLAGS = [ "-std=c++11 " | ] -- buildrules/compiler/flags.mk
+ ++ [ "-Werror " | "($Mode)" == "paranoid" ] -- buildrules/compiler/flags.mk
+ ++ [ "-Wno-unused-variable " | not $ "($Mode)" == "paranoid" ] -- buildrules/compiler/flags.mk
+ ++ [ "-O2 -Wall " | ] -- Makefile
+ ```
+ | 28 | 7 | 25 | 3 |
b9cc02a68e465f17eb507fd6d1eab7800b382963 | app/services/ci/retry_pipeline_service.rb | app/services/ci/retry_pipeline_service.rb | module Ci
class RetryPipelineService < ::BaseService
def execute(pipeline)
unless can?(current_user, :update_pipeline, pipeline)
raise Gitlab::Access::AccessDeniedError
end
each_build(pipeline.builds.failed_or_canceled) do |build|
next unless build.retryable?
Ci::RetryBuildService.new(project, current_user)
.reprocess(build)
end
MergeRequests::AddTodoWhenBuildFailsService
.new(project, current_user)
.close_all(pipeline)
pipeline.process!
end
private
def each_build(relation)
Gitlab::OptimisticLocking.retry_lock(relation) do |builds|
builds.find_each { |build| yield build }
end
end
end
end
| module Ci
class RetryPipelineService < ::BaseService
def execute(pipeline)
unless can?(current_user, :update_pipeline, pipeline)
raise Gitlab::Access::AccessDeniedError
end
pipeline.builds.failed_or_canceled.find_each do |build|
next unless build.retryable?
Ci::RetryBuildService.new(project, current_user)
.reprocess(build)
end
MergeRequests::AddTodoWhenBuildFailsService
.new(project, current_user)
.close_all(pipeline)
pipeline.process!
end
end
end
| Remove support for locking in pipeline retry service | Remove support for locking in pipeline retry service
| Ruby | mit | mmkassem/gitlabhq,jirutka/gitlabhq,dreampet/gitlab,dplarson/gitlabhq,LUMC/gitlabhq,dplarson/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,LUMC/gitlabhq,stoplightio/gitlabhq,stoplightio/gitlabhq,t-zuehlsdorff/gitlabhq,t-zuehlsdorff/gitlabhq,dreampet/gitlab,axilleas/gitlabhq,iiet/iiet-git,htve/GitlabForChinese,dreampet/gitlab,htve/GitlabForChinese,stoplightio/gitlabhq,darkrasid/gitlabhq,darkrasid/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,htve/GitlabForChinese,jirutka/gitlabhq,darkrasid/gitlabhq,LUMC/gitlabhq,htve/GitlabForChinese,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq,t-zuehlsdorff/gitlabhq,dplarson/gitlabhq,iiet/iiet-git,axilleas/gitlabhq,iiet/iiet-git,LUMC/gitlabhq,dplarson/gitlabhq,jirutka/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,axilleas/gitlabhq,darkrasid/gitlabhq | ruby | ## Code Before:
module Ci
class RetryPipelineService < ::BaseService
def execute(pipeline)
unless can?(current_user, :update_pipeline, pipeline)
raise Gitlab::Access::AccessDeniedError
end
each_build(pipeline.builds.failed_or_canceled) do |build|
next unless build.retryable?
Ci::RetryBuildService.new(project, current_user)
.reprocess(build)
end
MergeRequests::AddTodoWhenBuildFailsService
.new(project, current_user)
.close_all(pipeline)
pipeline.process!
end
private
def each_build(relation)
Gitlab::OptimisticLocking.retry_lock(relation) do |builds|
builds.find_each { |build| yield build }
end
end
end
end
## Instruction:
Remove support for locking in pipeline retry service
## Code After:
module Ci
class RetryPipelineService < ::BaseService
def execute(pipeline)
unless can?(current_user, :update_pipeline, pipeline)
raise Gitlab::Access::AccessDeniedError
end
pipeline.builds.failed_or_canceled.find_each do |build|
next unless build.retryable?
Ci::RetryBuildService.new(project, current_user)
.reprocess(build)
end
MergeRequests::AddTodoWhenBuildFailsService
.new(project, current_user)
.close_all(pipeline)
pipeline.process!
end
end
end
| module Ci
class RetryPipelineService < ::BaseService
def execute(pipeline)
unless can?(current_user, :update_pipeline, pipeline)
raise Gitlab::Access::AccessDeniedError
end
- each_build(pipeline.builds.failed_or_canceled) do |build|
? ----------- ^
+ pipeline.builds.failed_or_canceled.find_each do |build|
? ^^^^^^^^^^
next unless build.retryable?
Ci::RetryBuildService.new(project, current_user)
.reprocess(build)
end
MergeRequests::AddTodoWhenBuildFailsService
.new(project, current_user)
.close_all(pipeline)
pipeline.process!
end
-
- private
-
- def each_build(relation)
- Gitlab::OptimisticLocking.retry_lock(relation) do |builds|
- builds.find_each { |build| yield build }
- end
- end
end
end | 10 | 0.333333 | 1 | 9 |
89f567aebc048e00cf6675c17ef54fcf4dca7d43 | docs/About/TechEmpower.md | docs/About/TechEmpower.md |
In a [March 2013 blog entry](https://www.techempower.com/blog/2013/03/28/frameworks-round-1/), we published the results of comparing the performance of several web application frameworks executing simple but representative tasks: serializing JSON objects and querying databases. Since then, community input has been tremendous. We—speaking now for all contributors to the project—have been regularly updating the test implementations, expanding coverage, and capturing results in semi-regular updates that we call "rounds."
For more information, please visit the [TechEmpower website](https://www.techempower.com/). |
[TechEmpower](https://www.techempower.com/) is a custom software development firm located in El Segundo, California that provies web and mobile application development services.
##What does TechEmpower Have to do with the Framework Benchmarks?
In a [March 2013 blog entry](https://www.techempower.com/blog/2013/03/28/frameworks-round-1/), TechEmpower published the results of comparing the performance of several web application frameworks executing simple but representative tasks: serializing JSON objects and querying databases. The community reaction was terrific. TechEmpower received dozens of comments, suggestions, questions, criticisms, and most importantly, GitHub pull requests at the [repository TechEmpower set up for this project](https://github.com/TechEmpower/FrameworkBenchmarks/). Since then, community input has been tremendous and the benchmarks now have regular updates called "rounds" where test implementations are regularly updated, and coverage is expanded.
For more information, please visit the [TechEmpower website](https://www.techempower.com/).
| Update TE description a bit | Update TE description a bit
| Markdown | bsd-3-clause | LadyMozzarella/FrameworkBenchmarksDocs,LadyMozzarella/FrameworkBenchmarksDocs | markdown | ## Code Before:
In a [March 2013 blog entry](https://www.techempower.com/blog/2013/03/28/frameworks-round-1/), we published the results of comparing the performance of several web application frameworks executing simple but representative tasks: serializing JSON objects and querying databases. Since then, community input has been tremendous. We—speaking now for all contributors to the project—have been regularly updating the test implementations, expanding coverage, and capturing results in semi-regular updates that we call "rounds."
For more information, please visit the [TechEmpower website](https://www.techempower.com/).
## Instruction:
Update TE description a bit
## Code After:
[TechEmpower](https://www.techempower.com/) is a custom software development firm located in El Segundo, California that provies web and mobile application development services.
##What does TechEmpower Have to do with the Framework Benchmarks?
In a [March 2013 blog entry](https://www.techempower.com/blog/2013/03/28/frameworks-round-1/), TechEmpower published the results of comparing the performance of several web application frameworks executing simple but representative tasks: serializing JSON objects and querying databases. The community reaction was terrific. TechEmpower received dozens of comments, suggestions, questions, criticisms, and most importantly, GitHub pull requests at the [repository TechEmpower set up for this project](https://github.com/TechEmpower/FrameworkBenchmarks/). Since then, community input has been tremendous and the benchmarks now have regular updates called "rounds" where test implementations are regularly updated, and coverage is expanded.
For more information, please visit the [TechEmpower website](https://www.techempower.com/).
|
- In a [March 2013 blog entry](https://www.techempower.com/blog/2013/03/28/frameworks-round-1/), we published the results of comparing the performance of several web application frameworks executing simple but representative tasks: serializing JSON objects and querying databases. Since then, community input has been tremendous. We—speaking now for all contributors to the project—have been regularly updating the test implementations, expanding coverage, and capturing results in semi-regular updates that we call "rounds."
+ [TechEmpower](https://www.techempower.com/) is a custom software development firm located in El Segundo, California that provies web and mobile application development services.
+
+ ##What does TechEmpower Have to do with the Framework Benchmarks?
+
+ In a [March 2013 blog entry](https://www.techempower.com/blog/2013/03/28/frameworks-round-1/), TechEmpower published the results of comparing the performance of several web application frameworks executing simple but representative tasks: serializing JSON objects and querying databases. The community reaction was terrific. TechEmpower received dozens of comments, suggestions, questions, criticisms, and most importantly, GitHub pull requests at the [repository TechEmpower set up for this project](https://github.com/TechEmpower/FrameworkBenchmarks/). Since then, community input has been tremendous and the benchmarks now have regular updates called "rounds" where test implementations are regularly updated, and coverage is expanded.
For more information, please visit the [TechEmpower website](https://www.techempower.com/). | 6 | 1.5 | 5 | 1 |
990a8147b278abe9b901355c28e191ec4e1fa037 | scripts/activemq.sh | scripts/activemq.sh | set -eu
ROOT="`dirname $0`/.."
ROOT=`readlink -m $ROOT`
wget http://apache.rediris.es/activemq/apache-activemq/5.8.0/apache-activemq-5.8.0-bin.tar.gz
tar -xvzf apache-activemq-5.8.0-bin.tar.gz
sudo mv apache-activemq-5.8.0 /opt
sudo ln -sf /opt/apache-activemq-5.8.0/ /opt/activemq
sudo adduser -system activemq --shell /bin/bash
sudo ln -sf /opt/activemq/bin/activemq /etc/init.d/
sudo update-rc.d activemq defaults
sudo /etc/init.d/activemq setup /etc/default/activemq
sudo chown root:nogroup /etc/default/activemq
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.access
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.password
sudo cp ${ROOT}/extra_cookbooks/activemq_mco/templates/default/activemq.xml.erb \
/opt/activemq/conf/activemq.xml
sudo /etc/init.d/activemq start
| set -eu
ROOT="`dirname $0`/.."
ROOT=`readlink -m $ROOT`
wget http://apache.rediris.es/activemq/apache-activemq/5.8.0/apache-activemq-5.8.0-bin.tar.gz
tar -xvzf apache-activemq-5.8.0-bin.tar.gz
sudo mv apache-activemq-5.8.0 /opt
sudo ln -sf /opt/apache-activemq-5.8.0/ /opt/activemq
sudo adduser -system activemq --shell /bin/bash
sudo ln -sf /opt/activemq/bin/activemq /etc/init.d/
sudo update-rc.d activemq defaults
sudo /etc/init.d/activemq setup /etc/default/activemq
sudo chown root:nogroup /etc/default/activemq
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.access
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.password
sudo cp ${ROOT}/extra_cookbooks/activemq_mco/templates/default/activemq.xml.erb \
/opt/activemq/conf/activemq.xml
sudo cp ${ROOT}/tests/fixtures/keystore.jks \
/opt/activemq/conf/keystore.jks
sudo cp ${ROOT}/tests/fixtures/truststore.jks \
/opt/activemq/conf/truststore.jks
sudo /etc/init.d/activemq start
| Add missing keystore/trustore to ActiveMQ script | Add missing keystore/trustore to ActiveMQ script
| Shell | bsd-3-clause | rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective | shell | ## Code Before:
set -eu
ROOT="`dirname $0`/.."
ROOT=`readlink -m $ROOT`
wget http://apache.rediris.es/activemq/apache-activemq/5.8.0/apache-activemq-5.8.0-bin.tar.gz
tar -xvzf apache-activemq-5.8.0-bin.tar.gz
sudo mv apache-activemq-5.8.0 /opt
sudo ln -sf /opt/apache-activemq-5.8.0/ /opt/activemq
sudo adduser -system activemq --shell /bin/bash
sudo ln -sf /opt/activemq/bin/activemq /etc/init.d/
sudo update-rc.d activemq defaults
sudo /etc/init.d/activemq setup /etc/default/activemq
sudo chown root:nogroup /etc/default/activemq
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.access
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.password
sudo cp ${ROOT}/extra_cookbooks/activemq_mco/templates/default/activemq.xml.erb \
/opt/activemq/conf/activemq.xml
sudo /etc/init.d/activemq start
## Instruction:
Add missing keystore/trustore to ActiveMQ script
## Code After:
set -eu
ROOT="`dirname $0`/.."
ROOT=`readlink -m $ROOT`
wget http://apache.rediris.es/activemq/apache-activemq/5.8.0/apache-activemq-5.8.0-bin.tar.gz
tar -xvzf apache-activemq-5.8.0-bin.tar.gz
sudo mv apache-activemq-5.8.0 /opt
sudo ln -sf /opt/apache-activemq-5.8.0/ /opt/activemq
sudo adduser -system activemq --shell /bin/bash
sudo ln -sf /opt/activemq/bin/activemq /etc/init.d/
sudo update-rc.d activemq defaults
sudo /etc/init.d/activemq setup /etc/default/activemq
sudo chown root:nogroup /etc/default/activemq
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.access
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.password
sudo cp ${ROOT}/extra_cookbooks/activemq_mco/templates/default/activemq.xml.erb \
/opt/activemq/conf/activemq.xml
sudo cp ${ROOT}/tests/fixtures/keystore.jks \
/opt/activemq/conf/keystore.jks
sudo cp ${ROOT}/tests/fixtures/truststore.jks \
/opt/activemq/conf/truststore.jks
sudo /etc/init.d/activemq start
| set -eu
ROOT="`dirname $0`/.."
ROOT=`readlink -m $ROOT`
wget http://apache.rediris.es/activemq/apache-activemq/5.8.0/apache-activemq-5.8.0-bin.tar.gz
tar -xvzf apache-activemq-5.8.0-bin.tar.gz
sudo mv apache-activemq-5.8.0 /opt
sudo ln -sf /opt/apache-activemq-5.8.0/ /opt/activemq
sudo adduser -system activemq --shell /bin/bash
sudo ln -sf /opt/activemq/bin/activemq /etc/init.d/
sudo update-rc.d activemq defaults
sudo /etc/init.d/activemq setup /etc/default/activemq
sudo chown root:nogroup /etc/default/activemq
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.access
sudo chmod 600 /opt/apache-activemq-5.8.0/conf/jmx.password
sudo cp ${ROOT}/extra_cookbooks/activemq_mco/templates/default/activemq.xml.erb \
/opt/activemq/conf/activemq.xml
+ sudo cp ${ROOT}/tests/fixtures/keystore.jks \
+ /opt/activemq/conf/keystore.jks
+ sudo cp ${ROOT}/tests/fixtures/truststore.jks \
+ /opt/activemq/conf/truststore.jks
sudo /etc/init.d/activemq start | 4 | 0.210526 | 4 | 0 |
05163d9fb503777a5bb4056bba52ad745f4b52c0 | lib/eval-script.js | lib/eval-script.js | module.exports = function(el) {
// console.log("going to execute script", el)
var code = (el.text || el.textContent || el.innerHTML || "")
var src = (el.src || "");
var parent = el.parentNode || document.querySelector("head") || document.documentElement
var script = document.createElement("script")
if (code.match("document.write")) {
if (console && console.log) {
console.log("Script contains document.write. Can’t be executed correctly. Code skipped ", el)
}
return false
}
script.type = "text/javascript"
if (src != "") {
script.src = src;
script.onload = function() { document.dispatchEvent((new Event("pjax:complete"))); }
script.async = false; // force asynchronous loading of peripheral js
}
if (code != "") {
try {
script.appendChild(document.createTextNode(code))
}
catch (e) {
// old IEs have funky script nodes
script.text = code
}
}
// execute
parent.appendChild(script);
// avoid pollution only in head or body tags
if (["head","body"].indexOf(parent.tagName.toLowerCase()) > 0) {
parent.removeChild(script)
}
return true;
}
| module.exports = function(el) {
var code = (el.text || el.textContent || el.innerHTML || "")
var src = (el.src || "");
var parent = el.parentNode || document.querySelector("head") || document.documentElement
var script = document.createElement("script")
if (code.match("document.write")) {
if (console && console.log) {
console.log("Script contains document.write. Can’t be executed correctly. Code skipped ", el)
}
return false
}
script.type = "text/javascript"
if (src != "") {
script.src = src;
script.async = false; // force synchronous loading of peripheral js
}
if (code != "") {
try {
script.appendChild(document.createTextNode(code))
}
catch (e) {
// old IEs have funky script nodes
script.text = code
}
}
// execute
parent.appendChild(script);
// avoid pollution only in head or body tags
if (["head","body"].indexOf(parent.tagName.toLowerCase()) > 0) {
parent.removeChild(script)
}
return true;
}
| Stop dispatching extraneous `pjax:complete` events, correct typo | Stop dispatching extraneous `pjax:complete` events, correct typo
| JavaScript | mit | MoOx/pjax,MoOx/pjax,MoOx/pjax | javascript | ## Code Before:
module.exports = function(el) {
// console.log("going to execute script", el)
var code = (el.text || el.textContent || el.innerHTML || "")
var src = (el.src || "");
var parent = el.parentNode || document.querySelector("head") || document.documentElement
var script = document.createElement("script")
if (code.match("document.write")) {
if (console && console.log) {
console.log("Script contains document.write. Can’t be executed correctly. Code skipped ", el)
}
return false
}
script.type = "text/javascript"
if (src != "") {
script.src = src;
script.onload = function() { document.dispatchEvent((new Event("pjax:complete"))); }
script.async = false; // force asynchronous loading of peripheral js
}
if (code != "") {
try {
script.appendChild(document.createTextNode(code))
}
catch (e) {
// old IEs have funky script nodes
script.text = code
}
}
// execute
parent.appendChild(script);
// avoid pollution only in head or body tags
if (["head","body"].indexOf(parent.tagName.toLowerCase()) > 0) {
parent.removeChild(script)
}
return true;
}
## Instruction:
Stop dispatching extraneous `pjax:complete` events, correct typo
## Code After:
module.exports = function(el) {
var code = (el.text || el.textContent || el.innerHTML || "")
var src = (el.src || "");
var parent = el.parentNode || document.querySelector("head") || document.documentElement
var script = document.createElement("script")
if (code.match("document.write")) {
if (console && console.log) {
console.log("Script contains document.write. Can’t be executed correctly. Code skipped ", el)
}
return false
}
script.type = "text/javascript"
if (src != "") {
script.src = src;
script.async = false; // force synchronous loading of peripheral js
}
if (code != "") {
try {
script.appendChild(document.createTextNode(code))
}
catch (e) {
// old IEs have funky script nodes
script.text = code
}
}
// execute
parent.appendChild(script);
// avoid pollution only in head or body tags
if (["head","body"].indexOf(parent.tagName.toLowerCase()) > 0) {
parent.removeChild(script)
}
return true;
}
| module.exports = function(el) {
- // console.log("going to execute script", el)
-
var code = (el.text || el.textContent || el.innerHTML || "")
var src = (el.src || "");
var parent = el.parentNode || document.querySelector("head") || document.documentElement
var script = document.createElement("script")
if (code.match("document.write")) {
if (console && console.log) {
console.log("Script contains document.write. Can’t be executed correctly. Code skipped ", el)
}
return false
}
script.type = "text/javascript"
if (src != "") {
script.src = src;
- script.onload = function() { document.dispatchEvent((new Event("pjax:complete"))); }
- script.async = false; // force asynchronous loading of peripheral js
? -
+ script.async = false; // force synchronous loading of peripheral js
}
if (code != "") {
try {
script.appendChild(document.createTextNode(code))
}
catch (e) {
// old IEs have funky script nodes
script.text = code
}
}
// execute
parent.appendChild(script);
// avoid pollution only in head or body tags
if (["head","body"].indexOf(parent.tagName.toLowerCase()) > 0) {
parent.removeChild(script)
}
return true;
} | 5 | 0.119048 | 1 | 4 |
fbb25c7ad0305e0c45d5d8b24037bb92cb594bc6 | docs/libssh2_sftp_last_error.3 | docs/libssh2_sftp_last_error.3 | .\" $Id: libssh2_sftp_last_error.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
.\"
.TH libssh2_sftp_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_sftp_last_error - return the last SFTP-specific error code
.SH SYNOPSIS
#include <libssh2.h>
#include <libssh2_sftp.h>
unsigned long
libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
.SH DESCRIPTION
\fIsftp\fP - SFTP instance as returned by
.BR libssh2_sftp_init(3)
Determines the last error code produced by the SFTP layer.
.SH RETURN VALUE
Current error code state of the SFTP instance.
.SH SEE ALSO
.BR libssh2_sftp_init(3)
| .\" $Id: libssh2_sftp_last_error.3,v 1.2 2008/12/15 18:48:09 bagder Exp $
.\"
.TH libssh2_sftp_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_sftp_last_error - return the last SFTP-specific error code
.SH SYNOPSIS
#include <libssh2.h>
#include <libssh2_sftp.h>
unsigned long
libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
.SH DESCRIPTION
\fIsftp\fP - SFTP instance as returned by
.BR libssh2_sftp_init(3)
Returns the last error code produced by the SFTP layer. Note that this only
returns a sensible error code if libssh2 returned LIBSSH2_ERROR_SFTP_PROTOCOL
in a previous call. Using \fBlibssh2_sftp_last_error(3)\fP without a
preceeding SFTP protocol error, it will return an unspecified value.
.SH RETURN VALUE
Current error code state of the SFTP instance.
.SH SEE ALSO
.BR libssh2_sftp_init(3)
| Clarify that this is only fine to use after an actual SFTP protocol error return code. | Clarify that this is only fine to use after an actual SFTP protocol error
return code.
| Groff | bsd-3-clause | libssh2/libssh2,libssh2/libssh2,libssh2/libssh2,libssh2/libssh2 | groff | ## Code Before:
.\" $Id: libssh2_sftp_last_error.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
.\"
.TH libssh2_sftp_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_sftp_last_error - return the last SFTP-specific error code
.SH SYNOPSIS
#include <libssh2.h>
#include <libssh2_sftp.h>
unsigned long
libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
.SH DESCRIPTION
\fIsftp\fP - SFTP instance as returned by
.BR libssh2_sftp_init(3)
Determines the last error code produced by the SFTP layer.
.SH RETURN VALUE
Current error code state of the SFTP instance.
.SH SEE ALSO
.BR libssh2_sftp_init(3)
## Instruction:
Clarify that this is only fine to use after an actual SFTP protocol error
return code.
## Code After:
.\" $Id: libssh2_sftp_last_error.3,v 1.2 2008/12/15 18:48:09 bagder Exp $
.\"
.TH libssh2_sftp_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_sftp_last_error - return the last SFTP-specific error code
.SH SYNOPSIS
#include <libssh2.h>
#include <libssh2_sftp.h>
unsigned long
libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
.SH DESCRIPTION
\fIsftp\fP - SFTP instance as returned by
.BR libssh2_sftp_init(3)
Returns the last error code produced by the SFTP layer. Note that this only
returns a sensible error code if libssh2 returned LIBSSH2_ERROR_SFTP_PROTOCOL
in a previous call. Using \fBlibssh2_sftp_last_error(3)\fP without a
preceeding SFTP protocol error, it will return an unspecified value.
.SH RETURN VALUE
Current error code state of the SFTP instance.
.SH SEE ALSO
.BR libssh2_sftp_init(3)
| - .\" $Id: libssh2_sftp_last_error.3,v 1.1 2007/06/14 16:08:43 jehousley Exp $
? ^ ^^^^ ^ --- ^ ^ ^^^^^^^
+ .\" $Id: libssh2_sftp_last_error.3,v 1.2 2008/12/15 18:48:09 bagder Exp $
? ^ ^ ^^^^ ^^^^ ^^^^ ^
.\"
.TH libssh2_sftp_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
.SH NAME
libssh2_sftp_last_error - return the last SFTP-specific error code
.SH SYNOPSIS
#include <libssh2.h>
#include <libssh2_sftp.h>
unsigned long
libssh2_sftp_last_error(LIBSSH2_SFTP *sftp);
.SH DESCRIPTION
\fIsftp\fP - SFTP instance as returned by
.BR libssh2_sftp_init(3)
- Determines the last error code produced by the SFTP layer.
? ^ ^ -- -
+ Returns the last error code produced by the SFTP layer. Note that this only
? ^ ^ ++++++++++++++++++++
+ returns a sensible error code if libssh2 returned LIBSSH2_ERROR_SFTP_PROTOCOL
+ in a previous call. Using \fBlibssh2_sftp_last_error(3)\fP without a
+ preceeding SFTP protocol error, it will return an unspecified value.
.SH RETURN VALUE
Current error code state of the SFTP instance.
.SH SEE ALSO
.BR libssh2_sftp_init(3) | 7 | 0.304348 | 5 | 2 |
ab57f576c06b57a6748b0b5978e1ac8ade047494 | doc/qt.txt | doc/qt.txt | Preparing Qt for use with Visual Studio 2008 and rex
This set of instructions is adapted from
http://dcsoft.com/community_server/blogs/dcsoft/archive/2009/03/06/how-to-setup-qt-4-5-visual-studio-integration.aspx
(which was a bit outdated).
1. Download Qt source package from http://www.qtsoftware.com/downloads
Choose LGPL/Free -> Qt Framework only (Windows) -> Source code available on this link
(direct link: http://get.qtsoftware.com/qt/source/qt-win-opensource-src-4.5.1.zip)
2. Extract zip to C: root. Rename the created directory to something more convenient, like Qt (assumed below)
3. Add C:\Qt\bin to your path
4. Open VS2008 command prompt, go to C:\Qt and run
configure -platform win32-msvc2008
5. In the same directory, run
nmake
6. Add QTDIR = C:\Qt to your environment variables.
7. Regenerate the rex VS project files from the cmake files. Remember to invoke cmake from a process that was created
after steps 3 and 6 in order for the environment settings to take effect. This means restarting Visual Studio or
any command prompts after changing the environment settings.
| Preparing Qt for use with Visual Studio 2008 and rex
This set of instructions is adapted from
http://dcsoft.com/community_server/blogs/dcsoft/archive/2009/03/06/how-to-setup-qt-4-5-visual-studio-integration.aspx
(which was a bit outdated).
1. Download Qt source package from http://www.qtsoftware.com/downloads
Choose LGPL/Free -> Qt Framework only (Windows) -> Source code available on this link
(direct link: http://get.qtsoftware.com/qt/source/qt-win-opensource-src-4.5.1.zip)
2. Extract zip to C: root. Rename the created directory to something more convenient, like Qt (assumed below)
3. Add C:\Qt\bin to your path
4. Open VS2008 command prompt, go to C:\Qt and run
configure -platform win32-msvc2008
5. In the same directory, run
nmake
6. Add QTDIR = C:\Qt to your environment variables.
7. Regenerate the rex VS project files from the cmake files. Remember to invoke cmake from a process that was created
after steps 3 and 6 in order for the environment settings to take effect. This means restarting Visual Studio or
any command prompts after changing the environment settings.
* If configure and nmake doesn't work you can try to download built version of Qt SDK
from: http://dev.realxtend.org/gf/project/viewerdeps/frs/
Built was made on Windows Vista 32bit
1) Download Qt.zip
2) Unzip to c:\
(ensure that folder structure is like below)
3) set environment variable: QTDIR=C:\Qt\2009.02-visual-studio\qt | Add instructions for built version of Qt SDK | Add instructions for built version of Qt SDK
git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1008 5b2332b8-efa3-11de-8684-7d64432d61a3
| Text | apache-2.0 | realXtend/tundra,pharos3d/tundra,jesterKing/naali,AlphaStaxLLC/tundra,AlphaStaxLLC/tundra,realXtend/tundra,jesterKing/naali,BogusCurry/tundra,jesterKing/naali,pharos3d/tundra,jesterKing/naali,AlphaStaxLLC/tundra,jesterKing/naali,antont/tundra,AlphaStaxLLC/tundra,BogusCurry/tundra,pharos3d/tundra,antont/tundra,realXtend/tundra,antont/tundra,antont/tundra,pharos3d/tundra,jesterKing/naali,BogusCurry/tundra,realXtend/tundra,antont/tundra,realXtend/tundra,realXtend/tundra,jesterKing/naali,antont/tundra,pharos3d/tundra,AlphaStaxLLC/tundra,pharos3d/tundra,BogusCurry/tundra,BogusCurry/tundra,BogusCurry/tundra,antont/tundra,AlphaStaxLLC/tundra | text | ## Code Before:
Preparing Qt for use with Visual Studio 2008 and rex
This set of instructions is adapted from
http://dcsoft.com/community_server/blogs/dcsoft/archive/2009/03/06/how-to-setup-qt-4-5-visual-studio-integration.aspx
(which was a bit outdated).
1. Download Qt source package from http://www.qtsoftware.com/downloads
Choose LGPL/Free -> Qt Framework only (Windows) -> Source code available on this link
(direct link: http://get.qtsoftware.com/qt/source/qt-win-opensource-src-4.5.1.zip)
2. Extract zip to C: root. Rename the created directory to something more convenient, like Qt (assumed below)
3. Add C:\Qt\bin to your path
4. Open VS2008 command prompt, go to C:\Qt and run
configure -platform win32-msvc2008
5. In the same directory, run
nmake
6. Add QTDIR = C:\Qt to your environment variables.
7. Regenerate the rex VS project files from the cmake files. Remember to invoke cmake from a process that was created
after steps 3 and 6 in order for the environment settings to take effect. This means restarting Visual Studio or
any command prompts after changing the environment settings.
## Instruction:
Add instructions for built version of Qt SDK
git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1008 5b2332b8-efa3-11de-8684-7d64432d61a3
## Code After:
Preparing Qt for use with Visual Studio 2008 and rex
This set of instructions is adapted from
http://dcsoft.com/community_server/blogs/dcsoft/archive/2009/03/06/how-to-setup-qt-4-5-visual-studio-integration.aspx
(which was a bit outdated).
1. Download Qt source package from http://www.qtsoftware.com/downloads
Choose LGPL/Free -> Qt Framework only (Windows) -> Source code available on this link
(direct link: http://get.qtsoftware.com/qt/source/qt-win-opensource-src-4.5.1.zip)
2. Extract zip to C: root. Rename the created directory to something more convenient, like Qt (assumed below)
3. Add C:\Qt\bin to your path
4. Open VS2008 command prompt, go to C:\Qt and run
configure -platform win32-msvc2008
5. In the same directory, run
nmake
6. Add QTDIR = C:\Qt to your environment variables.
7. Regenerate the rex VS project files from the cmake files. Remember to invoke cmake from a process that was created
after steps 3 and 6 in order for the environment settings to take effect. This means restarting Visual Studio or
any command prompts after changing the environment settings.
* If configure and nmake doesn't work you can try to download built version of Qt SDK
from: http://dev.realxtend.org/gf/project/viewerdeps/frs/
Built was made on Windows Vista 32bit
1) Download Qt.zip
2) Unzip to c:\
(ensure that folder structure is like below)
3) set environment variable: QTDIR=C:\Qt\2009.02-visual-studio\qt | Preparing Qt for use with Visual Studio 2008 and rex
This set of instructions is adapted from
http://dcsoft.com/community_server/blogs/dcsoft/archive/2009/03/06/how-to-setup-qt-4-5-visual-studio-integration.aspx
(which was a bit outdated).
1. Download Qt source package from http://www.qtsoftware.com/downloads
Choose LGPL/Free -> Qt Framework only (Windows) -> Source code available on this link
(direct link: http://get.qtsoftware.com/qt/source/qt-win-opensource-src-4.5.1.zip)
2. Extract zip to C: root. Rename the created directory to something more convenient, like Qt (assumed below)
3. Add C:\Qt\bin to your path
4. Open VS2008 command prompt, go to C:\Qt and run
configure -platform win32-msvc2008
5. In the same directory, run
nmake
6. Add QTDIR = C:\Qt to your environment variables.
7. Regenerate the rex VS project files from the cmake files. Remember to invoke cmake from a process that was created
after steps 3 and 6 in order for the environment settings to take effect. This means restarting Visual Studio or
any command prompts after changing the environment settings.
+
+
+ * If configure and nmake doesn't work you can try to download built version of Qt SDK
+ from: http://dev.realxtend.org/gf/project/viewerdeps/frs/
+
+ Built was made on Windows Vista 32bit
+
+ 1) Download Qt.zip
+ 2) Unzip to c:\
+ (ensure that folder structure is like below)
+ 3) set environment variable: QTDIR=C:\Qt\2009.02-visual-studio\qt | 11 | 0.458333 | 11 | 0 |
293b818433794eaf0e90f5e2383a9c3aabfa5842 | requirements.txt | requirements.txt |
Django==1.10
# Include https://github.com/tzangms/django-bootstrap-form/pull/88 fix. Can change to version number when version increments above 3.2.1
git+https://github.com/tzangms/django-bootstrap-form.git@5fff56f715bd9f2f29793f6a5a87baa1be25e409#egg=django-bootstrap-form
-e git+https://github.com/MoveOnOrg/huerta.git@master#egg=huerta
-e git+https://github.com/MoveOnOrg/python-actionkit.git@public-master#egg=python-actionkit
#mysqlclient==1.3.7
psycopg2==2.7.5
requests==2.20.0
six==1.11.0
drf-hal-json==0.9.1
mockredispy
django-redis~=4.4
django-cachalot
boto3==1.9.130
botocore==1.12.252
zappa
|
Django==1.10
# Include https://github.com/tzangms/django-bootstrap-form/pull/88 fix. Can change to version number when version increments above 3.2.1
git+https://github.com/tzangms/django-bootstrap-form.git@5fff56f715bd9f2f29793f6a5a87baa1be25e409#egg=django-bootstrap-form
-e git+https://github.com/MoveOnOrg/huerta.git@master#egg=huerta
-e git+https://github.com/MoveOnOrg/python-actionkit.git@public-master#egg=python-actionkit
#mysqlclient==1.3.7
psycopg2
requests==2.20.0
six==1.11.0
drf-hal-json==0.9.1
mockredispy
django-redis~=4.4
django-cachalot
boto3==1.9.130
botocore==1.12.252
zappa
pytz
| Update psycopg version and add pytz requirement The previously pinned version was failing to build. | Update psycopg version and add pytz requirement
The previously pinned version was failing to build.
| Text | mit | MoveOnOrg/eventroller,MoveOnOrg/eventroller,MoveOnOrg/eventroller | text | ## Code Before:
Django==1.10
# Include https://github.com/tzangms/django-bootstrap-form/pull/88 fix. Can change to version number when version increments above 3.2.1
git+https://github.com/tzangms/django-bootstrap-form.git@5fff56f715bd9f2f29793f6a5a87baa1be25e409#egg=django-bootstrap-form
-e git+https://github.com/MoveOnOrg/huerta.git@master#egg=huerta
-e git+https://github.com/MoveOnOrg/python-actionkit.git@public-master#egg=python-actionkit
#mysqlclient==1.3.7
psycopg2==2.7.5
requests==2.20.0
six==1.11.0
drf-hal-json==0.9.1
mockredispy
django-redis~=4.4
django-cachalot
boto3==1.9.130
botocore==1.12.252
zappa
## Instruction:
Update psycopg version and add pytz requirement
The previously pinned version was failing to build.
## Code After:
Django==1.10
# Include https://github.com/tzangms/django-bootstrap-form/pull/88 fix. Can change to version number when version increments above 3.2.1
git+https://github.com/tzangms/django-bootstrap-form.git@5fff56f715bd9f2f29793f6a5a87baa1be25e409#egg=django-bootstrap-form
-e git+https://github.com/MoveOnOrg/huerta.git@master#egg=huerta
-e git+https://github.com/MoveOnOrg/python-actionkit.git@public-master#egg=python-actionkit
#mysqlclient==1.3.7
psycopg2
requests==2.20.0
six==1.11.0
drf-hal-json==0.9.1
mockredispy
django-redis~=4.4
django-cachalot
boto3==1.9.130
botocore==1.12.252
zappa
pytz
|
Django==1.10
# Include https://github.com/tzangms/django-bootstrap-form/pull/88 fix. Can change to version number when version increments above 3.2.1
git+https://github.com/tzangms/django-bootstrap-form.git@5fff56f715bd9f2f29793f6a5a87baa1be25e409#egg=django-bootstrap-form
-e git+https://github.com/MoveOnOrg/huerta.git@master#egg=huerta
-e git+https://github.com/MoveOnOrg/python-actionkit.git@public-master#egg=python-actionkit
#mysqlclient==1.3.7
- psycopg2==2.7.5
+ psycopg2
requests==2.20.0
six==1.11.0
drf-hal-json==0.9.1
mockredispy
django-redis~=4.4
django-cachalot
boto3==1.9.130
botocore==1.12.252
zappa
+ pytz | 3 | 0.142857 | 2 | 1 |
6165ebfb0dcb632a2469e3de4ae3344413bc0378 | src/app.rb | src/app.rb | require 'sinatra'
require 'resque'
require 'dotenv'
require_relative 'upgrade'
Dotenv.load
enable :logging
set :bind, '0.0.0.0'
set :port, '8080'
config = ENV.select { |k,v| k.start_with?("RANCHER_") }
redis_host = ENV['REDIS_HOST'] || 'localhost'
redis_port = ENV['REDIS_PORT'] || '6379'
Resque.redis = "#{redis_host}:#{redis_port}"
puts '---'
for key,val in config
puts "#{key}: #{val}"
end
puts '---'
post '/hook' do
content_type :json
request.body.rewind
data = JSON.parse request.body.read
repo_name = data['repository']['repo_name']
tag = data['push_data']['tag']
image_uuid = "docker:#{repo_name}:#{tag}"
Resque.enqueue(Upgrade, image_uuid, config)
return {
status: "accepted",
data: {
rancher_url: config["RANCHER_URL"],
image_uuid: image_uuid
}
}.to_json
end
| require 'sinatra'
require 'resque'
require 'dotenv'
require_relative 'upgrade'
Dotenv.load
enable :logging
set :bind, '0.0.0.0'
set :port, '8080'
config = ENV.select { |k,v| k.start_with?("RANCHER_") }
token = ENV['TOKEN']
redis_host = ENV['REDIS_HOST'] || 'localhost'
redis_port = ENV['REDIS_PORT'] || '6379'
Resque.redis = "#{redis_host}:#{redis_port}"
raise "TOKEN required" if !token
puts '---'
for key,val in config
puts "#{key}: #{val}"
end
puts '---'
get "/check/#{token}" do
'OK'
end
post "/hook/#{token}" do
content_type :json
request.body.rewind
data = JSON.parse request.body.read
repo_name = data['repository']['repo_name']
tag = data['push_data']['tag']
image_uuid = "docker:#{repo_name}:#{tag}"
Resque.enqueue(Upgrade, image_uuid, config)
return {
status: "accepted",
data: {
rancher_url: config["RANCHER_URL"],
image_uuid: image_uuid
}
}.to_json
end
| Add TOKEN env var for security | Add TOKEN env var for security
| Ruby | mit | chickenzord/rancher-autodeploy | ruby | ## Code Before:
require 'sinatra'
require 'resque'
require 'dotenv'
require_relative 'upgrade'
Dotenv.load
enable :logging
set :bind, '0.0.0.0'
set :port, '8080'
config = ENV.select { |k,v| k.start_with?("RANCHER_") }
redis_host = ENV['REDIS_HOST'] || 'localhost'
redis_port = ENV['REDIS_PORT'] || '6379'
Resque.redis = "#{redis_host}:#{redis_port}"
puts '---'
for key,val in config
puts "#{key}: #{val}"
end
puts '---'
post '/hook' do
content_type :json
request.body.rewind
data = JSON.parse request.body.read
repo_name = data['repository']['repo_name']
tag = data['push_data']['tag']
image_uuid = "docker:#{repo_name}:#{tag}"
Resque.enqueue(Upgrade, image_uuid, config)
return {
status: "accepted",
data: {
rancher_url: config["RANCHER_URL"],
image_uuid: image_uuid
}
}.to_json
end
## Instruction:
Add TOKEN env var for security
## Code After:
require 'sinatra'
require 'resque'
require 'dotenv'
require_relative 'upgrade'
Dotenv.load
enable :logging
set :bind, '0.0.0.0'
set :port, '8080'
config = ENV.select { |k,v| k.start_with?("RANCHER_") }
token = ENV['TOKEN']
redis_host = ENV['REDIS_HOST'] || 'localhost'
redis_port = ENV['REDIS_PORT'] || '6379'
Resque.redis = "#{redis_host}:#{redis_port}"
raise "TOKEN required" if !token
puts '---'
for key,val in config
puts "#{key}: #{val}"
end
puts '---'
get "/check/#{token}" do
'OK'
end
post "/hook/#{token}" do
content_type :json
request.body.rewind
data = JSON.parse request.body.read
repo_name = data['repository']['repo_name']
tag = data['push_data']['tag']
image_uuid = "docker:#{repo_name}:#{tag}"
Resque.enqueue(Upgrade, image_uuid, config)
return {
status: "accepted",
data: {
rancher_url: config["RANCHER_URL"],
image_uuid: image_uuid
}
}.to_json
end
| require 'sinatra'
require 'resque'
require 'dotenv'
require_relative 'upgrade'
Dotenv.load
enable :logging
set :bind, '0.0.0.0'
set :port, '8080'
config = ENV.select { |k,v| k.start_with?("RANCHER_") }
-
+ token = ENV['TOKEN']
redis_host = ENV['REDIS_HOST'] || 'localhost'
redis_port = ENV['REDIS_PORT'] || '6379'
Resque.redis = "#{redis_host}:#{redis_port}"
+
+ raise "TOKEN required" if !token
puts '---'
for key,val in config
puts "#{key}: #{val}"
end
puts '---'
- post '/hook' do
+ get "/check/#{token}" do
+ 'OK'
+ end
+
+ post "/hook/#{token}" do
content_type :json
request.body.rewind
data = JSON.parse request.body.read
repo_name = data['repository']['repo_name']
tag = data['push_data']['tag']
image_uuid = "docker:#{repo_name}:#{tag}"
Resque.enqueue(Upgrade, image_uuid, config)
return {
status: "accepted",
data: {
rancher_url: config["RANCHER_URL"],
image_uuid: image_uuid
}
}.to_json
end | 10 | 0.238095 | 8 | 2 |
8235e2e93031c51a7d66330346ce3408734e2154 | app/sessionManager.js | app/sessionManager.js | 'use strict';
var React = require('react-native');
var Constants = require('./constants');
var { AsyncStorage } = React;
var SessionManager = {
login: function(user) {
return new Promise(function(resolve, reject) {
var url = Constants.APP_SERVER_HOST + '/users/register';
fetch(url, {
method: 'post',
body: JSON.stringify({user: user}),
headers: new Headers({
'Content-Type': 'application/json'
})
})
.then(response => {
if(response.ok) {
return response.json();
} else {
reject(new Error(JSON.parse(response._bodyText).error)); //FixIt - Shoudn't be using the quasi private method
}
})
.then(response => {
var user = {
name: response.user.name,
email: response.user.email,
avatar: response.user.gravatar_url
}
console.log(user);
AsyncStorage
.setItem(Constants.CURRENT_USER_STORAGE_KEY, JSON.stringify(user))
.then((value) => resolve(value));
})
.catch(error => reject(error));
});
},
getCurrentUser: function() {
return new Promise(function(resolve, reject) {
AsyncStorage.getItem(Constants.CURRENT_USER_STORAGE_KEY)
.then((value) => {
if(value === null) reject(Error('No user logged in!'));
resolve(JSON.parse(value));
});
});
}
};
module.exports = SessionManager;
| 'use strict';
var React = require('react-native');
var Constants = require('./constants');
var { AsyncStorage } = React;
const CURRENT_USER_STORAGE_KEY = 'currentUser';
var SessionManager = {
login: function(user) {
return new Promise(function(resolve, reject) {
var url = Constants.APP_SERVER_HOST + '/users/register';
fetch(url, {
method: 'post',
body: JSON.stringify({user: user}),
headers: new Headers({
'Content-Type': 'application/json'
})
})
.then(response => {
if(response.ok) {
return response.json();
} else {
reject(new Error(JSON.parse(response._bodyText).error)); //FixIt - Shoudn't be using the quasi private method
}
})
.then(response => {
var user = {
name: response.user.name,
email: response.user.email,
avatar: response.user.gravatar_url
}
console.log(user);
AsyncStorage
.setItem(CURRENT_USER_STORAGE_KEY, JSON.stringify(user))
.then((value) => resolve(value));
})
.catch(error => reject(error));
});
},
getCurrentUser: function() {
return new Promise(function(resolve, reject) {
AsyncStorage.getItem(CURRENT_USER_STORAGE_KEY)
.then((value) => {
if(value === null) reject(Error('No user logged in!'));
resolve(JSON.parse(value));
});
});
}
};
module.exports = SessionManager;
| Move the CURRENT_USER_STORAGE_KEY constant to SessionManager | Move the CURRENT_USER_STORAGE_KEY constant to SessionManager
| JavaScript | mit | multunus/moveit-mobile,multunus/moveit-mobile,multunus/moveit-mobile | javascript | ## Code Before:
'use strict';
var React = require('react-native');
var Constants = require('./constants');
var { AsyncStorage } = React;
var SessionManager = {
login: function(user) {
return new Promise(function(resolve, reject) {
var url = Constants.APP_SERVER_HOST + '/users/register';
fetch(url, {
method: 'post',
body: JSON.stringify({user: user}),
headers: new Headers({
'Content-Type': 'application/json'
})
})
.then(response => {
if(response.ok) {
return response.json();
} else {
reject(new Error(JSON.parse(response._bodyText).error)); //FixIt - Shoudn't be using the quasi private method
}
})
.then(response => {
var user = {
name: response.user.name,
email: response.user.email,
avatar: response.user.gravatar_url
}
console.log(user);
AsyncStorage
.setItem(Constants.CURRENT_USER_STORAGE_KEY, JSON.stringify(user))
.then((value) => resolve(value));
})
.catch(error => reject(error));
});
},
getCurrentUser: function() {
return new Promise(function(resolve, reject) {
AsyncStorage.getItem(Constants.CURRENT_USER_STORAGE_KEY)
.then((value) => {
if(value === null) reject(Error('No user logged in!'));
resolve(JSON.parse(value));
});
});
}
};
module.exports = SessionManager;
## Instruction:
Move the CURRENT_USER_STORAGE_KEY constant to SessionManager
## Code After:
'use strict';
var React = require('react-native');
var Constants = require('./constants');
var { AsyncStorage } = React;
const CURRENT_USER_STORAGE_KEY = 'currentUser';
var SessionManager = {
login: function(user) {
return new Promise(function(resolve, reject) {
var url = Constants.APP_SERVER_HOST + '/users/register';
fetch(url, {
method: 'post',
body: JSON.stringify({user: user}),
headers: new Headers({
'Content-Type': 'application/json'
})
})
.then(response => {
if(response.ok) {
return response.json();
} else {
reject(new Error(JSON.parse(response._bodyText).error)); //FixIt - Shoudn't be using the quasi private method
}
})
.then(response => {
var user = {
name: response.user.name,
email: response.user.email,
avatar: response.user.gravatar_url
}
console.log(user);
AsyncStorage
.setItem(CURRENT_USER_STORAGE_KEY, JSON.stringify(user))
.then((value) => resolve(value));
})
.catch(error => reject(error));
});
},
getCurrentUser: function() {
return new Promise(function(resolve, reject) {
AsyncStorage.getItem(CURRENT_USER_STORAGE_KEY)
.then((value) => {
if(value === null) reject(Error('No user logged in!'));
resolve(JSON.parse(value));
});
});
}
};
module.exports = SessionManager;
| 'use strict';
var React = require('react-native');
var Constants = require('./constants');
var { AsyncStorage } = React;
+
+ const CURRENT_USER_STORAGE_KEY = 'currentUser';
var SessionManager = {
login: function(user) {
return new Promise(function(resolve, reject) {
var url = Constants.APP_SERVER_HOST + '/users/register';
fetch(url, {
method: 'post',
body: JSON.stringify({user: user}),
headers: new Headers({
'Content-Type': 'application/json'
})
})
.then(response => {
if(response.ok) {
return response.json();
} else {
reject(new Error(JSON.parse(response._bodyText).error)); //FixIt - Shoudn't be using the quasi private method
}
})
.then(response => {
var user = {
name: response.user.name,
email: response.user.email,
avatar: response.user.gravatar_url
}
console.log(user);
AsyncStorage
- .setItem(Constants.CURRENT_USER_STORAGE_KEY, JSON.stringify(user))
? ----------
+ .setItem(CURRENT_USER_STORAGE_KEY, JSON.stringify(user))
.then((value) => resolve(value));
})
.catch(error => reject(error));
});
},
getCurrentUser: function() {
return new Promise(function(resolve, reject) {
- AsyncStorage.getItem(Constants.CURRENT_USER_STORAGE_KEY)
? ----------
+ AsyncStorage.getItem(CURRENT_USER_STORAGE_KEY)
.then((value) => {
if(value === null) reject(Error('No user logged in!'));
resolve(JSON.parse(value));
});
});
}
};
module.exports = SessionManager; | 6 | 0.115385 | 4 | 2 |
148aa42043e7d7cf20669b57c74530119819aebc | src/main/java/org/jenkinsci/plugins/dockerbuildstep/cmd/DockerCommand.java | src/main/java/org/jenkinsci/plugins/dockerbuildstep/cmd/DockerCommand.java | package org.jenkinsci.plugins.dockerbuildstep.cmd;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.AbstractBuild;
import hudson.model.Descriptor;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.dockerbuildstep.DockerBuilder;
import org.jenkinsci.plugins.dockerbuildstep.log.ConsoleLogger;
import com.kpelykh.docker.client.DockerClient;
import com.kpelykh.docker.client.DockerException;
/**
* Parent class of all Docker commands.
*
* @author vjuranek
*
*/
public abstract class DockerCommand implements Describable<DockerCommand>, ExtensionPoint {
public abstract void execute(@SuppressWarnings("rawtypes") AbstractBuild build, ConsoleLogger console)
throws DockerException;
protected static DockerClient getClient() {
return ((DockerBuilder.DescriptorImpl) Jenkins.getInstance().getDescriptor(DockerBuilder.class))
.getDockerClient();
}
public DockerCommandDescriptor getDescriptor() {
return (DockerCommandDescriptor) Jenkins.getInstance().getDescriptor(getClass());
}
public static DescriptorExtensionList<DockerCommand, DockerCommandDescriptor> all() {
return Jenkins.getInstance().<DockerCommand, DockerCommandDescriptor> getDescriptorList(DockerCommand.class);
}
public abstract static class DockerCommandDescriptor extends Descriptor<DockerCommand> {
protected DockerCommandDescriptor(Class<? extends DockerCommand> clazz) {
super(clazz);
}
protected DockerCommandDescriptor() {
}
}
}
| package org.jenkinsci.plugins.dockerbuildstep.cmd;
import hudson.AbortException;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.AbstractBuild;
import hudson.model.Descriptor;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.dockerbuildstep.DockerBuilder;
import org.jenkinsci.plugins.dockerbuildstep.log.ConsoleLogger;
import com.kpelykh.docker.client.DockerClient;
import com.kpelykh.docker.client.DockerException;
/**
* Parent class of all Docker commands.
*
* @author vjuranek
*
*/
public abstract class DockerCommand implements Describable<DockerCommand>, ExtensionPoint {
public abstract void execute(@SuppressWarnings("rawtypes") AbstractBuild build, ConsoleLogger console)
throws DockerException, AbortException;
protected static DockerClient getClient() {
return ((DockerBuilder.DescriptorImpl) Jenkins.getInstance().getDescriptor(DockerBuilder.class))
.getDockerClient();
}
public DockerCommandDescriptor getDescriptor() {
return (DockerCommandDescriptor) Jenkins.getInstance().getDescriptor(getClass());
}
public static DescriptorExtensionList<DockerCommand, DockerCommandDescriptor> all() {
return Jenkins.getInstance().<DockerCommand, DockerCommandDescriptor> getDescriptorList(DockerCommand.class);
}
public abstract static class DockerCommandDescriptor extends Descriptor<DockerCommand> {
protected DockerCommandDescriptor(Class<? extends DockerCommand> clazz) {
super(clazz);
}
protected DockerCommandDescriptor() {
}
}
}
| Allow commands to throw AbortException to fail the build | Allow commands to throw AbortException to fail the build
| Java | mit | draoullig/docker-build-step-plugin,wzheng2310/docker-build-step-plugin,BlackPepperSoftware/docker-build-step-plugin,wzheng2310/docker-build-step-plugin,ldtkms/docker-build-step-plugin,tylerdavis/docker-build-step-plugin,ldtkms/docker-build-step-plugin,BlackPepperSoftware/docker-build-step-plugin,draoullig/docker-build-step-plugin,tylerdavis/docker-build-step-plugin | java | ## Code Before:
package org.jenkinsci.plugins.dockerbuildstep.cmd;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.AbstractBuild;
import hudson.model.Descriptor;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.dockerbuildstep.DockerBuilder;
import org.jenkinsci.plugins.dockerbuildstep.log.ConsoleLogger;
import com.kpelykh.docker.client.DockerClient;
import com.kpelykh.docker.client.DockerException;
/**
* Parent class of all Docker commands.
*
* @author vjuranek
*
*/
public abstract class DockerCommand implements Describable<DockerCommand>, ExtensionPoint {
public abstract void execute(@SuppressWarnings("rawtypes") AbstractBuild build, ConsoleLogger console)
throws DockerException;
protected static DockerClient getClient() {
return ((DockerBuilder.DescriptorImpl) Jenkins.getInstance().getDescriptor(DockerBuilder.class))
.getDockerClient();
}
public DockerCommandDescriptor getDescriptor() {
return (DockerCommandDescriptor) Jenkins.getInstance().getDescriptor(getClass());
}
public static DescriptorExtensionList<DockerCommand, DockerCommandDescriptor> all() {
return Jenkins.getInstance().<DockerCommand, DockerCommandDescriptor> getDescriptorList(DockerCommand.class);
}
public abstract static class DockerCommandDescriptor extends Descriptor<DockerCommand> {
protected DockerCommandDescriptor(Class<? extends DockerCommand> clazz) {
super(clazz);
}
protected DockerCommandDescriptor() {
}
}
}
## Instruction:
Allow commands to throw AbortException to fail the build
## Code After:
package org.jenkinsci.plugins.dockerbuildstep.cmd;
import hudson.AbortException;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.AbstractBuild;
import hudson.model.Descriptor;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.dockerbuildstep.DockerBuilder;
import org.jenkinsci.plugins.dockerbuildstep.log.ConsoleLogger;
import com.kpelykh.docker.client.DockerClient;
import com.kpelykh.docker.client.DockerException;
/**
* Parent class of all Docker commands.
*
* @author vjuranek
*
*/
public abstract class DockerCommand implements Describable<DockerCommand>, ExtensionPoint {
public abstract void execute(@SuppressWarnings("rawtypes") AbstractBuild build, ConsoleLogger console)
throws DockerException, AbortException;
protected static DockerClient getClient() {
return ((DockerBuilder.DescriptorImpl) Jenkins.getInstance().getDescriptor(DockerBuilder.class))
.getDockerClient();
}
public DockerCommandDescriptor getDescriptor() {
return (DockerCommandDescriptor) Jenkins.getInstance().getDescriptor(getClass());
}
public static DescriptorExtensionList<DockerCommand, DockerCommandDescriptor> all() {
return Jenkins.getInstance().<DockerCommand, DockerCommandDescriptor> getDescriptorList(DockerCommand.class);
}
public abstract static class DockerCommandDescriptor extends Descriptor<DockerCommand> {
protected DockerCommandDescriptor(Class<? extends DockerCommand> clazz) {
super(clazz);
}
protected DockerCommandDescriptor() {
}
}
}
| package org.jenkinsci.plugins.dockerbuildstep.cmd;
+ import hudson.AbortException;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.AbstractBuild;
import hudson.model.Descriptor;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.dockerbuildstep.DockerBuilder;
import org.jenkinsci.plugins.dockerbuildstep.log.ConsoleLogger;
import com.kpelykh.docker.client.DockerClient;
import com.kpelykh.docker.client.DockerException;
/**
* Parent class of all Docker commands.
*
* @author vjuranek
*
*/
public abstract class DockerCommand implements Describable<DockerCommand>, ExtensionPoint {
public abstract void execute(@SuppressWarnings("rawtypes") AbstractBuild build, ConsoleLogger console)
- throws DockerException;
+ throws DockerException, AbortException;
? ++++++++++++++++
protected static DockerClient getClient() {
return ((DockerBuilder.DescriptorImpl) Jenkins.getInstance().getDescriptor(DockerBuilder.class))
.getDockerClient();
}
public DockerCommandDescriptor getDescriptor() {
return (DockerCommandDescriptor) Jenkins.getInstance().getDescriptor(getClass());
}
public static DescriptorExtensionList<DockerCommand, DockerCommandDescriptor> all() {
return Jenkins.getInstance().<DockerCommand, DockerCommandDescriptor> getDescriptorList(DockerCommand.class);
}
public abstract static class DockerCommandDescriptor extends Descriptor<DockerCommand> {
protected DockerCommandDescriptor(Class<? extends DockerCommand> clazz) {
super(clazz);
}
protected DockerCommandDescriptor() {
}
}
} | 3 | 0.0625 | 2 | 1 |
7bf90f0829e917795dd552996400d26ac7cb36cd | app.rb | app.rb | require 'sinatra'
require 'json'
require 'sinatra/json'
require 'sinatra/reloader' if development?
require 'rest-client'
require_relative 'env.rb'
set :server, "thin"
set :robot, Config::ROBOT
before do
@request_body = JSON.parse request.body.read
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'SubscriptionConfirmation'
RestClient.get @request_body["SubscribeURL"]
end
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'Notification'
@subject = @request_body["Subject"]
@message = @request_body["Message"]
@time = @request_body["Timestamp"]
end
end
post '/test', :agent => /^Paw/ do
json test: request.env
end
post '/aws', :agent => /^Amazon/ do
robot_message = {
"msgtype": "markdown",
"markdown": {
"title": @subject,
"text": "### #{@subject}\n" +
"> #{@message}\n\n" +
"> ###### 时间 #{@time}"
},
"at": {
"atMobiles": [
Config::LIUSINING
],
"isAtAll": false
}
}
RestClient.post settings.robot, robot_message.to_json, {content_type: :json, accept: :json}
status = 200
end
| require 'sinatra'
require 'json'
require 'sinatra/json'
require 'sinatra/reloader' if development?
require 'rest-client'
require_relative 'env.rb'
set :server, "thin"
set :robot, Config::ROBOT
before do
@request_body = JSON.parse request.body.read
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'SubscriptionConfirmation'
RestClient.get @request_body["SubscribeURL"]
end
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'Notification'
@subject = @request_body["Subject"]
@message = @request_body["Message"]
@time = @request_body["Timestamp"]
end
end
post '/test', :agent => /^Paw/ do
json test: request.env
end
post '/aws', :agent => /^Amazon/ do
robot_message = {
"msgtype": "markdown",
"markdown": {
"title": @subject,
"text": "### #{@subject}\n" +
"> #{@message.to_json.gsub(',', ",\n")}\n\n" +
"> ###### 时间 #{@time}"
},
"at": {
"atMobiles": [
Config::LIUSINING
],
"isAtAll": false
}
}
RestClient.post settings.robot, robot_message.to_json, {content_type: :json, accept: :json}
status = 200
end
| Add a formatter for message, to make it pretty | Add a formatter for message, to make it pretty
| Ruby | mit | liusining/aws-sns-to-dingtalk | ruby | ## Code Before:
require 'sinatra'
require 'json'
require 'sinatra/json'
require 'sinatra/reloader' if development?
require 'rest-client'
require_relative 'env.rb'
set :server, "thin"
set :robot, Config::ROBOT
before do
@request_body = JSON.parse request.body.read
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'SubscriptionConfirmation'
RestClient.get @request_body["SubscribeURL"]
end
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'Notification'
@subject = @request_body["Subject"]
@message = @request_body["Message"]
@time = @request_body["Timestamp"]
end
end
post '/test', :agent => /^Paw/ do
json test: request.env
end
post '/aws', :agent => /^Amazon/ do
robot_message = {
"msgtype": "markdown",
"markdown": {
"title": @subject,
"text": "### #{@subject}\n" +
"> #{@message}\n\n" +
"> ###### 时间 #{@time}"
},
"at": {
"atMobiles": [
Config::LIUSINING
],
"isAtAll": false
}
}
RestClient.post settings.robot, robot_message.to_json, {content_type: :json, accept: :json}
status = 200
end
## Instruction:
Add a formatter for message, to make it pretty
## Code After:
require 'sinatra'
require 'json'
require 'sinatra/json'
require 'sinatra/reloader' if development?
require 'rest-client'
require_relative 'env.rb'
set :server, "thin"
set :robot, Config::ROBOT
before do
@request_body = JSON.parse request.body.read
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'SubscriptionConfirmation'
RestClient.get @request_body["SubscribeURL"]
end
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'Notification'
@subject = @request_body["Subject"]
@message = @request_body["Message"]
@time = @request_body["Timestamp"]
end
end
post '/test', :agent => /^Paw/ do
json test: request.env
end
post '/aws', :agent => /^Amazon/ do
robot_message = {
"msgtype": "markdown",
"markdown": {
"title": @subject,
"text": "### #{@subject}\n" +
"> #{@message.to_json.gsub(',', ",\n")}\n\n" +
"> ###### 时间 #{@time}"
},
"at": {
"atMobiles": [
Config::LIUSINING
],
"isAtAll": false
}
}
RestClient.post settings.robot, robot_message.to_json, {content_type: :json, accept: :json}
status = 200
end
| require 'sinatra'
require 'json'
require 'sinatra/json'
require 'sinatra/reloader' if development?
require 'rest-client'
require_relative 'env.rb'
set :server, "thin"
set :robot, Config::ROBOT
before do
@request_body = JSON.parse request.body.read
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'SubscriptionConfirmation'
RestClient.get @request_body["SubscribeURL"]
end
end
before do
if request.env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'] == 'Notification'
@subject = @request_body["Subject"]
@message = @request_body["Message"]
@time = @request_body["Timestamp"]
end
end
post '/test', :agent => /^Paw/ do
json test: request.env
end
post '/aws', :agent => /^Amazon/ do
robot_message = {
"msgtype": "markdown",
"markdown": {
"title": @subject,
"text": "### #{@subject}\n" +
- "> #{@message}\n\n" +
+ "> #{@message.to_json.gsub(',', ",\n")}\n\n" +
? +++++++++++++++++++++++++
"> ###### 时间 #{@time}"
},
"at": {
"atMobiles": [
Config::LIUSINING
],
"isAtAll": false
}
}
RestClient.post settings.robot, robot_message.to_json, {content_type: :json, accept: :json}
status = 200
end | 2 | 0.039216 | 1 | 1 |
1441770c31fd0300a3b96a04260e26463850e8ed | spec/bandwidth/xml/verbs/gather_spec.rb | spec/bandwidth/xml/verbs/gather_spec.rb | Gather = Bandwidth::Xml::Verbs::Gather
describe Gather do
describe '#to_xml' do
it 'should generate valid xml' do
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost"))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\"/></Response>")
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost", :max_digits => 2))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\" maxDigits=\"2\"/></Response>")
end
end
end
| Gather = Bandwidth::Xml::Verbs::Gather
describe Gather do
describe '#to_xml' do
it 'should generate valid xml' do
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost"))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\"></Gather></Response>")
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost", :max_digits => 2))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\" maxDigits=\"2\"></Gather></Response>")
end
end
end
| Gather should generate valid XML. | Gather should generate valid XML.
| Ruby | mit | bandwidthcom/ruby-bandwidth,bandwidthcom/ruby-bandwidth | ruby | ## Code Before:
Gather = Bandwidth::Xml::Verbs::Gather
describe Gather do
describe '#to_xml' do
it 'should generate valid xml' do
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost"))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\"/></Response>")
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost", :max_digits => 2))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\" maxDigits=\"2\"/></Response>")
end
end
end
## Instruction:
Gather should generate valid XML.
## Code After:
Gather = Bandwidth::Xml::Verbs::Gather
describe Gather do
describe '#to_xml' do
it 'should generate valid xml' do
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost"))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\"></Gather></Response>")
expect(Helper.to_xml(Gather.new(:request_url => "http://localhost", :max_digits => 2))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\" maxDigits=\"2\"></Gather></Response>")
end
end
end
| Gather = Bandwidth::Xml::Verbs::Gather
describe Gather do
describe '#to_xml' do
it 'should generate valid xml' do
- expect(Helper.to_xml(Gather.new(:request_url => "http://localhost"))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\"/></Response>")
+ expect(Helper.to_xml(Gather.new(:request_url => "http://localhost"))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\"></Gather></Response>")
? ++ ++++++
- expect(Helper.to_xml(Gather.new(:request_url => "http://localhost", :max_digits => 2))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\" maxDigits=\"2\"/></Response>")
? ^
+ expect(Helper.to_xml(Gather.new(:request_url => "http://localhost", :max_digits => 2))).to eql("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Gather requestUrl=\"http://localhost\" maxDigits=\"2\"></Gather></Response>")
? ^^^^^^^^^
end
end
end
| 4 | 0.4 | 2 | 2 |
ff5af455cd89c8e5c8908bdef58c93655f797a04 | requirements-test.txt | requirements-test.txt | pytest
coverage<5
codecov
pytest-mypy
pytest-cov
pytest-black
nbval
fastparquet>=0.3.3
flake8
check-manifest>=0.41
twine>=3.1.1 | pytest
coverage<5
codecov
pytest-mypy
pytest-cov
pytest-black
nbval
fastparquet>=0.3.3
flake8
check-manifest>=0.41
twine>=3.1.1
dask[complete]>=2.14.0 | Update dask dependency in requirement-test Dask is an optional dependency | Update dask dependency in requirement-test
Dask is an optional dependency
| Text | mit | JosPolfliet/pandas-profiling,JosPolfliet/pandas-profiling | text | ## Code Before:
pytest
coverage<5
codecov
pytest-mypy
pytest-cov
pytest-black
nbval
fastparquet>=0.3.3
flake8
check-manifest>=0.41
twine>=3.1.1
## Instruction:
Update dask dependency in requirement-test
Dask is an optional dependency
## Code After:
pytest
coverage<5
codecov
pytest-mypy
pytest-cov
pytest-black
nbval
fastparquet>=0.3.3
flake8
check-manifest>=0.41
twine>=3.1.1
dask[complete]>=2.14.0 | pytest
coverage<5
codecov
pytest-mypy
pytest-cov
pytest-black
nbval
fastparquet>=0.3.3
flake8
check-manifest>=0.41
twine>=3.1.1
+ dask[complete]>=2.14.0 | 1 | 0.090909 | 1 | 0 |
67605f98911850f87aa48c35d46c9aaefbd1e50d | app/models/setup/operation.rb | app/models/setup/operation.rb | module Setup
class Operation < Webhook
build_in_data_type.including(:resource).referenced_by(:resource, :method)
deny :create
belongs_to :resource, class_name: Setup::Resource.to_s, inverse_of: :operations
trace_ignore :resource_id
field :description, type: String
field :method, type: String
parameters :parameters, :headers
# trace_references :parameters, :headers
validates_presence_of :resource, :method
def tracing?
false
end
def params_stack
super.insert(-2, resource)
end
def scope_title
resource && resource.custom_title
end
def namespace
(resource && resource.namespace) || ''
end
def path
resource && resource.path
end
def template_parameters
(resource && resource.template_parameters) || []
end
def name
"#{method.to_s.upcase} #{resource && resource.custom_title}"
end
def label
"#{method.to_s.upcase}"
end
def title
label
end
def connections
(resource && resource.connections).presence || super
end
class << self
def namespace_enum
Setup::Resource.namespace_enum
end
end
protected
def conforms(field, template_parameters = {}, base_hash = nil)
if resource
base_hash = resource.conforms(field, template_parameters, base_hash)
end
super
end
end
end
| module Setup
class Operation < Webhook
build_in_data_type
.including(:resource)
.referenced_by(:resource, :method)
.and(abstract: true)
deny :create
belongs_to :resource, class_name: Setup::Resource.to_s, inverse_of: :operations
trace_ignore :resource_id
field :description, type: String
field :method, type: String
validates_uniqueness_of :method, scope: :resource
parameters :parameters, :headers
# trace_references :parameters, :headers
validates_presence_of :resource, :method
def tracing?
false
end
def params_stack
super.insert(-2, resource)
end
def scope_title
resource&.custom_title
end
def namespace
resource&.namespace || ''
end
def path
resource&.path
end
def template_parameters
resource&.template_parameters || []
end
def name
"#{method.to_s.upcase} #{resource&.custom_title}"
end
def label
"#{method.to_s.upcase}"
end
def title
label
end
def connections
resource&.connections.presence || super
end
class << self
def namespace_enum
Setup::Resource.namespace_enum
end
end
protected
def conforms(field, template_parameters = {}, base_hash = nil)
if resource
base_hash = resource.conforms(field, template_parameters, base_hash)
end
super
end
end
end
| Update | Operations config & validations | Update | Operations config & validations
| Ruby | mit | cenit-io/cenit,cenit-io/cenit,cenit-io/cenit,cenit-io/cenit | ruby | ## Code Before:
module Setup
class Operation < Webhook
build_in_data_type.including(:resource).referenced_by(:resource, :method)
deny :create
belongs_to :resource, class_name: Setup::Resource.to_s, inverse_of: :operations
trace_ignore :resource_id
field :description, type: String
field :method, type: String
parameters :parameters, :headers
# trace_references :parameters, :headers
validates_presence_of :resource, :method
def tracing?
false
end
def params_stack
super.insert(-2, resource)
end
def scope_title
resource && resource.custom_title
end
def namespace
(resource && resource.namespace) || ''
end
def path
resource && resource.path
end
def template_parameters
(resource && resource.template_parameters) || []
end
def name
"#{method.to_s.upcase} #{resource && resource.custom_title}"
end
def label
"#{method.to_s.upcase}"
end
def title
label
end
def connections
(resource && resource.connections).presence || super
end
class << self
def namespace_enum
Setup::Resource.namespace_enum
end
end
protected
def conforms(field, template_parameters = {}, base_hash = nil)
if resource
base_hash = resource.conforms(field, template_parameters, base_hash)
end
super
end
end
end
## Instruction:
Update | Operations config & validations
## Code After:
module Setup
class Operation < Webhook
build_in_data_type
.including(:resource)
.referenced_by(:resource, :method)
.and(abstract: true)
deny :create
belongs_to :resource, class_name: Setup::Resource.to_s, inverse_of: :operations
trace_ignore :resource_id
field :description, type: String
field :method, type: String
validates_uniqueness_of :method, scope: :resource
parameters :parameters, :headers
# trace_references :parameters, :headers
validates_presence_of :resource, :method
def tracing?
false
end
def params_stack
super.insert(-2, resource)
end
def scope_title
resource&.custom_title
end
def namespace
resource&.namespace || ''
end
def path
resource&.path
end
def template_parameters
resource&.template_parameters || []
end
def name
"#{method.to_s.upcase} #{resource&.custom_title}"
end
def label
"#{method.to_s.upcase}"
end
def title
label
end
def connections
resource&.connections.presence || super
end
class << self
def namespace_enum
Setup::Resource.namespace_enum
end
end
protected
def conforms(field, template_parameters = {}, base_hash = nil)
if resource
base_hash = resource.conforms(field, template_parameters, base_hash)
end
super
end
end
end
| module Setup
class Operation < Webhook
- build_in_data_type.including(:resource).referenced_by(:resource, :method)
+ build_in_data_type
+ .including(:resource)
+ .referenced_by(:resource, :method)
+ .and(abstract: true)
deny :create
belongs_to :resource, class_name: Setup::Resource.to_s, inverse_of: :operations
trace_ignore :resource_id
field :description, type: String
field :method, type: String
+
+ validates_uniqueness_of :method, scope: :resource
parameters :parameters, :headers
# trace_references :parameters, :headers
validates_presence_of :resource, :method
def tracing?
false
end
def params_stack
super.insert(-2, resource)
end
def scope_title
- resource && resource.custom_title
? - ----------
+ resource&.custom_title
end
def namespace
- (resource && resource.namespace) || ''
? ------------- -
+ resource&.namespace || ''
? +
end
def path
- resource && resource.path
? - ----------
+ resource&.path
end
def template_parameters
- (resource && resource.template_parameters) || []
? ------------- -
+ resource&.template_parameters || []
? +
end
def name
- "#{method.to_s.upcase} #{resource && resource.custom_title}"
? - ----------
+ "#{method.to_s.upcase} #{resource&.custom_title}"
end
def label
"#{method.to_s.upcase}"
end
def title
label
end
def connections
- (resource && resource.connections).presence || super
? ------------- -
+ resource&.connections.presence || super
? +
end
class << self
def namespace_enum
Setup::Resource.namespace_enum
end
end
protected
def conforms(field, template_parameters = {}, base_hash = nil)
if resource
base_hash = resource.conforms(field, template_parameters, base_hash)
end
super
end
end
end | 19 | 0.246753 | 12 | 7 |
4d477ba993dcd82ceaf83023336c6eabe8dc2531 | lib/ember-orbit.js | lib/ember-orbit.js | import EO from 'ember-orbit/main';
import Store from 'ember-orbit/store';
import Model from 'ember-orbit/model';
import RecordArrayManager from 'ember-orbit/record-array-manager';
import Schema from 'ember-orbit/schema';
import Source from 'ember-orbit/source';
import attr from 'ember-orbit/fields/attr';
import hasMany from 'ember-orbit/fields/has-many';
import hasOne from 'ember-orbit/fields/has-one';
import HasManyArray from 'ember-orbit/links/has-many-array';
import HasOneObject from 'ember-orbit/links/has-one-object';
import LinkProxyMixin from 'ember-orbit/links/link-proxy-mixin';
import FilteredRecordArray from 'ember-orbit/record-arrays/filtered-record-array';
import RecordArray from 'ember-orbit/record-arrays/record-array';
EO.Store = Store;
EO.Model = Model;
EO.RecordArrayManager = RecordArrayManager;
EO.Schema = Schema;
EO.Source = Source;
EO.attr = attr;
EO.hasOne = hasOne;
EO.hasMany = hasMany;
EO.HasManyArray = HasManyArray;
EO.HasOneObject = HasOneObject;
EO.LinkProxyMixin = LinkProxyMixin;
EO.FilteredRecordArray = FilteredRecordArray;
EO.RecordArray = RecordArray;
export default EO;
| import EO from 'ember-orbit/main';
import Store from 'ember-orbit/store';
import Model from 'ember-orbit/model';
import RecordArrayManager from 'ember-orbit/record-array-manager';
import Schema from 'ember-orbit/schema';
import Source from 'ember-orbit/source';
import HasManyArray from 'ember-orbit/links/has-many-array';
import HasOneObject from 'ember-orbit/links/has-one-object';
import LinkProxyMixin from 'ember-orbit/links/link-proxy-mixin';
import FilteredRecordArray from 'ember-orbit/record-arrays/filtered-record-array';
import RecordArray from 'ember-orbit/record-arrays/record-array';
import key from 'ember-orbit/fields/key';
import attr from 'ember-orbit/fields/attr';
import hasMany from 'ember-orbit/fields/has-many';
import hasOne from 'ember-orbit/fields/has-one';
EO.Store = Store;
EO.Model = Model;
EO.RecordArrayManager = RecordArrayManager;
EO.Schema = Schema;
EO.Source = Source;
EO.key = key;
EO.attr = attr;
EO.HasManyArray = HasManyArray;
EO.HasOneObject = HasOneObject;
EO.LinkProxyMixin = LinkProxyMixin;
EO.FilteredRecordArray = FilteredRecordArray;
EO.RecordArray = RecordArray;
EO.hasOne = hasOne;
EO.hasMany = hasMany;
export default EO;
| Update to the export file. | Update to the export file.
| JavaScript | mit | opsb/ember-orbit,greyhwndz/ember-orbit,pixelhandler/ember-orbit,orbitjs/ember-orbit,lytbulb/ember-orbit,lytbulb/ember-orbit,gnarf/ember-orbit,ProlificLab/ember-orbit,ProlificLab/ember-orbit,gnarf/ember-orbit,opsb/ember-orbit,greyhwndz/ember-orbit,lytbulb/ember-orbit,orbitjs/ember-orbit,orbitjs/ember-orbit,pixelhandler/ember-orbit | javascript | ## Code Before:
import EO from 'ember-orbit/main';
import Store from 'ember-orbit/store';
import Model from 'ember-orbit/model';
import RecordArrayManager from 'ember-orbit/record-array-manager';
import Schema from 'ember-orbit/schema';
import Source from 'ember-orbit/source';
import attr from 'ember-orbit/fields/attr';
import hasMany from 'ember-orbit/fields/has-many';
import hasOne from 'ember-orbit/fields/has-one';
import HasManyArray from 'ember-orbit/links/has-many-array';
import HasOneObject from 'ember-orbit/links/has-one-object';
import LinkProxyMixin from 'ember-orbit/links/link-proxy-mixin';
import FilteredRecordArray from 'ember-orbit/record-arrays/filtered-record-array';
import RecordArray from 'ember-orbit/record-arrays/record-array';
EO.Store = Store;
EO.Model = Model;
EO.RecordArrayManager = RecordArrayManager;
EO.Schema = Schema;
EO.Source = Source;
EO.attr = attr;
EO.hasOne = hasOne;
EO.hasMany = hasMany;
EO.HasManyArray = HasManyArray;
EO.HasOneObject = HasOneObject;
EO.LinkProxyMixin = LinkProxyMixin;
EO.FilteredRecordArray = FilteredRecordArray;
EO.RecordArray = RecordArray;
export default EO;
## Instruction:
Update to the export file.
## Code After:
import EO from 'ember-orbit/main';
import Store from 'ember-orbit/store';
import Model from 'ember-orbit/model';
import RecordArrayManager from 'ember-orbit/record-array-manager';
import Schema from 'ember-orbit/schema';
import Source from 'ember-orbit/source';
import HasManyArray from 'ember-orbit/links/has-many-array';
import HasOneObject from 'ember-orbit/links/has-one-object';
import LinkProxyMixin from 'ember-orbit/links/link-proxy-mixin';
import FilteredRecordArray from 'ember-orbit/record-arrays/filtered-record-array';
import RecordArray from 'ember-orbit/record-arrays/record-array';
import key from 'ember-orbit/fields/key';
import attr from 'ember-orbit/fields/attr';
import hasMany from 'ember-orbit/fields/has-many';
import hasOne from 'ember-orbit/fields/has-one';
EO.Store = Store;
EO.Model = Model;
EO.RecordArrayManager = RecordArrayManager;
EO.Schema = Schema;
EO.Source = Source;
EO.key = key;
EO.attr = attr;
EO.HasManyArray = HasManyArray;
EO.HasOneObject = HasOneObject;
EO.LinkProxyMixin = LinkProxyMixin;
EO.FilteredRecordArray = FilteredRecordArray;
EO.RecordArray = RecordArray;
EO.hasOne = hasOne;
EO.hasMany = hasMany;
export default EO;
| import EO from 'ember-orbit/main';
import Store from 'ember-orbit/store';
import Model from 'ember-orbit/model';
import RecordArrayManager from 'ember-orbit/record-array-manager';
import Schema from 'ember-orbit/schema';
import Source from 'ember-orbit/source';
- import attr from 'ember-orbit/fields/attr';
- import hasMany from 'ember-orbit/fields/has-many';
- import hasOne from 'ember-orbit/fields/has-one';
import HasManyArray from 'ember-orbit/links/has-many-array';
import HasOneObject from 'ember-orbit/links/has-one-object';
import LinkProxyMixin from 'ember-orbit/links/link-proxy-mixin';
import FilteredRecordArray from 'ember-orbit/record-arrays/filtered-record-array';
import RecordArray from 'ember-orbit/record-arrays/record-array';
+ import key from 'ember-orbit/fields/key';
+ import attr from 'ember-orbit/fields/attr';
+ import hasMany from 'ember-orbit/fields/has-many';
+ import hasOne from 'ember-orbit/fields/has-one';
EO.Store = Store;
EO.Model = Model;
EO.RecordArrayManager = RecordArrayManager;
EO.Schema = Schema;
EO.Source = Source;
+ EO.key = key;
EO.attr = attr;
- EO.hasOne = hasOne;
- EO.hasMany = hasMany;
EO.HasManyArray = HasManyArray;
EO.HasOneObject = HasOneObject;
EO.LinkProxyMixin = LinkProxyMixin;
EO.FilteredRecordArray = FilteredRecordArray;
EO.RecordArray = RecordArray;
+ EO.hasOne = hasOne;
+ EO.hasMany = hasMany;
export default EO; | 12 | 0.4 | 7 | 5 |
f8618795073c60b9aa4046125622c00aae658dcc | app/controllers/events_controller.rb | app/controllers/events_controller.rb | class EventsController < ApplicationController
before_filter :require_verified_user, except: :show
def index
if params[:start_time]
@events = Event.by_time(params[:start_time], params[:end_time])
else
@events = Event.future
end
respond_to do |format|
format.html
format.json { render json: @events }
end
end
def show
@rand_image_number = rand(1..10)
unless current_user and current_user.verified?
session[:redirect_url] = "/events/#{params[:id]}"
end
@event = Event.find(params[:id])
@attend = Attendance.find_by(event: @event, student_id: session[:user_id])
@out_nudge = Nudge.find_by(event: @event, nudger_id: session[:user_id])
@in_nudge = Nudge.find_by(event: @event, nudgee_id: session[:user_id])
flash[:attendance] = @attend.id if @attend
end
end
| class EventsController < ApplicationController
before_filter :require_verified_user, except: :show
def index
if params[:start_time]
@events = Event.by_time(params[:start_time], params[:end_time])
else
@events = Event.future
end
respond_to do |format|
format.html
format.json { render json: @events }
end
end
def show
@rand_image_number = rand(1..10)
unless current_user and current_user.verified?
session[:redirect_url] = "/events/#{params[:id]}"
end
@event = Event.find(params[:id])
@attend = Attendance.find_by(event: @event, student: current_student)
@out_nudge = Nudge.find_by(event: @event, nudger: current_student)
@in_nudge = Nudge.find_by(event: @event, nudgee: current_student)
flash[:attendance] = @attend.id if @attend
end
end
| Revise nudges code to refer to Student instead of User | Revise nudges code to refer to Student instead of User
| Ruby | mpl-2.0 | MozillaHive/HiveCHI-rwm,MozillaHive/HiveCHI-rwm,MozillaHive/HiveCHI-rwm,MozillaHive/HiveCHI-rwm | ruby | ## Code Before:
class EventsController < ApplicationController
before_filter :require_verified_user, except: :show
def index
if params[:start_time]
@events = Event.by_time(params[:start_time], params[:end_time])
else
@events = Event.future
end
respond_to do |format|
format.html
format.json { render json: @events }
end
end
def show
@rand_image_number = rand(1..10)
unless current_user and current_user.verified?
session[:redirect_url] = "/events/#{params[:id]}"
end
@event = Event.find(params[:id])
@attend = Attendance.find_by(event: @event, student_id: session[:user_id])
@out_nudge = Nudge.find_by(event: @event, nudger_id: session[:user_id])
@in_nudge = Nudge.find_by(event: @event, nudgee_id: session[:user_id])
flash[:attendance] = @attend.id if @attend
end
end
## Instruction:
Revise nudges code to refer to Student instead of User
## Code After:
class EventsController < ApplicationController
before_filter :require_verified_user, except: :show
def index
if params[:start_time]
@events = Event.by_time(params[:start_time], params[:end_time])
else
@events = Event.future
end
respond_to do |format|
format.html
format.json { render json: @events }
end
end
def show
@rand_image_number = rand(1..10)
unless current_user and current_user.verified?
session[:redirect_url] = "/events/#{params[:id]}"
end
@event = Event.find(params[:id])
@attend = Attendance.find_by(event: @event, student: current_student)
@out_nudge = Nudge.find_by(event: @event, nudger: current_student)
@in_nudge = Nudge.find_by(event: @event, nudgee: current_student)
flash[:attendance] = @attend.id if @attend
end
end
| class EventsController < ApplicationController
before_filter :require_verified_user, except: :show
def index
if params[:start_time]
@events = Event.by_time(params[:start_time], params[:end_time])
else
@events = Event.future
end
respond_to do |format|
format.html
format.json { render json: @events }
end
end
def show
@rand_image_number = rand(1..10)
unless current_user and current_user.verified?
session[:redirect_url] = "/events/#{params[:id]}"
end
@event = Event.find(params[:id])
- @attend = Attendance.find_by(event: @event, student_id: session[:user_id])
? --- ---- ^^^^^^^^^^
+ @attend = Attendance.find_by(event: @event, student: current_student)
? ++++++++ +++ ^
- @out_nudge = Nudge.find_by(event: @event, nudger_id: session[:user_id])
? --- ---- ^^^^^^^^^^
+ @out_nudge = Nudge.find_by(event: @event, nudger: current_student)
? ++++++++ +++ ^
- @in_nudge = Nudge.find_by(event: @event, nudgee_id: session[:user_id])
? --- ---- ^^^^^^^^^^
+ @in_nudge = Nudge.find_by(event: @event, nudgee: current_student)
? ++++++++ +++ ^
flash[:attendance] = @attend.id if @attend
end
end | 6 | 0.214286 | 3 | 3 |
33e0535939be727fea893a3605492bf8551d7df0 | migrations/2015_03_05_022227_anomaly.module.files__create_disks_stream.php | migrations/2015_03_05_022227_anomaly.module.files__create_disks_stream.php | <?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
/**
* Class AnomalyModuleFilesCreateDisksStream
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class AnomalyModuleFilesCreateDisksStream extends Migration
{
/**
* The stream definition.
*
* @var array
*/
protected $stream = [
'slug' => 'disks',
'title_column' => 'name',
'translatable' => true
];
/**
* The stream assignments.
*
* @var array
*/
protected $assignments = [
'name' => [
'required' => true,
'unique' => true
],
'slug' => [
'required' => true,
'unique' => true
],
'adapter' => [
'required' => true
],
'description'
];
}
| <?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
/**
* Class AnomalyModuleFilesCreateDisksStream
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class AnomalyModuleFilesCreateDisksStream extends Migration
{
/**
* The stream definition.
*
* @var array
*/
protected $stream = [
'slug' => 'disks',
'title_column' => 'name',
'translatable' => true
];
/**
* The stream assignments.
*
* @var array
*/
protected $assignments = [
'name' => [
'translatable' => true,
'required' => true,
'unique' => true
],
'slug' => [
'required' => true,
'unique' => true
],
'adapter' => [
'required' => true
],
'description' => [
'translatable' => true
]
];
}
| Fix issue where disk translatables were not translatable! | Fix issue where disk translatables were not translatable!
| PHP | mit | anomalylabs/files-module,anomalylabs/files-module | php | ## Code Before:
<?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
/**
* Class AnomalyModuleFilesCreateDisksStream
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class AnomalyModuleFilesCreateDisksStream extends Migration
{
/**
* The stream definition.
*
* @var array
*/
protected $stream = [
'slug' => 'disks',
'title_column' => 'name',
'translatable' => true
];
/**
* The stream assignments.
*
* @var array
*/
protected $assignments = [
'name' => [
'required' => true,
'unique' => true
],
'slug' => [
'required' => true,
'unique' => true
],
'adapter' => [
'required' => true
],
'description'
];
}
## Instruction:
Fix issue where disk translatables were not translatable!
## Code After:
<?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
/**
* Class AnomalyModuleFilesCreateDisksStream
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class AnomalyModuleFilesCreateDisksStream extends Migration
{
/**
* The stream definition.
*
* @var array
*/
protected $stream = [
'slug' => 'disks',
'title_column' => 'name',
'translatable' => true
];
/**
* The stream assignments.
*
* @var array
*/
protected $assignments = [
'name' => [
'translatable' => true,
'required' => true,
'unique' => true
],
'slug' => [
'required' => true,
'unique' => true
],
'adapter' => [
'required' => true
],
'description' => [
'translatable' => true
]
];
}
| <?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
/**
* Class AnomalyModuleFilesCreateDisksStream
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class AnomalyModuleFilesCreateDisksStream extends Migration
{
/**
* The stream definition.
*
* @var array
*/
protected $stream = [
'slug' => 'disks',
'title_column' => 'name',
'translatable' => true
];
/**
* The stream assignments.
*
* @var array
*/
protected $assignments = [
- 'name' => [
+ 'name' => [
? ++++
+ 'translatable' => true,
+ 'required' => true,
+ 'unique' => true
+ ],
+ 'slug' => [
'required' => true,
'unique' => true
],
- 'slug' => [
- 'required' => true,
- 'unique' => true
- ],
- 'adapter' => [
+ 'adapter' => [
? ++++
'required' => true
],
- 'description'
+ 'description' => [
? +++++
+ 'translatable' => true
+ ]
];
} | 17 | 0.369565 | 10 | 7 |
3efbe8eea8f3a4a277ec18a8c1f1e09a43e56bbb | ci/pipeline.yml | ci/pipeline.yml | resources:
- name: lolstats
type: git
source:
uri: https://github.com/kayemk/lolstats.git
branch: develop
#private_key: |
# -----BEGIN RSA PRIVATE KEY-----
# -----END RSA PRIVATE KEY-----
jobs:
- name: test build
serial: true
plan:
- get: lolstats
resource: lolstats
trigger: true
- task: test
file: lolstats/ci/build.yml
#trigger: true
# - task: build
#file: code/build.yml
#config:
# platform: linux
# image_resource:
# type: docker-image
# source: {repository: ubuntu}
# run:
# path: echo
# args: ["Hey! Listen!"]
| resources:
- name: lolstats
type: git
source:
uri: https://github.com/kayemk/lolstats.git
branch: develop
#private_key: |
# -----BEGIN RSA PRIVATE KEY-----
# -----END RSA PRIVATE KEY-----
jobs:
- name: test build
serial: true
plan:
- get: lolstats
resource: lolstats
trigger: true
- task: test
file: lolstats/ci/build.yml
# - task: build
#file: code/build.yml
#config:
# platform: linux
# image_resource:
# type: docker-image
# source: {repository: ubuntu}
# run:
# path: echo
# args: ["Hey! Listen!"]
| Test ci again and again. | Test ci again and again.
| YAML | mit | kayemk/lolstats,kayemk/lolstats,kayemk/lolstats,kayemk/lolstats | yaml | ## Code Before:
resources:
- name: lolstats
type: git
source:
uri: https://github.com/kayemk/lolstats.git
branch: develop
#private_key: |
# -----BEGIN RSA PRIVATE KEY-----
# -----END RSA PRIVATE KEY-----
jobs:
- name: test build
serial: true
plan:
- get: lolstats
resource: lolstats
trigger: true
- task: test
file: lolstats/ci/build.yml
#trigger: true
# - task: build
#file: code/build.yml
#config:
# platform: linux
# image_resource:
# type: docker-image
# source: {repository: ubuntu}
# run:
# path: echo
# args: ["Hey! Listen!"]
## Instruction:
Test ci again and again.
## Code After:
resources:
- name: lolstats
type: git
source:
uri: https://github.com/kayemk/lolstats.git
branch: develop
#private_key: |
# -----BEGIN RSA PRIVATE KEY-----
# -----END RSA PRIVATE KEY-----
jobs:
- name: test build
serial: true
plan:
- get: lolstats
resource: lolstats
trigger: true
- task: test
file: lolstats/ci/build.yml
# - task: build
#file: code/build.yml
#config:
# platform: linux
# image_resource:
# type: docker-image
# source: {repository: ubuntu}
# run:
# path: echo
# args: ["Hey! Listen!"]
| resources:
- name: lolstats
type: git
source:
uri: https://github.com/kayemk/lolstats.git
branch: develop
#private_key: |
# -----BEGIN RSA PRIVATE KEY-----
# -----END RSA PRIVATE KEY-----
jobs:
- name: test build
serial: true
plan:
- get: lolstats
resource: lolstats
trigger: true
- task: test
file: lolstats/ci/build.yml
- #trigger: true
# - task: build
#file: code/build.yml
#config:
# platform: linux
# image_resource:
# type: docker-image
# source: {repository: ubuntu}
# run:
# path: echo
# args: ["Hey! Listen!"] | 1 | 0.033333 | 0 | 1 |
6848ffdff605e7e889e1bc4f288781623f0e3770 | test/smoke/typing-test.coffee | test/smoke/typing-test.coffee | {assert} = require 'chai'
fs = require 'fs'
Drafter = require '../../src/drafter'
describe 'Typing test', ->
blueprint = fs.readFileSync './test/fixtures/dataStructures.apib', 'utf8'
drafter = new Drafter
describe 'When I type the blueprint', ->
currentLength = 0
error = undefined
exception = undefined
result = undefined
while currentLength < blueprint.length
currentLength++
describe "and write first #{currentLength} characters and parse them", ->
before (done) ->
try
drafter.make blueprint.slice(0, currentLength), (err, res) ->
error = err
result = res
done null
catch exc
exception = exc
done null
it 'I got no unplanned exception', ->
assert.isUndefined exception
it 'I properly-formatted error', ->
if not error
assert.isNull error
else
assert.isDefined error.code
assert.isDefined error.message
assert.isArray error.location
it 'I get proper result', ->
if error
# The node idom is to pass null, but drafter is passing undefined
assert.isUndefined result
else
assert.ok result.ast._version
assert.ok result.ast.content
assert.isArray result.ast.resourceGroups
after ->
error = undefined
exception = undefined
result = undefined
| {assert} = require 'chai'
fs = require 'fs'
Drafter = require '../../src/drafter'
describe 'Typing test', ->
blueprint = fs.readFileSync './test/fixtures/dataStructures.apib', 'utf8'
drafter = new Drafter
describe 'When I type the blueprint', ->
currentLength = 0
# Because drafter.make uses protagonist.parse (asynchronous call),
# we cannot call desribe directly within for loop. We need a closure or
# otherwise currentLength won't be of value the one used when describe
# was created, but with the final number (blueprint.length) instead.
for currentLength in [1..(blueprint.length-1)] then do (currentLength) ->
describe "and write first #{currentLength} characters and parse them", ->
error = undefined
exception = undefined
result = undefined
after ->
error = undefined
exception = undefined
result = undefined
before (done) ->
try
drafter.make blueprint.slice(0, currentLength), (err, res) ->
error = err
result = res
done null
catch exc
exception = exc
done null
it 'I got no unplanned exception', ->
assert.isUndefined exception
it 'I properly-formatted error', ->
if not error
assert.isNull error
else
assert.isDefined error.code
assert.isDefined error.message
assert.isArray error.location
it 'I get proper result', ->
if error
# The node idom is to pass null, but drafter is passing undefined
assert.isUndefined result
else
assert.ok result.ast._version
assert.ok result.ast.content
assert.isArray result.ast.resourceGroups
| Make the smoke-writing test actually using various blueprint slices | Make the smoke-writing test actually using various blueprint slices
| CoffeeScript | mit | apiaryio/drafter.js,obihann/drafter.js,apiaryio/drafter.js,apiaryio/drafter.js,apiaryio/drafter.js,apiaryio/drafter.js,obihann/drafter.js,apiaryio/drafter.js | coffeescript | ## Code Before:
{assert} = require 'chai'
fs = require 'fs'
Drafter = require '../../src/drafter'
describe 'Typing test', ->
blueprint = fs.readFileSync './test/fixtures/dataStructures.apib', 'utf8'
drafter = new Drafter
describe 'When I type the blueprint', ->
currentLength = 0
error = undefined
exception = undefined
result = undefined
while currentLength < blueprint.length
currentLength++
describe "and write first #{currentLength} characters and parse them", ->
before (done) ->
try
drafter.make blueprint.slice(0, currentLength), (err, res) ->
error = err
result = res
done null
catch exc
exception = exc
done null
it 'I got no unplanned exception', ->
assert.isUndefined exception
it 'I properly-formatted error', ->
if not error
assert.isNull error
else
assert.isDefined error.code
assert.isDefined error.message
assert.isArray error.location
it 'I get proper result', ->
if error
# The node idom is to pass null, but drafter is passing undefined
assert.isUndefined result
else
assert.ok result.ast._version
assert.ok result.ast.content
assert.isArray result.ast.resourceGroups
after ->
error = undefined
exception = undefined
result = undefined
## Instruction:
Make the smoke-writing test actually using various blueprint slices
## Code After:
{assert} = require 'chai'
fs = require 'fs'
Drafter = require '../../src/drafter'
describe 'Typing test', ->
blueprint = fs.readFileSync './test/fixtures/dataStructures.apib', 'utf8'
drafter = new Drafter
describe 'When I type the blueprint', ->
currentLength = 0
# Because drafter.make uses protagonist.parse (asynchronous call),
# we cannot call desribe directly within for loop. We need a closure or
# otherwise currentLength won't be of value the one used when describe
# was created, but with the final number (blueprint.length) instead.
for currentLength in [1..(blueprint.length-1)] then do (currentLength) ->
describe "and write first #{currentLength} characters and parse them", ->
error = undefined
exception = undefined
result = undefined
after ->
error = undefined
exception = undefined
result = undefined
before (done) ->
try
drafter.make blueprint.slice(0, currentLength), (err, res) ->
error = err
result = res
done null
catch exc
exception = exc
done null
it 'I got no unplanned exception', ->
assert.isUndefined exception
it 'I properly-formatted error', ->
if not error
assert.isNull error
else
assert.isDefined error.code
assert.isDefined error.message
assert.isArray error.location
it 'I get proper result', ->
if error
# The node idom is to pass null, but drafter is passing undefined
assert.isUndefined result
else
assert.ok result.ast._version
assert.ok result.ast.content
assert.isArray result.ast.resourceGroups
| {assert} = require 'chai'
fs = require 'fs'
Drafter = require '../../src/drafter'
describe 'Typing test', ->
blueprint = fs.readFileSync './test/fixtures/dataStructures.apib', 'utf8'
drafter = new Drafter
describe 'When I type the blueprint', ->
currentLength = 0
- error = undefined
- exception = undefined
- result = undefined
- while currentLength < blueprint.length
- currentLength++
+ # Because drafter.make uses protagonist.parse (asynchronous call),
+ # we cannot call desribe directly within for loop. We need a closure or
+ # otherwise currentLength won't be of value the one used when describe
+ # was created, but with the final number (blueprint.length) instead.
+ for currentLength in [1..(blueprint.length-1)] then do (currentLength) ->
describe "and write first #{currentLength} characters and parse them", ->
+ error = undefined
+ exception = undefined
+ result = undefined
+
+ after ->
+ error = undefined
+ exception = undefined
+ result = undefined
+
before (done) ->
try
drafter.make blueprint.slice(0, currentLength), (err, res) ->
error = err
result = res
done null
catch exc
exception = exc
done null
it 'I got no unplanned exception', ->
assert.isUndefined exception
it 'I properly-formatted error', ->
if not error
assert.isNull error
else
assert.isDefined error.code
assert.isDefined error.message
assert.isArray error.location
it 'I get proper result', ->
if error
# The node idom is to pass null, but drafter is passing undefined
assert.isUndefined result
else
assert.ok result.ast._version
assert.ok result.ast.content
assert.isArray result.ast.resourceGroups
-
-
-
- after ->
- error = undefined
- exception = undefined
- result = undefined | 26 | 0.448276 | 14 | 12 |
1839f6375b0d2feb15d262d18c1ecb5f4840b5af | tests/standalone/regress_29695_test.dart | tests/standalone/regress_29695_test.dart | // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Test that type tests are not misoptimized.
// VMOptions=--optimization-counter-threshold=1000 --optimization-filter=IsAnInt
main() {
train();
if (IsAnInt("This is not an int")) throw "oops";
}
// Prime the IC with things that are and are not ints.
void train() {
for (int i = 0; i < 10000; i++) {
IsAnInt(42); // Smi - always goes first in the generated code.
IsAnInt(1 << 62); // Mint on 64 bit platforms.
IsAnInt(1 << 62);
IsAnInt(4200000000000000000000000000000000000); // BigInt
IsAnInt(4200000000000000000000000000000000000);
// This one that is not an int goes last in the IC because it is called
// less frequently.
IsAnInt(4.2);
}
}
bool IsAnInt(f) => f is int;
| // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Test that type tests are not misoptimized.
// VMOptions=--optimization-counter-threshold=1000 --optimization-filter=IsAnInt
main() {
train();
if (IsAnInt("This is not an int")) throw "oops";
}
// Prime the IC with things that are and are not ints.
void train() {
int sum = 0;
for (int i = 0; i < 10000; i++) {
IsAnInt(42); // Smi - always goes first in the generated code.
IsAnInt(1 << 62); // Mint on 64 bit platforms.
IsAnInt(1 << 62);
IsAnInt(4200000000000000000000000000000000000); // BigInt
IsAnInt(4200000000000000000000000000000000000);
// This one that is not an int goes last in the IC because it is called
// less frequently.
IsAnInt(4.2);
}
}
int IsAnInt(Foo f) => f is int;
| Revert "Fix misoptimization of 'is' test" | Revert "Fix misoptimization of 'is' test"
R=johnniwinther@google.com
BUG=
This reverts commits fc693153d1c79e8303abe05697a1d8458b0fef62
and b7797ac45fe6d58d5dae6c4db3094afb1dfaa4bc, code review at
https://codereview.chromium.org/2904543002. Revert is due to
an AOT failure.
Review-Url: https://codereview.chromium.org/2908153002 .
| Dart | bsd-3-clause | dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk | dart | ## Code Before:
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Test that type tests are not misoptimized.
// VMOptions=--optimization-counter-threshold=1000 --optimization-filter=IsAnInt
main() {
train();
if (IsAnInt("This is not an int")) throw "oops";
}
// Prime the IC with things that are and are not ints.
void train() {
for (int i = 0; i < 10000; i++) {
IsAnInt(42); // Smi - always goes first in the generated code.
IsAnInt(1 << 62); // Mint on 64 bit platforms.
IsAnInt(1 << 62);
IsAnInt(4200000000000000000000000000000000000); // BigInt
IsAnInt(4200000000000000000000000000000000000);
// This one that is not an int goes last in the IC because it is called
// less frequently.
IsAnInt(4.2);
}
}
bool IsAnInt(f) => f is int;
## Instruction:
Revert "Fix misoptimization of 'is' test"
R=johnniwinther@google.com
BUG=
This reverts commits fc693153d1c79e8303abe05697a1d8458b0fef62
and b7797ac45fe6d58d5dae6c4db3094afb1dfaa4bc, code review at
https://codereview.chromium.org/2904543002. Revert is due to
an AOT failure.
Review-Url: https://codereview.chromium.org/2908153002 .
## Code After:
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Test that type tests are not misoptimized.
// VMOptions=--optimization-counter-threshold=1000 --optimization-filter=IsAnInt
main() {
train();
if (IsAnInt("This is not an int")) throw "oops";
}
// Prime the IC with things that are and are not ints.
void train() {
int sum = 0;
for (int i = 0; i < 10000; i++) {
IsAnInt(42); // Smi - always goes first in the generated code.
IsAnInt(1 << 62); // Mint on 64 bit platforms.
IsAnInt(1 << 62);
IsAnInt(4200000000000000000000000000000000000); // BigInt
IsAnInt(4200000000000000000000000000000000000);
// This one that is not an int goes last in the IC because it is called
// less frequently.
IsAnInt(4.2);
}
}
int IsAnInt(Foo f) => f is int;
| // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Test that type tests are not misoptimized.
// VMOptions=--optimization-counter-threshold=1000 --optimization-filter=IsAnInt
main() {
train();
if (IsAnInt("This is not an int")) throw "oops";
}
// Prime the IC with things that are and are not ints.
void train() {
+ int sum = 0;
for (int i = 0; i < 10000; i++) {
IsAnInt(42); // Smi - always goes first in the generated code.
IsAnInt(1 << 62); // Mint on 64 bit platforms.
IsAnInt(1 << 62);
IsAnInt(4200000000000000000000000000000000000); // BigInt
IsAnInt(4200000000000000000000000000000000000);
// This one that is not an int goes last in the IC because it is called
// less frequently.
IsAnInt(4.2);
}
}
- bool IsAnInt(f) => f is int;
? ^^^^
+ int IsAnInt(Foo f) => f is int;
? ^^^ ++++
| 3 | 0.111111 | 2 | 1 |
249e511a6316863ad2d81fe59a2e55c9c0a37232 | README.md | README.md |
[](http://travis-ci.org/tstmedia/ical_importer "Travis-CI IcalImporter")
[RubyGems](NOT YET "NOT YET")
Easily import your iCal feeds.
Simply run the parser and you'll be given a list of objectified events to manage and manipulate.
|
[](http://travis-ci.org/tstmedia/ical_importer "Travis-CI IcalImporter")
<!---
[RubyGems](NOT YET "NOT YET")
--->
Easily import your iCal feeds.
Simply run the parser and you'll be given a list of objectified events to manage and manipulate.
| Hide rubygems link until we have a gem up | Hide rubygems link until we have a gem up | Markdown | mit | sportngin/ical_importer | markdown | ## Code Before:
[](http://travis-ci.org/tstmedia/ical_importer "Travis-CI IcalImporter")
[RubyGems](NOT YET "NOT YET")
Easily import your iCal feeds.
Simply run the parser and you'll be given a list of objectified events to manage and manipulate.
## Instruction:
Hide rubygems link until we have a gem up
## Code After:
[](http://travis-ci.org/tstmedia/ical_importer "Travis-CI IcalImporter")
<!---
[RubyGems](NOT YET "NOT YET")
--->
Easily import your iCal feeds.
Simply run the parser and you'll be given a list of objectified events to manage and manipulate.
|
[](http://travis-ci.org/tstmedia/ical_importer "Travis-CI IcalImporter")
+ <!---
[RubyGems](NOT YET "NOT YET")
+ --->
Easily import your iCal feeds.
Simply run the parser and you'll be given a list of objectified events to manage and manipulate. | 2 | 0.25 | 2 | 0 |
1fe006d94d216cbca16204cd8ce68c7a4eda2fc4 | .github/pull_request_template.md | .github/pull_request_template.md | Fixes issue #
Work done
---
1. Major changes
An overview of the most important changes done
2. Important things to review
- This class
- That other class because
Integrity
---
- I have run unit tests: [ ]
- I have had a look on the PR preview for obvious whitespace\formatting issues before actually openned this PR: [ ]
- I have run all acceptance tests: [ ]
- I have run all integration tests: [ ] | Fixes issue #
Work done
---
1. Major changes
An overview of the most important changes done
2. Important things to review
- This class
- That other class because
Integrity
---
- I have had a look on the PR preview for obvious whitespace\formatting issues before actually openned this PR: [ ]
- I have run unit tests: [ ]
- I have run all acceptance tests: [ ]
- I have run all integration tests: [ ]
| Update PR template to fix order of integrity | Update PR template to fix order of integrity | Markdown | mit | BullOak/BullOak,skleanthous/BullOak | markdown | ## Code Before:
Fixes issue #
Work done
---
1. Major changes
An overview of the most important changes done
2. Important things to review
- This class
- That other class because
Integrity
---
- I have run unit tests: [ ]
- I have had a look on the PR preview for obvious whitespace\formatting issues before actually openned this PR: [ ]
- I have run all acceptance tests: [ ]
- I have run all integration tests: [ ]
## Instruction:
Update PR template to fix order of integrity
## Code After:
Fixes issue #
Work done
---
1. Major changes
An overview of the most important changes done
2. Important things to review
- This class
- That other class because
Integrity
---
- I have had a look on the PR preview for obvious whitespace\formatting issues before actually openned this PR: [ ]
- I have run unit tests: [ ]
- I have run all acceptance tests: [ ]
- I have run all integration tests: [ ]
| Fixes issue #
Work done
---
1. Major changes
An overview of the most important changes done
2. Important things to review
- This class
- That other class because
Integrity
---
+ - I have had a look on the PR preview for obvious whitespace\formatting issues before actually openned this PR: [ ]
- I have run unit tests: [ ]
- - I have had a look on the PR preview for obvious whitespace\formatting issues before actually openned this PR: [ ]
- I have run all acceptance tests: [ ]
- I have run all integration tests: [ ] | 2 | 0.095238 | 1 | 1 |
4f9af67c931e767060101b83c697e089dd9b896c | pombola/nigeria/templates/spinner/slides/spinner_image-content.html | pombola/nigeria/templates/spinner/slides/spinner_image-content.html | {% load thumbnail %}
<a href="{{ object.url }}" title="{{ object.caption }}">
{% thumbnail object.image "478x478" crop="center" as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="{{ object.caption }}" />
{% endthumbnail %}
</a>
| {% load thumbnail %}
<a href="{{ object.url }}" title="{{ object.caption }}">
{% thumbnail object.image "250x250" crop="center" quality=80 as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="{{ object.caption }}" />
{% endthumbnail %}
</a>
| Reduce size of Nigeria homepage spinner images | NG: Reduce size of Nigeria homepage spinner images
| HTML | agpl-3.0 | geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola | html | ## Code Before:
{% load thumbnail %}
<a href="{{ object.url }}" title="{{ object.caption }}">
{% thumbnail object.image "478x478" crop="center" as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="{{ object.caption }}" />
{% endthumbnail %}
</a>
## Instruction:
NG: Reduce size of Nigeria homepage spinner images
## Code After:
{% load thumbnail %}
<a href="{{ object.url }}" title="{{ object.caption }}">
{% thumbnail object.image "250x250" crop="center" quality=80 as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="{{ object.caption }}" />
{% endthumbnail %}
</a>
| {% load thumbnail %}
<a href="{{ object.url }}" title="{{ object.caption }}">
- {% thumbnail object.image "478x478" crop="center" as im %}
? ^^^ ^^^
+ {% thumbnail object.image "250x250" crop="center" quality=80 as im %}
? ^^^ ^^^ +++++++++++
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="{{ object.caption }}" />
{% endthumbnail %}
</a>
| 2 | 0.25 | 1 | 1 |
72a29a96d123990adef08b392d0efccb6c5ecd69 | src/util.h | src/util.h |
namespace pl0 {
#if defined(_MSC_VER) || defined(__GNUC__)
namespace polyfill {
template <typename T, typename... Args>
void fold_write_stream(std::ostringstream &oss, T value, Args... args) {
oss << value;
fold_write_stream(oss, args...);
}
template <typename T>
void fold_write_stream(std::ostringstream &oss, T value) {
oss << value;
}
}
#endif
class general_error {
std::string message_;
public:
template <typename... Args>
general_error(Args... args) {
std::ostringstream oss;
#if defined(_MSC_VER) || defined(__GNUC__)
// Visual Studio 2017 does not support fold expression now.
// We need to make a polyfill.
polyfill::fold_write_stream(oss, args...);
#else
oss << ... << args;
#endif
message_ = oss.str();
}
const std::string &what() const { return message_; }
};
}
#endif
|
namespace pl0 {
#if defined(_MSC_VER) || defined(__GNUC__)
namespace polyfill {
template <typename T>
void fold_write_stream(std::ostringstream &oss, T value) {
oss << value;
}
template <typename T, typename... Args>
void fold_write_stream(std::ostringstream &oss, T value, Args... args) {
oss << value;
fold_write_stream(oss, args...);
}
}
#endif
class general_error {
std::string message_;
public:
template <typename... Args>
general_error(Args... args) {
std::ostringstream oss;
#if defined(_MSC_VER) || defined(__GNUC__)
// Visual Studio 2017 does not support fold expression now.
// We need to make a polyfill.
polyfill::fold_write_stream(oss, args...);
#else
oss << ... << args;
#endif
message_ = oss.str();
}
const std::string &what() const { return message_; }
};
}
#endif
| Swap two overloads to make g++ happy. | Swap two overloads to make g++ happy.
Hmmmm.
| C | mit | chengluyu/PL0 | c | ## Code Before:
namespace pl0 {
#if defined(_MSC_VER) || defined(__GNUC__)
namespace polyfill {
template <typename T, typename... Args>
void fold_write_stream(std::ostringstream &oss, T value, Args... args) {
oss << value;
fold_write_stream(oss, args...);
}
template <typename T>
void fold_write_stream(std::ostringstream &oss, T value) {
oss << value;
}
}
#endif
class general_error {
std::string message_;
public:
template <typename... Args>
general_error(Args... args) {
std::ostringstream oss;
#if defined(_MSC_VER) || defined(__GNUC__)
// Visual Studio 2017 does not support fold expression now.
// We need to make a polyfill.
polyfill::fold_write_stream(oss, args...);
#else
oss << ... << args;
#endif
message_ = oss.str();
}
const std::string &what() const { return message_; }
};
}
#endif
## Instruction:
Swap two overloads to make g++ happy.
Hmmmm.
## Code After:
namespace pl0 {
#if defined(_MSC_VER) || defined(__GNUC__)
namespace polyfill {
template <typename T>
void fold_write_stream(std::ostringstream &oss, T value) {
oss << value;
}
template <typename T, typename... Args>
void fold_write_stream(std::ostringstream &oss, T value, Args... args) {
oss << value;
fold_write_stream(oss, args...);
}
}
#endif
class general_error {
std::string message_;
public:
template <typename... Args>
general_error(Args... args) {
std::ostringstream oss;
#if defined(_MSC_VER) || defined(__GNUC__)
// Visual Studio 2017 does not support fold expression now.
// We need to make a polyfill.
polyfill::fold_write_stream(oss, args...);
#else
oss << ... << args;
#endif
message_ = oss.str();
}
const std::string &what() const { return message_; }
};
}
#endif
|
namespace pl0 {
#if defined(_MSC_VER) || defined(__GNUC__)
namespace polyfill {
+ template <typename T>
+ void fold_write_stream(std::ostringstream &oss, T value) {
+ oss << value;
+ }
+
template <typename T, typename... Args>
void fold_write_stream(std::ostringstream &oss, T value, Args... args) {
oss << value;
fold_write_stream(oss, args...);
- }
-
- template <typename T>
- void fold_write_stream(std::ostringstream &oss, T value) {
- oss << value;
}
}
#endif
class general_error {
std::string message_;
public:
template <typename... Args>
general_error(Args... args) {
std::ostringstream oss;
#if defined(_MSC_VER) || defined(__GNUC__)
// Visual Studio 2017 does not support fold expression now.
// We need to make a polyfill.
polyfill::fold_write_stream(oss, args...);
#else
oss << ... << args;
#endif
message_ = oss.str();
}
const std::string &what() const { return message_; }
};
}
#endif | 10 | 0.238095 | 5 | 5 |
05d234b2b3da5dd59f73f3584b2f9a4402f5d35d | exercises/mock-viewer.js | exercises/mock-viewer.js | var extend = require('extend')
var Crocodoc,
createViewer
module.exports.mock = function (mocks) {
Crocodoc = window.Crocodoc
createViewer = Crocodoc.createViewer
Crocodoc.addPlugin('expose-config', function (scope) {
return {
init: function () {
scope.getConfig().api.getConfig = function () {
return scope.getConfig()
}
}
}
})
Crocodoc.createViewer = function (el, conf) {
conf = extend(true, {}, conf, {
plugins: { 'expose-config': true }
})
var viewer = createViewer(el, conf)
Object.keys(mocks).forEach(function (method) {
var orig = viewer[method]
viewer[method] = mocks[method]
viewer['_' + method] = orig
})
return viewer
}
}
module.exports.restore = function () {
if (Crocodoc) {
Crocodoc.createViewer = createViewer
}
}
| var extend = require('extend')
var Crocodoc,
createViewer
module.exports.mock = function (mocks) {
mocks = mocks || {}
Crocodoc = window.Crocodoc
createViewer = Crocodoc.createViewer
Crocodoc.addPlugin('expose-config', function (scope) {
return {
init: function () {
scope.getConfig().api.getConfig = function () {
return scope.getConfig()
}
}
}
})
Crocodoc.createViewer = function (el, conf) {
conf = extend(true, {}, conf, {
plugins: { 'expose-config': true }
})
var viewer = createViewer(el, conf)
Object.keys(mocks).forEach(function (method) {
var orig = viewer[method]
viewer[method] = mocks[method]
viewer['_' + method] = orig
})
return viewer
}
}
module.exports.restore = function () {
if (Crocodoc) {
Crocodoc.createViewer = createViewer
}
}
| Fix bug where empty viewer mock breaks stuff | Fix bug where empty viewer mock breaks stuff
| JavaScript | mit | lakenen/view-school,lakenen/view-school | javascript | ## Code Before:
var extend = require('extend')
var Crocodoc,
createViewer
module.exports.mock = function (mocks) {
Crocodoc = window.Crocodoc
createViewer = Crocodoc.createViewer
Crocodoc.addPlugin('expose-config', function (scope) {
return {
init: function () {
scope.getConfig().api.getConfig = function () {
return scope.getConfig()
}
}
}
})
Crocodoc.createViewer = function (el, conf) {
conf = extend(true, {}, conf, {
plugins: { 'expose-config': true }
})
var viewer = createViewer(el, conf)
Object.keys(mocks).forEach(function (method) {
var orig = viewer[method]
viewer[method] = mocks[method]
viewer['_' + method] = orig
})
return viewer
}
}
module.exports.restore = function () {
if (Crocodoc) {
Crocodoc.createViewer = createViewer
}
}
## Instruction:
Fix bug where empty viewer mock breaks stuff
## Code After:
var extend = require('extend')
var Crocodoc,
createViewer
module.exports.mock = function (mocks) {
mocks = mocks || {}
Crocodoc = window.Crocodoc
createViewer = Crocodoc.createViewer
Crocodoc.addPlugin('expose-config', function (scope) {
return {
init: function () {
scope.getConfig().api.getConfig = function () {
return scope.getConfig()
}
}
}
})
Crocodoc.createViewer = function (el, conf) {
conf = extend(true, {}, conf, {
plugins: { 'expose-config': true }
})
var viewer = createViewer(el, conf)
Object.keys(mocks).forEach(function (method) {
var orig = viewer[method]
viewer[method] = mocks[method]
viewer['_' + method] = orig
})
return viewer
}
}
module.exports.restore = function () {
if (Crocodoc) {
Crocodoc.createViewer = createViewer
}
}
| var extend = require('extend')
var Crocodoc,
createViewer
module.exports.mock = function (mocks) {
+ mocks = mocks || {}
Crocodoc = window.Crocodoc
createViewer = Crocodoc.createViewer
Crocodoc.addPlugin('expose-config', function (scope) {
return {
init: function () {
scope.getConfig().api.getConfig = function () {
return scope.getConfig()
}
}
}
})
Crocodoc.createViewer = function (el, conf) {
conf = extend(true, {}, conf, {
plugins: { 'expose-config': true }
})
var viewer = createViewer(el, conf)
Object.keys(mocks).forEach(function (method) {
var orig = viewer[method]
viewer[method] = mocks[method]
viewer['_' + method] = orig
})
return viewer
}
}
module.exports.restore = function () {
if (Crocodoc) {
Crocodoc.createViewer = createViewer
}
} | 1 | 0.026316 | 1 | 0 |
fc9a465569097b183b573deacc07b2bd8e8d84ea | README.md | README.md |
Easy jsonp client for browser and node.js
[](https://travis-ci.org/then/then-jsonp)
[](https://gemnasium.com/then/then-jsonp)
[](https://www.npmjs.org/package/then-jsonp)
## Installation
npm install then-jsonp
## License
MIT
|
Easy jsonp client for browser and node.js
[](https://travis-ci.org/then/then-jsonp)
[](https://gemnasium.com/then/then-jsonp)
[](https://www.npmjs.org/package/then-jsonp)
[](https://saucelabs.com/u/then-jsonp-ci)
## Installation
npm install then-jsonp
## License
MIT
| Add sauce labs build matrix | Add sauce labs build matrix
Unfortunately it shows the incorrect tests as failing
| Markdown | mit | then/then-jsonp | markdown | ## Code Before:
Easy jsonp client for browser and node.js
[](https://travis-ci.org/then/then-jsonp)
[](https://gemnasium.com/then/then-jsonp)
[](https://www.npmjs.org/package/then-jsonp)
## Installation
npm install then-jsonp
## License
MIT
## Instruction:
Add sauce labs build matrix
Unfortunately it shows the incorrect tests as failing
## Code After:
Easy jsonp client for browser and node.js
[](https://travis-ci.org/then/then-jsonp)
[](https://gemnasium.com/then/then-jsonp)
[](https://www.npmjs.org/package/then-jsonp)
[](https://saucelabs.com/u/then-jsonp-ci)
## Installation
npm install then-jsonp
## License
MIT
|
Easy jsonp client for browser and node.js
[](https://travis-ci.org/then/then-jsonp)
[](https://gemnasium.com/then/then-jsonp)
[](https://www.npmjs.org/package/then-jsonp)
+
+ [](https://saucelabs.com/u/then-jsonp-ci)
## Installation
npm install then-jsonp
## License
MIT | 2 | 0.142857 | 2 | 0 |
32e07098a1ec512540dacf422b111cc3a76fb0e1 | core/java/com/google/instrumentation/common/NonThrowingCloseable.java | core/java/com/google/instrumentation/common/NonThrowingCloseable.java | package com.google.instrumentation.common;
import java.io.Closeable;
/**
* An {@link Closeable} which cannot throw a checked exception.
*/
public interface NonThrowingCloseable extends Closeable {
@Override
void close();
}
| package com.google.instrumentation.common;
import java.io.Closeable;
/**
* An {@link Closeable} which cannot throw a checked exception.
*
* <p>This is useful because such a reversion otherwise requires the caller to catch the
* (impossible) Exception in the try-with-resources.
*
* <p>Example of usage:
*
* <pre>
* try (NonThrowingAutoCloseable ctx = tryEnter()) {
* ...
* }
* </pre>
*/
public interface NonThrowingCloseable extends Closeable {
@Override
void close();
}
| Add more comments and example of use. | Add more comments and example of use.
| Java | apache-2.0 | bogdandrutu/opencensus-java,census-instrumentation/opencensus-java,sebright/opencensus-java,songy23/instrumentation-java,census-instrumentation/opencensus-java,songy23/instrumentation-java,bogdandrutu/opencensus-java,census-instrumentation/opencensus-java,sebright/instrumentation-java,bogdandrutu/instrumentation-java,sebright/opencensus-java,sebright/instrumentation-java,dinooliva/instrumentation-java,sebright/opencensus-java,ubschmidt2/instrumentation-java,ubschmidt2/instrumentation-java,bogdandrutu/instrumentation-java,songy23/instrumentation-java,bogdandrutu/opencensus-java,dinooliva/instrumentation-java | java | ## Code Before:
package com.google.instrumentation.common;
import java.io.Closeable;
/**
* An {@link Closeable} which cannot throw a checked exception.
*/
public interface NonThrowingCloseable extends Closeable {
@Override
void close();
}
## Instruction:
Add more comments and example of use.
## Code After:
package com.google.instrumentation.common;
import java.io.Closeable;
/**
* An {@link Closeable} which cannot throw a checked exception.
*
* <p>This is useful because such a reversion otherwise requires the caller to catch the
* (impossible) Exception in the try-with-resources.
*
* <p>Example of usage:
*
* <pre>
* try (NonThrowingAutoCloseable ctx = tryEnter()) {
* ...
* }
* </pre>
*/
public interface NonThrowingCloseable extends Closeable {
@Override
void close();
}
| package com.google.instrumentation.common;
import java.io.Closeable;
/**
* An {@link Closeable} which cannot throw a checked exception.
+ *
+ * <p>This is useful because such a reversion otherwise requires the caller to catch the
+ * (impossible) Exception in the try-with-resources.
+ *
+ * <p>Example of usage:
+ *
+ * <pre>
+ * try (NonThrowingAutoCloseable ctx = tryEnter()) {
+ * ...
+ * }
+ * </pre>
*/
public interface NonThrowingCloseable extends Closeable {
@Override
void close();
} | 11 | 1 | 11 | 0 |
c293cfa204c093e3e58f570acde4b202ce4b06cc | test/CodeGen/CBackend/2003-10-23-UnusedType.ll | test/CodeGen/CBackend/2003-10-23-UnusedType.ll |
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
|
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
void %test(%A *) { ret void }
| Make the test use the %A type | Make the test use the %A type
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@13789 91177308-0d34-0410-b5e6-96231b3b80d8
| LLVM | apache-2.0 | apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm | llvm | ## Code Before:
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
## Instruction:
Make the test use the %A type
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@13789 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
void %test(%A *) { ret void }
|
%A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
+ void %test(%A *) { ret void } | 1 | 0.333333 | 1 | 0 |
53d86fbfa0f59be863bc821f7b4b7d28429684a4 | package.json | package.json | {
"name": "flick",
"version": "0.1.0",
"description": "Post-receive hooks handler",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/romac/node-flick"
},
"keywords": [
"github",
"git",
"post-receive",
"hook"
],
"author": "Romain Ruetschi (romain.ruetschi@gmail.com)",
"license": "MIT",
"readmeFilename": "README.md",
"dependencies": {},
"devDependencies": {
"mocha": "*",
"should": "*",
"supertest": "0.0.1"
},
"scripts": {
"prepublish" : "npm prune",
"test": "make test"
}
}
| {
"name": "flick",
"version": "0.1.0",
"description": "Post-receive hooks handler",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/romac/node-flick"
},
"keywords": [
"github",
"git",
"post-receive",
"hook"
],
"author": "Romain Ruetschi (romain.ruetschi@gmail.com)",
"license": "MIT",
"readmeFilename": "README.md",
"dependencies": {},
"devDependencies": {
"mocha": "*",
"should": "*",
"supertest": "0.0.1"
},
"scripts": {
"prepublish" : "npm prune",
"test": "make test REPORTER=dot"
}
}
| Use Mocha's dot reporter for cleaner Travis-CI build output. | Use Mocha's dot reporter for cleaner Travis-CI build output.
| JSON | mit | romac/node-flick | json | ## Code Before:
{
"name": "flick",
"version": "0.1.0",
"description": "Post-receive hooks handler",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/romac/node-flick"
},
"keywords": [
"github",
"git",
"post-receive",
"hook"
],
"author": "Romain Ruetschi (romain.ruetschi@gmail.com)",
"license": "MIT",
"readmeFilename": "README.md",
"dependencies": {},
"devDependencies": {
"mocha": "*",
"should": "*",
"supertest": "0.0.1"
},
"scripts": {
"prepublish" : "npm prune",
"test": "make test"
}
}
## Instruction:
Use Mocha's dot reporter for cleaner Travis-CI build output.
## Code After:
{
"name": "flick",
"version": "0.1.0",
"description": "Post-receive hooks handler",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/romac/node-flick"
},
"keywords": [
"github",
"git",
"post-receive",
"hook"
],
"author": "Romain Ruetschi (romain.ruetschi@gmail.com)",
"license": "MIT",
"readmeFilename": "README.md",
"dependencies": {},
"devDependencies": {
"mocha": "*",
"should": "*",
"supertest": "0.0.1"
},
"scripts": {
"prepublish" : "npm prune",
"test": "make test REPORTER=dot"
}
}
| {
"name": "flick",
"version": "0.1.0",
"description": "Post-receive hooks handler",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/romac/node-flick"
},
"keywords": [
"github",
"git",
"post-receive",
"hook"
],
"author": "Romain Ruetschi (romain.ruetschi@gmail.com)",
"license": "MIT",
"readmeFilename": "README.md",
"dependencies": {},
"devDependencies": {
"mocha": "*",
"should": "*",
"supertest": "0.0.1"
},
"scripts": {
"prepublish" : "npm prune",
- "test": "make test"
+ "test": "make test REPORTER=dot"
? +++++++++++++
}
} | 2 | 0.0625 | 1 | 1 |
fce387ecea7ed21a33586cc0e2fb08f4d20b5d3f | composer.json | composer.json | {
"name": "jakubzapletal/bank-statements",
"description": "PHP library to parse bank account statements",
"version": "1.0.0",
"autoload": {
"psr-0": { "JakubZapletal\\Component\\BankStatement\\": ""}
},
"target-dir": "JakubZapletal/Component/BankStatement",
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "4.0.*@dev",
"satooshi/php-coveralls": "dev-master"
},
"scripts": {
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev"
}
| {
"name": "jakubzapletal/bank-statements",
"description": "The PHP library to parse bank account statements",
"autoload": {
"psr-4": { "JakubZapletal\\Component\\BankStatement\\": ""}
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "4.0.*@dev",
"satooshi/php-coveralls": "dev-master"
},
"minimum-stability": "dev",
"config": {
"bin-dir": "bin"
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
| Update to use for Packagist | Update to use for Packagist
| JSON | mit | jakubzapletal/bank-statements | json | ## Code Before:
{
"name": "jakubzapletal/bank-statements",
"description": "PHP library to parse bank account statements",
"version": "1.0.0",
"autoload": {
"psr-0": { "JakubZapletal\\Component\\BankStatement\\": ""}
},
"target-dir": "JakubZapletal/Component/BankStatement",
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "4.0.*@dev",
"satooshi/php-coveralls": "dev-master"
},
"scripts": {
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev"
}
## Instruction:
Update to use for Packagist
## Code After:
{
"name": "jakubzapletal/bank-statements",
"description": "The PHP library to parse bank account statements",
"autoload": {
"psr-4": { "JakubZapletal\\Component\\BankStatement\\": ""}
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "4.0.*@dev",
"satooshi/php-coveralls": "dev-master"
},
"minimum-stability": "dev",
"config": {
"bin-dir": "bin"
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
| {
"name": "jakubzapletal/bank-statements",
- "description": "PHP library to parse bank account statements",
+ "description": "The PHP library to parse bank account statements",
? ++++
- "version": "1.0.0",
"autoload": {
- "psr-0": { "JakubZapletal\\Component\\BankStatement\\": ""}
? ^
+ "psr-4": { "JakubZapletal\\Component\\BankStatement\\": ""}
? ^
},
- "target-dir": "JakubZapletal/Component/BankStatement",
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "4.0.*@dev",
"satooshi/php-coveralls": "dev-master"
},
+ "minimum-stability": "dev",
- "scripts": {
- },
"config": {
"bin-dir": "bin"
},
- "minimum-stability": "dev"
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
} | 15 | 0.681818 | 8 | 7 |
9f2b2c4d24d912b600bef01ffe73c48d678d5d95 | index.rst | index.rst | Release Engine
==============
.. toctree::
:maxdepth: 3
:numbered:
intro.rst
Setting up <setup.rst>
Components and Libraries <components.rst>
development.rst
YAMLScripts.rst
playbooks.rst
license.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| Release Engine
==============
.. toctree::
:maxdepth: 3
:numbered:
intro.rst
Setting up <setup.rst>
Components and Libraries <components.rst>
development.rst
YAMLScripts.rst
JSONScripts.rst
playbooks.rst
license.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| Include the JSONScripts page in the main TOC | Include the JSONScripts page in the main TOC
| reStructuredText | apache-2.0 | RHInception/re-docs,RHInception/re-docs | restructuredtext | ## Code Before:
Release Engine
==============
.. toctree::
:maxdepth: 3
:numbered:
intro.rst
Setting up <setup.rst>
Components and Libraries <components.rst>
development.rst
YAMLScripts.rst
playbooks.rst
license.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
## Instruction:
Include the JSONScripts page in the main TOC
## Code After:
Release Engine
==============
.. toctree::
:maxdepth: 3
:numbered:
intro.rst
Setting up <setup.rst>
Components and Libraries <components.rst>
development.rst
YAMLScripts.rst
JSONScripts.rst
playbooks.rst
license.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| Release Engine
==============
.. toctree::
:maxdepth: 3
:numbered:
intro.rst
Setting up <setup.rst>
Components and Libraries <components.rst>
development.rst
YAMLScripts.rst
+ JSONScripts.rst
playbooks.rst
license.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search` | 1 | 0.041667 | 1 | 0 |
342723d638d36c042fc059a2fe7df8f56455a0dc | src/SFA.DAS.Commitments.Database/StoredProcedures/CheckForOverlappingEmailsForTable.sql | src/SFA.DAS.Commitments.Database/StoredProcedures/CheckForOverlappingEmailsForTable.sql | CREATE PROCEDURE [dbo].[CheckForOverlappingEmailsForTable]
@Emails [EmailCheckTable] READONLY,
@CohortId BIGINT = NULL
AS
BEGIN
SELECT
E.RowId,
A.Id,
A.FirstName,
A.LastName,
A.DateOfBirth,
A.CommitmentId AS CohortId,
A.StartDate,
A.EndDate,
A.IsApproved,
A.Email,
dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) AS OverlapStatus
FROM Apprenticeship A
JOIN @Emails E ON E.Email = A.Email
WHERE
CASE
WHEN @CohortId IS NULL AND A.IsApproved = 1 THEN 1
WHEN @CohortId IS NOT NULL AND A.CommitmentId = @CohortId AND A.IsApproved = 0 AND A.StartDate IS NOT NULL AND A.EndDate IS NOT NULL THEN 1
WHEN A.IsApproved = 1 THEN 1
ELSE 0
END = 1
AND A.Id != ISNULL(E.ApprenticeshipId,0)
AND A.Email = E.Email
AND dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) >= 1
END | CREATE PROCEDURE [dbo].[CheckForOverlappingEmailsForTable]
@Emails [EmailCheckTable] READONLY,
@CohortId BIGINT = NULL
AS
BEGIN
SELECT
E.RowId,
A.Id,
A.FirstName,
A.LastName,
A.DateOfBirth,
A.CommitmentId AS CohortId,
A.StartDate,
A.EndDate,
A.IsApproved,
A.Email,
dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) AS OverlapStatus
FROM Apprenticeship A
JOIN @Emails E ON E.Email = A.Email
WHERE
CASE
WHEN @CohortId IS NOT NULL AND A.CommitmentId = @CohortId AND A.IsApproved = 0 AND A.StartDate IS NOT NULL AND A.EndDate IS NOT NULL THEN 1
WHEN C.WithParty = 4 AND A.IsApproved = 0 THEN 1
WHEN A.IsApproved = 1 THEN 1
ELSE 0
END = 1
AND A.Id != ISNULL(E.ApprenticeshipId,0)
AND A.Email = E.Email
AND dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) >= 1
END | Fix email overlap check so it looks at cohorts with transfer sender (but not approved) | Fix email overlap check so it looks at cohorts with transfer sender (but not approved)
| SQL | mit | SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments | sql | ## Code Before:
CREATE PROCEDURE [dbo].[CheckForOverlappingEmailsForTable]
@Emails [EmailCheckTable] READONLY,
@CohortId BIGINT = NULL
AS
BEGIN
SELECT
E.RowId,
A.Id,
A.FirstName,
A.LastName,
A.DateOfBirth,
A.CommitmentId AS CohortId,
A.StartDate,
A.EndDate,
A.IsApproved,
A.Email,
dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) AS OverlapStatus
FROM Apprenticeship A
JOIN @Emails E ON E.Email = A.Email
WHERE
CASE
WHEN @CohortId IS NULL AND A.IsApproved = 1 THEN 1
WHEN @CohortId IS NOT NULL AND A.CommitmentId = @CohortId AND A.IsApproved = 0 AND A.StartDate IS NOT NULL AND A.EndDate IS NOT NULL THEN 1
WHEN A.IsApproved = 1 THEN 1
ELSE 0
END = 1
AND A.Id != ISNULL(E.ApprenticeshipId,0)
AND A.Email = E.Email
AND dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) >= 1
END
## Instruction:
Fix email overlap check so it looks at cohorts with transfer sender (but not approved)
## Code After:
CREATE PROCEDURE [dbo].[CheckForOverlappingEmailsForTable]
@Emails [EmailCheckTable] READONLY,
@CohortId BIGINT = NULL
AS
BEGIN
SELECT
E.RowId,
A.Id,
A.FirstName,
A.LastName,
A.DateOfBirth,
A.CommitmentId AS CohortId,
A.StartDate,
A.EndDate,
A.IsApproved,
A.Email,
dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) AS OverlapStatus
FROM Apprenticeship A
JOIN @Emails E ON E.Email = A.Email
WHERE
CASE
WHEN @CohortId IS NOT NULL AND A.CommitmentId = @CohortId AND A.IsApproved = 0 AND A.StartDate IS NOT NULL AND A.EndDate IS NOT NULL THEN 1
WHEN C.WithParty = 4 AND A.IsApproved = 0 THEN 1
WHEN A.IsApproved = 1 THEN 1
ELSE 0
END = 1
AND A.Id != ISNULL(E.ApprenticeshipId,0)
AND A.Email = E.Email
AND dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) >= 1
END | CREATE PROCEDURE [dbo].[CheckForOverlappingEmailsForTable]
@Emails [EmailCheckTable] READONLY,
@CohortId BIGINT = NULL
AS
BEGIN
SELECT
E.RowId,
A.Id,
A.FirstName,
A.LastName,
A.DateOfBirth,
A.CommitmentId AS CohortId,
A.StartDate,
A.EndDate,
A.IsApproved,
A.Email,
dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) AS OverlapStatus
FROM Apprenticeship A
JOIN @Emails E ON E.Email = A.Email
WHERE
CASE
- WHEN @CohortId IS NULL AND A.IsApproved = 1 THEN 1
WHEN @CohortId IS NOT NULL AND A.CommitmentId = @CohortId AND A.IsApproved = 0 AND A.StartDate IS NOT NULL AND A.EndDate IS NOT NULL THEN 1
+ WHEN C.WithParty = 4 AND A.IsApproved = 0 THEN 1
WHEN A.IsApproved = 1 THEN 1
ELSE 0
END = 1
AND A.Id != ISNULL(E.ApprenticeshipId,0)
AND A.Email = E.Email
AND dbo.CourseDatesOverlap(A.StartDate, dbo.GetEndDateForOverlapChecks(A.PaymentStatus, A.EndDate, A.StopDate, A.CompletionDate), E.StartDate, E.EndDate) >= 1
END | 2 | 0.066667 | 1 | 1 |
a325f69f21c27c3fedb34a209a547a58a6e0946d | appveyor.yml | appveyor.yml | version: '1.0.5-build{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
nuget:
disable_publish_on_pr: true
build_script:
- ps: .\build.ps1
test: off
artifacts:
- path: .\artifacts\**\*.nupkg
name: NuGet
deploy:
- provider: NuGet
server: https://www.myget.org/F/ben-foster-cko-dev/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
- provider: NuGet
name: production
server: https://www.myget.org/F/ben-foster-cko/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
appveyor_repo_tag: true
| version: '1.0.5-build{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
nuget:
disable_publish_on_pr: true
build_script:
- ps: .\build.ps1
test: off
artifacts:
- path: .\artifacts\**\*.nupkg
name: NuGet
- path: .\artifacts\changelog.md
name: Release Notes
deploy:
- provider: NuGet
server: https://www.myget.org/F/ben-foster-cko-dev/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
- provider: NuGet
name: production
server: https://www.myget.org/F/ben-foster-cko/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
appveyor_repo_tag: true
| Include release notes in build artifacts | Include release notes in build artifacts
| YAML | mit | ben-foster-cko/checkout-nuget-demo | yaml | ## Code Before:
version: '1.0.5-build{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
nuget:
disable_publish_on_pr: true
build_script:
- ps: .\build.ps1
test: off
artifacts:
- path: .\artifacts\**\*.nupkg
name: NuGet
deploy:
- provider: NuGet
server: https://www.myget.org/F/ben-foster-cko-dev/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
- provider: NuGet
name: production
server: https://www.myget.org/F/ben-foster-cko/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
appveyor_repo_tag: true
## Instruction:
Include release notes in build artifacts
## Code After:
version: '1.0.5-build{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
nuget:
disable_publish_on_pr: true
build_script:
- ps: .\build.ps1
test: off
artifacts:
- path: .\artifacts\**\*.nupkg
name: NuGet
- path: .\artifacts\changelog.md
name: Release Notes
deploy:
- provider: NuGet
server: https://www.myget.org/F/ben-foster-cko-dev/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
- provider: NuGet
name: production
server: https://www.myget.org/F/ben-foster-cko/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
appveyor_repo_tag: true
| version: '1.0.5-build{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
nuget:
disable_publish_on_pr: true
build_script:
- ps: .\build.ps1
test: off
artifacts:
- path: .\artifacts\**\*.nupkg
name: NuGet
+ - path: .\artifacts\changelog.md
+ name: Release Notes
deploy:
- provider: NuGet
server: https://www.myget.org/F/ben-foster-cko-dev/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
- provider: NuGet
name: production
server: https://www.myget.org/F/ben-foster-cko/api/v2/package
api_key:
secure: cywvUXN90tLAa82KXWVO2G14C1aWvlgrpgxpL7i2oALjKtenX3YGPxyIQUlNbiAM
skip_symbols: true
on:
branch: master
appveyor_repo_tag: true | 2 | 0.064516 | 2 | 0 |
fad644bcdc8fb0e126f221ac5e793a3803df86e6 | .travis.yml | .travis.yml | language: python
os: linux
dist: focal
cache:
pip: true
directories:
- $HOME/.cache/pypoetry
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
before_install:
- pip install --upgrade pip
- pip install poetry
install:
- poetry install
script:
- if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then make style; fi
- poetry run pytest tests --cov=immutabledict
after_success:
- bash <(curl -s https://codecov.io/bash)
jobs:
include:
- stage: deploy
script: skip
if: tag IS present
python: "3.9"
before_deploy:
- poetry config pypi-token.pypi $PYPI_TOKEN
- poetry build
deploy:
provider: script
script: poetry publish
on:
tags: true
| language: python
os: linux
dist: focal
cache:
pip: true
directories:
- $HOME/.cache/pypoetry
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
before_install:
- pip install --upgrade pip
- pip install poetry
install:
- poetry install
script:
- if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then make style; fi
- poetry run pytest tests --cov=immutabledict
after_success:
- if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then bash <(curl -s https://codecov.io/bash); fi
jobs:
include:
- stage: deploy
script: skip
if: tag IS present
python: "3.9"
before_deploy:
- poetry config pypi-token.pypi $PYPI_TOKEN
- poetry build
deploy:
provider: script
script: poetry publish
on:
tags: true
| Send codecov coverage only one per CI run | Send codecov coverage only one per CI run
| YAML | mit | corenting/immutabledict | yaml | ## Code Before:
language: python
os: linux
dist: focal
cache:
pip: true
directories:
- $HOME/.cache/pypoetry
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
before_install:
- pip install --upgrade pip
- pip install poetry
install:
- poetry install
script:
- if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then make style; fi
- poetry run pytest tests --cov=immutabledict
after_success:
- bash <(curl -s https://codecov.io/bash)
jobs:
include:
- stage: deploy
script: skip
if: tag IS present
python: "3.9"
before_deploy:
- poetry config pypi-token.pypi $PYPI_TOKEN
- poetry build
deploy:
provider: script
script: poetry publish
on:
tags: true
## Instruction:
Send codecov coverage only one per CI run
## Code After:
language: python
os: linux
dist: focal
cache:
pip: true
directories:
- $HOME/.cache/pypoetry
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
before_install:
- pip install --upgrade pip
- pip install poetry
install:
- poetry install
script:
- if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then make style; fi
- poetry run pytest tests --cov=immutabledict
after_success:
- if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then bash <(curl -s https://codecov.io/bash); fi
jobs:
include:
- stage: deploy
script: skip
if: tag IS present
python: "3.9"
before_deploy:
- poetry config pypi-token.pypi $PYPI_TOKEN
- poetry build
deploy:
provider: script
script: poetry publish
on:
tags: true
| language: python
os: linux
dist: focal
cache:
pip: true
directories:
- $HOME/.cache/pypoetry
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
before_install:
- pip install --upgrade pip
- pip install poetry
install:
- poetry install
script:
- if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then make style; fi
- poetry run pytest tests --cov=immutabledict
after_success:
- - bash <(curl -s https://codecov.io/bash)
+ - if [[ $TRAVIS_PYTHON_VERSION = 3.9 ]]; then bash <(curl -s https://codecov.io/bash); fi
jobs:
include:
- stage: deploy
script: skip
if: tag IS present
python: "3.9"
before_deploy:
- poetry config pypi-token.pypi $PYPI_TOKEN
- poetry build
deploy:
provider: script
script: poetry publish
on:
tags: true | 2 | 0.051282 | 1 | 1 |
0e400261b2dad04dc9f290cdbc5b16222487d4e3 | setup.py | setup.py |
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name="pysovo",
version="0.4.1",
packages=['pysovo', 'pysovo.comms',
'pysovo.tests', 'pysovo.tests.resources'],
package_data={'pysovo':['tests/resources/*.xml', 'templates/*.txt']},
description="Utility scripts for reacting to received VOEvent packets",
author="Tim Staley",
author_email="timstaley337@gmail.com",
url="https://github.com/timstaley/pysovo",
install_requires=required
)
|
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name="pysovo",
version="0.4.1",
packages=['pysovo', 'pysovo.comms', 'pysovo.triggers',
'pysovo.tests', 'pysovo.tests.resources'],
package_data={'pysovo':['tests/resources/*.xml', 'templates/*.txt']},
description="Utility scripts for reacting to received VOEvent packets",
author="Tim Staley",
author_email="timstaley337@gmail.com",
url="https://github.com/timstaley/pysovo",
install_requires=required
)
| Add triggers module to install. | Add triggers module to install.
| Python | bsd-2-clause | timstaley/pysovo | python | ## Code Before:
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name="pysovo",
version="0.4.1",
packages=['pysovo', 'pysovo.comms',
'pysovo.tests', 'pysovo.tests.resources'],
package_data={'pysovo':['tests/resources/*.xml', 'templates/*.txt']},
description="Utility scripts for reacting to received VOEvent packets",
author="Tim Staley",
author_email="timstaley337@gmail.com",
url="https://github.com/timstaley/pysovo",
install_requires=required
)
## Instruction:
Add triggers module to install.
## Code After:
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name="pysovo",
version="0.4.1",
packages=['pysovo', 'pysovo.comms', 'pysovo.triggers',
'pysovo.tests', 'pysovo.tests.resources'],
package_data={'pysovo':['tests/resources/*.xml', 'templates/*.txt']},
description="Utility scripts for reacting to received VOEvent packets",
author="Tim Staley",
author_email="timstaley337@gmail.com",
url="https://github.com/timstaley/pysovo",
install_requires=required
)
|
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name="pysovo",
version="0.4.1",
- packages=['pysovo', 'pysovo.comms',
+ packages=['pysovo', 'pysovo.comms', 'pysovo.triggers',
? +++++++++++++++++++
'pysovo.tests', 'pysovo.tests.resources'],
package_data={'pysovo':['tests/resources/*.xml', 'templates/*.txt']},
description="Utility scripts for reacting to received VOEvent packets",
author="Tim Staley",
author_email="timstaley337@gmail.com",
url="https://github.com/timstaley/pysovo",
install_requires=required
) | 2 | 0.111111 | 1 | 1 |
5ecd628fb0f597811a69a7c8e4cdf02f46497f50 | components/Deck/ContentModulesPanel/ContentHistoryPanel/SlideHistoryPanel.js | components/Deck/ContentModulesPanel/ContentHistoryPanel/SlideHistoryPanel.js | import React from 'react';
import {connectToStores} from 'fluxible-addons-react';
import SlideHistoryStore from '../../../../stores/SlideHistoryStore';
import UserProfileStore from '../../../../stores/UserProfileStore';
import PermissionsStore from '../../../../stores/PermissionsStore';
import {Feed} from 'semantic-ui-react';
import ContentChangeItem from './ContentChangeItem';
class SlideHistoryPanel extends React.Component {
render() {
const changes = this.props.SlideHistoryStore.changes ? this.props.SlideHistoryStore.changes.map((change, index) => {
return (
<ContentChangeItem selector={this.props.selector} permissions={this.props.PermissionsStore.permissions} change={change} key={index}/>
);
}) : '';
return (
<div ref="slideHistoryPanel" className="ui">
<Feed>
{changes}
</Feed>
</div>
);
}
}
SlideHistoryPanel.contextTypes = {
executeAction: React.PropTypes.func.isRequired
};
SlideHistoryPanel = connectToStores(SlideHistoryPanel, [SlideHistoryStore, UserProfileStore, PermissionsStore], (context, props) => {
return {
SlideHistoryStore: context.getStore(SlideHistoryStore).getState(),
UserProfileStore: context.getStore(UserProfileStore).getState(),
PermissionsStore: context.getStore(PermissionsStore).getState()
};
});
export default SlideHistoryPanel;
| import React from 'react';
import {connectToStores} from 'fluxible-addons-react';
import SlideHistoryStore from '../../../../stores/SlideHistoryStore';
import UserProfileStore from '../../../../stores/UserProfileStore';
import PermissionsStore from '../../../../stores/PermissionsStore';
import {Feed} from 'semantic-ui-react';
import ContentChangeItem from './ContentChangeItem';
class SlideHistoryPanel extends React.Component {
render() {
const changes = this.props.SlideHistoryStore.changes && this.props.SlideHistoryStore.changes.length ? this.props.SlideHistoryStore.changes.map((change, index) => {
return (
<ContentChangeItem selector={this.props.selector} permissions={this.props.PermissionsStore.permissions} change={change} key={index}/>
);
}) : 'There are no changes for this slide.';
return (
<div ref="slideHistoryPanel" className="ui">
<Feed>
{changes}
</Feed>
</div>
);
}
}
SlideHistoryPanel.contextTypes = {
executeAction: React.PropTypes.func.isRequired
};
SlideHistoryPanel = connectToStores(SlideHistoryPanel, [SlideHistoryStore, UserProfileStore, PermissionsStore], (context, props) => {
return {
SlideHistoryStore: context.getStore(SlideHistoryStore).getState(),
UserProfileStore: context.getStore(UserProfileStore).getState(),
PermissionsStore: context.getStore(PermissionsStore).getState()
};
});
export default SlideHistoryPanel;
| Add message for empty slide history | Add message for empty slide history
| JavaScript | mpl-2.0 | slidewiki/slidewiki-platform,slidewiki/slidewiki-platform,slidewiki/slidewiki-platform | javascript | ## Code Before:
import React from 'react';
import {connectToStores} from 'fluxible-addons-react';
import SlideHistoryStore from '../../../../stores/SlideHistoryStore';
import UserProfileStore from '../../../../stores/UserProfileStore';
import PermissionsStore from '../../../../stores/PermissionsStore';
import {Feed} from 'semantic-ui-react';
import ContentChangeItem from './ContentChangeItem';
class SlideHistoryPanel extends React.Component {
render() {
const changes = this.props.SlideHistoryStore.changes ? this.props.SlideHistoryStore.changes.map((change, index) => {
return (
<ContentChangeItem selector={this.props.selector} permissions={this.props.PermissionsStore.permissions} change={change} key={index}/>
);
}) : '';
return (
<div ref="slideHistoryPanel" className="ui">
<Feed>
{changes}
</Feed>
</div>
);
}
}
SlideHistoryPanel.contextTypes = {
executeAction: React.PropTypes.func.isRequired
};
SlideHistoryPanel = connectToStores(SlideHistoryPanel, [SlideHistoryStore, UserProfileStore, PermissionsStore], (context, props) => {
return {
SlideHistoryStore: context.getStore(SlideHistoryStore).getState(),
UserProfileStore: context.getStore(UserProfileStore).getState(),
PermissionsStore: context.getStore(PermissionsStore).getState()
};
});
export default SlideHistoryPanel;
## Instruction:
Add message for empty slide history
## Code After:
import React from 'react';
import {connectToStores} from 'fluxible-addons-react';
import SlideHistoryStore from '../../../../stores/SlideHistoryStore';
import UserProfileStore from '../../../../stores/UserProfileStore';
import PermissionsStore from '../../../../stores/PermissionsStore';
import {Feed} from 'semantic-ui-react';
import ContentChangeItem from './ContentChangeItem';
class SlideHistoryPanel extends React.Component {
render() {
const changes = this.props.SlideHistoryStore.changes && this.props.SlideHistoryStore.changes.length ? this.props.SlideHistoryStore.changes.map((change, index) => {
return (
<ContentChangeItem selector={this.props.selector} permissions={this.props.PermissionsStore.permissions} change={change} key={index}/>
);
}) : 'There are no changes for this slide.';
return (
<div ref="slideHistoryPanel" className="ui">
<Feed>
{changes}
</Feed>
</div>
);
}
}
SlideHistoryPanel.contextTypes = {
executeAction: React.PropTypes.func.isRequired
};
SlideHistoryPanel = connectToStores(SlideHistoryPanel, [SlideHistoryStore, UserProfileStore, PermissionsStore], (context, props) => {
return {
SlideHistoryStore: context.getStore(SlideHistoryStore).getState(),
UserProfileStore: context.getStore(UserProfileStore).getState(),
PermissionsStore: context.getStore(PermissionsStore).getState()
};
});
export default SlideHistoryPanel;
| import React from 'react';
import {connectToStores} from 'fluxible-addons-react';
import SlideHistoryStore from '../../../../stores/SlideHistoryStore';
import UserProfileStore from '../../../../stores/UserProfileStore';
import PermissionsStore from '../../../../stores/PermissionsStore';
import {Feed} from 'semantic-ui-react';
import ContentChangeItem from './ContentChangeItem';
class SlideHistoryPanel extends React.Component {
render() {
- const changes = this.props.SlideHistoryStore.changes ? this.props.SlideHistoryStore.changes.map((change, index) => {
+ const changes = this.props.SlideHistoryStore.changes && this.props.SlideHistoryStore.changes.length ? this.props.SlideHistoryStore.changes.map((change, index) => {
? +++++++++++++++++++++++++++++++++++++++++++++++
return (
<ContentChangeItem selector={this.props.selector} permissions={this.props.PermissionsStore.permissions} change={change} key={index}/>
);
- }) : '';
+ }) : 'There are no changes for this slide.';
return (
<div ref="slideHistoryPanel" className="ui">
<Feed>
{changes}
</Feed>
</div>
);
}
}
SlideHistoryPanel.contextTypes = {
executeAction: React.PropTypes.func.isRequired
};
SlideHistoryPanel = connectToStores(SlideHistoryPanel, [SlideHistoryStore, UserProfileStore, PermissionsStore], (context, props) => {
return {
SlideHistoryStore: context.getStore(SlideHistoryStore).getState(),
UserProfileStore: context.getStore(UserProfileStore).getState(),
PermissionsStore: context.getStore(PermissionsStore).getState()
};
});
export default SlideHistoryPanel; | 4 | 0.102564 | 2 | 2 |
92b51edcfe1d1be3f7e5c5b0ce3b6bad51363edd | web/src/js/base/view.js | web/src/js/base/view.js | import domify from 'domify';
export default class View {
constructor({app, model}) {
this.app = app;
this.model = model;
}
render() {
const html = this.getHTML();
const element = domify(html);
this.mount(element);
return element;
}
renderInto(target) {
target.innerHTML = this.getHTML();
const element = target.children[0];
this.mount(element);
return element;
}
getHTML() {
return '<div></div>';
}
mount(element, sync=false) {
this.element = element;
}
} | import domify from 'domify';
export default class View {
constructor({app}) {
this.app = app;
}
render() {
const html = this.getHTML();
const element = domify(html);
this.mount(element);
return element;
}
renderInto(target) {
target.innerHTML = this.getHTML();
const element = target.children[0];
this.mount(element);
return element;
}
getHTML() {
return '<div></div>';
}
mount(element, sync=false) {
this.element = element;
}
} | Remove model argument from View altogether | Remove model argument from View altogether
| JavaScript | mit | despawnerer/theatrics,despawnerer/theatrics,despawnerer/theatrics | javascript | ## Code Before:
import domify from 'domify';
export default class View {
constructor({app, model}) {
this.app = app;
this.model = model;
}
render() {
const html = this.getHTML();
const element = domify(html);
this.mount(element);
return element;
}
renderInto(target) {
target.innerHTML = this.getHTML();
const element = target.children[0];
this.mount(element);
return element;
}
getHTML() {
return '<div></div>';
}
mount(element, sync=false) {
this.element = element;
}
}
## Instruction:
Remove model argument from View altogether
## Code After:
import domify from 'domify';
export default class View {
constructor({app}) {
this.app = app;
}
render() {
const html = this.getHTML();
const element = domify(html);
this.mount(element);
return element;
}
renderInto(target) {
target.innerHTML = this.getHTML();
const element = target.children[0];
this.mount(element);
return element;
}
getHTML() {
return '<div></div>';
}
mount(element, sync=false) {
this.element = element;
}
} | import domify from 'domify';
export default class View {
- constructor({app, model}) {
? -------
+ constructor({app}) {
this.app = app;
- this.model = model;
}
render() {
const html = this.getHTML();
const element = domify(html);
this.mount(element);
return element;
}
renderInto(target) {
target.innerHTML = this.getHTML();
const element = target.children[0];
this.mount(element);
return element;
}
getHTML() {
return '<div></div>';
}
mount(element, sync=false) {
this.element = element;
}
} | 3 | 0.096774 | 1 | 2 |
0b79aa7e8e71a863e80e5d1868746c224e3467da | Casks/clipy.rb | Casks/clipy.rb | cask :v1 => 'clipy' do
version '1.0.2'
sha256 'e8f09e7ad766f71e6f780c8a05f5cbdf5c71465c4586263f8b73a8e9ae632d93'
url "https://github.com/Clipy/Clipy/releases/download/#{version}/Clipy_#{version}.dmg"
appcast 'http://clipy-app.com/appcast.xml',
:sha256 => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
:format => :sparkle
name 'Clipy'
homepage 'http://clipy-app.com/'
license :mit
depends_on :macos => '>= :mavericks'
app 'Clipy.app'
end
| cask :v1 => 'clipy' do
version '1.0.3'
sha256 '888476b91f7df5a2cef83901f7b426aab17dac4448ada0e60ada9b024751aeee'
url "https://github.com/Clipy/Clipy/releases/download/#{version}/Clipy_#{version}.dmg"
appcast 'http://clipy-app.com/appcast.xml',
:sha256 => '888476b91f7df5a2cef83901f7b426aab17dac4448ada0e60ada9b024751aeee',
:format => :sparkle
name 'Clipy'
homepage 'http://clipy-app.com/'
license :mit
depends_on :macos => '>= :mavericks'
app 'Clipy.app'
end
| Update Clipy to version 1.0.3. | Update Clipy to version 1.0.3.
| Ruby | bsd-2-clause | yurrriq/homebrew-cask,stephenwade/homebrew-cask,Ibuprofen/homebrew-cask,ayohrling/homebrew-cask,Keloran/homebrew-cask,sanyer/homebrew-cask,qbmiller/homebrew-cask,amatos/homebrew-cask,Whoaa512/homebrew-cask,nrlquaker/homebrew-cask,tsparber/homebrew-cask,morganestes/homebrew-cask,zorosteven/homebrew-cask,hvisage/homebrew-cask,kteru/homebrew-cask,deanmorin/homebrew-cask,theoriginalgri/homebrew-cask,cblecker/homebrew-cask,chadcatlett/caskroom-homebrew-cask,vin047/homebrew-cask,jacobbednarz/homebrew-cask,Saklad5/homebrew-cask,afdnlw/homebrew-cask,jaredsampson/homebrew-cask,leipert/homebrew-cask,linc01n/homebrew-cask,mahori/homebrew-cask,farmerchris/homebrew-cask,a1russell/homebrew-cask,hovancik/homebrew-cask,riyad/homebrew-cask,rhendric/homebrew-cask,winkelsdorf/homebrew-cask,nickpellant/homebrew-cask,gwaldo/homebrew-cask,pkq/homebrew-cask,caskroom/homebrew-cask,BenjaminHCCarr/homebrew-cask,larseggert/homebrew-cask,Nitecon/homebrew-cask,hyuna917/homebrew-cask,decrement/homebrew-cask,mgryszko/homebrew-cask,Dremora/homebrew-cask,tjt263/homebrew-cask,Ephemera/homebrew-cask,giannitm/homebrew-cask,jalaziz/homebrew-cask,zorosteven/homebrew-cask,tedbundyjr/homebrew-cask,ahundt/homebrew-cask,wayou/homebrew-cask,d/homebrew-cask,Nitecon/homebrew-cask,genewoo/homebrew-cask,slnovak/homebrew-cask,stonehippo/homebrew-cask,elyscape/homebrew-cask,joschi/homebrew-cask,johnjelinek/homebrew-cask,stigkj/homebrew-caskroom-cask,fharbe/homebrew-cask,adrianchia/homebrew-cask,6uclz1/homebrew-cask,exherb/homebrew-cask,napaxton/homebrew-cask,wuman/homebrew-cask,jeanregisser/homebrew-cask,boydj/homebrew-cask,uetchy/homebrew-cask,shoichiaizawa/homebrew-cask,ianyh/homebrew-cask,johntrandall/homebrew-cask,winkelsdorf/homebrew-cask,chrisRidgers/homebrew-cask,jedahan/homebrew-cask,diguage/homebrew-cask,Labutin/homebrew-cask,singingwolfboy/homebrew-cask,howie/homebrew-cask,caskroom/homebrew-cask,ahundt/homebrew-cask,cfillion/homebrew-cask,timsutton/homebrew-cask,jellyfishcoder/homebrew-cask,corbt/homebrew-cask,skyyuan/homebrew-cask,seanzxx/homebrew-cask,mrmachine/homebrew-cask,hovancik/homebrew-cask,asins/homebrew-cask,MoOx/homebrew-cask,andrewdisley/homebrew-cask,joshka/homebrew-cask,santoshsahoo/homebrew-cask,RickWong/homebrew-cask,wickles/homebrew-cask,kevyau/homebrew-cask,zmwangx/homebrew-cask,schneidmaster/homebrew-cask,crzrcn/homebrew-cask,dvdoliveira/homebrew-cask,jen20/homebrew-cask,neverfox/homebrew-cask,paour/homebrew-cask,boecko/homebrew-cask,antogg/homebrew-cask,miguelfrde/homebrew-cask,seanorama/homebrew-cask,franklouwers/homebrew-cask,tjnycum/homebrew-cask,ftiff/homebrew-cask,yurrriq/homebrew-cask,jellyfishcoder/homebrew-cask,kryhear/homebrew-cask,ldong/homebrew-cask,vitorgalvao/homebrew-cask,gyugyu/homebrew-cask,nathansgreen/homebrew-cask,kpearson/homebrew-cask,alebcay/homebrew-cask,stigkj/homebrew-caskroom-cask,nrlquaker/homebrew-cask,farmerchris/homebrew-cask,johan/homebrew-cask,axodys/homebrew-cask,shorshe/homebrew-cask,mwean/homebrew-cask,chrisfinazzo/homebrew-cask,kei-yamazaki/homebrew-cask,dwihn0r/homebrew-cask,wastrachan/homebrew-cask,neverfox/homebrew-cask,mwilmer/homebrew-cask,inz/homebrew-cask,guylabs/homebrew-cask,larseggert/homebrew-cask,mrmachine/homebrew-cask,retbrown/homebrew-cask,zerrot/homebrew-cask,crzrcn/homebrew-cask,jalaziz/homebrew-cask,jpodlech/homebrew-cask,xight/homebrew-cask,kolomiichenko/homebrew-cask,mikem/homebrew-cask,afh/homebrew-cask,JosephViolago/homebrew-cask,remko/homebrew-cask,coeligena/homebrew-customized,guylabs/homebrew-cask,wKovacs64/homebrew-cask,mwilmer/homebrew-cask,ninjahoahong/homebrew-cask,patresi/homebrew-cask,slack4u/homebrew-cask,mathbunnyru/homebrew-cask,pablote/homebrew-cask,rubenerd/homebrew-cask,muan/homebrew-cask,casidiablo/homebrew-cask,markthetech/homebrew-cask,mathbunnyru/homebrew-cask,zhuzihhhh/homebrew-cask,jbeagley52/homebrew-cask,hvisage/homebrew-cask,jmeridth/homebrew-cask,optikfluffel/homebrew-cask,feniix/homebrew-cask,stevehedrick/homebrew-cask,yuhki50/homebrew-cask,troyxmccall/homebrew-cask,gilesdring/homebrew-cask,LaurentFough/homebrew-cask,schneidmaster/homebrew-cask,yutarody/homebrew-cask,JacopKane/homebrew-cask,sscotth/homebrew-cask,chuanxd/homebrew-cask,anbotero/homebrew-cask,SamiHiltunen/homebrew-cask,okket/homebrew-cask,fharbe/homebrew-cask,maxnordlund/homebrew-cask,lantrix/homebrew-cask,phpwutz/homebrew-cask,ksato9700/homebrew-cask,cblecker/homebrew-cask,renaudguerin/homebrew-cask,giannitm/homebrew-cask,kei-yamazaki/homebrew-cask,retbrown/homebrew-cask,atsuyim/homebrew-cask,unasuke/homebrew-cask,tedski/homebrew-cask,kevyau/homebrew-cask,djakarta-trap/homebrew-myCask,perfide/homebrew-cask,MisumiRize/homebrew-cask,scribblemaniac/homebrew-cask,kesara/homebrew-cask,diogodamiani/homebrew-cask,jacobbednarz/homebrew-cask,flaviocamilo/homebrew-cask,sohtsuka/homebrew-cask,miguelfrde/homebrew-cask,pablote/homebrew-cask,antogg/homebrew-cask,helloIAmPau/homebrew-cask,gerrypower/homebrew-cask,sosedoff/homebrew-cask,asbachb/homebrew-cask,remko/homebrew-cask,cprecioso/homebrew-cask,aguynamedryan/homebrew-cask,alexg0/homebrew-cask,johan/homebrew-cask,mchlrmrz/homebrew-cask,lukeadams/homebrew-cask,sscotth/homebrew-cask,wmorin/homebrew-cask,jconley/homebrew-cask,qbmiller/homebrew-cask,thii/homebrew-cask,akiomik/homebrew-cask,JacopKane/homebrew-cask,cfillion/homebrew-cask,mariusbutuc/homebrew-cask,cblecker/homebrew-cask,andrewdisley/homebrew-cask,mazehall/homebrew-cask,Bombenleger/homebrew-cask,af/homebrew-cask,arronmabrey/homebrew-cask,Gasol/homebrew-cask,wmorin/homebrew-cask,coeligena/homebrew-customized,blainesch/homebrew-cask,jiashuw/homebrew-cask,qnm/homebrew-cask,cliffcotino/homebrew-cask,syscrusher/homebrew-cask,jgarber623/homebrew-cask,chrisRidgers/homebrew-cask,xcezx/homebrew-cask,rajiv/homebrew-cask,forevergenin/homebrew-cask,y00rb/homebrew-cask,tjnycum/homebrew-cask,adrianchia/homebrew-cask,tangestani/homebrew-cask,underyx/homebrew-cask,alebcay/homebrew-cask,samshadwell/homebrew-cask,royalwang/homebrew-cask,opsdev-ws/homebrew-cask,andyli/homebrew-cask,BenjaminHCCarr/homebrew-cask,chrisfinazzo/homebrew-cask,dictcp/homebrew-cask,mauricerkelly/homebrew-cask,gerrymiller/homebrew-cask,ayohrling/homebrew-cask,winkelsdorf/homebrew-cask,vin047/homebrew-cask,sgnh/homebrew-cask,ninjahoahong/homebrew-cask,miccal/homebrew-cask,rogeriopradoj/homebrew-cask,Amorymeltzer/homebrew-cask,illusionfield/homebrew-cask,doits/homebrew-cask,FinalDes/homebrew-cask,6uclz1/homebrew-cask,m3nu/homebrew-cask,JosephViolago/homebrew-cask,buo/homebrew-cask,skyyuan/homebrew-cask,psibre/homebrew-cask,cedwardsmedia/homebrew-cask,FinalDes/homebrew-cask,gyndav/homebrew-cask,malob/homebrew-cask,axodys/homebrew-cask,exherb/homebrew-cask,bdhess/homebrew-cask,optikfluffel/homebrew-cask,gerrypower/homebrew-cask,pacav69/homebrew-cask,kuno/homebrew-cask,zhuzihhhh/homebrew-cask,christer155/homebrew-cask,pkq/homebrew-cask,Gasol/homebrew-cask,johntrandall/homebrew-cask,renard/homebrew-cask,0rax/homebrew-cask,reitermarkus/homebrew-cask,arronmabrey/homebrew-cask,bosr/homebrew-cask,jaredsampson/homebrew-cask,imgarylai/homebrew-cask,rickychilcott/homebrew-cask,lvicentesanchez/homebrew-cask,mkozjak/homebrew-cask,BahtiyarB/homebrew-cask,jppelteret/homebrew-cask,kirikiriyamama/homebrew-cask,ddm/homebrew-cask,johnjelinek/homebrew-cask,dwkns/homebrew-cask,toonetown/homebrew-cask,rajiv/homebrew-cask,christer155/homebrew-cask,mahori/homebrew-cask,adriweb/homebrew-cask,nathanielvarona/homebrew-cask,Ketouem/homebrew-cask,johndbritton/homebrew-cask,0xadada/homebrew-cask,dwihn0r/homebrew-cask,colindean/homebrew-cask,kiliankoe/homebrew-cask,yurikoles/homebrew-cask,deanmorin/homebrew-cask,jconley/homebrew-cask,hristozov/homebrew-cask,mattrobenolt/homebrew-cask,yumitsu/homebrew-cask,jawshooah/homebrew-cask,mkozjak/homebrew-cask,zmwangx/homebrew-cask,jayshao/homebrew-cask,unasuke/homebrew-cask,dvdoliveira/homebrew-cask,josa42/homebrew-cask,sohtsuka/homebrew-cask,jonathanwiesel/homebrew-cask,wuman/homebrew-cask,FredLackeyOfficial/homebrew-cask,jhowtan/homebrew-cask,mlocher/homebrew-cask,gurghet/homebrew-cask,iAmGhost/homebrew-cask,forevergenin/homebrew-cask,timsutton/homebrew-cask,chadcatlett/caskroom-homebrew-cask,uetchy/homebrew-cask,yuhki50/homebrew-cask,bendoerr/homebrew-cask,asins/homebrew-cask,devmynd/homebrew-cask,miccal/homebrew-cask,colindean/homebrew-cask,mwean/homebrew-cask,puffdad/homebrew-cask,mingzhi22/homebrew-cask,lifepillar/homebrew-cask,usami-k/homebrew-cask,hakamadare/homebrew-cask,wickles/homebrew-cask,kingthorin/homebrew-cask,mazehall/homebrew-cask,af/homebrew-cask,imgarylai/homebrew-cask,neil-ca-moore/homebrew-cask,andrewdisley/homebrew-cask,lcasey001/homebrew-cask,morganestes/homebrew-cask,coeligena/homebrew-customized,JoelLarson/homebrew-cask,lvicentesanchez/homebrew-cask,mishari/homebrew-cask,fly19890211/homebrew-cask,kiliankoe/homebrew-cask,bcomnes/homebrew-cask,deiga/homebrew-cask,ebraminio/homebrew-cask,bdhess/homebrew-cask,Whoaa512/homebrew-cask,stevenmaguire/homebrew-cask,MircoT/homebrew-cask,shonjir/homebrew-cask,mjdescy/homebrew-cask,moonboots/homebrew-cask,tyage/homebrew-cask,underyx/homebrew-cask,xcezx/homebrew-cask,atsuyim/homebrew-cask,sjackman/homebrew-cask,neverfox/homebrew-cask,nysthee/homebrew-cask,tranc99/homebrew-cask,scribblemaniac/homebrew-cask,ksylvan/homebrew-cask,englishm/homebrew-cask,gabrielizaias/homebrew-cask,troyxmccall/homebrew-cask,zeusdeux/homebrew-cask,jedahan/homebrew-cask,skatsuta/homebrew-cask,bric3/homebrew-cask,kteru/homebrew-cask,rubenerd/homebrew-cask,dustinblackman/homebrew-cask,gyndav/homebrew-cask,singingwolfboy/homebrew-cask,janlugt/homebrew-cask,MatzFan/homebrew-cask,xtian/homebrew-cask,nrlquaker/homebrew-cask,sanchezm/homebrew-cask,squid314/homebrew-cask,ericbn/homebrew-cask,Cottser/homebrew-cask,xyb/homebrew-cask,tan9/homebrew-cask,kronicd/homebrew-cask,paour/homebrew-cask,mokagio/homebrew-cask,FranklinChen/homebrew-cask,howie/homebrew-cask,stevehedrick/homebrew-cask,mattfelsen/homebrew-cask,mattrobenolt/homebrew-cask,corbt/homebrew-cask,jawshooah/homebrew-cask,0rax/homebrew-cask,CameronGarrett/homebrew-cask,mwek/homebrew-cask,klane/homebrew-cask,andyli/homebrew-cask,jpmat296/homebrew-cask,KosherBacon/homebrew-cask,jeroenj/homebrew-cask,ctrevino/homebrew-cask,bcomnes/homebrew-cask,joshka/homebrew-cask,MerelyAPseudonym/homebrew-cask,franklouwers/homebrew-cask,nathancahill/homebrew-cask,reitermarkus/homebrew-cask,samshadwell/homebrew-cask,kostasdizas/homebrew-cask,nshemonsky/homebrew-cask,faun/homebrew-cask,norio-nomura/homebrew-cask,scottsuch/homebrew-cask,jalaziz/homebrew-cask,mattrobenolt/homebrew-cask,jonathanwiesel/homebrew-cask,xtian/homebrew-cask,blogabe/homebrew-cask,tsparber/homebrew-cask,kesara/homebrew-cask,claui/homebrew-cask,coneman/homebrew-cask,casidiablo/homebrew-cask,greg5green/homebrew-cask,gmkey/homebrew-cask,kingthorin/homebrew-cask,blogabe/homebrew-cask,pacav69/homebrew-cask,bendoerr/homebrew-cask,blainesch/homebrew-cask,MichaelPei/homebrew-cask,ctrevino/homebrew-cask,opsdev-ws/homebrew-cask,decrement/homebrew-cask,shonjir/homebrew-cask,jpodlech/homebrew-cask,blogabe/homebrew-cask,fwiesel/homebrew-cask,miccal/homebrew-cask,joschi/homebrew-cask,malob/homebrew-cask,klane/homebrew-cask,mjgardner/homebrew-cask,tan9/homebrew-cask,kkdd/homebrew-cask,ldong/homebrew-cask,MatzFan/homebrew-cask,josa42/homebrew-cask,vuquoctuan/homebrew-cask,My2ndAngelic/homebrew-cask,anbotero/homebrew-cask,a1russell/homebrew-cask,samdoran/homebrew-cask,samnung/homebrew-cask,shanonvl/homebrew-cask,pkq/homebrew-cask,FredLackeyOfficial/homebrew-cask,lcasey001/homebrew-cask,RJHsiao/homebrew-cask,samnung/homebrew-cask,williamboman/homebrew-cask,rcuza/homebrew-cask,wKovacs64/homebrew-cask,a-x-/homebrew-cask,tangestani/homebrew-cask,shoichiaizawa/homebrew-cask,deiga/homebrew-cask,bkono/homebrew-cask,nickpellant/homebrew-cask,brianshumate/homebrew-cask,goxberry/homebrew-cask,SentinelWarren/homebrew-cask,kronicd/homebrew-cask,BahtiyarB/homebrew-cask,bosr/homebrew-cask,samdoran/homebrew-cask,guerrero/homebrew-cask,drostron/homebrew-cask,malford/homebrew-cask,wayou/homebrew-cask,wastrachan/homebrew-cask,alebcay/homebrew-cask,mhubig/homebrew-cask,asbachb/homebrew-cask,ywfwj2008/homebrew-cask,tjt263/homebrew-cask,cliffcotino/homebrew-cask,mjdescy/homebrew-cask,JikkuJose/homebrew-cask,renard/homebrew-cask,scottsuch/homebrew-cask,goxberry/homebrew-cask,deiga/homebrew-cask,tmoreira2020/homebrew,julionc/homebrew-cask,dustinblackman/homebrew-cask,sanyer/homebrew-cask,wickedsp1d3r/homebrew-cask,afh/homebrew-cask,psibre/homebrew-cask,singingwolfboy/homebrew-cask,seanorama/homebrew-cask,thomanq/homebrew-cask,nysthee/homebrew-cask,colindunn/homebrew-cask,mattfelsen/homebrew-cask,jen20/homebrew-cask,markthetech/homebrew-cask,devmynd/homebrew-cask,Bombenleger/homebrew-cask,n8henrie/homebrew-cask,paour/homebrew-cask,a1russell/homebrew-cask,moimikey/homebrew-cask,MisumiRize/homebrew-cask,kkdd/homebrew-cask,hyuna917/homebrew-cask,githubutilities/homebrew-cask,xight/homebrew-cask,dieterdemeyer/homebrew-cask,mlocher/homebrew-cask,jasmas/homebrew-cask,kongslund/homebrew-cask,shanonvl/homebrew-cask,guerrero/homebrew-cask,jiashuw/homebrew-cask,adriweb/homebrew-cask,shonjir/homebrew-cask,santoshsahoo/homebrew-cask,julionc/homebrew-cask,ptb/homebrew-cask,taherio/homebrew-cask,My2ndAngelic/homebrew-cask,mwek/homebrew-cask,xakraz/homebrew-cask,jangalinski/homebrew-cask,moonboots/homebrew-cask,djakarta-trap/homebrew-myCask,RJHsiao/homebrew-cask,gmkey/homebrew-cask,onlynone/homebrew-cask,taherio/homebrew-cask,gyugyu/homebrew-cask,paulombcosta/homebrew-cask,elyscape/homebrew-cask,ebraminio/homebrew-cask,josa42/homebrew-cask,ftiff/homebrew-cask,Amorymeltzer/homebrew-cask,mariusbutuc/homebrew-cask,JacopKane/homebrew-cask,joschi/homebrew-cask,malob/homebrew-cask,scribblemaniac/homebrew-cask,diogodamiani/homebrew-cask,rogeriopradoj/homebrew-cask,victorpopkov/homebrew-cask,cobyism/homebrew-cask,jbeagley52/homebrew-cask,vuquoctuan/homebrew-cask,paulombcosta/homebrew-cask,yutarody/homebrew-cask,wmorin/homebrew-cask,bric3/homebrew-cask,jeroenseegers/homebrew-cask,chino/homebrew-cask,mishari/homebrew-cask,slnovak/homebrew-cask,esebastian/homebrew-cask,bcaceiro/homebrew-cask,barravi/homebrew-cask,Keloran/homebrew-cask,mhubig/homebrew-cask,michelegera/homebrew-cask,nightscape/homebrew-cask,markhuber/homebrew-cask,jeroenseegers/homebrew-cask,diguage/homebrew-cask,ajbw/homebrew-cask,huanzhang/homebrew-cask,ericbn/homebrew-cask,kpearson/homebrew-cask,moogar0880/homebrew-cask,FranklinChen/homebrew-cask,williamboman/homebrew-cask,Labutin/homebrew-cask,xyb/homebrew-cask,malford/homebrew-cask,johndbritton/homebrew-cask,bcaceiro/homebrew-cask,miku/homebrew-cask,MicTech/homebrew-cask,stevenmaguire/homebrew-cask,slack4u/homebrew-cask,stephenwade/homebrew-cask,tranc99/homebrew-cask,alexg0/homebrew-cask,Dremora/homebrew-cask,nshemonsky/homebrew-cask,greg5green/homebrew-cask,syscrusher/homebrew-cask,Ketouem/homebrew-cask,mathbunnyru/homebrew-cask,danielbayley/homebrew-cask,ddm/homebrew-cask,mahori/homebrew-cask,squid314/homebrew-cask,lantrix/homebrew-cask,esebastian/homebrew-cask,lucasmezencio/homebrew-cask,koenrh/homebrew-cask,stephenwade/homebrew-cask,fkrone/homebrew-cask,MichaelPei/homebrew-cask,bkono/homebrew-cask,claui/homebrew-cask,kryhear/homebrew-cask,thii/homebrew-cask,nathanielvarona/homebrew-cask,kievechua/homebrew-cask,shoichiaizawa/homebrew-cask,buo/homebrew-cask,tmoreira2020/homebrew,JosephViolago/homebrew-cask,riyad/homebrew-cask,retrography/homebrew-cask,nathanielvarona/homebrew-cask,aguynamedryan/homebrew-cask,vigosan/homebrew-cask,joshka/homebrew-cask,hanxue/caskroom,dcondrey/homebrew-cask,ksylvan/homebrew-cask,daften/homebrew-cask,chuanxd/homebrew-cask,wickedsp1d3r/homebrew-cask,kostasdizas/homebrew-cask,leonmachadowilcox/homebrew-cask,dictcp/homebrew-cask,afdnlw/homebrew-cask,kievechua/homebrew-cask,mindriot101/homebrew-cask,jasmas/homebrew-cask,Amorymeltzer/homebrew-cask,sjackman/homebrew-cask,feigaochn/homebrew-cask,lumaxis/homebrew-cask,moimikey/homebrew-cask,SentinelWarren/homebrew-cask,gibsjose/homebrew-cask,Saklad5/homebrew-cask,artdevjs/homebrew-cask,yurikoles/homebrew-cask,sebcode/homebrew-cask,linc01n/homebrew-cask,chino/homebrew-cask,kassi/homebrew-cask,yurikoles/homebrew-cask,0xadada/homebrew-cask,lauantai/homebrew-cask,tedbundyjr/homebrew-cask,koenrh/homebrew-cask,MircoT/homebrew-cask,esebastian/homebrew-cask,rhendric/homebrew-cask,jeroenj/homebrew-cask,stonehippo/homebrew-cask,KosherBacon/homebrew-cask,n0ts/homebrew-cask,Fedalto/homebrew-cask,n8henrie/homebrew-cask,jgarber623/homebrew-cask,akiomik/homebrew-cask,okket/homebrew-cask,drostron/homebrew-cask,otaran/homebrew-cask,RickWong/homebrew-cask,leipert/homebrew-cask,stonehippo/homebrew-cask,kTitan/homebrew-cask,mingzhi22/homebrew-cask,Ephemera/homebrew-cask,jangalinski/homebrew-cask,cobyism/homebrew-cask,tolbkni/homebrew-cask,kesara/homebrew-cask,BenjaminHCCarr/homebrew-cask,Ngrd/homebrew-cask,jeanregisser/homebrew-cask,gabrielizaias/homebrew-cask,lumaxis/homebrew-cask,tedski/homebrew-cask,xight/homebrew-cask,qnm/homebrew-cask,elnappo/homebrew-cask,victorpopkov/homebrew-cask,andersonba/homebrew-cask,yutarody/homebrew-cask,lauantai/homebrew-cask,genewoo/homebrew-cask,moogar0880/homebrew-cask,onlynone/homebrew-cask,nightscape/homebrew-cask,githubutilities/homebrew-cask,inz/homebrew-cask,englishm/homebrew-cask,norio-nomura/homebrew-cask,CameronGarrett/homebrew-cask,vitorgalvao/homebrew-cask,sscotth/homebrew-cask,mgryszko/homebrew-cask,tangestani/homebrew-cask,kuno/homebrew-cask,jpmat296/homebrew-cask,cedwardsmedia/homebrew-cask,kTitan/homebrew-cask,sebcode/homebrew-cask,kassi/homebrew-cask,codeurge/homebrew-cask,leonmachadowilcox/homebrew-cask,hanxue/caskroom,robertgzr/homebrew-cask,kolomiichenko/homebrew-cask,LaurentFough/homebrew-cask,fanquake/homebrew-cask,Cottser/homebrew-cask,ksato9700/homebrew-cask,vigosan/homebrew-cask,chrisfinazzo/homebrew-cask,SamiHiltunen/homebrew-cask,thehunmonkgroup/homebrew-cask,christophermanning/homebrew-cask,cprecioso/homebrew-cask,athrunsun/homebrew-cask,Ephemera/homebrew-cask,Ibuprofen/homebrew-cask,hanxue/caskroom,Fedalto/homebrew-cask,tarwich/homebrew-cask,inta/homebrew-cask,robertgzr/homebrew-cask,gerrymiller/homebrew-cask,gwaldo/homebrew-cask,artdevjs/homebrew-cask,michelegera/homebrew-cask,kongslund/homebrew-cask,skatsuta/homebrew-cask,y00rb/homebrew-cask,rajiv/homebrew-cask,phpwutz/homebrew-cask,andersonba/homebrew-cask,MerelyAPseudonym/homebrew-cask,haha1903/homebrew-cask,colindunn/homebrew-cask,hellosky806/homebrew-cask,JikkuJose/homebrew-cask,boecko/homebrew-cask,JoelLarson/homebrew-cask,optikfluffel/homebrew-cask,thehunmonkgroup/homebrew-cask,coneman/homebrew-cask,nathansgreen/homebrew-cask,mchlrmrz/homebrew-cask,ericbn/homebrew-cask,hellosky806/homebrew-cask,tjnycum/homebrew-cask,reelsense/homebrew-cask,amatos/homebrew-cask,ianyh/homebrew-cask,thomanq/homebrew-cask,tolbkni/homebrew-cask,kingthorin/homebrew-cask,sosedoff/homebrew-cask,gurghet/homebrew-cask,lukeadams/homebrew-cask,flaviocamilo/homebrew-cask,christophermanning/homebrew-cask,fkrone/homebrew-cask,otaran/homebrew-cask,tyage/homebrew-cask,elnappo/homebrew-cask,dwkns/homebrew-cask,xakraz/homebrew-cask,feigaochn/homebrew-cask,MoOx/homebrew-cask,lucasmezencio/homebrew-cask,usami-k/homebrew-cask,reelsense/homebrew-cask,albertico/homebrew-cask,alexg0/homebrew-cask,aktau/homebrew-cask,gilesdring/homebrew-cask,lifepillar/homebrew-cask,hakamadare/homebrew-cask,gibsjose/homebrew-cask,m3nu/homebrew-cask,reitermarkus/homebrew-cask,janlugt/homebrew-cask,feniix/homebrew-cask,patresi/homebrew-cask,haha1903/homebrew-cask,dcondrey/homebrew-cask,brianshumate/homebrew-cask,theoriginalgri/homebrew-cask,royalwang/homebrew-cask,seanzxx/homebrew-cask,doits/homebrew-cask,miku/homebrew-cask,timsutton/homebrew-cask,perfide/homebrew-cask,sanyer/homebrew-cask,robbiethegeek/homebrew-cask,nathancahill/homebrew-cask,jmeridth/homebrew-cask,shorshe/homebrew-cask,lukasbestle/homebrew-cask,ywfwj2008/homebrew-cask,inta/homebrew-cask,retrography/homebrew-cask,helloIAmPau/homebrew-cask,robbiethegeek/homebrew-cask,rogeriopradoj/homebrew-cask,hristozov/homebrew-cask,mjgardner/homebrew-cask,mauricerkelly/homebrew-cask,ajbw/homebrew-cask,napaxton/homebrew-cask,codeurge/homebrew-cask,MicTech/homebrew-cask,mikem/homebrew-cask,jppelteret/homebrew-cask,toonetown/homebrew-cask,kamilboratynski/homebrew-cask,antogg/homebrew-cask,pinut/homebrew-cask,renaudguerin/homebrew-cask,daften/homebrew-cask,imgarylai/homebrew-cask,puffdad/homebrew-cask,cobyism/homebrew-cask,mchlrmrz/homebrew-cask,fly19890211/homebrew-cask,mjgardner/homebrew-cask,lukasbestle/homebrew-cask,adrianchia/homebrew-cask,jgarber623/homebrew-cask,13k/homebrew-cask,zerrot/homebrew-cask,danielbayley/homebrew-cask,maxnordlund/homebrew-cask,julionc/homebrew-cask,dictcp/homebrew-cask,AnastasiaSulyagina/homebrew-cask,muan/homebrew-cask,tarwich/homebrew-cask,athrunsun/homebrew-cask,uetchy/homebrew-cask,albertico/homebrew-cask,aktau/homebrew-cask,sgnh/homebrew-cask,rcuza/homebrew-cask,claui/homebrew-cask,boydj/homebrew-cask,13k/homebrew-cask,mokagio/homebrew-cask,jayshao/homebrew-cask,huanzhang/homebrew-cask,jhowtan/homebrew-cask,mindriot101/homebrew-cask,xyb/homebrew-cask,danielbayley/homebrew-cask,a-x-/homebrew-cask,fanquake/homebrew-cask,bric3/homebrew-cask,faun/homebrew-cask,Ngrd/homebrew-cask,AnastasiaSulyagina/homebrew-cask,n0ts/homebrew-cask,pinut/homebrew-cask,gyndav/homebrew-cask,kamilboratynski/homebrew-cask,fwiesel/homebrew-cask,yumitsu/homebrew-cask,iAmGhost/homebrew-cask,m3nu/homebrew-cask,neil-ca-moore/homebrew-cask,barravi/homebrew-cask,zeusdeux/homebrew-cask,scottsuch/homebrew-cask,ptb/homebrew-cask,sanchezm/homebrew-cask,rickychilcott/homebrew-cask,moimikey/homebrew-cask,markhuber/homebrew-cask,kirikiriyamama/homebrew-cask,dieterdemeyer/homebrew-cask,illusionfield/homebrew-cask,d/homebrew-cask | ruby | ## Code Before:
cask :v1 => 'clipy' do
version '1.0.2'
sha256 'e8f09e7ad766f71e6f780c8a05f5cbdf5c71465c4586263f8b73a8e9ae632d93'
url "https://github.com/Clipy/Clipy/releases/download/#{version}/Clipy_#{version}.dmg"
appcast 'http://clipy-app.com/appcast.xml',
:sha256 => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
:format => :sparkle
name 'Clipy'
homepage 'http://clipy-app.com/'
license :mit
depends_on :macos => '>= :mavericks'
app 'Clipy.app'
end
## Instruction:
Update Clipy to version 1.0.3.
## Code After:
cask :v1 => 'clipy' do
version '1.0.3'
sha256 '888476b91f7df5a2cef83901f7b426aab17dac4448ada0e60ada9b024751aeee'
url "https://github.com/Clipy/Clipy/releases/download/#{version}/Clipy_#{version}.dmg"
appcast 'http://clipy-app.com/appcast.xml',
:sha256 => '888476b91f7df5a2cef83901f7b426aab17dac4448ada0e60ada9b024751aeee',
:format => :sparkle
name 'Clipy'
homepage 'http://clipy-app.com/'
license :mit
depends_on :macos => '>= :mavericks'
app 'Clipy.app'
end
| cask :v1 => 'clipy' do
- version '1.0.2'
? ^
+ version '1.0.3'
? ^
- sha256 'e8f09e7ad766f71e6f780c8a05f5cbdf5c71465c4586263f8b73a8e9ae632d93'
+ sha256 '888476b91f7df5a2cef83901f7b426aab17dac4448ada0e60ada9b024751aeee'
url "https://github.com/Clipy/Clipy/releases/download/#{version}/Clipy_#{version}.dmg"
appcast 'http://clipy-app.com/appcast.xml',
- :sha256 => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
+ :sha256 => '888476b91f7df5a2cef83901f7b426aab17dac4448ada0e60ada9b024751aeee',
:format => :sparkle
name 'Clipy'
homepage 'http://clipy-app.com/'
license :mit
depends_on :macos => '>= :mavericks'
app 'Clipy.app'
end | 6 | 0.375 | 3 | 3 |
03cc7533a6035e8cb3fed8ecf5b80dc0cc2638d1 | maven-plugin/src/main/java/se/vandmo/textchecker/maven/RulesResolver.java | maven-plugin/src/main/java/se/vandmo/textchecker/maven/RulesResolver.java | package se.vandmo.textchecker.maven;
import static java.util.Arrays.asList;
import java.io.File;
import java.util.Collection;
import se.vandmo.textchecker.maven.rules.ConsistentLineSeparator;
import se.vandmo.textchecker.maven.rules.EndsWithLineSeparator;
import se.vandmo.textchecker.maven.rules.NoTabs;
import se.vandmo.textchecker.maven.rules.NoTrailingWhitespaceOnNonBlankLines;
import se.vandmo.textchecker.maven.rules.NoWhitespaceOnBlankLines;
import se.vandmo.textchecker.maven.rules.NotExecutable;
public final class RulesResolver {
public Collection<Rule> getRulesFor(File file) {
return asList(
new NoTabs(),
new NoTrailingWhitespaceOnNonBlankLines(),
new NoWhitespaceOnBlankLines(),
new NotExecutable(),
new ConsistentLineSeparator(),
new EndsWithLineSeparator());
}
}
| package se.vandmo.textchecker.maven;
import static java.util.Arrays.asList;
import java.io.File;
import java.util.Collection;
import se.vandmo.textchecker.maven.rules.ConsistentLineSeparator;
import se.vandmo.textchecker.maven.rules.EndsWithLineSeparator;
import se.vandmo.textchecker.maven.rules.NoTabs;
import se.vandmo.textchecker.maven.rules.NoTrailingWhitespaceOnNonBlankLines;
import se.vandmo.textchecker.maven.rules.NoWhitespaceOnBlankLines;
public final class RulesResolver {
public Collection<Rule> getRulesFor(File file) {
return asList(
new NoTabs(),
new NoTrailingWhitespaceOnNonBlankLines(),
new NoWhitespaceOnBlankLines(),
new ConsistentLineSeparator(),
new EndsWithLineSeparator());
}
}
| Remove NotExecutable check, bad on Windows | Remove NotExecutable check, bad on Windows
| Java | apache-2.0 | vandmo/text-checker,vandmo/text-checker | java | ## Code Before:
package se.vandmo.textchecker.maven;
import static java.util.Arrays.asList;
import java.io.File;
import java.util.Collection;
import se.vandmo.textchecker.maven.rules.ConsistentLineSeparator;
import se.vandmo.textchecker.maven.rules.EndsWithLineSeparator;
import se.vandmo.textchecker.maven.rules.NoTabs;
import se.vandmo.textchecker.maven.rules.NoTrailingWhitespaceOnNonBlankLines;
import se.vandmo.textchecker.maven.rules.NoWhitespaceOnBlankLines;
import se.vandmo.textchecker.maven.rules.NotExecutable;
public final class RulesResolver {
public Collection<Rule> getRulesFor(File file) {
return asList(
new NoTabs(),
new NoTrailingWhitespaceOnNonBlankLines(),
new NoWhitespaceOnBlankLines(),
new NotExecutable(),
new ConsistentLineSeparator(),
new EndsWithLineSeparator());
}
}
## Instruction:
Remove NotExecutable check, bad on Windows
## Code After:
package se.vandmo.textchecker.maven;
import static java.util.Arrays.asList;
import java.io.File;
import java.util.Collection;
import se.vandmo.textchecker.maven.rules.ConsistentLineSeparator;
import se.vandmo.textchecker.maven.rules.EndsWithLineSeparator;
import se.vandmo.textchecker.maven.rules.NoTabs;
import se.vandmo.textchecker.maven.rules.NoTrailingWhitespaceOnNonBlankLines;
import se.vandmo.textchecker.maven.rules.NoWhitespaceOnBlankLines;
public final class RulesResolver {
public Collection<Rule> getRulesFor(File file) {
return asList(
new NoTabs(),
new NoTrailingWhitespaceOnNonBlankLines(),
new NoWhitespaceOnBlankLines(),
new ConsistentLineSeparator(),
new EndsWithLineSeparator());
}
}
| package se.vandmo.textchecker.maven;
import static java.util.Arrays.asList;
import java.io.File;
import java.util.Collection;
import se.vandmo.textchecker.maven.rules.ConsistentLineSeparator;
import se.vandmo.textchecker.maven.rules.EndsWithLineSeparator;
import se.vandmo.textchecker.maven.rules.NoTabs;
import se.vandmo.textchecker.maven.rules.NoTrailingWhitespaceOnNonBlankLines;
import se.vandmo.textchecker.maven.rules.NoWhitespaceOnBlankLines;
- import se.vandmo.textchecker.maven.rules.NotExecutable;
public final class RulesResolver {
public Collection<Rule> getRulesFor(File file) {
return asList(
new NoTabs(),
new NoTrailingWhitespaceOnNonBlankLines(),
new NoWhitespaceOnBlankLines(),
- new NotExecutable(),
new ConsistentLineSeparator(),
new EndsWithLineSeparator());
}
} | 2 | 0.071429 | 0 | 2 |
1812067b33e67216042e0f0dd0978d36fbd50b53 | trivial-documentation.asd | trivial-documentation.asd | ;;;; System definition for TRIVIAL-DOCUMENTATION.
(defsystem trivial-documentation
:description
"Extract documentation and definitions for symbols and packages."
:author "Max Rottenkolber <max@mr.gy>"
:license "GNU AGPL"
:components ((:file "extract"))
:depends-on ("closer-mop"))
| ;;;; System definition for TRIVIAL-DOCUMENTATION.
(defsystem trivial-documentation
:description
"Extract documentation and definitions for symbols and packages."
:author "Max Rottenkolber <max@mr.gy>"
:license "GNU AGPL"
:components ((:file "extract"))
:depends-on ("closer-mop" #+sbcl"sb-introspect"))
| Add sb-introspect dependency on SBCL. | Add sb-introspect dependency on SBCL.
| Common Lisp | agpl-3.0 | eugeneia/trivial-documentation | common-lisp | ## Code Before:
;;;; System definition for TRIVIAL-DOCUMENTATION.
(defsystem trivial-documentation
:description
"Extract documentation and definitions for symbols and packages."
:author "Max Rottenkolber <max@mr.gy>"
:license "GNU AGPL"
:components ((:file "extract"))
:depends-on ("closer-mop"))
## Instruction:
Add sb-introspect dependency on SBCL.
## Code After:
;;;; System definition for TRIVIAL-DOCUMENTATION.
(defsystem trivial-documentation
:description
"Extract documentation and definitions for symbols and packages."
:author "Max Rottenkolber <max@mr.gy>"
:license "GNU AGPL"
:components ((:file "extract"))
:depends-on ("closer-mop" #+sbcl"sb-introspect"))
| ;;;; System definition for TRIVIAL-DOCUMENTATION.
(defsystem trivial-documentation
:description
"Extract documentation and definitions for symbols and packages."
:author "Max Rottenkolber <max@mr.gy>"
:license "GNU AGPL"
:components ((:file "extract"))
- :depends-on ("closer-mop"))
+ :depends-on ("closer-mop" #+sbcl"sb-introspect")) | 2 | 0.222222 | 1 | 1 |
8ce34fe3d2aa8beecdfa77b15d25cdb30609b400 | spec/controllers/medicaid/sign_and_submit_controller_spec.rb | spec/controllers/medicaid/sign_and_submit_controller_spec.rb | require "rails_helper"
RSpec.describe Medicaid::SignAndSubmitController do
describe "#next_path" do
it "is the insurance current path" do
expect(subject.next_path).to eq(
"/steps/medicaid/confirmation",
)
end
end
describe "#update" do
it "updates the signature" do
medicaid_application = create(
:medicaid_application,
signature: "Hans Solo",
)
session[:medicaid_application_id] = medicaid_application.id
expect do
put :update, params: { step: { signature: "Chiu Baka" } }
end.to change {
medicaid_application.reload.signature
}.from("Hans Solo").to("Chiu Baka")
expect(medicaid_application.signed_at).not_to be nil
end
end
end
| require "rails_helper"
RSpec.describe Medicaid::SignAndSubmitController do
describe "#next_path" do
it "is the insurance current path" do
expect(subject.next_path).to eq(
"/steps/medicaid/confirmation",
)
end
end
describe "#update" do
it "updates the signature" do
medicaid_application = create(
:medicaid_application,
signature: "Hans Solo",
signed_at: nil,
)
session[:medicaid_application_id] = medicaid_application.id
expect do
put :update, params: { step: { signature: "Chiu Baka" } }
end.to change {
medicaid_application.reload.signature
}.from("Hans Solo").to("Chiu Baka")
expect(medicaid_application.signed_at).not_to be nil
end
end
end
| Add explicit nil in test setup when checking attribute change | Add explicit nil in test setup when checking attribute change
| Ruby | mit | codeforamerica/michigan-benefits,codeforamerica/michigan-benefits,codeforamerica/michigan-benefits,codeforamerica/michigan-benefits | ruby | ## Code Before:
require "rails_helper"
RSpec.describe Medicaid::SignAndSubmitController do
describe "#next_path" do
it "is the insurance current path" do
expect(subject.next_path).to eq(
"/steps/medicaid/confirmation",
)
end
end
describe "#update" do
it "updates the signature" do
medicaid_application = create(
:medicaid_application,
signature: "Hans Solo",
)
session[:medicaid_application_id] = medicaid_application.id
expect do
put :update, params: { step: { signature: "Chiu Baka" } }
end.to change {
medicaid_application.reload.signature
}.from("Hans Solo").to("Chiu Baka")
expect(medicaid_application.signed_at).not_to be nil
end
end
end
## Instruction:
Add explicit nil in test setup when checking attribute change
## Code After:
require "rails_helper"
RSpec.describe Medicaid::SignAndSubmitController do
describe "#next_path" do
it "is the insurance current path" do
expect(subject.next_path).to eq(
"/steps/medicaid/confirmation",
)
end
end
describe "#update" do
it "updates the signature" do
medicaid_application = create(
:medicaid_application,
signature: "Hans Solo",
signed_at: nil,
)
session[:medicaid_application_id] = medicaid_application.id
expect do
put :update, params: { step: { signature: "Chiu Baka" } }
end.to change {
medicaid_application.reload.signature
}.from("Hans Solo").to("Chiu Baka")
expect(medicaid_application.signed_at).not_to be nil
end
end
end
| require "rails_helper"
RSpec.describe Medicaid::SignAndSubmitController do
describe "#next_path" do
it "is the insurance current path" do
expect(subject.next_path).to eq(
"/steps/medicaid/confirmation",
)
end
end
describe "#update" do
it "updates the signature" do
medicaid_application = create(
:medicaid_application,
signature: "Hans Solo",
+ signed_at: nil,
)
session[:medicaid_application_id] = medicaid_application.id
expect do
put :update, params: { step: { signature: "Chiu Baka" } }
end.to change {
medicaid_application.reload.signature
}.from("Hans Solo").to("Chiu Baka")
expect(medicaid_application.signed_at).not_to be nil
end
end
end | 1 | 0.034483 | 1 | 0 |
ec2458d246b0c329fa5d50ac00c5b9bd07c5c283 | README.md | README.md | **Set up users and services in this application**
Users / people:
To create a user (also creates a person) run:
```
scripts/create-user.sh
```
Registering a service:
```
scripts/register-service-sh
```
**Deploy to heroku**
Make sure you have [installed the heroku toolbelt](https://toolbelt.heroku.com/)
*Note if you add anthing to environment.sh or environment_private.sh then add those config items to the heroku app as well*
For example
```
heroku config:set SETTINGS='config.Config'
```
If you make changes, push to github first and then push to heroku master
To set up heroku master as a remote :
```
heroku git:remote -a registry-gov
```
The you can:
```
git push heroku master
```
But again, please make sure your changes are in github master first. Then all will be synced up nicely
**Setup users and register services in heroku**
```
heroku run python manage.py register-service --app registry-gov
```
```
heroku run python manage.py create-user --app registry-gov
```
| **Set up users and services in this application**
Users / people:
To create a user (also creates a person) run:
```
scripts/create-user.sh
```
Registering a service:
```
scripts/register-service-sh
```
**Deploy to heroku**
Make sure you have [installed the heroku toolbelt](https://toolbelt.heroku.com/)
*Note if you add anthing to environment.sh or environment_private.sh then add those config items to the heroku app as well*
For example
```
heroku config:set SETTINGS='config.Config'
```
If you make changes, push to github first and then push to heroku master
To set up heroku master as a remote :
```
heroku git:remote -a registry-gov
```
The you can:
```
git push heroku master
```
But again, please make sure your changes are in github master first. Then all will be synced up nicely
**Setup users and register services in heroku**
Register a service:
```
heroku run python manage.py register-service --app registry-gov
```
For the moment when running this in heroku, when you are asked for the OAuth redirect URI, use http not https. e.g.
```
OAuth redirect URI: http://organisations-gov.herokuapp.com/verified
```
Create a user:
```
heroku run python manage.py create-user --app registry-gov
```
| Add clarification for registering services in heroku | Add clarification for registering services in heroku
| Markdown | mit | sausages-of-the-future/registry,sausages-of-the-future/registry,sausages-of-the-future/registry,sausages-of-the-future/registry | markdown | ## Code Before:
**Set up users and services in this application**
Users / people:
To create a user (also creates a person) run:
```
scripts/create-user.sh
```
Registering a service:
```
scripts/register-service-sh
```
**Deploy to heroku**
Make sure you have [installed the heroku toolbelt](https://toolbelt.heroku.com/)
*Note if you add anthing to environment.sh or environment_private.sh then add those config items to the heroku app as well*
For example
```
heroku config:set SETTINGS='config.Config'
```
If you make changes, push to github first and then push to heroku master
To set up heroku master as a remote :
```
heroku git:remote -a registry-gov
```
The you can:
```
git push heroku master
```
But again, please make sure your changes are in github master first. Then all will be synced up nicely
**Setup users and register services in heroku**
```
heroku run python manage.py register-service --app registry-gov
```
```
heroku run python manage.py create-user --app registry-gov
```
## Instruction:
Add clarification for registering services in heroku
## Code After:
**Set up users and services in this application**
Users / people:
To create a user (also creates a person) run:
```
scripts/create-user.sh
```
Registering a service:
```
scripts/register-service-sh
```
**Deploy to heroku**
Make sure you have [installed the heroku toolbelt](https://toolbelt.heroku.com/)
*Note if you add anthing to environment.sh or environment_private.sh then add those config items to the heroku app as well*
For example
```
heroku config:set SETTINGS='config.Config'
```
If you make changes, push to github first and then push to heroku master
To set up heroku master as a remote :
```
heroku git:remote -a registry-gov
```
The you can:
```
git push heroku master
```
But again, please make sure your changes are in github master first. Then all will be synced up nicely
**Setup users and register services in heroku**
Register a service:
```
heroku run python manage.py register-service --app registry-gov
```
For the moment when running this in heroku, when you are asked for the OAuth redirect URI, use http not https. e.g.
```
OAuth redirect URI: http://organisations-gov.herokuapp.com/verified
```
Create a user:
```
heroku run python manage.py create-user --app registry-gov
```
| **Set up users and services in this application**
Users / people:
To create a user (also creates a person) run:
```
scripts/create-user.sh
```
Registering a service:
```
scripts/register-service-sh
```
**Deploy to heroku**
Make sure you have [installed the heroku toolbelt](https://toolbelt.heroku.com/)
*Note if you add anthing to environment.sh or environment_private.sh then add those config items to the heroku app as well*
For example
```
heroku config:set SETTINGS='config.Config'
```
If you make changes, push to github first and then push to heroku master
To set up heroku master as a remote :
```
heroku git:remote -a registry-gov
```
The you can:
```
git push heroku master
```
But again, please make sure your changes are in github master first. Then all will be synced up nicely
**Setup users and register services in heroku**
+
+ Register a service:
```
heroku run python manage.py register-service --app registry-gov
```
+ For the moment when running this in heroku, when you are asked for the OAuth redirect URI, use http not https. e.g.
+
+ ```
+ OAuth redirect URI: http://organisations-gov.herokuapp.com/verified
+ ```
+
+ Create a user:
```
heroku run python manage.py create-user --app registry-gov
```
| 9 | 0.166667 | 9 | 0 |
f5166a03b1f766c8a5b6cc2c5633d6c50c0b9ddb | spec_helper.rb | spec_helper.rb | remove_file 'spec/spec_helper.rb'
create_file 'spec/spec_helper.rb' do
<<-RUBY
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
require 'rspec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
Rspec.configure do |config|
# Remove this line if you don't want Rspec's should and should_not
# methods or matchers
require 'rspec/expectations'
config.include Rspec::Matchers
config.before(:all) { DataMapper.auto_migrate! }
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
end
RUBY
end
| remove_file 'spec/spec_helper.rb'
create_file 'spec/spec_helper.rb' do
<<-RUBY
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
require 'rspec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
# Work around rspec not yet being ORM agnostic
DataMapper::Resource.module_eval do
def has_attribute?(attribute)
attributes.include?(attribute)
end
end
Rspec.configure do |config|
# Remove this line if you don't want Rspec's should and should_not
# methods or matchers
require 'rspec/expectations'
config.include Rspec::Matchers
config.before(:all) { DataMapper.auto_migrate! }
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
end
RUBY
end
| Work around rspec-2 not yet being ORM agnostic | Work around rspec-2 not yet being ORM agnostic
Thx myabc for pointing this out | Ruby | mit | snusnu/rails-templates | ruby | ## Code Before:
remove_file 'spec/spec_helper.rb'
create_file 'spec/spec_helper.rb' do
<<-RUBY
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
require 'rspec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
Rspec.configure do |config|
# Remove this line if you don't want Rspec's should and should_not
# methods or matchers
require 'rspec/expectations'
config.include Rspec::Matchers
config.before(:all) { DataMapper.auto_migrate! }
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
end
RUBY
end
## Instruction:
Work around rspec-2 not yet being ORM agnostic
Thx myabc for pointing this out
## Code After:
remove_file 'spec/spec_helper.rb'
create_file 'spec/spec_helper.rb' do
<<-RUBY
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
require 'rspec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
# Work around rspec not yet being ORM agnostic
DataMapper::Resource.module_eval do
def has_attribute?(attribute)
attributes.include?(attribute)
end
end
Rspec.configure do |config|
# Remove this line if you don't want Rspec's should and should_not
# methods or matchers
require 'rspec/expectations'
config.include Rspec::Matchers
config.before(:all) { DataMapper.auto_migrate! }
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
end
RUBY
end
| remove_file 'spec/spec_helper.rb'
create_file 'spec/spec_helper.rb' do
<<-RUBY
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
require 'rspec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
+
+ # Work around rspec not yet being ORM agnostic
+ DataMapper::Resource.module_eval do
+ def has_attribute?(attribute)
+ attributes.include?(attribute)
+ end
+ end
Rspec.configure do |config|
# Remove this line if you don't want Rspec's should and should_not
# methods or matchers
require 'rspec/expectations'
config.include Rspec::Matchers
config.before(:all) { DataMapper.auto_migrate! }
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
end
RUBY
end | 7 | 0.205882 | 7 | 0 |
496c8efd4ef521b4f6662f866646251f5e9c33ca | lib/license_finder/decision_applier.rb | lib/license_finder/decision_applier.rb | module LicenseFinder
class DecisionApplier
def initialize(options)
@decisions = options.fetch(:decisions)
@packages = options.fetch(:packages)
end
def unapproved
acknowledged.reject(&:approved?)
end
def acknowledged
base_packages = decisions.packages + packages
base_packages.
reject { |package| ignored?(package) }.
map { |package| with_decided_licenses(package) }.
map { |package| with_approval(package) }
end
private
attr_reader :packages, :decisions
def ignored?(package)
decisions.ignored?(package.name) ||
package.groups.any? { |group| decisions.ignored_group?(group) }
end
def with_decided_licenses(package)
decisions.licenses_of(package.name).each do |license|
package.decide_on_license license
end
package
end
def with_approval(package)
if decisions.approved?(package.name)
package.approved_manually!(decisions.approval_of(package.name))
elsif package.licenses.any? { |license| decisions.whitelisted?(license) }
package.whitelisted!
end
package
end
end
end
| module LicenseFinder
class DecisionApplier
def initialize(options)
@decisions = options.fetch(:decisions)
@system_packages = options.fetch(:packages)
end
def unapproved
acknowledged.reject(&:approved?)
end
def acknowledged
packages.reject { |package| ignored?(package) }
end
private
attr_reader :system_packages, :decisions
def packages
result = decisions.packages + system_packages
result.
map { |package| with_decided_licenses(package) }.
map { |package| with_approval(package) }
end
def ignored?(package)
decisions.ignored?(package.name) ||
package.groups.any? { |group| decisions.ignored_group?(group) }
end
def with_decided_licenses(package)
decisions.licenses_of(package.name).each do |license|
package.decide_on_license license
end
package
end
def with_approval(package)
if decisions.approved?(package.name)
package.approved_manually!(decisions.approval_of(package.name))
elsif package.licenses.any? { |license| decisions.whitelisted?(license) }
package.whitelisted!
end
package
end
end
end
| Clarify that acknowledged means 'not ignored' | Clarify that acknowledged means 'not ignored'
| Ruby | mit | pivotal/LicenseFinder,tinfoil/LicenseFinder,bspeck/LicenseFinder,pivotal/LicenseFinder,LukeWinikates/LicenseFinder,JasonMSwrve/LicenseFinder,bdshroyer/LicenseFinder,phusion/LicenseFinder,sschuberth/LicenseFinder,joemoore/LicenseFinder,SimantovYousoufov/LicenseFinder,pivotal/LicenseFinder,pivotal/LicenseFinder,sschuberth/LicenseFinder,alexderz/LicenseFinder,pivotal/LicenseFinder,joemoore/LicenseFinder,alexderz/LicenseFinder,LukeWinikates/LicenseFinder,phusion/LicenseFinder,SimantovYousoufov/LicenseFinder,tinfoil/LicenseFinder,bspeck/LicenseFinder,chef/LicenseFinder,bdshroyer/LicenseFinder,chef/LicenseFinder,alexderz/LicenseFinder,tinfoil/LicenseFinder,joemoore/LicenseFinder,SimantovYousoufov/LicenseFinder,bspeck/LicenseFinder,sschuberth/LicenseFinder,JasonMSwrve/LicenseFinder,JasonMSwrve/LicenseFinder,phusion/LicenseFinder,phusion/LicenseFinder,chef/LicenseFinder,alexderz/LicenseFinder,LukeWinikates/LicenseFinder,sschuberth/LicenseFinder,bdshroyer/LicenseFinder,SimantovYousoufov/LicenseFinder,pivotal/LicenseFinder,bdshroyer/LicenseFinder,JasonMSwrve/LicenseFinder,SimantovYousoufov/LicenseFinder,joemoore/LicenseFinder,LukeWinikates/LicenseFinder,LukeWinikates/LicenseFinder,tinfoil/LicenseFinder,sschuberth/LicenseFinder,bdshroyer/LicenseFinder,alexderz/LicenseFinder,bspeck/LicenseFinder,pivotal/LicenseFinder,joemoore/LicenseFinder,chef/LicenseFinder,JasonMSwrve/LicenseFinder,bspeck/LicenseFinder,tinfoil/LicenseFinder,phusion/LicenseFinder | ruby | ## Code Before:
module LicenseFinder
class DecisionApplier
def initialize(options)
@decisions = options.fetch(:decisions)
@packages = options.fetch(:packages)
end
def unapproved
acknowledged.reject(&:approved?)
end
def acknowledged
base_packages = decisions.packages + packages
base_packages.
reject { |package| ignored?(package) }.
map { |package| with_decided_licenses(package) }.
map { |package| with_approval(package) }
end
private
attr_reader :packages, :decisions
def ignored?(package)
decisions.ignored?(package.name) ||
package.groups.any? { |group| decisions.ignored_group?(group) }
end
def with_decided_licenses(package)
decisions.licenses_of(package.name).each do |license|
package.decide_on_license license
end
package
end
def with_approval(package)
if decisions.approved?(package.name)
package.approved_manually!(decisions.approval_of(package.name))
elsif package.licenses.any? { |license| decisions.whitelisted?(license) }
package.whitelisted!
end
package
end
end
end
## Instruction:
Clarify that acknowledged means 'not ignored'
## Code After:
module LicenseFinder
class DecisionApplier
def initialize(options)
@decisions = options.fetch(:decisions)
@system_packages = options.fetch(:packages)
end
def unapproved
acknowledged.reject(&:approved?)
end
def acknowledged
packages.reject { |package| ignored?(package) }
end
private
attr_reader :system_packages, :decisions
def packages
result = decisions.packages + system_packages
result.
map { |package| with_decided_licenses(package) }.
map { |package| with_approval(package) }
end
def ignored?(package)
decisions.ignored?(package.name) ||
package.groups.any? { |group| decisions.ignored_group?(group) }
end
def with_decided_licenses(package)
decisions.licenses_of(package.name).each do |license|
package.decide_on_license license
end
package
end
def with_approval(package)
if decisions.approved?(package.name)
package.approved_manually!(decisions.approval_of(package.name))
elsif package.licenses.any? { |license| decisions.whitelisted?(license) }
package.whitelisted!
end
package
end
end
end
| module LicenseFinder
class DecisionApplier
def initialize(options)
@decisions = options.fetch(:decisions)
- @packages = options.fetch(:packages)
+ @system_packages = options.fetch(:packages)
? +++++++
end
def unapproved
acknowledged.reject(&:approved?)
end
def acknowledged
- base_packages = decisions.packages + packages
- base_packages.
- reject { |package| ignored?(package) }.
? ^^ -
+ packages.reject { |package| ignored?(package) }
? ^^^^^^^^^
- map { |package| with_decided_licenses(package) }.
- map { |package| with_approval(package) }
end
private
- attr_reader :packages, :decisions
+ attr_reader :system_packages, :decisions
? +++++++
+
+ def packages
+ result = decisions.packages + system_packages
+ result.
+ map { |package| with_decided_licenses(package) }.
+ map { |package| with_approval(package) }
+ end
def ignored?(package)
decisions.ignored?(package.name) ||
package.groups.any? { |group| decisions.ignored_group?(group) }
end
def with_decided_licenses(package)
decisions.licenses_of(package.name).each do |license|
package.decide_on_license license
end
package
end
def with_approval(package)
if decisions.approved?(package.name)
package.approved_manually!(decisions.approval_of(package.name))
elsif package.licenses.any? { |license| decisions.whitelisted?(license) }
package.whitelisted!
end
package
end
end
end
| 17 | 0.369565 | 10 | 7 |
18c287a9cfba6e06e1e41db5e23f57b58db64980 | command_line/small_molecule.py | command_line/small_molecule.py | import sys
from xia2_main import run
if __name__ == '__main__':
if 'small_molecule=true' not in sys.argv:
sys.argv.insert(1, 'small_molecule=true')
run()
| from __future__ import division
if __name__ == '__main__':
import sys
if 'small_molecule=true' not in sys.argv:
sys.argv.insert(1, 'small_molecule=true')
# clean up command-line so we know what was happening i.e. xia2.small_molecule
# becomes xia2 small_molecule=true (and other things) but without repeating
# itself
import libtbx.load_env
libtbx.env.dispatcher_name = 'xia2'
from xia2_main import run
run()
| Reduce redundancy in corrected command-line; replace dispatcher name with xia2 from xia2.small molecule for print out | Reduce redundancy in corrected command-line; replace dispatcher name with xia2 from xia2.small molecule for print out
| Python | bsd-3-clause | xia2/xia2,xia2/xia2 | python | ## Code Before:
import sys
from xia2_main import run
if __name__ == '__main__':
if 'small_molecule=true' not in sys.argv:
sys.argv.insert(1, 'small_molecule=true')
run()
## Instruction:
Reduce redundancy in corrected command-line; replace dispatcher name with xia2 from xia2.small molecule for print out
## Code After:
from __future__ import division
if __name__ == '__main__':
import sys
if 'small_molecule=true' not in sys.argv:
sys.argv.insert(1, 'small_molecule=true')
# clean up command-line so we know what was happening i.e. xia2.small_molecule
# becomes xia2 small_molecule=true (and other things) but without repeating
# itself
import libtbx.load_env
libtbx.env.dispatcher_name = 'xia2'
from xia2_main import run
run()
| + from __future__ import division
- import sys
- from xia2_main import run
if __name__ == '__main__':
+ import sys
if 'small_molecule=true' not in sys.argv:
sys.argv.insert(1, 'small_molecule=true')
+ # clean up command-line so we know what was happening i.e. xia2.small_molecule
+ # becomes xia2 small_molecule=true (and other things) but without repeating
+ # itself
+ import libtbx.load_env
+ libtbx.env.dispatcher_name = 'xia2'
+ from xia2_main import run
run() | 10 | 1.428571 | 8 | 2 |
4713bf60d020d81772e91b63952b8036908b04e0 | A2DynamicDelegate.podspec | A2DynamicDelegate.podspec | Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '2.0'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v2.0' }
s.dependency 'libffi'
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}', 'A2BlockClosure.{h,m}', 'blockimp/*.{h,m,s}', 'libffi/*.h'
s.clean_paths = 'Demo/', 'A2DynamicDelegate.xcodeproj/', '.gitignore', 'libffi/'
end
| Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '2.0'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v2.0' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}', 'A2BlockClosure.{h,m}', 'blockimp/*.{h,m,s}', 'libffi/*.h'
s.clean_paths = 'Demo/', 'A2DynamicDelegate.xcodeproj/', '.gitignore'
s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => "$(SRCROOT)/Pods/A2DynamicDelegate/libffi/",
'HEADER_SEARCH_PATHS' => "$(SRCROOT)/Pods/A2DynamicDelegate/libffi/",
'OTHER_LDFLAGS' => "-Wl,-no_compact_unwind" }
if config.ios?
s.library = 'ffi_ios'
else
s.library = 'ffi_mac'
end
end
| Revert part of "Project and pod spec updates." | Revert part of "Project and pod spec updates."
This reverts part of commit a8076d266a475bf9a12616b3395249eb408398f8.
Signed-off-by: Zachary Waldowski <f6cb034ae1bf314d2c0261a7a22e4684d1f74b57@gmail.com>
| Ruby | mit | aipeople/BlocksKit,hq804116393/BlocksKit,pilot34/BlocksKit,HarrisLee/BlocksKit,z8927623/BlocksKit,shenhzou654321/BlocksKit,zwaldowski/BlocksKit,ManagerOrganization/BlocksKit,xinlehou/BlocksKit,anton-matosov/BlocksKit,demonnico/BlocksKit,zxq3220122/BlocksKit-1,stevenxiaoyang/BlocksKit,yaoxiaoyong/BlocksKit,AlexanderMazaletskiy/BlocksKit,Gitub/BlocksKit,coneman/BlocksKit,hartbit/BlocksKit,dachaoisme/BlocksKit,Voxer/BlocksKit,zhaoguohui/BlocksKit,Herbert77/BlocksKit,owers19856/BlocksKit,TomBin647/BlocksKit,pomu0325/BlocksKit,tattocau/BlocksKit,yimouleng/BlocksKit | ruby | ## Code Before:
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '2.0'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v2.0' }
s.dependency 'libffi'
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}', 'A2BlockClosure.{h,m}', 'blockimp/*.{h,m,s}', 'libffi/*.h'
s.clean_paths = 'Demo/', 'A2DynamicDelegate.xcodeproj/', '.gitignore', 'libffi/'
end
## Instruction:
Revert part of "Project and pod spec updates."
This reverts part of commit a8076d266a475bf9a12616b3395249eb408398f8.
Signed-off-by: Zachary Waldowski <f6cb034ae1bf314d2c0261a7a22e4684d1f74b57@gmail.com>
## Code After:
Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '2.0'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v2.0' }
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}', 'A2BlockClosure.{h,m}', 'blockimp/*.{h,m,s}', 'libffi/*.h'
s.clean_paths = 'Demo/', 'A2DynamicDelegate.xcodeproj/', '.gitignore'
s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => "$(SRCROOT)/Pods/A2DynamicDelegate/libffi/",
'HEADER_SEARCH_PATHS' => "$(SRCROOT)/Pods/A2DynamicDelegate/libffi/",
'OTHER_LDFLAGS' => "-Wl,-no_compact_unwind" }
if config.ios?
s.library = 'ffi_ios'
else
s.library = 'ffi_mac'
end
end
| Pod::Spec.new do |s|
s.name = 'A2DynamicDelegate'
s.version = '2.0'
s.license = 'BSD'
s.summary = 'Blocks are to functions as A2DynamicDelegate is to delegates.'
s.homepage = 'https://github.com/pandamonia/A2DynamicDelegate'
s.author = { 'Alexsander Akers' => 'a2@pandamonia.us',
'Zachary Waldowski' => 'zwaldowski@gmail.com' }
s.source = { :git => 'https://github.com/pandamonia/A2DynamicDelegate.git', :tag => 'v2.0' }
- s.dependency 'libffi'
s.source_files = 'A2DynamicDelegate.{h,m}', 'A2BlockDelegate.{h,m}', 'A2BlockClosure.{h,m}', 'blockimp/*.{h,m,s}', 'libffi/*.h'
- s.clean_paths = 'Demo/', 'A2DynamicDelegate.xcodeproj/', '.gitignore', 'libffi/'
? -----------
+ s.clean_paths = 'Demo/', 'A2DynamicDelegate.xcodeproj/', '.gitignore'
+ s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => "$(SRCROOT)/Pods/A2DynamicDelegate/libffi/",
+ 'HEADER_SEARCH_PATHS' => "$(SRCROOT)/Pods/A2DynamicDelegate/libffi/",
+ 'OTHER_LDFLAGS' => "-Wl,-no_compact_unwind" }
+ if config.ios?
+ s.library = 'ffi_ios'
+ else
+ s.library = 'ffi_mac'
+ end
end | 11 | 0.846154 | 9 | 2 |
270a6c08eb8ad7f07304cd1244b40617644c6b1c | lib/paperclip-meta.rb | lib/paperclip-meta.rb | require "paperclip"
require "paperclip-meta/version"
require 'paperclip-meta/railtie'
require 'paperclip-meta/attachment' | require 'paperclip-meta/version'
require 'paperclip-meta/railtie'
require 'paperclip-meta/attachment'
| Remove paperclip require; gem does that | Remove paperclip require; gem does that
| Ruby | mit | fishbrain/paperclip-meta,Envek/paperclip-meta,teeparham/paperclip-meta | ruby | ## Code Before:
require "paperclip"
require "paperclip-meta/version"
require 'paperclip-meta/railtie'
require 'paperclip-meta/attachment'
## Instruction:
Remove paperclip require; gem does that
## Code After:
require 'paperclip-meta/version'
require 'paperclip-meta/railtie'
require 'paperclip-meta/attachment'
| - require "paperclip"
- require "paperclip-meta/version"
? ^ ^
+ require 'paperclip-meta/version'
? ^ ^
require 'paperclip-meta/railtie'
require 'paperclip-meta/attachment' | 3 | 0.75 | 1 | 2 |
52d98437190a6c9869dd70ea621940e9c2adf4c1 | app/views/devise/registrations/edit.html.erb | app/views/devise/registrations/edit.html.erb | <h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= simple_form_for(resource, as: resource_name, url: user_registration_path(resource), html: { method: :patch }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>
<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Update" %>
</div>
<% end %>
| <h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= simple_form_for(resource, as: resource_name, url: user_registration_path, html: { method: :put }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>
<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Update" %>
</div>
<% end %>
| Fix user password reset form | Fix user password reset form
| HTML+ERB | agpl-3.0 | osucomm/mediamagnet,osucomm/mediamagnet | html+erb | ## Code Before:
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= simple_form_for(resource, as: resource_name, url: user_registration_path(resource), html: { method: :patch }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>
<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Update" %>
</div>
<% end %>
## Instruction:
Fix user password reset form
## Code After:
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= simple_form_for(resource, as: resource_name, url: user_registration_path, html: { method: :put }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>
<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Update" %>
</div>
<% end %>
| <h2>Edit <%= resource_name.to_s.humanize %></h2>
- <%= simple_form_for(resource, as: resource_name, url: user_registration_path(resource), html: { method: :patch }) do |f| %>
? ---------- ^ --
+ <%= simple_form_for(resource, as: resource_name, url: user_registration_path, html: { method: :put }) do |f| %>
? ^
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>
<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Update" %>
</div>
<% end %> | 2 | 0.095238 | 1 | 1 |
3d917d678751cbfbc617aa98a51ec47d4c01dabe | packages/to/tokenizer-monad.yaml | packages/to/tokenizer-monad.yaml | homepage: ''
changelog-type: markdown
hash: 2245f6a5ce242a93353fcf0afed34399e31f6ce496ac5a08cdd682ad288ccb8d
test-bench-deps: {}
maintainer: darcs@m.doomanddarkness.eu
synopsis: An efficient and easy-to-use tokenizer monad.
changelog: ! '# Revision history for tokenizer-monad
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.10'
text: ! '>=1.2 && <1.3'
all-versions:
- 0.1.0.0
author: Marvin Cohrs
latest: 0.1.0.0
description-type: haddock
description: This monad can be used for writing efficient and readable tokenizers.
license-name: GPL-3.0-only
| homepage: ''
changelog-type: markdown
hash: ddd2b604e5b6c79033d49191c8abbd1eb44849ba2b29752a6af6e61ea402142a
test-bench-deps: {}
maintainer: darcs@m.doomanddarkness.eu
synopsis: An efficient and easy-to-use tokenizer monad.
changelog: ! '# Revision history for tokenizer-monad
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.11'
text: ! '>=1.2'
all-versions:
- 0.1.0.0
author: Enum Cohrs
latest: 0.1.0.0
description-type: haddock
description: This monad can be used for writing efficient and readable tokenizers.
license-name: GPL-3.0-only
| Update from Hackage at 2018-12-23T19:22:52Z | Update from Hackage at 2018-12-23T19:22:52Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: markdown
hash: 2245f6a5ce242a93353fcf0afed34399e31f6ce496ac5a08cdd682ad288ccb8d
test-bench-deps: {}
maintainer: darcs@m.doomanddarkness.eu
synopsis: An efficient and easy-to-use tokenizer monad.
changelog: ! '# Revision history for tokenizer-monad
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.10'
text: ! '>=1.2 && <1.3'
all-versions:
- 0.1.0.0
author: Marvin Cohrs
latest: 0.1.0.0
description-type: haddock
description: This monad can be used for writing efficient and readable tokenizers.
license-name: GPL-3.0-only
## Instruction:
Update from Hackage at 2018-12-23T19:22:52Z
## Code After:
homepage: ''
changelog-type: markdown
hash: ddd2b604e5b6c79033d49191c8abbd1eb44849ba2b29752a6af6e61ea402142a
test-bench-deps: {}
maintainer: darcs@m.doomanddarkness.eu
synopsis: An efficient and easy-to-use tokenizer monad.
changelog: ! '# Revision history for tokenizer-monad
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.11'
text: ! '>=1.2'
all-versions:
- 0.1.0.0
author: Enum Cohrs
latest: 0.1.0.0
description-type: haddock
description: This monad can be used for writing efficient and readable tokenizers.
license-name: GPL-3.0-only
| homepage: ''
changelog-type: markdown
- hash: 2245f6a5ce242a93353fcf0afed34399e31f6ce496ac5a08cdd682ad288ccb8d
+ hash: ddd2b604e5b6c79033d49191c8abbd1eb44849ba2b29752a6af6e61ea402142a
test-bench-deps: {}
maintainer: darcs@m.doomanddarkness.eu
synopsis: An efficient and easy-to-use tokenizer monad.
changelog: ! '# Revision history for tokenizer-monad
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
- base: ! '>=4.9 && <4.10'
? ^
+ base: ! '>=4.9 && <4.11'
? ^
- text: ! '>=1.2 && <1.3'
? --------
+ text: ! '>=1.2'
all-versions:
- 0.1.0.0
- author: Marvin Cohrs
? ^^^^^
+ author: Enum Cohrs
? ^ ++
latest: 0.1.0.0
description-type: haddock
description: This monad can be used for writing efficient and readable tokenizers.
license-name: GPL-3.0-only | 8 | 0.32 | 4 | 4 |
90dd79817f6a7e0e014dee4039362aad25054489 | resources/views/errors/generic.blade.php | resources/views/errors/generic.blade.php | @extends('layouts/app')
@section('title')
Error | {{ config('app.name') }}
@endsection
@section('content')
@component('layouts/title')
Whoops!
@endcomponent
<div class="row">
<div class="col-md-12">
Something went wrong. Please try your request again later. If you continue to receive this error,
please contact #it-helpdesk on <a href="https://robojackets.slack.com">Slack</a>.
</div>
</div>
<hr>
<div class="row">
<div class="col-md-4">
<h4>Error Details:</h4>
</div>
</div>
<div class="row">
<div class="col-md-3">
<b>Code:</b> {{ $error_code }}
</div>
<div class="col-md-6">
<b>Message:</b> {{ $error_message }}
</div>
</div>
<div class="row">
<div class="col-md-3">
<b>User:</b> {{ cas()->user() }}
</div>
<div class="col-md-3">
<b>Time:</b> {{ time() }}
</div>
</div>
@endsection | @extends('layouts/app')
@section('title')
Error | {{ config('app.name') }}
@endsection
@section('content')
@component('layouts/title')
Whoops!
@endcomponent
<div class="row">
<div class="col-md-12">
Something went wrong. Please try your request again later. If you continue to receive this error,
please contact #it-helpdesk on <a href="https://robojackets.slack.com">Slack</a>.
</div>
</div>
<hr>
<div class="row">
<div class="col-md-4">
<h4>Error Details:</h4>
</div>
</div>
<div class="row">
<div class="col-md-3">
<b>Code:</b> {{ $error_code }}
</div>
<div class="col-md-6">
<b>Message:</b> {{ $error_message }}
</div>
</div>
<div class="row">
@if(cas()->checkAuthentication())
<div class="col-md-3">
<b>User:</b> {{ cas()->user() }}
</div>
@endif
<div class="col-md-3">
<b>Time:</b> {{ time() }}
</div>
</div>
@endsection | Add CAS user checking to prevent less-than-useful generic error from phpCAS | Add CAS user checking to prevent less-than-useful generic error from phpCAS
| PHP | apache-2.0 | RoboJackets/apiary,RoboJackets/apiary | php | ## Code Before:
@extends('layouts/app')
@section('title')
Error | {{ config('app.name') }}
@endsection
@section('content')
@component('layouts/title')
Whoops!
@endcomponent
<div class="row">
<div class="col-md-12">
Something went wrong. Please try your request again later. If you continue to receive this error,
please contact #it-helpdesk on <a href="https://robojackets.slack.com">Slack</a>.
</div>
</div>
<hr>
<div class="row">
<div class="col-md-4">
<h4>Error Details:</h4>
</div>
</div>
<div class="row">
<div class="col-md-3">
<b>Code:</b> {{ $error_code }}
</div>
<div class="col-md-6">
<b>Message:</b> {{ $error_message }}
</div>
</div>
<div class="row">
<div class="col-md-3">
<b>User:</b> {{ cas()->user() }}
</div>
<div class="col-md-3">
<b>Time:</b> {{ time() }}
</div>
</div>
@endsection
## Instruction:
Add CAS user checking to prevent less-than-useful generic error from phpCAS
## Code After:
@extends('layouts/app')
@section('title')
Error | {{ config('app.name') }}
@endsection
@section('content')
@component('layouts/title')
Whoops!
@endcomponent
<div class="row">
<div class="col-md-12">
Something went wrong. Please try your request again later. If you continue to receive this error,
please contact #it-helpdesk on <a href="https://robojackets.slack.com">Slack</a>.
</div>
</div>
<hr>
<div class="row">
<div class="col-md-4">
<h4>Error Details:</h4>
</div>
</div>
<div class="row">
<div class="col-md-3">
<b>Code:</b> {{ $error_code }}
</div>
<div class="col-md-6">
<b>Message:</b> {{ $error_message }}
</div>
</div>
<div class="row">
@if(cas()->checkAuthentication())
<div class="col-md-3">
<b>User:</b> {{ cas()->user() }}
</div>
@endif
<div class="col-md-3">
<b>Time:</b> {{ time() }}
</div>
</div>
@endsection | @extends('layouts/app')
@section('title')
Error | {{ config('app.name') }}
@endsection
@section('content')
@component('layouts/title')
Whoops!
@endcomponent
<div class="row">
<div class="col-md-12">
Something went wrong. Please try your request again later. If you continue to receive this error,
please contact #it-helpdesk on <a href="https://robojackets.slack.com">Slack</a>.
</div>
</div>
<hr>
<div class="row">
<div class="col-md-4">
<h4>Error Details:</h4>
</div>
</div>
<div class="row">
<div class="col-md-3">
<b>Code:</b> {{ $error_code }}
</div>
<div class="col-md-6">
<b>Message:</b> {{ $error_message }}
</div>
</div>
<div class="row">
+ @if(cas()->checkAuthentication())
<div class="col-md-3">
<b>User:</b> {{ cas()->user() }}
</div>
+ @endif
<div class="col-md-3">
<b>Time:</b> {{ time() }}
</div>
</div>
@endsection | 2 | 0.045455 | 2 | 0 |
a18c67a349eb24dd0ff2df06edcb5b20ac85df0f | src/stopwords.coffee | src/stopwords.coffee | path = require('path')
fs = require('fs')
_ = require('lodash')
cache = {}
# Given a language, loads a list of stop words for that language
# and then returns which of those words exist in the given content
module.exports = stopwords = (content, language = 'en') ->
filePath = path.join(__dirname, "..", "data", "stopwords", "stopwords-#{language}.txt")
if cache.hasOwnProperty(language)
stopWords = cache[language]
else
stopWords = fs.readFileSync(filePath).toString().split('\n')
cache[language] = stopWords
strippedInput = removePunctuation(content)
words = candiateWords(strippedInput)
overlappingStopwords = []
count = 0
_.each words, (w) ->
count += 1
if stopWords.indexOf(w.toLowerCase()) > -1
overlappingStopwords.push(w.toLowerCase())
{
wordCount: count,
stopwordCount: overlappingStopwords.length,
stopWords: overlappingStopwords
}
removePunctuation = (content) ->
content.replace(/[\|\@\<\>\[\]\"\'\.,-\/#\?!$%\^&\*\+;:{}=\-_`~()]/g,"")
candiateWords = (strippedInput) ->
strippedInput.split(' ')
| path = require('path')
fs = require('fs')
_ = require('lodash')
cache = {}
getFilePath = (language) ->
path.join(__dirname, "..", "data", "stopwords", "stopwords-#{language}.txt")
# Given a language, loads a list of stop words for that language
# and then returns which of those words exist in the given content
module.exports = stopwords = (content, language = 'en') ->
filePath = getFilePath(language)
if !fs.existsSync(filePath)
filePath = getFilePath('en')
if cache.hasOwnProperty(language)
stopWords = cache[language]
else
stopWords = fs.readFileSync(filePath).toString().split('\n')
cache[language] = stopWords
strippedInput = removePunctuation(content)
words = candiateWords(strippedInput)
overlappingStopwords = []
count = 0
_.each words, (w) ->
count += 1
if stopWords.indexOf(w.toLowerCase()) > -1
overlappingStopwords.push(w.toLowerCase())
{
wordCount: count,
stopwordCount: overlappingStopwords.length,
stopWords: overlappingStopwords
}
removePunctuation = (content) ->
content.replace(/[\|\@\<\>\[\]\"\'\.,-\/#\?!$%\^&\*\+;:{}=\-_`~()]/g,"")
candiateWords = (strippedInput) ->
strippedInput.split(' ')
| Handle case where stopword file !exists | Handle case where stopword file !exists
Hit an error where unfluff tried to read a file that didn't exist; now the code should default to English. Would welcome a cleaner approach. | CoffeeScript | apache-2.0 | ahmadassaf/Node-Goose,pat-riley/node-unfluff,ageitgey/node-unfluff,jeffj/node-unfluff,ageitgey/node-unfluff,ahmadassaf/Node-Goose,jeffj/node-unfluff | coffeescript | ## Code Before:
path = require('path')
fs = require('fs')
_ = require('lodash')
cache = {}
# Given a language, loads a list of stop words for that language
# and then returns which of those words exist in the given content
module.exports = stopwords = (content, language = 'en') ->
filePath = path.join(__dirname, "..", "data", "stopwords", "stopwords-#{language}.txt")
if cache.hasOwnProperty(language)
stopWords = cache[language]
else
stopWords = fs.readFileSync(filePath).toString().split('\n')
cache[language] = stopWords
strippedInput = removePunctuation(content)
words = candiateWords(strippedInput)
overlappingStopwords = []
count = 0
_.each words, (w) ->
count += 1
if stopWords.indexOf(w.toLowerCase()) > -1
overlappingStopwords.push(w.toLowerCase())
{
wordCount: count,
stopwordCount: overlappingStopwords.length,
stopWords: overlappingStopwords
}
removePunctuation = (content) ->
content.replace(/[\|\@\<\>\[\]\"\'\.,-\/#\?!$%\^&\*\+;:{}=\-_`~()]/g,"")
candiateWords = (strippedInput) ->
strippedInput.split(' ')
## Instruction:
Handle case where stopword file !exists
Hit an error where unfluff tried to read a file that didn't exist; now the code should default to English. Would welcome a cleaner approach.
## Code After:
path = require('path')
fs = require('fs')
_ = require('lodash')
cache = {}
getFilePath = (language) ->
path.join(__dirname, "..", "data", "stopwords", "stopwords-#{language}.txt")
# Given a language, loads a list of stop words for that language
# and then returns which of those words exist in the given content
module.exports = stopwords = (content, language = 'en') ->
filePath = getFilePath(language)
if !fs.existsSync(filePath)
filePath = getFilePath('en')
if cache.hasOwnProperty(language)
stopWords = cache[language]
else
stopWords = fs.readFileSync(filePath).toString().split('\n')
cache[language] = stopWords
strippedInput = removePunctuation(content)
words = candiateWords(strippedInput)
overlappingStopwords = []
count = 0
_.each words, (w) ->
count += 1
if stopWords.indexOf(w.toLowerCase()) > -1
overlappingStopwords.push(w.toLowerCase())
{
wordCount: count,
stopwordCount: overlappingStopwords.length,
stopWords: overlappingStopwords
}
removePunctuation = (content) ->
content.replace(/[\|\@\<\>\[\]\"\'\.,-\/#\?!$%\^&\*\+;:{}=\-_`~()]/g,"")
candiateWords = (strippedInput) ->
strippedInput.split(' ')
| path = require('path')
fs = require('fs')
_ = require('lodash')
cache = {}
+ getFilePath = (language) ->
+ path.join(__dirname, "..", "data", "stopwords", "stopwords-#{language}.txt")
+
# Given a language, loads a list of stop words for that language
# and then returns which of those words exist in the given content
module.exports = stopwords = (content, language = 'en') ->
- filePath = path.join(__dirname, "..", "data", "stopwords", "stopwords-#{language}.txt")
-
+ filePath = getFilePath(language)
+
+ if !fs.existsSync(filePath)
+ filePath = getFilePath('en')
+
if cache.hasOwnProperty(language)
stopWords = cache[language]
else
stopWords = fs.readFileSync(filePath).toString().split('\n')
cache[language] = stopWords
strippedInput = removePunctuation(content)
words = candiateWords(strippedInput)
overlappingStopwords = []
count = 0
_.each words, (w) ->
count += 1
if stopWords.indexOf(w.toLowerCase()) > -1
overlappingStopwords.push(w.toLowerCase())
{
wordCount: count,
stopwordCount: overlappingStopwords.length,
stopWords: overlappingStopwords
}
removePunctuation = (content) ->
content.replace(/[\|\@\<\>\[\]\"\'\.,-\/#\?!$%\^&\*\+;:{}=\-_`~()]/g,"")
candiateWords = (strippedInput) ->
strippedInput.split(' ') | 10 | 0.25641 | 8 | 2 |
2eb42f93c0586d1b1a274ad3c90010397cbdba2b | lib/spree_redirects/redirect_middleware.rb | lib/spree_redirects/redirect_middleware.rb | module SpreeRedirects
class RedirectMiddleware
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
path = [ env["PATH_INFO"], env["QUERY_STRING"] ].join("?").sub(/[\/\?\s]*$/, "").strip
if status == 404 && url = find_redirect(path)
# Issue a "Moved permanently" response with the redirect location
[ 301, { "Location" => url }, [ "Redirecting..." ] ]
else
# Not a 404 or no redirect found, just send the response as is
[ status, headers, body ]
end
end
def find_redirect(url)
redirect = Spree::Redirect.find_by_old_url(url)
redirect.new_url unless redirect.nil?
end
end
end
| module SpreeRedirects
class RedirectMiddleware
def initialize(app)
@app = app
end
def call(env)
begin
# when consider_all_requests_local is false, an exception is raised for 404
status, headers, body = @app.call(env)
rescue ActionController::RoutingError => e
routing_error = e
end
if (routing_error.present? or status == 404)
path = [ env["PATH_INFO"], env["QUERY_STRING"] ].join("?").sub(/[\/\?\s]*$/, "").strip
if url = find_redirect(path)
# Issue a "Moved permanently" response with the redirect location
return [ 301, { "Location" => url }, [ "Redirecting..." ] ]
end
else
raise routing_error unless Rails.configuration.consider_all_requests_local
end
[ status, headers, body ]
end
def find_redirect(url)
redirect = Spree::Redirect.find_by_old_url(url)
redirect.new_url unless redirect.nil?
end
end
end
| Fix for redirects on production (consider_all_requests_local = false) | Fix for redirects on production (consider_all_requests_local = false)
| Ruby | bsd-3-clause | urbanladder/spree_redirects,ReserveBar1/spree_redirects,ramkumar-kr/spree_redirects,ramkumar-kr/spree_redirects,quentinuys/spree_redirects,quentinuys/spree_redirects,resolve/spree_redirects,urbanladder/spree_redirects,urbanladder/spree_redirects,ReserveBar1/spree_redirects,citrus/spree_redirects,citrus/spree_redirects,ramkumar-kr/spree_redirects,locomotivapro/spree_redirects,cgservices/spree_redirects,cgservices/spree_redirects,locomotivapro/spree_redirects,locomotivapro/spree_redirects | ruby | ## Code Before:
module SpreeRedirects
class RedirectMiddleware
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
path = [ env["PATH_INFO"], env["QUERY_STRING"] ].join("?").sub(/[\/\?\s]*$/, "").strip
if status == 404 && url = find_redirect(path)
# Issue a "Moved permanently" response with the redirect location
[ 301, { "Location" => url }, [ "Redirecting..." ] ]
else
# Not a 404 or no redirect found, just send the response as is
[ status, headers, body ]
end
end
def find_redirect(url)
redirect = Spree::Redirect.find_by_old_url(url)
redirect.new_url unless redirect.nil?
end
end
end
## Instruction:
Fix for redirects on production (consider_all_requests_local = false)
## Code After:
module SpreeRedirects
class RedirectMiddleware
def initialize(app)
@app = app
end
def call(env)
begin
# when consider_all_requests_local is false, an exception is raised for 404
status, headers, body = @app.call(env)
rescue ActionController::RoutingError => e
routing_error = e
end
if (routing_error.present? or status == 404)
path = [ env["PATH_INFO"], env["QUERY_STRING"] ].join("?").sub(/[\/\?\s]*$/, "").strip
if url = find_redirect(path)
# Issue a "Moved permanently" response with the redirect location
return [ 301, { "Location" => url }, [ "Redirecting..." ] ]
end
else
raise routing_error unless Rails.configuration.consider_all_requests_local
end
[ status, headers, body ]
end
def find_redirect(url)
redirect = Spree::Redirect.find_by_old_url(url)
redirect.new_url unless redirect.nil?
end
end
end
| module SpreeRedirects
class RedirectMiddleware
def initialize(app)
@app = app
end
def call(env)
+ begin
+ # when consider_all_requests_local is false, an exception is raised for 404
- status, headers, body = @app.call(env)
+ status, headers, body = @app.call(env)
? ++
+ rescue ActionController::RoutingError => e
+ routing_error = e
+ end
+
+ if (routing_error.present? or status == 404)
- path = [ env["PATH_INFO"], env["QUERY_STRING"] ].join("?").sub(/[\/\?\s]*$/, "").strip
+ path = [ env["PATH_INFO"], env["QUERY_STRING"] ].join("?").sub(/[\/\?\s]*$/, "").strip
? ++
+
- if status == 404 && url = find_redirect(path)
? -----------------
+ if url = find_redirect(path)
? ++
- # Issue a "Moved permanently" response with the redirect location
+ # Issue a "Moved permanently" response with the redirect location
? ++
- [ 301, { "Location" => url }, [ "Redirecting..." ] ]
+ return [ 301, { "Location" => url }, [ "Redirecting..." ] ]
? +++++++++
+ end
else
+ raise routing_error unless Rails.configuration.consider_all_requests_local
- # Not a 404 or no redirect found, just send the response as is
- [ status, headers, body ]
end
+
+ [ status, headers, body ]
end
def find_redirect(url)
redirect = Spree::Redirect.find_by_old_url(url)
redirect.new_url unless redirect.nil?
end
end
end | 24 | 0.923077 | 17 | 7 |
6acc1f3f0949c9ad4c3e3cb6f4ce7798083ed307 | tests/run_unit_tests.sh | tests/run_unit_tests.sh |
MINCOVERAGE=93
coverage erase || exit 1
for i in unit/test_*py ; do PYTHONPATH=.. coverage run -a --source ../faucet $i || exit 1 ; done
coverage report -m --fail-under=$MINCOVERAGE || exit 1
|
MINCOVERAGE=93
coverage erase || exit 1
for i in unit/test_*py integration/experimental_api_test_app.py; do PYTHONPATH=.. coverage run -a --source ../faucet $i || exit 1 ; done
coverage report -m --fail-under=$MINCOVERAGE || exit 1
| Add experimental API test app back to unit tests. | Add experimental API test app back to unit tests.
Also restores fail-under=$MINCOVERAGE
integration/experimental_api_test_app.py is used in the integration
tests, but previously it was being run as a unit test as well.
Moving it into integration/ removed it from the unit tests and
reduced coverage slightly.
The test appears to be mostly a no-op at this point, but invoking
it from run_unit_tests.sh should reduce the coverage drop (though
there still seems to be a drop on test_vlan.py?)
| Shell | apache-2.0 | anarkiwi/faucet,shivarammysore/faucet,anarkiwi/faucet,gizmoguy/faucet,gizmoguy/faucet,trentindav/faucet,trentindav/faucet,faucetsdn/faucet,mwutzke/faucet,shivarammysore/faucet,REANNZ/faucet,mwutzke/faucet,faucetsdn/faucet,trungdtbk/faucet,REANNZ/faucet,trungdtbk/faucet | shell | ## Code Before:
MINCOVERAGE=93
coverage erase || exit 1
for i in unit/test_*py ; do PYTHONPATH=.. coverage run -a --source ../faucet $i || exit 1 ; done
coverage report -m --fail-under=$MINCOVERAGE || exit 1
## Instruction:
Add experimental API test app back to unit tests.
Also restores fail-under=$MINCOVERAGE
integration/experimental_api_test_app.py is used in the integration
tests, but previously it was being run as a unit test as well.
Moving it into integration/ removed it from the unit tests and
reduced coverage slightly.
The test appears to be mostly a no-op at this point, but invoking
it from run_unit_tests.sh should reduce the coverage drop (though
there still seems to be a drop on test_vlan.py?)
## Code After:
MINCOVERAGE=93
coverage erase || exit 1
for i in unit/test_*py integration/experimental_api_test_app.py; do PYTHONPATH=.. coverage run -a --source ../faucet $i || exit 1 ; done
coverage report -m --fail-under=$MINCOVERAGE || exit 1
|
MINCOVERAGE=93
coverage erase || exit 1
+
- for i in unit/test_*py ; do PYTHONPATH=.. coverage run -a --source ../faucet $i || exit 1 ; done
+ for i in unit/test_*py integration/experimental_api_test_app.py; do PYTHONPATH=.. coverage run -a --source ../faucet $i || exit 1 ; done
? + ++++++++++++++++++++++++++++++++++++++++
coverage report -m --fail-under=$MINCOVERAGE || exit 1 | 3 | 0.5 | 2 | 1 |
dcd39f2955cd80e3888458954a58203ae74dab71 | cyder/base/eav/forms.py | cyder/base/eav/forms.py | from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'instance' in kwargs and kwargs['instance'] is not None:
# This is a bound form with a real instance
if 'initial' not in kwargs:
kwargs['initial'] = dict()
# Set the attribute field to the name, not the pk
kwargs['initial']['attribute'] = \
kwargs['instance'].attribute.name
# Set the attribute_type field to the current attribute's type
kwargs['initial']['attribute_type'] = \
kwargs['instance'].attribute.attribute_type
super(EAVForm, self).__init__(*args, **kwargs)
attribute_type = forms.ChoiceField(
choices=eav_model._meta.get_field('attribute').type_choices)
entity = forms.ModelChoiceField(
queryset=entity_model.objects.all(),
widget=forms.HiddenInput())
class Meta:
model = eav_model
fields = ('entity', 'attribute_type', 'attribute', 'value')
return EAVForm
| from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'instance' in kwargs and kwargs['instance'] is not None:
# This is a bound form with a real instance
if 'initial' not in kwargs:
kwargs['initial'] = dict()
# Set the attribute field to the name, not the pk
kwargs['initial']['attribute'] = \
kwargs['instance'].attribute.name
# Set the attribute_type field to the current attribute's type
kwargs['initial']['attribute_type'] = \
kwargs['instance'].attribute.attribute_type
super(EAVForm, self).__init__(*args, **kwargs)
attribute_type = forms.ChoiceField(
choices=eav_model._meta.get_field('attribute').type_choices)
entity = forms.ModelChoiceField(
queryset=entity_model.objects.all(),
widget=forms.HiddenInput())
class Meta:
model = eav_model
fields = ('entity', 'attribute_type', 'attribute', 'value')
EAVForm.__name__ = eav_model.__name__ + 'Form'
return EAVForm
| Set EAV form class name to match EAV model name | Set EAV form class name to match EAV model name
(for easier debugging, at least in theory)
| Python | bsd-3-clause | murrown/cyder,akeym/cyder,OSU-Net/cyder,drkitty/cyder,drkitty/cyder,zeeman/cyder,drkitty/cyder,zeeman/cyder,drkitty/cyder,akeym/cyder,murrown/cyder,murrown/cyder,murrown/cyder,zeeman/cyder,zeeman/cyder,OSU-Net/cyder,OSU-Net/cyder,OSU-Net/cyder,akeym/cyder,akeym/cyder | python | ## Code Before:
from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'instance' in kwargs and kwargs['instance'] is not None:
# This is a bound form with a real instance
if 'initial' not in kwargs:
kwargs['initial'] = dict()
# Set the attribute field to the name, not the pk
kwargs['initial']['attribute'] = \
kwargs['instance'].attribute.name
# Set the attribute_type field to the current attribute's type
kwargs['initial']['attribute_type'] = \
kwargs['instance'].attribute.attribute_type
super(EAVForm, self).__init__(*args, **kwargs)
attribute_type = forms.ChoiceField(
choices=eav_model._meta.get_field('attribute').type_choices)
entity = forms.ModelChoiceField(
queryset=entity_model.objects.all(),
widget=forms.HiddenInput())
class Meta:
model = eav_model
fields = ('entity', 'attribute_type', 'attribute', 'value')
return EAVForm
## Instruction:
Set EAV form class name to match EAV model name
(for easier debugging, at least in theory)
## Code After:
from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'instance' in kwargs and kwargs['instance'] is not None:
# This is a bound form with a real instance
if 'initial' not in kwargs:
kwargs['initial'] = dict()
# Set the attribute field to the name, not the pk
kwargs['initial']['attribute'] = \
kwargs['instance'].attribute.name
# Set the attribute_type field to the current attribute's type
kwargs['initial']['attribute_type'] = \
kwargs['instance'].attribute.attribute_type
super(EAVForm, self).__init__(*args, **kwargs)
attribute_type = forms.ChoiceField(
choices=eav_model._meta.get_field('attribute').type_choices)
entity = forms.ModelChoiceField(
queryset=entity_model.objects.all(),
widget=forms.HiddenInput())
class Meta:
model = eav_model
fields = ('entity', 'attribute_type', 'attribute', 'value')
EAVForm.__name__ = eav_model.__name__ + 'Form'
return EAVForm
| from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'instance' in kwargs and kwargs['instance'] is not None:
# This is a bound form with a real instance
if 'initial' not in kwargs:
kwargs['initial'] = dict()
# Set the attribute field to the name, not the pk
kwargs['initial']['attribute'] = \
kwargs['instance'].attribute.name
# Set the attribute_type field to the current attribute's type
kwargs['initial']['attribute_type'] = \
kwargs['instance'].attribute.attribute_type
super(EAVForm, self).__init__(*args, **kwargs)
attribute_type = forms.ChoiceField(
choices=eav_model._meta.get_field('attribute').type_choices)
entity = forms.ModelChoiceField(
queryset=entity_model.objects.all(),
widget=forms.HiddenInput())
class Meta:
model = eav_model
fields = ('entity', 'attribute_type', 'attribute', 'value')
+ EAVForm.__name__ = eav_model.__name__ + 'Form'
+
return EAVForm | 2 | 0.052632 | 2 | 0 |
c96a2f636b48b065e8404af6d67fbae5986fd34a | tests/basics/subclass_native2_tuple.py | tests/basics/subclass_native2_tuple.py | class Base1:
def __init__(self, *args):
print("Base1.__init__", args)
class Ctuple1(Base1, tuple):
pass
a = Ctuple1()
print(len(a))
a = Ctuple1([1, 2, 3])
print(len(a))
print("---")
class Ctuple2(tuple, Base1):
pass
a = Ctuple2()
print(len(a))
a = Ctuple2([1, 2, 3])
print(len(a))
| class Base1:
def __init__(self, *args):
print("Base1.__init__", args)
class Ctuple1(Base1, tuple):
pass
a = Ctuple1()
print(len(a))
a = Ctuple1([1, 2, 3])
print(len(a))
print("---")
class Ctuple2(tuple, Base1):
pass
a = Ctuple2()
print(len(a))
a = Ctuple2([1, 2, 3])
print(len(a))
a = tuple([1,2,3])
b = Ctuple1([1,2,3])
c = Ctuple2([1,2,3])
print(a == b)
print(b == c)
print(c == a)
| Expand test cases for equality of subclasses. | tests/basics: Expand test cases for equality of subclasses.
| Python | mit | pramasoul/micropython,adafruit/circuitpython,henriknelson/micropython,MrSurly/micropython,bvernoux/micropython,tobbad/micropython,kerneltask/micropython,kerneltask/micropython,tobbad/micropython,tobbad/micropython,pramasoul/micropython,selste/micropython,adafruit/circuitpython,henriknelson/micropython,pozetroninc/micropython,pozetroninc/micropython,MrSurly/micropython,pozetroninc/micropython,adafruit/circuitpython,kerneltask/micropython,tobbad/micropython,pramasoul/micropython,selste/micropython,bvernoux/micropython,MrSurly/micropython,adafruit/circuitpython,bvernoux/micropython,selste/micropython,henriknelson/micropython,pozetroninc/micropython,kerneltask/micropython,henriknelson/micropython,tobbad/micropython,kerneltask/micropython,pozetroninc/micropython,selste/micropython,pramasoul/micropython,MrSurly/micropython,pramasoul/micropython,MrSurly/micropython,henriknelson/micropython,bvernoux/micropython,adafruit/circuitpython,selste/micropython,bvernoux/micropython,adafruit/circuitpython | python | ## Code Before:
class Base1:
def __init__(self, *args):
print("Base1.__init__", args)
class Ctuple1(Base1, tuple):
pass
a = Ctuple1()
print(len(a))
a = Ctuple1([1, 2, 3])
print(len(a))
print("---")
class Ctuple2(tuple, Base1):
pass
a = Ctuple2()
print(len(a))
a = Ctuple2([1, 2, 3])
print(len(a))
## Instruction:
tests/basics: Expand test cases for equality of subclasses.
## Code After:
class Base1:
def __init__(self, *args):
print("Base1.__init__", args)
class Ctuple1(Base1, tuple):
pass
a = Ctuple1()
print(len(a))
a = Ctuple1([1, 2, 3])
print(len(a))
print("---")
class Ctuple2(tuple, Base1):
pass
a = Ctuple2()
print(len(a))
a = Ctuple2([1, 2, 3])
print(len(a))
a = tuple([1,2,3])
b = Ctuple1([1,2,3])
c = Ctuple2([1,2,3])
print(a == b)
print(b == c)
print(c == a)
| class Base1:
def __init__(self, *args):
print("Base1.__init__", args)
class Ctuple1(Base1, tuple):
pass
a = Ctuple1()
print(len(a))
a = Ctuple1([1, 2, 3])
print(len(a))
print("---")
class Ctuple2(tuple, Base1):
pass
a = Ctuple2()
print(len(a))
a = Ctuple2([1, 2, 3])
print(len(a))
+
+ a = tuple([1,2,3])
+ b = Ctuple1([1,2,3])
+ c = Ctuple2([1,2,3])
+
+ print(a == b)
+ print(b == c)
+ print(c == a) | 8 | 0.380952 | 8 | 0 |
3b58121570501ed4f8fd327e69a6b63abc82a6b6 | JumpingBall/JumpingBall/PlayScene.swift | JumpingBall/JumpingBall/PlayScene.swift | import SpriteKit
// Sprite node for the bar
let runningBar = SKSpriteNode(imageNamed: "bar")
class PlayScene: SKScene{
override func didMoveToView(view: SKView!) {
self.backgroundColor = UIColor(hex: 0x809DFF)
// Set the anchor point of the running bar at (0, 0.5)
self.runningBar.anchorPoint = CGPointMake(0, 0.5)
}
/// Update the scene: It will run every single frame
override func update(currentTime: NSTimeInterval) {
}
}
| import SpriteKit
// Sprite node for the bar
let runningBar = SKSpriteNode(imageNamed: "bar")
class PlayScene: SKScene{
override func didMoveToView(view: SKView!) {
self.backgroundColor = UIColor(hex: 0x809DFF)
// Set the anchor point of the running bar at (0, 0.5)
self.runningBar.anchorPoint = CGPointMake(0, 0.5)
// Set the bar at the bottom of the screen
self.runningBar.position = CGPointMake(CGRectGetMinX(self.frame), CGRectGetMinY(self.frame))
}
/// Update the scene: It will run every single frame
override func update(currentTime: NSTimeInterval) {
}
}
| Set the bar at the bottom of the screen | Set the bar at the bottom of the screen
| Swift | mit | nguyenantinhbk77/practice-swift,nguyenantinhbk77/practice-swift,domenicosolazzo/practice-swift,hanhailong/practice-swift,hanhailong/practice-swift,domenicosolazzo/practice-swift,domenicosolazzo/practice-swift,domenicosolazzo/practice-swift,nguyenantinhbk77/practice-swift,nguyenantinhbk77/practice-swift,hanhailong/practice-swift,hanhailong/practice-swift | swift | ## Code Before:
import SpriteKit
// Sprite node for the bar
let runningBar = SKSpriteNode(imageNamed: "bar")
class PlayScene: SKScene{
override func didMoveToView(view: SKView!) {
self.backgroundColor = UIColor(hex: 0x809DFF)
// Set the anchor point of the running bar at (0, 0.5)
self.runningBar.anchorPoint = CGPointMake(0, 0.5)
}
/// Update the scene: It will run every single frame
override func update(currentTime: NSTimeInterval) {
}
}
## Instruction:
Set the bar at the bottom of the screen
## Code After:
import SpriteKit
// Sprite node for the bar
let runningBar = SKSpriteNode(imageNamed: "bar")
class PlayScene: SKScene{
override func didMoveToView(view: SKView!) {
self.backgroundColor = UIColor(hex: 0x809DFF)
// Set the anchor point of the running bar at (0, 0.5)
self.runningBar.anchorPoint = CGPointMake(0, 0.5)
// Set the bar at the bottom of the screen
self.runningBar.position = CGPointMake(CGRectGetMinX(self.frame), CGRectGetMinY(self.frame))
}
/// Update the scene: It will run every single frame
override func update(currentTime: NSTimeInterval) {
}
}
| import SpriteKit
// Sprite node for the bar
let runningBar = SKSpriteNode(imageNamed: "bar")
class PlayScene: SKScene{
override func didMoveToView(view: SKView!) {
self.backgroundColor = UIColor(hex: 0x809DFF)
// Set the anchor point of the running bar at (0, 0.5)
- self.runningBar.anchorPoint = CGPointMake(0, 0.5)
? ---
+ self.runningBar.anchorPoint = CGPointMake(0, 0.5)
+ // Set the bar at the bottom of the screen
+ self.runningBar.position = CGPointMake(CGRectGetMinX(self.frame), CGRectGetMinY(self.frame))
+
}
/// Update the scene: It will run every single frame
override func update(currentTime: NSTimeInterval) {
}
} | 5 | 0.277778 | 4 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.