commit stringlengths 40 40 | old_file stringlengths 4 237 | new_file stringlengths 4 237 | old_contents stringlengths 1 4.24k | new_contents stringlengths 5 4.84k | subject stringlengths 15 778 | message stringlengths 16 6.86k | lang stringlengths 1 30 | license stringclasses 13 values | repos stringlengths 5 116k | config stringlengths 1 30 | content stringlengths 105 8.72k |
|---|---|---|---|---|---|---|---|---|---|---|---|
af78197a7daf81c7ca5f48b9911c6fee8b5a4c75 | .changeset/config.json | .changeset/config.json | {
"changelog": ["@changesets/changelog-github", { "repo": "mobxjs/mobx" }],
"commit": false,
"access": "public",
"baseBranch": "main"
}
| {
"changelog": ["@changesets/changelog-github", { "repo": "mobxjs/mobx" }],
"commit": false,
"access": "public",
"baseBranch": "main",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
| Apply changeset exp. flag for handling peer deps | Apply changeset exp. flag for handling peer deps
See details at https://github.com/atlassian/changesets/issues/524 | JSON | mit | mweststrate/MOBservable,mweststrate/MOBservable,mobxjs/mobx,mobxjs/mobx,mobxjs/mobx,mweststrate/MOBservable,mobxjs/mobx | json | ## Code Before:
{
"changelog": ["@changesets/changelog-github", { "repo": "mobxjs/mobx" }],
"commit": false,
"access": "public",
"baseBranch": "main"
}
## Instruction:
Apply changeset exp. flag for handling peer deps
See details at https://github.com/atlassian/changesets/issues/524
## Code After:
{
"changelog": ["@changesets/changelog-github", { "repo": "mobxjs/mobx" }],
"commit": false,
"access": "public",
"baseBranch": "main",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
|
b8c21dd03d44812c22940d714ac266e0d8168d18 | package.json | package.json | {
"name": "primeng",
"version": "v1.0.0-beta.2-SNAPSHOT",
"scripts": {
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
},
"license": "Apache-2.0",
"peerDependencies": {
"angular2": "2.0.0-beta.14",
"systemjs": "0.19.25",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.6",
"primeui": "4.1.7"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.8.9",
"typings": "^0.7.11"
}
}
| {
"name": "primeng",
"version": "v1.0.0-beta.2-SNAPSHOT",
"scripts": {
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
},
"repository": {
"type": "git",
"url": "https://github.com/primefaces/primeng.git"
},
"license": "Apache-2.0",
"peerDependencies": {
"angular2": "2.0.0-beta.14",
"systemjs": "0.19.25",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.6",
"primeui": "4.1.7"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.9",
"typings": "^0.7.12"
}
}
| Add repository field and updated lite-server | Add repository field and updated lite-server
| JSON | mit | hryktrd/primeng,carlosearaujo/primeng,primefaces/primeng,donriver/primeng,gabriel17carmo/primeng,carlosearaujo/primeng,nhnb/primeng,WebRota/primeng,davidkirolos/primeng,pauly815/primeng,primefaces/primeng,aaraggornn/primeng,blver/primeng,mmercan/primeng,odedolive/primeng,nhnb/primeng,pauly815/primeng,davidkirolos/primeng,311devs/primeng,kojisaiki/primeng,kcjonesevans/primeng,sourabh8003/ultimate-primeNg,ConradSchmidt/primeng,laserus/primeng,howlettt/primeng,gabriel17carmo/primeng,attilacsanyi/primeng,gilhanan/primeng,kojisaiki/primeng,WebRota/primeng,attilacsanyi/primeng,blver/primeng,fusion-ffn/primeng,311devs/primeng,carlosearaujo/primeng,vesteraas/primeng,donriver/primeng,carlosearaujo/primeng,laserus/primeng,kcjonesevans/primeng,davidkirolos/primeng,odedolive/primeng,ConradSchmidt/primeng,attilacsanyi/primeng,vesteraas/primeng,hryktrd/primeng,fusion-ffn/primeng,hryktrd/primeng,mmercan/primeng,sourabh8003/ultimate-primeNg,danielkay/primeng,mmercan/primeng,pauly815/primeng,nhnb/primeng,blver/primeng,fusion-ffn/primeng,pecko/primeng,kojisaiki/primeng,odedolive/primeng,gilhanan/primeng,laserus/primeng,ConradSchmidt/primeng,aclarktcc/primeng,hryktrd/primeng,howlettt/primeng,pecko/primeng,odedolive/primeng,kcjonesevans/primeng,gabriel17carmo/primeng,aclarktcc/primeng,aaraggornn/primeng,howlettt/primeng,gilhanan/primeng,danielkay/primeng,kcjonesevans/primeng,donriver/primeng,kojisaiki/primeng,sourabh8003/ultimate-primeNg,mmercan/primeng,aaraggornn/primeng,WebRota/primeng,311devs/primeng,nhnb/primeng,gabriel17carmo/primeng,gilhanan/primeng,laserus/primeng,aclarktcc/primeng,donriver/primeng,primefaces/primeng,pecko/primeng,311devs/primeng,aaraggornn/primeng,vesteraas/primeng,pecko/primeng,sourabh8003/ultimate-primeNg,ConradSchmidt/primeng,blver/primeng,danielkay/primeng,WebRota/primeng,primefaces/primeng,davidkirolos/primeng,pauly815/primeng,aclarktcc/primeng | json | ## Code Before:
{
"name": "primeng",
"version": "v1.0.0-beta.2-SNAPSHOT",
"scripts": {
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
},
"license": "Apache-2.0",
"peerDependencies": {
"angular2": "2.0.0-beta.14",
"systemjs": "0.19.25",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.6",
"primeui": "4.1.7"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.8.9",
"typings": "^0.7.11"
}
}
## Instruction:
Add repository field and updated lite-server
## Code After:
{
"name": "primeng",
"version": "v1.0.0-beta.2-SNAPSHOT",
"scripts": {
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
},
"repository": {
"type": "git",
"url": "https://github.com/primefaces/primeng.git"
},
"license": "Apache-2.0",
"peerDependencies": {
"angular2": "2.0.0-beta.14",
"systemjs": "0.19.25",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.6",
"primeui": "4.1.7"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.9",
"typings": "^0.7.12"
}
}
|
a037843f62a3d6b1124f8b62517463ef92cd793f | tvsort_sl/fcntl.py | tvsort_sl/fcntl.py | from __future__ import unicode_literals
def fcntl(fd, op, arg=0):
return 0
def ioctl(fd, op, arg=0, mutable_flag=True):
if mutable_flag:
return 0
else:
return ""
def flock(fd, op):
return
def lockf(fd, operation, length=0, start=0, whence=0):
return
| from __future__ import unicode_literals
# Variables with simple values
FASYNC = 64
FD_CLOEXEC = 1
F_DUPFD = 0
F_FULLFSYNC = 51
F_GETFD = 1
F_GETFL = 3
F_GETLK = 7
F_GETOWN = 5
F_RDLCK = 1
F_SETFD = 2
F_SETFL = 4
F_SETLK = 8
F_SETLKW = 9
F_SETOWN = 6
F_UNLCK = 2
F_WRLCK = 3
LOCK_EX = 2
LOCK_NB = 4
LOCK_SH = 1
LOCK_UN = 8
def fcntl(fd, op, arg=0):
return 0
def ioctl(fd, op, arg=0, mutable_flag=True):
if mutable_flag:
return 0
else:
return ""
def flock(fd, op):
return
def lockf(fd, operation, length=0, start=0, whence=0):
return
| Add missing variables to cntl | Add missing variables to cntl
| Python | mit | shlomiLan/tvsort_sl | python | ## Code Before:
from __future__ import unicode_literals
def fcntl(fd, op, arg=0):
return 0
def ioctl(fd, op, arg=0, mutable_flag=True):
if mutable_flag:
return 0
else:
return ""
def flock(fd, op):
return
def lockf(fd, operation, length=0, start=0, whence=0):
return
## Instruction:
Add missing variables to cntl
## Code After:
from __future__ import unicode_literals
# Variables with simple values
FASYNC = 64
FD_CLOEXEC = 1
F_DUPFD = 0
F_FULLFSYNC = 51
F_GETFD = 1
F_GETFL = 3
F_GETLK = 7
F_GETOWN = 5
F_RDLCK = 1
F_SETFD = 2
F_SETFL = 4
F_SETLK = 8
F_SETLKW = 9
F_SETOWN = 6
F_UNLCK = 2
F_WRLCK = 3
LOCK_EX = 2
LOCK_NB = 4
LOCK_SH = 1
LOCK_UN = 8
def fcntl(fd, op, arg=0):
return 0
def ioctl(fd, op, arg=0, mutable_flag=True):
if mutable_flag:
return 0
else:
return ""
def flock(fd, op):
return
def lockf(fd, operation, length=0, start=0, whence=0):
return
|
1d2237655ef0ba225e6fa0b8d0959ed6b3e75726 | runtests.py | runtests.py |
# Third party imports
import pytest
def main():
"""
Run pytest tests.
"""
errno = pytest.main(['-x', 'spyder_terminal', '-v',
'-rw', '--durations=10',
'--cov=spyder_terminal', '--cov-report=term-missing'])
# sys.exit doesn't work here because some things could be running
# in the background (e.g. closing the main window) when this point
# is reached. And if that's the case, sys.exit does't stop the
# script (as you would expected).
if errno != 0:
raise SystemExit(errno)
if __name__ == '__main__':
main()
|
# Third party imports
import pytest
def main():
"""
Run pytest tests.
"""
errno = pytest.main(['-x', 'spyder_terminal', '-v',
'-rw', '--durations=10',
'--cov=spyder_terminal', '--cov-report=term-missing',
'--timeout=20'])
# sys.exit doesn't work here because some things could be running
# in the background (e.g. closing the main window) when this point
# is reached. And if that's the case, sys.exit does't stop the
# script (as you would expected).
if errno != 0:
raise SystemExit(errno)
if __name__ == '__main__':
main()
| Add timeout to all tests | Add timeout to all tests
| Python | mit | spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal | python | ## Code Before:
# Third party imports
import pytest
def main():
"""
Run pytest tests.
"""
errno = pytest.main(['-x', 'spyder_terminal', '-v',
'-rw', '--durations=10',
'--cov=spyder_terminal', '--cov-report=term-missing'])
# sys.exit doesn't work here because some things could be running
# in the background (e.g. closing the main window) when this point
# is reached. And if that's the case, sys.exit does't stop the
# script (as you would expected).
if errno != 0:
raise SystemExit(errno)
if __name__ == '__main__':
main()
## Instruction:
Add timeout to all tests
## Code After:
# Third party imports
import pytest
def main():
"""
Run pytest tests.
"""
errno = pytest.main(['-x', 'spyder_terminal', '-v',
'-rw', '--durations=10',
'--cov=spyder_terminal', '--cov-report=term-missing',
'--timeout=20'])
# sys.exit doesn't work here because some things could be running
# in the background (e.g. closing the main window) when this point
# is reached. And if that's the case, sys.exit does't stop the
# script (as you would expected).
if errno != 0:
raise SystemExit(errno)
if __name__ == '__main__':
main()
|
e3bb6d03d7dee49330d46c529147e20e763b33c4 | app/assets/javascripts/handlebars_helpers.js | app/assets/javascripts/handlebars_helpers.js | Handlebars.registerHelper('select_list', function(select_options, id) {
var template = HandlebarsTemplates['recipes/foods_select'];
var list = $.map(select_options, function(e) {
if (id === e.id){
e.selected = "selected";
return e;
} else {
return e;
}
});
return new Handlebars.SafeString(template(list));
});
Handlebars.registerHelper('num', function(number) {
return number.toFixed(1).toLocaleString();
});
Handlebars.registerHelper('title', function(string) {
return string.titleize();
});
| Handlebars.registerHelper('select_list', function(select_options, id) {
var template = HandlebarsTemplates['recipes/foods_select'];
var list = $.map(select_options, function(e) {
if (id === e.id){
return {id: e.id, unique_name: e.unique_name, selected: "selected"}
} else {
return {id: e.id, unique_name: e.unique_name}
}
});
return new Handlebars.SafeString(template(list));
});
Handlebars.registerHelper('num', function(number) {
return number.toFixed(1).toLocaleString();
});
Handlebars.registerHelper('title', function(string) {
return string.titleize();
});
| Fix bug causing multiple food selected to be selected | Fix bug causing multiple food selected to be selected
| JavaScript | mit | snsavage/carb_tracker,snsavage/carb_tracker,snsavage/carb_tracker | javascript | ## Code Before:
Handlebars.registerHelper('select_list', function(select_options, id) {
var template = HandlebarsTemplates['recipes/foods_select'];
var list = $.map(select_options, function(e) {
if (id === e.id){
e.selected = "selected";
return e;
} else {
return e;
}
});
return new Handlebars.SafeString(template(list));
});
Handlebars.registerHelper('num', function(number) {
return number.toFixed(1).toLocaleString();
});
Handlebars.registerHelper('title', function(string) {
return string.titleize();
});
## Instruction:
Fix bug causing multiple food selected to be selected
## Code After:
Handlebars.registerHelper('select_list', function(select_options, id) {
var template = HandlebarsTemplates['recipes/foods_select'];
var list = $.map(select_options, function(e) {
if (id === e.id){
return {id: e.id, unique_name: e.unique_name, selected: "selected"}
} else {
return {id: e.id, unique_name: e.unique_name}
}
});
return new Handlebars.SafeString(template(list));
});
Handlebars.registerHelper('num', function(number) {
return number.toFixed(1).toLocaleString();
});
Handlebars.registerHelper('title', function(string) {
return string.titleize();
});
|
d77cdc0488f77a8951d6ba43cd15c89647bc031a | RELEASING.rst | RELEASING.rst | Release procedure
=================
A list of steps to perform when releasing.
* Run tests against latest CouchDB release (ideally also trunk)
* Run tests on different Python versions
* Update ChangeLog and add a release date, then commit
* Merge changes from default to stable
* Edit setup.cfg (in the tag), remove the egg_info section and commit
* Tag the just-committed changeset, then update to the tag
* python setup.py bdist_wheel sdist --formats=gztar upload
* Revert the setup.cfg change.
* Update the version number on the branch to 0.10.1
| Release procedure
=================
A list of steps to perform when releasing.
* Run tests against latest CouchDB release (ideally also trunk)
* Make sure the version number in setup.py is correct
* Update ChangeLog and add a release date, then commit
* Edit setup.cfg, remove the egg_info section and commit
* Tag the just-committed changeset
* python setup.py bdist_wheel sdist --formats=gztar upload
* Revert the setup.cfg change
* Update the version number in setup.py
| Update release procedure checklist a bit | Update release procedure checklist a bit
| reStructuredText | bsd-3-clause | djc/couchdb-python,djc/couchdb-python | restructuredtext | ## Code Before:
Release procedure
=================
A list of steps to perform when releasing.
* Run tests against latest CouchDB release (ideally also trunk)
* Run tests on different Python versions
* Update ChangeLog and add a release date, then commit
* Merge changes from default to stable
* Edit setup.cfg (in the tag), remove the egg_info section and commit
* Tag the just-committed changeset, then update to the tag
* python setup.py bdist_wheel sdist --formats=gztar upload
* Revert the setup.cfg change.
* Update the version number on the branch to 0.10.1
## Instruction:
Update release procedure checklist a bit
## Code After:
Release procedure
=================
A list of steps to perform when releasing.
* Run tests against latest CouchDB release (ideally also trunk)
* Make sure the version number in setup.py is correct
* Update ChangeLog and add a release date, then commit
* Edit setup.cfg, remove the egg_info section and commit
* Tag the just-committed changeset
* python setup.py bdist_wheel sdist --formats=gztar upload
* Revert the setup.cfg change
* Update the version number in setup.py
|
8e35263a3d312c709f0fc9e4f614d9d3ca789d77 | pyfarm/master/templates/pyfarm/user_interface/logs_in_task.html | pyfarm/master/templates/pyfarm/user_interface/logs_in_task.html | {% extends "pyfarm/user_interface/layout.html" %}
{% block title %}Logs in Task {{ task.id }} {% endblock %}
{% block jobs_nb_class %}active{% endblock %}
{% block additional_styles %}
{% endblock %}
{% block content %}
<h1>Logs in Task {{ task.id }} </h1>
<h2>(Frame {{ task.frame }} from job <a href="{{ url_for('single_job_ui', job_id=task.job.id) }}">{{ task.job.title }}</a>)</h2>
<ul>
{% for attempt, logs in attempts.items() %}
<li> Attempt {{ attempt }}
<ul>
{% for log in logs %}
<li><span class="timestamp">{{ log.log.created_on.isoformat() }}</span> on {{ log.log.agent.hostname }}: <a href="/api/v1/jobs/{{ task.job.id }}/tasks/{{ task.id }}/attempts/{{ attempt }}/logs/{{ log.log.identifier }}/logfile">{{ log.log.identifier }}</a></li>
{% endfor %}
</ul>
</li>
{%endfor%}
</ul>
{% endblock %}
| {% extends "pyfarm/user_interface/layout.html" %}
{% block title %}Logs in Task {{ task.id }} {% endblock %}
{% block jobs_nb_class %}active{% endblock %}
{% block additional_styles %}
{% endblock %}
{% block content %}
<h1>Logs in Task {{ task.id }} </h1>
<h2>(Frame {{ task.frame }} from job <a href="{{ url_for('single_job_ui', job_id=task.job.id) }}">{{ task.job.title }}</a>)</h2>
<ul>
{% for attempt, logs in attempts.items() %}
<li> Attempt {{ attempt }}
<ul>
{% for log in logs %}
<li><span class="timestamp">{{ log.log.created_on.isoformat() }}</span> on <a href="{{ url_for('single_agent_ui', agent_id=log.log.agent.id) }}">{{ log.log.agent.hostname }}</a>: <a href="/api/v1/jobs/{{ task.job.id }}/tasks/{{ task.id }}/attempts/{{ attempt }}/logs/{{ log.log.identifier }}/logfile">{{ log.log.identifier }}</a></li>
{% endfor %}
</ul>
</li>
{%endfor%}
</ul>
{% endblock %}
| Make agents in tasklogs view clickable | Make agents in tasklogs view clickable
| HTML | apache-2.0 | pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master | html | ## Code Before:
{% extends "pyfarm/user_interface/layout.html" %}
{% block title %}Logs in Task {{ task.id }} {% endblock %}
{% block jobs_nb_class %}active{% endblock %}
{% block additional_styles %}
{% endblock %}
{% block content %}
<h1>Logs in Task {{ task.id }} </h1>
<h2>(Frame {{ task.frame }} from job <a href="{{ url_for('single_job_ui', job_id=task.job.id) }}">{{ task.job.title }}</a>)</h2>
<ul>
{% for attempt, logs in attempts.items() %}
<li> Attempt {{ attempt }}
<ul>
{% for log in logs %}
<li><span class="timestamp">{{ log.log.created_on.isoformat() }}</span> on {{ log.log.agent.hostname }}: <a href="/api/v1/jobs/{{ task.job.id }}/tasks/{{ task.id }}/attempts/{{ attempt }}/logs/{{ log.log.identifier }}/logfile">{{ log.log.identifier }}</a></li>
{% endfor %}
</ul>
</li>
{%endfor%}
</ul>
{% endblock %}
## Instruction:
Make agents in tasklogs view clickable
## Code After:
{% extends "pyfarm/user_interface/layout.html" %}
{% block title %}Logs in Task {{ task.id }} {% endblock %}
{% block jobs_nb_class %}active{% endblock %}
{% block additional_styles %}
{% endblock %}
{% block content %}
<h1>Logs in Task {{ task.id }} </h1>
<h2>(Frame {{ task.frame }} from job <a href="{{ url_for('single_job_ui', job_id=task.job.id) }}">{{ task.job.title }}</a>)</h2>
<ul>
{% for attempt, logs in attempts.items() %}
<li> Attempt {{ attempt }}
<ul>
{% for log in logs %}
<li><span class="timestamp">{{ log.log.created_on.isoformat() }}</span> on <a href="{{ url_for('single_agent_ui', agent_id=log.log.agent.id) }}">{{ log.log.agent.hostname }}</a>: <a href="/api/v1/jobs/{{ task.job.id }}/tasks/{{ task.id }}/attempts/{{ attempt }}/logs/{{ log.log.identifier }}/logfile">{{ log.log.identifier }}</a></li>
{% endfor %}
</ul>
</li>
{%endfor%}
</ul>
{% endblock %}
|
cd2469fd3980281cbd04c88991d7e9e50c555d5e | README.md | README.md | PenguinPredictor
To build:
```
gradle build
gradle jfxNative
```
The jar version of the application will be located in build/jfx/app, and native versions will be located in build/jfx/native
WARNING: After the latest penguin quest, it's very likely that the 2 point penguin predictions from this program are incorrect. 1 pointers seem to be unaffected, but be aware that they may have problems as well.
| PenguinPredictor
To build:
```
gradle build
gradle jfxNative
```
The jar version of the application will be located in build/jfx/app, and native versions will be located in build/jfx/native
WARNING: Be sure you are using the latest version of the code - older versions will not accurately predict 2 point penguins after the Back to the Freezer quest.
| Update the warning in the readme - we have a fix | Update the warning in the readme - we have a fix | Markdown | apache-2.0 | brainiac744/PenguinPredictor | markdown | ## Code Before:
PenguinPredictor
To build:
```
gradle build
gradle jfxNative
```
The jar version of the application will be located in build/jfx/app, and native versions will be located in build/jfx/native
WARNING: After the latest penguin quest, it's very likely that the 2 point penguin predictions from this program are incorrect. 1 pointers seem to be unaffected, but be aware that they may have problems as well.
## Instruction:
Update the warning in the readme - we have a fix
## Code After:
PenguinPredictor
To build:
```
gradle build
gradle jfxNative
```
The jar version of the application will be located in build/jfx/app, and native versions will be located in build/jfx/native
WARNING: Be sure you are using the latest version of the code - older versions will not accurately predict 2 point penguins after the Back to the Freezer quest.
|
68020403d72b00fbda301ad43242fcc70897b884 | lib/MetaProcessor/CMakeLists.txt | lib/MetaProcessor/CMakeLists.txt | set(LLVM_USED_LIBS
clangBasic
)
add_cling_library(clingMetaProcessor
Display.cpp
MetaProcessor.cpp
InputValidator.cpp)
| set(LLVM_USED_LIBS
clangBasic
)
add_cling_library(clingMetaProcessor
Display.cpp
InputValidator.cpp
MetaLexer.cpp
MetaParser.cpp
MetaProcessor.cpp
MetaSema.cpp)
| Update cmake to compile the newly added files | Update cmake to compile the newly added files
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@47812 27541ba8-7e3a-0410-8455-c3a389f83636
| Text | lgpl-2.1 | marsupial/cling,root-mirror/cling,perovic/cling,marsupial/cling,root-mirror/cling,perovic/cling,perovic/cling,karies/cling,perovic/cling,karies/cling,karies/cling,root-mirror/cling,root-mirror/cling,marsupial/cling,marsupial/cling,karies/cling,root-mirror/cling,karies/cling,marsupial/cling,karies/cling,root-mirror/cling,perovic/cling,marsupial/cling | text | ## Code Before:
set(LLVM_USED_LIBS
clangBasic
)
add_cling_library(clingMetaProcessor
Display.cpp
MetaProcessor.cpp
InputValidator.cpp)
## Instruction:
Update cmake to compile the newly added files
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@47812 27541ba8-7e3a-0410-8455-c3a389f83636
## Code After:
set(LLVM_USED_LIBS
clangBasic
)
add_cling_library(clingMetaProcessor
Display.cpp
InputValidator.cpp
MetaLexer.cpp
MetaParser.cpp
MetaProcessor.cpp
MetaSema.cpp)
|
b6c3ad3ddc66538965966191f55448dda5af007d | test/stmt/switch_nil.swift | test/stmt/switch_nil.swift | // RUN: %target-typecheck-verify-swift
enum Hey {
case listen
}
func test() {
switch Hey.listen {
case nil: // expected-warning {{type 'Hey' is not optional, value can never be nil}}
break
default:
break
}
}
| // RUN: %target-typecheck-verify-swift
enum Hey {
case listen
}
func test() {
switch Hey.listen {
case nil: // expected-warning {{type 'Hey' is not optional, value can never be nil}}
break
default:
break
}
}
struct Nilable: ExpressibleByNilLiteral {
init(nilLiteral: ()) {}
}
func testNil() {
// N.B. A deeply confusing case as no conversion is performed on the `nil`
// literal. Instead, the match subject is converted to `Nilable?` and compared
// using ~=.
switch Nilable(nilLiteral: ()) {
case nil: // expected-warning {{type 'Nilable' is not optional, value can never be nil}}
break
default:
break
}
}
| Augment Test for Confusing ExpressibleByNilLiteral Case | Augment Test for Confusing ExpressibleByNilLiteral Case
Add a test for an extremely confusing behavior of switches for
ExpressibleByNilLiteral-conforming types. From the looks of the expression
tree, one would hope that `case nil` would match such types. Instead, the
subject value is up-converted to an optional and compared to `nil` directly
with ~=.
| Swift | apache-2.0 | glessard/swift,gregomni/swift,benlangmuir/swift,rudkx/swift,benlangmuir/swift,JGiola/swift,ahoppen/swift,rudkx/swift,atrick/swift,apple/swift,benlangmuir/swift,glessard/swift,roambotics/swift,atrick/swift,ahoppen/swift,roambotics/swift,gregomni/swift,benlangmuir/swift,glessard/swift,gregomni/swift,rudkx/swift,roambotics/swift,glessard/swift,benlangmuir/swift,atrick/swift,ahoppen/swift,JGiola/swift,rudkx/swift,rudkx/swift,gregomni/swift,glessard/swift,roambotics/swift,atrick/swift,rudkx/swift,ahoppen/swift,JGiola/swift,glessard/swift,apple/swift,atrick/swift,apple/swift,atrick/swift,JGiola/swift,roambotics/swift,apple/swift,JGiola/swift,ahoppen/swift,gregomni/swift,apple/swift,roambotics/swift,benlangmuir/swift,gregomni/swift,ahoppen/swift,apple/swift,JGiola/swift | swift | ## Code Before:
// RUN: %target-typecheck-verify-swift
enum Hey {
case listen
}
func test() {
switch Hey.listen {
case nil: // expected-warning {{type 'Hey' is not optional, value can never be nil}}
break
default:
break
}
}
## Instruction:
Augment Test for Confusing ExpressibleByNilLiteral Case
Add a test for an extremely confusing behavior of switches for
ExpressibleByNilLiteral-conforming types. From the looks of the expression
tree, one would hope that `case nil` would match such types. Instead, the
subject value is up-converted to an optional and compared to `nil` directly
with ~=.
## Code After:
// RUN: %target-typecheck-verify-swift
enum Hey {
case listen
}
func test() {
switch Hey.listen {
case nil: // expected-warning {{type 'Hey' is not optional, value can never be nil}}
break
default:
break
}
}
struct Nilable: ExpressibleByNilLiteral {
init(nilLiteral: ()) {}
}
func testNil() {
// N.B. A deeply confusing case as no conversion is performed on the `nil`
// literal. Instead, the match subject is converted to `Nilable?` and compared
// using ~=.
switch Nilable(nilLiteral: ()) {
case nil: // expected-warning {{type 'Nilable' is not optional, value can never be nil}}
break
default:
break
}
}
|
48b4229d23105486185a652a6b711c5b6d54dad5 | README.md | README.md | ZeroDB [http://www.zerodb.io/] is an end-to-end encrypted database.
Data can be stored on untrusted database servers without ever exposing the
encryption key. Clients can execute remote queries against the encrypted data
without downloading it or suffering an excessive performance hit.
### Technical white paper: [https://www.zerodb.io/zerodb.pdf](https://www.zerodb.io/zerodb.pdf)
### Documentation: [https://docs.zerodb.io/](https://docs.zerodb.io/)
### OpenSource Community: [https://slack.zerodb.io/](https://slack.zerodb.io/)
Based on ZODB
| ZeroDB [http://www.zerodb.io/] is an end-to-end encrypted database.
Data can be stored on untrusted database servers without ever exposing the
encryption key. Clients can execute remote queries against the encrypted data
without downloading it or suffering an excessive performance hit.
Special thanks to ZODB community on which ZeroDB is based.
### Technical white paper: [https://www.zerodb.io/zerodb.pdf](https://www.zerodb.io/zerodb.pdf)
### Documentation: [https://docs.zerodb.io/](https://docs.zerodb.io/)
### OpenSource Community: [https://slack.zerodb.io/](https://slack.zerodb.io/)
| Update the Readme file for cleanup | Update the Readme file for cleanup
Quick patch | Markdown | agpl-3.0 | zero-db/zerodb,zerodb/zerodb,zero-db/zerodb,zerodb/zerodb | markdown | ## Code Before:
ZeroDB [http://www.zerodb.io/] is an end-to-end encrypted database.
Data can be stored on untrusted database servers without ever exposing the
encryption key. Clients can execute remote queries against the encrypted data
without downloading it or suffering an excessive performance hit.
### Technical white paper: [https://www.zerodb.io/zerodb.pdf](https://www.zerodb.io/zerodb.pdf)
### Documentation: [https://docs.zerodb.io/](https://docs.zerodb.io/)
### OpenSource Community: [https://slack.zerodb.io/](https://slack.zerodb.io/)
Based on ZODB
## Instruction:
Update the Readme file for cleanup
Quick patch
## Code After:
ZeroDB [http://www.zerodb.io/] is an end-to-end encrypted database.
Data can be stored on untrusted database servers without ever exposing the
encryption key. Clients can execute remote queries against the encrypted data
without downloading it or suffering an excessive performance hit.
Special thanks to ZODB community on which ZeroDB is based.
### Technical white paper: [https://www.zerodb.io/zerodb.pdf](https://www.zerodb.io/zerodb.pdf)
### Documentation: [https://docs.zerodb.io/](https://docs.zerodb.io/)
### OpenSource Community: [https://slack.zerodb.io/](https://slack.zerodb.io/)
|
15ea1f2a61f3c0f7401ec8cdfdedcfbbc3b6f2db | wifi-reset.sh | wifi-reset.sh | iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done
# Bring all wifi interfaces up.
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done
| sleep 30
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done
# Bring all wifi interfaces up.
sleep 30
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done
| Add delay to allow wifi device to become ready | Add delay to allow wifi device to become ready
Attempt to resolve Adafruit customer reported issue for the OURLINK WiFi USB Adapter:
https://forums.adafruit.com/viewtopic.php?f=49&t=86761 | Shell | mit | adafruit/wifi-reset | shell | ## Code Before:
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done
# Bring all wifi interfaces up.
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done
## Instruction:
Add delay to allow wifi device to become ready
Attempt to resolve Adafruit customer reported issue for the OURLINK WiFi USB Adapter:
https://forums.adafruit.com/viewtopic.php?f=49&t=86761
## Code After:
sleep 30
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done
# Bring all wifi interfaces up.
sleep 30
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done
|
9faf61eb862ffbf9a7c488477d25a329627fddfc | pyproject.toml | pyproject.toml | [tool.poetry]
name = "jsonref"
version = "1.0.1"
description = "jsonref is a library for automatic dereferencing of JSON Reference objects for Python."
authors = ["Chase Sterling <chase.sterling@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [
{ include = "jsonref.py" },
{ include = "proxytypes.py" },
]
repository = "https://github.com/gazpachoking/jsonref"
documentation = "https://jsonref.readthedocs.io/en/latest/"
[tool.poetry.dependencies]
python = ">=3.3"
[tool.poetry.group.dev.dependencies]
pytest = ">=7.1.3"
[tool.poetry_bumpversion.file."jsonref.py"]
[build-system]
requires = ["poetry-core >= 1.2.0"]
build-backend = "poetry.core.masonry.api"
[tool.isort]
profile = "black"
| [project]
name = "jsonref"
description = "jsonref is a library for automatic dereferencing of JSON Reference objects for Python."
authors = [
{name = "Chase Sterling", email = "chase.sterling@gmail.com"},
]
license = {text = "MIT"}
readme = "README.md"
dynamic = ["version"]
requires-python = ">=3.3"
dependencies = []
[project.urls]
repository = "https://github.com/gazpachoking/jsonref"
documentation = "https://jsonref.readthedocs.io/en/latest/"
[tool.pdm.dev-dependencies]
test = ["pytest>=7.1.3"]
[tool.pdm]
version = { source = "file", path = "jsonref.py" }
[tool.pdm.build]
includes = ["jsonref.py", "proxytypes.py"]
[build-system]
requires = ["pdm-pep517>=1.0.0"]
build-backend = "pdm.pep517.api"
[tool.isort]
profile = "black"
| Switch to pdm for building Switch metadata to PEP 621 | Switch to pdm for building
Switch metadata to PEP 621
| TOML | mit | gazpachoking/jsonref | toml | ## Code Before:
[tool.poetry]
name = "jsonref"
version = "1.0.1"
description = "jsonref is a library for automatic dereferencing of JSON Reference objects for Python."
authors = ["Chase Sterling <chase.sterling@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [
{ include = "jsonref.py" },
{ include = "proxytypes.py" },
]
repository = "https://github.com/gazpachoking/jsonref"
documentation = "https://jsonref.readthedocs.io/en/latest/"
[tool.poetry.dependencies]
python = ">=3.3"
[tool.poetry.group.dev.dependencies]
pytest = ">=7.1.3"
[tool.poetry_bumpversion.file."jsonref.py"]
[build-system]
requires = ["poetry-core >= 1.2.0"]
build-backend = "poetry.core.masonry.api"
[tool.isort]
profile = "black"
## Instruction:
Switch to pdm for building
Switch metadata to PEP 621
## Code After:
[project]
name = "jsonref"
description = "jsonref is a library for automatic dereferencing of JSON Reference objects for Python."
authors = [
{name = "Chase Sterling", email = "chase.sterling@gmail.com"},
]
license = {text = "MIT"}
readme = "README.md"
dynamic = ["version"]
requires-python = ">=3.3"
dependencies = []
[project.urls]
repository = "https://github.com/gazpachoking/jsonref"
documentation = "https://jsonref.readthedocs.io/en/latest/"
[tool.pdm.dev-dependencies]
test = ["pytest>=7.1.3"]
[tool.pdm]
version = { source = "file", path = "jsonref.py" }
[tool.pdm.build]
includes = ["jsonref.py", "proxytypes.py"]
[build-system]
requires = ["pdm-pep517>=1.0.0"]
build-backend = "pdm.pep517.api"
[tool.isort]
profile = "black"
|
e4c46e36f4edc0b864c3df2fe07ae782aedd6238 | exiters.go | exiters.go | // +build linux darwin openbsd freebsd netbsd
package main
const EXITERS = "EOF (Ctrl-D), or SIGINT (Ctrl-C)"
| // +build !windows
// +build !plan9
package main
const EXITERS = "EOF (Ctrl-D), or SIGINT (Ctrl-C)"
| Exclude the different OSes instead of trying to list all the 'normal' ones | Exclude the different OSes instead of trying to list all the 'normal' ones
| Go | epl-1.0 | candid82/joker,candid82/joker,candid82/joker | go | ## Code Before:
// +build linux darwin openbsd freebsd netbsd
package main
const EXITERS = "EOF (Ctrl-D), or SIGINT (Ctrl-C)"
## Instruction:
Exclude the different OSes instead of trying to list all the 'normal' ones
## Code After:
// +build !windows
// +build !plan9
package main
const EXITERS = "EOF (Ctrl-D), or SIGINT (Ctrl-C)"
|
37b5e1b014757eccfefd775a6784dda76c15ee79 | app/serializers/api/admin/payment_method_serializer.rb | app/serializers/api/admin/payment_method_serializer.rb |
module Api
module Admin
class PaymentMethodSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :method_serializer
def method_serializer
if object.type == 'Spree::Gateway::StripeSCA'
Api::Admin::PaymentMethod::StripeSerializer.new(object)
else
Api::Admin::PaymentMethod::BaseSerializer.new(object)
end
end
end
end
end
|
module Api
module Admin
class PaymentMethodSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :method_serializer
def method_serializer
if object.type == 'Spree::Gateway::StripeSCA'
Api::Admin::PaymentMethod::StripeSerializer.new(object, options)
else
Api::Admin::PaymentMethod::BaseSerializer.new(object, options)
end
end
end
end
end
| Allow Payment Method Serializers to receive options | Allow Payment Method Serializers to receive options
| Ruby | agpl-3.0 | openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork | ruby | ## Code Before:
module Api
module Admin
class PaymentMethodSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :method_serializer
def method_serializer
if object.type == 'Spree::Gateway::StripeSCA'
Api::Admin::PaymentMethod::StripeSerializer.new(object)
else
Api::Admin::PaymentMethod::BaseSerializer.new(object)
end
end
end
end
end
## Instruction:
Allow Payment Method Serializers to receive options
## Code After:
module Api
module Admin
class PaymentMethodSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :method_serializer
def method_serializer
if object.type == 'Spree::Gateway::StripeSCA'
Api::Admin::PaymentMethod::StripeSerializer.new(object, options)
else
Api::Admin::PaymentMethod::BaseSerializer.new(object, options)
end
end
end
end
end
|
2a8c8ae03b02cb3e952a985280da307df7b88e26 | web/templates/pages/scoreboard.html | web/templates/pages/scoreboard.html | {{ define "content" }}
<div class="row">
<div class="main">
<h1 class="page-header">Scoreboard</h1>
<div class="table-responsive">
<table data-toggle="table"
data-url="/api/users"
data-search="true"
data-show-refresh="true"
data-show-toggle="false"
data-show-columns="false">
<thead>
<tr>
<th data-field="Score">Score</th>
<th data-field="Name">Name</th>
<th data-field="Email">Email</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
{{ end }}
| {{ define "content" }}
<div class="row">
<div class="main">
<h1 class="page-header">Scoreboard</h1>
<div class="table-responsive">
<table data-toggle="table"
data-url="/api/users"
data-search="true"
data-show-refresh="true"
data-show-toggle="false"
data-show-columns="false">
<thead>
<tr>
<th data-field="Score">Score</th>
<th data-field="Name">Name</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
{{ end }}
| Remove unused fiel from table | Remove unused fiel from table
Change-Id: If83de35b3d73e721160d542aeb422e839cf6dec3
| HTML | apache-2.0 | molecul/qa_portal,molecul/qa_portal,molecul/qa_portal,molecul/qa_portal,molecul/qa_portal | html | ## Code Before:
{{ define "content" }}
<div class="row">
<div class="main">
<h1 class="page-header">Scoreboard</h1>
<div class="table-responsive">
<table data-toggle="table"
data-url="/api/users"
data-search="true"
data-show-refresh="true"
data-show-toggle="false"
data-show-columns="false">
<thead>
<tr>
<th data-field="Score">Score</th>
<th data-field="Name">Name</th>
<th data-field="Email">Email</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
{{ end }}
## Instruction:
Remove unused fiel from table
Change-Id: If83de35b3d73e721160d542aeb422e839cf6dec3
## Code After:
{{ define "content" }}
<div class="row">
<div class="main">
<h1 class="page-header">Scoreboard</h1>
<div class="table-responsive">
<table data-toggle="table"
data-url="/api/users"
data-search="true"
data-show-refresh="true"
data-show-toggle="false"
data-show-columns="false">
<thead>
<tr>
<th data-field="Score">Score</th>
<th data-field="Name">Name</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
{{ end }}
|
a699c0335428491589225864c9f04b7c7f7c989d | sql/mssql/tables/Account.sql | sql/mssql/tables/Account.sql | create table Account (
id int not null identity,
instance int null references Instance(id),
fullname nvarchar(255) null,
email nvarchar(255) null,
password nvarchar(255) null,
password_salt varchar(50) null,
password_tag varchar(255) null,
createdate datetimeoffset(0) null,
last_login datetimeoffset(0) null,
primary key (id)
);
CREATE INDEX Account_instance_index ON Account(instance);
CREATE INDEX Account_email_index ON Account(email);
| create table Account (
id int not null identity,
instance int null references Instance(id),
fullname nvarchar(255) null,
email nvarchar(255) null,
password nvarchar(255) null,
password_salt varchar(50) null,
password_tag varchar(255) null,
createdate datetime2 null,
last_login datetime2 null,
primary key (id)
);
CREATE INDEX Account_instance_index ON Account(instance);
CREATE INDEX Account_email_index ON Account(email);
| Change date datatype to one without TZ offset information. Dates are stored in UTC. | Change date datatype to one without TZ offset information. Dates are stored in UTC.
svn commit r54386
| SQL | lgpl-2.1 | silverorange/site,silverorange/site,nburka/site,nburka/site | sql | ## Code Before:
create table Account (
id int not null identity,
instance int null references Instance(id),
fullname nvarchar(255) null,
email nvarchar(255) null,
password nvarchar(255) null,
password_salt varchar(50) null,
password_tag varchar(255) null,
createdate datetimeoffset(0) null,
last_login datetimeoffset(0) null,
primary key (id)
);
CREATE INDEX Account_instance_index ON Account(instance);
CREATE INDEX Account_email_index ON Account(email);
## Instruction:
Change date datatype to one without TZ offset information. Dates are stored in UTC.
svn commit r54386
## Code After:
create table Account (
id int not null identity,
instance int null references Instance(id),
fullname nvarchar(255) null,
email nvarchar(255) null,
password nvarchar(255) null,
password_salt varchar(50) null,
password_tag varchar(255) null,
createdate datetime2 null,
last_login datetime2 null,
primary key (id)
);
CREATE INDEX Account_instance_index ON Account(instance);
CREATE INDEX Account_email_index ON Account(email);
|
f4c49b6fd069bb27f064d26a4c18476883507cad | test/spec/ControlSpec.js | test/spec/ControlSpec.js | describe('Creating custom map controls', function () {
var map;
beforeEach(function() {
map = map || new GMaps({
el : '#basic-map',
lat: -12.0433,
lng: -77.0283,
zoom: 12
});
});
it('should add default styles for the control', function () {
map.addControl({
position: 'top_right',
content: 'Geolocate'
});
expect(map.controls[0].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.controls[0].style.fontFamily).not.toEqual('');
});
it('should leave off default styles if requested', function () {
map.addControl({
position: 'top_right',
disableDefaultStyles: true,
content: '<i class="icon"></i>'
});
expect(map.controls[1].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.controls[1].style.fontFamily).toEqual('');
});
it('should remove control', function () {
var control = map.controls[0];
map.removeControl(control);
expect(map.controls.length).toEqual(1);
expect(map.controls[0]).not.toEqual(control);
});
}); | describe('Creating custom map controls', function () {
var map;
beforeEach(function() {
map = map || new GMaps({
el : '#basic-map',
lat: -12.0433,
lng: -77.0283,
zoom: 12
});
});
it('should add default styles for the control', function () {
map.addControl({
position: 'top_right',
content: 'Geolocate'
});
expect(map.controls[0].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.controls[0].style.fontFamily).not.toEqual('');
});
it('should leave off default styles if requested', function () {
map.addControl({
position: 'top_right',
disableDefaultStyles: true,
content: '<i class="icon"></i>'
});
expect(map.controls[1].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.map.controls[google.maps.ControlPosition.TOP_RIGHT].length).toEqual(2);
expect(map.controls[1].style.fontFamily).toEqual('');
});
it('should remove control', function () {
var control = map.controls[0];
map.removeControl(control);
expect(map.controls.length).toEqual(1);
expect(map.map.controls[google.maps.ControlPosition.TOP_RIGHT].length).toEqual(1);
expect(map.controls[0]).not.toEqual(control);
});
}); | Add unit test for the internal state after removing controls | Add unit test for the internal state after removing controls
| JavaScript | mit | Matt-Jensen/gmaps-for-apps,Matt-Jensen/gmaps-for-apps | javascript | ## Code Before:
describe('Creating custom map controls', function () {
var map;
beforeEach(function() {
map = map || new GMaps({
el : '#basic-map',
lat: -12.0433,
lng: -77.0283,
zoom: 12
});
});
it('should add default styles for the control', function () {
map.addControl({
position: 'top_right',
content: 'Geolocate'
});
expect(map.controls[0].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.controls[0].style.fontFamily).not.toEqual('');
});
it('should leave off default styles if requested', function () {
map.addControl({
position: 'top_right',
disableDefaultStyles: true,
content: '<i class="icon"></i>'
});
expect(map.controls[1].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.controls[1].style.fontFamily).toEqual('');
});
it('should remove control', function () {
var control = map.controls[0];
map.removeControl(control);
expect(map.controls.length).toEqual(1);
expect(map.controls[0]).not.toEqual(control);
});
});
## Instruction:
Add unit test for the internal state after removing controls
## Code After:
describe('Creating custom map controls', function () {
var map;
beforeEach(function() {
map = map || new GMaps({
el : '#basic-map',
lat: -12.0433,
lng: -77.0283,
zoom: 12
});
});
it('should add default styles for the control', function () {
map.addControl({
position: 'top_right',
content: 'Geolocate'
});
expect(map.controls[0].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.controls[0].style.fontFamily).not.toEqual('');
});
it('should leave off default styles if requested', function () {
map.addControl({
position: 'top_right',
disableDefaultStyles: true,
content: '<i class="icon"></i>'
});
expect(map.controls[1].position).toEqual(google.maps.ControlPosition.TOP_RIGHT);
expect(map.map.controls[google.maps.ControlPosition.TOP_RIGHT].length).toEqual(2);
expect(map.controls[1].style.fontFamily).toEqual('');
});
it('should remove control', function () {
var control = map.controls[0];
map.removeControl(control);
expect(map.controls.length).toEqual(1);
expect(map.map.controls[google.maps.ControlPosition.TOP_RIGHT].length).toEqual(1);
expect(map.controls[0]).not.toEqual(control);
});
}); |
552fd8a23bc1fe0976174d806fde0fda900ccaba | data/qmltoolbox/qml/QmlToolbox/Controls/+qt54/Pane.qml | data/qmltoolbox/qml/QmlToolbox/Controls/+qt54/Pane.qml |
import QtQuick 2.4
import QtQuick.Controls 1.3
Control {
id: root
padding: 10
background: Rectangle {
color: "#F5F5F5"
}
function updateImplicitSize() {
if (contentItem.children.length == 1) {
implicitWidth = contentItem.children[0].implicitWidth + leftPadding + rightPadding;
implicitHeight = contentItem.children[0].implicitHeight + topPadding + bottomPadding;
}
}
Component.onCompleted: {
root.contentItem.onChildrenChanged.connect(childrenChanged);
updateImplicitSize();
}
} |
import QtQuick 2.4
import QtQuick.Controls 1.3
Control {
id: root
padding: 10
background: Rectangle {
color: "#F5F5F5"
}
/**
* Implements the following specification:
* If only a single item is used within a Pane, it will resize to fit the implicit size of its contained item.
*/
function updateImplicitSize() {
if (contentItem.children.length == 1) {
implicitWidth = Qt.binding(function() { return contentItem.children[0].implicitWidth + leftPadding + rightPadding });
implicitHeight = Qt.binding(function() { return contentItem.children[0].implicitHeight + topPadding + bottomPadding });
}
}
Component.onCompleted: {
root.contentItem.onChildrenChanged.connect(childrenChanged);
updateImplicitSize();
}
} | Fix automatic updating of implicitHeight and implicitWidth | Fix automatic updating of implicitHeight and implicitWidth
| QML | mit | cginternals/qmltoolbox | qml | ## Code Before:
import QtQuick 2.4
import QtQuick.Controls 1.3
Control {
id: root
padding: 10
background: Rectangle {
color: "#F5F5F5"
}
function updateImplicitSize() {
if (contentItem.children.length == 1) {
implicitWidth = contentItem.children[0].implicitWidth + leftPadding + rightPadding;
implicitHeight = contentItem.children[0].implicitHeight + topPadding + bottomPadding;
}
}
Component.onCompleted: {
root.contentItem.onChildrenChanged.connect(childrenChanged);
updateImplicitSize();
}
}
## Instruction:
Fix automatic updating of implicitHeight and implicitWidth
## Code After:
import QtQuick 2.4
import QtQuick.Controls 1.3
Control {
id: root
padding: 10
background: Rectangle {
color: "#F5F5F5"
}
/**
* Implements the following specification:
* If only a single item is used within a Pane, it will resize to fit the implicit size of its contained item.
*/
function updateImplicitSize() {
if (contentItem.children.length == 1) {
implicitWidth = Qt.binding(function() { return contentItem.children[0].implicitWidth + leftPadding + rightPadding });
implicitHeight = Qt.binding(function() { return contentItem.children[0].implicitHeight + topPadding + bottomPadding });
}
}
Component.onCompleted: {
root.contentItem.onChildrenChanged.connect(childrenChanged);
updateImplicitSize();
}
} |
8435ed758c5cff926aef1f9ed434492457d62cbb | src/Microsoft.PowerShell.PSReadLine/project.json | src/Microsoft.PowerShell.PSReadLine/project.json | {
"name": "Microsoft.PowerShell.PSReadLine",
"version": "1.0.0-*",
"authors": [ "andschwa" ],
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"System.Management.Automation": "1.0.0-*"
},
"frameworks": {
"netstandard1.5": {
"compilationOptions": {
"define": [ "CORECLR" ]
},
"imports": [ "dnxcore50", "portable-net45+win8" ]
},
"net451": {
}
}
}
| {
"name": "Microsoft.PowerShell.PSReadLine",
"version": "1.0.0-*",
"authors": [ "andschwa" ],
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"System.Management.Automation": "1.0.0-*"
},
"frameworks": {
"netstandard1.5": {
"compilationOptions": {
"define": [ "CORECLR" ]
},
"imports": [ "dnxcore50", "portable-net45+win8" ]
},
"net451": {
"frameworkAssemblies": {
"System.Windows.Forms": {
"type": "build"
}
}
}
}
}
| Fix PSReadLine for net451 build | Fix PSReadLine for net451 build
Needed System.Windows.Forms
| JSON | mit | bmanikm/PowerShell,kmosher/PowerShell,KarolKaczmarek/PowerShell,KarolKaczmarek/PowerShell,bingbing8/PowerShell,bmanikm/PowerShell,bingbing8/PowerShell,PaulHigin/PowerShell,jsoref/PowerShell,KarolKaczmarek/PowerShell,JamesWTruher/PowerShell-1,daxian-dbw/PowerShell,JamesWTruher/PowerShell-1,bingbing8/PowerShell,PaulHigin/PowerShell,kmosher/PowerShell,jsoref/PowerShell,daxian-dbw/PowerShell,daxian-dbw/PowerShell,KarolKaczmarek/PowerShell,kmosher/PowerShell,TravisEz13/PowerShell,kmosher/PowerShell,jsoref/PowerShell,bmanikm/PowerShell,bingbing8/PowerShell,KarolKaczmarek/PowerShell,PaulHigin/PowerShell,TravisEz13/PowerShell,JamesWTruher/PowerShell-1,JamesWTruher/PowerShell-1,TravisEz13/PowerShell,bmanikm/PowerShell,kmosher/PowerShell,bmanikm/PowerShell,TravisEz13/PowerShell,daxian-dbw/PowerShell,jsoref/PowerShell,jsoref/PowerShell,PaulHigin/PowerShell,bingbing8/PowerShell | json | ## Code Before:
{
"name": "Microsoft.PowerShell.PSReadLine",
"version": "1.0.0-*",
"authors": [ "andschwa" ],
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"System.Management.Automation": "1.0.0-*"
},
"frameworks": {
"netstandard1.5": {
"compilationOptions": {
"define": [ "CORECLR" ]
},
"imports": [ "dnxcore50", "portable-net45+win8" ]
},
"net451": {
}
}
}
## Instruction:
Fix PSReadLine for net451 build
Needed System.Windows.Forms
## Code After:
{
"name": "Microsoft.PowerShell.PSReadLine",
"version": "1.0.0-*",
"authors": [ "andschwa" ],
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"System.Management.Automation": "1.0.0-*"
},
"frameworks": {
"netstandard1.5": {
"compilationOptions": {
"define": [ "CORECLR" ]
},
"imports": [ "dnxcore50", "portable-net45+win8" ]
},
"net451": {
"frameworkAssemblies": {
"System.Windows.Forms": {
"type": "build"
}
}
}
}
}
|
d79fb2e3c7f3fb7b812c31c429c784b596ff0cab | distributionviewer/core/static/css/chart-menu.styl | distributionviewer/core/static/css/chart-menu.styl | @import 'lib';
.chart-menu {
display: none;
font-weight: 100;
height: 100%;
// Offset total padding-left so the links are flush against the left window edge.
margin-left: - ($min-padding + $med-padding);
padding: $lrg-padding $med-padding $med-padding 0;
width: $menu-width;
ul {
list-style: none;
margin: $min-padding 0 0;
padding: 0;
}
a {
color: $normal-text;
font-size: 12px;
text-decoration: none;
line-height: 2.5;
display: block;
border-radius: 0 4px 4px 0;
padding: 0 $min-padding 0 0;
text-align: right;
&:hover {
background-image: linear-gradient(90deg, #001021 0%, #00224A 100%);
}
}
}
@media $base-tablet {
.chart-menu {
display: block;
}
}
| @import 'lib';
.chart-menu {
display: none;
font-weight: 100;
height: 100%;
// Offset total padding-left so the links are flush against the left window edge.
margin-left: - ($min-padding + $med-padding);
padding: $lrg-padding $med-padding $med-padding 0;
width: $menu-width;
ul {
list-style: none;
margin: $min-padding 0 0;
padding: 0;
}
a {
color: $normal-text;
font-size: 12px;
text-decoration: none;
line-height: 1.5;
display: block;
border-radius: 0 4px 4px 0;
padding: 0 $min-padding 0 0;
text-align: right;
margin-bottom: 15px;
&:hover {
background-image: linear-gradient(90deg, #001021 0%, #00224A 100%);
}
}
}
@media $base-tablet {
.chart-menu {
display: block;
}
}
| Improve spacing of multi-line titles in sidebar | Improve spacing of multi-line titles in sidebar
| Stylus | mpl-2.0 | openjck/distribution-viewer,openjck/distribution-viewer,openjck/distribution-viewer,openjck/distribution-viewer | stylus | ## Code Before:
@import 'lib';
.chart-menu {
display: none;
font-weight: 100;
height: 100%;
// Offset total padding-left so the links are flush against the left window edge.
margin-left: - ($min-padding + $med-padding);
padding: $lrg-padding $med-padding $med-padding 0;
width: $menu-width;
ul {
list-style: none;
margin: $min-padding 0 0;
padding: 0;
}
a {
color: $normal-text;
font-size: 12px;
text-decoration: none;
line-height: 2.5;
display: block;
border-radius: 0 4px 4px 0;
padding: 0 $min-padding 0 0;
text-align: right;
&:hover {
background-image: linear-gradient(90deg, #001021 0%, #00224A 100%);
}
}
}
@media $base-tablet {
.chart-menu {
display: block;
}
}
## Instruction:
Improve spacing of multi-line titles in sidebar
## Code After:
@import 'lib';
.chart-menu {
display: none;
font-weight: 100;
height: 100%;
// Offset total padding-left so the links are flush against the left window edge.
margin-left: - ($min-padding + $med-padding);
padding: $lrg-padding $med-padding $med-padding 0;
width: $menu-width;
ul {
list-style: none;
margin: $min-padding 0 0;
padding: 0;
}
a {
color: $normal-text;
font-size: 12px;
text-decoration: none;
line-height: 1.5;
display: block;
border-radius: 0 4px 4px 0;
padding: 0 $min-padding 0 0;
text-align: right;
margin-bottom: 15px;
&:hover {
background-image: linear-gradient(90deg, #001021 0%, #00224A 100%);
}
}
}
@media $base-tablet {
.chart-menu {
display: block;
}
}
|
d4faa12293024b76dcb751ee926e62ec1c8d912c | CeraonUI/src/Styling/Ceraon.scss | CeraonUI/src/Styling/Ceraon.scss | /* =============================================================================
App specific CSS file.
========================================================================== */
// @import "../../node_modules/semantic-ui-css/semantic.min";
@import "http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css";
/* universal */
html {
overflow-y: scroll;
}
.no-margin {
margin:0 !important;
}
.app-content {
margin-top: 75px;
} | /* =============================================================================
App specific CSS file.
========================================================================== */
// @import "../../node_modules/semantic-ui-css/semantic.min";
@import "http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css";
/* universal */
html {
overflow-y: scroll;
}
.no-margin {
margin:0 !important;
}
.app-content {
margin-top: 75px;
}
.dropdown > .icon {
display:inline-block !important;
} | Update styling to fix semantic bug | Update styling to fix semantic bug
| SCSS | bsd-3-clause | Rdbaker/Mealbound,Rdbaker/Mealbound,Rdbaker/Mealbound,Rdbaker/Mealbound,Rdbaker/Mealbound | scss | ## Code Before:
/* =============================================================================
App specific CSS file.
========================================================================== */
// @import "../../node_modules/semantic-ui-css/semantic.min";
@import "http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css";
/* universal */
html {
overflow-y: scroll;
}
.no-margin {
margin:0 !important;
}
.app-content {
margin-top: 75px;
}
## Instruction:
Update styling to fix semantic bug
## Code After:
/* =============================================================================
App specific CSS file.
========================================================================== */
// @import "../../node_modules/semantic-ui-css/semantic.min";
@import "http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css";
/* universal */
html {
overflow-y: scroll;
}
.no-margin {
margin:0 !important;
}
.app-content {
margin-top: 75px;
}
.dropdown > .icon {
display:inline-block !important;
} |
9134abf954319bf7e645a4a91b8c5a38743b6f99 | pemFioi/randomGenerator-1.0.js | pemFioi/randomGenerator-1.0.js | var RandomGenerator = function(initialSeed) {
this.reset = function(seed) {
this.initialSeed = seed;
this.counter = (seed % 1000003 + 1) * 4751;
};
this.nextReal = function() {
var number = Math.sin(this.counter) * 10000;
this.counter++;
return number - Math.floor(number);
};
this.nextInt = function(min, max) {
return Math.floor(this.nextReal() * (max - min + 1)) + min;
};
this.nextBit = function() {
return this.nextInt(0, 1);
};
this.shuffle = function(array) {
Beav.Array.shuffle(array, this.nextInt(0, 100000));
};
this.getInitialSeed = function() {
return this.initialSeed;
};
this.reset(initialSeed);
};
| var RandomGenerator = function(initialSeed) {
this.reset = function(seed) {
this.initialSeed = seed;
this.counter = (seed % 1000003 + 1) * 4751;
};
this.nextReal = function() {
var number = Math.sin(this.counter) * 10000;
this.counter++;
return number - Math.floor(number);
};
this.nextInt = function(min, max) {
return Math.floor(this.nextReal() * (max - min + 1)) + min;
};
this.nextBit = function() {
return this.nextInt(0, 1);
};
this.shuffle = function(array) {
Beav.Array.shuffle(array, this.nextInt(0, 100000));
};
this.safeShuffle = function(array) {
var permutation = this.generateSafePermutation(array.length);
var backup = $.extend([], array);
for(var index = 0; index < array.length; index++) {
array[index] = backup[permutation[index]];
}
};
this.generateSafePermutation = function(numElements) {
if(numElements <= 1) {
return [0];
}
var permutation = Beav.Array.init(numElements, function(index) {
return index;
});
for(var attempt = 0; attempt < 100; attempt++) {
this.shuffle(permutation);
if(countFixedPoints(permutation) < numElements / 2) {
break;
}
}
return permutation;
};
function countFixedPoints(permutation) {
var result = 0;
for(var index = 0; index < permutation.length; index++) {
if(permutation[index] === index) {
result++;
}
}
return result;
}
this.getInitialSeed = function() {
return this.initialSeed;
};
this.reset(initialSeed);
};
| Add option to shuffle safely (at most N/2 fixed points). | Add option to shuffle safely (at most N/2 fixed points). | JavaScript | mit | France-ioi/bebras-modules,be-oi/beoi-contest-modules,be-oi/beoi-contest-modules,France-ioi/bebras-modules | javascript | ## Code Before:
var RandomGenerator = function(initialSeed) {
this.reset = function(seed) {
this.initialSeed = seed;
this.counter = (seed % 1000003 + 1) * 4751;
};
this.nextReal = function() {
var number = Math.sin(this.counter) * 10000;
this.counter++;
return number - Math.floor(number);
};
this.nextInt = function(min, max) {
return Math.floor(this.nextReal() * (max - min + 1)) + min;
};
this.nextBit = function() {
return this.nextInt(0, 1);
};
this.shuffle = function(array) {
Beav.Array.shuffle(array, this.nextInt(0, 100000));
};
this.getInitialSeed = function() {
return this.initialSeed;
};
this.reset(initialSeed);
};
## Instruction:
Add option to shuffle safely (at most N/2 fixed points).
## Code After:
var RandomGenerator = function(initialSeed) {
this.reset = function(seed) {
this.initialSeed = seed;
this.counter = (seed % 1000003 + 1) * 4751;
};
this.nextReal = function() {
var number = Math.sin(this.counter) * 10000;
this.counter++;
return number - Math.floor(number);
};
this.nextInt = function(min, max) {
return Math.floor(this.nextReal() * (max - min + 1)) + min;
};
this.nextBit = function() {
return this.nextInt(0, 1);
};
this.shuffle = function(array) {
Beav.Array.shuffle(array, this.nextInt(0, 100000));
};
this.safeShuffle = function(array) {
var permutation = this.generateSafePermutation(array.length);
var backup = $.extend([], array);
for(var index = 0; index < array.length; index++) {
array[index] = backup[permutation[index]];
}
};
this.generateSafePermutation = function(numElements) {
if(numElements <= 1) {
return [0];
}
var permutation = Beav.Array.init(numElements, function(index) {
return index;
});
for(var attempt = 0; attempt < 100; attempt++) {
this.shuffle(permutation);
if(countFixedPoints(permutation) < numElements / 2) {
break;
}
}
return permutation;
};
function countFixedPoints(permutation) {
var result = 0;
for(var index = 0; index < permutation.length; index++) {
if(permutation[index] === index) {
result++;
}
}
return result;
}
this.getInitialSeed = function() {
return this.initialSeed;
};
this.reset(initialSeed);
};
|
4f72ad3042ba35303a2f6fd735a20a8f4291bed4 | .travis.yml | .travis.yml | language: cpp
compiler:
- gcc
- clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
- doxygen
before_install:
- pip install --user cpp-coveralls gcovr
# Install CMake 3.1.2
- wget https://github.com/Viq111/travis-container-packets/releases/download/cmake-3.1.2/cmake.tar.bz2
- tar -xjf cmake.tar.bz2
- rm cmake.tar.bz2
- export PATH=$(pwd)/cmake/bin:$PATH
install:
- if [ "$CXX" = "g++" ];
then export CXX="g++-4.8" CC="gcc-4.8" GCC="true";
fi
- ln -fs /usr/bin/gcov-4.8 "$HOME/.local/bin/gcov"
script:
- if [ "$GCC" = "true" ]; then
make covered;
else
make test;
fi
after_success:
- if [ "$GCC" = "true" ]; then
coveralls --exclude="thirdparty" --exclude="tests" --exclude build/CMakeFiles;
scripts/doxygen-to-gh-pages.sh;
fi
notifications:
email: false
sudo: false
| language: cpp
compiler:
- gcc
- clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
- doxygen
before_install:
- pip install --user cpp-coveralls gcovr
# Install CMake 3.1.2
- wget https://github.com/Viq111/travis-container-packets/releases/download/cmake-3.1.2/cmake.tar.bz2
- tar -xjf cmake.tar.bz2
- rm cmake.tar.bz2
- export PATH=$(pwd)/cmake/bin:$PATH
install:
- if [ "$CXX" = "g++" ];
then export CXX="g++-4.8" CC="gcc-4.8" GCC="true";
fi
- ln -fs /usr/bin/gcov-4.8 "$HOME/.local/bin/gcov"
script:
- if [ "$GCC" = "true" ]; then
make covered;
else
make test;
fi
after_success:
- if [ "$GCC" = "true" ]; then
coveralls --exclude="thirdparty" --exclude="tests" --exclude "build/CMakeFiles" --exclude "cmake";
scripts/doxygen-to-gh-pages.sh;
fi
notifications:
email: false
sudo: false
| Exclude cmake directory from coverage | Exclude cmake directory from coverage
| YAML | apache-2.0 | Chippiewill/phosphor,Chippiewill/phosphor | yaml | ## Code Before:
language: cpp
compiler:
- gcc
- clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
- doxygen
before_install:
- pip install --user cpp-coveralls gcovr
# Install CMake 3.1.2
- wget https://github.com/Viq111/travis-container-packets/releases/download/cmake-3.1.2/cmake.tar.bz2
- tar -xjf cmake.tar.bz2
- rm cmake.tar.bz2
- export PATH=$(pwd)/cmake/bin:$PATH
install:
- if [ "$CXX" = "g++" ];
then export CXX="g++-4.8" CC="gcc-4.8" GCC="true";
fi
- ln -fs /usr/bin/gcov-4.8 "$HOME/.local/bin/gcov"
script:
- if [ "$GCC" = "true" ]; then
make covered;
else
make test;
fi
after_success:
- if [ "$GCC" = "true" ]; then
coveralls --exclude="thirdparty" --exclude="tests" --exclude build/CMakeFiles;
scripts/doxygen-to-gh-pages.sh;
fi
notifications:
email: false
sudo: false
## Instruction:
Exclude cmake directory from coverage
## Code After:
language: cpp
compiler:
- gcc
- clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
- doxygen
before_install:
- pip install --user cpp-coveralls gcovr
# Install CMake 3.1.2
- wget https://github.com/Viq111/travis-container-packets/releases/download/cmake-3.1.2/cmake.tar.bz2
- tar -xjf cmake.tar.bz2
- rm cmake.tar.bz2
- export PATH=$(pwd)/cmake/bin:$PATH
install:
- if [ "$CXX" = "g++" ];
then export CXX="g++-4.8" CC="gcc-4.8" GCC="true";
fi
- ln -fs /usr/bin/gcov-4.8 "$HOME/.local/bin/gcov"
script:
- if [ "$GCC" = "true" ]; then
make covered;
else
make test;
fi
after_success:
- if [ "$GCC" = "true" ]; then
coveralls --exclude="thirdparty" --exclude="tests" --exclude "build/CMakeFiles" --exclude "cmake";
scripts/doxygen-to-gh-pages.sh;
fi
notifications:
email: false
sudo: false
|
2590489dc5fb0652fff7dd374c8c5ebf7d1ea50a | app/views/container/explorer.html.haml | app/views/container/explorer.html.haml | - if @showtype == "timeline"
= render(:partial => "layouts/tl_show")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif @showtype == "performance"
= render(:partial => "layouts/performance")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif TreeBuilder.get_model_for_prefix(@nodetype) == "Container"
-# Showing a specific Service
= render :partial => "container_show", :locals => {:controller => "container"}
- else
-# Showing a list of Containers
= render :partial => 'layouts/x_gtl'
| - content_for :search do
= render(:partial => "layouts/x_adv_searchbox")
= render(:partial => 'layouts/quick_search')
#main_div
- if @showtype == "timeline"
= render(:partial => "layouts/tl_show")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif @showtype == "performance"
= render(:partial => "layouts/performance")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif TreeBuilder.get_model_for_prefix(@nodetype) == "Container"
-# Showing a specific Service
= render :partial => "container_show", :locals => {:controller => "container"}
- else
-# Showing a list of Containers
= render :partial => 'layouts/x_gtl'
| Add adv. search to Containers explorer | Add adv. search to Containers explorer
| Haml | apache-2.0 | juliancheal/manageiq,jameswnl/manageiq,israel-hdez/manageiq,tzumainn/manageiq,romanblanco/manageiq,lpichler/manageiq,ilackarms/manageiq,NickLaMuro/manageiq,tinaafitz/manageiq,gerikis/manageiq,mfeifer/manageiq,josejulio/manageiq,ilackarms/manageiq,ilackarms/manageiq,aufi/manageiq,syncrou/manageiq,mfeifer/manageiq,djberg96/manageiq,pkomanek/manageiq,kbrock/manageiq,d-m-u/manageiq,kbrock/manageiq,skateman/manageiq,kbrock/manageiq,branic/manageiq,juliancheal/manageiq,NaNi-Z/manageiq,chessbyte/manageiq,aufi/manageiq,branic/manageiq,mzazrivec/manageiq,jntullo/manageiq,agrare/manageiq,ailisp/manageiq,yaacov/manageiq,skateman/manageiq,josejulio/manageiq,josejulio/manageiq,yaacov/manageiq,borod108/manageiq,mzazrivec/manageiq,jrafanie/manageiq,NickLaMuro/manageiq,borod108/manageiq,fbladilo/manageiq,mfeifer/manageiq,agrare/manageiq,durandom/manageiq,matobet/manageiq,NaNi-Z/manageiq,NickLaMuro/manageiq,mresti/manageiq,gerikis/manageiq,billfitzgerald0120/manageiq,chessbyte/manageiq,skateman/manageiq,jvlcek/manageiq,ilackarms/manageiq,matobet/manageiq,hstastna/manageiq,agrare/manageiq,pkomanek/manageiq,mresti/manageiq,israel-hdez/manageiq,NaNi-Z/manageiq,juliancheal/manageiq,jameswnl/manageiq,mresti/manageiq,billfitzgerald0120/manageiq,lpichler/manageiq,ailisp/manageiq,josejulio/manageiq,romanblanco/manageiq,aufi/manageiq,billfitzgerald0120/manageiq,fbladilo/manageiq,romanblanco/manageiq,tinaafitz/manageiq,mfeifer/manageiq,branic/manageiq,syncrou/manageiq,tzumainn/manageiq,ManageIQ/manageiq,mkanoor/manageiq,hstastna/manageiq,ManageIQ/manageiq,jvlcek/manageiq,juliancheal/manageiq,gerikis/manageiq,jrafanie/manageiq,ManageIQ/manageiq,branic/manageiq,fbladilo/manageiq,mkanoor/manageiq,hstastna/manageiq,chessbyte/manageiq,andyvesel/manageiq,pkomanek/manageiq,gmcculloug/manageiq,hstastna/manageiq,tinaafitz/manageiq,aufi/manageiq,billfitzgerald0120/manageiq,jvlcek/manageiq,jameswnl/manageiq,durandom/manageiq,djberg96/manageiq,kbrock/manageiq,israel-hdez/manageiq,tzumainn/manageiq,gmcculloug/manageiq,d-m-u/manageiq,jrafanie/manageiq,fbladilo/manageiq,d-m-u/manageiq,pkomanek/manageiq,mkanoor/manageiq,ailisp/manageiq,jameswnl/manageiq,ailisp/manageiq,skateman/manageiq,agrare/manageiq,gmcculloug/manageiq,lpichler/manageiq,jvlcek/manageiq,yaacov/manageiq,borod108/manageiq,andyvesel/manageiq,matobet/manageiq,yaacov/manageiq,ManageIQ/manageiq,israel-hdez/manageiq,syncrou/manageiq,jrafanie/manageiq,mkanoor/manageiq,syncrou/manageiq,jntullo/manageiq,jntullo/manageiq,d-m-u/manageiq,durandom/manageiq,djberg96/manageiq,mzazrivec/manageiq,gerikis/manageiq,andyvesel/manageiq,andyvesel/manageiq,mresti/manageiq,djberg96/manageiq,NickLaMuro/manageiq,jntullo/manageiq,lpichler/manageiq,tinaafitz/manageiq,NaNi-Z/manageiq,chessbyte/manageiq,matobet/manageiq,borod108/manageiq,gmcculloug/manageiq,romanblanco/manageiq,tzumainn/manageiq,mzazrivec/manageiq,durandom/manageiq | haml | ## Code Before:
- if @showtype == "timeline"
= render(:partial => "layouts/tl_show")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif @showtype == "performance"
= render(:partial => "layouts/performance")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif TreeBuilder.get_model_for_prefix(@nodetype) == "Container"
-# Showing a specific Service
= render :partial => "container_show", :locals => {:controller => "container"}
- else
-# Showing a list of Containers
= render :partial => 'layouts/x_gtl'
## Instruction:
Add adv. search to Containers explorer
## Code After:
- content_for :search do
= render(:partial => "layouts/x_adv_searchbox")
= render(:partial => 'layouts/quick_search')
#main_div
- if @showtype == "timeline"
= render(:partial => "layouts/tl_show")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif @showtype == "performance"
= render(:partial => "layouts/performance")
:javascript
ManageIQ.afterOnload = "miqAsyncAjax('#{url_for(:action => @ajax_action, :id => @record)}');"
- elsif TreeBuilder.get_model_for_prefix(@nodetype) == "Container"
-# Showing a specific Service
= render :partial => "container_show", :locals => {:controller => "container"}
- else
-# Showing a list of Containers
= render :partial => 'layouts/x_gtl'
|
052c79f7449f50c282a61b40d4a9c913a889c0d9 | .travis.yml | .travis.yml | language: node_js
node_js:
- 'node'
- '6'
- '4'
| language: node_js
node_js:
- node
- '6'
- '4'
deploy:
provider: npm
email: marcus@stade.se
api_key:
secure: ztmhu+UTP+kF0QJYDGNMzdToqsoDgRhyvY8oK1+J32Z2uVJis0hjDAVVIJ8W8vSbsYLAYsgqj22vpidMOycfNAjhLVKyY/Jq5qqzYpJLJFKm2b2SM1BFXmkvyFAnYvlnOfxBZcDl5tKaPVU3AOb6FnLXL/RRreHk7H/eRKra3VX3QRPlCnm/CZi7ukYb3jA+27nu755vGlGKC8lpjYsYG2FPrU0XAFBW7GuQpjPut3vsqIaNduyn3m40cbbyxsZCJ2qw4d1AJx/V74TCzYt1oPWRtC7i8Fxi0Cs99MixJp5kAEfI+gDOc3L4mTgLlI/J7DR85wLHpZ6KZaVID7cCtNTndXtb5I8I5MEW+MP09nE0pa4qG9OWtZ2hzORPaENLE8GnXW1NPSX11MrUzUycLSqv0fTn7z94x2iTY4VvnwVVghokI/hOJpXJ/Y9e4JDpZUETLj9g3UTR41/AwSPfvXOy8w4MGLLwbenlitNaTu8fEITKrOEIzKiC9xZiz6Q783afihKUVK2LWJictNxsAPdz/a1I4hl9dFSgCltOvwLajJnCQBP9cKk8YO6mttWt4CbxxtpceBhGcZrr9WirOzWboUBbLPSMGlKUks6f7t98PxJNpoGnHIIfm7wqggUN+Ma1sG3tFvTMAs3jcGAgT9nTFseFMoXvrMvd2brPGW4=
skip_cleanup: true
on:
tags: true
repo: zambezi/ez-build
all_branches: true
| Enable continuous deployment to npm whenever a new release is cut | Enable continuous deployment to npm whenever a new release is cut
Whenever a semver tag is pushed, this will trigger a deployment
to npm. Used in conjunction with zambezi/prepare-release this
makes for a very nice release process.
| YAML | mit | zambezi/ez-build,zambezi/ez-build | yaml | ## Code Before:
language: node_js
node_js:
- 'node'
- '6'
- '4'
## Instruction:
Enable continuous deployment to npm whenever a new release is cut
Whenever a semver tag is pushed, this will trigger a deployment
to npm. Used in conjunction with zambezi/prepare-release this
makes for a very nice release process.
## Code After:
language: node_js
node_js:
- node
- '6'
- '4'
deploy:
provider: npm
email: marcus@stade.se
api_key:
secure: ztmhu+UTP+kF0QJYDGNMzdToqsoDgRhyvY8oK1+J32Z2uVJis0hjDAVVIJ8W8vSbsYLAYsgqj22vpidMOycfNAjhLVKyY/Jq5qqzYpJLJFKm2b2SM1BFXmkvyFAnYvlnOfxBZcDl5tKaPVU3AOb6FnLXL/RRreHk7H/eRKra3VX3QRPlCnm/CZi7ukYb3jA+27nu755vGlGKC8lpjYsYG2FPrU0XAFBW7GuQpjPut3vsqIaNduyn3m40cbbyxsZCJ2qw4d1AJx/V74TCzYt1oPWRtC7i8Fxi0Cs99MixJp5kAEfI+gDOc3L4mTgLlI/J7DR85wLHpZ6KZaVID7cCtNTndXtb5I8I5MEW+MP09nE0pa4qG9OWtZ2hzORPaENLE8GnXW1NPSX11MrUzUycLSqv0fTn7z94x2iTY4VvnwVVghokI/hOJpXJ/Y9e4JDpZUETLj9g3UTR41/AwSPfvXOy8w4MGLLwbenlitNaTu8fEITKrOEIzKiC9xZiz6Q783afihKUVK2LWJictNxsAPdz/a1I4hl9dFSgCltOvwLajJnCQBP9cKk8YO6mttWt4CbxxtpceBhGcZrr9WirOzWboUBbLPSMGlKUks6f7t98PxJNpoGnHIIfm7wqggUN+Ma1sG3tFvTMAs3jcGAgT9nTFseFMoXvrMvd2brPGW4=
skip_cleanup: true
on:
tags: true
repo: zambezi/ez-build
all_branches: true
|
1468f5a88cb817b5b74590b1d01ae0cd3c158b8f | app/graphql/types/team_member_type.rb | app/graphql/types/team_member_type.rb | class Types::TeamMemberType < Types::BaseObject
graphql_name 'TeamMember'
authorize_record
field :id, Int, null: false
field :display, Boolean, null: false, deprecation_reason: 'Use display_team_member instead'
field :display_team_member, Boolean, null: false
field :show_email, Boolean, null: false, camelize: false
field :receive_con_email, Boolean, null: false, camelize: false
field :receive_signup_email, Types::ReceiveSignupEmailType, null: false, camelize: false
field :email, String, null: true
field :event, Types::EventType, null: false
field :user_con_profile, Types::UserConProfileType, null: false, camelize: false
association_loaders TeamMember, :event, :user_con_profile
def receive_signup_email
object.receive_signup_email.upcase
end
def display
display_team_member
end
def display_team_member
!!object.display
end
def show_email
!!object.show_email
end
def receive_con_email
!!object.receive_con_email
end
def email
return nil unless current_user
object.email
end
end
| class Types::TeamMemberType < Types::BaseObject
graphql_name 'TeamMember'
authorize_record
field :id, Int, null: false
field :display, Boolean,
null: false,
resolver_method: :display_team_member,
deprecation_reason: 'Use display_team_member instead'
field :display_team_member, Boolean, null: false
field :show_email, Boolean, null: false, camelize: false
field :receive_con_email, Boolean, null: false, camelize: false
field :receive_signup_email, Types::ReceiveSignupEmailType, null: false, camelize: false
field :email, String, null: true
field :event, Types::EventType, null: false
field :user_con_profile, Types::UserConProfileType, null: false, camelize: false
association_loaders TeamMember, :event, :user_con_profile
def receive_signup_email
object.receive_signup_email.upcase
end
def display_team_member
!!object.display
end
def show_email
!!object.show_email
end
def receive_con_email
!!object.receive_con_email
end
def email
return nil unless current_user
object.email
end
end
| Fix deprecation warning from graphql-ruby | Fix deprecation warning from graphql-ruby
| Ruby | mit | neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode | ruby | ## Code Before:
class Types::TeamMemberType < Types::BaseObject
graphql_name 'TeamMember'
authorize_record
field :id, Int, null: false
field :display, Boolean, null: false, deprecation_reason: 'Use display_team_member instead'
field :display_team_member, Boolean, null: false
field :show_email, Boolean, null: false, camelize: false
field :receive_con_email, Boolean, null: false, camelize: false
field :receive_signup_email, Types::ReceiveSignupEmailType, null: false, camelize: false
field :email, String, null: true
field :event, Types::EventType, null: false
field :user_con_profile, Types::UserConProfileType, null: false, camelize: false
association_loaders TeamMember, :event, :user_con_profile
def receive_signup_email
object.receive_signup_email.upcase
end
def display
display_team_member
end
def display_team_member
!!object.display
end
def show_email
!!object.show_email
end
def receive_con_email
!!object.receive_con_email
end
def email
return nil unless current_user
object.email
end
end
## Instruction:
Fix deprecation warning from graphql-ruby
## Code After:
class Types::TeamMemberType < Types::BaseObject
graphql_name 'TeamMember'
authorize_record
field :id, Int, null: false
field :display, Boolean,
null: false,
resolver_method: :display_team_member,
deprecation_reason: 'Use display_team_member instead'
field :display_team_member, Boolean, null: false
field :show_email, Boolean, null: false, camelize: false
field :receive_con_email, Boolean, null: false, camelize: false
field :receive_signup_email, Types::ReceiveSignupEmailType, null: false, camelize: false
field :email, String, null: true
field :event, Types::EventType, null: false
field :user_con_profile, Types::UserConProfileType, null: false, camelize: false
association_loaders TeamMember, :event, :user_con_profile
def receive_signup_email
object.receive_signup_email.upcase
end
def display_team_member
!!object.display
end
def show_email
!!object.show_email
end
def receive_con_email
!!object.receive_con_email
end
def email
return nil unless current_user
object.email
end
end
|
af92f591d5aa047ef1222e8e74b1f1956d6116ed | dthm4kaiako/templates/generic/map-javascript.html | dthm4kaiako/templates/generic/map-javascript.html | <script>
var event_markers = [
{% if map_location %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% elif map_locations %}
{% for location in map_locations %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% endfor %}
{% endif %}
];
function initMap() {
var map = new google.maps.Map(
document.getElementById('map'),
{
zoom: {{ map_zoom|default:6 }},
center:
{% if map_location %}
event_markers[0],
{% else %}
{ lat: -41, lng: 174 },
{% endif %}
}
);
for (var i = 0; i < event_markers.length; i++) {
var marker = new google.maps.Marker({ position: event_markers[i], map: map });
}
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key={{ GOOGLE_MAPS_API_KEY }}&callback=initMap">
</script>
| <script>
var event_markers = [
{% if map_location %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% elif map_locations %}
{% for location in map_locations %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% endfor %}
{% endif %}
];
function initMap() {
var map = new google.maps.Map(
document.getElementById('map'),
{
zoom: {{ map_zoom|default:6 }},
center:
{% if map_location %}
event_markers[0],
{% else %}
{ lat: -41, lng: 174 },
{% endif %}
}
);
var map_markers = event_markers.map(function (location, i) {
return new google.maps.Marker({
position: location,
map: map
});
});
{% if map_locations %}
var markerCluster = new MarkerClusterer(map, map_markers,
{ imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m' });
{% endif %}
}
</script>
{% if map_locations %}
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
{% endif %}
<script async defer
src="https://maps.googleapis.com/maps/api/js?key={{ GOOGLE_MAPS_API_KEY }}&callback=initMap">
</script>
| Add map clustering when multiple nodes are displayed | Add map clustering when multiple nodes are displayed
| HTML | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | html | ## Code Before:
<script>
var event_markers = [
{% if map_location %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% elif map_locations %}
{% for location in map_locations %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% endfor %}
{% endif %}
];
function initMap() {
var map = new google.maps.Map(
document.getElementById('map'),
{
zoom: {{ map_zoom|default:6 }},
center:
{% if map_location %}
event_markers[0],
{% else %}
{ lat: -41, lng: 174 },
{% endif %}
}
);
for (var i = 0; i < event_markers.length; i++) {
var marker = new google.maps.Marker({ position: event_markers[i], map: map });
}
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key={{ GOOGLE_MAPS_API_KEY }}&callback=initMap">
</script>
## Instruction:
Add map clustering when multiple nodes are displayed
## Code After:
<script>
var event_markers = [
{% if map_location %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% elif map_locations %}
{% for location in map_locations %}
{ lat: {{ location.coords.y }}, lng: {{ location.coords.x }} },
{% endfor %}
{% endif %}
];
function initMap() {
var map = new google.maps.Map(
document.getElementById('map'),
{
zoom: {{ map_zoom|default:6 }},
center:
{% if map_location %}
event_markers[0],
{% else %}
{ lat: -41, lng: 174 },
{% endif %}
}
);
var map_markers = event_markers.map(function (location, i) {
return new google.maps.Marker({
position: location,
map: map
});
});
{% if map_locations %}
var markerCluster = new MarkerClusterer(map, map_markers,
{ imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m' });
{% endif %}
}
</script>
{% if map_locations %}
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
{% endif %}
<script async defer
src="https://maps.googleapis.com/maps/api/js?key={{ GOOGLE_MAPS_API_KEY }}&callback=initMap">
</script>
|
818331e3d53abc615fc69dca8d3203c5684d6855 | .travis.yml | .travis.yml | dist: trusty
language: node_js
node_js:
- lts/*
- node
jobs:
include:
- stage: build
script: npm run build
| language: node_js
node_js:
- lts/*
- node
before_script: npm run clean && node bin/asc -v && npm test
script: npm run build && node bin/asc -v && npm test
| Test both sources and distribution | Test both sources and distribution
| YAML | apache-2.0 | MaxGraey/AssemblyScript,MaxGraey/AssemblyScript,MaxGraey/AssemblyScript,MaxGraey/AssemblyScript,MaxGraey/AssemblyScript | yaml | ## Code Before:
dist: trusty
language: node_js
node_js:
- lts/*
- node
jobs:
include:
- stage: build
script: npm run build
## Instruction:
Test both sources and distribution
## Code After:
language: node_js
node_js:
- lts/*
- node
before_script: npm run clean && node bin/asc -v && npm test
script: npm run build && node bin/asc -v && npm test
|
5a86218a29e23718e40f38790ecd9b2773d7764a | opencog/rule-engine/backwardchainer/CMakeLists.txt | opencog/rule-engine/backwardchainer/CMakeLists.txt | INSTALL (FILES
BackwardChainerPMCB.h
DESTINATION "include/opencog/rule-engine/backwardchainer"
)
| INSTALL (FILES
BackwardChainer.h
BackwardChainerPMCB.h
DESTINATION "include/opencog/rule-engine/backwardchainer"
)
| Add BackwardChainer.h to cmake install list | Add BackwardChainer.h to cmake install list
| Text | agpl-3.0 | AmeBel/atomspace,misgeatgit/atomspace,inflector/atomspace,ceefour/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,yantrabuddhi/atomspace,ArvinPan/atomspace,misgeatgit/atomspace,yantrabuddhi/atomspace,misgeatgit/atomspace,ceefour/atomspace,yantrabuddhi/atomspace,ArvinPan/atomspace,inflector/atomspace,rTreutlein/atomspace,inflector/atomspace,ArvinPan/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,inflector/atomspace,ceefour/atomspace,ceefour/atomspace,AmeBel/atomspace,ArvinPan/atomspace,inflector/atomspace,rTreutlein/atomspace,misgeatgit/atomspace,AmeBel/atomspace,yantrabuddhi/atomspace,misgeatgit/atomspace,yantrabuddhi/atomspace | text | ## Code Before:
INSTALL (FILES
BackwardChainerPMCB.h
DESTINATION "include/opencog/rule-engine/backwardchainer"
)
## Instruction:
Add BackwardChainer.h to cmake install list
## Code After:
INSTALL (FILES
BackwardChainer.h
BackwardChainerPMCB.h
DESTINATION "include/opencog/rule-engine/backwardchainer"
)
|
cec75e9152f612579ad95f094ee825df85a3977a | .github/workflows/ruby.yml | .github/workflows/ruby.yml | name: Ruby
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '2.5.4', '2.6.5', 'ruby-head', 'jruby-9.2.9.0', 'jruby-head' ]
steps:
- uses: actions/checkout@v1
- name: Set up RVM
run: |
curl -sSL https://get.rvm.io | bash
- name: Set up Ruby
run: |
source $HOME/.rvm/scripts/rvm
rvm install ${{ matrix.ruby }} --binary
rvm --default use ${{ matrix.ruby }}
- name: Build and test with Rake
run: |
source $HOME/.rvm/scripts/rvm
gem i test-unit
rake
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Test performance and accuracy
run: |
gem install bundler
bundle install --jobs 4 --retry 2
gem uni did_you_mean
bundle exec rake test:accuracy
bundle exec rake test:explore
bundle exec rake benchmark:memory
| name: Ruby
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '2.5.8', '2.6.6', '2.7.1', 'ruby-head', 'jruby-9.2.11.1', 'jruby-head' ]
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Build and test with Rake
run: |
gem i test-unit
rake
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
- name: Test performance and accuracy
run: |
gem install bundler
bundle install --jobs 4 --retry 2
gem uni did_you_mean
bundle exec rake test:accuracy
bundle exec rake test:explore
bundle exec rake benchmark:memory
| Use GH action box maintained by Ruby core | Use GH action box maintained by Ruby core
| YAML | mit | yuki24/did_you_mean | yaml | ## Code Before:
name: Ruby
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '2.5.4', '2.6.5', 'ruby-head', 'jruby-9.2.9.0', 'jruby-head' ]
steps:
- uses: actions/checkout@v1
- name: Set up RVM
run: |
curl -sSL https://get.rvm.io | bash
- name: Set up Ruby
run: |
source $HOME/.rvm/scripts/rvm
rvm install ${{ matrix.ruby }} --binary
rvm --default use ${{ matrix.ruby }}
- name: Build and test with Rake
run: |
source $HOME/.rvm/scripts/rvm
gem i test-unit
rake
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Test performance and accuracy
run: |
gem install bundler
bundle install --jobs 4 --retry 2
gem uni did_you_mean
bundle exec rake test:accuracy
bundle exec rake test:explore
bundle exec rake benchmark:memory
## Instruction:
Use GH action box maintained by Ruby core
## Code After:
name: Ruby
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '2.5.8', '2.6.6', '2.7.1', 'ruby-head', 'jruby-9.2.11.1', 'jruby-head' ]
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Build and test with Rake
run: |
gem i test-unit
rake
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
- name: Test performance and accuracy
run: |
gem install bundler
bundle install --jobs 4 --retry 2
gem uni did_you_mean
bundle exec rake test:accuracy
bundle exec rake test:explore
bundle exec rake benchmark:memory
|
93da664c36b47e478b7f52e1510a24d73f4f8d1d | runtime/src/chplexit.c | runtime/src/chplexit.c |
static void chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
chpl_comm_barrier("chpl_comm_exit_all");
chpl_comm_stopPollingTask();
chpl_task_exit();
chpl_reportMemInfo();
chpl_mem_exit();
chpl_comm_exit_all(status);
} else {
chpl_mem_exit();
chpl_comm_exit_any(status);
}
exit(status);
}
void chpl_exit_all(int status) {
chpl_exit_common(status, 1);
}
void chpl_exit_any(int status) {
chpl_exit_common(status, 0);
}
|
static void chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
chpl_comm_barrier("chpl_exit_common");
chpl_comm_stopPollingTask();
chpl_task_exit();
chpl_reportMemInfo();
chpl_mem_exit();
chpl_comm_exit_all(status);
} else {
chpl_mem_exit();
chpl_comm_exit_any(status);
}
exit(status);
}
void chpl_exit_all(int status) {
chpl_exit_common(status, 1);
}
void chpl_exit_any(int status) {
chpl_exit_common(status, 0);
}
| Clarify the debug message that may be generated by the chpl_comm_barrier() call in chpl_exit_common(). | Clarify the debug message that may be generated by the
chpl_comm_barrier() call in chpl_exit_common().
git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@19217 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
| C | apache-2.0 | chizarlicious/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,chizarlicious/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,sungeunchoi/chapel | c | ## Code Before:
static void chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
chpl_comm_barrier("chpl_comm_exit_all");
chpl_comm_stopPollingTask();
chpl_task_exit();
chpl_reportMemInfo();
chpl_mem_exit();
chpl_comm_exit_all(status);
} else {
chpl_mem_exit();
chpl_comm_exit_any(status);
}
exit(status);
}
void chpl_exit_all(int status) {
chpl_exit_common(status, 1);
}
void chpl_exit_any(int status) {
chpl_exit_common(status, 0);
}
## Instruction:
Clarify the debug message that may be generated by the
chpl_comm_barrier() call in chpl_exit_common().
git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@19217 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
## Code After:
static void chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
chpl_comm_barrier("chpl_exit_common");
chpl_comm_stopPollingTask();
chpl_task_exit();
chpl_reportMemInfo();
chpl_mem_exit();
chpl_comm_exit_all(status);
} else {
chpl_mem_exit();
chpl_comm_exit_any(status);
}
exit(status);
}
void chpl_exit_all(int status) {
chpl_exit_common(status, 1);
}
void chpl_exit_any(int status) {
chpl_exit_common(status, 0);
}
|
f67108e6d5b21a48c8b237bd0d5bd86c6c900e6d | README.md | README.md |
A [JSON-RPC 2.0](http://www.jsonrpc.org/specification) client implementation, which can be used with an arbitrary transport. For corresponding server implementation, see [json-rpc-server](https://github.com/claudijo/json-rpc-server).
> The Client is defined as the origin of Request objects and the handler of Response objects.
# License
[MIT](LICENSE)
|
A [JSON-RPC 2.0](http://www.jsonrpc.org/specification) client implementation, which can be used with an arbitrary transport. For corresponding server implementation, see [json-rpc-server](https://github.com/claudijo/json-rpc-server).
> The Client is defined as the origin of Request objects and the handler of Response objects.
# Test
Run unit tests;
`$ npm test`
Create test coverage report:
`$ npm run-script test-cov`
# License
[MIT](LICENSE)
| Add instruction on how to run tests. | Add instruction on how to run tests.
| Markdown | mit | claudijo/json-rpc-client | markdown | ## Code Before:
A [JSON-RPC 2.0](http://www.jsonrpc.org/specification) client implementation, which can be used with an arbitrary transport. For corresponding server implementation, see [json-rpc-server](https://github.com/claudijo/json-rpc-server).
> The Client is defined as the origin of Request objects and the handler of Response objects.
# License
[MIT](LICENSE)
## Instruction:
Add instruction on how to run tests.
## Code After:
A [JSON-RPC 2.0](http://www.jsonrpc.org/specification) client implementation, which can be used with an arbitrary transport. For corresponding server implementation, see [json-rpc-server](https://github.com/claudijo/json-rpc-server).
> The Client is defined as the origin of Request objects and the handler of Response objects.
# Test
Run unit tests;
`$ npm test`
Create test coverage report:
`$ npm run-script test-cov`
# License
[MIT](LICENSE)
|
3f706b352a97bd07e61c5285ee71ef0323e1f7f2 | _layouts/default.html | _layouts/default.html | <!DOCTYPE html5>
<html>
<head>
<title>{{ page.title }}</title>
<meta charset="utf-8" />
<meta name="description" content="Codemania - New Zealand's premier developer conference" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" media="screen" />
</head>
<body class="lunchBox">
<div id="mainBody">
{{ content }}
</div>
<div id="menu">
<ul class="nav">
<li>
<a id="topLink" href="/" class="navLink">HOME</a>
</li>
</ul>
</div>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
</body> | <!DOCTYPE html5>
<html>
<head>
<title>{{ page.title }}</title>
<meta charset="utf-8" />
<meta name="description" content="Codemania - New Zealand's premier developer conference" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" media="screen" />
</head>
<body class="lunchBox">
<div id="mainBody">
{{ content }}
</div>
<div id="menu">
<ul class="nav">
<li>
<a id="topLink" href="/" class="navLink">HOME</a>
</li>
<li>
<a href="/nostalgia.html" class="navLink">NOSTALGIA</a>
</li>
</ul>
</div>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
</body> | Add nostalgia link to menu | Add nostalgia link to menu
| HTML | mit | codemania/codemania.github.io,codemania/codemania.github.io,codemania/codemania.github.io | html | ## Code Before:
<!DOCTYPE html5>
<html>
<head>
<title>{{ page.title }}</title>
<meta charset="utf-8" />
<meta name="description" content="Codemania - New Zealand's premier developer conference" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" media="screen" />
</head>
<body class="lunchBox">
<div id="mainBody">
{{ content }}
</div>
<div id="menu">
<ul class="nav">
<li>
<a id="topLink" href="/" class="navLink">HOME</a>
</li>
</ul>
</div>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
</body>
## Instruction:
Add nostalgia link to menu
## Code After:
<!DOCTYPE html5>
<html>
<head>
<title>{{ page.title }}</title>
<meta charset="utf-8" />
<meta name="description" content="Codemania - New Zealand's premier developer conference" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" media="screen" />
</head>
<body class="lunchBox">
<div id="mainBody">
{{ content }}
</div>
<div id="menu">
<ul class="nav">
<li>
<a id="topLink" href="/" class="navLink">HOME</a>
</li>
<li>
<a href="/nostalgia.html" class="navLink">NOSTALGIA</a>
</li>
</ul>
</div>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
</body> |
fe30e0bbce03b7a3738f02baf5e768bd263e690e | spec/features/reordering_topic_sections.rb | spec/features/reordering_topic_sections.rb | require 'rails_helper'
RSpec.describe 'Re-ordering topic sections', type: :feature, js: true do
before do
stub_any_publishing_api_call
# Ensure that all elements are within the browser 'viewport' when dragging
# things around by making the page really tall
page.driver.resize(1024, 2000)
end
it 'lets you re-order topic sections' do
topic = create(:topic)
topic.topic_sections << create(:topic_section, title: "Section B", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section A", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section C", topic: topic)
visit edit_topic_path(topic)
drag_topic_section_above("Section A", "Section B")
click_button "Save"
expect(sections_in_order).to eq ["Section A", "Section B", "Section C"]
end
private
def drag_topic_section_above(dragged_section_title, destination_section_title)
handle = within_topic_section dragged_section_title do
find('.js-topic-section-handle')
end
destination = within_topic_section destination_section_title do
find('.js-topic-section-handle')
end
handle.drag_to destination
end
def sections_in_order
all('.list-group-item input[placeholder="Heading Title"]').map &:value
end
end
| require 'rails_helper'
RSpec.describe 'Re-ordering topic sections', type: :feature, js: true do
before do
stub_any_publishing_api_call
# Ensure that all elements are within the browser 'viewport' when dragging
# things around by making the page really tall
page.driver.resize(1024, 2000)
end
it 'lets you re-order topic sections' do
topic = create(:topic)
topic.topic_sections << create(:topic_section, title: "Section B", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section A", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section C", topic: topic)
visit edit_topic_path(topic)
drag_topic_section_above("Section A", "Section B")
click_button "Save"
expect(sections_in_order).to eq ["Section A", "Section B", "Section C"]
end
private
def handle_for_topic_section(section_title)
within_topic_section(section_title) { find('.js-topic-section-handle') }
end
def drag_topic_section_above(dragged_section_title, destination_section_title)
handle_for_topic_section(dragged_section_title).drag_to(
handle_for_topic_section(destination_section_title)
)
end
def sections_in_order
all('.list-group-item input[placeholder="Heading Title"]').map &:value
end
end
| Tidy up reordering topic section feature spec helpers | Tidy up reordering topic section feature spec helpers
| Ruby | mit | alphagov/service-manual-publisher,alphagov/service-manual-publisher,alphagov/service-manual-publisher | ruby | ## Code Before:
require 'rails_helper'
RSpec.describe 'Re-ordering topic sections', type: :feature, js: true do
before do
stub_any_publishing_api_call
# Ensure that all elements are within the browser 'viewport' when dragging
# things around by making the page really tall
page.driver.resize(1024, 2000)
end
it 'lets you re-order topic sections' do
topic = create(:topic)
topic.topic_sections << create(:topic_section, title: "Section B", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section A", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section C", topic: topic)
visit edit_topic_path(topic)
drag_topic_section_above("Section A", "Section B")
click_button "Save"
expect(sections_in_order).to eq ["Section A", "Section B", "Section C"]
end
private
def drag_topic_section_above(dragged_section_title, destination_section_title)
handle = within_topic_section dragged_section_title do
find('.js-topic-section-handle')
end
destination = within_topic_section destination_section_title do
find('.js-topic-section-handle')
end
handle.drag_to destination
end
def sections_in_order
all('.list-group-item input[placeholder="Heading Title"]').map &:value
end
end
## Instruction:
Tidy up reordering topic section feature spec helpers
## Code After:
require 'rails_helper'
RSpec.describe 'Re-ordering topic sections', type: :feature, js: true do
before do
stub_any_publishing_api_call
# Ensure that all elements are within the browser 'viewport' when dragging
# things around by making the page really tall
page.driver.resize(1024, 2000)
end
it 'lets you re-order topic sections' do
topic = create(:topic)
topic.topic_sections << create(:topic_section, title: "Section B", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section A", topic: topic)
topic.topic_sections << create(:topic_section, title: "Section C", topic: topic)
visit edit_topic_path(topic)
drag_topic_section_above("Section A", "Section B")
click_button "Save"
expect(sections_in_order).to eq ["Section A", "Section B", "Section C"]
end
private
def handle_for_topic_section(section_title)
within_topic_section(section_title) { find('.js-topic-section-handle') }
end
def drag_topic_section_above(dragged_section_title, destination_section_title)
handle_for_topic_section(dragged_section_title).drag_to(
handle_for_topic_section(destination_section_title)
)
end
def sections_in_order
all('.list-group-item input[placeholder="Heading Title"]').map &:value
end
end
|
e3586ce2fd93c67f6b0bf7bd92ee1a5a4531516c | docs/src/donating.rst | docs/src/donating.rst | 🌷️ Thank you for your interest in supporting Cython! 🌷️
======================================================
Managing, maintaining and advancing a project as large as Cython takes
**a lot of time and dedication**. This is really a full-time job that
is currently done by **Stefan Behnel**, paid by users just like you.
**Your support can make a difference**
for improving a great tool that helps you every day!
Please consider signing a subscription for continuous project support via
* `GitHub Sponsors <https://github.com/users/scoder/sponsorship>`_
* `Tidelift <https://tidelift.com/subscription/pkg/pypi-cython>`_
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
or donating via
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
| 🌷️ Thank you for your interest in supporting Cython! 🌷️
=========================================================
Managing, maintaining and advancing a project as large as Cython takes
**a lot of time and dedication**. This is really a full-time job that
is currently done by **Stefan Behnel**, paid by users just like you.
**Your support can make a difference**
for improving a great tool that helps you every day!
Please consider signing a subscription for continuous project support via
* `GitHub Sponsors <https://github.com/users/scoder/sponsorship>`_
* `Tidelift <https://tidelift.com/subscription/pkg/pypi-cython>`_
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
or donating via
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
Note that PayPal takes 5 - 15% fees for small non-EUR payments,
which is money that you pay without helping us.
Consider signing up for a GitHub Sponsors subscription instead.
| Add a note on PayPal fees for small payments. | Add a note on PayPal fees for small payments.
| reStructuredText | apache-2.0 | da-woods/cython,scoder/cython,scoder/cython,scoder/cython,da-woods/cython,cython/cython,cython/cython,cython/cython,da-woods/cython,scoder/cython,cython/cython,da-woods/cython | restructuredtext | ## Code Before:
🌷️ Thank you for your interest in supporting Cython! 🌷️
======================================================
Managing, maintaining and advancing a project as large as Cython takes
**a lot of time and dedication**. This is really a full-time job that
is currently done by **Stefan Behnel**, paid by users just like you.
**Your support can make a difference**
for improving a great tool that helps you every day!
Please consider signing a subscription for continuous project support via
* `GitHub Sponsors <https://github.com/users/scoder/sponsorship>`_
* `Tidelift <https://tidelift.com/subscription/pkg/pypi-cython>`_
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
or donating via
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
## Instruction:
Add a note on PayPal fees for small payments.
## Code After:
🌷️ Thank you for your interest in supporting Cython! 🌷️
=========================================================
Managing, maintaining and advancing a project as large as Cython takes
**a lot of time and dedication**. This is really a full-time job that
is currently done by **Stefan Behnel**, paid by users just like you.
**Your support can make a difference**
for improving a great tool that helps you every day!
Please consider signing a subscription for continuous project support via
* `GitHub Sponsors <https://github.com/users/scoder/sponsorship>`_
* `Tidelift <https://tidelift.com/subscription/pkg/pypi-cython>`_
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
or donating via
* `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HLS9JEYD4ETB6&source=url>`_
Note that PayPal takes 5 - 15% fees for small non-EUR payments,
which is money that you pay without helping us.
Consider signing up for a GitHub Sponsors subscription instead.
|
604d5a0ebadbd275dc3f5abe5e1cae252f4783af | lib/app/routes/solutions.rb | lib/app/routes/solutions.rb | module ExercismWeb
module Routes
class Solutions < Core
get '/code/:language/:slug/random' do |language, slug|
please_login
language, slug = language.downcase, slug.downcase
problem = Problem.new(language, slug)
unless current_user.nitpicker_on?(problem)
flash[:notice] = "You'll have access to that page when you complete #{slug} in #{language}"
redirect '/'
end
submission = Submission.random_completed_for(problem)
total = Submission.completed_for(problem).count
erb :"code/random", locals: {submission: submission, total: total}
end
end
end
end
| module ExercismWeb
module Routes
class Solutions < Core
get '/code/:language/:slug/random' do |language, slug|
please_login
language, slug = language.downcase, slug.downcase
problem = Problem.new(language, slug)
unless current_user.nitpicker_on?(problem)
flash[:notice] = "You'll have access to that page when you complete #{slug} in #{language}"
redirect '/'
end
submission = Submission.random_completed_for(problem)
total = Submission.completed_for(problem).count
if submission.problem.nil?
# Need more info
Bugsnag.notify("WARN: unknown problem for submission #{submission.key}")
# try again
redirect "/code/%s/%s/random" % [language, slug]
end
erb :"code/random", locals: {submission: submission, total: total}
end
end
end
end
| Add more context for difficult-to-reproduce exception | Add more context for difficult-to-reproduce exception
| Ruby | agpl-3.0 | praveenpuglia/exercism.io,treiff/exercism.io,alexclarkofficial/exercism.io,RaptorRCX/exercism.io,Tonkpils/exercism.io,tejasbubane/exercism.io,nathanbwright/exercism.io,amar47shah/exercism.io,chinaowl/exercism.io,copiousfreetime/exercism.io,tejasbubane/exercism.io,Tonkpils/exercism.io,k4rtik/exercism.io,kangkyu/exercism.io,Tonkpils/exercism.io,k4rtik/exercism.io,alexclarkofficial/exercism.io,sheekap/exercism.io,praveenpuglia/exercism.io,mhelmetag/exercism.io,amar47shah/exercism.io,copiousfreetime/exercism.io,chinaowl/exercism.io,IanDCarroll/exercism.io,copiousfreetime/exercism.io,bmulvihill/exercism.io,sheekap/exercism.io,hanumakanthvvn/exercism.io,jtigger/exercism.io,RaptorRCX/exercism.io,beni55/exercism.io,emilyforst/exercism.io,treiff/exercism.io,kizerxl/exercism.io,treiff/exercism.io,emilyforst/exercism.io,amar47shah/exercism.io,bmulvihill/exercism.io,sheekap/exercism.io,kangkyu/exercism.io,RaptorRCX/exercism.io,jtigger/exercism.io,RaptorRCX/exercism.io,beni55/exercism.io,chinaowl/exercism.io,kizerxl/exercism.io,bmulvihill/exercism.io,exercistas/exercism.io,nathanbwright/exercism.io,Tonkpils/exercism.io,nathanbwright/exercism.io,colinrubbert/exercism.io,hanumakanthvvn/exercism.io,jtigger/exercism.io,hanumakanthvvn/exercism.io,emilyforst/exercism.io,copiousfreetime/exercism.io,praveenpuglia/exercism.io,kizerxl/exercism.io,tejasbubane/exercism.io,treiff/exercism.io,k4rtik/exercism.io,IanDCarroll/exercism.io,chastell/exercism.io,mhelmetag/exercism.io,beni55/exercism.io,exercistas/exercism.io,colinrubbert/exercism.io,chastell/exercism.io,chastell/exercism.io,hanumakanthvvn/exercism.io,praveenpuglia/exercism.io,tejasbubane/exercism.io,exercistas/exercism.io,bmulvihill/exercism.io,mhelmetag/exercism.io,mhelmetag/exercism.io,IanDCarroll/exercism.io,nathanbwright/exercism.io,kangkyu/exercism.io,IanDCarroll/exercism.io,jtigger/exercism.io,sheekap/exercism.io,colinrubbert/exercism.io,alexclarkofficial/exercism.io | ruby | ## Code Before:
module ExercismWeb
module Routes
class Solutions < Core
get '/code/:language/:slug/random' do |language, slug|
please_login
language, slug = language.downcase, slug.downcase
problem = Problem.new(language, slug)
unless current_user.nitpicker_on?(problem)
flash[:notice] = "You'll have access to that page when you complete #{slug} in #{language}"
redirect '/'
end
submission = Submission.random_completed_for(problem)
total = Submission.completed_for(problem).count
erb :"code/random", locals: {submission: submission, total: total}
end
end
end
end
## Instruction:
Add more context for difficult-to-reproduce exception
## Code After:
module ExercismWeb
module Routes
class Solutions < Core
get '/code/:language/:slug/random' do |language, slug|
please_login
language, slug = language.downcase, slug.downcase
problem = Problem.new(language, slug)
unless current_user.nitpicker_on?(problem)
flash[:notice] = "You'll have access to that page when you complete #{slug} in #{language}"
redirect '/'
end
submission = Submission.random_completed_for(problem)
total = Submission.completed_for(problem).count
if submission.problem.nil?
# Need more info
Bugsnag.notify("WARN: unknown problem for submission #{submission.key}")
# try again
redirect "/code/%s/%s/random" % [language, slug]
end
erb :"code/random", locals: {submission: submission, total: total}
end
end
end
end
|
ebfaf30fca157e83ea9e4bf33173221fc9525caf | demo/examples/employees/forms.py | demo/examples/employees/forms.py | from datetime import date
from django import forms
from django.utils import timezone
from .models import Employee, DeptManager, Title, Salary
class ChangeManagerForm(forms.Form):
manager = forms.ModelChoiceField(queryset=Employee.objects.all()[:100])
def __init__(self, *args, **kwargs):
self.department = kwargs.pop('department')
super(ChangeManagerForm, self).__init__(*args, **kwargs)
def save(self):
new_manager = self.cleaned_data['manager']
DeptManager.objects.filter(
department=self.department
).set(
department=self.department,
employee=new_manager
)
class ChangeTitleForm(forms.Form):
position = forms.CharField()
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeTitleForm, self).__init__(*args, **kwargs)
def save(self):
new_title = self.cleaned_data['position']
Title.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
title=new_title
)
class ChangeSalaryForm(forms.Form):
salary = forms.IntegerField()
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeSalaryForm, self).__init__(*args, **kwargs)
def save(self):
new_salary = self.cleaned_data['salary']
Salary.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
salary=new_salary,
)
| from django import forms
from .models import Employee, DeptManager, Title, Salary
class ChangeManagerForm(forms.Form):
manager = forms.ModelChoiceField(queryset=Employee.objects.all()[:100])
def __init__(self, *args, **kwargs):
self.department = kwargs.pop('department')
super(ChangeManagerForm, self).__init__(*args, **kwargs)
def save(self):
new_manager = self.cleaned_data['manager']
DeptManager.objects.filter(
department=self.department
).set(
department=self.department,
employee=new_manager
)
class ChangeTitleForm(forms.Form):
position = forms.CharField()
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeTitleForm, self).__init__(*args, **kwargs)
def save(self):
new_title = self.cleaned_data['position']
Title.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
title=new_title
)
class ChangeSalaryForm(forms.Form):
salary = forms.IntegerField(max_value=1000000)
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeSalaryForm, self).__init__(*args, **kwargs)
def save(self):
new_salary = self.cleaned_data['salary']
Salary.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
salary=new_salary,
)
| Fix emplorrs demo salary db error | Fix emplorrs demo salary db error
| Python | bsd-3-clause | viewflow/django-material,viewflow/django-material,viewflow/django-material | python | ## Code Before:
from datetime import date
from django import forms
from django.utils import timezone
from .models import Employee, DeptManager, Title, Salary
class ChangeManagerForm(forms.Form):
manager = forms.ModelChoiceField(queryset=Employee.objects.all()[:100])
def __init__(self, *args, **kwargs):
self.department = kwargs.pop('department')
super(ChangeManagerForm, self).__init__(*args, **kwargs)
def save(self):
new_manager = self.cleaned_data['manager']
DeptManager.objects.filter(
department=self.department
).set(
department=self.department,
employee=new_manager
)
class ChangeTitleForm(forms.Form):
position = forms.CharField()
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeTitleForm, self).__init__(*args, **kwargs)
def save(self):
new_title = self.cleaned_data['position']
Title.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
title=new_title
)
class ChangeSalaryForm(forms.Form):
salary = forms.IntegerField()
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeSalaryForm, self).__init__(*args, **kwargs)
def save(self):
new_salary = self.cleaned_data['salary']
Salary.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
salary=new_salary,
)
## Instruction:
Fix emplorrs demo salary db error
## Code After:
from django import forms
from .models import Employee, DeptManager, Title, Salary
class ChangeManagerForm(forms.Form):
manager = forms.ModelChoiceField(queryset=Employee.objects.all()[:100])
def __init__(self, *args, **kwargs):
self.department = kwargs.pop('department')
super(ChangeManagerForm, self).__init__(*args, **kwargs)
def save(self):
new_manager = self.cleaned_data['manager']
DeptManager.objects.filter(
department=self.department
).set(
department=self.department,
employee=new_manager
)
class ChangeTitleForm(forms.Form):
position = forms.CharField()
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeTitleForm, self).__init__(*args, **kwargs)
def save(self):
new_title = self.cleaned_data['position']
Title.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
title=new_title
)
class ChangeSalaryForm(forms.Form):
salary = forms.IntegerField(max_value=1000000)
def __init__(self, *args, **kwargs):
self.employee = kwargs.pop('employee')
super(ChangeSalaryForm, self).__init__(*args, **kwargs)
def save(self):
new_salary = self.cleaned_data['salary']
Salary.objects.filter(
employee=self.employee,
).set(
employee=self.employee,
salary=new_salary,
)
|
922acafc793b3d32f625fe18cd52b2bfd59a5f96 | ansible/wsgi.py | ansible/wsgi.py | from pecan.deploy import deploy
app = deploy('/opt/web/draughtcraft/src/production.py')
from paste.exceptions.errormiddleware import ErrorMiddleware
app = ErrorMiddleware(
app,
error_email=app.conf.error_email,
from_address=app.conf.error_email,
smtp_server=app.conf.error_smtp_server,
smtp_username=app.conf.error_email,
smtp_password=app.conf.error_password,
smtp_use_tls=True
)
| from pecan import conf
from pecan.deploy import deploy
app = deploy('/opt/web/draughtcraft/src/production.py')
from paste.exceptions.errormiddleware import ErrorMiddleware
app = ErrorMiddleware(
app,
error_email=conf.error_email,
from_address=conf.error_email,
smtp_server=conf.error_smtp_server,
smtp_username=conf.error_email,
smtp_password=conf.error_password,
smtp_use_tls=True
)
| Fix a bug in the WSGI entrypoint. | Fix a bug in the WSGI entrypoint.
| Python | bsd-3-clause | ryanpetrello/draughtcraft,ryanpetrello/draughtcraft,ryanpetrello/draughtcraft,ryanpetrello/draughtcraft | python | ## Code Before:
from pecan.deploy import deploy
app = deploy('/opt/web/draughtcraft/src/production.py')
from paste.exceptions.errormiddleware import ErrorMiddleware
app = ErrorMiddleware(
app,
error_email=app.conf.error_email,
from_address=app.conf.error_email,
smtp_server=app.conf.error_smtp_server,
smtp_username=app.conf.error_email,
smtp_password=app.conf.error_password,
smtp_use_tls=True
)
## Instruction:
Fix a bug in the WSGI entrypoint.
## Code After:
from pecan import conf
from pecan.deploy import deploy
app = deploy('/opt/web/draughtcraft/src/production.py')
from paste.exceptions.errormiddleware import ErrorMiddleware
app = ErrorMiddleware(
app,
error_email=conf.error_email,
from_address=conf.error_email,
smtp_server=conf.error_smtp_server,
smtp_username=conf.error_email,
smtp_password=conf.error_password,
smtp_use_tls=True
)
|
23a9d15bfe3c92cd9eb6b5cf2e12356e55149302 | templates/opinions/opinion_base.html | templates/opinions/opinion_base.html | {% extends "base.html" %}
{% load opinions %}
{% block sidebar %}
{% if question %}
{% promise_statistics_sidebar user question %}
{% else %}
{% promise_statistics_sidebar user %}
{% endif %}
{% endblock %}
| {% extends "base.html" %}
{% load opinions %}
{% block head %}
<script type="text/javascript">
$(function() {
$('.opinion_navigation_category [title]').tooltip({
delay: 0,
fade: 0,
track: true,
showURL: false,
});
});
</script>
{% endblock %}
{% block sidebar %}
{% if question %}
{% promise_statistics_sidebar user question %}
{% else %}
{% promise_statistics_sidebar user %}
{% endif %}
{% endblock %}
| Add fast tooltips for the sidebar | opinions: Add fast tooltips for the sidebar
| HTML | agpl-3.0 | kansanmuisti/kamu,kansanmuisti/kamu,kansanmuisti/kamu,kansanmuisti/kamu,kansanmuisti/kamu | html | ## Code Before:
{% extends "base.html" %}
{% load opinions %}
{% block sidebar %}
{% if question %}
{% promise_statistics_sidebar user question %}
{% else %}
{% promise_statistics_sidebar user %}
{% endif %}
{% endblock %}
## Instruction:
opinions: Add fast tooltips for the sidebar
## Code After:
{% extends "base.html" %}
{% load opinions %}
{% block head %}
<script type="text/javascript">
$(function() {
$('.opinion_navigation_category [title]').tooltip({
delay: 0,
fade: 0,
track: true,
showURL: false,
});
});
</script>
{% endblock %}
{% block sidebar %}
{% if question %}
{% promise_statistics_sidebar user question %}
{% else %}
{% promise_statistics_sidebar user %}
{% endif %}
{% endblock %}
|
3ecf2ed9721019051af03870a2754dbfa6abd419 | lib/heroku/deploy/tasks/prepare_production_branch.rb | lib/heroku/deploy/tasks/prepare_production_branch.rb | module Heroku::Deploy::Task
class PrepareProductionBranch < Base
include Heroku::Deploy::Shell
def before_deploy
@previous_branch = git "rev-parse --abbrev-ref HEAD"
# Always fetch first. The repo may have already been created.
task "Fetching from #{colorize "origin", :cyan}" do
git "fetch origin"
end
task "Switching to #{colorize strategy.branch, :cyan}" do
branches = git "branch"
if branches.match /#{strategy.branch}$/
git "checkout #{strategy.branch}"
else
git "checkout -b #{strategy.branch}"
end
end
task "Merging your current branch #{colorize @previous_branch, :cyan} into #{colorize strategy.branch, :cyan}" do
git "merge #{strategy.new_commit}"
end
end
def after_deploy
task "Pushing local #{colorize strategy.branch, :cyan} to #{colorize "origin", :cyan}"
git "push -u origin #{strategy.branch} -v", :exec => true
switch_back_to_old_branch
end
def rollback_before_deploy
switch_back_to_old_branch
end
private
def switch_back_to_old_branch
task "Switching back to #{colorize @previous_branch, :cyan}" do
git "checkout #{@previous_branch}"
end
end
end
end
| module Heroku::Deploy::Task
class PrepareProductionBranch < Base
include Heroku::Deploy::Shell
def before_deploy
@previous_branch = git "rev-parse --abbrev-ref HEAD"
# Always fetch first. The repo may have already been created.
task "Fetching from #{colorize "origin", :cyan}" do
git "fetch origin"
end
task "Switching to #{colorize strategy.branch, :cyan}" do
branches = git "branch"
if branches.match /#{strategy.branch}$/
git "checkout #{strategy.branch}"
git "reset origin/#{strategy.branch} --hard"
else
git "checkout -b #{strategy.branch}"
end
end
task "Merging your current branch #{colorize @previous_branch, :cyan} into #{colorize strategy.branch, :cyan}" do
git "merge #{strategy.new_commit}"
end
end
def after_deploy
task "Pushing local #{colorize strategy.branch, :cyan} to #{colorize "origin", :cyan}"
git "push -u origin #{strategy.branch} -v", :exec => true
switch_back_to_old_branch
end
def rollback_before_deploy
switch_back_to_old_branch
end
private
def switch_back_to_old_branch
task "Switching back to #{colorize @previous_branch, :cyan}" do
git "checkout #{@previous_branch}"
end
end
end
end
| Reset the local production branch when we switch to it. | Reset the local production branch when we switch to it.
| Ruby | mit | envato/heroku-deploy,LeadSimple/heroku-deploy | ruby | ## Code Before:
module Heroku::Deploy::Task
class PrepareProductionBranch < Base
include Heroku::Deploy::Shell
def before_deploy
@previous_branch = git "rev-parse --abbrev-ref HEAD"
# Always fetch first. The repo may have already been created.
task "Fetching from #{colorize "origin", :cyan}" do
git "fetch origin"
end
task "Switching to #{colorize strategy.branch, :cyan}" do
branches = git "branch"
if branches.match /#{strategy.branch}$/
git "checkout #{strategy.branch}"
else
git "checkout -b #{strategy.branch}"
end
end
task "Merging your current branch #{colorize @previous_branch, :cyan} into #{colorize strategy.branch, :cyan}" do
git "merge #{strategy.new_commit}"
end
end
def after_deploy
task "Pushing local #{colorize strategy.branch, :cyan} to #{colorize "origin", :cyan}"
git "push -u origin #{strategy.branch} -v", :exec => true
switch_back_to_old_branch
end
def rollback_before_deploy
switch_back_to_old_branch
end
private
def switch_back_to_old_branch
task "Switching back to #{colorize @previous_branch, :cyan}" do
git "checkout #{@previous_branch}"
end
end
end
end
## Instruction:
Reset the local production branch when we switch to it.
## Code After:
module Heroku::Deploy::Task
class PrepareProductionBranch < Base
include Heroku::Deploy::Shell
def before_deploy
@previous_branch = git "rev-parse --abbrev-ref HEAD"
# Always fetch first. The repo may have already been created.
task "Fetching from #{colorize "origin", :cyan}" do
git "fetch origin"
end
task "Switching to #{colorize strategy.branch, :cyan}" do
branches = git "branch"
if branches.match /#{strategy.branch}$/
git "checkout #{strategy.branch}"
git "reset origin/#{strategy.branch} --hard"
else
git "checkout -b #{strategy.branch}"
end
end
task "Merging your current branch #{colorize @previous_branch, :cyan} into #{colorize strategy.branch, :cyan}" do
git "merge #{strategy.new_commit}"
end
end
def after_deploy
task "Pushing local #{colorize strategy.branch, :cyan} to #{colorize "origin", :cyan}"
git "push -u origin #{strategy.branch} -v", :exec => true
switch_back_to_old_branch
end
def rollback_before_deploy
switch_back_to_old_branch
end
private
def switch_back_to_old_branch
task "Switching back to #{colorize @previous_branch, :cyan}" do
git "checkout #{@previous_branch}"
end
end
end
end
|
80399ba74e45b7d071f6e81868bc8af40c516647 | Cargo.toml | Cargo.toml | [package]
name = "riscan-pro"
version = "0.1.0"
authors = ["Pete Gadomski <pete.gadomski@gmail.com>"]
[dependencies]
docopt = "0.6"
las = "0.3"
nalgebra = "0.9"
pbr = "0.3"
rustc-serialize = "0.3"
xmltree = "0.3"
| [package]
name = "riscan-pro"
version = "0.1.0"
authors = ["Pete Gadomski <pete.gadomski@gmail.com>"]
[dependencies]
docopt = "0.6"
las = "0.3"
nalgebra = "0.9"
pbr = "0.3"
rustc-serialize = "0.3"
xmltree = "0.3"
[[bin]]
name = "riscan-pro"
doc = false
| Set doc to false for the binary | Set doc to false for the binary
| TOML | mit | gadomski/riscan-pro | toml | ## Code Before:
[package]
name = "riscan-pro"
version = "0.1.0"
authors = ["Pete Gadomski <pete.gadomski@gmail.com>"]
[dependencies]
docopt = "0.6"
las = "0.3"
nalgebra = "0.9"
pbr = "0.3"
rustc-serialize = "0.3"
xmltree = "0.3"
## Instruction:
Set doc to false for the binary
## Code After:
[package]
name = "riscan-pro"
version = "0.1.0"
authors = ["Pete Gadomski <pete.gadomski@gmail.com>"]
[dependencies]
docopt = "0.6"
las = "0.3"
nalgebra = "0.9"
pbr = "0.3"
rustc-serialize = "0.3"
xmltree = "0.3"
[[bin]]
name = "riscan-pro"
doc = false
|
87ba996af0b363d734155326db7b865d035046fd | .slackbot.yml | .slackbot.yml | releaseSchedule:
OmarShehata: 9/2/2019
mramato: 10/1/2019
hpinkos: 11/1/2019
lilleyse: 12/1/2019
kring: 1/6/2020
lilleyse: 2/3/2020
mramato: 3/2/2020
greetings:
- Happy Friday everyone!
- Can you believe Friday is already here?
- I hope you all had awesome week!
- I skipped breakfast, so I hope Gary baked something good today...
- Good morning everyone!
| releaseSchedule:
mamato: 3/2/2020
oshehata: 4/1/2020
lilleyse: 5/1/2020
ian: 6/1/2020
sam.suhag: 7/1/2020
sam.vargas: 8/3/2020
kevin: 9/1/2020
mamato: 10/1/2020
oshehata: 11/2/2020
lilleyse: 12/1/2020
| Update release schedule for 2020 | Update release schedule for 2020 | YAML | apache-2.0 | YonatanKra/cesium,YonatanKra/cesium,likangning93/cesium,CesiumGS/cesium,progsung/cesium,CesiumGS/cesium,AnalyticalGraphicsInc/cesium,YonatanKra/cesium,AnalyticalGraphicsInc/cesium,CesiumGS/cesium,likangning93/cesium,likangning93/cesium,progsung/cesium,likangning93/cesium,likangning93/cesium,CesiumGS/cesium,YonatanKra/cesium,CesiumGS/cesium | yaml | ## Code Before:
releaseSchedule:
OmarShehata: 9/2/2019
mramato: 10/1/2019
hpinkos: 11/1/2019
lilleyse: 12/1/2019
kring: 1/6/2020
lilleyse: 2/3/2020
mramato: 3/2/2020
greetings:
- Happy Friday everyone!
- Can you believe Friday is already here?
- I hope you all had awesome week!
- I skipped breakfast, so I hope Gary baked something good today...
- Good morning everyone!
## Instruction:
Update release schedule for 2020
## Code After:
releaseSchedule:
mamato: 3/2/2020
oshehata: 4/1/2020
lilleyse: 5/1/2020
ian: 6/1/2020
sam.suhag: 7/1/2020
sam.vargas: 8/3/2020
kevin: 9/1/2020
mamato: 10/1/2020
oshehata: 11/2/2020
lilleyse: 12/1/2020
|
c7f6e0c2e9c5be112a7576c3d2a1fc8a79eb9f18 | brasilcomvc/settings/staticfiles.py | brasilcomvc/settings/staticfiles.py | import os
import sys
# Disable django-pipeline when in test mode
PIPELINE_ENABLED = 'test' not in sys.argv
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../webroot')
# Static file dirs
STATIC_ROOT = os.path.join(STATIC_BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(STATIC_BASE_DIR, 'media')
# Static file URLs
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
# django-pipeline settings
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
'pipeline.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
PIPELINE_COMPILERS = (
'pipeline.compilers.stylus.StylusCompiler',
)
# Stylus configuration
PIPELINE_STYLUS_ARGUMENTS = ' '.join([
'--include {path}/common/static/styl', # Expose common styl lib dir
'--use kouto-swiss',
]).format(path=BASE_DIR)
# Packaging specs for CSS
PIPELINE_CSS = {
'app': {
'source_filenames': [
# ...
],
'output_filename': 'css/app.css',
}
}
# Packaging specs for JavaScript
PIPELINE_JS = {
}
| import os
import sys
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../webroot')
# Static file dirs
STATIC_ROOT = os.path.join(STATIC_BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(STATIC_BASE_DIR, 'media')
# Static file URLs
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
# django-pipeline settings
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
if 'test' in sys.argv:
STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
STATICFILES_FINDERS = (
'pipeline.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
PIPELINE_COMPILERS = (
'pipeline.compilers.stylus.StylusCompiler',
)
# Stylus configuration
PIPELINE_STYLUS_ARGUMENTS = ' '.join([
'--include {path}/common/static/styl', # Expose common styl lib dir
'--use kouto-swiss',
]).format(path=BASE_DIR)
# Packaging specs for CSS
PIPELINE_CSS = {
'app': {
'source_filenames': [
# ...
],
'output_filename': 'css/app.css',
}
}
# Packaging specs for JavaScript
PIPELINE_JS = {
}
| Fix django-pipeline configuration for development/test | fix(set): Fix django-pipeline configuration for development/test
| Python | apache-2.0 | brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc | python | ## Code Before:
import os
import sys
# Disable django-pipeline when in test mode
PIPELINE_ENABLED = 'test' not in sys.argv
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../webroot')
# Static file dirs
STATIC_ROOT = os.path.join(STATIC_BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(STATIC_BASE_DIR, 'media')
# Static file URLs
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
# django-pipeline settings
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
'pipeline.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
PIPELINE_COMPILERS = (
'pipeline.compilers.stylus.StylusCompiler',
)
# Stylus configuration
PIPELINE_STYLUS_ARGUMENTS = ' '.join([
'--include {path}/common/static/styl', # Expose common styl lib dir
'--use kouto-swiss',
]).format(path=BASE_DIR)
# Packaging specs for CSS
PIPELINE_CSS = {
'app': {
'source_filenames': [
# ...
],
'output_filename': 'css/app.css',
}
}
# Packaging specs for JavaScript
PIPELINE_JS = {
}
## Instruction:
fix(set): Fix django-pipeline configuration for development/test
## Code After:
import os
import sys
# Main project directory
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
STATIC_BASE_DIR = os.path.join(BASE_DIR, '../webroot')
# Static file dirs
STATIC_ROOT = os.path.join(STATIC_BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(STATIC_BASE_DIR, 'media')
# Static file URLs
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
# django-pipeline settings
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
if 'test' in sys.argv:
STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
STATICFILES_FINDERS = (
'pipeline.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
PIPELINE_COMPILERS = (
'pipeline.compilers.stylus.StylusCompiler',
)
# Stylus configuration
PIPELINE_STYLUS_ARGUMENTS = ' '.join([
'--include {path}/common/static/styl', # Expose common styl lib dir
'--use kouto-swiss',
]).format(path=BASE_DIR)
# Packaging specs for CSS
PIPELINE_CSS = {
'app': {
'source_filenames': [
# ...
],
'output_filename': 'css/app.css',
}
}
# Packaging specs for JavaScript
PIPELINE_JS = {
}
|
6d16ecbdcabd4ff55bc152fc2199e6f165f2871e | core/js/src/main/scala/sttp/client/MessageDigestCompatibility.scala | core/js/src/main/scala/sttp/client/MessageDigestCompatibility.scala | package sttp.client
import org.scalajs.dom.webgl.Buffer
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.|
private[client] class MessageDigestCompatibility(algorithm: String) {
private lazy val md = algorithm match {
case "MD5" => MD5
case _ => throw new IllegalArgumentException(s"Unsupported algorithm: $algorithm")
}
def digest(input: Array[Byte]): Array[Byte] = md(new String(input, "UTF-8")).getBytes("UTF-8")
}
@js.native
@JSImport("md5", JSImport.Namespace)
private object MD5 extends js.Object {
/**
* Returns the MD5 encoded string generated from a given string or buffer
* @param value the given [[String]] or [[Buffer]]
* @return the MD5 encoded string
*/
def apply(value: String | Buffer): String = js.native
}
| package sttp.client
import org.scalajs.dom.webgl.Buffer
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.|
private[client] class MessageDigestCompatibility(algorithm: String) {
private lazy val md = algorithm match {
case "MD5" => MD5
case _ => throw new IllegalArgumentException(s"Unsupported algorithm: $algorithm")
}
def digest(input: Array[Byte]): Array[Byte] = md(new String(input, "UTF-8")).getBytes("UTF-8")
}
// Copied from https://github.com/scalajs-io/md5
@js.native
@JSImport("md5", JSImport.Namespace)
private object MD5 extends js.Object {
/**
* Returns the MD5 encoded string generated from a given string or buffer
* @param value the given [[String]] or [[Buffer]]
* @return the MD5 encoded string
*/
def apply(value: String | Buffer): String = js.native
}
| Add link to original code with md5hash for scalajs | Add link to original code with md5hash for scalajs
| Scala | apache-2.0 | softwaremill/sttp,softwaremill/sttp,softwaremill/sttp | scala | ## Code Before:
package sttp.client
import org.scalajs.dom.webgl.Buffer
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.|
private[client] class MessageDigestCompatibility(algorithm: String) {
private lazy val md = algorithm match {
case "MD5" => MD5
case _ => throw new IllegalArgumentException(s"Unsupported algorithm: $algorithm")
}
def digest(input: Array[Byte]): Array[Byte] = md(new String(input, "UTF-8")).getBytes("UTF-8")
}
@js.native
@JSImport("md5", JSImport.Namespace)
private object MD5 extends js.Object {
/**
* Returns the MD5 encoded string generated from a given string or buffer
* @param value the given [[String]] or [[Buffer]]
* @return the MD5 encoded string
*/
def apply(value: String | Buffer): String = js.native
}
## Instruction:
Add link to original code with md5hash for scalajs
## Code After:
package sttp.client
import org.scalajs.dom.webgl.Buffer
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.|
private[client] class MessageDigestCompatibility(algorithm: String) {
private lazy val md = algorithm match {
case "MD5" => MD5
case _ => throw new IllegalArgumentException(s"Unsupported algorithm: $algorithm")
}
def digest(input: Array[Byte]): Array[Byte] = md(new String(input, "UTF-8")).getBytes("UTF-8")
}
// Copied from https://github.com/scalajs-io/md5
@js.native
@JSImport("md5", JSImport.Namespace)
private object MD5 extends js.Object {
/**
* Returns the MD5 encoded string generated from a given string or buffer
* @param value the given [[String]] or [[Buffer]]
* @return the MD5 encoded string
*/
def apply(value: String | Buffer): String = js.native
}
|
f3cbe52e0d65e8d6647815b25c79a836db93fb41 | gitcd/Cli/Command.py | gitcd/Cli/Command.py | import subprocess
import string
class Command(object):
def execute(self, command: str):
cliArgs = self.parseCliArgs(command)
process = subprocess.Popen(cliArgs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = process.communicate()
if process.returncode != 0:
return False
return output.decode("utf-8").strip()
def parseCliArgs(self, command: str):
rawArgs = command.split(" ")
parsedArgs = []
tmpString = False
isSingle = False
isDouble = False
for arg in rawArgs:
# handle strings in single quotes
if arg.startswith("'") and isSingle == False and isDouble == False:
isSingle = True
tmpString = arg
elif arg.endswith("'") and isSingle == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isSingle = False
tmpString = False
# handle strings in double quotes
elif arg.startswith('"') and isDouble == False and isSingle == False:
isDouble = True
tmpString = arg
elif arg.endswith('"') and isDouble == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isDouble = False
tmpString = False
# extend current string
elif tmpString != False:
tmpString = "%s %s" % (tmpString, arg)
else:
parsedArgs.append(arg)
return parsedArgs | import subprocess
import string
from pprint import pprint
class Command(object):
def execute(self, command: str):
cliArgs = self.parseCliArgs(command)
pprint(cliArgs)
process = subprocess.Popen(cliArgs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = process.communicate()
if process.returncode != 0:
return False
return output.decode("utf-8").strip()
def parseCliArgs(self, command: str):
rawArgs = command.split(" ")
parsedArgs = []
tmpString = False
isSingle = False
isDouble = False
for arg in rawArgs:
# handle strings in single quotes
if arg.startswith("'") and isSingle == False and isDouble == False:
isSingle = True
tmpString = arg
elif arg.endswith("'") and isSingle == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isSingle = False
tmpString = False
# handle strings in double quotes
elif arg.startswith('"') and isDouble == False and isSingle == False:
isDouble = True
tmpString = arg
elif arg.endswith('"') and isDouble == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isDouble = False
tmpString = False
# extend current string
elif tmpString != False:
tmpString = "%s %s" % (tmpString, arg)
else:
parsedArgs.append(arg)
return parsedArgs | Add some debug for debian box | Add some debug for debian box
| Python | apache-2.0 | claudio-walser/gitcd,claudio-walser/gitcd | python | ## Code Before:
import subprocess
import string
class Command(object):
def execute(self, command: str):
cliArgs = self.parseCliArgs(command)
process = subprocess.Popen(cliArgs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = process.communicate()
if process.returncode != 0:
return False
return output.decode("utf-8").strip()
def parseCliArgs(self, command: str):
rawArgs = command.split(" ")
parsedArgs = []
tmpString = False
isSingle = False
isDouble = False
for arg in rawArgs:
# handle strings in single quotes
if arg.startswith("'") and isSingle == False and isDouble == False:
isSingle = True
tmpString = arg
elif arg.endswith("'") and isSingle == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isSingle = False
tmpString = False
# handle strings in double quotes
elif arg.startswith('"') and isDouble == False and isSingle == False:
isDouble = True
tmpString = arg
elif arg.endswith('"') and isDouble == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isDouble = False
tmpString = False
# extend current string
elif tmpString != False:
tmpString = "%s %s" % (tmpString, arg)
else:
parsedArgs.append(arg)
return parsedArgs
## Instruction:
Add some debug for debian box
## Code After:
import subprocess
import string
from pprint import pprint
class Command(object):
def execute(self, command: str):
cliArgs = self.parseCliArgs(command)
pprint(cliArgs)
process = subprocess.Popen(cliArgs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = process.communicate()
if process.returncode != 0:
return False
return output.decode("utf-8").strip()
def parseCliArgs(self, command: str):
rawArgs = command.split(" ")
parsedArgs = []
tmpString = False
isSingle = False
isDouble = False
for arg in rawArgs:
# handle strings in single quotes
if arg.startswith("'") and isSingle == False and isDouble == False:
isSingle = True
tmpString = arg
elif arg.endswith("'") and isSingle == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isSingle = False
tmpString = False
# handle strings in double quotes
elif arg.startswith('"') and isDouble == False and isSingle == False:
isDouble = True
tmpString = arg
elif arg.endswith('"') and isDouble == True:
arg = "%s %s" % (tmpString, arg)
parsedArgs.append(arg)
isDouble = False
tmpString = False
# extend current string
elif tmpString != False:
tmpString = "%s %s" % (tmpString, arg)
else:
parsedArgs.append(arg)
return parsedArgs |
7bad77d0fd586813f777caf718e913ae1ffeed7a | playbooks/roles/splunkforwarder/defaults/main.yml | playbooks/roles/splunkforwarder/defaults/main.yml | ---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Vars for role splunk
#
#
# vars are namespace with the module name.
#
splunk_role_name: 'splunk'
#
# OS packages
#
splunk_debian_pkgs:
- gdebi
splunk_redhat_pkgs: []
SPLUNKFORWARDER_SERVER: 'localhost:9997'
SPLUNKFORWARDER_PACKAGE_LOCATION: !!null
SPLUNKFORWARDER_DEB: !!null
SPLUNKFORWARDER_PASSWORD: !!null
splunkforwarder_output_dir: '/opt/splunkforwarder/'
SPLUNKFORWARDER_LOG_ITEMS:
- directory: '{{log_base_dir}}'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'edx'
- directory: '/var/log'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'syslog'
- directory: '{{log_base_dir}}/nginx'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'nginx'
| ---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Vars for role splunk
#
#
# vars are namespace with the module name.
#
splunk_role_name: 'splunk'
SPLUNKFORWARDER_SERVER: 'localhost:9997'
SPLUNKFORWARDER_PACKAGE_LOCATION: !!null
SPLUNKFORWARDER_DEB: !!null
SPLUNKFORWARDER_PASSWORD: !!null
SPLUNKFORWARDER_LOG_ITEMS:
- directory: '{{log_base_dir}}'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'edx'
- directory: '/var/log'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'syslog'
- directory: '{{log_base_dir}}/nginx'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'nginx'
#
# OS packages
#
splunk_debian_pkgs:
- gdebi
splunk_redhat_pkgs: []
splunkforwarder_output_dir: '/opt/splunkforwarder/'
| Move overridable defaults to the top of the file. | Move overridable defaults to the top of the file.
| YAML | agpl-3.0 | proversity-org/configuration,nttks/configuration,kencung/configuration,Stanford-Online/configuration,sudheerchintala/LearnEra-Configuration,apigee/edx-configuration,ovnicraft/evex-configuration,knehez/configuration,nikolas/configuration,rue89-tech/configuration,openfun/configuration,Unow/configuration,arifsetiawan/configuration,antoviaque/configuration,antoviaque/configuration,rue89-tech/configuration,proversity-org/configuration,vasyarv/configuration,negritobomb/edxplat,leansoft/configuration,cyanna/configuration,negritobomb/edxplat,IndonesiaX/configuration,gsehub/configuration,mitodl/configuration,chenshuchuan/configuration,joshhu/configuration,B-MOOC/configuration,edx/configuration,bugcy013/edx_infra,hmcmooc/ec2-edx-configuration,jp-bpl/configuration,open-craft/configuration,B-MOOC/configuration,gashac03/ubuntu,xiangjf/configuration,marcore/configuration,arifsetiawan/configuration,lgfa29/configuration,gashac03/ubuntu,vasyarv/configuration,mitodl/configuration,kursitet/configuration,Softmotions/configuration,gashac03/ubuntu,jp-bpl/configuration,louyihua/configuration,jorgeomarmh/configuration,pobrejuanito/configuration,B-MOOC/configuration,usernamenumber/configuration,Stanford-Online/configuration,openfun/configuration,stvstnfrd/configuration,kencung/configuration,omarkhan/configuration,nunpa/configuration,alu042/configuration,hastexo/edx-configuration,antoviaque/configuration,zhengjunwei/configuration,open-craft/configuration,bugcy013/edx_infra,stvstnfrd/configuration,arbrandes/edx-configuration,hmcmooc/ec2-edx-configuration,AlfiyaZi/configuration,pedrorib/istx,Softmotions/configuration,pedrorib/istx,Softmotions/configuration,EDUlib/configuration,chenshuchuan/configuration,armaan/edx-configuration,xiangjf/configuration,Carlos2005/configuration,4eek/configuration,arifsetiawan/configuration,proversity-org/configuration,beacloudgenius/configuration,Pieros/configuration,hks-epod/configuration,beacloudgenius/configuration,michaelsteiner19/open-edx-configuration,hks-epod/configuration,4eek/configuration,rue89-tech/configuration,pobrejuanito/configuration,nttks/configuration,cecep-edu/configuration,jorgeomarmh/configuration,fghaas/edx-configuration,gsehub/configuration,arbrandes/edx-configuration,apigee/edx-configuration,UXE/edx-configuration,lgfa29/configuration,Unow/configuration,michaelsteiner19/open-edx-configuration,yrchen/configuration,4eek/configuration,arbrandes/edx-configuration,hastexo/edx-configuration,nikolas/configuration,kursitet/configuration,cyanna/configuration,mitodl/configuration,antshin72/configuration,michaelsteiner19/open-edx-configuration,Stanford-Online/configuration,alu042/configuration,glengal/configuration,fghaas/edx-configuration,beacloudgenius/configuration,alu042/configuration,EDUlib/configuration,appsembler/configuration,pobrejuanito/configuration,gsehub/configuration,LearnEra/LearnEra-Configuration,knehez/configuration,eduStack/configuration,rue89-tech/configuration,rue89-tech/configuration,Carlos2005/configuration,zhengjunwei/configuration,EDUlib/configuration,IONISx/edx-configuration,cecep-edu/configuration,jp-bpl/configuration,appsembler/configuration,chenshuchuan/configuration,chudaol/configuration,antshin72/configuration,armaan/edx-configuration,CredoReference/configuration,usernamenumber/configuration,leansoft/configuration,Softmotions/configuration,yrchen/configuration,appsembler/configuration,AlfiyaZi/configuration,omarkhan/configuration,glengal/configuration,kencung/configuration,armaan/edx-configuration,jorgeomarmh/configuration,IndonesiaX/configuration,kmoocdev/configuration,hastexo/edx-configuration,chudaol/configuration,hks-epod/configuration,knehez/configuration,omarkhan/configuration,joshhu/configuration,Carlos2005/configuration,UXE/edx-configuration,pedrorib/istx,Carlos2005/configuration,cyanna/configuration,stvstnfrd/configuration,proversity-org/configuration,Stanford-Online/configuration,open-craft/configuration,gsehub/configuration,CredoReference/configuration,cyanna/configuration,antshin72/configuration,Livit/Livit.Learn.EdX.configuration,pobrejuanito/configuration,kmoocdev/configuration,hastexo/edx-configuration-old,arbrandes/edx-configuration,xiangjf/configuration,usernamenumber/configuration,leansoft/configuration,armaan/edx-configuration,edx/configuration,ovnicraft/evex-configuration,apigee/edx-configuration,nunpa/configuration,chudaol/configuration,openfun/configuration,nunpa/configuration,antoviaque/configuration,jp-bpl/configuration,chudaol/configuration,CredoReference/configuration,yrchen/configuration,IndonesiaX/configuration,negritobomb/edxplat,glengal/configuration,hastexo/edx-configuration,nttks/configuration,IONISx/edx-configuration,appsembler/configuration,eduStack/configuration,ovnicraft/evex-configuration,joshhu/configuration,marcore/configuration,proversity-org/configuration,openfun/configuration,michaelsteiner19/open-edx-configuration,zhengjunwei/configuration,xiangjf/configuration,LearnEra/LearnEra-Configuration,sudheerchintala/LearnEra-Configuration,lgfa29/configuration,LearnEra/LearnEra-Configuration,leansoft/configuration,IONISx/edx-configuration,nikolas/configuration,kursitet/configuration,zhengjunwei/configuration,marcore/configuration,vasyarv/configuration,arbrandes/edx-configuration,eduStack/configuration,pedrorib/istx,hks-epod/configuration,Stanford-Online/configuration,glengal/configuration,hastexo/edx-configuration-old,EDUlib/configuration,vasyarv/configuration,Unow/configuration,hastexo/edx-configuration-old,knehez/configuration,kmoocdev/configuration,4eek/configuration,alu042/configuration,UXE/edx-configuration,Pieros/configuration,IONISx/edx-configuration,sudheerchintala/LearnEra-Configuration,AlfiyaZi/configuration,marcore/configuration,Pieros/configuration,kencung/configuration,kursitet/configuration,Pieros/configuration,fghaas/edx-configuration,open-craft/configuration,usernamenumber/configuration,AlfiyaZi/configuration,CredoReference/configuration,mitodl/configuration,arifsetiawan/configuration,nikolas/configuration,UXE/edx-configuration,lgfa29/configuration,louyihua/configuration,EDUlib/configuration,bugcy013/edx_infra,gashac03/ubuntu,louyihua/configuration,jp-bpl/configuration,antshin72/configuration,Livit/Livit.Learn.EdX.configuration,omarkhan/configuration,hmcmooc/ec2-edx-configuration,bugcy013/edx_infra,edx/configuration,nunpa/configuration,stvstnfrd/configuration,stvstnfrd/configuration,Livit/Livit.Learn.EdX.configuration,joshhu/configuration,hastexo/edx-configuration,hks-epod/configuration,nttks/configuration,fghaas/edx-configuration,kmoocdev/configuration,Livit/Livit.Learn.EdX.configuration,louyihua/configuration,IndonesiaX/configuration,cecep-edu/configuration,negritobomb/edxplat,edx/configuration,gsehub/configuration,hastexo/edx-configuration-old,yrchen/configuration,beacloudgenius/configuration,jorgeomarmh/configuration | yaml | ## Code Before:
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Vars for role splunk
#
#
# vars are namespace with the module name.
#
splunk_role_name: 'splunk'
#
# OS packages
#
splunk_debian_pkgs:
- gdebi
splunk_redhat_pkgs: []
SPLUNKFORWARDER_SERVER: 'localhost:9997'
SPLUNKFORWARDER_PACKAGE_LOCATION: !!null
SPLUNKFORWARDER_DEB: !!null
SPLUNKFORWARDER_PASSWORD: !!null
splunkforwarder_output_dir: '/opt/splunkforwarder/'
SPLUNKFORWARDER_LOG_ITEMS:
- directory: '{{log_base_dir}}'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'edx'
- directory: '/var/log'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'syslog'
- directory: '{{log_base_dir}}/nginx'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'nginx'
## Instruction:
Move overridable defaults to the top of the file.
## Code After:
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Vars for role splunk
#
#
# vars are namespace with the module name.
#
splunk_role_name: 'splunk'
SPLUNKFORWARDER_SERVER: 'localhost:9997'
SPLUNKFORWARDER_PACKAGE_LOCATION: !!null
SPLUNKFORWARDER_DEB: !!null
SPLUNKFORWARDER_PASSWORD: !!null
SPLUNKFORWARDER_LOG_ITEMS:
- directory: '{{log_base_dir}}'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'edx'
- directory: '/var/log'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'syslog'
- directory: '{{log_base_dir}}/nginx'
recursive: true
index: '{{ENV_TYPE}}-{{ENV_NAME}}'
sourcetype: 'nginx'
#
# OS packages
#
splunk_debian_pkgs:
- gdebi
splunk_redhat_pkgs: []
splunkforwarder_output_dir: '/opt/splunkforwarder/'
|
72a53c0c09c50e93012d50484837c6747a0157ab | packages/xo-server-auth-google/src/index.js | packages/xo-server-auth-google/src/index.js | import { Strategy } from 'passport-google-oauth20'
// ===================================================================
export const configurationSchema = {
type: 'object',
properties: {
callbackURL: {
type: 'string',
description: 'Must be exactly the same as specified on the Google developer console.'
},
clientID: {
type: 'string'
},
clientSecret: {
type: 'string'
},
scope: {
default: 'https://www.googleapis.com/auth/plus.login',
description: 'Note that changing this value will break existing users.',
enum: [ 'https://www.googleapis.com/auth/plus.login', 'email' ],
enumNames: [ 'Google+ name', 'Simple email address' ]
}
},
required: ['callbackURL', 'clientID', 'clientSecret']
}
// ===================================================================
class AuthGoogleXoPlugin {
constructor ({ xo }) {
this._conf = null
this._xo = xo
}
configure (conf) {
this._conf = conf
}
load () {
const conf = {
// TODO: find a better way to inject default values
scope: configurationSchema.properties.scope.default,
...this._conf
}
const xo = this._xo
xo.registerPassportStrategy(new Strategy(conf, async (accessToken, refreshToken, profile, done) => {
try {
done(null, await xo.registerUser(
'google',
conf.scope === 'email'
? profile.emails[0].value
: profile.displayName
))
} catch (error) {
done(error.message)
}
}))
}
}
// ===================================================================
export default opts => new AuthGoogleXoPlugin(opts)
| import { Strategy } from 'passport-google-oauth20'
// ===================================================================
export const configurationSchema = {
type: 'object',
properties: {
callbackURL: {
type: 'string',
description: 'Must be exactly the same as specified on the Google developer console.'
},
clientID: {
type: 'string'
},
clientSecret: {
type: 'string'
},
scope: {
default: 'https://www.googleapis.com/auth/plus.login',
description: 'Note that changing this value will break existing users.',
enum: [ 'https://www.googleapis.com/auth/plus.login', 'email' ],
enumNames: [ 'Google+ name', 'Simple email address' ]
}
},
required: ['callbackURL', 'clientID', 'clientSecret']
}
// ===================================================================
class AuthGoogleXoPlugin {
constructor ({ xo }) {
this._conf = null
this._xo = xo
}
configure (conf) {
this._conf = conf
}
load () {
const conf = this._conf
const xo = this._xo
xo.registerPassportStrategy(new Strategy(conf, async (accessToken, refreshToken, profile, done) => {
try {
done(null, await xo.registerUser(
'google',
conf.scope === 'email'
? profile.emails[0].value
: profile.displayName
))
} catch (error) {
done(error.message)
}
}))
}
}
// ===================================================================
export default opts => new AuthGoogleXoPlugin(opts)
| Revert "fix: ensure a scope is used" | Revert "fix: ensure a scope is used"
This reverts commit 3fbfbb1b2687de3d7c056a6790ad735b19eb9254.
No longer necessary, this is now fixed in vatesfr/xo-server@8c7d254244fdf0438ab8f0bf9ee7c082f7318f09
| JavaScript | agpl-3.0 | vatesfr/xo-web,lmcro/xo-web,vatesfr/xo-web,lmcro/xo-web,lmcro/xo-web | javascript | ## Code Before:
import { Strategy } from 'passport-google-oauth20'
// ===================================================================
export const configurationSchema = {
type: 'object',
properties: {
callbackURL: {
type: 'string',
description: 'Must be exactly the same as specified on the Google developer console.'
},
clientID: {
type: 'string'
},
clientSecret: {
type: 'string'
},
scope: {
default: 'https://www.googleapis.com/auth/plus.login',
description: 'Note that changing this value will break existing users.',
enum: [ 'https://www.googleapis.com/auth/plus.login', 'email' ],
enumNames: [ 'Google+ name', 'Simple email address' ]
}
},
required: ['callbackURL', 'clientID', 'clientSecret']
}
// ===================================================================
class AuthGoogleXoPlugin {
constructor ({ xo }) {
this._conf = null
this._xo = xo
}
configure (conf) {
this._conf = conf
}
load () {
const conf = {
// TODO: find a better way to inject default values
scope: configurationSchema.properties.scope.default,
...this._conf
}
const xo = this._xo
xo.registerPassportStrategy(new Strategy(conf, async (accessToken, refreshToken, profile, done) => {
try {
done(null, await xo.registerUser(
'google',
conf.scope === 'email'
? profile.emails[0].value
: profile.displayName
))
} catch (error) {
done(error.message)
}
}))
}
}
// ===================================================================
export default opts => new AuthGoogleXoPlugin(opts)
## Instruction:
Revert "fix: ensure a scope is used"
This reverts commit 3fbfbb1b2687de3d7c056a6790ad735b19eb9254.
No longer necessary, this is now fixed in vatesfr/xo-server@8c7d254244fdf0438ab8f0bf9ee7c082f7318f09
## Code After:
import { Strategy } from 'passport-google-oauth20'
// ===================================================================
export const configurationSchema = {
type: 'object',
properties: {
callbackURL: {
type: 'string',
description: 'Must be exactly the same as specified on the Google developer console.'
},
clientID: {
type: 'string'
},
clientSecret: {
type: 'string'
},
scope: {
default: 'https://www.googleapis.com/auth/plus.login',
description: 'Note that changing this value will break existing users.',
enum: [ 'https://www.googleapis.com/auth/plus.login', 'email' ],
enumNames: [ 'Google+ name', 'Simple email address' ]
}
},
required: ['callbackURL', 'clientID', 'clientSecret']
}
// ===================================================================
class AuthGoogleXoPlugin {
constructor ({ xo }) {
this._conf = null
this._xo = xo
}
configure (conf) {
this._conf = conf
}
load () {
const conf = this._conf
const xo = this._xo
xo.registerPassportStrategy(new Strategy(conf, async (accessToken, refreshToken, profile, done) => {
try {
done(null, await xo.registerUser(
'google',
conf.scope === 'email'
? profile.emails[0].value
: profile.displayName
))
} catch (error) {
done(error.message)
}
}))
}
}
// ===================================================================
export default opts => new AuthGoogleXoPlugin(opts)
|
bd40a662cf6271ab80a79fc03df5ea9c1ffb634e | tmuxinator/hamiware.yml | tmuxinator/hamiware.yml |
name: hamiware
root: ~/
windows:
- console: cd && clear
- tablero: cd ~/repos/tablero && yarn start
#- lzd: lzd
- tech-trooper:
layout: even-horizontal
panes:
- cd ~/repos_theiconic/tech-trooper/ && clear
- cd ~/repos_theiconic/tech-trooper/ && clear && git status
|
name: hamiware
root: ~/
windows:
- console: cd && clear
- tablero: cd && clear
#- lzd: lzd
#- tech-trooper:
# layout: even-horizontal
# panes:
# - cd ~/repos_theiconic/tech-trooper/ && clear
# - cd ~/repos_theiconic/tech-trooper/ && clear && git status
| Disable extra panes for now | Disable extra panes for now
| YAML | mit | jorgeborges/dotfiles,jorgeborges/dotfiles | yaml | ## Code Before:
name: hamiware
root: ~/
windows:
- console: cd && clear
- tablero: cd ~/repos/tablero && yarn start
#- lzd: lzd
- tech-trooper:
layout: even-horizontal
panes:
- cd ~/repos_theiconic/tech-trooper/ && clear
- cd ~/repos_theiconic/tech-trooper/ && clear && git status
## Instruction:
Disable extra panes for now
## Code After:
name: hamiware
root: ~/
windows:
- console: cd && clear
- tablero: cd && clear
#- lzd: lzd
#- tech-trooper:
# layout: even-horizontal
# panes:
# - cd ~/repos_theiconic/tech-trooper/ && clear
# - cd ~/repos_theiconic/tech-trooper/ && clear && git status
|
71b0adcdf10e9edd1503e75c0927a0c18acc7c97 | README.md | README.md |
A CSV parser and builder for PHP.
The `CsvParser` class implements the `Iterator` interface meaning large files can be parsed
without hitting any memory limits because only one line is loaded at a time.
## Requirements
* PHP >= 5.3
## Usage
#### Building a CSV file for download
```php
<?php
use Palmtree\Csv\CsvBuilder;
$csv = new CsvBuilder( 'people.csv' );
$csv->addHeaders( [ 'name', 'age', 'gender' ] );
$csv->addRow( [ 'Alice', '24', 'Female'] );
$csv->addRow( [ 'Bob', '28', 'Male' ] );
$csv->download();
```
#### Parsing a CSV file into an array
```php
<?php
use Palmtree\Csv\CsvParser;
$csv = new CsvParser( 'people.csv' );
foreach( $csv as $row ) {
// Alice is a 24 year old female.
echo "{$row['name']} is a {$row['age']} year old {$row['gender']}";
}
```
|
A CSV reader and writer for PHP.
The `Reader` class implements the `Iterator` interface meaning large files can be parsed
without hitting any memory limits because only one line is loaded at a time.
## Requirements
* PHP >= 5.3
## Usage
#### Building a CSV file for download
```php
<?php
use Palmtree\Csv\Writer;
$people = [];
$people[] = [
'name' => 'Alice',
'age' => '24',
'gender' => 'Female',
];
$people[] = [
'name' => 'Bob',
'age' => '28',
'gender' => 'Male',
];
$csv = new Writer( $people );
$csv->download('people.csv');
// OR
$csv->write('/path/to/save/people.csv');
```
#### Reading a CSV file
```php
<?php
use Palmtree\Csv\Reader;
$csv = new Reader( 'people.csv' );
foreach( $csv as $row ) {
echo "{$row['name']} is a {$row['age']} year old {$row['gender']}";
}
```
See the [examples](examples) directory for more usage examples.
| Update readme with new class names | Update readme with new class names
| Markdown | mit | palmtreephp/csv | markdown | ## Code Before:
A CSV parser and builder for PHP.
The `CsvParser` class implements the `Iterator` interface meaning large files can be parsed
without hitting any memory limits because only one line is loaded at a time.
## Requirements
* PHP >= 5.3
## Usage
#### Building a CSV file for download
```php
<?php
use Palmtree\Csv\CsvBuilder;
$csv = new CsvBuilder( 'people.csv' );
$csv->addHeaders( [ 'name', 'age', 'gender' ] );
$csv->addRow( [ 'Alice', '24', 'Female'] );
$csv->addRow( [ 'Bob', '28', 'Male' ] );
$csv->download();
```
#### Parsing a CSV file into an array
```php
<?php
use Palmtree\Csv\CsvParser;
$csv = new CsvParser( 'people.csv' );
foreach( $csv as $row ) {
// Alice is a 24 year old female.
echo "{$row['name']} is a {$row['age']} year old {$row['gender']}";
}
```
## Instruction:
Update readme with new class names
## Code After:
A CSV reader and writer for PHP.
The `Reader` class implements the `Iterator` interface meaning large files can be parsed
without hitting any memory limits because only one line is loaded at a time.
## Requirements
* PHP >= 5.3
## Usage
#### Building a CSV file for download
```php
<?php
use Palmtree\Csv\Writer;
$people = [];
$people[] = [
'name' => 'Alice',
'age' => '24',
'gender' => 'Female',
];
$people[] = [
'name' => 'Bob',
'age' => '28',
'gender' => 'Male',
];
$csv = new Writer( $people );
$csv->download('people.csv');
// OR
$csv->write('/path/to/save/people.csv');
```
#### Reading a CSV file
```php
<?php
use Palmtree\Csv\Reader;
$csv = new Reader( 'people.csv' );
foreach( $csv as $row ) {
echo "{$row['name']} is a {$row['age']} year old {$row['gender']}";
}
```
See the [examples](examples) directory for more usage examples.
|
55dc9595a25dd135bcdeff96dee77dafcd4575b6 | bottleopener/shiftrConnector.cpp | bottleopener/shiftrConnector.cpp |
void ShiftrConnector::init(const char* deviceLogin, const char* pwd)
{
client.begin("broker.shiftr.io");
this->deviceLogin = deviceLogin;
this->pwd = pwd;
connect();
client.subscribe("/bottle-openner");
// client.unsubscribe("/bottle-openner");
}
void ShiftrConnector::connect() {
while (!client.connect("arduino", this->deviceLogin, this->pwd)) {
Serial.print(".");
delay(500);
}
Serial.println("\nconnected to Shiftr!");
}
void ShiftrConnector::loop()
{
client.loop();
if (!client.connected()) {
connect();
}
}
void ShiftrConnector::sendCounter(int counter)
{
char buf[5];
itoa(counter, buf, 10);
client.publish("/bottle-openner", buf);
}
|
void ShiftrConnector::init(const char* deviceLogin, const char* pwd)
{
client.begin("broker.shiftr.io");
this->deviceLogin = deviceLogin;
this->pwd = pwd;
connect();
client.subscribe("/bottle-openner");
// client.unsubscribe("/bottle-openner");
}
void ShiftrConnector::connect() {
while (!client.connect("arduino", this->deviceLogin, this->pwd)) {
Serial.print(".");
delay(500);
}
Serial.println("\nBottle-Opener is now connected to Shiftr!");
}
void ShiftrConnector::loop()
{
client.loop();
if (!client.connected()) {
connect();
}
}
void ShiftrConnector::sendCounter(int counter)
{
char buf[5];
itoa(counter, buf, 10);
client.publish("/bottle-openner", buf);
}
| Extend log when connected to the IoT platform | Extend log when connected to the IoT platform
| C++ | mit | Zenika/bottleopener_iot,Zenika/bottleopener_iot,Zenika/bottleopener_iot,Zenika/bottleopener_iot | c++ | ## Code Before:
void ShiftrConnector::init(const char* deviceLogin, const char* pwd)
{
client.begin("broker.shiftr.io");
this->deviceLogin = deviceLogin;
this->pwd = pwd;
connect();
client.subscribe("/bottle-openner");
// client.unsubscribe("/bottle-openner");
}
void ShiftrConnector::connect() {
while (!client.connect("arduino", this->deviceLogin, this->pwd)) {
Serial.print(".");
delay(500);
}
Serial.println("\nconnected to Shiftr!");
}
void ShiftrConnector::loop()
{
client.loop();
if (!client.connected()) {
connect();
}
}
void ShiftrConnector::sendCounter(int counter)
{
char buf[5];
itoa(counter, buf, 10);
client.publish("/bottle-openner", buf);
}
## Instruction:
Extend log when connected to the IoT platform
## Code After:
void ShiftrConnector::init(const char* deviceLogin, const char* pwd)
{
client.begin("broker.shiftr.io");
this->deviceLogin = deviceLogin;
this->pwd = pwd;
connect();
client.subscribe("/bottle-openner");
// client.unsubscribe("/bottle-openner");
}
void ShiftrConnector::connect() {
while (!client.connect("arduino", this->deviceLogin, this->pwd)) {
Serial.print(".");
delay(500);
}
Serial.println("\nBottle-Opener is now connected to Shiftr!");
}
void ShiftrConnector::loop()
{
client.loop();
if (!client.connected()) {
connect();
}
}
void ShiftrConnector::sendCounter(int counter)
{
char buf[5];
itoa(counter, buf, 10);
client.publish("/bottle-openner", buf);
}
|
a77b3fe598d7437112b3596463204483701186c8 | setup/setup_tm.sh | setup/setup_tm.sh |
source ~/dotfiles/setup/header.sh
# The path to the cloned Asimov repository
export ASIMOV_PATH=~/asimov
# Exclude the given directory path from Time Machine
exclude_dir() {
local dir_path="${1%/}"
echo "Excluding $dir_path"
sudo tmutil addexclusion -p "$dir_path"
}
# Only back up /Users
for dir_path in /*/ /.*/; do
if [[ "$dir_path" != '/Users/' && "$dir_path" != '/./' && "$dir_path" != '/../' ]]; then
exclude_dir "$dir_path"
fi
done
# Exclude large directories under user home directory
exclude_dir ~/Library
exclude_dir ~/n
exclude_dir ~/.atom
# Clone Asimov for excluding development directories
if [ ! -d "$ASIMOV_PATH" ]; then
mkdir -p "$ASIMOV_PATH"
git clone https://github.com/caleb531/asimov.git "$ASIMOV_PATH"
else
pushd "$ASIMOV_PATH" > /dev/null || exit
git pull > /dev/null
popd > /dev/null || exit
fi
"$ASIMOV_PATH"/install.sh
|
source ~/dotfiles/setup/header.sh
# The path to the cloned Asimov repository
export ASIMOV_PATH=~/asimov
# Exclude the given directory path from Time Machine
exclude_dir() {
local dir_path="${1%/}"
echo "Excluding $dir_path"
sudo tmutil addexclusion -p "$dir_path"
}
# Only back up /Users
for dir_path in /*/ /.*/; do
if [[ "$dir_path" != '/Users/' && "$dir_path" != '/./' && "$dir_path" != '/../' ]]; then
exclude_dir "$dir_path"
fi
done
# Exclude large directories under user home directory
exclude_dir ~/Library
exclude_dir ~/n
exclude_dir ~/.atom
exclude_dir ~/Music/iTunes/Album\ Artwork/Cache
# Clone Asimov for excluding development directories
if [ ! -d "$ASIMOV_PATH" ]; then
mkdir -p "$ASIMOV_PATH"
git clone https://github.com/caleb531/asimov.git "$ASIMOV_PATH"
else
pushd "$ASIMOV_PATH" > /dev/null || exit
git pull > /dev/null
popd > /dev/null || exit
fi
"$ASIMOV_PATH"/install.sh
| Exclude Album Artwork Cache directory from TM | Exclude Album Artwork Cache directory from TM
| Shell | mit | caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles,caleb531/dotfiles | shell | ## Code Before:
source ~/dotfiles/setup/header.sh
# The path to the cloned Asimov repository
export ASIMOV_PATH=~/asimov
# Exclude the given directory path from Time Machine
exclude_dir() {
local dir_path="${1%/}"
echo "Excluding $dir_path"
sudo tmutil addexclusion -p "$dir_path"
}
# Only back up /Users
for dir_path in /*/ /.*/; do
if [[ "$dir_path" != '/Users/' && "$dir_path" != '/./' && "$dir_path" != '/../' ]]; then
exclude_dir "$dir_path"
fi
done
# Exclude large directories under user home directory
exclude_dir ~/Library
exclude_dir ~/n
exclude_dir ~/.atom
# Clone Asimov for excluding development directories
if [ ! -d "$ASIMOV_PATH" ]; then
mkdir -p "$ASIMOV_PATH"
git clone https://github.com/caleb531/asimov.git "$ASIMOV_PATH"
else
pushd "$ASIMOV_PATH" > /dev/null || exit
git pull > /dev/null
popd > /dev/null || exit
fi
"$ASIMOV_PATH"/install.sh
## Instruction:
Exclude Album Artwork Cache directory from TM
## Code After:
source ~/dotfiles/setup/header.sh
# The path to the cloned Asimov repository
export ASIMOV_PATH=~/asimov
# Exclude the given directory path from Time Machine
exclude_dir() {
local dir_path="${1%/}"
echo "Excluding $dir_path"
sudo tmutil addexclusion -p "$dir_path"
}
# Only back up /Users
for dir_path in /*/ /.*/; do
if [[ "$dir_path" != '/Users/' && "$dir_path" != '/./' && "$dir_path" != '/../' ]]; then
exclude_dir "$dir_path"
fi
done
# Exclude large directories under user home directory
exclude_dir ~/Library
exclude_dir ~/n
exclude_dir ~/.atom
exclude_dir ~/Music/iTunes/Album\ Artwork/Cache
# Clone Asimov for excluding development directories
if [ ! -d "$ASIMOV_PATH" ]; then
mkdir -p "$ASIMOV_PATH"
git clone https://github.com/caleb531/asimov.git "$ASIMOV_PATH"
else
pushd "$ASIMOV_PATH" > /dev/null || exit
git pull > /dev/null
popd > /dev/null || exit
fi
"$ASIMOV_PATH"/install.sh
|
22aa637d801a02ad6d64f607657ae3e00406888d | .travis.yml | .travis.yml | language: cpp
compiler:
- g++
os:
- linux
script: make && make test
| language: cpp
compiler:
- g++
os:
- linux
script: make && make test
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "KdiCvRP3pJ8KyOyNIaaqXvrGJvKOlW8Kh/tAsMKuu7trWi6XIvmmJKUeiRC3nHeiMq5cNOTau9WYbi7Q5C7wQLgf1K8xZrdA2T74rmtiyirIL+jlWGuI7VqCTdvvASthIJgTfX7JFfjy9kjsjOn3Ol0RsF1zyiG2sK5vTVO5U3h8b5zSenm6nSTbV4L2vpmMcPflbOhIDkiK6QZ9U3NK9qjGd3PEYMPRJ1f4tstLQbUq1zO5CY624jVWPYBxP9UkyQtyk6UKAViYNf2mBbJSBR8udKn3xExyuTOmOAOJfyL0cnmSPbATJMGzQzudy3x4vuEU3XRWzol5FDT9V6kYlo9PEb8SSa2VjfWMz80yYWcIwxQfvQn76ZSlR+o6yegNNWF8bMsI1ZUmbRbXvzEP8A8/zMQ5vgF7yV1XImKPPENrVU9hc8f2l9kxhhBpv1zJzbRto/+Qt6zWIDnDOdbbflMK6kqtNbJsIyIRrU2h3cELgKZ/DLhwS70B36gs6Xs6EgiWGVVb61eaCgjcBGV4xMuZD2BVRRU6XuFvg1nm0gbN9mBtrjdHUCKfQng4fEWR3bD0VHRGRFA57eXbUdFrUDN/FwGL+UWPA6f/ch4+dyIng0TFlQ4UZEtAZsrcs1Fe0VWmhmETkHpCyJDDmRo/hWNfqvnPDOg9WId6lgtJGlw="
before_install:
- echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
addons:
coverity_scan:
project:
name: "hongliuliao/ehttp"
description: "http server base on epoll"
notification_email: 357857613@qq.com
build_command_prepend: "make clean"
build_command: "make && make test"
branch_pattern: master
| Automate Analysis with Travis CI | Automate Analysis with Travis CI
Automate Analysis with Travis CI | YAML | apache-2.0 | hongliuliao/ehttp,hongliuliao/ehttp,hongliuliao/simple_server,hongliuliao/ehttp,hongliuliao/ehttp | yaml | ## Code Before:
language: cpp
compiler:
- g++
os:
- linux
script: make && make test
## Instruction:
Automate Analysis with Travis CI
Automate Analysis with Travis CI
## Code After:
language: cpp
compiler:
- g++
os:
- linux
script: make && make test
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "KdiCvRP3pJ8KyOyNIaaqXvrGJvKOlW8Kh/tAsMKuu7trWi6XIvmmJKUeiRC3nHeiMq5cNOTau9WYbi7Q5C7wQLgf1K8xZrdA2T74rmtiyirIL+jlWGuI7VqCTdvvASthIJgTfX7JFfjy9kjsjOn3Ol0RsF1zyiG2sK5vTVO5U3h8b5zSenm6nSTbV4L2vpmMcPflbOhIDkiK6QZ9U3NK9qjGd3PEYMPRJ1f4tstLQbUq1zO5CY624jVWPYBxP9UkyQtyk6UKAViYNf2mBbJSBR8udKn3xExyuTOmOAOJfyL0cnmSPbATJMGzQzudy3x4vuEU3XRWzol5FDT9V6kYlo9PEb8SSa2VjfWMz80yYWcIwxQfvQn76ZSlR+o6yegNNWF8bMsI1ZUmbRbXvzEP8A8/zMQ5vgF7yV1XImKPPENrVU9hc8f2l9kxhhBpv1zJzbRto/+Qt6zWIDnDOdbbflMK6kqtNbJsIyIRrU2h3cELgKZ/DLhwS70B36gs6Xs6EgiWGVVb61eaCgjcBGV4xMuZD2BVRRU6XuFvg1nm0gbN9mBtrjdHUCKfQng4fEWR3bD0VHRGRFA57eXbUdFrUDN/FwGL+UWPA6f/ch4+dyIng0TFlQ4UZEtAZsrcs1Fe0VWmhmETkHpCyJDDmRo/hWNfqvnPDOg9WId6lgtJGlw="
before_install:
- echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
addons:
coverity_scan:
project:
name: "hongliuliao/ehttp"
description: "http server base on epoll"
notification_email: 357857613@qq.com
build_command_prepend: "make clean"
build_command: "make && make test"
branch_pattern: master
|
b2219cf150766400a9c60c70a4cb528b551e20e4 | src/Symfony/Component/Finder/README.md | src/Symfony/Component/Finder/README.md | Finder Component
================
Finder finds files and directories via an intuitive fluent interface.
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$iterator = $finder
->files()
->name('*.php')
->depth(0)
->size('>= 1K')
->in(__DIR__);
foreach ($iterator as $file) {
print $file->getRealpath()."\n";
}
But you can also use it to find files stored remotely like in this example where
we are looking for files on Amazon S3:
$s3 = new \Zend_Service_Amazon_S3($key, $secret);
$s3->registerStreamWrapper("s3");
$finder = new Finder();
$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
foreach ($finder->in('s3://bucket-name') as $file) {
print $file->getFilename()."\n";
}
Resources
---------
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Finder/
$ composer.phar install
$ phpunit
| Finder Component
================
Finder finds files and directories via an intuitive fluent interface.
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$iterator = $finder
->files()
->name('*.php')
->depth(0)
->size('>= 1K')
->in(__DIR__);
foreach ($iterator as $file) {
print $file->getRealpath()."\n";
}
The resulting contents of the iterator are instances of [SplFileInfo][1]. You can
thus use all of SplFileInfo's methods (getPerms(), getSize(), etc) on them. See
[the API documentation][2] or the [web tutorial][3] for more.
But you can also use it to find files stored remotely like in this example where
we are looking for files on Amazon S3:
$s3 = new \Zend_Service_Amazon_S3($key, $secret);
$s3->registerStreamWrapper("s3");
$finder = new Finder();
$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
foreach ($finder->in('s3://bucket-name') as $file) {
print $file->getFilename()."\n";
}
Resources
---------
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Finder/
$ composer.phar install
$ phpunit
[1]: http://php.net/splfileinfo
[2]: http://api.symfony.com/2.5/Symfony/Component/Finder/SplFileInfo.html
[3]: http://symfony.com/doc/current/components/finder.html#usage
| Add info about possibilities offered by SplFileInfo | [Finder] Add info about possibilities offered by SplFileInfo
| Markdown | mit | ivanovnickolay/symfony,0x73/symfony,peterrehm/symfony,xabbuh/symfony,realityking/symfony,frankdejonge/symfony,phramz/symfony,lemoinem/symfony,jderusse/symfony,guanhui07/symfony,beoboo/symfony,gonzalovilaseca/symfony,showpad/symfony,aeoris/symfony,inso/symfony,jenalgit/symfony,mimaidms/symfony,bocharsky-bw/symfony,joelwurtz/symfony,alekitto/symfony,glensc/symfony,gcds/symfony,sergeyfedotov/symfony,mimaidms/symfony,howtolearntocode/symfony,Strate/symfony,ajgarlag/symfony,georaldc/symfony,ianfp/symfony,MAXakaWIZARD/symfony,Entropy03/symfony,ChMat/symfony,Padam87/symfony,mickaelandrieu/symfony,georaldc/symfony,AlexDpy/symfony,oleg-andreyev/symfony,jakzal/symfony,deciament/symfony,chalasr/symfony,VaShu/symfony,gonzalovilaseca/symfony,Entropy03/symfony,docteurklein/symfony,Naktibalda/symfony,weaverryan/symfony,danionut90/symfony,rmed19/symfony,Einenlum/symfony,Entropy03/symfony,tangkepeng/symfony,danionut90/symfony,tPl0ch/symfony,0x73/symfony,lcp0578/symfony,keradus/symfony,beealone/symfony,apfelbox/symfony,dkarvounaris/symfony,Engerim/symfony,aecca/symfony,joelwurtz/symfony,danielbber/symfony,xphere-forks/symfony,jakubsacha/symfony,beoboo/symfony,teohhanhui/symfony,BeastModeON/symfony,smatyas/symfony,moycarretero/behat,tronsha/symfony,tronsha/symfony,fduch/symfony,Restless-ET/symfony,Richard87/symfony,sergeyfedotov/symfony,kitsunet/symfony,pix-art/symfony,VaShu/symfony,hhamon/symfony,damienalexandre/symfony,sdiaz/symfony,HeahDude/symfony,ctrl-f5/symfony,dawehner/symfony,jamyouss/symfony,zilionis/symfony,giosh94mhz/symfony,tekjava/symfony,Soullivaneuh/symfony,SpacePossum/symfony,Nicofuma/symfony,codeclimate-testing/symfony,MisatoTremor/symfony,teohhanhui/symfony,ewgRa/symfony,gencer/symfony,Padam87/symfony,derrabus/symfony,rmed19/symfony,andreia/symfony,tangkepeng/symfony,vith/symfony,mickaelandrieu/symfony,gharlan/symfony,yjv/symfony,superdav42/symfony,OskarStark/symfony,MisatoTremor/symfony,razmo/symfony,EVODelavega/symfony,lemoinem/symfony,lepiaf/symfony,mpajunen/symfony,Mak-Di/symfony,pyrech-forks/symfony,beealone/symfony,rpg600/symfony,alekitto/symfony,mimaidms/symfony,splio-aleroux/symfony,aecca/symfony,splio-aleroux/symfony,Amo/symfony,havvg/symfony,peterrehm/symfony,smatyas/symfony,jameshalsall/symfony,Ocramius/symfony,Nyholm/symfony,realityking/symfony,kbond/symfony,ro0NL/symfony,MAXakaWIZARD/symfony,dkarvounaris/symfony,rmed19/symfony,tPl0ch/symfony,sstok/symfony,damienalexandre/symfony,voronkovich/symfony,superdav42/symfony,andreia/symfony,jamyouss/symfony,phramz/symfony,yethee/symfony,digitalkaoz/symfony,danielbber/symfony,Slamdunk/symfony,guanhui07/symfony,lyrixx/symfony,sergeyfedotov/symfony,Seanmcn/symfony,romainneutron/symfony,ragboyjr/symfony,pamil/symfony,jvasseur/symfony,ksom/symfony,wilderguzman/symfony,bocharsky-bw/symfony,deguif/symfony,mvhirsch/symfony,peterrehm/symfony,OndraM/symfony,fesor/symfony,shieldo/symfony,andrerom/symfony,lrlopez/symfony,znerol/symfony,superdav42/symfony,dmaicher/symfony,ragboyjr/symfony,yjv/symfony,Triiistan/symfony,MisatoTremor/symfony,bburnichon/symfony,jaytaph/symfony,nakashu/symfony,danilogiacomi/symfony,pix-art/symfony,1ed/symfony,natechicago/symfony,danielbber/symfony,showpad/symfony,Rvanlaak/symfony,dunglas/symfony,Koc/symfony,jzawadzki/symfony,SaschaDens/symfony,tekjava/symfony,fyee/symfony,wilderguzman/symfony,yjv/symfony,jeremyFreeAgent/symfony,nVitius/symfony,splio-aleroux/symfony,jenalgit/symfony,jvasseur/symfony,douglaslinsmeyer/symfony,SpacePossum/symfony,Rvanlaak/symfony,mweimerskirch/symfony,oleg-andreyev/symfony,OndraM/symfony,danionut90/symfony,maiksuaco/symfony,havvg/symfony,unexge/symfony,danilogiacomi/symfony,nicolas-grekas/symfony,Nicofuma/symfony,fyee/symfony,yceruto/symfony,dkarvounaris/symfony,hhamon/symfony,origaminal/symfony,teohhanhui/symfony,realityking/symfony,xabbuh/symfony,pix-art/symfony,francisbesset/symfony,neemzy/symfony,realityking/symfony,chalasr/symfony,zilionis/symfony,dosten/symfony,garak/symfony,cvuorinen/symfony,Incognito/symfony,AlexDpy/symfony,Aliance/symfony,zorn-v/symfony,realityking/symfony,Faisalawanisee/symfony,spreston/symfony,ctrl-f5/symfony,sroze/symfony,NiR-/symfony,SaschaDens/symfony,lemoinem/symfony,weaverryan/symfony,MisatoTremor/symfony,yinhe007/symfony,paradajozsef/symfony,arno14/symfony,xavierleune/symfony,rpg600/symfony,aschempp/symfony,0x73/symfony,ImaginationSydney/symfony,howtolearntocode/symfony,jelte/symfony,fyee/symfony,jjanvier/symfony,derrabus/symfony,kitsunet/symfony,danionut90/symfony,GerbenWijnja/symfony,NiR-/symfony,klandaika/symfony,jelte/symfony,Incognito/symfony,aecca/symfony,chrisbel/formationgit,hhamon/symfony,jaytaph/symfony,OskarStark/symfony,geoffrey-brier/symfony,ygerasimov/symfony,iltar/symfony,giosh94mhz/symfony,thunderer/symfony,patrick-mcdougle/symfony,jpauli/symfony,xavierleune/symfony,gadelkareem/symfony,curry684/symfony,kbond/symfony,weaverryan/symfony,imphil/symfony,guanhui07/symfony,SofHad/symfony,jvasseur/symfony,Mak-Di/symfony,arno14/symfony,oleg-andreyev/symfony,vith/symfony,mihai-stancu/symfony,nykopol/symfony,dkarvounaris/symfony,Amo/symfony,dawehner/symfony,rodnaph/symfony,deguif/symfony,maidmaid/symfony,beoboo/symfony,linovarona/symfony,Socratemus/symfony,davewwww/symfony,mpajunen/symfony,deciament/symfony,codeclimate-testing/symfony,evancauwenberg/symfony,mhujer/symfony,origaminal/symfony,michaelperrin/symfony,Nicofuma/symfony,mvhirsch/symfony,maiksuaco/symfony,Deamon/symfony,chrisguitarguy/symfony,dbu/symfony,Socratemus/symfony,MatTheCat/symfony,ImaginationSydney/symfony,e-moe/symfony,tronsha/symfony,fabpot/symfony,WhiteEagle88/symfony,natechicago/symfony,tecnocat/symfony,Wasserschlange/symfony,chrisguitarguy/symfony,hichammoad/symfony,rpg600/symfony,alebo/symfony,Nicofuma/symfony,vincentaubert/symfony,joelwurtz/symfony,Ener-Getick/symfony,sustmi/symfony,gimler/symfony,dbu/symfony,ygerasimov/symfony,Pierstoval/symfony,ajgarlag/symfony,FlorianLB/symfony,yinhe007/symfony,zcodes/symfony,Naktibalda/symfony,zhaoyan158567/symfony,natechicago/symfony,mathroc/symfony,c960657/symfony,Taluu/symfony,ro0NL/symfony,digitalkaoz/symfony,Nyholm/symfony,GuilhemN/symfony,OskarStark/symfony,e-moe/symfony,1ed/symfony,Tobion/symfony,ImaginationSydney/symfony,havvg/symfony,geoffrey-brier/symfony,ygerasimov/symfony,Ener-Getick/symfony,Nyholm/symfony,imphil/symfony,sdiaz/symfony,dmaicher/symfony,jzawadzki/symfony,bendavies/symfony,tgalopin/symfony,smatyas/symfony,adamelso/symfony,pyrech/symfony,geoffrey-brier/symfony,Tobion/symfony,ianfp/symfony,danilogiacomi/symfony,snoek09/symfony,kix/symfony,sof1105/symfony,Deamon/symfony,iltar/symfony,maiksuaco/symfony,nVitius/symfony,tecnocat/symfony,madflow/symfony,NiR-/symfony,k0pernikus/symfony,inso/symfony,c960657/symfony,SpacePossum/symfony,showpad/symfony,rquadling/symfony,voronkovich/symfony,giosh94mhz/symfony,ksom/symfony,NiR-/symfony,tecnocat/symfony,gharlan/symfony,alebo/symfony,bryanagee/symfony,mpajunen/symfony,adamelso/symfony,origaminal/symfony,phramz/symfony,shakaran/symfony,ewgRa/symfony,hiddewie/symfony,zerustech/symfony,dzuelke/symfony,SaschaDens/symfony,jameshalsall/symfony,peterjmit/symfony,OskarStark/symfony,mxnr/symfony,znerol/symfony,howtolearntocode/symfony,gimler/symfony,giosh94mhz/symfony,pix-art/symfony,Socratemus/symfony,Naktibalda/symfony,ro0NL/symfony,xijia37/symfony,Incognito/symfony,xphere-forks/symfony,yethee/symfony,jamyouss/symfony,glensc/symfony,moycarretero/behat,madflow/symfony,Wasserschlange/symfony,Seanmcn/symfony,hichammoad/symfony,Rvanlaak/symfony,ragboyjr/symfony,ihsanudin/symfony,believer-ufa/symfony,bryanagee/symfony,jameshalsall/symfony,Wasserschlange/symfony,maidmaid/symfony,fesor/symfony,WhiteEagle88/symfony,ImaginationSydney/symfony,jameshalsall/symfony,linovarona/symfony,gnat42/symfony,Socratemus/symfony,mvhirsch/symfony,pamil/symfony,andreia/symfony,inso/symfony,vincentaubert/symfony,tucksaun/symfony,jakzal/symfony,arjenm/symfony,Restless-ET/symfony,unexge/symfony,arjenm/symfony,vith/symfony,WouterJ/symfony,madflow/symfony,d-ph/symfony,rodnaph/symfony,ihsanudin/symfony,thunderer/symfony,webmozart/symfony,gcds/symfony,datagit/symfony,ahsio/symfony,fussl/symfony,jenalgit/symfony,glensc/symfony,FlorianLB/symfony,evancauwenberg/symfony,mpdude/symfony,aeoris/symfony,dawehner/symfony,Pierstoval/symfony,chrisbel/formationgit,k0pernikus/symfony,nVitius/symfony,linovarona/symfony,owyowoo/symfony,evancauwenberg/symfony,douglaslinsmeyer/symfony,owyowoo/symfony,gepo/symfony,sdiaz/symfony,EVODelavega/symfony,Ocramius/symfony,issei-m/symfony,fabpot/symfony,peterjmit/symfony,nakashu/symfony,Ener-Getick/symfony,chrisguitarguy/symfony,gharlan/symfony,Rvanlaak/symfony,xijia37/symfony,unkind/symfony,shakaran/symfony,nasimnabavi/symfony,madflow/symfony,analogic/symfony,alcohol/symfony,jderusse/symfony,gcds/symfony,pyrech-forks/symfony,EVODelavega/symfony,datagit/symfony,Incognito/symfony,guanhui07/symfony,gimler/symfony,keradus/symfony,natechicago/symfony,kix/symfony,druid628/symfony,alcohol/symfony,beoboo/symfony,lyrixx/symfony,lepiaf/symfony,believer-ufa/symfony,deciament/symfony,xphere-forks/symfony,ogizanagi/symfony,SaschaDens/symfony,backbone87/symfony,dosten/symfony,jvasseur/symfony,garak/symfony,Nyholm/symfony,davewwww/symfony,sdiaz/symfony,sgehrig/symfony,mweimerskirch/symfony,yjv/symfony,bburnichon/symfony,xabbuh/symfony,jakubsacha/symfony,Padam87/symfony,znerol/symfony,codeclimate-testing/symfony,skler/symfony,klandaika/symfony,symfony/symfony,OndraM/symfony,beoboo/symfony,zerustech/symfony,damienalexandre/symfony,deguif/symfony,danilogiacomi/symfony,madflow/symfony,thunderer/symfony,okdana/symfony,voronkovich/symfony,SofHad/symfony,bocharsky-bw/symfony,nakashu/symfony,dawehner/symfony,ajgarlag/symfony,HeahDude/symfony,Richard87/symfony,garak/symfony,apetitpa/symfony,lrlopez/symfony,ianfp/symfony,ImaginationSydney/symfony,nykopol/symfony,yceruto/symfony,showpad/symfony,patrick-mcdougle/symfony,spreston/symfony,ajgarlag/symfony,jderusse/symfony,pyrech/symfony,keradus/symfony,shakaran/symfony,howtolearntocode/symfony,derrabus/symfony,xavierleune/symfony,peterrehm/symfony,zerustech/symfony,ksom/symfony,arduanov/symfony,jpauli/symfony,glensc/symfony,mmauri04/symfony,pyrech/symfony,ianfp/symfony,HeahDude/symfony,paradajozsef/symfony,davewwww/symfony,geoffrey-brier/symfony,mweimerskirch/symfony,Aliance/symfony,mihai-stancu/symfony,dbu/symfony,rquadling/symfony,MatTheCat/symfony,sroze/symfony,sustmi/symfony,chalasr/symfony,pierredup/symfony,bendavies/symfony,kix/symfony,mvhirsch/symfony,mhujer/symfony,tPl0ch/symfony,Restless-ET/symfony,Padam87/symfony,tgalopin/symfony,lcp0578/symfony,FlorianLB/symfony,ChMat/symfony,apetitpa/symfony,kbond/symfony,tangkepeng/symfony,chrisbel/formationgit,danilogiacomi/symfony,lstrojny/symfony,ahsio/symfony,aitboudad/symfony,ihsanudin/symfony,evancauwenberg/symfony,docteurklein/symfony,apfelbox/symfony,Tobion/symfony,Faisalawanisee/symfony,evancauwenberg/symfony,chrisguitarguy/symfony,sroze/symfony,okdana/symfony,nasimnabavi/symfony,GuilhemN/symfony,Restless-ET/symfony,razmo/symfony,symfony/symfony,d-ph/symfony,stof/symfony,danionut90/symfony,Entropy03/symfony,AlexDpy/symfony,skler/symfony,ctrl-f5/symfony,shieldo/symfony,Naktibalda/symfony,aeoris/symfony,Entropy03/symfony,mvhirsch/symfony,datagit/symfony,Edouard-chin/symfony,francisbesset/symfony,fyee/symfony,Padam87/symfony,tucksaun/symfony,Ocramius/symfony,yjv/symfony,lstrojny/symfony,havvg/symfony,curry684/symfony,Edouard-chin/symfony,webmozart/symfony,VaShu/symfony,jeremyFreeAgent/symfony,calm10/Symfony2,sgehrig/symfony,Triiistan/symfony,imphil/symfony,dmaicher/symfony,MisatoTremor/symfony,mxnr/symfony,spreston/symfony,gonzalovilaseca/symfony,apetitpa/symfony,georaldc/symfony,Simperfit/symfony,iltar/symfony,kix/symfony,hiddewie/symfony,sstok/symfony,vlajos/symfony,ksom/symfony,mxnr/symfony,Ener-Getick/symfony,digitalkaoz/symfony,dzuelke/symfony,vlajos/symfony,csarrazi/symfony,mickaelandrieu/symfony,mnapoli/symfony,ChMat/symfony,stof/symfony,nykopol/symfony,nasimnabavi/symfony,unkind/symfony,lemoinem/symfony,SofHad/symfony,georaldc/symfony,smatyas/symfony,believer-ufa/symfony,andrerom/symfony,javiereguiluz/symfony,fduch/symfony,ctrl-f5/symfony,mathroc/symfony,SaschaDens/symfony,Koc/symfony,Edouard-chin/symfony,dosten/symfony,nykopol/symfony,Triiistan/symfony,Deamon/symfony,Faisalawanisee/symfony,beealone/symfony,zcodes/symfony,chrisbel/formationgit,josephdpurcell/symfony,WouterJ/symfony,davewwww/symfony,totophe/symfony,mpajunen/symfony,localheinz/symfony,owyowoo/symfony,geoffrey-brier/symfony,jean-gui/symfony,Strate/symfony,cvuorinen/symfony,GerbenWijnja/symfony,lcp0578/symfony,unexge/symfony,Rvanlaak/symfony,dzuelke/symfony,digitalkaoz/symfony,Simperfit/symfony,dunglas/symfony,GerbenWijnja/symfony,znerol/symfony,jpauli/symfony,tgalopin/symfony,Triiistan/symfony,voronkovich/symfony,peterjmit/symfony,xijia37/symfony,beealone/symfony,nakashu/symfony,alebo/symfony,WhiteEagle88/symfony,derrabus/symfony,Simperfit/symfony,alebo/symfony,oleg-andreyev/symfony,splio-aleroux/symfony,e-moe/symfony,jeremyFreeAgent/symfony,aitboudad/symfony,mxnr/symfony,fyee/symfony,guanhui07/symfony,Deamon/symfony,mathroc/symfony,issei-m/symfony,csarrazi/symfony,shieldo/symfony,arno14/symfony,dkarvounaris/symfony,mnapoli/symfony,jeremyFreeAgent/symfony,ivanovnickolay/symfony,MAXakaWIZARD/symfony,zerkms/symfony,ogizanagi/symfony,SpacePossum/symfony,vith/symfony,ewgRa/symfony,fesor/symfony,Ocramius/symfony,Wasserschlange/symfony,pierredup/symfony,ewgRa/symfony,issei-m/symfony,chrisguitarguy/symfony,rquadling/symfony,tecnocat/symfony,gnat42/symfony,c960657/symfony,Soullivaneuh/symfony,Deamon/symfony,francisbesset/symfony,ivanovnickolay/symfony,razmo/symfony,wilderguzman/symfony,jjanvier/symfony,k0pernikus/symfony,Einenlum/symfony,joelwurtz/symfony,EVODelavega/symfony,mathroc/symfony,dmaicher/symfony,nVitius/symfony,aitboudad/symfony,frankdejonge/symfony,OndraM/symfony,neemzy/symfony,bfolliot/symfony,iltar/symfony,klandaika/symfony,nicolas-grekas/symfony,Triiistan/symfony,aschempp/symfony,tronsha/symfony,unkind/symfony,pix-art/symfony,alcohol/symfony,jpauli/symfony,WouterJ/symfony,pamil/symfony,snoek09/symfony,cvuorinen/symfony,jamyouss/symfony,smatyas/symfony,zhaoyan158567/symfony,lrlopez/symfony,ChMat/symfony,danionut90/symfony,pyrech-forks/symfony,maiksuaco/symfony,mnapoli/symfony,lemoinem/symfony,rodnaph/symfony,moycarretero/behat,imphil/symfony,Simperfit/symfony,splio-aleroux/symfony,Mak-Di/symfony,mpdude/symfony,localheinz/symfony,romainneutron/symfony,superdav42/symfony,gadelkareem/symfony,tangkepeng/symfony,jaytaph/symfony,vincentaubert/symfony,weaverryan/symfony,skler/symfony,NiR-/symfony,totophe/symfony,analogic/symfony,believer-ufa/symfony,kbond/symfony,romaricdrigon/symfony,stof/symfony,Simperfit/symfony,romainneutron/symfony,SofHad/symfony,pierredup/symfony,hiddewie/symfony,jelte/symfony,phramz/symfony,Engerim/symfony,tronsha/symfony,druid628/symfony,thunderer/symfony,vlajos/symfony,douglaslinsmeyer/symfony,zhaoyan158567/symfony,bfolliot/symfony,vlajos/symfony,jjanvier/symfony,Strate/symfony,webmozart/symfony,dzuelke/symfony,owyowoo/symfony,gepo/symfony,docteurklein/symfony,raziel057/symfony,kitsunet/symfony,SpacePossum/symfony,calm10/Symfony2,kitsunet/symfony,jeremyFreeAgent/symfony,fussl/symfony,nykopol/symfony,fduch/symfony,gnat42/symfony,hacfi/symfony,georaldc/symfony,VaShu/symfony,rmed19/symfony,natechicago/symfony,ygerasimov/symfony,mmauri04/symfony,peterjmit/symfony,jenalgit/symfony,linovarona/symfony,ro0NL/symfony,Engerim/symfony,analogic/symfony,hason/symfony,Seanmcn/symfony,Einenlum/symfony,zorn-v/symfony,nakashu/symfony,sof1105/symfony,andreia/symfony,natechicago/symfony,tecnocat/symfony,ivanovnickolay/symfony,apfelbox/symfony,mhujer/symfony,tekjava/symfony,jean-gui/symfony,beealone/symfony,hacfi/symfony,origaminal/symfony,andrerom/symfony,moycarretero/behat,bryanagee/symfony,patrick-mcdougle/symfony,raziel057/symfony,zerkms/symfony,Soullivaneuh/symfony,maidmaid/symfony,jjanvier/symfony,alcohol/symfony,jameshalsall/symfony,neemzy/symfony,bocharsky-bw/symfony,docteurklein/symfony,jderusse/symfony,hiddewie/symfony,gimler/symfony,keradus/symfony,d-ph/symfony,codeclimate-testing/symfony,craue/symfony,zerkms/symfony,Slamdunk/symfony,issei-m/symfony,romaricdrigon/symfony,pyrech/symfony,nasimnabavi/symfony,arduanov/symfony,digitalkaoz/symfony,johnarevalo/symfony,AlexDpy/symfony,adamelso/symfony,BeastModeON/symfony,deguif/symfony,MatTheCat/symfony,OndraM/symfony,hichammoad/symfony,frankdejonge/symfony,Taluu/symfony,lyrixx/symfony,dosten/symfony,garak/symfony,MatTheCat/symfony,1ed/symfony,ogizanagi/symfony,GuilhemN/symfony,FlorianLB/symfony,analogic/symfony,gadelkareem/symfony,jjanvier/symfony,francisbesset/symfony,superdav42/symfony,sstok/symfony,bburnichon/symfony,imphil/symfony,DavidGarciaCat/symfony,xavierleune/symfony,johnarevalo/symfony,fussl/symfony,alekitto/symfony,shakaran/symfony,MAXakaWIZARD/symfony,ragboyjr/symfony,tucksaun/symfony,mhujer/symfony,calm10/Symfony2,Edouard-chin/symfony,apetitpa/symfony,aitboudad/symfony,arduanov/symfony,mmauri04/symfony,sustmi/symfony,webmozart/symfony,Aliance/symfony,razmo/symfony,johnarevalo/symfony,dosten/symfony,realityking/symfony,Amo/symfony,shakaran/symfony,zcodes/symfony,razmo/symfony,arjenm/symfony,sof1105/symfony,docteurklein/symfony,d-ph/symfony,GerbenWijnja/symfony,lepiaf/symfony,inso/symfony,alebo/symfony,mhujer/symfony,webmozart/symfony,datagit/symfony,geoffrey-brier/symfony,calm10/Symfony2,mihai-stancu/symfony,Soullivaneuh/symfony,curry684/symfony,michaelperrin/symfony,arduanov/symfony,romaricdrigon/symfony,sergeyfedotov/symfony,aitboudad/symfony,bfolliot/symfony,Edouard-chin/symfony,jakzal/symfony,mimaidms/symfony,ivanovnickolay/symfony,cvuorinen/symfony,bfolliot/symfony,zcodes/symfony,jelte/symfony,zhaoyan158567/symfony,josephdpurcell/symfony,localheinz/symfony,dzuelke/symfony,hhamon/symfony,BeastModeON/symfony,Richard87/symfony,Ocramius/symfony,fussl/symfony,fduch/symfony,mathroc/symfony,sgehrig/symfony,hichammoad/symfony,ksom/symfony,bburnichon/symfony,vith/symfony,fabpot/symfony,davewwww/symfony,rquadling/symfony,origaminal/symfony,k0pernikus/symfony,maiksuaco/symfony,SofHad/symfony,gepo/symfony,mimaidms/symfony,curry684/symfony,danielbber/symfony,Koc/symfony,raziel057/symfony,zhaoyan158567/symfony,johnarevalo/symfony,danielbber/symfony,BeastModeON/symfony,shieldo/symfony,bryanagee/symfony,pyrech-forks/symfony,gencer/symfony,jpauli/symfony,k0pernikus/symfony,yethee/symfony,totophe/symfony,DavidGarciaCat/symfony,druid628/symfony,klandaika/symfony,hason/symfony,backbone87/symfony,xabbuh/symfony,kitsunet/symfony,GerbenWijnja/symfony,issei-m/symfony,stof/symfony,linovarona/symfony,klandaika/symfony,howtolearntocode/symfony,mweimerskirch/symfony,sroze/symfony,josephdpurcell/symfony,Pierstoval/symfony,pix-art/symfony,patrick-mcdougle/symfony,adamelso/symfony,dunglas/symfony,yethee/symfony,arduanov/symfony,michaelperrin/symfony,aschempp/symfony,yceruto/symfony,paradajozsef/symfony,tPl0ch/symfony,spreston/symfony,jamyouss/symfony,Naktibalda/symfony,jean-gui/symfony,Richard87/symfony,okdana/symfony,jakzal/symfony,c960657/symfony,ChMat/symfony,javiereguiluz/symfony,Einenlum/symfony,douglaslinsmeyer/symfony,mnapoli/symfony,glensc/symfony,mmauri04/symfony,jakubsacha/symfony,frankdejonge/symfony,Tobion/symfony,raziel057/symfony,tangkepeng/symfony,arjenm/symfony,raziel057/symfony,totophe/symfony,zilionis/symfony,yceruto/symfony,Nicofuma/symfony,believer-ufa/symfony,pierredup/symfony,tronsha/symfony,javiereguiluz/symfony,Slamdunk/symfony,calm10/Symfony2,xavierleune/symfony,druid628/symfony,mmauri04/symfony,jzawadzki/symfony,jpauli/symfony,bendavies/symfony,fesor/symfony,yinhe007/symfony,romainneutron/symfony,hacfi/symfony,gharlan/symfony,vincentaubert/symfony,Socratemus/symfony,jelte/symfony,xijia37/symfony,alekitto/symfony,peterrehm/symfony,rpg600/symfony,Faisalawanisee/symfony,spreston/symfony,damienalexandre/symfony,kix/symfony,johnarevalo/symfony,mpdude/symfony,lcp0578/symfony,zilionis/symfony,Wasserschlange/symfony,mickaelandrieu/symfony,gepo/symfony,unexge/symfony,pamil/symfony,BeastModeON/symfony,chrisbel/formationgit,adamelso/symfony,tgalopin/symfony,mihai-stancu/symfony,Restless-ET/symfony,ctrl-f5/symfony,symfony/symfony,romaricdrigon/symfony,jean-gui/symfony,sustmi/symfony,sof1105/symfony,Ocramius/symfony,HeahDude/symfony,lstrojny/symfony,zerustech/symfony,jaytaph/symfony,nicolas-grekas/symfony,nVitius/symfony,tekjava/symfony,jenalgit/symfony,DavidGarciaCat/symfony,localheinz/symfony,Faisalawanisee/symfony,Pierstoval/symfony,georaldc/symfony,yinhe007/symfony,michaelperrin/symfony,Amo/symfony,MAXakaWIZARD/symfony,romainneutron/symfony,cvuorinen/symfony,peterjmit/symfony,aschempp/symfony,ygerasimov/symfony,Mak-Di/symfony,gnat42/symfony,apfelbox/symfony,0x73/symfony,mweimerskirch/symfony,gepo/symfony,superdav42/symfony,fabpot/symfony,GuilhemN/symfony,tekjava/symfony,snoek09/symfony,symfony/symfony,gcds/symfony,fesor/symfony,mpdude/symfony,tucksaun/symfony,keradus/symfony,dbu/symfony,apfelbox/symfony,ahsio/symfony,javiereguiluz/symfony,thunderer/symfony,dawehner/symfony,jakubsacha/symfony,yinhe007/symfony,deciament/symfony,aschempp/symfony,Taluu/symfony,zilionis/symfony,Mak-Di/symfony,andrerom/symfony,xphere-forks/symfony,bfolliot/symfony,druid628/symfony,fussl/symfony,backbone87/symfony,ewgRa/symfony,MisatoTremor/symfony,arno14/symfony,skler/symfony,gcds/symfony,e-moe/symfony,rodnaph/symfony,snoek09/symfony,rquadling/symfony,mihai-stancu/symfony,teohhanhui/symfony,craue/symfony,yethee/symfony,ogizanagi/symfony,rpg600/symfony,deciament/symfony,gonzalovilaseca/symfony,Seanmcn/symfony,ewgRa/symfony,sstok/symfony,mickaelandrieu/symfony,Koc/symfony,zorn-v/symfony,wilderguzman/symfony,javiereguiluz/symfony,believer-ufa/symfony,paradajozsef/symfony,VaShu/symfony,lyrixx/symfony,havvg/symfony,bryanagee/symfony,lrlopez/symfony,moycarretero/behat,datagit/symfony,maidmaid/symfony,craue/symfony,unkind/symfony,gharlan/symfony,snoek09/symfony,1ed/symfony,patrick-mcdougle/symfony,francisbesset/symfony,owyowoo/symfony,analogic/symfony,inso/symfony,Ener-Getick/symfony,chalasr/symfony,EVODelavega/symfony,zerustech/symfony,bburnichon/symfony,wilderguzman/symfony,unexge/symfony,ianfp/symfony,ahsio/symfony,gencer/symfony,Slamdunk/symfony,xijia37/symfony,sustmi/symfony,bendavies/symfony,Ener-Getick/symfony,AlexDpy/symfony,sdiaz/symfony,douglaslinsmeyer/symfony,gadelkareem/symfony,lcp0578/symfony,mnapoli/symfony,hichammoad/symfony,hiddewie/symfony,aecca/symfony,Soullivaneuh/symfony,hason/symfony,dbu/symfony,pyrech-forks/symfony,zorn-v/symfony,sstok/symfony,ihsanudin/symfony,alcohol/symfony,0x73/symfony,gadelkareem/symfony,Richard87/symfony,vlajos/symfony,nicolas-grekas/symfony,sgehrig/symfony,totophe/symfony,showpad/symfony,bocharsky-bw/symfony,aecca/symfony,Taluu/symfony,csarrazi/symfony,tPl0ch/symfony,rmed19/symfony,zerkms/symfony,GuilhemN/symfony,jakubsacha/symfony,Amo/symfony | markdown | ## Code Before:
Finder Component
================
Finder finds files and directories via an intuitive fluent interface.
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$iterator = $finder
->files()
->name('*.php')
->depth(0)
->size('>= 1K')
->in(__DIR__);
foreach ($iterator as $file) {
print $file->getRealpath()."\n";
}
But you can also use it to find files stored remotely like in this example where
we are looking for files on Amazon S3:
$s3 = new \Zend_Service_Amazon_S3($key, $secret);
$s3->registerStreamWrapper("s3");
$finder = new Finder();
$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
foreach ($finder->in('s3://bucket-name') as $file) {
print $file->getFilename()."\n";
}
Resources
---------
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Finder/
$ composer.phar install
$ phpunit
## Instruction:
[Finder] Add info about possibilities offered by SplFileInfo
## Code After:
Finder Component
================
Finder finds files and directories via an intuitive fluent interface.
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$iterator = $finder
->files()
->name('*.php')
->depth(0)
->size('>= 1K')
->in(__DIR__);
foreach ($iterator as $file) {
print $file->getRealpath()."\n";
}
The resulting contents of the iterator are instances of [SplFileInfo][1]. You can
thus use all of SplFileInfo's methods (getPerms(), getSize(), etc) on them. See
[the API documentation][2] or the [web tutorial][3] for more.
But you can also use it to find files stored remotely like in this example where
we are looking for files on Amazon S3:
$s3 = new \Zend_Service_Amazon_S3($key, $secret);
$s3->registerStreamWrapper("s3");
$finder = new Finder();
$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
foreach ($finder->in('s3://bucket-name') as $file) {
print $file->getFilename()."\n";
}
Resources
---------
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Finder/
$ composer.phar install
$ phpunit
[1]: http://php.net/splfileinfo
[2]: http://api.symfony.com/2.5/Symfony/Component/Finder/SplFileInfo.html
[3]: http://symfony.com/doc/current/components/finder.html#usage
|
cfdbb26fa02c929271dda092571b69c08d184cc7 | test-support/src/main/resources/application.yml | test-support/src/main/resources/application.yml | ---
applications:
root: ../../java-test-applications
distZip:
location: ${applications.root}/dist-zip-application
prefix: dist-zip-application-
ejb:
enabled: false
location: ${applications.root}/ejb-application
prefix: ejb-application-
groovy:
location: ${applications.root}/groovy-application
prefix: groovy-application-
javaMain:
location: ${applications.root}/java-main-application
prefix: java-main-application-
ratpack:
location: ${applications.root}/ratpack-application
prefix: ratpack-application-
springBootCli:
location: ${applications.root}/spring-boot-cli-application
prefix: spring-boot-cli-application-
springBootCliJar:
location: ${applications.root}/spring-boot-cli-jar-application
prefix: spring-boot-cli-jar-application-
web:
location: ${applications.root}/web-application
prefix: web-application-
webServlet2:
location: ${applications.root}/web-servlet-2-application
prefix: web-servlet-2-application-
services:
mongodb:
name: test-mongodb
service: mlab
plan: sandbox
mysql:
name: test-mysql
service: cleardb
plan: boost
postgresql:
name: test-postgresql
service: elephantsql
plan: panda
rabbitmq:
name: test-rabbitmq
service: cloudamqp
plan: lemur
redis:
name: test-redis
service: rediscloud
plan: 30mb
| ---
applications:
root: ../../java-test-applications
distZip:
location: ${applications.root}/dist-zip-application
prefix: dist-zip-application-
ejb:
enabled: false
location: ${applications.root}/ejb-application
prefix: ejb-application-
groovy:
location: ${applications.root}/groovy-application
prefix: groovy-application-
javaMain:
location: ${applications.root}/java-main-application
prefix: java-main-application-
ratpack:
location: ${applications.root}/ratpack-application
prefix: ratpack-application-
springBootCli:
location: ${applications.root}/spring-boot-cli-application
prefix: spring-boot-cli-application-
springBootCliJar:
location: ${applications.root}/spring-boot-cli-jar-application
prefix: spring-boot-cli-jar-application-
web:
location: ${applications.root}/web-application
prefix: web-application-
webServlet2:
location: ${applications.root}/web-servlet-2-application
prefix: web-servlet-2-application-
services:
mongodb:
name: test-mongodb
service: mlab
plan: sandbox
mysql:
name: test-mysql
service: p-mysql
plan: 100mb
postgresql:
name: test-postgresql
service: elephantsql
plan: panda
rabbitmq:
name: test-rabbitmq
service: cloudamqp
plan: lemur
redis:
name: test-redis
service: rediscloud
plan: 30mb
| Allow RGB env instead of PWS | Allow RGB env instead of PWS
| YAML | apache-2.0 | cloudfoundry/java-buildpack-system-test,cloudfoundry/java-buildpack-system-test | yaml | ## Code Before:
---
applications:
root: ../../java-test-applications
distZip:
location: ${applications.root}/dist-zip-application
prefix: dist-zip-application-
ejb:
enabled: false
location: ${applications.root}/ejb-application
prefix: ejb-application-
groovy:
location: ${applications.root}/groovy-application
prefix: groovy-application-
javaMain:
location: ${applications.root}/java-main-application
prefix: java-main-application-
ratpack:
location: ${applications.root}/ratpack-application
prefix: ratpack-application-
springBootCli:
location: ${applications.root}/spring-boot-cli-application
prefix: spring-boot-cli-application-
springBootCliJar:
location: ${applications.root}/spring-boot-cli-jar-application
prefix: spring-boot-cli-jar-application-
web:
location: ${applications.root}/web-application
prefix: web-application-
webServlet2:
location: ${applications.root}/web-servlet-2-application
prefix: web-servlet-2-application-
services:
mongodb:
name: test-mongodb
service: mlab
plan: sandbox
mysql:
name: test-mysql
service: cleardb
plan: boost
postgresql:
name: test-postgresql
service: elephantsql
plan: panda
rabbitmq:
name: test-rabbitmq
service: cloudamqp
plan: lemur
redis:
name: test-redis
service: rediscloud
plan: 30mb
## Instruction:
Allow RGB env instead of PWS
## Code After:
---
applications:
root: ../../java-test-applications
distZip:
location: ${applications.root}/dist-zip-application
prefix: dist-zip-application-
ejb:
enabled: false
location: ${applications.root}/ejb-application
prefix: ejb-application-
groovy:
location: ${applications.root}/groovy-application
prefix: groovy-application-
javaMain:
location: ${applications.root}/java-main-application
prefix: java-main-application-
ratpack:
location: ${applications.root}/ratpack-application
prefix: ratpack-application-
springBootCli:
location: ${applications.root}/spring-boot-cli-application
prefix: spring-boot-cli-application-
springBootCliJar:
location: ${applications.root}/spring-boot-cli-jar-application
prefix: spring-boot-cli-jar-application-
web:
location: ${applications.root}/web-application
prefix: web-application-
webServlet2:
location: ${applications.root}/web-servlet-2-application
prefix: web-servlet-2-application-
services:
mongodb:
name: test-mongodb
service: mlab
plan: sandbox
mysql:
name: test-mysql
service: p-mysql
plan: 100mb
postgresql:
name: test-postgresql
service: elephantsql
plan: panda
rabbitmq:
name: test-rabbitmq
service: cloudamqp
plan: lemur
redis:
name: test-redis
service: rediscloud
plan: 30mb
|
81ead0a6eee05eeed05f97f0af3fb142831aae9d | resources/views/component/upload/gallery.blade.php | resources/views/component/upload/gallery.blade.php | <div id="{{ $id or 'gallery-upload' }}" class="gallery-upload {{ $class or ''}}">
<p>
<button type="button" class="btn btn-default">{{ $button or 'Upload' }}</button>
<input type="file" class="hidden" accept="image/*">
</p>
<div class="image-gallery clearfix">
@foreach ($images as $image)
<div class="image-preview" style="background-image:url({{$image->getThumbUrl()}})">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]" value="{{ $image_id or '' }}">
</div>
@endforeach
</div>
<p class="text-muted">Drag and drop to change the order of images.</p>
<template>
<div class="image-preview">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]">
</div>
</template>
</div>
| <div id="{{ $id or 'gallery-upload' }}" class="gallery-upload {{ $class or ''}}">
<p>
<button type="button" class="btn btn-default">{{ $button or 'Upload' }}</button>
<input type="file" class="hidden" accept="image/*">
</p>
<div class="image-gallery clearfix">
@if (isset($images))
@foreach ($images as $image)
<div class="image-preview" style="background-image:url({{$image->getThumbUrl()}})">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]" value="{{ $image_id or '' }}">
</div>
@endforeach
@endif
</div>
<p class="text-muted">Drag and drop to change the order of images.</p>
<template>
<div class="image-preview">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]">
</div>
</template>
</div>
| Check if $images exists in gallery upload view. | Check if $images exists in gallery upload view.
| PHP | agpl-3.0 | santakani/santakani.com,santakani/santakani,santakani/santakani.com,santakani/santakani,santakani/santakani,santakani/santakani.com,santakani/santakani | php | ## Code Before:
<div id="{{ $id or 'gallery-upload' }}" class="gallery-upload {{ $class or ''}}">
<p>
<button type="button" class="btn btn-default">{{ $button or 'Upload' }}</button>
<input type="file" class="hidden" accept="image/*">
</p>
<div class="image-gallery clearfix">
@foreach ($images as $image)
<div class="image-preview" style="background-image:url({{$image->getThumbUrl()}})">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]" value="{{ $image_id or '' }}">
</div>
@endforeach
</div>
<p class="text-muted">Drag and drop to change the order of images.</p>
<template>
<div class="image-preview">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]">
</div>
</template>
</div>
## Instruction:
Check if $images exists in gallery upload view.
## Code After:
<div id="{{ $id or 'gallery-upload' }}" class="gallery-upload {{ $class or ''}}">
<p>
<button type="button" class="btn btn-default">{{ $button or 'Upload' }}</button>
<input type="file" class="hidden" accept="image/*">
</p>
<div class="image-gallery clearfix">
@if (isset($images))
@foreach ($images as $image)
<div class="image-preview" style="background-image:url({{$image->getThumbUrl()}})">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]" value="{{ $image_id or '' }}">
</div>
@endforeach
@endif
</div>
<p class="text-muted">Drag and drop to change the order of images.</p>
<template>
<div class="image-preview">
<span><i class="fa fa-times"></i></span>
<input type="hidden" name="{{ $name or 'images' }}[]">
</div>
</template>
</div>
|
dfee963c6198de4e05374eb04f91548b5c848965 | src/components/categoryForm/categoryForm.component.ts | src/components/categoryForm/categoryForm.component.ts | import { Component, ViewEncapsulation } from '@angular/core';
@Component({
templateUrl: './categoryForm.component.html',
styleUrls: ['./categoryForm.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CategoryFormComponent {
subjects: { value: string, viewValue: string }[] = [
{value: 'language', viewValue: 'Українська мова'},
{value: 'literature', viewValue: 'Українська література'}
];
subject: string;
category: string;
onSubmit() {
}
} | import { Component, ViewEncapsulation } from '@angular/core';
@Component({
templateUrl: './categoryForm.component.html',
styleUrls: ['./categoryForm.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CategoryFormComponent {
subjects: { value: string, viewValue: string }[] = [
{value: 'language', viewValue: 'Українська мова'},
{value: 'literature', viewValue: 'Українська література'}
];
subject: string;
category: string;
onSubmit(): {} {
if (this.subject != undefined) {
return {
subject: this.subject,
category: this.category
};
}
return {
subject: this.category
};
}
} | Create object with form data | Create object with form data
| TypeScript | mit | ivanna-ostrovets/language-and-literature-admin,ivanna-ostrovets/language-and-literature-admin,ivanna-ostrovets/language-and-literature-admin | typescript | ## Code Before:
import { Component, ViewEncapsulation } from '@angular/core';
@Component({
templateUrl: './categoryForm.component.html',
styleUrls: ['./categoryForm.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CategoryFormComponent {
subjects: { value: string, viewValue: string }[] = [
{value: 'language', viewValue: 'Українська мова'},
{value: 'literature', viewValue: 'Українська література'}
];
subject: string;
category: string;
onSubmit() {
}
}
## Instruction:
Create object with form data
## Code After:
import { Component, ViewEncapsulation } from '@angular/core';
@Component({
templateUrl: './categoryForm.component.html',
styleUrls: ['./categoryForm.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CategoryFormComponent {
subjects: { value: string, viewValue: string }[] = [
{value: 'language', viewValue: 'Українська мова'},
{value: 'literature', viewValue: 'Українська література'}
];
subject: string;
category: string;
onSubmit(): {} {
if (this.subject != undefined) {
return {
subject: this.subject,
category: this.category
};
}
return {
subject: this.category
};
}
} |
019c016596adc96adee0078f781c8d2af729ff5a | src/js/jstrans.js | src/js/jstrans.js | var jstrans = function (path) {
if (selector = document.querySelector('input[name=\"jstrans-value-for-' + path + '\"]')) {
return selector.value;
} else {
var json = JSON.parse('%s');
var keys = path.split('.');
var value = json;
for (var i in keys) {
var key = keys[i];
if (typeof value[key] === 'undefined') {
return path;
}
value = value[key];
}
return value;
}
} | var jstrans = function (path) {
if (typeof path === 'undefined') {
return null;
}
if (selector = document.querySelector('input[name=\"jstrans-value-for-' + path + '\"]')) {
return selector.value;
} else {
var json = JSON.parse('%s');
var keys = path.split('.');
var value = json;
for (var i in keys) {
var key = keys[i];
if (typeof value[key] === 'undefined') {
return path;
}
value = value[key];
}
return value;
}
} | Return null if path is not specified | Return null if path is not specified
| JavaScript | mit | misterpaladin/jstrans,misterpaladin/jstrans | javascript | ## Code Before:
var jstrans = function (path) {
if (selector = document.querySelector('input[name=\"jstrans-value-for-' + path + '\"]')) {
return selector.value;
} else {
var json = JSON.parse('%s');
var keys = path.split('.');
var value = json;
for (var i in keys) {
var key = keys[i];
if (typeof value[key] === 'undefined') {
return path;
}
value = value[key];
}
return value;
}
}
## Instruction:
Return null if path is not specified
## Code After:
var jstrans = function (path) {
if (typeof path === 'undefined') {
return null;
}
if (selector = document.querySelector('input[name=\"jstrans-value-for-' + path + '\"]')) {
return selector.value;
} else {
var json = JSON.parse('%s');
var keys = path.split('.');
var value = json;
for (var i in keys) {
var key = keys[i];
if (typeof value[key] === 'undefined') {
return path;
}
value = value[key];
}
return value;
}
} |
47c7333adc439d5a341aee0fe75f38248ee76341 | .travis.yml | .travis.yml | before_install:
- export LANG=en_US.UTF-8
- brew update
- brew upgrade xctool
script: ./build_script.sh
| language: objective-c
before_install:
- export LANG=en_US.UTF-8
- brew update
- brew upgrade xctool
script: ./build_script.sh
| Set to use Objective-C in Travis build file | Set to use Objective-C in Travis build file
| YAML | mit | rhodgkins/xctoolSubProjectTest | yaml | ## Code Before:
before_install:
- export LANG=en_US.UTF-8
- brew update
- brew upgrade xctool
script: ./build_script.sh
## Instruction:
Set to use Objective-C in Travis build file
## Code After:
language: objective-c
before_install:
- export LANG=en_US.UTF-8
- brew update
- brew upgrade xctool
script: ./build_script.sh
|
093c04f7b2e3b48b93590eda1e8560b6aaebe93c | .travis.yml | .travis.yml | sudo: required
dist: trusty
addons:
chrome: stable
language: node_js
node_js:
- 'lts/*'
install:
- npm i npm@6.1.0
- npm ci
script:
- npm run lint:eslint
- npm run lint:stylelint
- npm run build
# - npm run test
# before_script:
# - "sudo chown root /opt/google/chrome/chrome-sandbox"
# - "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
# - "export DISPLAY=:99.0"
# - "sh -e /etc/init.d/xvfb start"
# - sleep 3 # give xvfb some time to start
| dist: trusty
language: node_js
node_js:
- 'lts/*'
install:
- npm i -g npm@6.1.0
- npm ci
script:
- npm run lint:eslint
- npm run lint:stylelint
- npm run build
| Delete commented lines, enable global npm update | Delete commented lines, enable global npm update
| YAML | apache-2.0 | GoogleChromeLabs/sample-pie-shop,GoogleChromeLabs/sample-pie-shop | yaml | ## Code Before:
sudo: required
dist: trusty
addons:
chrome: stable
language: node_js
node_js:
- 'lts/*'
install:
- npm i npm@6.1.0
- npm ci
script:
- npm run lint:eslint
- npm run lint:stylelint
- npm run build
# - npm run test
# before_script:
# - "sudo chown root /opt/google/chrome/chrome-sandbox"
# - "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
# - "export DISPLAY=:99.0"
# - "sh -e /etc/init.d/xvfb start"
# - sleep 3 # give xvfb some time to start
## Instruction:
Delete commented lines, enable global npm update
## Code After:
dist: trusty
language: node_js
node_js:
- 'lts/*'
install:
- npm i -g npm@6.1.0
- npm ci
script:
- npm run lint:eslint
- npm run lint:stylelint
- npm run build
|
2a3bdd786c11fbf3fca9784f47feae5b179ac824 | CHANGELOG.md | CHANGELOG.md |
- Switch from icon font to using SVG icons
## v0.8.0
- Load Octicons from NPM instead of Bower
## v0.7.1
- Fixes the blueprint addition of `octicons` to the installing project's `bower.json` (reported by @herzzanu)
## v0.7.0
- Renamed `ember-cli-octicons` to `ember-octicons`
## v0.6.0
- Updated Octicons to 4.3.0
## v0.5.0
- Updated Octicons to 4.2.0
## v0.4.0
- Updated Octicons to 4.1.0
## v0.3.0
- Updated Octicons to 3.5.0
|
- Switch from icon font to using SVG icons
- Update Octicons to ^7.2.0
## v0.8.0
- Load Octicons from NPM instead of Bower
## v0.7.1
- Fixes the blueprint addition of `octicons` to the installing project's `bower.json` (reported by @herzzanu)
## v0.7.0
- Renamed `ember-cli-octicons` to `ember-octicons`
## v0.6.0
- Update Octicons to 4.3.0
## v0.5.0
- Update Octicons to 4.2.0
## v0.4.0
- Update Octicons to 4.1.0
## v0.3.0
- Update Octicons to 3.5.0
| Include Octicons version update in Changelog | Include Octicons version update in Changelog
| Markdown | mit | kpfefferle/ember-cli-octicons,kpfefferle/ember-cli-octicons,kpfefferle/ember-octicons,kpfefferle/ember-octicons | markdown | ## Code Before:
- Switch from icon font to using SVG icons
## v0.8.0
- Load Octicons from NPM instead of Bower
## v0.7.1
- Fixes the blueprint addition of `octicons` to the installing project's `bower.json` (reported by @herzzanu)
## v0.7.0
- Renamed `ember-cli-octicons` to `ember-octicons`
## v0.6.0
- Updated Octicons to 4.3.0
## v0.5.0
- Updated Octicons to 4.2.0
## v0.4.0
- Updated Octicons to 4.1.0
## v0.3.0
- Updated Octicons to 3.5.0
## Instruction:
Include Octicons version update in Changelog
## Code After:
- Switch from icon font to using SVG icons
- Update Octicons to ^7.2.0
## v0.8.0
- Load Octicons from NPM instead of Bower
## v0.7.1
- Fixes the blueprint addition of `octicons` to the installing project's `bower.json` (reported by @herzzanu)
## v0.7.0
- Renamed `ember-cli-octicons` to `ember-octicons`
## v0.6.0
- Update Octicons to 4.3.0
## v0.5.0
- Update Octicons to 4.2.0
## v0.4.0
- Update Octicons to 4.1.0
## v0.3.0
- Update Octicons to 3.5.0
|
719fd8cdc8ae9be63c99407fe6f3aac056220cb8 | taiga/users/fixtures/initial_user.json | taiga/users/fixtures/initial_user.json | [
{
"pk": 1,
"model": "users.user",
"fields": {
"username": "admin",
"full_name": "",
"bio": "",
"default_language": "",
"color": "",
"photo": "",
"is_active": true,
"colorize_tags": false,
"default_timezone": "",
"is_superuser": true,
"token": "",
"github_id": null,
"last_login": "2013-04-04T07:36:09.880Z",
"password": "pbkdf2_sha256$10000$oRIbCKOL1U3w$/gaYMnOlc/GnN4mn3UUXvXpk2Hx0vvht6Uqhu46aikI=",
"email": "niwi@niwi.be",
"date_joined": "2013-04-01T13:48:21.711Z"
}
}
]
| [
{
"pk": 1,
"model": "users.user",
"fields": {
"username": "admin",
"full_name": "",
"bio": "",
"default_language": "",
"color": "",
"photo": "",
"is_active": true,
"colorize_tags": false,
"default_timezone": "",
"is_superuser": true,
"token": "",
"github_id": null,
"last_login": "2013-04-04T07:36:09.880Z",
"password": "pbkdf2_sha256$10000$oRIbCKOL1U3w$/gaYMnOlc/GnN4mn3UUXvXpk2Hx0vvht6Uqhu46aikI=",
"email": "admin@admin.com",
"date_joined": "2013-04-01T13:48:21.711Z"
}
}
]
| Change the email of admin | Change the email of admin
| JSON | agpl-3.0 | Tigerwhit4/taiga-back,crr0004/taiga-back,coopsource/taiga-back,forging2012/taiga-back,Tigerwhit4/taiga-back,jeffdwyatt/taiga-back,Rademade/taiga-back,astagi/taiga-back,bdang2012/taiga-back-casting,seanchen/taiga-back,taigaio/taiga-back,taigaio/taiga-back,astagi/taiga-back,obimod/taiga-back,19kestier/taiga-back,joshisa/taiga-back,Rademade/taiga-back,CoolCloud/taiga-back,joshisa/taiga-back,jeffdwyatt/taiga-back,joshisa/taiga-back,seanchen/taiga-back,Rademade/taiga-back,forging2012/taiga-back,gam-phon/taiga-back,dayatz/taiga-back,jeffdwyatt/taiga-back,astronaut1712/taiga-back,forging2012/taiga-back,19kestier/taiga-back,EvgeneOskin/taiga-back,CoolCloud/taiga-back,Zaneh-/bearded-tribble-back,seanchen/taiga-back,dycodedev/taiga-back,Tigerwhit4/taiga-back,EvgeneOskin/taiga-back,gauravjns/taiga-back,gam-phon/taiga-back,rajiteh/taiga-back,CoolCloud/taiga-back,crr0004/taiga-back,bdang2012/taiga-back-casting,gauravjns/taiga-back,astagi/taiga-back,astronaut1712/taiga-back,coopsource/taiga-back,dycodedev/taiga-back,astagi/taiga-back,Zaneh-/bearded-tribble-back,seanchen/taiga-back,WALR/taiga-back,forging2012/taiga-back,astronaut1712/taiga-back,gam-phon/taiga-back,CMLL/taiga-back,CMLL/taiga-back,astronaut1712/taiga-back,obimod/taiga-back,Zaneh-/bearded-tribble-back,rajiteh/taiga-back,WALR/taiga-back,coopsource/taiga-back,coopsource/taiga-back,CMLL/taiga-back,CMLL/taiga-back,crr0004/taiga-back,dycodedev/taiga-back,dayatz/taiga-back,Rademade/taiga-back,EvgeneOskin/taiga-back,bdang2012/taiga-back-casting,crr0004/taiga-back,bdang2012/taiga-back-casting,WALR/taiga-back,xdevelsistemas/taiga-back-community,frt-arch/taiga-back,joshisa/taiga-back,rajiteh/taiga-back,19kestier/taiga-back,Tigerwhit4/taiga-back,frt-arch/taiga-back,Rademade/taiga-back,gam-phon/taiga-back,dayatz/taiga-back,EvgeneOskin/taiga-back,taigaio/taiga-back,obimod/taiga-back,rajiteh/taiga-back,jeffdwyatt/taiga-back,frt-arch/taiga-back,obimod/taiga-back,CoolCloud/taiga-back,xdevelsistemas/taiga-back-community,gauravjns/taiga-back,xdevelsistemas/taiga-back-community,WALR/taiga-back,gauravjns/taiga-back,dycodedev/taiga-back | json | ## Code Before:
[
{
"pk": 1,
"model": "users.user",
"fields": {
"username": "admin",
"full_name": "",
"bio": "",
"default_language": "",
"color": "",
"photo": "",
"is_active": true,
"colorize_tags": false,
"default_timezone": "",
"is_superuser": true,
"token": "",
"github_id": null,
"last_login": "2013-04-04T07:36:09.880Z",
"password": "pbkdf2_sha256$10000$oRIbCKOL1U3w$/gaYMnOlc/GnN4mn3UUXvXpk2Hx0vvht6Uqhu46aikI=",
"email": "niwi@niwi.be",
"date_joined": "2013-04-01T13:48:21.711Z"
}
}
]
## Instruction:
Change the email of admin
## Code After:
[
{
"pk": 1,
"model": "users.user",
"fields": {
"username": "admin",
"full_name": "",
"bio": "",
"default_language": "",
"color": "",
"photo": "",
"is_active": true,
"colorize_tags": false,
"default_timezone": "",
"is_superuser": true,
"token": "",
"github_id": null,
"last_login": "2013-04-04T07:36:09.880Z",
"password": "pbkdf2_sha256$10000$oRIbCKOL1U3w$/gaYMnOlc/GnN4mn3UUXvXpk2Hx0vvht6Uqhu46aikI=",
"email": "admin@admin.com",
"date_joined": "2013-04-01T13:48:21.711Z"
}
}
]
|
64d4bcf0862e2715dc0de92a0621adf23dff5818 | source/harmony/schema/collector.py | source/harmony/schema/collector.py |
from abc import ABCMeta, abstractmethod
class Collector(object):
'''Collect and return schemas.'''
__metaclass__ = ABCMeta
@abstractmethod
def collect(self):
'''Yield collected schemas.
Each schema should be a Python dictionary.
'''
|
import os
from abc import ABCMeta, abstractmethod
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
raise ImportError('Could not import json or simplejson')
class Collector(object):
'''Collect and return schemas.'''
__metaclass__ = ABCMeta
@abstractmethod
def collect(self):
'''Yield collected schemas.
Each schema should be a Python dictionary.
'''
class FilesystemCollector(Collector):
def __init__(self, paths=None, recursive=True):
'''Initialise with *paths* to search.
If *recursive* is True then all subdirectories of *paths* will also be
searched.
'''
self.paths = paths
self.recursive = recursive
if self.paths is None:
self.paths = []
super(FilesystemCollector, self).__init__()
def collect(self):
'''Yield collected schemas.'''
for path in self.paths:
for base, directories, filenames in os.walk(path):
for filename in filenames:
_, extension = os.path.splitext(filename)
if extension != '.json':
continue
filepath = os.path.join(base, filename)
with open(filepath, 'r') as file_handler:
schema = json.load(file_handler)
yield schema
if not self.recursive:
del directories[:]
| Support collecting schemas from filesystem. | Support collecting schemas from filesystem.
| Python | apache-2.0 | 4degrees/harmony | python | ## Code Before:
from abc import ABCMeta, abstractmethod
class Collector(object):
'''Collect and return schemas.'''
__metaclass__ = ABCMeta
@abstractmethod
def collect(self):
'''Yield collected schemas.
Each schema should be a Python dictionary.
'''
## Instruction:
Support collecting schemas from filesystem.
## Code After:
import os
from abc import ABCMeta, abstractmethod
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
raise ImportError('Could not import json or simplejson')
class Collector(object):
'''Collect and return schemas.'''
__metaclass__ = ABCMeta
@abstractmethod
def collect(self):
'''Yield collected schemas.
Each schema should be a Python dictionary.
'''
class FilesystemCollector(Collector):
def __init__(self, paths=None, recursive=True):
'''Initialise with *paths* to search.
If *recursive* is True then all subdirectories of *paths* will also be
searched.
'''
self.paths = paths
self.recursive = recursive
if self.paths is None:
self.paths = []
super(FilesystemCollector, self).__init__()
def collect(self):
'''Yield collected schemas.'''
for path in self.paths:
for base, directories, filenames in os.walk(path):
for filename in filenames:
_, extension = os.path.splitext(filename)
if extension != '.json':
continue
filepath = os.path.join(base, filename)
with open(filepath, 'r') as file_handler:
schema = json.load(file_handler)
yield schema
if not self.recursive:
del directories[:]
|
319fa749b4ba5264e7a9ee6bd0266c552c5f1650 | demo/analytics-pipeline/spark/service.spark.yaml | demo/analytics-pipeline/spark/service.spark.yaml | name: spark
components:
- name: zookeeper
service: zookeeper
- name: spark
code:
type: aptomi/code/kubernetes-helm
metadata:
chartName: spark-1.0.0
params:
spark:
image:
repository: mirantisworkloads/spark
tag: 2.1.0
master:
replicas: 1
worker:
replicas: 1
service:
type: NodePort
zookeeper:
deployChart: false
externalAddress: zk-{{ .Components.zookeeper.zookeeper }}-0.zk-{{ .Components.zookeeper.zookeeper }}:2181
dependencies:
- zookeeper
| name: spark
components:
- name: zookeeper
service: zookeeper
- name: spark
code:
type: aptomi/code/kubernetes-helm
metadata:
chartName: spark-1.0.0
params:
spark:
image:
repository: mirantisworkloads/spark
tag: 2.1.0
master:
replicas: 1
worker:
replicas: 1
service:
type: NodePort
zookeeper:
deployChart: false
externalAddress: zk-{{ .Components.zookeeper.zookeeper }}-0.zk-{{ .Components.zookeeper.zookeeper }}:2181
path: /{{ .ComponentInstance }}
dependencies:
- zookeeper
| Fix multiple Sparks using single ZooKeeper | Fix multiple Sparks using single ZooKeeper
| YAML | apache-2.0 | Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi | yaml | ## Code Before:
name: spark
components:
- name: zookeeper
service: zookeeper
- name: spark
code:
type: aptomi/code/kubernetes-helm
metadata:
chartName: spark-1.0.0
params:
spark:
image:
repository: mirantisworkloads/spark
tag: 2.1.0
master:
replicas: 1
worker:
replicas: 1
service:
type: NodePort
zookeeper:
deployChart: false
externalAddress: zk-{{ .Components.zookeeper.zookeeper }}-0.zk-{{ .Components.zookeeper.zookeeper }}:2181
dependencies:
- zookeeper
## Instruction:
Fix multiple Sparks using single ZooKeeper
## Code After:
name: spark
components:
- name: zookeeper
service: zookeeper
- name: spark
code:
type: aptomi/code/kubernetes-helm
metadata:
chartName: spark-1.0.0
params:
spark:
image:
repository: mirantisworkloads/spark
tag: 2.1.0
master:
replicas: 1
worker:
replicas: 1
service:
type: NodePort
zookeeper:
deployChart: false
externalAddress: zk-{{ .Components.zookeeper.zookeeper }}-0.zk-{{ .Components.zookeeper.zookeeper }}:2181
path: /{{ .ComponentInstance }}
dependencies:
- zookeeper
|
49c7b683a8dfe1b570ff8767d8eb18f8014d22d6 | .travis.yml | .travis.yml | language: python
sudo: required
dist: xenial
python:
- "2.7"
- "3.6"
- "3.7"
env:
- DJANGO_VERSION=1.8
- DJANGO_VERSION=1.10
- DJANGO_VERSION=1.11
- DJANGO_VERSION=2.0
- DJANGO_VERSION=2.1
- DJANGO_VERSION=2.2
before_install:
- curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
- source "$HOME/.poetry/env"
matrix:
exclude:
- python: "2.7"
env: DJANGO_VERSION=2.0
- python: "2.7"
env: DJANGO_VERSION=2.1
- python: "2.7"
env: DJANGO_VERSION=2.2
- python: "3.7"
env: DJANGO_VERSION=1.11
install:
- poetry install
- pip install -U Django~=$DJANGO_VERSION
script:
- flake8
- python runtests.py
| language: python
sudo: required
dist: xenial
python:
- "2.7"
- "3.6"
- "3.7"
env:
- DJANGO_VERSION=1.8
- DJANGO_VERSION=1.10
- DJANGO_VERSION=1.11
- DJANGO_VERSION=2.0
- DJANGO_VERSION=2.1
- DJANGO_VERSION=2.2
before_install:
- curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
- source "$HOME/.poetry/env"
matrix:
exclude:
- python: "2.7"
env: DJANGO_VERSION=2.0
- python: "2.7"
env: DJANGO_VERSION=2.1
- python: "2.7"
env: DJANGO_VERSION=2.2
- python: "3.7"
env: DJANGO_VERSION=1.11
install:
- poetry install
- pip install -U Django~=$DJANGO_VERSION
script:
- poetry run flake8
- poetry run runtests.py
| Change to use poetry to run tests | Change to use poetry to run tests
| YAML | mit | catcombo/django-speedinfo,catcombo/django-speedinfo,catcombo/django-speedinfo | yaml | ## Code Before:
language: python
sudo: required
dist: xenial
python:
- "2.7"
- "3.6"
- "3.7"
env:
- DJANGO_VERSION=1.8
- DJANGO_VERSION=1.10
- DJANGO_VERSION=1.11
- DJANGO_VERSION=2.0
- DJANGO_VERSION=2.1
- DJANGO_VERSION=2.2
before_install:
- curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
- source "$HOME/.poetry/env"
matrix:
exclude:
- python: "2.7"
env: DJANGO_VERSION=2.0
- python: "2.7"
env: DJANGO_VERSION=2.1
- python: "2.7"
env: DJANGO_VERSION=2.2
- python: "3.7"
env: DJANGO_VERSION=1.11
install:
- poetry install
- pip install -U Django~=$DJANGO_VERSION
script:
- flake8
- python runtests.py
## Instruction:
Change to use poetry to run tests
## Code After:
language: python
sudo: required
dist: xenial
python:
- "2.7"
- "3.6"
- "3.7"
env:
- DJANGO_VERSION=1.8
- DJANGO_VERSION=1.10
- DJANGO_VERSION=1.11
- DJANGO_VERSION=2.0
- DJANGO_VERSION=2.1
- DJANGO_VERSION=2.2
before_install:
- curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
- source "$HOME/.poetry/env"
matrix:
exclude:
- python: "2.7"
env: DJANGO_VERSION=2.0
- python: "2.7"
env: DJANGO_VERSION=2.1
- python: "2.7"
env: DJANGO_VERSION=2.2
- python: "3.7"
env: DJANGO_VERSION=1.11
install:
- poetry install
- pip install -U Django~=$DJANGO_VERSION
script:
- poetry run flake8
- poetry run runtests.py
|
a4e34a3d4493a0c853efa4123f3cdca4c9b6d690 | test/riak_moss_wm_key_test.erl | test/riak_moss_wm_key_test.erl | %% -------------------------------------------------------------------
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% -------------------------------------------------------------------
-module(riak_moss_wm_key_test).
-export([key_test_/0]).
-include("riak_moss.hrl").
-include_lib("webmachine/include/webmachine.hrl").
-include_lib("eunit/include/eunit.hrl").
key_test_() ->
{setup,
fun riak_moss_wm_test_utils:setup/0,
fun riak_moss_wm_test_utils:teardown/1,
[fun create_object/0]}.
create_object() ->
ok.
| %% -------------------------------------------------------------------
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% -------------------------------------------------------------------
-module(riak_moss_wm_key_test).
-export([key_test_/0]).
-include("riak_moss.hrl").
-include_lib("webmachine/include/webmachine.hrl").
-include_lib("eunit/include/eunit.hrl").
key_test_() ->
{setup,
fun riak_moss_wm_test_utils:setup/0,
fun riak_moss_wm_test_utils:teardown/1,
[fun get_object/0]}.
create_object() ->
ok.
get_object() ->
%% We use this instead of setting
%% path info the wm_reqdata because
%% riak_moss_wm_utils:ensure_doc uses
%% it.
Ctx= #key_context{bucket="keytest", key="foo"},
RD = #wm_reqdata{},
{Object, _, _} = riak_moss_wm_key:produce_body(RD, Ctx),
?assertEqual(<<>>, Object).
| Add failing key resource test | Add failing key resource test
AZ870
Test currently fails because of a bad
match on get_object.
| Erlang | apache-2.0 | laurenrother/riak_cs,dragonfax/riak_cs,sdebnath/riak_cs,laurenrother/riak_cs,GabrielNicolasAvellaneda/riak_cs,yangchengjian/riak_cs,basho/riak_cs_lfs,sdebnath/riak_cs,GabrielNicolasAvellaneda/riak_cs,yangchengjian/riak_cs,yangchengjian/riak_cs,yangchengjian/riak_cs,basho/riak_cs,dragonfax/riak_cs,laurenrother/riak_cs,basho/riak_cs_report,sdebnath/riak_cs,basho/riak_cs,GabrielNicolasAvellaneda/riak_cs,sdebnath/riak_cs,dragonfax/riak_cs,laurenrother/riak_cs,basho/riak_cs,basho/riak_cs,dragonfax/riak_cs,GabrielNicolasAvellaneda/riak_cs | erlang | ## Code Before:
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% -------------------------------------------------------------------
-module(riak_moss_wm_key_test).
-export([key_test_/0]).
-include("riak_moss.hrl").
-include_lib("webmachine/include/webmachine.hrl").
-include_lib("eunit/include/eunit.hrl").
key_test_() ->
{setup,
fun riak_moss_wm_test_utils:setup/0,
fun riak_moss_wm_test_utils:teardown/1,
[fun create_object/0]}.
create_object() ->
ok.
## Instruction:
Add failing key resource test
AZ870
Test currently fails because of a bad
match on get_object.
## Code After:
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% -------------------------------------------------------------------
-module(riak_moss_wm_key_test).
-export([key_test_/0]).
-include("riak_moss.hrl").
-include_lib("webmachine/include/webmachine.hrl").
-include_lib("eunit/include/eunit.hrl").
key_test_() ->
{setup,
fun riak_moss_wm_test_utils:setup/0,
fun riak_moss_wm_test_utils:teardown/1,
[fun get_object/0]}.
create_object() ->
ok.
get_object() ->
%% We use this instead of setting
%% path info the wm_reqdata because
%% riak_moss_wm_utils:ensure_doc uses
%% it.
Ctx= #key_context{bucket="keytest", key="foo"},
RD = #wm_reqdata{},
{Object, _, _} = riak_moss_wm_key:produce_body(RD, Ctx),
?assertEqual(<<>>, Object).
|
7305d45c27003db740e1da07e50371e5a01b83f6 | src/app/loadout/known-values.ts | src/app/loadout/known-values.ts | import {
armor2PlugCategoryHashes,
armor2PlugCategoryHashesByName,
D2ArmorStatHashByName,
} from 'app/search/d2-known-values';
import { PlugCategoryHashes } from 'data/d2/generated-enums';
export const armorStatHashes = [
D2ArmorStatHashByName.intellect,
D2ArmorStatHashByName.discipline,
D2ArmorStatHashByName.strength,
D2ArmorStatHashByName.mobility,
D2ArmorStatHashByName.recovery,
D2ArmorStatHashByName.resilience,
];
export const slotSpecificPlugCategoryHashes = [
armor2PlugCategoryHashesByName.helmet,
armor2PlugCategoryHashesByName.gauntlets,
armor2PlugCategoryHashesByName.chest,
armor2PlugCategoryHashesByName.leg,
armor2PlugCategoryHashesByName.classitem,
];
// TODO generate this somehow so we dont need to maintain it
export const raidPlugCategoryHashes = [
PlugCategoryHashes.EnhancementsSeasonOutlaw, // last wish
PlugCategoryHashes.EnhancementsRaidGarden, // garden of salvation
PlugCategoryHashes.EnhancementsRaidDescent, // deep stone crypt
PlugCategoryHashes.EnhancementsRaidV520, // vault of glass
];
export const knownModPlugCategoryHashes = [...armor2PlugCategoryHashes, ...raidPlugCategoryHashes];
| import {
armor2PlugCategoryHashes,
armor2PlugCategoryHashesByName,
D2ArmorStatHashByName,
} from 'app/search/d2-known-values';
import raidModPlugCategoryHashes from 'data/d2/raid-mod-plug-category-hashes.json';
export const armorStatHashes = [
D2ArmorStatHashByName.intellect,
D2ArmorStatHashByName.discipline,
D2ArmorStatHashByName.strength,
D2ArmorStatHashByName.mobility,
D2ArmorStatHashByName.recovery,
D2ArmorStatHashByName.resilience,
];
export const slotSpecificPlugCategoryHashes = [
armor2PlugCategoryHashesByName.helmet,
armor2PlugCategoryHashesByName.gauntlets,
armor2PlugCategoryHashesByName.chest,
armor2PlugCategoryHashesByName.leg,
armor2PlugCategoryHashesByName.classitem,
];
export const raidPlugCategoryHashes: number[] =
Array.isArray(raidModPlugCategoryHashes) &&
raidModPlugCategoryHashes.every((pch) => typeof pch === 'number')
? raidModPlugCategoryHashes
: [];
export const knownModPlugCategoryHashes = [...armor2PlugCategoryHashes, ...raidPlugCategoryHashes];
| Use generated raid plug category hashes. | Use generated raid plug category hashes.
| TypeScript | mit | delphiactual/DIM,DestinyItemManager/DIM,DestinyItemManager/DIM,delphiactual/DIM,delphiactual/DIM,DestinyItemManager/DIM,delphiactual/DIM,DestinyItemManager/DIM | typescript | ## Code Before:
import {
armor2PlugCategoryHashes,
armor2PlugCategoryHashesByName,
D2ArmorStatHashByName,
} from 'app/search/d2-known-values';
import { PlugCategoryHashes } from 'data/d2/generated-enums';
export const armorStatHashes = [
D2ArmorStatHashByName.intellect,
D2ArmorStatHashByName.discipline,
D2ArmorStatHashByName.strength,
D2ArmorStatHashByName.mobility,
D2ArmorStatHashByName.recovery,
D2ArmorStatHashByName.resilience,
];
export const slotSpecificPlugCategoryHashes = [
armor2PlugCategoryHashesByName.helmet,
armor2PlugCategoryHashesByName.gauntlets,
armor2PlugCategoryHashesByName.chest,
armor2PlugCategoryHashesByName.leg,
armor2PlugCategoryHashesByName.classitem,
];
// TODO generate this somehow so we dont need to maintain it
export const raidPlugCategoryHashes = [
PlugCategoryHashes.EnhancementsSeasonOutlaw, // last wish
PlugCategoryHashes.EnhancementsRaidGarden, // garden of salvation
PlugCategoryHashes.EnhancementsRaidDescent, // deep stone crypt
PlugCategoryHashes.EnhancementsRaidV520, // vault of glass
];
export const knownModPlugCategoryHashes = [...armor2PlugCategoryHashes, ...raidPlugCategoryHashes];
## Instruction:
Use generated raid plug category hashes.
## Code After:
import {
armor2PlugCategoryHashes,
armor2PlugCategoryHashesByName,
D2ArmorStatHashByName,
} from 'app/search/d2-known-values';
import raidModPlugCategoryHashes from 'data/d2/raid-mod-plug-category-hashes.json';
export const armorStatHashes = [
D2ArmorStatHashByName.intellect,
D2ArmorStatHashByName.discipline,
D2ArmorStatHashByName.strength,
D2ArmorStatHashByName.mobility,
D2ArmorStatHashByName.recovery,
D2ArmorStatHashByName.resilience,
];
export const slotSpecificPlugCategoryHashes = [
armor2PlugCategoryHashesByName.helmet,
armor2PlugCategoryHashesByName.gauntlets,
armor2PlugCategoryHashesByName.chest,
armor2PlugCategoryHashesByName.leg,
armor2PlugCategoryHashesByName.classitem,
];
export const raidPlugCategoryHashes: number[] =
Array.isArray(raidModPlugCategoryHashes) &&
raidModPlugCategoryHashes.every((pch) => typeof pch === 'number')
? raidModPlugCategoryHashes
: [];
export const knownModPlugCategoryHashes = [...armor2PlugCategoryHashes, ...raidPlugCategoryHashes];
|
b4f3400fa2f6918adba977815140a3c6c14476b5 | app.json | app.json | {
"name": "Ackee",
"description": "Self-hosted, Node.js based analytics tool for those who care about privacy",
"keywords": [
"server",
"tracking",
"analytics"
],
"website": "https://ackee.electerious.com/",
"repository": "https://github.com/electerious/Ackee",
"env": {
"ACKEE_USERNAME": {
"description": "Username which will be used to log in to Ackee",
"required": true
},
"ACKEE_PASSWORD": {
"description": "Password which will be used to log in to Ackee",
"required": true
}
},
"addons": [
{
"plan": "mongolab"
}
]
} | {
"name": "Ackee",
"description": "Self-hosted, Node.js based analytics tool for those who care about privacy",
"keywords": [
"server",
"tracking",
"analytics"
],
"website": "https://ackee.electerious.com/",
"repository": "https://github.com/electerious/Ackee",
"env": {
"ACKEE_USERNAME": {
"description": "Username which will be used to log in to Ackee",
"required": true
},
"ACKEE_PASSWORD": {
"description": "Password which will be used to log in to Ackee",
"required": true
},
"ACKEE_MONGODB": {
"description": "MongoDB URI which will be used to connect a database to Ackee",
"required": true
},
"ACKEE_ALLOW_ORIGIN": {
"description": "Tracked domains which will be used on Ackee (CORS headers)",
"required": true
},
"ACKEE_TTL": {
"description": "Specifies how long an Ackee TTL token is valid (Default: 3600000)",
"required": false
},
"ACKEE_TRACKER": {
"description": "Specifies a custom name for the tracking script (Default: tracker.js)",
"required": false
}
}
}
| Fix for "Deploy to Heroku" button | Fix for "Deploy to Heroku" button | JSON | mit | electerious/Ackee | json | ## Code Before:
{
"name": "Ackee",
"description": "Self-hosted, Node.js based analytics tool for those who care about privacy",
"keywords": [
"server",
"tracking",
"analytics"
],
"website": "https://ackee.electerious.com/",
"repository": "https://github.com/electerious/Ackee",
"env": {
"ACKEE_USERNAME": {
"description": "Username which will be used to log in to Ackee",
"required": true
},
"ACKEE_PASSWORD": {
"description": "Password which will be used to log in to Ackee",
"required": true
}
},
"addons": [
{
"plan": "mongolab"
}
]
}
## Instruction:
Fix for "Deploy to Heroku" button
## Code After:
{
"name": "Ackee",
"description": "Self-hosted, Node.js based analytics tool for those who care about privacy",
"keywords": [
"server",
"tracking",
"analytics"
],
"website": "https://ackee.electerious.com/",
"repository": "https://github.com/electerious/Ackee",
"env": {
"ACKEE_USERNAME": {
"description": "Username which will be used to log in to Ackee",
"required": true
},
"ACKEE_PASSWORD": {
"description": "Password which will be used to log in to Ackee",
"required": true
},
"ACKEE_MONGODB": {
"description": "MongoDB URI which will be used to connect a database to Ackee",
"required": true
},
"ACKEE_ALLOW_ORIGIN": {
"description": "Tracked domains which will be used on Ackee (CORS headers)",
"required": true
},
"ACKEE_TTL": {
"description": "Specifies how long an Ackee TTL token is valid (Default: 3600000)",
"required": false
},
"ACKEE_TRACKER": {
"description": "Specifies a custom name for the tracking script (Default: tracker.js)",
"required": false
}
}
}
|
c1bd75094ad8fb4b572089ecfd15332e8069c00f | docker-service/ecs-service.sls | docker-service/ecs-service.sls |
{% set service_list = [] %}
{% for service_name in pillar['services'] %}
{% if pillar['services'][service_name]['type'] | default('compose') == 'ecs' %}
{% do service_list.append(pillar['services'][service_name]) %}
{% endif %}
{% endfor %}
{{ service_list }}
|
{% for service_name in pillar['services'] %}
{% if pillar['services'][service_name]['type'] | default('compose') == 'ecs' %}
{% %}
{% endif %}
{% endfor %}
| Update ecs service placeholder file | Update ecs service placeholder file
| SaltStack | mit | ministryofjustice/opg-salt-formula,ministryofjustice/opg-salt-formula,ministryofjustice/opg-salt-formula | saltstack | ## Code Before:
{% set service_list = [] %}
{% for service_name in pillar['services'] %}
{% if pillar['services'][service_name]['type'] | default('compose') == 'ecs' %}
{% do service_list.append(pillar['services'][service_name]) %}
{% endif %}
{% endfor %}
{{ service_list }}
## Instruction:
Update ecs service placeholder file
## Code After:
{% for service_name in pillar['services'] %}
{% if pillar['services'][service_name]['type'] | default('compose') == 'ecs' %}
{% %}
{% endif %}
{% endfor %}
|
fb7911854db5f2dbe2d3093608e2eaa4a41b308f | app/views/comment/_show_comments.html.erb | app/views/comment/_show_comments.html.erb | <%
comments = object.comments.sort_by(&:created_at).reverse
if limit
and_more = comments.length - limit
comments = comments[0..limit-1]
end
%>
<div class="row">
<div class="col-sm-8">
<%= content_tag(:h4, comments.empty? ? :"show_comments_no_comments_yet".t : :COMMENTS.t) %>
</div>
<div class="col-sm-4">
<strong class="pull-right pad-top">
<%= link_with_query(:"show_comments_add_comment".t, {controller: :comment,
action: :add_comment, id: object.id, type: object.class.name}) if controls
%>
</strong>
</div>
</div>
<% comments.each do |comment| %>
<%= render(:partial => 'comment/comment', :object => comment) %>
<% end %>
<%= if limit and (and_more > 0)
link_to(:show_comments_and_more.t(:num => and_more),
{controller: :comment, action: :show_comments_for_target, id: object.id, type: object.class.name})
end %>
| <%
comments = object.comments.sort_by(&:created_at).reverse
if limit
and_more = comments.length - limit
comments = comments[0..limit-1]
end
%>
<div class="row">
<div class="col-sm-12">
<%= content_tag(:h4, comments.empty? ? :"show_comments_no_comments_yet".t : :COMMENTS.t, style: "display: inline-block") %>
<%= link_with_query(:"show_comments_add_comment".t,
{controller: :comment, action: :add_comment, id: object.id, type: object.class.name},
style: "margin-left: 10px;") if controls %>
</div>
</div>
<% comments.each do |comment| %>
<%= render(:partial => 'comment/comment', :object => comment) %>
<% end %>
<%= if limit and (and_more > 0)
link_to(:show_comments_and_more.t(:num => and_more),
{controller: :comment, action: :show_comments_for_target, id: object.id, type: object.class.name})
end %>
| Add comment link was hidden under images, took me about 5 seconds to find it, most users probably would take longer to find it. | Add comment link was hidden under images, took me about 5 seconds to find it, most users probably would take longer to find it.
| HTML+ERB | mit | pellaea/mushroom-observer,JoeCohen/mushroom-observer,raysuelzer/mushroom-observer,pellaea/mushroom-observer,MushroomObserver/mushroom-observer,raysuelzer/mushroom-observer,MushroomObserver/mushroom-observer,MushroomObserver/mushroom-observer,raysuelzer/mushroom-observer,JoeCohen/mushroom-observer,MushroomObserver/mushroom-observer,JoeCohen/mushroom-observer,pellaea/mushroom-observer,MushroomObserver/mushroom-observer,JoeCohen/mushroom-observer,raysuelzer/mushroom-observer,raysuelzer/mushroom-observer,MushroomObserver/mushroom-observer,JoeCohen/mushroom-observer,raysuelzer/mushroom-observer,JoeCohen/mushroom-observer,pellaea/mushroom-observer,JoeCohen/mushroom-observer,pellaea/mushroom-observer,raysuelzer/mushroom-observer,pellaea/mushroom-observer,pellaea/mushroom-observer,MushroomObserver/mushroom-observer | html+erb | ## Code Before:
<%
comments = object.comments.sort_by(&:created_at).reverse
if limit
and_more = comments.length - limit
comments = comments[0..limit-1]
end
%>
<div class="row">
<div class="col-sm-8">
<%= content_tag(:h4, comments.empty? ? :"show_comments_no_comments_yet".t : :COMMENTS.t) %>
</div>
<div class="col-sm-4">
<strong class="pull-right pad-top">
<%= link_with_query(:"show_comments_add_comment".t, {controller: :comment,
action: :add_comment, id: object.id, type: object.class.name}) if controls
%>
</strong>
</div>
</div>
<% comments.each do |comment| %>
<%= render(:partial => 'comment/comment', :object => comment) %>
<% end %>
<%= if limit and (and_more > 0)
link_to(:show_comments_and_more.t(:num => and_more),
{controller: :comment, action: :show_comments_for_target, id: object.id, type: object.class.name})
end %>
## Instruction:
Add comment link was hidden under images, took me about 5 seconds to find it, most users probably would take longer to find it.
## Code After:
<%
comments = object.comments.sort_by(&:created_at).reverse
if limit
and_more = comments.length - limit
comments = comments[0..limit-1]
end
%>
<div class="row">
<div class="col-sm-12">
<%= content_tag(:h4, comments.empty? ? :"show_comments_no_comments_yet".t : :COMMENTS.t, style: "display: inline-block") %>
<%= link_with_query(:"show_comments_add_comment".t,
{controller: :comment, action: :add_comment, id: object.id, type: object.class.name},
style: "margin-left: 10px;") if controls %>
</div>
</div>
<% comments.each do |comment| %>
<%= render(:partial => 'comment/comment', :object => comment) %>
<% end %>
<%= if limit and (and_more > 0)
link_to(:show_comments_and_more.t(:num => and_more),
{controller: :comment, action: :show_comments_for_target, id: object.id, type: object.class.name})
end %>
|
db674a1329e3d79ca5cf1b179817ee2e52684f18 | resources/config/local.php | resources/config/local.php | <?php
return function (CM_Config_Node $config) {
$config->services['s3export-filesystem-original'] = array(
'class' => 'CM_File_Filesystem_Factory',
'method' => array(
'name' => 'createFilesystem',
'arguments' => array(
'CM_File_Filesystem_Adapter_AwsS3',
array(
'bucket' => '<bucket>',
'region' => '<region>',
'key' => '<access-key>',
'secret' => '<secret-access-key>',
),
),
));
$config->services['s3export-backup-manager'] = [
'class' => 'S3Export_BackupManager',
'arguments' => [
[
'key' => '<access-key>',
'secret' => '<secret-access-key>',
]
]
];
};
| <?php
return function (CM_Config_Node $config) {
$awsBucket = '<bucket>';
$awsRegion = '<region>';
$awsKey = '<access-key>';
$awsSecret = '<secret-access-key>';
$config->services['s3export-filesystem-original'] = array(
'class' => 'CM_File_Filesystem_Factory',
'method' => array(
'name' => 'createFilesystem',
'arguments' => array(
'CM_File_Filesystem_Adapter_AwsS3',
array(
'bucket' => $awsBucket,
'region' => $awsRegion,
'key' => $awsKey,
'secret' => $awsSecret,
),
),
));
$config->services['s3export-backup-manager'] = [
'class' => 'S3Export_BackupManager',
'arguments' => [
[
'key' => $awsKey,
'secret' => $awsSecret,
]
]
];
};
| Make file easier to use | Make file easier to use
| PHP | mit | cargomedia/s3export_backup,cargomedia/s3export_backup | php | ## Code Before:
<?php
return function (CM_Config_Node $config) {
$config->services['s3export-filesystem-original'] = array(
'class' => 'CM_File_Filesystem_Factory',
'method' => array(
'name' => 'createFilesystem',
'arguments' => array(
'CM_File_Filesystem_Adapter_AwsS3',
array(
'bucket' => '<bucket>',
'region' => '<region>',
'key' => '<access-key>',
'secret' => '<secret-access-key>',
),
),
));
$config->services['s3export-backup-manager'] = [
'class' => 'S3Export_BackupManager',
'arguments' => [
[
'key' => '<access-key>',
'secret' => '<secret-access-key>',
]
]
];
};
## Instruction:
Make file easier to use
## Code After:
<?php
return function (CM_Config_Node $config) {
$awsBucket = '<bucket>';
$awsRegion = '<region>';
$awsKey = '<access-key>';
$awsSecret = '<secret-access-key>';
$config->services['s3export-filesystem-original'] = array(
'class' => 'CM_File_Filesystem_Factory',
'method' => array(
'name' => 'createFilesystem',
'arguments' => array(
'CM_File_Filesystem_Adapter_AwsS3',
array(
'bucket' => $awsBucket,
'region' => $awsRegion,
'key' => $awsKey,
'secret' => $awsSecret,
),
),
));
$config->services['s3export-backup-manager'] = [
'class' => 'S3Export_BackupManager',
'arguments' => [
[
'key' => $awsKey,
'secret' => $awsSecret,
]
]
];
};
|
efef24c1bd717a5591593b835313a8c29a0ef5fd | pi-setup/pi-robot-join-wifi.sh | pi-setup/pi-robot-join-wifi.sh |
_IP=$(hostname -I) || true
SSID=$(sed -n -e '/ssid/s/"//g' -e '/ssid/s/ssid=//' \
< /etc/wpa_supplicant/wpa_supplicant.conf)
echo -n "Connecting to $SSID wifi network"
while [[ ! ("$_IP" == *10.10.*) ]]; do
echo -n "."
ifdown wlan0 2>&1 | logger
sleep 2
ifup wlan0 2>&1 | logger
sleep 2
_IP=$(hostname -I) || true
done
echo ". IP address: $_IP"
|
LOOP=${1:-""}
_IP=$(hostname -I) || true
SSID=$(sed -n -e '/ssid/s/"//g' -e '/ssid/s/ssid=//' \
< /etc/wpa_supplicant/wpa_supplicant.conf)
WIFI_JOIN() {
echo -n "Connecting to $SSID wifi network"
while [[ ! ("$_IP" == *10.10.*) ]]; do
echo -n "."
ifdown wlan0 2>&1 | logger
sleep 2
ifup wlan0 2>&1 | logger
sleep 2
_IP=$(hostname -I) || true
done
echo ". IP address: $_IP"
}
WIFI_JOIN
if [[ $LOOP ]] ; then
WIFI_JOIN
sleep $LOOP
fi
| Add ability to loop based on argument | Add ability to loop based on argument
| Shell | mit | mitmuseumstudio/RoboticLightBallet,mitmuseumstudio/RoboticLightBallet,mitmuseumstudio/RoboticLightBallet,mitmuseumstudio/RoboticLightBallet | shell | ## Code Before:
_IP=$(hostname -I) || true
SSID=$(sed -n -e '/ssid/s/"//g' -e '/ssid/s/ssid=//' \
< /etc/wpa_supplicant/wpa_supplicant.conf)
echo -n "Connecting to $SSID wifi network"
while [[ ! ("$_IP" == *10.10.*) ]]; do
echo -n "."
ifdown wlan0 2>&1 | logger
sleep 2
ifup wlan0 2>&1 | logger
sleep 2
_IP=$(hostname -I) || true
done
echo ". IP address: $_IP"
## Instruction:
Add ability to loop based on argument
## Code After:
LOOP=${1:-""}
_IP=$(hostname -I) || true
SSID=$(sed -n -e '/ssid/s/"//g' -e '/ssid/s/ssid=//' \
< /etc/wpa_supplicant/wpa_supplicant.conf)
WIFI_JOIN() {
echo -n "Connecting to $SSID wifi network"
while [[ ! ("$_IP" == *10.10.*) ]]; do
echo -n "."
ifdown wlan0 2>&1 | logger
sleep 2
ifup wlan0 2>&1 | logger
sleep 2
_IP=$(hostname -I) || true
done
echo ". IP address: $_IP"
}
WIFI_JOIN
if [[ $LOOP ]] ; then
WIFI_JOIN
sleep $LOOP
fi
|
f6dfd51d6305b94541ce95be86877882c8d0201e | README.md | README.md |
+ Ratios - should be in the format of `x.xxx` to 3 decimal places (dp).
+ Times - should be expressed in Minutes with 2dp for seconds. `x.xx`
+ Percentages - should be in the format `xx.xx%` to 2dp.
### Calculating Percentages
round ( value / sum ) * 100 ) , 2 )
## View the definitons
[Click Here](https://github.com/OnsideFC/Definitions/blob/gh-pages/DEFINITIONS.md)
## Suggesting and Making a Change
Spot and issue or something missing then create an issue and then branch of this repo,
make your changes and issue a pull request back to the master branch attached to the issue.
You can either do this in git, in a client or via the github.com website.
## Questions?
[Open an Issue](https://github.com/OnsideFC/definitions/issues/new) !
## Rules
Please limit pull requests to one definition at a time.
## Then
If you change is approved it'll be merged into the master.
Thanks
|
+ Ratios - should be in the format of `x.xxx` to 3 decimal places (dp).
+ Times - should be expressed in minutes with 2dp for seconds `x.xx` for in-game references
- or for kick-off times and similar higher level times `24:MM:SS` of the timezone of the location in question.
+ Dates -should be in the ISO standard of `yyyy-mm-dd` to avoid any confusion with American/English formats.
+ Percentages - should be in the format `xx.xx%` to 2dp.
### Calculating Percentages
round ( value / sum ) * 100 ) , 2 )
## View the definitons
[Click Here](https://github.com/OnsideFC/Definitions/blob/gh-pages/DEFINITIONS.md)
## Suggesting and Making a Change
Spot and issue or something missing then create an issue and then branch of this repo,
make your changes and issue a pull request back to the master branch attached to the issue.
You can either do this in git, in a client or via the github.com website.
## Questions?
[Open an Issue](https://github.com/OnsideFC/definitions/issues/new) !
## Rules
Please limit pull requests to one definition at a time.
## Then
If you change is approved it'll be merged into the master.
Thanks
| Add in date formats and clarify time | Add in date formats and clarify time | Markdown | unlicense | OnsideFC/Definitions | markdown | ## Code Before:
+ Ratios - should be in the format of `x.xxx` to 3 decimal places (dp).
+ Times - should be expressed in Minutes with 2dp for seconds. `x.xx`
+ Percentages - should be in the format `xx.xx%` to 2dp.
### Calculating Percentages
round ( value / sum ) * 100 ) , 2 )
## View the definitons
[Click Here](https://github.com/OnsideFC/Definitions/blob/gh-pages/DEFINITIONS.md)
## Suggesting and Making a Change
Spot and issue or something missing then create an issue and then branch of this repo,
make your changes and issue a pull request back to the master branch attached to the issue.
You can either do this in git, in a client or via the github.com website.
## Questions?
[Open an Issue](https://github.com/OnsideFC/definitions/issues/new) !
## Rules
Please limit pull requests to one definition at a time.
## Then
If you change is approved it'll be merged into the master.
Thanks
## Instruction:
Add in date formats and clarify time
## Code After:
+ Ratios - should be in the format of `x.xxx` to 3 decimal places (dp).
+ Times - should be expressed in minutes with 2dp for seconds `x.xx` for in-game references
- or for kick-off times and similar higher level times `24:MM:SS` of the timezone of the location in question.
+ Dates -should be in the ISO standard of `yyyy-mm-dd` to avoid any confusion with American/English formats.
+ Percentages - should be in the format `xx.xx%` to 2dp.
### Calculating Percentages
round ( value / sum ) * 100 ) , 2 )
## View the definitons
[Click Here](https://github.com/OnsideFC/Definitions/blob/gh-pages/DEFINITIONS.md)
## Suggesting and Making a Change
Spot and issue or something missing then create an issue and then branch of this repo,
make your changes and issue a pull request back to the master branch attached to the issue.
You can either do this in git, in a client or via the github.com website.
## Questions?
[Open an Issue](https://github.com/OnsideFC/definitions/issues/new) !
## Rules
Please limit pull requests to one definition at a time.
## Then
If you change is approved it'll be merged into the master.
Thanks
|
51e9262ff273db870310453797dbeb48eefd4df7 | logcollector/__init__.py | logcollector/__init__.py | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../logcollector.db'
db = SQLAlchemy(app)
@app.route("/")
def hello():
return "Hello World!"
| from flask import Flask, request, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
from .models import DataPoint
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../logcollector.db'
db = SQLAlchemy(app)
@app.route("/new", methods=['POST'])
def collect():
new_data = DataPoint(request.form['timestamp'], request.form['dim1'],
request.form['dim2'], request.form['value']
)
db.session.add(new_data)
db.session.commit()
return jsonify(id=new_data.id, timestamp=request.form['timestamp'],
dim1=new_data.dim1, dim2=new_data.dim2), 201
| Implement save functionality with POST request | Implement save functionality with POST request
| Python | agpl-3.0 | kissgyorgy/log-collector | python | ## Code Before:
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../logcollector.db'
db = SQLAlchemy(app)
@app.route("/")
def hello():
return "Hello World!"
## Instruction:
Implement save functionality with POST request
## Code After:
from flask import Flask, request, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
from .models import DataPoint
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../logcollector.db'
db = SQLAlchemy(app)
@app.route("/new", methods=['POST'])
def collect():
new_data = DataPoint(request.form['timestamp'], request.form['dim1'],
request.form['dim2'], request.form['value']
)
db.session.add(new_data)
db.session.commit()
return jsonify(id=new_data.id, timestamp=request.form['timestamp'],
dim1=new_data.dim1, dim2=new_data.dim2), 201
|
2c7ad30e91cf4ad8c4b02f6ceecdae0c4651b829 | config/initializers/parameters.rb | config/initializers/parameters.rb | GenieacsGui::Application.config.summary_parameters = YAML.load_file('config/summary_parameters.yml')
GenieacsGui::Application.config.index_parameters = YAML.load_file('config/index_parameters.yml')
GenieacsGui::Application.config.device_filters = {'Last inform' => 'summary.lastInform', 'Tag' => '_tags'}
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.summary_parameters)
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.index_parameters)
| GenieacsGui::Application.config.summary_parameters = YAML.load_file('config/summary_parameters.yml')
GenieacsGui::Application.config.index_parameters = YAML.load_file('config/index_parameters.yml')
GenieacsGui::Application.config.device_filters = {'Last inform' => 'summary.lastInform', 'Tag' => '_tags'}
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.summary_parameters)
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.index_parameters)
GenieacsGui::Application.config.device_filters.delete_if {|key, value| not value.is_a?(String)}
| Exclude objects from search filters. | Exclude objects from search filters.
| Ruby | mit | zaidka/genieacs-gui,zaidka/genieacs-gui,sonaht/genieacs-gui,akcoder/genieacs-gui,zaidka/genieacs-gui,sonaht/genieacs-gui,akcoder/genieacs-gui,akcoder/genieacs-gui,sonaht/genieacs-gui | ruby | ## Code Before:
GenieacsGui::Application.config.summary_parameters = YAML.load_file('config/summary_parameters.yml')
GenieacsGui::Application.config.index_parameters = YAML.load_file('config/index_parameters.yml')
GenieacsGui::Application.config.device_filters = {'Last inform' => 'summary.lastInform', 'Tag' => '_tags'}
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.summary_parameters)
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.index_parameters)
## Instruction:
Exclude objects from search filters.
## Code After:
GenieacsGui::Application.config.summary_parameters = YAML.load_file('config/summary_parameters.yml')
GenieacsGui::Application.config.index_parameters = YAML.load_file('config/index_parameters.yml')
GenieacsGui::Application.config.device_filters = {'Last inform' => 'summary.lastInform', 'Tag' => '_tags'}
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.summary_parameters)
GenieacsGui::Application.config.device_filters.merge!(GenieacsGui::Application.config.index_parameters)
GenieacsGui::Application.config.device_filters.delete_if {|key, value| not value.is_a?(String)}
|
90f733c5dcb4e4a51a9ef6d7cc70e754b63415c7 | test/markup/haskell/infix.expect.txt | test/markup/haskell/infix.expect.txt | <span class="hljs-infix"><span class="hljs-keyword">infix</span> <span class="hljs-number">3</span> `foo`</span>
<span class="hljs-infix"><span class="hljs-keyword">infixl</span> <span class="hljs-number">6</span> `bar`</span>
<span class="hljs-infix"><span class="hljs-keyword">infixr</span> <span class="hljs-number">9</span> `baz`</span>
| <span class="hljs-keyword">infix</span> <span class="hljs-number">3</span> `foo`
<span class="hljs-keyword">infixl</span> <span class="hljs-number">6</span> `bar`
<span class="hljs-keyword">infixr</span> <span class="hljs-number">9</span> `baz`
| Fix haskell infix markup test. | Fix haskell infix markup test.
| Text | bsd-3-clause | palmin/highlight.js,isagalaev/highlight.js,palmin/highlight.js,dbkaplun/highlight.js,VoldemarLeGrand/highlight.js,aurusov/highlight.js,palmin/highlight.js,tenbits/highlight.js,StanislawSwierc/highlight.js,aurusov/highlight.js,bluepichu/highlight.js,Sannis/highlight.js,isagalaev/highlight.js,carlokok/highlight.js,Sannis/highlight.js,VoldemarLeGrand/highlight.js,bluepichu/highlight.js,teambition/highlight.js,highlightjs/highlight.js,VoldemarLeGrand/highlight.js,highlightjs/highlight.js,MakeNowJust/highlight.js,highlightjs/highlight.js,sourrust/highlight.js,MakeNowJust/highlight.js,carlokok/highlight.js,bluepichu/highlight.js,MakeNowJust/highlight.js,dbkaplun/highlight.js,highlightjs/highlight.js,lead-auth/highlight.js,sourrust/highlight.js,Sannis/highlight.js,dbkaplun/highlight.js,sourrust/highlight.js,tenbits/highlight.js,carlokok/highlight.js,carlokok/highlight.js,aurusov/highlight.js,tenbits/highlight.js,StanislawSwierc/highlight.js,teambition/highlight.js,teambition/highlight.js | text | ## Code Before:
<span class="hljs-infix"><span class="hljs-keyword">infix</span> <span class="hljs-number">3</span> `foo`</span>
<span class="hljs-infix"><span class="hljs-keyword">infixl</span> <span class="hljs-number">6</span> `bar`</span>
<span class="hljs-infix"><span class="hljs-keyword">infixr</span> <span class="hljs-number">9</span> `baz`</span>
## Instruction:
Fix haskell infix markup test.
## Code After:
<span class="hljs-keyword">infix</span> <span class="hljs-number">3</span> `foo`
<span class="hljs-keyword">infixl</span> <span class="hljs-number">6</span> `bar`
<span class="hljs-keyword">infixr</span> <span class="hljs-number">9</span> `baz`
|
d1a893514092a2495fcd2b14365b9b014fd39f59 | calaccess_processed/models/__init__.py | calaccess_processed/models/__init__.py | from calaccess_processed.models.campaign.entities import (
Candidate,
CandidateCommittee,
)
from calaccess_processed.models.campaign.filings import (
Form460,
Form460Version,
Schedule497,
Schedule497Version,
)
from calaccess_processed.models.campaign.contributions import (
MonetaryContribution,
MonetaryContributionVersion,
NonMonetaryContribution,
NonMonetaryContributionVersion,
LateContributionReceived,
LateContributionReceivedVersion,
LateContributionMade,
LateContributionMadeVersion,
)
from calaccess_processed.models.common import (
FilerIDValue,
FilingIDValue,
)
from calaccess_processed.models.tracking import (
ProcessedDataVersion,
ProcessedDataFile,
)
__all__ = (
'ProcessedDataVersion',
'ProcessedDataFile',
'Candidate',
'CandidateCommittee',
'Form460',
'Form460Version',
'Schedule497',
'Schedule497Version',
'LateContributionReceived',
'LateContributionReceivedVersion',
'LateContributionMade',
'LateContributionMadeVersion',
'FilerIDValue',
'FilingIDValue',
)
| from calaccess_processed.models.campaign.entities import (
Candidate,
CandidateCommittee,
)
from calaccess_processed.models.campaign.filings import (
Form460,
Form460Version,
Schedule497,
Schedule497Version,
)
from calaccess_processed.models.campaign.contributions import (
MonetaryContribution,
MonetaryContributionVersion,
NonMonetaryContribution,
NonMonetaryContributionVersion,
LateContributionReceived,
LateContributionReceivedVersion,
LateContributionMade,
LateContributionMadeVersion,
)
from calaccess_processed.models.common import (
FilerIDValue,
FilingIDValue,
)
from calaccess_processed.models.tracking import (
ProcessedDataVersion,
ProcessedDataFile,
)
__all__ = (
'ProcessedDataVersion',
'ProcessedDataFile',
'Candidate',
'CandidateCommittee',
'Form460',
'Form460Version',
'Schedule497',
'Schedule497Version',
'MonetaryContribution',
'MonetaryContributionVersion',
'NonMonetaryContribution',
'NonMonetaryContributionVersion',
'LateContributionReceived',
'LateContributionReceivedVersion',
'LateContributionMade',
'LateContributionMadeVersion',
'FilerIDValue',
'FilingIDValue',
)
| Add missing models to __all__ list | Add missing models to __all__ list
| Python | mit | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | python | ## Code Before:
from calaccess_processed.models.campaign.entities import (
Candidate,
CandidateCommittee,
)
from calaccess_processed.models.campaign.filings import (
Form460,
Form460Version,
Schedule497,
Schedule497Version,
)
from calaccess_processed.models.campaign.contributions import (
MonetaryContribution,
MonetaryContributionVersion,
NonMonetaryContribution,
NonMonetaryContributionVersion,
LateContributionReceived,
LateContributionReceivedVersion,
LateContributionMade,
LateContributionMadeVersion,
)
from calaccess_processed.models.common import (
FilerIDValue,
FilingIDValue,
)
from calaccess_processed.models.tracking import (
ProcessedDataVersion,
ProcessedDataFile,
)
__all__ = (
'ProcessedDataVersion',
'ProcessedDataFile',
'Candidate',
'CandidateCommittee',
'Form460',
'Form460Version',
'Schedule497',
'Schedule497Version',
'LateContributionReceived',
'LateContributionReceivedVersion',
'LateContributionMade',
'LateContributionMadeVersion',
'FilerIDValue',
'FilingIDValue',
)
## Instruction:
Add missing models to __all__ list
## Code After:
from calaccess_processed.models.campaign.entities import (
Candidate,
CandidateCommittee,
)
from calaccess_processed.models.campaign.filings import (
Form460,
Form460Version,
Schedule497,
Schedule497Version,
)
from calaccess_processed.models.campaign.contributions import (
MonetaryContribution,
MonetaryContributionVersion,
NonMonetaryContribution,
NonMonetaryContributionVersion,
LateContributionReceived,
LateContributionReceivedVersion,
LateContributionMade,
LateContributionMadeVersion,
)
from calaccess_processed.models.common import (
FilerIDValue,
FilingIDValue,
)
from calaccess_processed.models.tracking import (
ProcessedDataVersion,
ProcessedDataFile,
)
__all__ = (
'ProcessedDataVersion',
'ProcessedDataFile',
'Candidate',
'CandidateCommittee',
'Form460',
'Form460Version',
'Schedule497',
'Schedule497Version',
'MonetaryContribution',
'MonetaryContributionVersion',
'NonMonetaryContribution',
'NonMonetaryContributionVersion',
'LateContributionReceived',
'LateContributionReceivedVersion',
'LateContributionMade',
'LateContributionMadeVersion',
'FilerIDValue',
'FilingIDValue',
)
|
f48f0042fb3f96c4ca0cce05816efdb16d032e8c | IxD/features.txt | IxD/features.txt | "Baby" entity properties
* First Name
* Last Name
* Delivery (date)
* Birthday (date)
* Born (bool) [consider using "nil" birthday instead]
* Sex
* Picture
* Dad
* Mom
* Godparent(s)
* Siblings
* Special event (baptism, Brit milah etc, birthday party)
* Nameday
* Babyshower
* Gifts
* Notes (free text)
"Gift" entity
* When
* Description
* Price
"Event" entity
* When
* Type
* Notification?
Features
- Contacts Framework (iOS 9)
- Add/Edit/Delete
- Reminders (delivery date, birthday, nameday etc)
- Call Parents
- Copy baby info to Contacts
- iCloud
- Analytics
- Sharing
- Export to calendar
- Export reminders
Briefing view (all known data as a quick to read story)
Brit milah (circumcision ceremony)
https://en.wikipedia.org/wiki/Religious_initiation_rites
| "Baby" entity properties
* First Name
* Last Name
* Delivery (date)
* Birthday (date)
* Born (bool) [consider using "nil" birthday instead]
* Sex
* Picture
* Dad
* Mom
* Godparent(s)
* Siblings
* Special event (baptism, Brit milah etc, birthday party)
* Nameday
* Babyshower
* Gifts
* Notes (free text)
"Gift" entity
* When
* Description
* Price
"Event" entity
* When
* Type
* Notification?
Features
- Contacts Framework (iOS 9)
- Add/Edit/Delete
- Reminders (delivery date, birthday, nameday etc)
- Call Parents
- Copy baby info to Contacts
- iCloud
- Analytics
- Sharing
- Export to calendar
- Export reminders
Before birth, the baby image changes to predefined ones based on current week
Briefing view (all known data as a quick to read story)
Brit milah (circumcision ceremony)
https://en.wikipedia.org/wiki/Religious_initiation_rites
| Add a reminder for a baby pictures related feature | Add a reminder for a baby pictures related feature
| Text | mit | phi161/Babies,phi161/Babies | text | ## Code Before:
"Baby" entity properties
* First Name
* Last Name
* Delivery (date)
* Birthday (date)
* Born (bool) [consider using "nil" birthday instead]
* Sex
* Picture
* Dad
* Mom
* Godparent(s)
* Siblings
* Special event (baptism, Brit milah etc, birthday party)
* Nameday
* Babyshower
* Gifts
* Notes (free text)
"Gift" entity
* When
* Description
* Price
"Event" entity
* When
* Type
* Notification?
Features
- Contacts Framework (iOS 9)
- Add/Edit/Delete
- Reminders (delivery date, birthday, nameday etc)
- Call Parents
- Copy baby info to Contacts
- iCloud
- Analytics
- Sharing
- Export to calendar
- Export reminders
Briefing view (all known data as a quick to read story)
Brit milah (circumcision ceremony)
https://en.wikipedia.org/wiki/Religious_initiation_rites
## Instruction:
Add a reminder for a baby pictures related feature
## Code After:
"Baby" entity properties
* First Name
* Last Name
* Delivery (date)
* Birthday (date)
* Born (bool) [consider using "nil" birthday instead]
* Sex
* Picture
* Dad
* Mom
* Godparent(s)
* Siblings
* Special event (baptism, Brit milah etc, birthday party)
* Nameday
* Babyshower
* Gifts
* Notes (free text)
"Gift" entity
* When
* Description
* Price
"Event" entity
* When
* Type
* Notification?
Features
- Contacts Framework (iOS 9)
- Add/Edit/Delete
- Reminders (delivery date, birthday, nameday etc)
- Call Parents
- Copy baby info to Contacts
- iCloud
- Analytics
- Sharing
- Export to calendar
- Export reminders
Before birth, the baby image changes to predefined ones based on current week
Briefing view (all known data as a quick to read story)
Brit milah (circumcision ceremony)
https://en.wikipedia.org/wiki/Religious_initiation_rites
|
b28dd3fbd085d6b58b18e846f9b18fbce02b9fb5 | javascripts/apps/github.js | javascripts/apps/github.js | (function() { define(['zepto'], function($) {
var gistCaching = {};
var renderGist = function(ele, gist) {
var css = "https://gist.github.com" + gist.stylesheet;
if($('link[href="' + css + '"]').length === 0){
$('head').prepend('<link rel="stylesheet" type="text/css" media="screen" href="' + css + '" />');
}
$(ele).html(gist.div);
$('.gist-meta', $(ele)).click(function() {
$('.gist-data', $(ele)).toggle();
});
};
// http://stackoverflow.com/questions/9154026/jquery-dynamically-load-a-gist-embed
return function(ele) {
var id = $(ele).data('id');
if (gistCaching[id]) {
renderGist(ele, gistCaching[id]);
} else {
window["gist_callback_count"] = (window["gist_callback_count"] || 0) + 1;
var callbackName = "gist_callback_" + window["gist_callback_count"];
window[callbackName] = function (gist) {
renderGist(ele, gist);
gistCaching[id] = gist;
script.parentNode.removeChild(script);
delete window[callbackName];
};
var script = document.createElement("script");
script.setAttribute("src", "https://gist.github.com/" + id + ".json?callback=" + callbackName);
document.body.appendChild(script);
}
};
}); }());
| (function() { define(['zepto'], function($) {
var gistCaching = {};
var renderGist = function(ele, gist) {
var css = "https://gist.github.com" + gist.stylesheet;
if($('link[href="' + css + '"]').length === 0){
$('head').prepend('<link rel="stylesheet" type="text/css" media="screen" href="' + css + '" />');
}
$(ele).html(gist.div);
$('.gist-meta', $(ele)).click(function() {
$('.gist-data', $(ele)).toggle();
});
};
return function(ele) {
var id = $(ele).data('id');
if (gistCaching[id]) {
renderGist(ele, gistCaching[id]);
} else {
$.ajax({
url: "https://gist.github.com/" + id + ".json",
dataType: "jsonp",
async: false,
withCredentials: true,
success: function(gist) {
gistCaching[id] = gist;
renderGist(ele, gist);
}
});
}
};
}); }());
| Use zepto got get gist, without own ugly jsonp | Use zepto got get gist, without own ugly jsonp
| JavaScript | bsd-3-clause | vecio/MeT,vecio/MeT | javascript | ## Code Before:
(function() { define(['zepto'], function($) {
var gistCaching = {};
var renderGist = function(ele, gist) {
var css = "https://gist.github.com" + gist.stylesheet;
if($('link[href="' + css + '"]').length === 0){
$('head').prepend('<link rel="stylesheet" type="text/css" media="screen" href="' + css + '" />');
}
$(ele).html(gist.div);
$('.gist-meta', $(ele)).click(function() {
$('.gist-data', $(ele)).toggle();
});
};
// http://stackoverflow.com/questions/9154026/jquery-dynamically-load-a-gist-embed
return function(ele) {
var id = $(ele).data('id');
if (gistCaching[id]) {
renderGist(ele, gistCaching[id]);
} else {
window["gist_callback_count"] = (window["gist_callback_count"] || 0) + 1;
var callbackName = "gist_callback_" + window["gist_callback_count"];
window[callbackName] = function (gist) {
renderGist(ele, gist);
gistCaching[id] = gist;
script.parentNode.removeChild(script);
delete window[callbackName];
};
var script = document.createElement("script");
script.setAttribute("src", "https://gist.github.com/" + id + ".json?callback=" + callbackName);
document.body.appendChild(script);
}
};
}); }());
## Instruction:
Use zepto got get gist, without own ugly jsonp
## Code After:
(function() { define(['zepto'], function($) {
var gistCaching = {};
var renderGist = function(ele, gist) {
var css = "https://gist.github.com" + gist.stylesheet;
if($('link[href="' + css + '"]').length === 0){
$('head').prepend('<link rel="stylesheet" type="text/css" media="screen" href="' + css + '" />');
}
$(ele).html(gist.div);
$('.gist-meta', $(ele)).click(function() {
$('.gist-data', $(ele)).toggle();
});
};
return function(ele) {
var id = $(ele).data('id');
if (gistCaching[id]) {
renderGist(ele, gistCaching[id]);
} else {
$.ajax({
url: "https://gist.github.com/" + id + ".json",
dataType: "jsonp",
async: false,
withCredentials: true,
success: function(gist) {
gistCaching[id] = gist;
renderGist(ele, gist);
}
});
}
};
}); }());
|
1f4712eca3960b4489e6872d7261b1fc17eccf59 | src/main/java/com/ichorcommunity/latch/enums/LockType.java | src/main/java/com/ichorcommunity/latch/enums/LockType.java | package com.ichorcommunity.latch.enums;
public enum LockType {
/*
* Accessible by everyone
*/
PUBLIC,
/*
* Accessible by the group
*/
GUILD,
/*
* Requires a password every time to use
*/
PASSWORD_ALWAYS,
/*
* Requires a password the first time a player accesses it
*/
PASSWORD_ONCE,
/*
* Owned/controlled by one person, access able to be shared
*/
PRIVATE,
/*
* Allows all players to deposit items, only the owner to withdraw
*/
DONATION;
}
| package com.ichorcommunity.latch.enums;
public enum LockType {
/*
* Accessible by everyone
*/
PUBLIC,
/*
* Accessible by the group
*/
GUILD,
/*
* Requires a password every time to use
*/
PASSWORD_ALWAYS,
/*
* Requires a password the first time a player accesses it
*/
PASSWORD_ONCE,
/*
* Owned/controlled by one person, access able to be shared
*/
PRIVATE;
/*
* Allows all players to deposit items, only the owner to withdraw
*/
//Donation locks not possible to make without Sponge Inventory implementation
//DONATION;
}
| Disable donation lock for now | Disable donation lock for now
| Java | mit | IchorPowered/Latch | java | ## Code Before:
package com.ichorcommunity.latch.enums;
public enum LockType {
/*
* Accessible by everyone
*/
PUBLIC,
/*
* Accessible by the group
*/
GUILD,
/*
* Requires a password every time to use
*/
PASSWORD_ALWAYS,
/*
* Requires a password the first time a player accesses it
*/
PASSWORD_ONCE,
/*
* Owned/controlled by one person, access able to be shared
*/
PRIVATE,
/*
* Allows all players to deposit items, only the owner to withdraw
*/
DONATION;
}
## Instruction:
Disable donation lock for now
## Code After:
package com.ichorcommunity.latch.enums;
public enum LockType {
/*
* Accessible by everyone
*/
PUBLIC,
/*
* Accessible by the group
*/
GUILD,
/*
* Requires a password every time to use
*/
PASSWORD_ALWAYS,
/*
* Requires a password the first time a player accesses it
*/
PASSWORD_ONCE,
/*
* Owned/controlled by one person, access able to be shared
*/
PRIVATE;
/*
* Allows all players to deposit items, only the owner to withdraw
*/
//Donation locks not possible to make without Sponge Inventory implementation
//DONATION;
}
|
6149075789d1034a7adab0b6c31ccdebe32afd4a | user_aws_edit_request_submit.php | user_aws_edit_request_submit.php | <?php
include_once 'header.php';
include_once 'database.php';
$_POST[ 'speaker' ] = $_SESSION[ 'user' ];
$res = insertIntoTable( 'aws_requests'
, array( 'speaker', 'title', 'abstract', 'supervisor_1', 'supervisor_2'
, 'tcm_member_1', 'tcm_member_2', 'tcm_member_3', 'tcm_member_4'
, 'date', 'time'
) , $_POST
);
if( $res )
{
echo printInfo( 'Successfully created a request to edit AWS details ' );
goToPage( 'user_aws.php', 1 );
exit;
}
else
{
echo minionEmbarrassed( 'I could not create a request to edit your AWS' );
}
echo goBackToPageLink( 'user_aws.php', 'Go back' );
?>
| <?php
include_once 'header.php';
include_once 'database.php';
$_POST[ 'speaker' ] = $_SESSION[ 'user' ];
$res = insertIntoTable( 'aws_requests'
, array( 'speaker', 'title', 'abstract', 'supervisor_1', 'supervisor_2'
, 'tcm_member_1', 'tcm_member_2', 'tcm_member_3', 'tcm_member_4'
, 'date', 'time' , 'is_presynopsis_seminar'
) , $_POST
);
if( $res )
{
echo printInfo( 'Successfully created a request to edit AWS details ' );
goToPage( 'user_aws.php', 1 );
exit;
}
else
{
echo minionEmbarrassed( 'I could not create a request to edit your AWS' );
}
echo goBackToPageLink( 'user_aws.php', 'Go back' );
?>
| Make sure user can also change is_presynopsis_seminar. | Make sure user can also change is_presynopsis_seminar.
| PHP | mit | dilawar/ncbs-hippo,dilawar/ncbs-minion,dilawar/ncbs-hippo,dilawar/ncbs-minion,dilawar/ncbs-minion,dilawar/ncbs-minion,dilawar/ncbs-hippo,dilawar/ncbs-hippo,dilawar/ncbs-minion,dilawar/ncbs-hippo | php | ## Code Before:
<?php
include_once 'header.php';
include_once 'database.php';
$_POST[ 'speaker' ] = $_SESSION[ 'user' ];
$res = insertIntoTable( 'aws_requests'
, array( 'speaker', 'title', 'abstract', 'supervisor_1', 'supervisor_2'
, 'tcm_member_1', 'tcm_member_2', 'tcm_member_3', 'tcm_member_4'
, 'date', 'time'
) , $_POST
);
if( $res )
{
echo printInfo( 'Successfully created a request to edit AWS details ' );
goToPage( 'user_aws.php', 1 );
exit;
}
else
{
echo minionEmbarrassed( 'I could not create a request to edit your AWS' );
}
echo goBackToPageLink( 'user_aws.php', 'Go back' );
?>
## Instruction:
Make sure user can also change is_presynopsis_seminar.
## Code After:
<?php
include_once 'header.php';
include_once 'database.php';
$_POST[ 'speaker' ] = $_SESSION[ 'user' ];
$res = insertIntoTable( 'aws_requests'
, array( 'speaker', 'title', 'abstract', 'supervisor_1', 'supervisor_2'
, 'tcm_member_1', 'tcm_member_2', 'tcm_member_3', 'tcm_member_4'
, 'date', 'time' , 'is_presynopsis_seminar'
) , $_POST
);
if( $res )
{
echo printInfo( 'Successfully created a request to edit AWS details ' );
goToPage( 'user_aws.php', 1 );
exit;
}
else
{
echo minionEmbarrassed( 'I could not create a request to edit your AWS' );
}
echo goBackToPageLink( 'user_aws.php', 'Go back' );
?>
|
2a6f141fd0f32614a2e4e9444e835ac46a442406 | .travis.yml | .travis.yml | language: node_js
node_js:
- "0.12"
script:
- "npm test"
- "npm run lint"
before_script:
- "export CHROME_BIN=chromium-browser"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
after_success:
- "npm run coveralls"
- "rm -rf coverage"
| language: node_js
node_js:
- "stable"
- "4.2"
- "0.12"
- "0.10"
script:
- "npm test"
- "npm run lint"
before_script:
- "export CHROME_BIN=chromium-browser"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
after_success:
- "npm run coveralls"
- "rm -rf coverage"
| Test various version's Node.js in Travis CI | Test various version's Node.js in Travis CI
| YAML | mit | ybiquitous/backbone.deepmodel,ybiquitous/backbone.deepmodel | yaml | ## Code Before:
language: node_js
node_js:
- "0.12"
script:
- "npm test"
- "npm run lint"
before_script:
- "export CHROME_BIN=chromium-browser"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
after_success:
- "npm run coveralls"
- "rm -rf coverage"
## Instruction:
Test various version's Node.js in Travis CI
## Code After:
language: node_js
node_js:
- "stable"
- "4.2"
- "0.12"
- "0.10"
script:
- "npm test"
- "npm run lint"
before_script:
- "export CHROME_BIN=chromium-browser"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
after_success:
- "npm run coveralls"
- "rm -rf coverage"
|
ba5a470e4d4bb3525c2510d7855469353e54f186 | framework/scripts-combined/start-combined.sh | framework/scripts-combined/start-combined.sh |
if [[ $OSTYPE == "cygwin" ]] ; then
OPTIONSFILE="jetty-options.env.win"
else
OPTIONSFILE="jetty-options.env.unix"
fi
#Make sure environment variables are properly set
if [ -e "$JAVA_HOME"/bin/java ] ; then
if [ -f ./properties.xml ] ; then
# Build the global options
OPTIONS=$(cat "$OPTIONSFILE")
"$JAVA_HOME/bin/java" $OPTIONS org.apache.manifoldcf.jettyrunner.ManifoldCFCombinedJettyRunner
exit $?
else
echo "Working directory contains no properties.xml file." 1>&2
exit 1
fi
else
echo "Environment variable JAVA_HOME is not properly set." 1>&2
exit 1
fi
|
if [[ $OSTYPE == "cygwin" ]] ; then
OPTIONSFILE="combined-options.env.win"
else
OPTIONSFILE="combined-options.env.unix"
fi
#Make sure environment variables are properly set
if [ -e "$JAVA_HOME"/bin/java ] ; then
if [ -f ./properties.xml ] ; then
# Build the global options
OPTIONS=$(cat "$OPTIONSFILE")
"$JAVA_HOME/bin/java" $OPTIONS org.apache.manifoldcf.jettyrunner.ManifoldCFCombinedJettyRunner
exit $?
else
echo "Working directory contains no properties.xml file." 1>&2
exit 1
fi
else
echo "Environment variable JAVA_HOME is not properly set." 1>&2
exit 1
fi
| Debug linux scripts -- part of CONNECTORS-862. | Debug linux scripts -- part of CONNECTORS-862.
git-svn-id: 4d319e5ed894aec93a653bc5b2159f21e28d8370@1559508 13f79535-47bb-0310-9956-ffa450edef68
| Shell | apache-2.0 | gladyscarrizales/manifoldcf,gladyscarrizales/manifoldcf,kishorejangid/manifoldcf,cogfor/mcf-cogfor,cogfor/mcf-cogfor,gladyscarrizales/manifoldcf,cogfor/mcf-cogfor,apache/manifoldcf,kishorejangid/manifoldcf,cogfor/mcf-cogfor,kishorejangid/manifoldcf,kishorejangid/manifoldcf,cogfor/mcf-cogfor,apache/manifoldcf,gladyscarrizales/manifoldcf,kishorejangid/manifoldcf,kishorejangid/manifoldcf,gladyscarrizales/manifoldcf,apache/manifoldcf,apache/manifoldcf,gladyscarrizales/manifoldcf,apache/manifoldcf,apache/manifoldcf,cogfor/mcf-cogfor | shell | ## Code Before:
if [[ $OSTYPE == "cygwin" ]] ; then
OPTIONSFILE="jetty-options.env.win"
else
OPTIONSFILE="jetty-options.env.unix"
fi
#Make sure environment variables are properly set
if [ -e "$JAVA_HOME"/bin/java ] ; then
if [ -f ./properties.xml ] ; then
# Build the global options
OPTIONS=$(cat "$OPTIONSFILE")
"$JAVA_HOME/bin/java" $OPTIONS org.apache.manifoldcf.jettyrunner.ManifoldCFCombinedJettyRunner
exit $?
else
echo "Working directory contains no properties.xml file." 1>&2
exit 1
fi
else
echo "Environment variable JAVA_HOME is not properly set." 1>&2
exit 1
fi
## Instruction:
Debug linux scripts -- part of CONNECTORS-862.
git-svn-id: 4d319e5ed894aec93a653bc5b2159f21e28d8370@1559508 13f79535-47bb-0310-9956-ffa450edef68
## Code After:
if [[ $OSTYPE == "cygwin" ]] ; then
OPTIONSFILE="combined-options.env.win"
else
OPTIONSFILE="combined-options.env.unix"
fi
#Make sure environment variables are properly set
if [ -e "$JAVA_HOME"/bin/java ] ; then
if [ -f ./properties.xml ] ; then
# Build the global options
OPTIONS=$(cat "$OPTIONSFILE")
"$JAVA_HOME/bin/java" $OPTIONS org.apache.manifoldcf.jettyrunner.ManifoldCFCombinedJettyRunner
exit $?
else
echo "Working directory contains no properties.xml file." 1>&2
exit 1
fi
else
echo "Environment variable JAVA_HOME is not properly set." 1>&2
exit 1
fi
|
d06474d106a4309e92f3489d2177743d4db95e45 | install/deploy.sh | install/deploy.sh | sudo apt-get -y remove mysql-server mysql-server-5.5 lighttpd php5-cgi php5-mysql
sudo apt-get -y remove bind9 bind9utils bind9-doc
sudo apt-get -y autoremove
sudo apt-get autoclean
sudo apt-get -y install lighttpd php5-cgi php5-mysql
#
# Bind configuration
#
sudo apt-get -y install bind9 bind9utils bind9-doc
sudo echo 'OPTIONS="-4 -u bind"' > /etc/default/bind9
sudo cp named.conf.options /etc/bind/named.conf.options
sudo echo "nameserver 127.0.0.1" > /etc/resolv.conf
sudo service bind9 restart
sudo cp db.99h.info /etc/bind/db.99h.info
sudo cp db.151 /etc/bind/db.151
sudo cp named.conf.local /etc/bind/named.conf.local
sudo service bind9 restart
sudo lighttpd-enable-mod fastcgi
sudo lighttpd-enable-mod fastcgi-php
sudo service lighttpd force-reload
echo "mysql-server-5.5 mysql-server/root_password password T00R" | sudo debconf-set-selections
echo "mysql-server-5.5 mysql-server/root_password_again password T00R" | sudo debconf-set-selections
sudo apt-get -y install mysql-server-5.5
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
|
PACKAGES="mysql-server-5.5 mysql-client lighttpd lighttpd-mod-mysql-vhost php5-cgi php5-mysql"
sudo apt-get -y remove $PACKAGES
sudo apt-get -y autoremove
sudo apt-get -y autoclean
sudo apt-get -y install $PACKAGES
#
# Bind configuration
#
# sudo bash bind9/deploy.sh
sudo lighttpd-enable-mod fastcgi
sudo lighttpd-enable-mod fastcgi-php
sudo service lighttpd force-reload
echo "mysql-server mysql-server/root_password password P@SSW0RD" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again password P@SSW0RD" | sudo debconf-set-selections
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
| Disable bind9 add MySQL vhosts | Disable bind9 add MySQL vhosts
| Shell | apache-2.0 | zahari/99h.info,zahari/99h.info | shell | ## Code Before:
sudo apt-get -y remove mysql-server mysql-server-5.5 lighttpd php5-cgi php5-mysql
sudo apt-get -y remove bind9 bind9utils bind9-doc
sudo apt-get -y autoremove
sudo apt-get autoclean
sudo apt-get -y install lighttpd php5-cgi php5-mysql
#
# Bind configuration
#
sudo apt-get -y install bind9 bind9utils bind9-doc
sudo echo 'OPTIONS="-4 -u bind"' > /etc/default/bind9
sudo cp named.conf.options /etc/bind/named.conf.options
sudo echo "nameserver 127.0.0.1" > /etc/resolv.conf
sudo service bind9 restart
sudo cp db.99h.info /etc/bind/db.99h.info
sudo cp db.151 /etc/bind/db.151
sudo cp named.conf.local /etc/bind/named.conf.local
sudo service bind9 restart
sudo lighttpd-enable-mod fastcgi
sudo lighttpd-enable-mod fastcgi-php
sudo service lighttpd force-reload
echo "mysql-server-5.5 mysql-server/root_password password T00R" | sudo debconf-set-selections
echo "mysql-server-5.5 mysql-server/root_password_again password T00R" | sudo debconf-set-selections
sudo apt-get -y install mysql-server-5.5
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
## Instruction:
Disable bind9 add MySQL vhosts
## Code After:
PACKAGES="mysql-server-5.5 mysql-client lighttpd lighttpd-mod-mysql-vhost php5-cgi php5-mysql"
sudo apt-get -y remove $PACKAGES
sudo apt-get -y autoremove
sudo apt-get -y autoclean
sudo apt-get -y install $PACKAGES
#
# Bind configuration
#
# sudo bash bind9/deploy.sh
sudo lighttpd-enable-mod fastcgi
sudo lighttpd-enable-mod fastcgi-php
sudo service lighttpd force-reload
echo "mysql-server mysql-server/root_password password P@SSW0RD" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again password P@SSW0RD" | sudo debconf-set-selections
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
|
66075f6de7de65e8b38d0b27a5a358cfddbbd2ee | spec/fixtures/dummy_rails_app/application.rb | spec/fixtures/dummy_rails_app/application.rb | Rails = Class.new do
require "#{File.dirname(__FILE__)}/dummy_app/fake"
def self.root
Pathname.new(File.dirname(__FILE__))
end
def self.env
'development'
end
end
| Rails = Class.new do
require_relative 'fake'
def self.root
Pathname.new(File.dirname(__FILE__))
end
def self.env
'development'
end
end
| Fix test which did not work in all cases. | Fix test which did not work in all cases. | Ruby | mit | quandl/quandl-config | ruby | ## Code Before:
Rails = Class.new do
require "#{File.dirname(__FILE__)}/dummy_app/fake"
def self.root
Pathname.new(File.dirname(__FILE__))
end
def self.env
'development'
end
end
## Instruction:
Fix test which did not work in all cases.
## Code After:
Rails = Class.new do
require_relative 'fake'
def self.root
Pathname.new(File.dirname(__FILE__))
end
def self.env
'development'
end
end
|
1b1022d4621484fdf56838d9a004e8d47cbd6483 | .travis.yml | .travis.yml | language: go
go_import_path: github.com/99designs/keyring
install:
- go get -u github.com/kardianos/govendor
- govendor status
go:
- "1.8.x"
- "1.9.x"
- "1.10.x"
- "master"
os:
- linux
- osx
osx_image: xcode7.3
| language: go
go:
- "1.10.x"
- "1.11.x"
os:
- linux
- osx
before_install:
- go get -u github.com/kardianos/govendor
script:
- govendor status
- diff -u <(echo -n) <(gofmt -d $(git ls-files '*.go' | grep -v ^vendor/))
- go vet ./...
- go test -race ./...
| Remove CI testing for go 1.8, 1.9. Add lints and tests | Remove CI testing for go 1.8, 1.9. Add lints and tests
| YAML | mit | 99designs/keyring,99designs/keyring | yaml | ## Code Before:
language: go
go_import_path: github.com/99designs/keyring
install:
- go get -u github.com/kardianos/govendor
- govendor status
go:
- "1.8.x"
- "1.9.x"
- "1.10.x"
- "master"
os:
- linux
- osx
osx_image: xcode7.3
## Instruction:
Remove CI testing for go 1.8, 1.9. Add lints and tests
## Code After:
language: go
go:
- "1.10.x"
- "1.11.x"
os:
- linux
- osx
before_install:
- go get -u github.com/kardianos/govendor
script:
- govendor status
- diff -u <(echo -n) <(gofmt -d $(git ls-files '*.go' | grep -v ^vendor/))
- go vet ./...
- go test -race ./...
|
effd24c64c2d59195b2d688bd9b6032f1dadaabb | app.json | app.json | {
"name": "Tetris clone in Elm",
"repository": "https://github.com/chendrix/elm-tetris",
"env": {
"BUILDPACK_URL": "https://github.com/srid/heroku-buildpack-elm.git",
"ELM_COMPILE": "make clean compile",
"ELM_STATIC_DIR": "."
}
} | {
"name": "Tetris clone in Elm",
"repository": "https://github.com/chendrix/elm-tetris",
"env": {
"BUILDPACK_URL": "https://github.com/srid/heroku-buildpack-elm.git",
"ELM_COMPILE": "make",
"ELM_STATIC_DIR": "."
}
} | Use base make for heroku | Use base make for heroku
| JSON | mit | chendrix/elm-tetris | json | ## Code Before:
{
"name": "Tetris clone in Elm",
"repository": "https://github.com/chendrix/elm-tetris",
"env": {
"BUILDPACK_URL": "https://github.com/srid/heroku-buildpack-elm.git",
"ELM_COMPILE": "make clean compile",
"ELM_STATIC_DIR": "."
}
}
## Instruction:
Use base make for heroku
## Code After:
{
"name": "Tetris clone in Elm",
"repository": "https://github.com/chendrix/elm-tetris",
"env": {
"BUILDPACK_URL": "https://github.com/srid/heroku-buildpack-elm.git",
"ELM_COMPILE": "make",
"ELM_STATIC_DIR": "."
}
} |
143e2a2b82cec2cd777822748fd9f0ec0aac1d3a | src/test/scala/doc/jockey/horse/StringsInPatternMatchingSpec.scala | src/test/scala/doc/jockey/horse/StringsInPatternMatchingSpec.scala | package doc.jockey.horse
import org.scalatest.WordSpec
class StringsInPatternMatchingSpec extends WordSpec {
implicit class MySContext(val sc: StringContext) {
// this will not work, because the compiler thinks that s is special
case class s(args: Any*) {
def unapplySeq(s: String): Option[Seq[String]] = {
val regexp = sc.parts.mkString("(.+)").r
regexp.unapplySeq(s)
}
}
object url {
def unapplySeq(s: String): Option[Seq[String]] = {
val regexp = sc.parts.mkString("(.+)").r
regexp.unapplySeq(s)
}
}
val url2 = sc.parts.mkString("(.+)").r
}
"We can pattern match in interpolated Strings" in {
def matcher: PartialFunction[String, String] = {
case url2"this ${a} is a simple ${b}" => s"Matched: $a, $b"
case url"/dj/$a/$b" => s"Matched: $a, $b"
case x => "Did not match anything"
}
assert(matcher("this sentence is a simple string") === "Matched: sentence, string")
assert(matcher("/dj/investment/StockAnalyser") === "Matched: investment, StockAnalyser")
}
"We can pattern match in interpolated Strings inside Tim's HTTP DSL" in {
case class GET(x: String)
def matcher: PartialFunction[GET, String] = {
case GET(url"/trade/$tradeID/message/$messageID") => s"Matched: $tradeID, $messageID" //processTradeMEssage(tradeId, messageId)
case x => "It fucked up"
}
assert(matcher(GET("/trade/123/message/456")) === "Matched: 123, 456")
}
} | package doc.jockey.horse
import org.scalatest.WordSpec
class StringsInPatternMatchingSpec extends WordSpec {
implicit class PatternMatchableUrlAdapter(val sc: StringContext) {
val url = sc.parts.mkString("(.+)").r
}
"We can pattern match in interpolated Strings" in {
def matcher: PartialFunction[String, String] = {
case url"this ${a} is a simple ${b}" => s"Matched: $a, $b"
case url"/dj/$a/$b" => s"Matched: $a, $b"
case x => "Did not match anything"
}
assert(matcher("this sentence is a simple string") === "Matched: sentence, string")
assert(matcher("/dj/investment/StockAnalyser") === "Matched: investment, StockAnalyser")
}
"We can pattern match in interpolated Strings inside Tim's HTTP DSL" in {
case class GET(x: String)
def matcher: PartialFunction[GET, String] = {
case GET(url"/trade/$tradeID/message/$messageID") => s"Matched: $tradeID, $messageID" //processTradeMEssage(tradeId, messageId)
case x => "It fucked up"
}
assert(matcher(GET("/trade/123/message/456")) === "Matched: 123, 456")
}
} | Add NanoHTTPD to play with | Add NanoHTTPD to play with
| Scala | mit | agmenc/doc-jockey | scala | ## Code Before:
package doc.jockey.horse
import org.scalatest.WordSpec
class StringsInPatternMatchingSpec extends WordSpec {
implicit class MySContext(val sc: StringContext) {
// this will not work, because the compiler thinks that s is special
case class s(args: Any*) {
def unapplySeq(s: String): Option[Seq[String]] = {
val regexp = sc.parts.mkString("(.+)").r
regexp.unapplySeq(s)
}
}
object url {
def unapplySeq(s: String): Option[Seq[String]] = {
val regexp = sc.parts.mkString("(.+)").r
regexp.unapplySeq(s)
}
}
val url2 = sc.parts.mkString("(.+)").r
}
"We can pattern match in interpolated Strings" in {
def matcher: PartialFunction[String, String] = {
case url2"this ${a} is a simple ${b}" => s"Matched: $a, $b"
case url"/dj/$a/$b" => s"Matched: $a, $b"
case x => "Did not match anything"
}
assert(matcher("this sentence is a simple string") === "Matched: sentence, string")
assert(matcher("/dj/investment/StockAnalyser") === "Matched: investment, StockAnalyser")
}
"We can pattern match in interpolated Strings inside Tim's HTTP DSL" in {
case class GET(x: String)
def matcher: PartialFunction[GET, String] = {
case GET(url"/trade/$tradeID/message/$messageID") => s"Matched: $tradeID, $messageID" //processTradeMEssage(tradeId, messageId)
case x => "It fucked up"
}
assert(matcher(GET("/trade/123/message/456")) === "Matched: 123, 456")
}
}
## Instruction:
Add NanoHTTPD to play with
## Code After:
package doc.jockey.horse
import org.scalatest.WordSpec
class StringsInPatternMatchingSpec extends WordSpec {
implicit class PatternMatchableUrlAdapter(val sc: StringContext) {
val url = sc.parts.mkString("(.+)").r
}
"We can pattern match in interpolated Strings" in {
def matcher: PartialFunction[String, String] = {
case url"this ${a} is a simple ${b}" => s"Matched: $a, $b"
case url"/dj/$a/$b" => s"Matched: $a, $b"
case x => "Did not match anything"
}
assert(matcher("this sentence is a simple string") === "Matched: sentence, string")
assert(matcher("/dj/investment/StockAnalyser") === "Matched: investment, StockAnalyser")
}
"We can pattern match in interpolated Strings inside Tim's HTTP DSL" in {
case class GET(x: String)
def matcher: PartialFunction[GET, String] = {
case GET(url"/trade/$tradeID/message/$messageID") => s"Matched: $tradeID, $messageID" //processTradeMEssage(tradeId, messageId)
case x => "It fucked up"
}
assert(matcher(GET("/trade/123/message/456")) === "Matched: 123, 456")
}
} |
d60db37ad3e1899cbad61b1edcff03a59e7ad8ff | common/perllib/share/b2bua/services/freeswitch/conf/dialplan/template/redirect-with-media.xml | common/perllib/share/b2bua/services/freeswitch/conf/dialplan/template/redirect-with-media.xml | <?xml version="1.0" encoding="utf-8"?>
<include>
<context name="ingress-$${profile_name}">
<extension name="unloop">
<condition field="${unroll_loops}" expression="^true$"/>
<condition field="${sip_looped_call}" expression="^true$">
<action application="deflect" data="${destination_number}"/>
</condition>
</extension>
<extension name="redirect">
<condition field="destination_number" expression="^(\d+)$">
<action application="pre_answer"/> <!-- 183: lock the SDP here -->
<action application="gentones" data="%(2000,4000,440,480)"/> <!-- ringback -->
<action application="set" data="ccnq_account=${regex(${sip_req_params}|account=([^;]*)|%1)}"/>
<action application="set" data="ccnq_account_sub=${regex(${sip_req_params}|account_sub=([^;]*)|%1)}"/>
<action application="bridge" data="sofia/sbc-$${profile_name}/${destination_number}@$${egress_target};account=${ccnq_account};account_sub=${ccnq_account_sub}"/>
</condition>
</extension>
</context>
</include>
| <?xml version="1.0" encoding="utf-8"?>
<include>
<context name="ingress-$${profile_name}">
<extension name="unloop">
<condition field="${unroll_loops}" expression="^true$"/>
<condition field="${sip_looped_call}" expression="^true$">
<action application="deflect" data="${destination_number}"/>
</condition>
</extension>
<extension name="redirect">
<condition field="destination_number" expression="^(\d+)$">
<action application="pre_answer"/> <!-- 183: lock the SDP here -->
<action application="gentones" data="%(2000,4000,440,480)"/> <!-- ringback -->
<action application="set" data="ccnq_account=${regex(${sip_req_params}|account=([^;]*)|%1)}"/>
<action application="set" data="ccnq_account_sub=${regex(${sip_req_params}|account_sub=([^;]*)|%1)}"/>
<action application="set" data="instant_ringback=true"/>
<action application="set" data="ringback=$${us-ring}"/>
<action application="bridge" data="sofia/sbc-$${profile_name}/${destination_number}@$${egress_target};account=${ccnq_account};account_sub=${ccnq_account_sub}"/>
</condition>
</extension>
</context>
</include>
| Work around lack of ringback issue. When receiving a 180 from the far-end, bridge would stop the ringback tone. | Work around lack of ringback issue. When receiving a 180 from the far-end, bridge would stop the ringback tone.
| XML | agpl-3.0 | shimaore/ccnq2.0,shimaore/ccnq2.0,shimaore/ccnq2.0 | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<include>
<context name="ingress-$${profile_name}">
<extension name="unloop">
<condition field="${unroll_loops}" expression="^true$"/>
<condition field="${sip_looped_call}" expression="^true$">
<action application="deflect" data="${destination_number}"/>
</condition>
</extension>
<extension name="redirect">
<condition field="destination_number" expression="^(\d+)$">
<action application="pre_answer"/> <!-- 183: lock the SDP here -->
<action application="gentones" data="%(2000,4000,440,480)"/> <!-- ringback -->
<action application="set" data="ccnq_account=${regex(${sip_req_params}|account=([^;]*)|%1)}"/>
<action application="set" data="ccnq_account_sub=${regex(${sip_req_params}|account_sub=([^;]*)|%1)}"/>
<action application="bridge" data="sofia/sbc-$${profile_name}/${destination_number}@$${egress_target};account=${ccnq_account};account_sub=${ccnq_account_sub}"/>
</condition>
</extension>
</context>
</include>
## Instruction:
Work around lack of ringback issue. When receiving a 180 from the far-end, bridge would stop the ringback tone.
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<include>
<context name="ingress-$${profile_name}">
<extension name="unloop">
<condition field="${unroll_loops}" expression="^true$"/>
<condition field="${sip_looped_call}" expression="^true$">
<action application="deflect" data="${destination_number}"/>
</condition>
</extension>
<extension name="redirect">
<condition field="destination_number" expression="^(\d+)$">
<action application="pre_answer"/> <!-- 183: lock the SDP here -->
<action application="gentones" data="%(2000,4000,440,480)"/> <!-- ringback -->
<action application="set" data="ccnq_account=${regex(${sip_req_params}|account=([^;]*)|%1)}"/>
<action application="set" data="ccnq_account_sub=${regex(${sip_req_params}|account_sub=([^;]*)|%1)}"/>
<action application="set" data="instant_ringback=true"/>
<action application="set" data="ringback=$${us-ring}"/>
<action application="bridge" data="sofia/sbc-$${profile_name}/${destination_number}@$${egress_target};account=${ccnq_account};account_sub=${ccnq_account_sub}"/>
</condition>
</extension>
</context>
</include>
|
ab983e0a806d09728b08aff17c165450c4ec5de5 | setup.cfg | setup.cfg | [metadata]
name = concurrently
# version = < see setup.py >
description = Library helps easy write concurrent executed code blocks
long_description = file: README.rst
url = https://github.com/sirkonst/concurrently
author = Konstantin Enchant
author-email = sirkonst@gmail.com
maintainer = Konstantin Enchant
maintainer_email = sirkonst@gmail.com
keywords = concurrent, thread, threading, process, multiprocessing, asyncio, gevent
classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Natural Language :: English
Natural Language :: Russian
Operating System :: OS Independent
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Topic :: Software Development :: Libraries
[options]
python_requires = >=3.5
packages = find: concurrently
[options.extras_require]
gevent =
gevent
develop =
wheel
twine
docutils
tox
pytest
pytest-asyncio
coverage
Sphinx
gevent
| [metadata]
name = concurrently
# version = < see setup.py >
description = Library helps easy write concurrent executed code blocks
long_description = file: README.rst
url = https://github.com/sirkonst/concurrently
author = Konstantin Enchant
author-email = sirkonst@gmail.com
maintainer = Konstantin Enchant
maintainer_email = sirkonst@gmail.com
keywords = concurrent, thread, threading, process, multiprocessing, asyncio, gevent
classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Natural Language :: English
Natural Language :: Russian
Operating System :: OS Independent
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Topic :: Software Development :: Libraries
[options]
python_requires = >=3.5
packages = find: concurrently
[options.extras_require]
gevent =
gevent
develop =
wheel
twine
tox
pytest
pytest-asyncio
coverage
Sphinx
gevent
| Use docutils as implied dependence from Sphinx | Use docutils as implied dependence from Sphinx
| INI | mit | sirkonst/concurrently | ini | ## Code Before:
[metadata]
name = concurrently
# version = < see setup.py >
description = Library helps easy write concurrent executed code blocks
long_description = file: README.rst
url = https://github.com/sirkonst/concurrently
author = Konstantin Enchant
author-email = sirkonst@gmail.com
maintainer = Konstantin Enchant
maintainer_email = sirkonst@gmail.com
keywords = concurrent, thread, threading, process, multiprocessing, asyncio, gevent
classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Natural Language :: English
Natural Language :: Russian
Operating System :: OS Independent
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Topic :: Software Development :: Libraries
[options]
python_requires = >=3.5
packages = find: concurrently
[options.extras_require]
gevent =
gevent
develop =
wheel
twine
docutils
tox
pytest
pytest-asyncio
coverage
Sphinx
gevent
## Instruction:
Use docutils as implied dependence from Sphinx
## Code After:
[metadata]
name = concurrently
# version = < see setup.py >
description = Library helps easy write concurrent executed code blocks
long_description = file: README.rst
url = https://github.com/sirkonst/concurrently
author = Konstantin Enchant
author-email = sirkonst@gmail.com
maintainer = Konstantin Enchant
maintainer_email = sirkonst@gmail.com
keywords = concurrent, thread, threading, process, multiprocessing, asyncio, gevent
classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Natural Language :: English
Natural Language :: Russian
Operating System :: OS Independent
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Topic :: Software Development :: Libraries
[options]
python_requires = >=3.5
packages = find: concurrently
[options.extras_require]
gevent =
gevent
develop =
wheel
twine
tox
pytest
pytest-asyncio
coverage
Sphinx
gevent
|
efa9efed5b1ea1aa1a9fd76ce496efba5a5c07e9 | spec/spec_helper.rb | spec/spec_helper.rb | require 'erb_helper'
require 'bundler/setup'
require 'vcloud/net_launcher'
| require 'erb_helper'
require 'bundler/setup'
require 'vcloud/net_launcher'
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
| Disable `should` syntax in Rspec | Disable `should` syntax in Rspec
`should` syntax is deprecated as of Rspec version 3.0 and the previous
commit converts all of our tests to use `expect` for consistency.
To prevent regressions, this change disables `should` syntax for this
gem.
| Ruby | mit | gds-operations/vcloud-net_launcher,gds-operations/vcloud-net_launcher,gds-operations/vcloud-net_launcher | ruby | ## Code Before:
require 'erb_helper'
require 'bundler/setup'
require 'vcloud/net_launcher'
## Instruction:
Disable `should` syntax in Rspec
`should` syntax is deprecated as of Rspec version 3.0 and the previous
commit converts all of our tests to use `expect` for consistency.
To prevent regressions, this change disables `should` syntax for this
gem.
## Code After:
require 'erb_helper'
require 'bundler/setup'
require 'vcloud/net_launcher'
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
|
b28caec8eb1c88b130e779ee7cf615f88b54332f | src/js/utils/ReactSVG.js | src/js/utils/ReactSVG.js | var DOMProperty = require('react/lib/DOMProperty');
var svgAttrs = ['dominant-baseline', 'shape-rendering', 'mask'];
// hack for getting react to render svg attributes
DOMProperty.injection.injectDOMPropertyConfig({
isCustomAttribute: function (attribute) {
return svgAttrs.includes(attribute);
}
});
| var DOMProperty = require('react/lib/DOMProperty');
var svgAttrs = ['dominant-baseline', 'shape-rendering', 'mask'];
// hack for getting react to render svg attributes
DOMProperty.injection.injectDOMPropertyConfig({
DOMAttributeNames: {
fillRule: 'fill-rule'
},
isCustomAttribute: function (attribute) {
return svgAttrs.includes(attribute);
},
Properties: {
fillRule: DOMProperty.injection.MUST_USE_ATTRIBUTE
}
});
| Transform fillRule attribute to fill-rule | Transform fillRule attribute to fill-rule
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui | javascript | ## Code Before:
var DOMProperty = require('react/lib/DOMProperty');
var svgAttrs = ['dominant-baseline', 'shape-rendering', 'mask'];
// hack for getting react to render svg attributes
DOMProperty.injection.injectDOMPropertyConfig({
isCustomAttribute: function (attribute) {
return svgAttrs.includes(attribute);
}
});
## Instruction:
Transform fillRule attribute to fill-rule
## Code After:
var DOMProperty = require('react/lib/DOMProperty');
var svgAttrs = ['dominant-baseline', 'shape-rendering', 'mask'];
// hack for getting react to render svg attributes
DOMProperty.injection.injectDOMPropertyConfig({
DOMAttributeNames: {
fillRule: 'fill-rule'
},
isCustomAttribute: function (attribute) {
return svgAttrs.includes(attribute);
},
Properties: {
fillRule: DOMProperty.injection.MUST_USE_ATTRIBUTE
}
});
|
ea4acb3314fe282fcfac31f36f5653c81806d2f7 | app/services/publisher_domain_normalizer.rb | app/services/publisher_domain_normalizer.rb | class PublisherDomainNormalizer < BaseApiClient
attr_reader :domain
def initialize(domain:)
# normalize domain by stripping off the protocol, it it exists,
# and checking if it parses as an http URL
host_and_path = domain.split(/:\/\//).last
URI.parse("http://#{host_and_path}")
@domain = host_and_path
end
def perform
return perform_offline if Rails.application.secrets[:api_ledger_offline]
url = "http://#{domain}"
response = connection.get do |request|
request.params["url"] = url
request.url("/v2/publisher/identity")
end
response_h = JSON.parse(response.body)
# If the normalized publisher ID is missing, it's on the exclusion list.
if response_h.include?("publisher")
response_h["publisher"]
else
raise DomainExclusionError.new("Normalized publisher ID unavailable for #{url}")
end
end
def perform_offline
# Development Gemfile group. If you run in prod move the gem to the top level.
require "domain_name"
Rails.logger.info("PublisherDomainNormalizer normalizing offline.")
begin
DomainName(domain).domain
rescue => e
raise OfflineNormalizationError.new(e)
end
end
private
def api_base_uri
Rails.application.secrets[:api_ledger_base_uri]
end
class DomainExclusionError < RuntimeError
end
class OfflineNormalizationError < RuntimeError
end
end
| class PublisherDomainNormalizer < BaseApiClient
attr_reader :domain
def initialize(domain:)
# normalize domain by stripping off the protocol, it it exists,
# and checking if it parses as an http URL
host_and_path = domain.split(/:\/\//).last
URI.parse("http://#{host_and_path}")
@domain = host_and_path
end
def perform
return perform_offline if Rails.application.secrets[:api_ledger_offline]
url = "http://#{domain}"
response = connection.get do |request|
request.params["url"] = url
request.url("/v2/publisher/identity")
end
response_h = JSON.parse(response.body)
# If the normalized publisher ID is missing, it's on the exclusion list.
if response_h.include?("publisher")
response_h["publisher"]
else
raise DomainExclusionError.new("Normalized publisher ID unavailable for #{url}")
end
end
def perform_offline
# Development Gemfile group. If you run in prod move the gem to the top level.
require "domain_name"
Rails.logger.info("PublisherDomainNormalizer normalizing offline.")
domain_name = DomainName(domain)
unless domain_name.canonical_tld?
raise DomainExclusionError.new("Normalized publisher ID unavailable for #{domain}")
end
domain_name.hostname
end
private
def api_base_uri
Rails.application.secrets[:api_ledger_base_uri]
end
class DomainExclusionError < RuntimeError
end
class OfflineNormalizationError < RuntimeError
end
end
| Improve offline mode of PublisherDomainNormalizer | Improve offline mode of PublisherDomainNormalizer
| Ruby | mpl-2.0 | dgeb/publishers,brave/publishers,dgeb/publishers,dgeb/publishers,brave/publishers,brave/publishers | ruby | ## Code Before:
class PublisherDomainNormalizer < BaseApiClient
attr_reader :domain
def initialize(domain:)
# normalize domain by stripping off the protocol, it it exists,
# and checking if it parses as an http URL
host_and_path = domain.split(/:\/\//).last
URI.parse("http://#{host_and_path}")
@domain = host_and_path
end
def perform
return perform_offline if Rails.application.secrets[:api_ledger_offline]
url = "http://#{domain}"
response = connection.get do |request|
request.params["url"] = url
request.url("/v2/publisher/identity")
end
response_h = JSON.parse(response.body)
# If the normalized publisher ID is missing, it's on the exclusion list.
if response_h.include?("publisher")
response_h["publisher"]
else
raise DomainExclusionError.new("Normalized publisher ID unavailable for #{url}")
end
end
def perform_offline
# Development Gemfile group. If you run in prod move the gem to the top level.
require "domain_name"
Rails.logger.info("PublisherDomainNormalizer normalizing offline.")
begin
DomainName(domain).domain
rescue => e
raise OfflineNormalizationError.new(e)
end
end
private
def api_base_uri
Rails.application.secrets[:api_ledger_base_uri]
end
class DomainExclusionError < RuntimeError
end
class OfflineNormalizationError < RuntimeError
end
end
## Instruction:
Improve offline mode of PublisherDomainNormalizer
## Code After:
class PublisherDomainNormalizer < BaseApiClient
attr_reader :domain
def initialize(domain:)
# normalize domain by stripping off the protocol, it it exists,
# and checking if it parses as an http URL
host_and_path = domain.split(/:\/\//).last
URI.parse("http://#{host_and_path}")
@domain = host_and_path
end
def perform
return perform_offline if Rails.application.secrets[:api_ledger_offline]
url = "http://#{domain}"
response = connection.get do |request|
request.params["url"] = url
request.url("/v2/publisher/identity")
end
response_h = JSON.parse(response.body)
# If the normalized publisher ID is missing, it's on the exclusion list.
if response_h.include?("publisher")
response_h["publisher"]
else
raise DomainExclusionError.new("Normalized publisher ID unavailable for #{url}")
end
end
def perform_offline
# Development Gemfile group. If you run in prod move the gem to the top level.
require "domain_name"
Rails.logger.info("PublisherDomainNormalizer normalizing offline.")
domain_name = DomainName(domain)
unless domain_name.canonical_tld?
raise DomainExclusionError.new("Normalized publisher ID unavailable for #{domain}")
end
domain_name.hostname
end
private
def api_base_uri
Rails.application.secrets[:api_ledger_base_uri]
end
class DomainExclusionError < RuntimeError
end
class OfflineNormalizationError < RuntimeError
end
end
|
2138f9c64d4b02828318e57b69f4b20f16ed34e3 | attributes/default.rb | attributes/default.rb | default['boulder']['config']['boulder-config']['va']['portConfig']['httpPort'] = 80
default['boulder']['config']['boulder-config']['va']['portConfig']['httpsPort'] = 443
default['boulder']['config']['boulder-config']['va']['portConfig']['tlsPort'] = 443
default['boulder']['config']['boulder-config']['syslog']['network'] = 'udp'
default['boulder']['config']['boulder-config']['syslog']['server'] = 'localhost:514'
# Default 8000 port is needed by Atlassian apps.
default['boulder']['config']['boulder-config']['wfe']['debugAddr'] = 'localhost:7999'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['network'] = 'udp'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['server'] = 'localhost:514'
| default['boulder']['config']['boulder-config']['va']['portConfig']['httpPort'] = 80
default['boulder']['config']['boulder-config']['va']['portConfig']['httpsPort'] = 443
default['boulder']['config']['boulder-config']['va']['portConfig']['tlsPort'] = 443
default['boulder']['config']['boulder-config']['syslog']['network'] = 'udp'
default['boulder']['config']['boulder-config']['syslog']['server'] = 'localhost:514'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['network'] = 'udp'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['server'] = 'localhost:514'
| Remove personal customization from attributes. | Remove personal customization from attributes.
| Ruby | mit | patcon/chef-letsencrypt-boulder-server | ruby | ## Code Before:
default['boulder']['config']['boulder-config']['va']['portConfig']['httpPort'] = 80
default['boulder']['config']['boulder-config']['va']['portConfig']['httpsPort'] = 443
default['boulder']['config']['boulder-config']['va']['portConfig']['tlsPort'] = 443
default['boulder']['config']['boulder-config']['syslog']['network'] = 'udp'
default['boulder']['config']['boulder-config']['syslog']['server'] = 'localhost:514'
# Default 8000 port is needed by Atlassian apps.
default['boulder']['config']['boulder-config']['wfe']['debugAddr'] = 'localhost:7999'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['network'] = 'udp'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['server'] = 'localhost:514'
## Instruction:
Remove personal customization from attributes.
## Code After:
default['boulder']['config']['boulder-config']['va']['portConfig']['httpPort'] = 80
default['boulder']['config']['boulder-config']['va']['portConfig']['httpsPort'] = 443
default['boulder']['config']['boulder-config']['va']['portConfig']['tlsPort'] = 443
default['boulder']['config']['boulder-config']['syslog']['network'] = 'udp'
default['boulder']['config']['boulder-config']['syslog']['server'] = 'localhost:514'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['network'] = 'udp'
default['boulder']['config']['issuer-ocsp-responder']['syslog']['server'] = 'localhost:514'
|
187b21e0c70cd78625ca8eaf1db16a57148f1948 | db/migration.sql | db/migration.sql | -- 2015-11-27
alter table bookmarks add column notes text;
| -- 2015-11-27
ALTER TABLE "bookmarks" ADD COLUMN `notes` TEXT;
| Change case of SQL statement to be more SQLey | Change case of SQL statement to be more SQLey
| SQL | apache-2.0 | nobbyknox/malachite,nobbyknox/malachite | sql | ## Code Before:
-- 2015-11-27
alter table bookmarks add column notes text;
## Instruction:
Change case of SQL statement to be more SQLey
## Code After:
-- 2015-11-27
ALTER TABLE "bookmarks" ADD COLUMN `notes` TEXT;
|
61462a942bf814aa4458b100344af6d80e3230e7 | providers/rule.rb | providers/rule.rb | class Chef::Provider::UlimitRule < Chef::Provider
def load_current_resource
new_resource.domain new_resource.domain.domain_name if new_resource.domain.is_a?(Chef::Resource)
node.run_state[:ulimit] ||= Mash.new
node.run_state[:ulimit][new_resource.domain] ||= Mash.new
end
action :create do # ~FC017
node.run_state[:ulimit][new_resource.domain][new_resource.item] ||= Mash.new
node.run_state[:ulimit][new_resource.domain][new_resource.item][new_resource.type] = new_resource.value
end
action :delete do
# NOOP
end
end
| class Chef::Provider::UlimitRule < Chef::Provider
def load_current_resource
new_resource.domain new_resource.domain.domain_name if new_resource.domain.is_a?(Chef::Resource)
node.run_state[:ulimit] ||= Mash.new
node.run_state[:ulimit][new_resource.domain] ||= Mash.new
end
use_inline_resources
action :create do # ~FC017
node.run_state[:ulimit][new_resource.domain][new_resource.item] ||= Mash.new
node.run_state[:ulimit][new_resource.domain][new_resource.item][new_resource.type] = new_resource.value
end
action :delete do
# NOOP
end
end
| Fix undefined method action for Chef::Provider::UlimitRule:Class | Fix undefined method action for Chef::Provider::UlimitRule:Class
| Ruby | apache-2.0 | bmhatfield/chef-ulimit,bmhatfield/chef-ulimit | ruby | ## Code Before:
class Chef::Provider::UlimitRule < Chef::Provider
def load_current_resource
new_resource.domain new_resource.domain.domain_name if new_resource.domain.is_a?(Chef::Resource)
node.run_state[:ulimit] ||= Mash.new
node.run_state[:ulimit][new_resource.domain] ||= Mash.new
end
action :create do # ~FC017
node.run_state[:ulimit][new_resource.domain][new_resource.item] ||= Mash.new
node.run_state[:ulimit][new_resource.domain][new_resource.item][new_resource.type] = new_resource.value
end
action :delete do
# NOOP
end
end
## Instruction:
Fix undefined method action for Chef::Provider::UlimitRule:Class
## Code After:
class Chef::Provider::UlimitRule < Chef::Provider
def load_current_resource
new_resource.domain new_resource.domain.domain_name if new_resource.domain.is_a?(Chef::Resource)
node.run_state[:ulimit] ||= Mash.new
node.run_state[:ulimit][new_resource.domain] ||= Mash.new
end
use_inline_resources
action :create do # ~FC017
node.run_state[:ulimit][new_resource.domain][new_resource.item] ||= Mash.new
node.run_state[:ulimit][new_resource.domain][new_resource.item][new_resource.type] = new_resource.value
end
action :delete do
# NOOP
end
end
|
1d6670165dd74084813b38032cfddb6d33cd9d7a | xdc-plugin/tests/compare_output_json.py | xdc-plugin/tests/compare_output_json.py |
import sys
import json
parameters = ["IOSTANDARD", "DRIVE", "SLEW", "IN_TERM"]
def read_cells(json_file):
with open(json_file) as f:
data = json.load(f)
f.close()
cells = data['modules']['top']['cells']
cells_parameters = dict()
for cell, opts in cells.items():
attributes = opts['parameters']
if len(attributes.keys()):
if any([x in parameters for x in attributes.keys()]):
cells_parameters[cell] = attributes
return cells_parameters
def main():
if len(sys.argv) < 3:
print("Incorrect number of arguments")
exit(1)
cells1 = read_cells(sys.argv[1])
cells2 = read_cells(sys.argv[2])
if cells1 == cells2:
exit(0)
else:
print(json.dumps(cells1, indent=4))
print("VS")
print(json.dumps(cells2, indent=4))
exit(1)
if __name__ == "__main__":
main()
|
import sys
import json
import argparse
parameters = ["IOSTANDARD", "DRIVE", "SLEW", "IN_TERM"]
def read_cells(json_file):
with open(json_file) as f:
data = json.load(f)
f.close()
cells = data['modules']['top']['cells']
cells_parameters = dict()
for cell, opts in cells.items():
attributes = opts['parameters']
if len(attributes.keys()):
if any([x in parameters for x in attributes.keys()]):
cells_parameters[cell] = attributes
return cells_parameters
def main(args):
cells = read_cells(args.json)
if args.update:
with open(args.golden, 'w') as f:
json.dump(cells, f)
else:
with open(args.golden) as f:
cells_golden = json.load(f)
if cells == cells_golden:
exit(0)
else:
print(json.dumps(cells, indent=4))
print("VS")
print(json.dumps(cells_golden, indent=4))
exit(1)
f.close()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--json', help = 'JSON to compare', required = True)
parser.add_argument('--golden', help = 'Golden JSON file', required = True)
parser.add_argument('--update', action = 'store_true', help = 'Update golden reference')
args = parser.parse_args()
main(args)
| Refactor test output comparison script | XDC: Refactor test output comparison script
Signed-off-by: Tomasz Michalak <a2fdaa543b4cc5e3d6cd8672ec412c0eb393b86e@antmicro.com>
| Python | apache-2.0 | SymbiFlow/yosys-f4pga-plugins,SymbiFlow/yosys-f4pga-plugins,chipsalliance/yosys-f4pga-plugins,SymbiFlow/yosys-f4pga-plugins,chipsalliance/yosys-f4pga-plugins,SymbiFlow/yosys-symbiflow-plugins,antmicro/yosys-symbiflow-plugins,antmicro/yosys-symbiflow-plugins,SymbiFlow/yosys-symbiflow-plugins,antmicro/yosys-symbiflow-plugins,SymbiFlow/yosys-symbiflow-plugins | python | ## Code Before:
import sys
import json
parameters = ["IOSTANDARD", "DRIVE", "SLEW", "IN_TERM"]
def read_cells(json_file):
with open(json_file) as f:
data = json.load(f)
f.close()
cells = data['modules']['top']['cells']
cells_parameters = dict()
for cell, opts in cells.items():
attributes = opts['parameters']
if len(attributes.keys()):
if any([x in parameters for x in attributes.keys()]):
cells_parameters[cell] = attributes
return cells_parameters
def main():
if len(sys.argv) < 3:
print("Incorrect number of arguments")
exit(1)
cells1 = read_cells(sys.argv[1])
cells2 = read_cells(sys.argv[2])
if cells1 == cells2:
exit(0)
else:
print(json.dumps(cells1, indent=4))
print("VS")
print(json.dumps(cells2, indent=4))
exit(1)
if __name__ == "__main__":
main()
## Instruction:
XDC: Refactor test output comparison script
Signed-off-by: Tomasz Michalak <a2fdaa543b4cc5e3d6cd8672ec412c0eb393b86e@antmicro.com>
## Code After:
import sys
import json
import argparse
parameters = ["IOSTANDARD", "DRIVE", "SLEW", "IN_TERM"]
def read_cells(json_file):
with open(json_file) as f:
data = json.load(f)
f.close()
cells = data['modules']['top']['cells']
cells_parameters = dict()
for cell, opts in cells.items():
attributes = opts['parameters']
if len(attributes.keys()):
if any([x in parameters for x in attributes.keys()]):
cells_parameters[cell] = attributes
return cells_parameters
def main(args):
cells = read_cells(args.json)
if args.update:
with open(args.golden, 'w') as f:
json.dump(cells, f)
else:
with open(args.golden) as f:
cells_golden = json.load(f)
if cells == cells_golden:
exit(0)
else:
print(json.dumps(cells, indent=4))
print("VS")
print(json.dumps(cells_golden, indent=4))
exit(1)
f.close()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--json', help = 'JSON to compare', required = True)
parser.add_argument('--golden', help = 'Golden JSON file', required = True)
parser.add_argument('--update', action = 'store_true', help = 'Update golden reference')
args = parser.parse_args()
main(args)
|
36cac11960be6177aa6031dad621a749971a327e | spec/hive_spec.rb | spec/hive_spec.rb | require 'spec_helper'
describe 'hadoop::hive' do
context 'on Centos 6.4 x86_64' do
let(:chef_run) do
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node|
node.automatic['domain'] = 'example.com'
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false)
stub_command('update-alternatives --display hive-conf | grep best | awk \'{print $5}\' | grep /etc/hive/conf.chef').and_return(false)
end.converge(described_recipe)
end
it 'install hive package' do
expect(chef_run).to install_package('hive')
end
end
end
| require 'spec_helper'
describe 'hadoop::hive' do
context 'on Centos 6.4 x86_64' do
let(:chef_run) do
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node|
node.automatic['domain'] = 'example.com'
node.default['hive']['hive_site']['hive.exec.local.scratchdir'] = '/tmp'
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false)
stub_command('update-alternatives --display hive-conf | grep best | awk \'{print $5}\' | grep /etc/hive/conf.chef').and_return(false)
end.converge(described_recipe)
end
%w(mysql-connector-java postgresql-jdbc hive).each do |pkg|
it "install #{pkg} package" do
expect(chef_run).to install_package(pkg)
end
end
end
end
| Add tests for mysql-connector-java and postgresql-jdbc packages | Add tests for mysql-connector-java and postgresql-jdbc packages
ChefSpec Coverage report generated...
Total Resources: 106
Touched Resources: 85
Touch Coverage: 80.19%
| Ruby | apache-2.0 | caskdata/hadoop_cookbook,caskdata/hadoop_cookbook,cdapio/hadoop_cookbook,cdapio/hadoop_cookbook,cdapio/hadoop_cookbook,caskdata/hadoop_cookbook | ruby | ## Code Before:
require 'spec_helper'
describe 'hadoop::hive' do
context 'on Centos 6.4 x86_64' do
let(:chef_run) do
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node|
node.automatic['domain'] = 'example.com'
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false)
stub_command('update-alternatives --display hive-conf | grep best | awk \'{print $5}\' | grep /etc/hive/conf.chef').and_return(false)
end.converge(described_recipe)
end
it 'install hive package' do
expect(chef_run).to install_package('hive')
end
end
end
## Instruction:
Add tests for mysql-connector-java and postgresql-jdbc packages
ChefSpec Coverage report generated...
Total Resources: 106
Touched Resources: 85
Touch Coverage: 80.19%
## Code After:
require 'spec_helper'
describe 'hadoop::hive' do
context 'on Centos 6.4 x86_64' do
let(:chef_run) do
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node|
node.automatic['domain'] = 'example.com'
node.default['hive']['hive_site']['hive.exec.local.scratchdir'] = '/tmp'
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false)
stub_command('update-alternatives --display hive-conf | grep best | awk \'{print $5}\' | grep /etc/hive/conf.chef').and_return(false)
end.converge(described_recipe)
end
%w(mysql-connector-java postgresql-jdbc hive).each do |pkg|
it "install #{pkg} package" do
expect(chef_run).to install_package(pkg)
end
end
end
end
|
5319705cccafc8ed3a12cb39f1fb3a07159b115c | packages/rendering/addon/helpers/cs-field-type.js | packages/rendering/addon/helpers/cs-field-type.js | import Ember from 'ember';
export function fieldType(content, fieldName) {
if (!content) { return; }
let meta;
try {
meta = content.constructor.metaForProperty(fieldName);
} catch (err) {
return;
}
// meta.options.fieldType is our convention for annotating
// models. meta.type is the name of the transform that ember-data
// is using, which we keep as a fallback.
let type = meta.options && meta.options.fieldType;
if (!type && meta.type) {
// lift the default ember-data transform names into our core
// types
type = `@cardstack/core-types::${meta.type}`;
}
if (type) {
type = stripNamespace(type);
}
return type;
}
function stripNamespace(type) {
// Right now the actual field editor components get flattened down
// out of their namespaces, so we throw away everything but the
// last bit of their names here. This problem is easier to solve
// once I can integrate a module-unification resolver, so I'm
// leaving it like this for now.
let parts = type.split(/[/:]/g);
return parts[parts.length - 1];
}
export default Ember.Helper.helper(fieldType);
| import { camelize } from '@ember/string';
import Ember from 'ember';
export function fieldType(content, fieldName) {
if (!content) { return; }
let meta;
fieldName = camelize(fieldName);
try {
meta = content.constructor.metaForProperty(fieldName);
} catch (err) {
return;
}
// meta.options.fieldType is our convention for annotating
// models. meta.type is the name of the transform that ember-data
// is using, which we keep as a fallback.
let type = meta.options && meta.options.fieldType;
if (!type && meta.type) {
// lift the default ember-data transform names into our core
// types
type = `@cardstack/core-types::${meta.type}`;
}
if (type) {
type = stripNamespace(type);
}
return type;
}
function stripNamespace(type) {
// Right now the actual field editor components get flattened down
// out of their namespaces, so we throw away everything but the
// last bit of their names here. This problem is easier to solve
// once I can integrate a module-unification resolver, so I'm
// leaving it like this for now.
let parts = type.split(/[/:]/g);
return parts[parts.length - 1];
}
export default Ember.Helper.helper(fieldType);
| Fix field editors for names that have dashes | Fix field editors for names that have dashes
| JavaScript | mit | cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack | javascript | ## Code Before:
import Ember from 'ember';
export function fieldType(content, fieldName) {
if (!content) { return; }
let meta;
try {
meta = content.constructor.metaForProperty(fieldName);
} catch (err) {
return;
}
// meta.options.fieldType is our convention for annotating
// models. meta.type is the name of the transform that ember-data
// is using, which we keep as a fallback.
let type = meta.options && meta.options.fieldType;
if (!type && meta.type) {
// lift the default ember-data transform names into our core
// types
type = `@cardstack/core-types::${meta.type}`;
}
if (type) {
type = stripNamespace(type);
}
return type;
}
function stripNamespace(type) {
// Right now the actual field editor components get flattened down
// out of their namespaces, so we throw away everything but the
// last bit of their names here. This problem is easier to solve
// once I can integrate a module-unification resolver, so I'm
// leaving it like this for now.
let parts = type.split(/[/:]/g);
return parts[parts.length - 1];
}
export default Ember.Helper.helper(fieldType);
## Instruction:
Fix field editors for names that have dashes
## Code After:
import { camelize } from '@ember/string';
import Ember from 'ember';
export function fieldType(content, fieldName) {
if (!content) { return; }
let meta;
fieldName = camelize(fieldName);
try {
meta = content.constructor.metaForProperty(fieldName);
} catch (err) {
return;
}
// meta.options.fieldType is our convention for annotating
// models. meta.type is the name of the transform that ember-data
// is using, which we keep as a fallback.
let type = meta.options && meta.options.fieldType;
if (!type && meta.type) {
// lift the default ember-data transform names into our core
// types
type = `@cardstack/core-types::${meta.type}`;
}
if (type) {
type = stripNamespace(type);
}
return type;
}
function stripNamespace(type) {
// Right now the actual field editor components get flattened down
// out of their namespaces, so we throw away everything but the
// last bit of their names here. This problem is easier to solve
// once I can integrate a module-unification resolver, so I'm
// leaving it like this for now.
let parts = type.split(/[/:]/g);
return parts[parts.length - 1];
}
export default Ember.Helper.helper(fieldType);
|
c6ad36326a792b1c41f531f2b83fa438d2dc98de | src/components/publishing/embed.tsx | src/components/publishing/embed.tsx | import * as React from "react"
import styled, { StyledFunction } from "styled-components"
interface EmbedProps {
section: any
}
const Embed: React.SFC<EmbedProps> = props => {
const { url, height, mobile_height } = props.section
return <IFrame src={url} scrolling="no" frameBorder="0" height={height} mobileHeight={mobile_height} />
}
interface FrameProps extends React.HTMLProps<HTMLIFrameElement> {
mobileHeight?: number
height: number
}
const iframe: StyledFunction<FrameProps & React.HTMLProps<HTMLIFrameElement>> = styled.iframe
const IFrame = iframe`
width: 100%;
height: ${props => props.height + "px"};
@media (max-width: 600px) {
height: ${props => props.mobileHeight + "px"};
}
`
export default Embed
| import * as React from "react"
import styled, { StyledFunction } from "styled-components"
import { pMedia } from "../helpers"
interface EmbedProps {
section: any
}
const Embed: React.SFC<EmbedProps> = props => {
const { url, height, mobile_height } = props.section
return <IFrame src={url} scrolling="no" frameBorder="0" height={height} mobileHeight={mobile_height} />
}
interface FrameProps extends React.HTMLProps<HTMLIFrameElement> {
mobileHeight?: number
height: number
}
const iframe: StyledFunction<FrameProps> = styled.iframe
const IFrame = iframe`
width: 100%;
height: ${props => props.height + "px"};
${props => pMedia.sm`
height: ${props.mobileHeight}px;
`}
`
export default Embed
| Fix query and remove duplicate prop | Fix query and remove duplicate prop
| TypeScript | mit | artsy/reaction,artsy/reaction-force,xtina-starr/reaction,xtina-starr/reaction,xtina-starr/reaction,craigspaeth/reaction,craigspaeth/reaction,artsy/reaction,artsy/reaction,artsy/reaction-force,craigspaeth/reaction,xtina-starr/reaction | typescript | ## Code Before:
import * as React from "react"
import styled, { StyledFunction } from "styled-components"
interface EmbedProps {
section: any
}
const Embed: React.SFC<EmbedProps> = props => {
const { url, height, mobile_height } = props.section
return <IFrame src={url} scrolling="no" frameBorder="0" height={height} mobileHeight={mobile_height} />
}
interface FrameProps extends React.HTMLProps<HTMLIFrameElement> {
mobileHeight?: number
height: number
}
const iframe: StyledFunction<FrameProps & React.HTMLProps<HTMLIFrameElement>> = styled.iframe
const IFrame = iframe`
width: 100%;
height: ${props => props.height + "px"};
@media (max-width: 600px) {
height: ${props => props.mobileHeight + "px"};
}
`
export default Embed
## Instruction:
Fix query and remove duplicate prop
## Code After:
import * as React from "react"
import styled, { StyledFunction } from "styled-components"
import { pMedia } from "../helpers"
interface EmbedProps {
section: any
}
const Embed: React.SFC<EmbedProps> = props => {
const { url, height, mobile_height } = props.section
return <IFrame src={url} scrolling="no" frameBorder="0" height={height} mobileHeight={mobile_height} />
}
interface FrameProps extends React.HTMLProps<HTMLIFrameElement> {
mobileHeight?: number
height: number
}
const iframe: StyledFunction<FrameProps> = styled.iframe
const IFrame = iframe`
width: 100%;
height: ${props => props.height + "px"};
${props => pMedia.sm`
height: ${props.mobileHeight}px;
`}
`
export default Embed
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.