commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c0a9c133a5b5b1fb377b607bba4ad720d1d8c696 | src/ggrc/assets/stylesheets/modules/_related-list.scss | src/ggrc/assets/stylesheets/modules/_related-list.scss | /*
* Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
* Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
* Created By: vladan@reciprocitylabs.com
* Maintained By: vladan@reciprocitylabs.com
*/
.past-items-list {
@extend %reset-list;
> li {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid $lightGray;
&:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
&.list-title {
line-height: 26px;
height: 26px;
margin-bottom: 10px;
padding-bottom: 0;
border-bottom: none;
}
}
.mini-col {
@extend %tab-col-general;
width: 10%;
}
.small-col {
@extend %tab-col-general;
width: 20%;
}
.medium-col {
@extend %tab-col-general;
width: 35%;
}
.xmedium-col {
@extend %tab-col-general;
width: 25%;
}
.large-col {
@extend %tab-col-general;
width: 45%;
}
}
| /*
* Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
* Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
* Created By: vladan@reciprocitylabs.com
* Maintained By: vladan@reciprocitylabs.com
*/
.past-items-list {
@extend %reset-list;
> li {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid $lightGray;
&:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
&.list-title {
line-height: 26px;
height: 26px;
margin-bottom: 10px;
padding-bottom: 0;
border-bottom: none;
}
}
.mini-col {
@extend %tab-col-general;
width: 10%;
}
.small-col {
@extend %tab-col-general;
width: 20%;
}
.medium-col {
@extend %tab-col-general;
width: 35%;
}
.xmedium-col {
@extend %tab-col-general;
width: 25%;
}
.large-col {
@extend %tab-col-general;
width: 45%;
}
}
| Fix tab indentation on related list | Fix tab indentation on related list
| SCSS | apache-2.0 | VinnieJohns/ggrc-core,josthkko/ggrc-core,prasannav7/ggrc-core,jmakov/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,jmakov/ggrc-core,VinnieJohns/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,kr41/ggrc-core,jmakov/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,jmakov/ggrc-core | scss | ## Code Before:
/*
* Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
* Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
* Created By: vladan@reciprocitylabs.com
* Maintained By: vladan@reciprocitylabs.com
*/
.past-items-list {
@extend %reset-list;
> li {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid $lightGray;
&:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
&.list-title {
line-height: 26px;
height: 26px;
margin-bottom: 10px;
padding-bottom: 0;
border-bottom: none;
}
}
.mini-col {
@extend %tab-col-general;
width: 10%;
}
.small-col {
@extend %tab-col-general;
width: 20%;
}
.medium-col {
@extend %tab-col-general;
width: 35%;
}
.xmedium-col {
@extend %tab-col-general;
width: 25%;
}
.large-col {
@extend %tab-col-general;
width: 45%;
}
}
## Instruction:
Fix tab indentation on related list
## Code After:
/*
* Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
* Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
* Created By: vladan@reciprocitylabs.com
* Maintained By: vladan@reciprocitylabs.com
*/
.past-items-list {
@extend %reset-list;
> li {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid $lightGray;
&:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
&.list-title {
line-height: 26px;
height: 26px;
margin-bottom: 10px;
padding-bottom: 0;
border-bottom: none;
}
}
.mini-col {
@extend %tab-col-general;
width: 10%;
}
.small-col {
@extend %tab-col-general;
width: 20%;
}
.medium-col {
@extend %tab-col-general;
width: 35%;
}
.xmedium-col {
@extend %tab-col-general;
width: 25%;
}
.large-col {
@extend %tab-col-general;
width: 45%;
}
}
| /*
* Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
* Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
* Created By: vladan@reciprocitylabs.com
* Maintained By: vladan@reciprocitylabs.com
*/
.past-items-list {
- @extend %reset-list;
? ^
+ @extend %reset-list;
? ^^
- > li {
? ^
+ > li {
? ^^
- margin-bottom: 20px;
? ^^
+ margin-bottom: 20px;
? ^^^^
- padding-bottom: 15px;
? ^^
+ padding-bottom: 15px;
? ^^^^
- border-bottom: 1px solid $lightGray;
? ^^
+ border-bottom: 1px solid $lightGray;
? ^^^^
- &:last-child {
? ^^
+ &:last-child {
? ^^^^
- margin-bottom: 0;
? ^^^
+ margin-bottom: 0;
? ^^^^^^
- padding-bottom: 0;
? ^^^
+ padding-bottom: 0;
? ^^^^^^
- border-bottom: none;
? ^^^
+ border-bottom: none;
? ^^^^^^
- }
+ }
- &.list-title {
? ^^
+ &.list-title {
? ^^^^
- line-height: 26px;
? ^^^
+ line-height: 26px;
? ^^^^^^
- height: 26px;
+ height: 26px;
- margin-bottom: 10px;
? ^^^
+ margin-bottom: 10px;
? ^^^^^^
- padding-bottom: 0;
? ^^^
+ padding-bottom: 0;
? ^^^^^^
- border-bottom: none;
? ^^^
+ border-bottom: none;
? ^^^^^^
- }
- }
+ }
+ }
- .mini-col {
? ^
+ .mini-col {
? ^^
- @extend %tab-col-general;
? ^^
+ @extend %tab-col-general;
? ^^^^
- width: 10%;
? ^^
+ width: 10%;
? ^^^^
- }
+ }
- .small-col {
? ^
+ .small-col {
? ^^
- @extend %tab-col-general;
? ^^
+ @extend %tab-col-general;
? ^^^^
- width: 20%;
? ^^
+ width: 20%;
? ^^^^
- }
+ }
- .medium-col {
? ^
+ .medium-col {
? ^^
- @extend %tab-col-general;
? ^^
+ @extend %tab-col-general;
? ^^^^
- width: 35%;
? ^^
+ width: 35%;
? ^^^^
- }
+ }
- .xmedium-col {
? ^
+ .xmedium-col {
? ^^
- @extend %tab-col-general;
? ^^
+ @extend %tab-col-general;
? ^^^^
- width: 25%;
? ^^
+ width: 25%;
? ^^^^
- }
+ }
- .large-col {
? ^
+ .large-col {
? ^^
- @extend %tab-col-general;
? ^^
+ @extend %tab-col-general;
? ^^^^
- width: 45%;
? ^^
+ width: 45%;
? ^^^^
- }
+ }
} | 76 | 1.617021 | 38 | 38 |
fbb9d30f44ad3373b96ef0319a4fb404b60be5de | critical-mutex.c | critical-mutex.c |
static uv_mutex_t mutex;
static uv_thread_t thread;
static int crit_data = 0;
static void thread_cb(void* arg) {
uv_mutex_lock(&mutex);
printf("thread mutex start\n");
crit_data = 2;
printf("thread mutex end\n");
uv_mutex_unlock(&mutex);
}
int main() {
assert(0 == uv_mutex_init(&mutex));
assert(0 == uv_thread_create(&thread, thread_cb, NULL));
uv_mutex_lock(&mutex);
printf("main mutex start\n");
sleep(1);
crit_data = 1;
printf("main mutex end\n");
uv_mutex_unlock(&mutex);
uv_thread_join(&thread);
uv_mutex_destroy(&mutex);
return 0;
}
|
static uv_mutex_t mutex;
static uv_thread_t thread;
static void thread_cb(void* arg) {
printf("thread_cb\n");
uv_mutex_lock(&mutex);
printf("thread mutex\n");
uv_mutex_unlock(&mutex);
}
int main() {
assert(0 == uv_mutex_init(&mutex));
assert(0 == uv_thread_create(&thread, thread_cb, NULL));
uv_mutex_lock(&mutex);
printf("main mutex start\n");
sleep(1);
printf("main mutex end\n");
uv_mutex_unlock(&mutex);
uv_thread_join(&thread);
uv_mutex_destroy(&mutex);
return 0;
}
| Make use of mutex easier to see | Make use of mutex easier to see
With the access to the data, the use of the actual mutex could have been
confused. By simply using the mutex the example is a lot more clear.
| C | mit | trevnorris/libuv-examples | c | ## Code Before:
static uv_mutex_t mutex;
static uv_thread_t thread;
static int crit_data = 0;
static void thread_cb(void* arg) {
uv_mutex_lock(&mutex);
printf("thread mutex start\n");
crit_data = 2;
printf("thread mutex end\n");
uv_mutex_unlock(&mutex);
}
int main() {
assert(0 == uv_mutex_init(&mutex));
assert(0 == uv_thread_create(&thread, thread_cb, NULL));
uv_mutex_lock(&mutex);
printf("main mutex start\n");
sleep(1);
crit_data = 1;
printf("main mutex end\n");
uv_mutex_unlock(&mutex);
uv_thread_join(&thread);
uv_mutex_destroy(&mutex);
return 0;
}
## Instruction:
Make use of mutex easier to see
With the access to the data, the use of the actual mutex could have been
confused. By simply using the mutex the example is a lot more clear.
## Code After:
static uv_mutex_t mutex;
static uv_thread_t thread;
static void thread_cb(void* arg) {
printf("thread_cb\n");
uv_mutex_lock(&mutex);
printf("thread mutex\n");
uv_mutex_unlock(&mutex);
}
int main() {
assert(0 == uv_mutex_init(&mutex));
assert(0 == uv_thread_create(&thread, thread_cb, NULL));
uv_mutex_lock(&mutex);
printf("main mutex start\n");
sleep(1);
printf("main mutex end\n");
uv_mutex_unlock(&mutex);
uv_thread_join(&thread);
uv_mutex_destroy(&mutex);
return 0;
}
|
static uv_mutex_t mutex;
static uv_thread_t thread;
- static int crit_data = 0;
-
-
static void thread_cb(void* arg) {
+ printf("thread_cb\n");
uv_mutex_lock(&mutex);
- printf("thread mutex start\n");
- crit_data = 2;
- printf("thread mutex end\n");
? ----
+ printf("thread mutex\n");
uv_mutex_unlock(&mutex);
}
-
int main() {
assert(0 == uv_mutex_init(&mutex));
assert(0 == uv_thread_create(&thread, thread_cb, NULL));
uv_mutex_lock(&mutex);
printf("main mutex start\n");
sleep(1);
- crit_data = 1;
printf("main mutex end\n");
uv_mutex_unlock(&mutex);
uv_thread_join(&thread);
uv_mutex_destroy(&mutex);
return 0;
} | 10 | 0.3125 | 2 | 8 |
847143cd60986c6558167a8ad28a778b09330a7c | gocd/server.py | gocd/server.py | import urllib2
from urlparse import urljoin
from gocd.api import Pipeline
class Server(object):
def __init__(self, host, user=None, password=None):
self.host = host
self.user = user
self.password = password
if self.user and self.password:
self._add_basic_auth()
def get(self, path):
return urllib2.urlopen(self._request(path))
def pipeline(self, name):
return Pipeline(self, name)
def _add_basic_auth(self):
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password(
realm='Cruise', # This seems to be hard coded.
uri=self.host,
user=self.user,
passwd=self.password,
)
urllib2.install_opener(urllib2.build_opener(auth_handler))
def _request(self, path, data=None, headers=None):
default_headers = {
'User-Agent': 'py-gocd',
}
default_headers.update(headers or {})
return urllib2.Request(
self._url(path),
data=data,
headers=default_headers
)
def _url(self, path):
return urljoin(self.host, path)
| import urllib2
from urlparse import urljoin
from gocd.api import Pipeline
class Server(object):
def __init__(self, host, user=None, password=None):
self.host = host
self.user = user
self.password = password
if self.user and self.password:
self._add_basic_auth()
def get(self, path):
return urllib2.urlopen(self._request(path))
def pipeline(self, name):
return Pipeline(self, name)
def _add_basic_auth(self):
auth_handler = urllib2.HTTPBasicAuthHandler(
urllib2.HTTPPasswordMgrWithDefaultRealm()
)
auth_handler.add_password(
realm=None,
uri=self.host,
user=self.user,
passwd=self.password,
)
urllib2.install_opener(urllib2.build_opener(auth_handler))
def _request(self, path, data=None, headers=None):
default_headers = {
'User-Agent': 'py-gocd',
}
default_headers.update(headers or {})
return urllib2.Request(
self._url(path),
data=data,
headers=default_headers
)
def _url(self, path):
return urljoin(self.host, path)
| Remove hard coded realm and assume any is fine | Remove hard coded realm and assume any is fine
| Python | mit | henriquegemignani/py-gocd,gaqzi/py-gocd | python | ## Code Before:
import urllib2
from urlparse import urljoin
from gocd.api import Pipeline
class Server(object):
def __init__(self, host, user=None, password=None):
self.host = host
self.user = user
self.password = password
if self.user and self.password:
self._add_basic_auth()
def get(self, path):
return urllib2.urlopen(self._request(path))
def pipeline(self, name):
return Pipeline(self, name)
def _add_basic_auth(self):
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password(
realm='Cruise', # This seems to be hard coded.
uri=self.host,
user=self.user,
passwd=self.password,
)
urllib2.install_opener(urllib2.build_opener(auth_handler))
def _request(self, path, data=None, headers=None):
default_headers = {
'User-Agent': 'py-gocd',
}
default_headers.update(headers or {})
return urllib2.Request(
self._url(path),
data=data,
headers=default_headers
)
def _url(self, path):
return urljoin(self.host, path)
## Instruction:
Remove hard coded realm and assume any is fine
## Code After:
import urllib2
from urlparse import urljoin
from gocd.api import Pipeline
class Server(object):
def __init__(self, host, user=None, password=None):
self.host = host
self.user = user
self.password = password
if self.user and self.password:
self._add_basic_auth()
def get(self, path):
return urllib2.urlopen(self._request(path))
def pipeline(self, name):
return Pipeline(self, name)
def _add_basic_auth(self):
auth_handler = urllib2.HTTPBasicAuthHandler(
urllib2.HTTPPasswordMgrWithDefaultRealm()
)
auth_handler.add_password(
realm=None,
uri=self.host,
user=self.user,
passwd=self.password,
)
urllib2.install_opener(urllib2.build_opener(auth_handler))
def _request(self, path, data=None, headers=None):
default_headers = {
'User-Agent': 'py-gocd',
}
default_headers.update(headers or {})
return urllib2.Request(
self._url(path),
data=data,
headers=default_headers
)
def _url(self, path):
return urljoin(self.host, path)
| import urllib2
from urlparse import urljoin
from gocd.api import Pipeline
class Server(object):
def __init__(self, host, user=None, password=None):
self.host = host
self.user = user
self.password = password
if self.user and self.password:
self._add_basic_auth()
def get(self, path):
return urllib2.urlopen(self._request(path))
def pipeline(self, name):
return Pipeline(self, name)
def _add_basic_auth(self):
- auth_handler = urllib2.HTTPBasicAuthHandler()
? -
+ auth_handler = urllib2.HTTPBasicAuthHandler(
+ urllib2.HTTPPasswordMgrWithDefaultRealm()
+ )
auth_handler.add_password(
- realm='Cruise', # This seems to be hard coded.
+ realm=None,
uri=self.host,
user=self.user,
passwd=self.password,
)
urllib2.install_opener(urllib2.build_opener(auth_handler))
def _request(self, path, data=None, headers=None):
default_headers = {
'User-Agent': 'py-gocd',
}
default_headers.update(headers or {})
return urllib2.Request(
self._url(path),
data=data,
headers=default_headers
)
def _url(self, path):
return urljoin(self.host, path) | 6 | 0.130435 | 4 | 2 |
27f6c19e5e9c6f0417ca8ba313075e0c3110faa1 | Magic/src/main/resources/examples/survival/wands/divinghelmet.yml | Magic/src/main/resources/examples/survival/wands/divinghelmet.yml | divinghelmet:
icon: light_blue_stained_glass{CustomModelData:18001}
legacy_icon: stained_glass:3
indestructible: true
locked: true
keep: true
quiet: 2
mana_regeneration_boost: -0.1
potion_effects: conduit_power
worn: true
wearable: helmet
| divinghelmet:
icon: light_blue_stained_glass{CustomModelData:18001}
migrate_legacy_icons:
"light_blue_stained_glass": light_blue_stained_glass{CustomModelData:18001}
"stained_glass:3": light_blue_stained_glass{CustomModelData:18001}
legacy_icon: stained_glass:3
indestructible: true
locked: true
keep: true
quiet: 2
mana_regeneration_boost: -0.1
potion_effects: conduit_power
worn: true
wearable: helmet
| Add icon migration for diving helmet | Add icon migration for diving helmet
| YAML | mit | elBukkit/MagicPlugin,elBukkit/MagicPlugin,elBukkit/MagicPlugin | yaml | ## Code Before:
divinghelmet:
icon: light_blue_stained_glass{CustomModelData:18001}
legacy_icon: stained_glass:3
indestructible: true
locked: true
keep: true
quiet: 2
mana_regeneration_boost: -0.1
potion_effects: conduit_power
worn: true
wearable: helmet
## Instruction:
Add icon migration for diving helmet
## Code After:
divinghelmet:
icon: light_blue_stained_glass{CustomModelData:18001}
migrate_legacy_icons:
"light_blue_stained_glass": light_blue_stained_glass{CustomModelData:18001}
"stained_glass:3": light_blue_stained_glass{CustomModelData:18001}
legacy_icon: stained_glass:3
indestructible: true
locked: true
keep: true
quiet: 2
mana_regeneration_boost: -0.1
potion_effects: conduit_power
worn: true
wearable: helmet
| divinghelmet:
icon: light_blue_stained_glass{CustomModelData:18001}
+ migrate_legacy_icons:
+ "light_blue_stained_glass": light_blue_stained_glass{CustomModelData:18001}
+ "stained_glass:3": light_blue_stained_glass{CustomModelData:18001}
legacy_icon: stained_glass:3
indestructible: true
locked: true
keep: true
quiet: 2
mana_regeneration_boost: -0.1
potion_effects: conduit_power
worn: true
wearable: helmet | 3 | 0.272727 | 3 | 0 |
19952d7f437270065a693dc886c867329ec7c4a0 | startzone.py | startzone.py | import xmlrpclib
from supervisor.xmlrpc import SupervisorTransport
def start_zone(port=1300, zoneid="defaultzone", processgroup='zones', autorestart=False):
s = xmlrpclib.ServerProxy('http://localhost:9001')
import socket
try:
version = s.twiddler.getAPIVersion()
except(socket.error), exc:
raise UserWarning("Could not connect to supervisor: %s" % exc)
if float(version) >= 0.3:
command = '/usr/bin/python zoneserver.py --port=%d --zoneid=%s' % (port, zoneid)
settings = {'command': command, 'autostart': str(True), 'autorestart': str(autorestart)}
try:
addtogroup = s.twiddler.addProgramToGroup(processgroup, zoneid, settings)
except(xmlrpclib.Fault), exc:
if "BAD_NAME" in exc.faultString:
raise UserWarning("Zone already exists in process list.")
else:
print exc
print exc.faultCode, exc.faultString
raise
if addtogroup:
return True
else:
raise UserWarning("Couldn't add zone %s to process group." % zoneid)
else:
raise UserWarning("Twiddler version too old.")
if __name__ == "__main__":
if start_zone():
print "Started zone successfully."
| import xmlrpclib
from supervisor.xmlrpc import SupervisorTransport
def start_zone(port=1300, zoneid="defaultzone", processgroup='zones', autorestart=False):
s = xmlrpclib.ServerProxy('http://localhost:9001')
import socket
try:
version = s.twiddler.getAPIVersion()
except(socket.error), exc:
raise UserWarning("Could not connect to supervisor: %s" % exc)
if float(version) >= 0.3:
command = '/usr/bin/python zoneserver.py --port=%d --zoneid=%s' % (int(port), zoneid)
settings = {'command': command, 'autostart': str(True), 'autorestart': str(autorestart), 'redirect_stderr': str(True)}
try:
addtogroup = s.twiddler.addProgramToGroup(processgroup, zoneid, settings)
except(xmlrpclib.Fault), exc:
if "BAD_NAME" in exc.faultString:
raise UserWarning("Zone already exists in process list.")
else:
print exc
print exc.faultCode, exc.faultString
raise
if addtogroup:
return True
else:
raise UserWarning("Couldn't add zone %s to process group." % zoneid)
else:
raise UserWarning("Twiddler version too old.")
if __name__ == "__main__":
if start_zone():
print "Started zone successfully."
| Fix up some settings for start_zone() | Fix up some settings for start_zone()
| Python | agpl-3.0 | cnelsonsic/SimpleMMO,cnelsonsic/SimpleMMO,cnelsonsic/SimpleMMO | python | ## Code Before:
import xmlrpclib
from supervisor.xmlrpc import SupervisorTransport
def start_zone(port=1300, zoneid="defaultzone", processgroup='zones', autorestart=False):
s = xmlrpclib.ServerProxy('http://localhost:9001')
import socket
try:
version = s.twiddler.getAPIVersion()
except(socket.error), exc:
raise UserWarning("Could not connect to supervisor: %s" % exc)
if float(version) >= 0.3:
command = '/usr/bin/python zoneserver.py --port=%d --zoneid=%s' % (port, zoneid)
settings = {'command': command, 'autostart': str(True), 'autorestart': str(autorestart)}
try:
addtogroup = s.twiddler.addProgramToGroup(processgroup, zoneid, settings)
except(xmlrpclib.Fault), exc:
if "BAD_NAME" in exc.faultString:
raise UserWarning("Zone already exists in process list.")
else:
print exc
print exc.faultCode, exc.faultString
raise
if addtogroup:
return True
else:
raise UserWarning("Couldn't add zone %s to process group." % zoneid)
else:
raise UserWarning("Twiddler version too old.")
if __name__ == "__main__":
if start_zone():
print "Started zone successfully."
## Instruction:
Fix up some settings for start_zone()
## Code After:
import xmlrpclib
from supervisor.xmlrpc import SupervisorTransport
def start_zone(port=1300, zoneid="defaultzone", processgroup='zones', autorestart=False):
s = xmlrpclib.ServerProxy('http://localhost:9001')
import socket
try:
version = s.twiddler.getAPIVersion()
except(socket.error), exc:
raise UserWarning("Could not connect to supervisor: %s" % exc)
if float(version) >= 0.3:
command = '/usr/bin/python zoneserver.py --port=%d --zoneid=%s' % (int(port), zoneid)
settings = {'command': command, 'autostart': str(True), 'autorestart': str(autorestart), 'redirect_stderr': str(True)}
try:
addtogroup = s.twiddler.addProgramToGroup(processgroup, zoneid, settings)
except(xmlrpclib.Fault), exc:
if "BAD_NAME" in exc.faultString:
raise UserWarning("Zone already exists in process list.")
else:
print exc
print exc.faultCode, exc.faultString
raise
if addtogroup:
return True
else:
raise UserWarning("Couldn't add zone %s to process group." % zoneid)
else:
raise UserWarning("Twiddler version too old.")
if __name__ == "__main__":
if start_zone():
print "Started zone successfully."
| import xmlrpclib
from supervisor.xmlrpc import SupervisorTransport
def start_zone(port=1300, zoneid="defaultzone", processgroup='zones', autorestart=False):
s = xmlrpclib.ServerProxy('http://localhost:9001')
import socket
try:
version = s.twiddler.getAPIVersion()
except(socket.error), exc:
raise UserWarning("Could not connect to supervisor: %s" % exc)
if float(version) >= 0.3:
- command = '/usr/bin/python zoneserver.py --port=%d --zoneid=%s' % (port, zoneid)
+ command = '/usr/bin/python zoneserver.py --port=%d --zoneid=%s' % (int(port), zoneid)
? ++++ +
- settings = {'command': command, 'autostart': str(True), 'autorestart': str(autorestart)}
+ settings = {'command': command, 'autostart': str(True), 'autorestart': str(autorestart), 'redirect_stderr': str(True)}
? ++++++++++++++++++++++++++++++
try:
addtogroup = s.twiddler.addProgramToGroup(processgroup, zoneid, settings)
except(xmlrpclib.Fault), exc:
if "BAD_NAME" in exc.faultString:
raise UserWarning("Zone already exists in process list.")
else:
print exc
print exc.faultCode, exc.faultString
raise
if addtogroup:
return True
else:
raise UserWarning("Couldn't add zone %s to process group." % zoneid)
else:
raise UserWarning("Twiddler version too old.")
if __name__ == "__main__":
if start_zone():
print "Started zone successfully."
| 4 | 0.108108 | 2 | 2 |
51a0993def81210f62de245c2b0f63e3adae353c | git/aliases.zsh | git/aliases.zsh | alias gd='git diff'
alias gpb='git checkout $(git branch | cut -c 3- | pick)'
alias gcb='git copy-branch-name'
alias gdb='git branch -D $(git branch | cut -c 3- | pick)'
alias gpri='git rebase -i $(git branch | cut -c 3- | pick)'
alias ggui='/usr/local/opt/git/libexec/git-core/git-gui &'
alias gm='git merge'
alias editgit='vim ~/.gitconfig'
| hub_path=$(which hub)
if (( $+commands[hub] ))
then
alias git=$hub_path
fi
# The rest of my fun git aliases
alias gd='git diff'
alias gpb='git checkout $(git branch | cut -c 3- | pick)'
alias gcb='git copy-branch-name'
alias gdb='git branch -D $(git branch | cut -c 3- | pick)'
alias gpri='git rebase -i $(git branch | cut -c 3- | pick)'
alias ggui='/usr/local/opt/git/libexec/git-core/git-gui &'
alias gm='git merge'
alias editgit='vim ~/.gitconfig'
| Revert "Remove alias from git" | Revert "Remove alias from git"
This reverts commit 8a3f724c07529f78ddb62ead8cc025b478104a61.
| Shell | mit | marionzualo/dotfiles | shell | ## Code Before:
alias gd='git diff'
alias gpb='git checkout $(git branch | cut -c 3- | pick)'
alias gcb='git copy-branch-name'
alias gdb='git branch -D $(git branch | cut -c 3- | pick)'
alias gpri='git rebase -i $(git branch | cut -c 3- | pick)'
alias ggui='/usr/local/opt/git/libexec/git-core/git-gui &'
alias gm='git merge'
alias editgit='vim ~/.gitconfig'
## Instruction:
Revert "Remove alias from git"
This reverts commit 8a3f724c07529f78ddb62ead8cc025b478104a61.
## Code After:
hub_path=$(which hub)
if (( $+commands[hub] ))
then
alias git=$hub_path
fi
# The rest of my fun git aliases
alias gd='git diff'
alias gpb='git checkout $(git branch | cut -c 3- | pick)'
alias gcb='git copy-branch-name'
alias gdb='git branch -D $(git branch | cut -c 3- | pick)'
alias gpri='git rebase -i $(git branch | cut -c 3- | pick)'
alias ggui='/usr/local/opt/git/libexec/git-core/git-gui &'
alias gm='git merge'
alias editgit='vim ~/.gitconfig'
| + hub_path=$(which hub)
+ if (( $+commands[hub] ))
+ then
+ alias git=$hub_path
+ fi
+
+ # The rest of my fun git aliases
alias gd='git diff'
alias gpb='git checkout $(git branch | cut -c 3- | pick)'
alias gcb='git copy-branch-name'
alias gdb='git branch -D $(git branch | cut -c 3- | pick)'
alias gpri='git rebase -i $(git branch | cut -c 3- | pick)'
alias ggui='/usr/local/opt/git/libexec/git-core/git-gui &'
alias gm='git merge'
alias editgit='vim ~/.gitconfig' | 7 | 0.875 | 7 | 0 |
513a71ad7c6874bc530a3fc9bad17ffd27d600d8 | projects/samskivert/src/java/com/samskivert/swing/util/Task.java | projects/samskivert/src/java/com/samskivert/swing/util/Task.java | //
// $Id: Task.java,v 1.1 2000/12/06 03:25:19 mdb Exp $
package com.samskivert.swing.util;
/**
* A swing application requests that a task be invoked by the task
* master. The task master invokes the task on a separate thread and
* informs the swing application when the task has completed via the task
* observer interface. It does so in a way that plays nicely with the
* swing event dispatch thread (the swing application is notified of the
* task's completion on the event dispatch thread so that it can wiggle
* its user interface elements to its heart's desire).
*/
public interface Task
{
/**
* This method is called by the task master to invoke the task. The
* task should run to completion and return some value.
*/
public Object invoke ();
/**
* This method is called by the task master when it has received a
* request to cancel this task. If the task can be cancelled, abort
* should return true and the currently running call to
* <code>invoke()</code> should immediately return (the return value
* will be ignored). If the task cannot be cancelled, abort should
* return false and the task master will simply abandon the task and
* the thread on which it is running.
*/
public boolean abort ();
}
| //
// $Id: Task.java,v 1.2 2000/12/07 05:41:30 mdb Exp $
package com.samskivert.swing.util;
/**
* A swing application requests that a task be invoked by the task
* master. The task master invokes the task on a separate thread and
* informs the swing application when the task has completed via the task
* observer interface. It does so in a way that plays nicely with the
* swing event dispatch thread (the swing application is notified of the
* task's completion on the event dispatch thread so that it can wiggle
* its user interface elements to its heart's desire).
*/
public interface Task
{
/**
* This method is called by the task master to invoke the task. The
* task should run to completion and return some value.
*/
public Object invoke () throws Exception;
/**
* This method is called by the task master when it has received a
* request to cancel this task. If the task can be cancelled, abort
* should return true and the currently running call to
* <code>invoke()</code> should immediately return (the return value
* will be ignored). If the task cannot be cancelled, abort should
* return false and the task master will simply abandon the task and
* the thread on which it is running.
*/
public boolean abort ();
}
| Allow tasks to throw an exception so that it can be caught and passed to the task observer. | Allow tasks to throw an exception so that it can be caught and passed to
the task observer.
git-svn-id: 64ebf368729f38804935acb7146e017e0f909c6b@24 6335cc39-0255-0410-8fd6-9bcaacd3b74c
| Java | lgpl-2.1 | samskivert/samskivert,samskivert/samskivert | java | ## Code Before:
//
// $Id: Task.java,v 1.1 2000/12/06 03:25:19 mdb Exp $
package com.samskivert.swing.util;
/**
* A swing application requests that a task be invoked by the task
* master. The task master invokes the task on a separate thread and
* informs the swing application when the task has completed via the task
* observer interface. It does so in a way that plays nicely with the
* swing event dispatch thread (the swing application is notified of the
* task's completion on the event dispatch thread so that it can wiggle
* its user interface elements to its heart's desire).
*/
public interface Task
{
/**
* This method is called by the task master to invoke the task. The
* task should run to completion and return some value.
*/
public Object invoke ();
/**
* This method is called by the task master when it has received a
* request to cancel this task. If the task can be cancelled, abort
* should return true and the currently running call to
* <code>invoke()</code> should immediately return (the return value
* will be ignored). If the task cannot be cancelled, abort should
* return false and the task master will simply abandon the task and
* the thread on which it is running.
*/
public boolean abort ();
}
## Instruction:
Allow tasks to throw an exception so that it can be caught and passed to
the task observer.
git-svn-id: 64ebf368729f38804935acb7146e017e0f909c6b@24 6335cc39-0255-0410-8fd6-9bcaacd3b74c
## Code After:
//
// $Id: Task.java,v 1.2 2000/12/07 05:41:30 mdb Exp $
package com.samskivert.swing.util;
/**
* A swing application requests that a task be invoked by the task
* master. The task master invokes the task on a separate thread and
* informs the swing application when the task has completed via the task
* observer interface. It does so in a way that plays nicely with the
* swing event dispatch thread (the swing application is notified of the
* task's completion on the event dispatch thread so that it can wiggle
* its user interface elements to its heart's desire).
*/
public interface Task
{
/**
* This method is called by the task master to invoke the task. The
* task should run to completion and return some value.
*/
public Object invoke () throws Exception;
/**
* This method is called by the task master when it has received a
* request to cancel this task. If the task can be cancelled, abort
* should return true and the currently running call to
* <code>invoke()</code> should immediately return (the return value
* will be ignored). If the task cannot be cancelled, abort should
* return false and the task master will simply abandon the task and
* the thread on which it is running.
*/
public boolean abort ();
}
| //
- // $Id: Task.java,v 1.1 2000/12/06 03:25:19 mdb Exp $
? ^ ^ --- ^
+ // $Id: Task.java,v 1.2 2000/12/07 05:41:30 mdb Exp $
? ^ ^ + ^^^
package com.samskivert.swing.util;
/**
* A swing application requests that a task be invoked by the task
* master. The task master invokes the task on a separate thread and
* informs the swing application when the task has completed via the task
* observer interface. It does so in a way that plays nicely with the
* swing event dispatch thread (the swing application is notified of the
* task's completion on the event dispatch thread so that it can wiggle
* its user interface elements to its heart's desire).
*/
public interface Task
{
/**
* This method is called by the task master to invoke the task. The
* task should run to completion and return some value.
*/
- public Object invoke ();
+ public Object invoke () throws Exception;
? +++++++++++++++++
/**
* This method is called by the task master when it has received a
* request to cancel this task. If the task can be cancelled, abort
* should return true and the currently running call to
* <code>invoke()</code> should immediately return (the return value
* will be ignored). If the task cannot be cancelled, abort should
* return false and the task master will simply abandon the task and
* the thread on which it is running.
*/
public boolean abort ();
} | 4 | 0.121212 | 2 | 2 |
3350102e997c9e81a63bce738b2167296d44b502 | test/executor/TestExecutor.sh | test/executor/TestExecutor.sh | include string.util.StringUtil
TestExecutor(){
executeTest(){
local group=${1}
shift
local tests=(${@})
for test in ${tests[@]}; do
local testName=$(StringUtil capitalize ${test})
if [[ $(${group} test${testName}) == FAIL ]]; then
echo ${group}#test${testName}
fi
done
}
${@}
} | include command.validator.CommandValidator
include string.util.StringUtil
TestExecutor(){
executeTest(){
local _tests=(
$(CommandValidator getValidFunctions bash-toolbox/test/${1}.sh)
)
local tests=()
for _test in ${_tests[@]}; do
if [[ ${_test} != ${1} && ${_test} != run ]]; then
if [[ $(${1} ${_test}) == FAIL ]]; then
echo ${1}\#${_test}
fi
fi
done
}
$@
} | Determine the tests dynamically so that we don't need to pass in all the tests names | Determine the tests dynamically so that we don't need to pass in all the tests names
| Shell | mit | anthony-chu/bash-toolbox | shell | ## Code Before:
include string.util.StringUtil
TestExecutor(){
executeTest(){
local group=${1}
shift
local tests=(${@})
for test in ${tests[@]}; do
local testName=$(StringUtil capitalize ${test})
if [[ $(${group} test${testName}) == FAIL ]]; then
echo ${group}#test${testName}
fi
done
}
${@}
}
## Instruction:
Determine the tests dynamically so that we don't need to pass in all the tests names
## Code After:
include command.validator.CommandValidator
include string.util.StringUtil
TestExecutor(){
executeTest(){
local _tests=(
$(CommandValidator getValidFunctions bash-toolbox/test/${1}.sh)
)
local tests=()
for _test in ${_tests[@]}; do
if [[ ${_test} != ${1} && ${_test} != run ]]; then
if [[ $(${1} ${_test}) == FAIL ]]; then
echo ${1}\#${_test}
fi
fi
done
}
$@
} | + include command.validator.CommandValidator
+
include string.util.StringUtil
TestExecutor(){
executeTest(){
- local group=${1}
- shift
- local tests=(${@})
? -----
+ local _tests=(
? +
+ $(CommandValidator getValidFunctions bash-toolbox/test/${1}.sh)
+ )
+ local tests=()
- for test in ${tests[@]}; do
- local testName=$(StringUtil capitalize ${test})
+ for _test in ${_tests[@]}; do
+ if [[ ${_test} != ${1} && ${_test} != run ]]; then
- if [[ $(${group} test${testName}) == FAIL ]]; then
? ^^^^^ ----------
+ if [[ $(${1} ${_test}) == FAIL ]]; then
? + ^ +++
- echo ${group}#test${testName}
+ echo ${1}\#${_test}
+ fi
fi
done
}
- ${@}
? - -
+ $@
} | 20 | 1.052632 | 12 | 8 |
8624431e62ef37e9570f53ec3fbe561d7991e9c1 | README.md | README.md | Autofac.Extras.Alternatives
=======================
An Autofac extension that adds support for alternatives to some of the Autofac-provided relationship types.
This includes recognition of `IReadOnlyDictionary<TKey, TValue>` as a relationship type that provides the same
capabilities as the built-in Autofac type `IIndex<TKey, TValue>`.
While Autofac's relationship types are very useful, it is sometimes desirable to not require a dependency
on Autofac for these types in libraries.
Download
========
Visit https://www.nuget.org/packages/Autofac.Extras.Alternatives/ to download.
Usage
=====
| Autofac.Extras.Alternatives
=======================
An Autofac extension that adds support for alternatives to some of the Autofac-provided relationship types.
This includes recognition of `IReadOnlyDictionary<TKey, TValue>` as a relationship type that provides the same
capabilities as the built-in Autofac type `IIndex<TKey, TValue>`.
While Autofac's relationship types are very useful, it is sometimes desirable to not require a dependency
on Autofac for these types in libraries.
[](https://ci.appveyor.com/project/mthamil/autofac-extras-alternatives)
Download
========
Visit https://www.nuget.org/packages/Autofac.Extras.Alternatives/ to download.
Usage
=====
| Add AppVeyor badge to readme. | Add AppVeyor badge to readme.
| Markdown | apache-2.0 | mthamil/Autofac.Extras.Alternatives | markdown | ## Code Before:
Autofac.Extras.Alternatives
=======================
An Autofac extension that adds support for alternatives to some of the Autofac-provided relationship types.
This includes recognition of `IReadOnlyDictionary<TKey, TValue>` as a relationship type that provides the same
capabilities as the built-in Autofac type `IIndex<TKey, TValue>`.
While Autofac's relationship types are very useful, it is sometimes desirable to not require a dependency
on Autofac for these types in libraries.
Download
========
Visit https://www.nuget.org/packages/Autofac.Extras.Alternatives/ to download.
Usage
=====
## Instruction:
Add AppVeyor badge to readme.
## Code After:
Autofac.Extras.Alternatives
=======================
An Autofac extension that adds support for alternatives to some of the Autofac-provided relationship types.
This includes recognition of `IReadOnlyDictionary<TKey, TValue>` as a relationship type that provides the same
capabilities as the built-in Autofac type `IIndex<TKey, TValue>`.
While Autofac's relationship types are very useful, it is sometimes desirable to not require a dependency
on Autofac for these types in libraries.
[](https://ci.appveyor.com/project/mthamil/autofac-extras-alternatives)
Download
========
Visit https://www.nuget.org/packages/Autofac.Extras.Alternatives/ to download.
Usage
=====
| Autofac.Extras.Alternatives
=======================
An Autofac extension that adds support for alternatives to some of the Autofac-provided relationship types.
This includes recognition of `IReadOnlyDictionary<TKey, TValue>` as a relationship type that provides the same
capabilities as the built-in Autofac type `IIndex<TKey, TValue>`.
While Autofac's relationship types are very useful, it is sometimes desirable to not require a dependency
on Autofac for these types in libraries.
+ [](https://ci.appveyor.com/project/mthamil/autofac-extras-alternatives)
+
Download
========
Visit https://www.nuget.org/packages/Autofac.Extras.Alternatives/ to download.
Usage
===== | 2 | 0.125 | 2 | 0 |
1111f1e40937e6a3a0a38302d3fa839731dc16d3 | htdocs/menu.html | htdocs/menu.html | <html><head><title>?</title></head>
<body bgcolor="WHITE" text="BLACK" link="BLUE" alink="RED" vlink="#AA00AA">
<table border=0 width="100%">
<tr>
<td align=center>[<a href="/Status" target=main>Status</a>]</td>
<td align=center>[<a href="/Connections" target=main>Connections</a>]</td>
<td align=center>[<a href="/CacheStatus" target=main>CacheStatus</a>]</td>
<td align=center>[<a href="/ClearCache" target=main>ClearCache</a>]</td>
<td align=center>[<a href="/LogRotator" target=main>LogRotator</a>]</td>
<td align=center>[<a href="/StackTrace" target=main>StackTrace</a>]</td>
<td align=center>[<a href="/SelectorStatus" target=main>Selector</a>]</td>
<!-- enable this in the future. -->
<!-- td align=center>[<a href="/FileSender/config/" target=main>Config</a>]</td -->
<td align=center>[<a href="/FileSender/README.txt" target=main>README</a>]</td>
<td align=center>[<a href="/FileSender/LICENSE.txt" target=main>LICENSE</a>]</td>
<td align=center>[<a href="/FileSender/javadoc/" target=main>RabbIT API</a>]</td>
<td align=center>[<a href="/Kill" target=main>Kill</a>]</td>
</tr>
</table>
</body></html>
| <html><head><title>?</title></head>
<body bgcolor="WHITE" text="BLACK" link="BLUE" alink="RED" vlink="#AA00AA">
<table border=0 width="100%">
<tr>
<td align=center>[<a href="/Status" target=main>Status</a>]</td>
<td align=center>[<a href="/Connections" target=main>Connections</a>]</td>
<td align=center>[<a href="/CacheStatus" target=main>CacheStatus</a>]</td>
<td align=center>[<a href="/ClearCache" target=main>ClearCache</a>]</td>
<td align=center>[<a href="/StackTrace" target=main>StackTrace</a>]</td>
<td align=center>[<a href="/SelectorStatus" target=main>Selector</a>]</td>
<td align=center>[<a href="/FileSender/README.txt" target=main>README</a>]</td>
<td align=center>[<a href="/FileSender/LICENSE.txt" target=main>LICENSE</a>]</td>
<td align=center>[<a href="/FileSender/javadoc/" target=main>RabbIT API</a>]</td>
<td align=center>[<a href="/Kill" target=main>Kill</a>]</td>
</tr>
</table>
</body></html>
| Remove old stuff that does not work. | Remove old stuff that does not work.
| HTML | apache-2.0 | curious-attempt-bunny/rabbit-http-proxy-fake-desktop-headers,toonetown/rabbit-maven | html | ## Code Before:
<html><head><title>?</title></head>
<body bgcolor="WHITE" text="BLACK" link="BLUE" alink="RED" vlink="#AA00AA">
<table border=0 width="100%">
<tr>
<td align=center>[<a href="/Status" target=main>Status</a>]</td>
<td align=center>[<a href="/Connections" target=main>Connections</a>]</td>
<td align=center>[<a href="/CacheStatus" target=main>CacheStatus</a>]</td>
<td align=center>[<a href="/ClearCache" target=main>ClearCache</a>]</td>
<td align=center>[<a href="/LogRotator" target=main>LogRotator</a>]</td>
<td align=center>[<a href="/StackTrace" target=main>StackTrace</a>]</td>
<td align=center>[<a href="/SelectorStatus" target=main>Selector</a>]</td>
<!-- enable this in the future. -->
<!-- td align=center>[<a href="/FileSender/config/" target=main>Config</a>]</td -->
<td align=center>[<a href="/FileSender/README.txt" target=main>README</a>]</td>
<td align=center>[<a href="/FileSender/LICENSE.txt" target=main>LICENSE</a>]</td>
<td align=center>[<a href="/FileSender/javadoc/" target=main>RabbIT API</a>]</td>
<td align=center>[<a href="/Kill" target=main>Kill</a>]</td>
</tr>
</table>
</body></html>
## Instruction:
Remove old stuff that does not work.
## Code After:
<html><head><title>?</title></head>
<body bgcolor="WHITE" text="BLACK" link="BLUE" alink="RED" vlink="#AA00AA">
<table border=0 width="100%">
<tr>
<td align=center>[<a href="/Status" target=main>Status</a>]</td>
<td align=center>[<a href="/Connections" target=main>Connections</a>]</td>
<td align=center>[<a href="/CacheStatus" target=main>CacheStatus</a>]</td>
<td align=center>[<a href="/ClearCache" target=main>ClearCache</a>]</td>
<td align=center>[<a href="/StackTrace" target=main>StackTrace</a>]</td>
<td align=center>[<a href="/SelectorStatus" target=main>Selector</a>]</td>
<td align=center>[<a href="/FileSender/README.txt" target=main>README</a>]</td>
<td align=center>[<a href="/FileSender/LICENSE.txt" target=main>LICENSE</a>]</td>
<td align=center>[<a href="/FileSender/javadoc/" target=main>RabbIT API</a>]</td>
<td align=center>[<a href="/Kill" target=main>Kill</a>]</td>
</tr>
</table>
</body></html>
| <html><head><title>?</title></head>
<body bgcolor="WHITE" text="BLACK" link="BLUE" alink="RED" vlink="#AA00AA">
<table border=0 width="100%">
<tr>
<td align=center>[<a href="/Status" target=main>Status</a>]</td>
<td align=center>[<a href="/Connections" target=main>Connections</a>]</td>
<td align=center>[<a href="/CacheStatus" target=main>CacheStatus</a>]</td>
<td align=center>[<a href="/ClearCache" target=main>ClearCache</a>]</td>
- <td align=center>[<a href="/LogRotator" target=main>LogRotator</a>]</td>
<td align=center>[<a href="/StackTrace" target=main>StackTrace</a>]</td>
<td align=center>[<a href="/SelectorStatus" target=main>Selector</a>]</td>
- <!-- enable this in the future. -->
- <!-- td align=center>[<a href="/FileSender/config/" target=main>Config</a>]</td -->
<td align=center>[<a href="/FileSender/README.txt" target=main>README</a>]</td>
<td align=center>[<a href="/FileSender/LICENSE.txt" target=main>LICENSE</a>]</td>
<td align=center>[<a href="/FileSender/javadoc/" target=main>RabbIT API</a>]</td>
<td align=center>[<a href="/Kill" target=main>Kill</a>]</td>
</tr>
</table>
</body></html> | 3 | 0.15 | 0 | 3 |
83cba43ba3e68bc909113e54d71b6e923f2b64bc | winforms-converter/requirements.md | winforms-converter/requirements.md | ---
title: Requirements
page_title: Requirements | WinForms Converter
description: This article explains which what you require in order to convert your projects.
slug: winforms/winforms-converter/requirements
tags: covert, winforms, requirements
published: True
position: 2
---
# Requirements
The following article lists what is required in order to be able to use the controls converter.
* __Visual Studio 2015 Update 2__
* __.NET 4.6.1__ - this is required if your Visual Studio does not have __Update 2__ installed. You can download it from [here](https://www.microsoft.com/en-us/download/details.aspx?id=49978).
* Solution that contains project with default .NET controls.
## See Also
* [Step-by-step tutorial]({%slug winforms/winforms-converter/step-by-step-tutorial%})
| ---
title: Requirements
page_title: Requirements | WinForms Converter
description: This article explains which what you require in order to convert your projects.
slug: winforms/winforms-converter/requirements
tags: covert, winforms, requirements
published: True
position: 2
---
# Requirements
The following article lists what is required in order to be able to use the controls converter.
* __Visual Studio 2015 Update 2__
* __.NET 4.6.1__ - this is required if your Visual Studio does not have __Update 2__ installed. You can download it from [here](https://www.microsoft.com/en-us/download/details.aspx?id=49978).
* Solution that contains project with default .NET controls.
>important The WinForms converter crashes when converting a project with Visual Studio 2017 18.7 or newer. This is caused because in the latest version of Visual Studio a type used in the converter was moved. Additional information is available here: [WinForms Converter crashes with Visual Studio 15.8](https://docs.telerik.com/devtools/winforms/knowledge-base/converter-exception)
>important WinForms Converter is not available for VS 2019 yet because of breaking changes in Roslyn.
## See Also
* [Step-by-step tutorial]({%slug winforms/winforms-converter/step-by-step-tutorial%})
| Add notes for the WinForms Converter | Add notes for the WinForms Converter
| Markdown | apache-2.0 | telerik/winforms-docs,telerik/winforms-docs,telerik/winforms-docs | markdown | ## Code Before:
---
title: Requirements
page_title: Requirements | WinForms Converter
description: This article explains which what you require in order to convert your projects.
slug: winforms/winforms-converter/requirements
tags: covert, winforms, requirements
published: True
position: 2
---
# Requirements
The following article lists what is required in order to be able to use the controls converter.
* __Visual Studio 2015 Update 2__
* __.NET 4.6.1__ - this is required if your Visual Studio does not have __Update 2__ installed. You can download it from [here](https://www.microsoft.com/en-us/download/details.aspx?id=49978).
* Solution that contains project with default .NET controls.
## See Also
* [Step-by-step tutorial]({%slug winforms/winforms-converter/step-by-step-tutorial%})
## Instruction:
Add notes for the WinForms Converter
## Code After:
---
title: Requirements
page_title: Requirements | WinForms Converter
description: This article explains which what you require in order to convert your projects.
slug: winforms/winforms-converter/requirements
tags: covert, winforms, requirements
published: True
position: 2
---
# Requirements
The following article lists what is required in order to be able to use the controls converter.
* __Visual Studio 2015 Update 2__
* __.NET 4.6.1__ - this is required if your Visual Studio does not have __Update 2__ installed. You can download it from [here](https://www.microsoft.com/en-us/download/details.aspx?id=49978).
* Solution that contains project with default .NET controls.
>important The WinForms converter crashes when converting a project with Visual Studio 2017 18.7 or newer. This is caused because in the latest version of Visual Studio a type used in the converter was moved. Additional information is available here: [WinForms Converter crashes with Visual Studio 15.8](https://docs.telerik.com/devtools/winforms/knowledge-base/converter-exception)
>important WinForms Converter is not available for VS 2019 yet because of breaking changes in Roslyn.
## See Also
* [Step-by-step tutorial]({%slug winforms/winforms-converter/step-by-step-tutorial%})
| ---
title: Requirements
page_title: Requirements | WinForms Converter
description: This article explains which what you require in order to convert your projects.
slug: winforms/winforms-converter/requirements
tags: covert, winforms, requirements
published: True
position: 2
---
# Requirements
The following article lists what is required in order to be able to use the controls converter.
* __Visual Studio 2015 Update 2__
* __.NET 4.6.1__ - this is required if your Visual Studio does not have __Update 2__ installed. You can download it from [here](https://www.microsoft.com/en-us/download/details.aspx?id=49978).
* Solution that contains project with default .NET controls.
+ >important The WinForms converter crashes when converting a project with Visual Studio 2017 18.7 or newer. This is caused because in the latest version of Visual Studio a type used in the converter was moved. Additional information is available here: [WinForms Converter crashes with Visual Studio 15.8](https://docs.telerik.com/devtools/winforms/knowledge-base/converter-exception)
+
+ >important WinForms Converter is not available for VS 2019 yet because of breaking changes in Roslyn.
+
## See Also
* [Step-by-step tutorial]({%slug winforms/winforms-converter/step-by-step-tutorial%})
| 4 | 0.166667 | 4 | 0 |
0498e1575f59880b4f7667f0d99bfbd993f2fcd5 | profiles/backends.py | profiles/backends.py | from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveModelBackend(ModelBackend):
def authenticate(email=None, password=None, **kwargs):
"""
Created by LNguyen(
Date: 14Dec2017
Description: Method to handle backend authentication for case insensitive usernames
If the given credentials are valid, return a User object.
"""
UserModel = get_user_model()
if email is None:
email=kwargs.get(UserModel.email)
try:
user=UserModel.objects.get(email__iexact=email)
user.backend = 'profiles.backends.CaseInsensitiveModelBackend'
if user.check_password(password):
return user
except UserModel.DoesNotExist:
# This backend doesn't accept these credentials as arguments. Try the next one.
UserModel().set_password(password)
| from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveModelBackend(ModelBackend):
def authenticate(email=None, password=None, **kwargs):
"""
Created by LNguyen(
Date: 14Dec2017
Description: Method to handle backend authentication for case insensitive usernames
If the given credentials are valid, return a User object.
"""
UserModel = get_user_model()
if email is None:
email=kwargs.get(UserModel.email)
try:
if (type(email)==str):
user=UserModel.objects.get(email__iexact=email)
else:
user=UserModel.objects.get(email__exact=email)
user.backend = 'profiles.backends.CaseInsensitiveModelBackend'
if user.check_password(password):
return user
except UserModel.DoesNotExist:
# This backend doesn't accept these credentials as arguments. Try the next one.
UserModel().set_password(password)
| Fix issues with changing passwords | Fix issues with changing passwords
| Python | mit | gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID | python | ## Code Before:
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveModelBackend(ModelBackend):
def authenticate(email=None, password=None, **kwargs):
"""
Created by LNguyen(
Date: 14Dec2017
Description: Method to handle backend authentication for case insensitive usernames
If the given credentials are valid, return a User object.
"""
UserModel = get_user_model()
if email is None:
email=kwargs.get(UserModel.email)
try:
user=UserModel.objects.get(email__iexact=email)
user.backend = 'profiles.backends.CaseInsensitiveModelBackend'
if user.check_password(password):
return user
except UserModel.DoesNotExist:
# This backend doesn't accept these credentials as arguments. Try the next one.
UserModel().set_password(password)
## Instruction:
Fix issues with changing passwords
## Code After:
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveModelBackend(ModelBackend):
def authenticate(email=None, password=None, **kwargs):
"""
Created by LNguyen(
Date: 14Dec2017
Description: Method to handle backend authentication for case insensitive usernames
If the given credentials are valid, return a User object.
"""
UserModel = get_user_model()
if email is None:
email=kwargs.get(UserModel.email)
try:
if (type(email)==str):
user=UserModel.objects.get(email__iexact=email)
else:
user=UserModel.objects.get(email__exact=email)
user.backend = 'profiles.backends.CaseInsensitiveModelBackend'
if user.check_password(password):
return user
except UserModel.DoesNotExist:
# This backend doesn't accept these credentials as arguments. Try the next one.
UserModel().set_password(password)
| from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveModelBackend(ModelBackend):
def authenticate(email=None, password=None, **kwargs):
"""
Created by LNguyen(
Date: 14Dec2017
Description: Method to handle backend authentication for case insensitive usernames
If the given credentials are valid, return a User object.
"""
UserModel = get_user_model()
if email is None:
email=kwargs.get(UserModel.email)
try:
+ if (type(email)==str):
- user=UserModel.objects.get(email__iexact=email)
+ user=UserModel.objects.get(email__iexact=email)
? +++
+ else:
+ user=UserModel.objects.get(email__exact=email)
user.backend = 'profiles.backends.CaseInsensitiveModelBackend'
if user.check_password(password):
return user
except UserModel.DoesNotExist:
# This backend doesn't accept these credentials as arguments. Try the next one.
UserModel().set_password(password)
| 5 | 0.178571 | 4 | 1 |
4f800c8bd7af1a8e40859477dac75035886c3850 | src/main/SchemaResolver.js | src/main/SchemaResolver.js | /**
* @class SchemaResolver
* Class exposing a method to resolve schema references to schema objects in a
* schema.
*/
define([
], function (
) {
return function(resolvers) {
/**
* Given the passed subobject walk its properties looking for $refs and
* replace them with the loaded schema.
* @param subobj - object to walk
* @param parent - parent of object if the $ref needs to be replaced.
* @param parentKey - key to replace $ref, if found.
*/
this.resolveRefs = function (subobj, parent, parentKey) {
if (!(subobj.tag && subobj.tag.resolved)) {
Object.keys(subobj).forEach(function (key, idx, obj) {
var val = subobj[key], value;
if (key === "$ref") {
resolvers.some(function (res) {
value = res(val);
return value;
});
if (value && value.tag && !value.tag.resolved) {
value.resolved = true;
this.resolveRefs(value, subobj, key);
}
parent[parentKey] = value;
} else if (typeof val === "object") {
this.resolveRefs(val, subobj, key);
}
}, this);
}
}
};
});
| /**
* @class SchemaResolver
* Class exposing a method to resolve schema references to schema objects in a
* schema.
*/
define([
], function (
) {
return function(resolvers) {
/**
* Given the passed subobject walk its properties looking for $refs and
* replace them with the loaded schema.
* @param subobj - object to walk
* @param parent - parent of object if the $ref needs to be replaced.
* @param parentKey - key to replace $ref, if found.
*/
this.resolveRefs = function (subobj, parent, parentKey) {
if (!(subobj.tag && subobj.tag.resolved)) {
Object.keys(subobj).forEach(function (key, idx, obj) {
var val = subobj[key], value;
if (key === "$ref") {
resolvers.some(function (res) {
value = res(val);
return value;
});
if (value && value.tag && !value.tag.resolved) {
value.resolved = true;
this.resolveRefs(value, subobj, key);
}
parent[parentKey] = value;
} else if (typeof val === "object" && !val.resolved) {
this.resolveRefs(val, subobj, key);
}
}, this);
}
}
};
});
| Fix missed resolve check on converted resolver. | Fix missed resolve check on converted resolver.
| JavaScript | apache-2.0 | atsid/schematic-js,atsid/schematic-js | javascript | ## Code Before:
/**
* @class SchemaResolver
* Class exposing a method to resolve schema references to schema objects in a
* schema.
*/
define([
], function (
) {
return function(resolvers) {
/**
* Given the passed subobject walk its properties looking for $refs and
* replace them with the loaded schema.
* @param subobj - object to walk
* @param parent - parent of object if the $ref needs to be replaced.
* @param parentKey - key to replace $ref, if found.
*/
this.resolveRefs = function (subobj, parent, parentKey) {
if (!(subobj.tag && subobj.tag.resolved)) {
Object.keys(subobj).forEach(function (key, idx, obj) {
var val = subobj[key], value;
if (key === "$ref") {
resolvers.some(function (res) {
value = res(val);
return value;
});
if (value && value.tag && !value.tag.resolved) {
value.resolved = true;
this.resolveRefs(value, subobj, key);
}
parent[parentKey] = value;
} else if (typeof val === "object") {
this.resolveRefs(val, subobj, key);
}
}, this);
}
}
};
});
## Instruction:
Fix missed resolve check on converted resolver.
## Code After:
/**
* @class SchemaResolver
* Class exposing a method to resolve schema references to schema objects in a
* schema.
*/
define([
], function (
) {
return function(resolvers) {
/**
* Given the passed subobject walk its properties looking for $refs and
* replace them with the loaded schema.
* @param subobj - object to walk
* @param parent - parent of object if the $ref needs to be replaced.
* @param parentKey - key to replace $ref, if found.
*/
this.resolveRefs = function (subobj, parent, parentKey) {
if (!(subobj.tag && subobj.tag.resolved)) {
Object.keys(subobj).forEach(function (key, idx, obj) {
var val = subobj[key], value;
if (key === "$ref") {
resolvers.some(function (res) {
value = res(val);
return value;
});
if (value && value.tag && !value.tag.resolved) {
value.resolved = true;
this.resolveRefs(value, subobj, key);
}
parent[parentKey] = value;
} else if (typeof val === "object" && !val.resolved) {
this.resolveRefs(val, subobj, key);
}
}, this);
}
}
};
});
| /**
* @class SchemaResolver
* Class exposing a method to resolve schema references to schema objects in a
* schema.
*/
define([
], function (
) {
return function(resolvers) {
/**
* Given the passed subobject walk its properties looking for $refs and
* replace them with the loaded schema.
* @param subobj - object to walk
* @param parent - parent of object if the $ref needs to be replaced.
* @param parentKey - key to replace $ref, if found.
*/
this.resolveRefs = function (subobj, parent, parentKey) {
if (!(subobj.tag && subobj.tag.resolved)) {
Object.keys(subobj).forEach(function (key, idx, obj) {
var val = subobj[key], value;
if (key === "$ref") {
resolvers.some(function (res) {
value = res(val);
return value;
});
if (value && value.tag && !value.tag.resolved) {
value.resolved = true;
this.resolveRefs(value, subobj, key);
}
parent[parentKey] = value;
- } else if (typeof val === "object") {
+ } else if (typeof val === "object" && !val.resolved) {
? +++++++++++++++++
this.resolveRefs(val, subobj, key);
}
}, this);
}
}
};
}); | 2 | 0.05 | 1 | 1 |
934c409756da664bc6a82d0c477beca242bfbc50 | js/app/utils.js | js/app/utils.js | define(["jquery", "underscore", "backbone"], function($, _, Backbone) {
var Utils = {};
Utils.logIn = function() {
$.ajax({
url: '/service/me/login',
async: false,
dataType: 'json'
});
};
Utils.loadView = function(viewToLoad) {
$('#page-content').html("");
if (typeof viewToLoad === 'function') {
new viewToLoad({
el: '#page-content'
});
} else {
viewToLoad.setElement('#page-content');
viewToLoad.render();
}
};
return Utils;
}); | define(["jquery", "underscore", "backbone"], function($, _, Backbone) {
var Utils = {};
Utils.logIn = function(response) {
$.ajax({
url: '/service/me/login?token=',
async: false,
dataType: 'json'
});
};
Utils.loadView = function(viewToLoad) {
$('#page-content').html("");
if (typeof viewToLoad === 'function') {
new viewToLoad({
el: '#page-content'
});
} else {
viewToLoad.setElement('#page-content');
viewToLoad.render();
}
};
return Utils;
}); | Prepare to pass OAuth token. | Prepare to pass OAuth token.
| JavaScript | mit | burnflare/CrowdBuy,burnflare/CrowdBuy | javascript | ## Code Before:
define(["jquery", "underscore", "backbone"], function($, _, Backbone) {
var Utils = {};
Utils.logIn = function() {
$.ajax({
url: '/service/me/login',
async: false,
dataType: 'json'
});
};
Utils.loadView = function(viewToLoad) {
$('#page-content').html("");
if (typeof viewToLoad === 'function') {
new viewToLoad({
el: '#page-content'
});
} else {
viewToLoad.setElement('#page-content');
viewToLoad.render();
}
};
return Utils;
});
## Instruction:
Prepare to pass OAuth token.
## Code After:
define(["jquery", "underscore", "backbone"], function($, _, Backbone) {
var Utils = {};
Utils.logIn = function(response) {
$.ajax({
url: '/service/me/login?token=',
async: false,
dataType: 'json'
});
};
Utils.loadView = function(viewToLoad) {
$('#page-content').html("");
if (typeof viewToLoad === 'function') {
new viewToLoad({
el: '#page-content'
});
} else {
viewToLoad.setElement('#page-content');
viewToLoad.render();
}
};
return Utils;
}); | define(["jquery", "underscore", "backbone"], function($, _, Backbone) {
var Utils = {};
- Utils.logIn = function() {
+ Utils.logIn = function(response) {
? ++++++++
$.ajax({
- url: '/service/me/login',
+ url: '/service/me/login?token=',
? +++++++
async: false,
dataType: 'json'
});
};
Utils.loadView = function(viewToLoad) {
$('#page-content').html("");
if (typeof viewToLoad === 'function') {
new viewToLoad({
el: '#page-content'
});
} else {
viewToLoad.setElement('#page-content');
viewToLoad.render();
}
};
return Utils;
}); | 4 | 0.16 | 2 | 2 |
6102d23428644383bf771cd79d5f0ba8f1df097c | README.md | README.md |
FontPainter is a javascript library to do custom web font rendering in the browser.
## Font support
FontPainter currently has the following limitations for font rendering:
- Only support horizontal type
- Only supports LTR type
- Only parses .svg format fonts
|
FontPainter is a javascript library to do custom web font rendering in the browser.
## API Documentation
API documentation is rendered using TypeDoc. You can view the rendered docs at
https://flut1.github.io/fontpainter/
## Font support
FontPainter currently has the following limitations for font rendering:
- Only support horizontal type
- Only supports LTR type
- Only parses .svg format fonts
| Add link do docs in readme | Add link do docs in readme
| Markdown | mit | flut1/fontpainter,flut1/fontpainter,flut1/fontpainter | markdown | ## Code Before:
FontPainter is a javascript library to do custom web font rendering in the browser.
## Font support
FontPainter currently has the following limitations for font rendering:
- Only support horizontal type
- Only supports LTR type
- Only parses .svg format fonts
## Instruction:
Add link do docs in readme
## Code After:
FontPainter is a javascript library to do custom web font rendering in the browser.
## API Documentation
API documentation is rendered using TypeDoc. You can view the rendered docs at
https://flut1.github.io/fontpainter/
## Font support
FontPainter currently has the following limitations for font rendering:
- Only support horizontal type
- Only supports LTR type
- Only parses .svg format fonts
|
FontPainter is a javascript library to do custom web font rendering in the browser.
+
+ ## API Documentation
+ API documentation is rendered using TypeDoc. You can view the rendered docs at
+ https://flut1.github.io/fontpainter/
## Font support
FontPainter currently has the following limitations for font rendering:
- Only support horizontal type
- Only supports LTR type
- Only parses .svg format fonts
| 4 | 0.444444 | 4 | 0 |
9a24a8efe2a349dd2d740937c18718194f499cde | app/components/admin/search_component.html.erb | app/components/admin/search_component.html.erb | <div class="small-12 medium-6">
<%= form_for(User.new, url: url, as: :user, method: :get) do |f| %>
<div class="input-group">
<%= text_field_tag :name_or_email, params[:name_or_email].to_s, placeholder: t("admin.shared.user_search.placeholder") %>
<div class="input-group-button">
<%= f.submit t("admin.shared.user_search.button"), class: "button" %>
</div>
</div>
<% end %>
</div>
| <div class="small-12 medium-6">
<%= form_tag(url, method: :get) do |f| %>
<div class="input-group">
<%= text_field_tag :name_or_email, params[:name_or_email].to_s, placeholder: t("admin.shared.user_search.placeholder") %>
<div class="input-group-button">
<%= submit_tag t("admin.shared.user_search.button"), class: "button" %>
</div>
</div>
<% end %>
</div>
| Use form_tag in search form | Use form_tag in search form
This form does not depend on an object at all, so we can use a generic
tag which is model-independent.
| HTML+ERB | agpl-3.0 | consul/consul,consul/consul,consul/consul,consul/consul,consul/consul | html+erb | ## Code Before:
<div class="small-12 medium-6">
<%= form_for(User.new, url: url, as: :user, method: :get) do |f| %>
<div class="input-group">
<%= text_field_tag :name_or_email, params[:name_or_email].to_s, placeholder: t("admin.shared.user_search.placeholder") %>
<div class="input-group-button">
<%= f.submit t("admin.shared.user_search.button"), class: "button" %>
</div>
</div>
<% end %>
</div>
## Instruction:
Use form_tag in search form
This form does not depend on an object at all, so we can use a generic
tag which is model-independent.
## Code After:
<div class="small-12 medium-6">
<%= form_tag(url, method: :get) do |f| %>
<div class="input-group">
<%= text_field_tag :name_or_email, params[:name_or_email].to_s, placeholder: t("admin.shared.user_search.placeholder") %>
<div class="input-group-button">
<%= submit_tag t("admin.shared.user_search.button"), class: "button" %>
</div>
</div>
<% end %>
</div>
| <div class="small-12 medium-6">
- <%= form_for(User.new, url: url, as: :user, method: :get) do |f| %>
+ <%= form_tag(url, method: :get) do |f| %>
<div class="input-group">
<%= text_field_tag :name_or_email, params[:name_or_email].to_s, placeholder: t("admin.shared.user_search.placeholder") %>
<div class="input-group-button">
- <%= f.submit t("admin.shared.user_search.button"), class: "button" %>
? --
+ <%= submit_tag t("admin.shared.user_search.button"), class: "button" %>
? ++++
</div>
</div>
<% end %>
</div> | 4 | 0.4 | 2 | 2 |
7a03c6e0131e3e592e1a7c7ea041217e8bc56bff | plugins/provisioners/docker/cap/linux/docker_installed.rb | plugins/provisioners/docker/cap/linux/docker_installed.rb | module VagrantPlugins
module DockerProvisioner
module Cap
module Linux
module DockerInstalled
def self.docker_installed(machine)
paths = [
"/usr/bin/docker",
"/usr/local/bin/docker",
"/usr/sbin/docker",
]
paths.each do |p|
if machine.communicate.test("test -f #{p}", sudo: true)
return true
end
end
return false
end
end
end
end
end
end
| module VagrantPlugins
module DockerProvisioner
module Cap
module Linux
module DockerInstalled
def self.docker_installed(machine)
paths = [
"/bin/docker",
"/usr/bin/docker",
"/usr/local/bin/docker",
"/usr/sbin/docker",
]
paths.each do |p|
if machine.communicate.test("test -f #{p}", sudo: true)
return true
end
end
return false
end
end
end
end
end
end
| Add /bin/docker to path list for installation verification | Add /bin/docker to path list for installation verification
| Ruby | mit | crashlytics/vagrant,bdwyertech/vagrant,mwrock/vagrant,PatrickLang/vagrant,sni/vagrant,PatrickLang/vagrant,marxarelli/vagrant,jtopper/vagrant,jtopper/vagrant,bryson/vagrant,bshurts/vagrant,mwrock/vagrant,mitchellh/vagrant,benh57/vagrant,justincampbell/vagrant,bshurts/vagrant,jtopper/vagrant,chrisroberts/vagrant,taliesins/vagrant,crashlytics/vagrant,chrisroberts/vagrant,taliesins/vagrant,PatrickLang/vagrant,bdwyertech/vagrant,marxarelli/vagrant,mitchellh/vagrant,taliesins/vagrant,sni/vagrant,bdwyertech/vagrant,sni/vagrant,chrisroberts/vagrant,bryson/vagrant,bdwyertech/vagrant,crashlytics/vagrant,marxarelli/vagrant,gitebra/vagrant,marxarelli/vagrant,chrisroberts/vagrant,gitebra/vagrant,benh57/vagrant,PatrickLang/vagrant,mitchellh/vagrant,taliesins/vagrant,mitchellh/vagrant,jtopper/vagrant,benh57/vagrant,bryson/vagrant,gitebra/vagrant,mwrock/vagrant,crashlytics/vagrant,justincampbell/vagrant,bshurts/vagrant,justincampbell/vagrant,gitebra/vagrant,bshurts/vagrant,mwrock/vagrant,sni/vagrant,justincampbell/vagrant,bryson/vagrant,benh57/vagrant | ruby | ## Code Before:
module VagrantPlugins
module DockerProvisioner
module Cap
module Linux
module DockerInstalled
def self.docker_installed(machine)
paths = [
"/usr/bin/docker",
"/usr/local/bin/docker",
"/usr/sbin/docker",
]
paths.each do |p|
if machine.communicate.test("test -f #{p}", sudo: true)
return true
end
end
return false
end
end
end
end
end
end
## Instruction:
Add /bin/docker to path list for installation verification
## Code After:
module VagrantPlugins
module DockerProvisioner
module Cap
module Linux
module DockerInstalled
def self.docker_installed(machine)
paths = [
"/bin/docker",
"/usr/bin/docker",
"/usr/local/bin/docker",
"/usr/sbin/docker",
]
paths.each do |p|
if machine.communicate.test("test -f #{p}", sudo: true)
return true
end
end
return false
end
end
end
end
end
end
| module VagrantPlugins
module DockerProvisioner
module Cap
module Linux
module DockerInstalled
def self.docker_installed(machine)
paths = [
+ "/bin/docker",
"/usr/bin/docker",
"/usr/local/bin/docker",
"/usr/sbin/docker",
]
paths.each do |p|
if machine.communicate.test("test -f #{p}", sudo: true)
return true
end
end
return false
end
end
end
end
end
end | 1 | 0.04 | 1 | 0 |
2c739b8d663827dd610f9c2e4562797b72f56ce3 | lib/kosapi_client/oauth2_http_adapter.rb | lib/kosapi_client/oauth2_http_adapter.rb | require 'oauth2'
module KOSapiClient
class OAuth2HttpAdapter
DEFAULT_AUTH_URL = 'https://auth.fit.cvut.cz/oauth/oauth/authorize'
DEFAULT_TOKEN_URL = 'https://auth.fit.cvut.cz/oauth/oauth/token'
def initialize(credentials, root_url, opts = {})
auth_url = opts[:auth_url] || DEFAULT_AUTH_URL
token_url = opts[:token_url] || DEFAULT_TOKEN_URL
@client = OAuth2::Client.new(credentials[:client_id], credentials[:client_secret], site: root_url, authorize_url: auth_url, token_url: token_url)
end
def get(url, options = {})
send_request(:get, url, options)
end
def send_request(verb, url, options = {})
result = token.request(verb, url, options)
KOSapiClient::HTTPResponse.new(result)
end
private
def authenticate
@token = @client.client_credentials.get_token
end
def token
authenticate if !@token || @token.expired?
@token
end
end
end
| require 'oauth2'
module KOSapiClient
class OAuth2HttpAdapter
DEFAULT_AUTH_URL = 'https://auth.fit.cvut.cz/oauth/oauth/authorize'
DEFAULT_TOKEN_URL = 'https://auth.fit.cvut.cz/oauth/oauth/token'
def initialize(credentials, root_url, opts = {})
auth_url = opts[:auth_url] || DEFAULT_AUTH_URL
token_url = opts[:token_url] || DEFAULT_TOKEN_URL
MultiXml.parser = :ox # make sure to use Ox because of different namespace handling in other MultiXML parsers
@client = OAuth2::Client.new(credentials[:client_id], credentials[:client_secret], site: root_url, authorize_url: auth_url, token_url: token_url)
end
def get(url, options = {})
send_request(:get, url, options)
end
def send_request(verb, url, options = {})
result = token.request(verb, url, options)
KOSapiClient::HTTPResponse.new(result)
end
private
def authenticate
@token = @client.client_credentials.get_token
end
def token
authenticate if !@token || @token.expired?
@token
end
end
end
| Set Ox as default MultiXML parser. | Set Ox as default MultiXML parser.
| Ruby | mit | cvut/kosapi_client.rb,cvut/kosapi_client.rb | ruby | ## Code Before:
require 'oauth2'
module KOSapiClient
class OAuth2HttpAdapter
DEFAULT_AUTH_URL = 'https://auth.fit.cvut.cz/oauth/oauth/authorize'
DEFAULT_TOKEN_URL = 'https://auth.fit.cvut.cz/oauth/oauth/token'
def initialize(credentials, root_url, opts = {})
auth_url = opts[:auth_url] || DEFAULT_AUTH_URL
token_url = opts[:token_url] || DEFAULT_TOKEN_URL
@client = OAuth2::Client.new(credentials[:client_id], credentials[:client_secret], site: root_url, authorize_url: auth_url, token_url: token_url)
end
def get(url, options = {})
send_request(:get, url, options)
end
def send_request(verb, url, options = {})
result = token.request(verb, url, options)
KOSapiClient::HTTPResponse.new(result)
end
private
def authenticate
@token = @client.client_credentials.get_token
end
def token
authenticate if !@token || @token.expired?
@token
end
end
end
## Instruction:
Set Ox as default MultiXML parser.
## Code After:
require 'oauth2'
module KOSapiClient
class OAuth2HttpAdapter
DEFAULT_AUTH_URL = 'https://auth.fit.cvut.cz/oauth/oauth/authorize'
DEFAULT_TOKEN_URL = 'https://auth.fit.cvut.cz/oauth/oauth/token'
def initialize(credentials, root_url, opts = {})
auth_url = opts[:auth_url] || DEFAULT_AUTH_URL
token_url = opts[:token_url] || DEFAULT_TOKEN_URL
MultiXml.parser = :ox # make sure to use Ox because of different namespace handling in other MultiXML parsers
@client = OAuth2::Client.new(credentials[:client_id], credentials[:client_secret], site: root_url, authorize_url: auth_url, token_url: token_url)
end
def get(url, options = {})
send_request(:get, url, options)
end
def send_request(verb, url, options = {})
result = token.request(verb, url, options)
KOSapiClient::HTTPResponse.new(result)
end
private
def authenticate
@token = @client.client_credentials.get_token
end
def token
authenticate if !@token || @token.expired?
@token
end
end
end
| require 'oauth2'
module KOSapiClient
class OAuth2HttpAdapter
DEFAULT_AUTH_URL = 'https://auth.fit.cvut.cz/oauth/oauth/authorize'
DEFAULT_TOKEN_URL = 'https://auth.fit.cvut.cz/oauth/oauth/token'
def initialize(credentials, root_url, opts = {})
auth_url = opts[:auth_url] || DEFAULT_AUTH_URL
token_url = opts[:token_url] || DEFAULT_TOKEN_URL
+ MultiXml.parser = :ox # make sure to use Ox because of different namespace handling in other MultiXML parsers
@client = OAuth2::Client.new(credentials[:client_id], credentials[:client_secret], site: root_url, authorize_url: auth_url, token_url: token_url)
end
def get(url, options = {})
send_request(:get, url, options)
end
def send_request(verb, url, options = {})
result = token.request(verb, url, options)
KOSapiClient::HTTPResponse.new(result)
end
private
def authenticate
@token = @client.client_credentials.get_token
end
def token
authenticate if !@token || @token.expired?
@token
end
end
end
| 1 | 0.028571 | 1 | 0 |
4c927b055f5ea0f1095ed5a6eb68253f0c004733 | src/Conversation/Conversation.js | src/Conversation/Conversation.js | import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
| import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
if (this.state.messagesToBeDisplayed.length === 0) {
clearInterval(this.timer);
} else {
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
| Stop the interval when all messages have been displadyed | Stop the interval when all messages have been displadyed
| JavaScript | mit | sevenleaps/chat-template,sevenleaps/chat-template | javascript | ## Code Before:
import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
## Instruction:
Stop the interval when all messages have been displadyed
## Code After:
import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
if (this.state.messagesToBeDisplayed.length === 0) {
clearInterval(this.timer);
} else {
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
| import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
+ if (this.state.messagesToBeDisplayed.length === 0) {
+ clearInterval(this.timer);
+ } else {
- messages.push(this.state.messagesToBeDisplayed.pop());
+ messages.push(this.state.messagesToBeDisplayed.pop());
? ++
+ this.setState({
+ messages,
+ messagesToBeDisplayed
+ });
- this.setState({
- messages,
- messagesToBeDisplayed
- });
? --
+ }
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation; | 14 | 0.229508 | 9 | 5 |
0b41bdf6897bb070fc3d90aa5d90228e744dee60 | sunpy/util/map_manager.py | sunpy/util/map_manager.py | import weakref
import sunpy
class MapManager(weakref.WeakSet):
"""Weak referenced set of maps created using functions decorated by manage_maps."""
def __repr__(self):
return str(self.data)
def manage_maps(fn):
"""Maps returned by functions decorated with manage_maps (eg. sunpy.make_map)
will be registered in the sunpy.map_manager list."""
def fn_manage_maps(*args, **kwargs):
ret = fn(*args, **kwargs)
sunpy.map_manager.add(ret)
return ret
return fn_manage_maps
| import weakref
import sunpy
class MapManager(weakref.WeakSet):
"""Weak referenced set of maps created using functions decorated by manage_maps."""
pass
def manage_maps(fn):
"""Maps returned by functions decorated with manage_maps (eg. sunpy.make_map)
will be registered in the sunpy.map_manager list."""
def fn_manage_maps(*args, **kwargs):
ret = fn(*args, **kwargs)
sunpy.map_manager.add(ret)
return ret
return fn_manage_maps
| Remove manager repr (user should not need to view contents) | Remove manager repr (user should not need to view contents)
| Python | bsd-2-clause | mjm159/sunpy,dpshelio/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy,Alex-Ian-Hamilton/sunpy,mjm159/sunpy | python | ## Code Before:
import weakref
import sunpy
class MapManager(weakref.WeakSet):
"""Weak referenced set of maps created using functions decorated by manage_maps."""
def __repr__(self):
return str(self.data)
def manage_maps(fn):
"""Maps returned by functions decorated with manage_maps (eg. sunpy.make_map)
will be registered in the sunpy.map_manager list."""
def fn_manage_maps(*args, **kwargs):
ret = fn(*args, **kwargs)
sunpy.map_manager.add(ret)
return ret
return fn_manage_maps
## Instruction:
Remove manager repr (user should not need to view contents)
## Code After:
import weakref
import sunpy
class MapManager(weakref.WeakSet):
"""Weak referenced set of maps created using functions decorated by manage_maps."""
pass
def manage_maps(fn):
"""Maps returned by functions decorated with manage_maps (eg. sunpy.make_map)
will be registered in the sunpy.map_manager list."""
def fn_manage_maps(*args, **kwargs):
ret = fn(*args, **kwargs)
sunpy.map_manager.add(ret)
return ret
return fn_manage_maps
| import weakref
import sunpy
class MapManager(weakref.WeakSet):
"""Weak referenced set of maps created using functions decorated by manage_maps."""
+ pass
-
- def __repr__(self):
- return str(self.data)
def manage_maps(fn):
"""Maps returned by functions decorated with manage_maps (eg. sunpy.make_map)
will be registered in the sunpy.map_manager list."""
def fn_manage_maps(*args, **kwargs):
ret = fn(*args, **kwargs)
sunpy.map_manager.add(ret)
return ret
return fn_manage_maps | 4 | 0.222222 | 1 | 3 |
721668156130ffeb9f724ce9efc8f1f0d8c7f6f2 | tests/quick/se/70.tgen/tgen-simple-dram.cfg | tests/quick/se/70.tgen/tgen-simple-dram.cfg | STATE 0 100 IDLE
#STATE 1 10000000000 TRACE tests/quick/se/70.tgen/tgen-simple-dram.trc 0
#STATE 1 1000000000 RANDOM 101 0 134217728 64 2000 2000 0
STATE 1 1000000000 LINEAR 100 0 134217728 64 2000 2000 0
INIT 0
TRANSITION 0 1 1
TRANSITION 1 1 1
| STATE 0 100 IDLE
STATE 1 1000000000 LINEAR 100 0 134217728 64 30000 30000 0
INIT 0
TRANSITION 0 1 1
TRANSITION 1 1 1
| Reduce DRAM controller regression traffic rate | config: Reduce DRAM controller regression traffic rate
This patch changes the traffic generator period such that it does not
completely saturate the DRAM controller and create an ever-growing
backlog in the queued port.
A separate patch updates the stats.
| INI | bsd-3-clause | gem5/gem5,gedare/gem5,austinharris/gem5-riscv,briancoutinho0905/2dsampling,powerjg/gem5-ci-test,qizenguf/MLC-STT,HwisooSo/gemV-update,Weil0ng/gem5,Weil0ng/gem5,powerjg/gem5-ci-test,HwisooSo/gemV-update,cancro7/gem5,cancro7/gem5,joerocklin/gem5,briancoutinho0905/2dsampling,KuroeKurose/gem5,markoshorro/gem5,joerocklin/gem5,markoshorro/gem5,aclifton/cpeg853-gem5,gem5/gem5,qizenguf/MLC-STT,SanchayanMaity/gem5,sobercoder/gem5,TUD-OS/gem5-dtu,kaiyuanl/gem5,samueldotj/TeeRISC-Simulator,aclifton/cpeg853-gem5,samueldotj/TeeRISC-Simulator,aclifton/cpeg853-gem5,joerocklin/gem5,joerocklin/gem5,sobercoder/gem5,gedare/gem5,zlfben/gem5,KuroeKurose/gem5,KuroeKurose/gem5,rallylee/gem5,powerjg/gem5-ci-test,qizenguf/MLC-STT,kaiyuanl/gem5,yb-kim/gemV,TUD-OS/gem5-dtu,gedare/gem5,samueldotj/TeeRISC-Simulator,cancro7/gem5,gem5/gem5,qizenguf/MLC-STT,zlfben/gem5,SanchayanMaity/gem5,gedare/gem5,rjschof/gem5,aclifton/cpeg853-gem5,kaiyuanl/gem5,kaiyuanl/gem5,aclifton/cpeg853-gem5,Weil0ng/gem5,rjschof/gem5,HwisooSo/gemV-update,SanchayanMaity/gem5,rallylee/gem5,TUD-OS/gem5-dtu,austinharris/gem5-riscv,HwisooSo/gemV-update,sobercoder/gem5,joerocklin/gem5,zlfben/gem5,austinharris/gem5-riscv,sobercoder/gem5,aclifton/cpeg853-gem5,markoshorro/gem5,SanchayanMaity/gem5,yb-kim/gemV,HwisooSo/gemV-update,sobercoder/gem5,qizenguf/MLC-STT,zlfben/gem5,zlfben/gem5,rjschof/gem5,markoshorro/gem5,TUD-OS/gem5-dtu,yb-kim/gemV,rallylee/gem5,joerocklin/gem5,SanchayanMaity/gem5,KuroeKurose/gem5,rjschof/gem5,joerocklin/gem5,yb-kim/gemV,TUD-OS/gem5-dtu,markoshorro/gem5,briancoutinho0905/2dsampling,KuroeKurose/gem5,sobercoder/gem5,Weil0ng/gem5,sobercoder/gem5,kaiyuanl/gem5,TUD-OS/gem5-dtu,gem5/gem5,gedare/gem5,SanchayanMaity/gem5,zlfben/gem5,zlfben/gem5,KuroeKurose/gem5,gedare/gem5,HwisooSo/gemV-update,markoshorro/gem5,cancro7/gem5,TUD-OS/gem5-dtu,briancoutinho0905/2dsampling,powerjg/gem5-ci-test,powerjg/gem5-ci-test,rjschof/gem5,qizenguf/MLC-STT,gem5/gem5,rjschof/gem5,Weil0ng/gem5,gem5/gem5,rallylee/gem5,kaiyuanl/gem5,austinharris/gem5-riscv,yb-kim/gemV,samueldotj/TeeRISC-Simulator,samueldotj/TeeRISC-Simulator,cancro7/gem5,gem5/gem5,yb-kim/gemV,austinharris/gem5-riscv,Weil0ng/gem5,rallylee/gem5,powerjg/gem5-ci-test,kaiyuanl/gem5,austinharris/gem5-riscv,cancro7/gem5,markoshorro/gem5,samueldotj/TeeRISC-Simulator,briancoutinho0905/2dsampling,austinharris/gem5-riscv,yb-kim/gemV,qizenguf/MLC-STT,briancoutinho0905/2dsampling,gedare/gem5,SanchayanMaity/gem5,Weil0ng/gem5,rjschof/gem5,samueldotj/TeeRISC-Simulator,KuroeKurose/gem5,briancoutinho0905/2dsampling,joerocklin/gem5,cancro7/gem5,HwisooSo/gemV-update,powerjg/gem5-ci-test,rallylee/gem5,yb-kim/gemV,aclifton/cpeg853-gem5,rallylee/gem5 | ini | ## Code Before:
STATE 0 100 IDLE
#STATE 1 10000000000 TRACE tests/quick/se/70.tgen/tgen-simple-dram.trc 0
#STATE 1 1000000000 RANDOM 101 0 134217728 64 2000 2000 0
STATE 1 1000000000 LINEAR 100 0 134217728 64 2000 2000 0
INIT 0
TRANSITION 0 1 1
TRANSITION 1 1 1
## Instruction:
config: Reduce DRAM controller regression traffic rate
This patch changes the traffic generator period such that it does not
completely saturate the DRAM controller and create an ever-growing
backlog in the queued port.
A separate patch updates the stats.
## Code After:
STATE 0 100 IDLE
STATE 1 1000000000 LINEAR 100 0 134217728 64 30000 30000 0
INIT 0
TRANSITION 0 1 1
TRANSITION 1 1 1
| STATE 0 100 IDLE
- #STATE 1 10000000000 TRACE tests/quick/se/70.tgen/tgen-simple-dram.trc 0
- #STATE 1 1000000000 RANDOM 101 0 134217728 64 2000 2000 0
- STATE 1 1000000000 LINEAR 100 0 134217728 64 2000 2000 0
? ^ ^
+ STATE 1 1000000000 LINEAR 100 0 134217728 64 30000 30000 0
? ^^ ^^
INIT 0
TRANSITION 0 1 1
TRANSITION 1 1 1 | 4 | 0.571429 | 1 | 3 |
7caef6417b9dc6bb0498cf267972c658f68f83e5 | spec/mongoid/query_cache_spec.rb | spec/mongoid/query_cache_spec.rb | require "spec_helper"
describe Mongoid::QueryCache do
context "when querying in the same collection" do
before do
Band.all.to_a
end
context "with same selector" do
it "does not query again" do
expect_no_queries do
Band.all.to_a
end
end
end
context "with different selector" do
it "queries again" do
expect_query(1) do
Band.where(id: 1).to_a
end
end
end
end
context "when querying in different collection" do
before do
Person.all.to_a
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
end
| require "spec_helper"
describe Mongoid::QueryCache do
context "when querying in the same collection" do
before do
Band.all.to_a
end
context "with same selector" do
it "does not query again" do
expect_no_queries do
Band.all.to_a
end
end
end
context "with different selector" do
it "queries again" do
expect_query(1) do
Band.where(id: 1).to_a
end
end
end
end
context "when querying in different collection" do
before do
Person.all.to_a
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when inserting a new document" do
before do
Band.all.to_a
Band.create!
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when deleting all documents" do
before do
Band.create!
Band.all.to_a
Band.delete_all
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when destroying all documents" do
before do
Band.create!
Band.all.to_a
Band.destroy_all
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when inserting an index" do
it "does not cache the query" do
expect(Mongoid::QueryCache).to receive(:cache_table).never
Band.collection.indexes.create(name: 1)
end
end
end
| Add more tests to query cache | Add more tests to query cache
| Ruby | mit | sivagollapalli/mongoid,narutosanjiv/mongoid,jbrien/mongoid,timgluz/mongoid,kayakyakr/mongoid,hxx/mongoid,sivagollapalli/mongoid,tricknotes/mongoid,drobune/mongoid,zenjoy/mongoid,rpocklin/mongoid,tricknotes/mongoid,zBMNForks/mongoid,nusco/mongoid,zaithottakath/mongoid,estolfo/mongoid,simi/mongoid,nviennot/mongoid,joshsoftware/mongoid,uniiverse/mongoid,karmakaze/mongoid,canvas-drw/mongoid,drobune/mongoid,etomic/mongoid,karmakaze/mongoid,Welovroi/mongoid,estolfo/mongoid,nusco/mongoid,arnkorty/mongoid,codedogfish/mongoid,mongodb/mongoid,trmmy/mongoid,hashrocketeer/mongoid,PerfectMemory/mongoid,Azzurrio/mongoid,johnny-miyake/mongoid,PerfectMemory/mongoid,bencrouse/mongoid,amw/mongoid,imomoisoft/mongoid,jonhyman/mongoid,asantamar/mongoid,Zhomart/mongoid,rinmu/mongoid,kay-kim/mongoid,jbrien/mongoid,nicolasblanco/mongoid,parov/mongoid,cao7113/mongoid,narutosanjiv/mongoid,bjori/mongoid,codedogfish/mongoid,hashrocketeer/mongoid,itbakery/mongoid,kentaroi/mongoid,bencrouse/mongoid,canvas-drw/mongoid,parov/mongoid,arnkorty/mongoid,mysociety/mongoid,rafaelgaspar/mongoid,mysociety/mongoid,demarque/mongoid,glebtv/mongoid,zenjoy/mongoid,asantamar/mongoid,nviennot/mongoid,mongodb/mongoid,jonhyman/mongoid,rafaelgaspar/mongoid,itbakery/mongoid,Welovroi/mongoid,mongoid/mongoid,sideci-sample/sideci-sample-mongoid,kay-kim/mongoid,stnguyen/mongoid,herimedia/mongoid,joshsoftware/mongoid,tzar/mongoid,infiverve/mongoid,demarque/mongoid,wuboy0307/mongoid,kayakyakr/mongoid,eljojo/mongoid,sideci-sample/sideci-sample-mongoid,hxx/mongoid,wuboy0307/mongoid,bjori/mongoid,Sharevari-Inc/mongoid,etomic/mongoid,matbox/mongoid,subhashb/mongoid,herimedia/mongoid,subhashb/mongoid,mongoid/mongoid,Zhomart/mongoid,trmmy/mongoid,infiverve/mongoid,Azzurrio/mongoid,cao7113/mongoid,matbox/mongoid,rinmu/mongoid,zBMNForks/mongoid,rpocklin/mongoid,amw/mongoid,kcdragon/mongoid,glebtv/mongoid,Sharevari-Inc/mongoid,eljojo/mongoid,zaithottakath/mongoid,imomoisoft/mongoid,tzar/mongoid,uniiverse/mongoid,timgluz/mongoid,mongodb/mongoid,simi/mongoid,johnny-miyake/mongoid,stnguyen/mongoid,kcdragon/mongoid,kentaroi/mongoid | ruby | ## Code Before:
require "spec_helper"
describe Mongoid::QueryCache do
context "when querying in the same collection" do
before do
Band.all.to_a
end
context "with same selector" do
it "does not query again" do
expect_no_queries do
Band.all.to_a
end
end
end
context "with different selector" do
it "queries again" do
expect_query(1) do
Band.where(id: 1).to_a
end
end
end
end
context "when querying in different collection" do
before do
Person.all.to_a
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
end
## Instruction:
Add more tests to query cache
## Code After:
require "spec_helper"
describe Mongoid::QueryCache do
context "when querying in the same collection" do
before do
Band.all.to_a
end
context "with same selector" do
it "does not query again" do
expect_no_queries do
Band.all.to_a
end
end
end
context "with different selector" do
it "queries again" do
expect_query(1) do
Band.where(id: 1).to_a
end
end
end
end
context "when querying in different collection" do
before do
Person.all.to_a
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when inserting a new document" do
before do
Band.all.to_a
Band.create!
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when deleting all documents" do
before do
Band.create!
Band.all.to_a
Band.delete_all
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when destroying all documents" do
before do
Band.create!
Band.all.to_a
Band.destroy_all
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
context "when inserting an index" do
it "does not cache the query" do
expect(Mongoid::QueryCache).to receive(:cache_table).never
Band.collection.indexes.create(name: 1)
end
end
end
| require "spec_helper"
describe Mongoid::QueryCache do
context "when querying in the same collection" do
before do
Band.all.to_a
end
context "with same selector" do
it "does not query again" do
expect_no_queries do
Band.all.to_a
end
end
end
context "with different selector" do
it "queries again" do
expect_query(1) do
Band.where(id: 1).to_a
end
end
end
end
context "when querying in different collection" do
before do
Person.all.to_a
end
it "queries again" do
expect_query(1) do
Band.all.to_a
end
end
end
+
+ context "when inserting a new document" do
+
+ before do
+ Band.all.to_a
+ Band.create!
+ end
+
+ it "queries again" do
+ expect_query(1) do
+ Band.all.to_a
+ end
+ end
+ end
+
+ context "when deleting all documents" do
+
+ before do
+ Band.create!
+ Band.all.to_a
+ Band.delete_all
+ end
+
+ it "queries again" do
+ expect_query(1) do
+ Band.all.to_a
+ end
+ end
+ end
+
+ context "when destroying all documents" do
+
+ before do
+ Band.create!
+ Band.all.to_a
+ Band.destroy_all
+ end
+
+ it "queries again" do
+ expect_query(1) do
+ Band.all.to_a
+ end
+ end
+ end
+
+ context "when inserting an index" do
+
+ it "does not cache the query" do
+ expect(Mongoid::QueryCache).to receive(:cache_table).never
+ Band.collection.indexes.create(name: 1)
+ end
+ end
end | 52 | 1.238095 | 52 | 0 |
a76a994399ed2604e4e627f3e9c42edd255a89f9 | app/assets/stylesheets/gend_image_pages.css.scss | app/assets/stylesheets/gend_image_pages.css.scss | // Place all the styles related to the GendImagePages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.meme-meta {
margin-top: 10px;
}
a.btn {
margin-top: 4px;
}
blockquote h1 {
font-weight: normal;
font-size: 14px;
line-height: 20px;
}
.qr {
margin: auto;
} | // Place all the styles related to the GendImagePages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.meme-meta {
margin-top: 10px;
word-wrap: break-word;
}
a.btn {
margin-top: 4px;
}
blockquote h1 {
font-weight: normal;
font-size: 14px;
line-height: 20px;
}
.qr {
margin: auto;
}
| Break long links on gend image page for mobile. | Break long links on gend image page for mobile.
| SCSS | mit | mmb/meme_captain_web,mmb/meme_captain_web,mmb/meme_captain_web,mmb/meme_captain_web | scss | ## Code Before:
// Place all the styles related to the GendImagePages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.meme-meta {
margin-top: 10px;
}
a.btn {
margin-top: 4px;
}
blockquote h1 {
font-weight: normal;
font-size: 14px;
line-height: 20px;
}
.qr {
margin: auto;
}
## Instruction:
Break long links on gend image page for mobile.
## Code After:
// Place all the styles related to the GendImagePages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.meme-meta {
margin-top: 10px;
word-wrap: break-word;
}
a.btn {
margin-top: 4px;
}
blockquote h1 {
font-weight: normal;
font-size: 14px;
line-height: 20px;
}
.qr {
margin: auto;
}
| // Place all the styles related to the GendImagePages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.meme-meta {
margin-top: 10px;
+ word-wrap: break-word;
}
a.btn {
margin-top: 4px;
}
blockquote h1 {
font-weight: normal;
font-size: 14px;
line-height: 20px;
}
.qr {
margin: auto;
} | 1 | 0.047619 | 1 | 0 |
01db92eb2f195c5b1fdb58399601ff014f99b992 | py2app/apptemplate/lib/__error__.sh | py2app/apptemplate/lib/__error__.sh | if ( test -n "$2" ) ; then
echo "$1 Error"
echo "An unexpected error has occurred during execution of the main script"
echo ""
echo "$2: $3"
echo ""
echo "See the Console for a detailed traceback."
else
echo "$1 Error"
echo "MacPython 2.3 is required to run this application.";
echo "ERRORURL: http://homepages.cwi.nl/~jack/macpython/index.html Visit the MacPython Website";
fi
| if ( test -n "$2" ) ; then
echo "$1 Error"
echo "An unexpected error has occurred during execution of the main script"
echo ""
echo "$2: $3"
echo ""
echo "See the Console for a detailed traceback."
else
echo "$1 Error"
# Usage: ERRORURL <anURL> <a button label>, this is used by the
# bundle runner to put up a dialog.
#echo "ERRORURL: http://www.python.org/ Visit the Python Website
# echo "ERRORURL: http://homepages.cwi.nl/~jack/macpython/index.html Visit the MacPython Website"
fi
| Remove a reference to the MacPython website from the error dialog that is displayed when an application terminates with an uncaught exception. | Remove a reference to the MacPython website from the error dialog
that is displayed when an application terminates with an uncaught
exception.
| Shell | mit | hsoft/pluginbuilder | shell | ## Code Before:
if ( test -n "$2" ) ; then
echo "$1 Error"
echo "An unexpected error has occurred during execution of the main script"
echo ""
echo "$2: $3"
echo ""
echo "See the Console for a detailed traceback."
else
echo "$1 Error"
echo "MacPython 2.3 is required to run this application.";
echo "ERRORURL: http://homepages.cwi.nl/~jack/macpython/index.html Visit the MacPython Website";
fi
## Instruction:
Remove a reference to the MacPython website from the error dialog
that is displayed when an application terminates with an uncaught
exception.
## Code After:
if ( test -n "$2" ) ; then
echo "$1 Error"
echo "An unexpected error has occurred during execution of the main script"
echo ""
echo "$2: $3"
echo ""
echo "See the Console for a detailed traceback."
else
echo "$1 Error"
# Usage: ERRORURL <anURL> <a button label>, this is used by the
# bundle runner to put up a dialog.
#echo "ERRORURL: http://www.python.org/ Visit the Python Website
# echo "ERRORURL: http://homepages.cwi.nl/~jack/macpython/index.html Visit the MacPython Website"
fi
| if ( test -n "$2" ) ; then
echo "$1 Error"
echo "An unexpected error has occurred during execution of the main script"
echo ""
echo "$2: $3"
echo ""
echo "See the Console for a detailed traceback."
else
echo "$1 Error"
- echo "MacPython 2.3 is required to run this application.";
+
+ # Usage: ERRORURL <anURL> <a button label>, this is used by the
+ # bundle runner to put up a dialog.
+ #echo "ERRORURL: http://www.python.org/ Visit the Python Website
- echo "ERRORURL: http://homepages.cwi.nl/~jack/macpython/index.html Visit the MacPython Website";
? ^ -
+ # echo "ERRORURL: http://homepages.cwi.nl/~jack/macpython/index.html Visit the MacPython Website"
? ^^
fi | 7 | 0.583333 | 5 | 2 |
a4933c13b99ac9258f891ac466641e5f8c45699d | core/app/classes/formatted_comment_content.rb | core/app/classes/formatted_comment_content.rb | class FormattedCommentContent
include ActionView::Helpers::TagHelper
def initialize text
@text = text
end
def html
urls_to_link_tags ERB::Util.html_escape(@text).to_str
end
private
AUTO_LINK_RE = %r{(?:(http|https)://|www\.)[^\s<\u00A0]+}i
FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/([0-9]+)}i
def urls_to_link_tags text
text.gsub(AUTO_LINK_RE) do |href|
scheme = Regexp.last_match[1]
link_text = href
href = 'http://' + href unless scheme
case href
when FACTLINK_PRETTY_URL
factlink_link_tag Regexp.last_match[1]
else
content_tag :a, link_text, href: href, target: '_blank'
end
end
end
def factlink_link_tag fact_id
dead_fact = Pavlov.query :'facts/get_dead', id: fact_id
url = FactUrl.new(dead_fact).friendly_fact_url
content_tag :a, dead_fact.displaystring, href: url, rel: 'backbone',
class: 'formatted-comment-content-factlink'
end
end
| class FormattedCommentContent
include ActionView::Helpers::TagHelper
def initialize text
@text = text
end
def html
urls_to_link_tags ERB::Util.html_escape(@text).to_str
end
private
AUTO_LINK_RE = %r{(?:(?<scheme>http|https)://|www\.)[^\s<\u00A0]+}i
FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/(?<id>[0-9]+)}i
def urls_to_link_tags text
text.gsub(AUTO_LINK_RE) do |href|
link_text = href
href = 'http://' + href unless Regexp.last_match[:scheme]
case href
when FACTLINK_PRETTY_URL
factlink_link_tag Regexp.last_match[:id]
else
content_tag :a, link_text, href: href, target: '_blank'
end
end
end
def factlink_link_tag fact_id
dead_fact = Pavlov.query :'facts/get_dead', id: fact_id
url = FactUrl.new(dead_fact).friendly_fact_url
content_tag :a, dead_fact.displaystring, href: url, rel: 'backbone',
class: 'formatted-comment-content-factlink'
end
end
| Use named groups in regexes | Use named groups in regexes
| Ruby | mit | Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core | ruby | ## Code Before:
class FormattedCommentContent
include ActionView::Helpers::TagHelper
def initialize text
@text = text
end
def html
urls_to_link_tags ERB::Util.html_escape(@text).to_str
end
private
AUTO_LINK_RE = %r{(?:(http|https)://|www\.)[^\s<\u00A0]+}i
FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/([0-9]+)}i
def urls_to_link_tags text
text.gsub(AUTO_LINK_RE) do |href|
scheme = Regexp.last_match[1]
link_text = href
href = 'http://' + href unless scheme
case href
when FACTLINK_PRETTY_URL
factlink_link_tag Regexp.last_match[1]
else
content_tag :a, link_text, href: href, target: '_blank'
end
end
end
def factlink_link_tag fact_id
dead_fact = Pavlov.query :'facts/get_dead', id: fact_id
url = FactUrl.new(dead_fact).friendly_fact_url
content_tag :a, dead_fact.displaystring, href: url, rel: 'backbone',
class: 'formatted-comment-content-factlink'
end
end
## Instruction:
Use named groups in regexes
## Code After:
class FormattedCommentContent
include ActionView::Helpers::TagHelper
def initialize text
@text = text
end
def html
urls_to_link_tags ERB::Util.html_escape(@text).to_str
end
private
AUTO_LINK_RE = %r{(?:(?<scheme>http|https)://|www\.)[^\s<\u00A0]+}i
FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/(?<id>[0-9]+)}i
def urls_to_link_tags text
text.gsub(AUTO_LINK_RE) do |href|
link_text = href
href = 'http://' + href unless Regexp.last_match[:scheme]
case href
when FACTLINK_PRETTY_URL
factlink_link_tag Regexp.last_match[:id]
else
content_tag :a, link_text, href: href, target: '_blank'
end
end
end
def factlink_link_tag fact_id
dead_fact = Pavlov.query :'facts/get_dead', id: fact_id
url = FactUrl.new(dead_fact).friendly_fact_url
content_tag :a, dead_fact.displaystring, href: url, rel: 'backbone',
class: 'formatted-comment-content-factlink'
end
end
| class FormattedCommentContent
include ActionView::Helpers::TagHelper
def initialize text
@text = text
end
def html
urls_to_link_tags ERB::Util.html_escape(@text).to_str
end
private
- AUTO_LINK_RE = %r{(?:(http|https)://|www\.)[^\s<\u00A0]+}i
+ AUTO_LINK_RE = %r{(?:(?<scheme>http|https)://|www\.)[^\s<\u00A0]+}i
? +++++++++
- FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/([0-9]+)}i
+ FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/(?<id>[0-9]+)}i
? +++++
def urls_to_link_tags text
text.gsub(AUTO_LINK_RE) do |href|
- scheme = Regexp.last_match[1]
-
link_text = href
- href = 'http://' + href unless scheme
+ href = 'http://' + href unless Regexp.last_match[:scheme]
? +++++++++++++++++++ +
case href
when FACTLINK_PRETTY_URL
- factlink_link_tag Regexp.last_match[1]
? ^
+ factlink_link_tag Regexp.last_match[:id]
? ^^^
else
content_tag :a, link_text, href: href, target: '_blank'
end
end
end
def factlink_link_tag fact_id
dead_fact = Pavlov.query :'facts/get_dead', id: fact_id
url = FactUrl.new(dead_fact).friendly_fact_url
content_tag :a, dead_fact.displaystring, href: url, rel: 'backbone',
class: 'formatted-comment-content-factlink'
end
end | 10 | 0.25 | 4 | 6 |
b00816e95feda55da18df33b9572783201b84bfe | lib/template-data.js | lib/template-data.js | var config = require('./config')
module.exports = {
site: {
title: config.title,
baseURL: config.baseURL
}
}
| var config = require('./config')
module.exports = {
site: config
}
| Change the templateData object to just include all config data until a blacklist is established. | Change the templateData object to just include all config data until a blacklist is established.
| JavaScript | mit | philipwalton/ingen | javascript | ## Code Before:
var config = require('./config')
module.exports = {
site: {
title: config.title,
baseURL: config.baseURL
}
}
## Instruction:
Change the templateData object to just include all config data until a blacklist is established.
## Code After:
var config = require('./config')
module.exports = {
site: config
}
| var config = require('./config')
module.exports = {
+ site: config
- site: {
- title: config.title,
- baseURL: config.baseURL
- }
} | 5 | 0.625 | 1 | 4 |
123cca13ab4561dc2e427acf0cf5e7abd1b35ee0 | packages/openmoko-projects/assassin-thumbnail.bb | packages/openmoko-projects/assassin-thumbnail.bb | DESCRIPTION = "Assassin Packages Thumbnails"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
LICENSE = "GPL"
RDEPENDS = "assassin"
PV = "0.1+svnr${SRCPV}"
PR = "r1"
SRC_URI = "svn://svn.openmoko.org/trunk/src/target/thumbnails/;module=result;proto=https"
do_install() {
install -d ${D}${THUMBNAIL_DIR}
cp -f ${WORKDIR}/result/${THUMBNAIL_FN} ${D}${THUMBNAIL_DIR}
}
FILES_${PN} = "${THUMBNAIL_DIR}/${THUMBNAIL_FN}"
THUMBNAIL_DIR = "${datadir}/assassin/"
THUMBNAIL_FN = "thumbnail.eet"
| DESCRIPTION = "Assassin Packages Thumbnails"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
PKG_TAGS_${PN} = "group::unknown"
LICENSE = "GPL"
RDEPENDS = "assassin"
PV = "0.1+svnr${SRCPV}"
PR = "r0"
SRC_URI = "svn://svn.openmoko.org/trunk/src/target/thumbnails/;module=result;proto=https"
do_install() {
install -d ${D}${THUMBNAIL_DIR}
cp -f ${WORKDIR}/result/${THUMBNAIL_FN} ${D}${THUMBNAIL_DIR}
}
FILES_${PN} = "${THUMBNAIL_DIR}/${THUMBNAIL_FN}"
THUMBNAIL_DIR = "${datadir}/assassin/"
THUMBNAIL_FN = "thumbnail.eet"
| Revert "[alias name] Adding alias name tags for packages" | Revert "[alias name] Adding alias name tags for packages"
This reverts commit ac7bec3cdab4ee8b7a4445be166c82c9432e3ac1.
| BitBake | mit | thebohemian/openembedded,giobauermeister/openembedded,scottellis/overo-oe,buglabs/oe-buglabs,hulifox008/openembedded,SIFTeam/openembedded,crystalfontz/openembedded,openembedded/openembedded,dave-billin/overo-ui-moos-auv,sledz/oe,popazerty/openembedded-cuberevo,philb/pbcl-oe-2010,crystalfontz/openembedded,nvl1109/openembeded,popazerty/openembedded-cuberevo,nvl1109/openembeded,sampov2/audio-openembedded,bticino/openembedded,demsey/openembedded,dellysunnymtech/sakoman-oe,rascalmicro/openembedded-rascal,mrchapp/arago-oe-dev,bticino/openembedded,sampov2/audio-openembedded,yyli/overo-oe,YtvwlD/od-oe,hulifox008/openembedded,BlackPole/bp-openembedded,anguslees/openembedded-android,sutajiokousagi/openembedded,nzjrs/overo-openembedded,anguslees/openembedded-android,JamesAng/goe,xifengchuo/openembedded,rascalmicro/openembedded-rascal,anguslees/openembedded-android,demsey/openenigma2,John-NY/overo-oe,sledz/oe,nx111/openembeded_openpli2.1_nx111,nzjrs/overo-openembedded,KDAB/OpenEmbedded-Archos,Martix/Eonos,dellysunnymtech/sakoman-oe,sentient-energy/emsw-oe-mirror,JamesAng/oe,xifengchuo/openembedded,hulifox008/openembedded,openembedded/openembedded,nlebedenco/mini2440,popazerty/openembedded-cuberevo,JamesAng/oe,libo/openembedded,rascalmicro/openembedded-rascal,openembedded/openembedded,dave-billin/overo-ui-moos-auv,troth/oe-ts7xxx,JrCs/opendreambox,mrchapp/arago-oe-dev,sentient-energy/emsw-oe-mirror,xifengchuo/openembedded,xifengchuo/openembedded,scottellis/overo-oe,troth/oe-ts7xxx,buglabs/oe-buglabs,xifengchuo/openembedded,rascalmicro/openembedded-rascal,xifengchuo/openembedded,bticino/openembedded,bticino/openembedded,anguslees/openembedded-android,openpli-arm/openembedded,trini/openembedded,giobauermeister/openembedded,nx111/openembeded_openpli2.1_nx111,trini/openembedded,YtvwlD/od-oe,demsey/openembedded,yyli/overo-oe,rascalmicro/openembedded-rascal,libo/openembedded,demsey/openembedded,trini/openembedded,dave-billin/overo-ui-moos-auv,sledz/oe,trini/openembedded,nzjrs/overo-openembedded,troth/oe-ts7xxx,libo/openembedded,sutajiokousagi/openembedded,popazerty/openembedded-cuberevo,crystalfontz/openembedded,sampov2/audio-openembedded,troth/oe-ts7xxx,popazerty/openembedded-cuberevo,John-NY/overo-oe,sentient-energy/emsw-oe-mirror,libo/openembedded,trini/openembedded,JamesAng/goe,popazerty/openembedded-cuberevo,hulifox008/openembedded,philb/pbcl-oe-2010,thebohemian/openembedded,SIFTeam/openembedded,demsey/openenigma2,sentient-energy/emsw-oe-mirror,BlackPole/bp-openembedded,YtvwlD/od-oe,popazerty/openembedded-cuberevo,troth/oe-ts7xxx,demsey/openenigma2,nlebedenco/mini2440,yyli/overo-oe,mrchapp/arago-oe-dev,mrchapp/arago-oe-dev,nvl1109/openembeded,nlebedenco/mini2440,nx111/openembeded_openpli2.1_nx111,YtvwlD/od-oe,nvl1109/openembeded,JrCs/opendreambox,anguslees/openembedded-android,openpli-arm/openembedded,openpli-arm/openembedded,sentient-energy/emsw-oe-mirror,demsey/openenigma2,demsey/openembedded,hulifox008/openembedded,crystalfontz/openembedded,KDAB/OpenEmbedded-Archos,philb/pbcl-oe-2010,JamesAng/oe,John-NY/overo-oe,buglabs/oe-buglabs,sutajiokousagi/openembedded,dellysunnymtech/sakoman-oe,sampov2/audio-openembedded,sutajiokousagi/openembedded,thebohemian/openembedded,BlackPole/bp-openembedded,JrCs/opendreambox,nvl1109/openembeded,openpli-arm/openembedded,SIFTeam/openembedded,dellysunnymtech/sakoman-oe,JrCs/opendreambox,YtvwlD/od-oe,dellysunnymtech/sakoman-oe,hulifox008/openembedded,scottellis/overo-oe,John-NY/overo-oe,Martix/Eonos,dave-billin/overo-ui-moos-auv,libo/openembedded,Martix/Eonos,JrCs/opendreambox,openembedded/openembedded,rascalmicro/openembedded-rascal,yyli/overo-oe,buglabs/oe-buglabs,libo/openembedded,JamesAng/oe,nzjrs/overo-openembedded,JamesAng/oe,BlackPole/bp-openembedded,SIFTeam/openembedded,Martix/Eonos,John-NY/overo-oe,xifengchuo/openembedded,JrCs/opendreambox,dellysunnymtech/sakoman-oe,troth/oe-ts7xxx,yyli/overo-oe,mrchapp/arago-oe-dev,nzjrs/overo-openembedded,dellysunnymtech/sakoman-oe,philb/pbcl-oe-2010,crystalfontz/openembedded,nzjrs/overo-openembedded,dellysunnymtech/sakoman-oe,openpli-arm/openembedded,nvl1109/openembeded,sutajiokousagi/openembedded,popazerty/openembedded-cuberevo,John-NY/overo-oe,demsey/openembedded,KDAB/OpenEmbedded-Archos,nlebedenco/mini2440,sledz/oe,giobauermeister/openembedded,demsey/openenigma2,dave-billin/overo-ui-moos-auv,openpli-arm/openembedded,openembedded/openembedded,bticino/openembedded,JamesAng/goe,sampov2/audio-openembedded,rascalmicro/openembedded-rascal,crystalfontz/openembedded,sampov2/audio-openembedded,giobauermeister/openembedded,buglabs/oe-buglabs,scottellis/overo-oe,giobauermeister/openembedded,openpli-arm/openembedded,xifengchuo/openembedded,BlackPole/bp-openembedded,sampov2/audio-openembedded,philb/pbcl-oe-2010,demsey/openenigma2,troth/oe-ts7xxx,SIFTeam/openembedded,sledz/oe,nlebedenco/mini2440,yyli/overo-oe,nx111/openembeded_openpli2.1_nx111,libo/openembedded,sentient-energy/emsw-oe-mirror,JamesAng/oe,mrchapp/arago-oe-dev,thebohemian/openembedded,dave-billin/overo-ui-moos-auv,nzjrs/overo-openembedded,openembedded/openembedded,demsey/openenigma2,nx111/openembeded_openpli2.1_nx111,scottellis/overo-oe,trini/openembedded,sledz/oe,nlebedenco/mini2440,demsey/openembedded,YtvwlD/od-oe,buglabs/oe-buglabs,nx111/openembeded_openpli2.1_nx111,BlackPole/bp-openembedded,nlebedenco/mini2440,YtvwlD/od-oe,dave-billin/overo-ui-moos-auv,rascalmicro/openembedded-rascal,thebohemian/openembedded,sledz/oe,KDAB/OpenEmbedded-Archos,openembedded/openembedded,BlackPole/bp-openembedded,mrchapp/arago-oe-dev,hulifox008/openembedded,KDAB/OpenEmbedded-Archos,Martix/Eonos,KDAB/OpenEmbedded-Archos,yyli/overo-oe,giobauermeister/openembedded,JrCs/opendreambox,yyli/overo-oe,philb/pbcl-oe-2010,JrCs/opendreambox,Martix/Eonos,giobauermeister/openembedded,Martix/Eonos,crystalfontz/openembedded,thebohemian/openembedded,JamesAng/oe,anguslees/openembedded-android,JamesAng/goe,SIFTeam/openembedded,buglabs/oe-buglabs,dellysunnymtech/sakoman-oe,scottellis/overo-oe,nx111/openembeded_openpli2.1_nx111,JrCs/opendreambox,nx111/openembeded_openpli2.1_nx111,KDAB/OpenEmbedded-Archos,nvl1109/openembeded,trini/openembedded,giobauermeister/openembedded,openembedded/openembedded,YtvwlD/od-oe,buglabs/oe-buglabs,openembedded/openembedded,SIFTeam/openembedded,sentient-energy/emsw-oe-mirror,openembedded/openembedded,demsey/openembedded,philb/pbcl-oe-2010,xifengchuo/openembedded,JamesAng/goe,sutajiokousagi/openembedded,scottellis/overo-oe,thebohemian/openembedded,giobauermeister/openembedded,sutajiokousagi/openembedded,JamesAng/goe,John-NY/overo-oe,bticino/openembedded,openembedded/openembedded,JamesAng/goe,bticino/openembedded,anguslees/openembedded-android | bitbake | ## Code Before:
DESCRIPTION = "Assassin Packages Thumbnails"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
LICENSE = "GPL"
RDEPENDS = "assassin"
PV = "0.1+svnr${SRCPV}"
PR = "r1"
SRC_URI = "svn://svn.openmoko.org/trunk/src/target/thumbnails/;module=result;proto=https"
do_install() {
install -d ${D}${THUMBNAIL_DIR}
cp -f ${WORKDIR}/result/${THUMBNAIL_FN} ${D}${THUMBNAIL_DIR}
}
FILES_${PN} = "${THUMBNAIL_DIR}/${THUMBNAIL_FN}"
THUMBNAIL_DIR = "${datadir}/assassin/"
THUMBNAIL_FN = "thumbnail.eet"
## Instruction:
Revert "[alias name] Adding alias name tags for packages"
This reverts commit ac7bec3cdab4ee8b7a4445be166c82c9432e3ac1.
## Code After:
DESCRIPTION = "Assassin Packages Thumbnails"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
PKG_TAGS_${PN} = "group::unknown"
LICENSE = "GPL"
RDEPENDS = "assassin"
PV = "0.1+svnr${SRCPV}"
PR = "r0"
SRC_URI = "svn://svn.openmoko.org/trunk/src/target/thumbnails/;module=result;proto=https"
do_install() {
install -d ${D}${THUMBNAIL_DIR}
cp -f ${WORKDIR}/result/${THUMBNAIL_FN} ${D}${THUMBNAIL_DIR}
}
FILES_${PN} = "${THUMBNAIL_DIR}/${THUMBNAIL_FN}"
THUMBNAIL_DIR = "${datadir}/assassin/"
THUMBNAIL_FN = "thumbnail.eet"
| DESCRIPTION = "Assassin Packages Thumbnails"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
+ PKG_TAGS_${PN} = "group::unknown"
LICENSE = "GPL"
RDEPENDS = "assassin"
PV = "0.1+svnr${SRCPV}"
- PR = "r1"
? ^
+ PR = "r0"
? ^
SRC_URI = "svn://svn.openmoko.org/trunk/src/target/thumbnails/;module=result;proto=https"
do_install() {
install -d ${D}${THUMBNAIL_DIR}
cp -f ${WORKDIR}/result/${THUMBNAIL_FN} ${D}${THUMBNAIL_DIR}
}
FILES_${PN} = "${THUMBNAIL_DIR}/${THUMBNAIL_FN}"
THUMBNAIL_DIR = "${datadir}/assassin/"
THUMBNAIL_FN = "thumbnail.eet" | 3 | 0.166667 | 2 | 1 |
851e0740c1ab5a0c9f4772f4fd0c0959b64b7566 | updateAll.sh | updateAll.sh | tsc -p csServerComp
(cd csComp && npm update)
tsc -p csComp
(cd example && npm update)
(cd example/public && bower install)
(cd example/ && gulp all)
tsc -p example
tsc -p test
| tsc -p csServerComp
(cd csComp && npm update)
tsc -p csComp
(cd example && npm update)
(cd example/public && bower install)
(cd example/ && gulp all)
tsc -p example
(cd example/ && gulp built_csComp.d.ts)
tsc -p test
| Add gulp task to updateall | Add gulp task to updateall
| Shell | mit | indodutch/csWeb,TNOCS/csWeb,indodutch/csWeb,mkuzak/csWeb,TNOCS/csWeb,indodutch/csWeb,mkuzak/csWeb,TNOCS/csWeb,c-martinez/csWeb,mkuzak/csWeb,c-martinez/csWeb,mkuzak/csWeb,c-martinez/csWeb | shell | ## Code Before:
tsc -p csServerComp
(cd csComp && npm update)
tsc -p csComp
(cd example && npm update)
(cd example/public && bower install)
(cd example/ && gulp all)
tsc -p example
tsc -p test
## Instruction:
Add gulp task to updateall
## Code After:
tsc -p csServerComp
(cd csComp && npm update)
tsc -p csComp
(cd example && npm update)
(cd example/public && bower install)
(cd example/ && gulp all)
tsc -p example
(cd example/ && gulp built_csComp.d.ts)
tsc -p test
| tsc -p csServerComp
(cd csComp && npm update)
tsc -p csComp
(cd example && npm update)
(cd example/public && bower install)
(cd example/ && gulp all)
tsc -p example
+ (cd example/ && gulp built_csComp.d.ts)
tsc -p test | 1 | 0.125 | 1 | 0 |
f566e0e36269ea2cd1e82c6af712097917effd4a | dlrn/migrations/versions/2d503b5034b7_rename_artifacts.py | dlrn/migrations/versions/2d503b5034b7_rename_artifacts.py |
from alembic import op
# revision identifiers, used by Alembic.
revision = '2d503b5034b7'
down_revision = '2a0313a8a7d6'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('rpms', new_column_name='artifacts')
def downgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('artifacts', new_column_name='rpms')
|
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2d503b5034b7'
down_revision = '2a0313a8a7d6'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('rpms', existing_type=sa.Text(),
new_column_name='artifacts')
def downgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('artifacts', existing_type=sa.Text(),
new_column_name='rpms')
| Fix alembic migration for rpms->artifacts rename | Fix alembic migration for rpms->artifacts rename
The migration does not work on MySQL-based engines, because it
requires setting the existing_type parameter [1]. It worked fine
on SQLite, though.
[1] - https://alembic.sqlalchemy.org/en/latest/ops.html#alembic.operations.Operations.alter_column
Change-Id: If0cc05af843e3db5f4b2e501caa8f4f773b24509
| Python | apache-2.0 | openstack-packages/delorean,openstack-packages/delorean,openstack-packages/DLRN,openstack-packages/DLRN | python | ## Code Before:
from alembic import op
# revision identifiers, used by Alembic.
revision = '2d503b5034b7'
down_revision = '2a0313a8a7d6'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('rpms', new_column_name='artifacts')
def downgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('artifacts', new_column_name='rpms')
## Instruction:
Fix alembic migration for rpms->artifacts rename
The migration does not work on MySQL-based engines, because it
requires setting the existing_type parameter [1]. It worked fine
on SQLite, though.
[1] - https://alembic.sqlalchemy.org/en/latest/ops.html#alembic.operations.Operations.alter_column
Change-Id: If0cc05af843e3db5f4b2e501caa8f4f773b24509
## Code After:
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2d503b5034b7'
down_revision = '2a0313a8a7d6'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('rpms', existing_type=sa.Text(),
new_column_name='artifacts')
def downgrade():
with op.batch_alter_table("commits") as batch_op:
batch_op.alter_column('artifacts', existing_type=sa.Text(),
new_column_name='rpms')
|
from alembic import op
+ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2d503b5034b7'
down_revision = '2a0313a8a7d6'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("commits") as batch_op:
- batch_op.alter_column('rpms', new_column_name='artifacts')
+ batch_op.alter_column('rpms', existing_type=sa.Text(),
+ new_column_name='artifacts')
def downgrade():
with op.batch_alter_table("commits") as batch_op:
- batch_op.alter_column('artifacts', new_column_name='rpms')
+ batch_op.alter_column('artifacts', existing_type=sa.Text(),
+ new_column_name='rpms') | 7 | 0.368421 | 5 | 2 |
1e082f8c39dd1a1d41064f522db10478b0c820e1 | icekit/page_types/layout_page/page_type_plugins.py | icekit/page_types/layout_page/page_type_plugins.py | from django.conf.urls import patterns, url
from fluent_pages.extensions import page_type_pool
from fluent_pages.integration.fluent_contents.page_type_plugins import FluentContentsPagePlugin
from fluent_pages.models import UrlNode
from . import admin, models
# Register this plugin to the page plugin pool.
@page_type_pool.register
class LayoutPagePlugin(FluentContentsPagePlugin):
model = models.LayoutPage
model_admin = admin.LayoutPageAdmin
| from django.conf.urls import patterns, url
from fluent_pages.extensions import page_type_pool
from fluent_pages.integration.fluent_contents.page_type_plugins import FluentContentsPagePlugin
from fluent_pages.models import UrlNode
from . import admin, models
# Register this plugin to the page plugin pool.
@page_type_pool.register
class LayoutPagePlugin(FluentContentsPagePlugin):
model = models.LayoutPage
model_admin = admin.LayoutPageAdmin
def get_render_template(self, request, fluentpage, **kwargs):
# Allow subclasses to easily override it by specifying `render_template` after all.
# The default, is to use the template_path from the layout object.
return self.render_template or fluentpage.layout.template_name
| Add smart template render method to LayoutPage | Add smart template render method to LayoutPage
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | python | ## Code Before:
from django.conf.urls import patterns, url
from fluent_pages.extensions import page_type_pool
from fluent_pages.integration.fluent_contents.page_type_plugins import FluentContentsPagePlugin
from fluent_pages.models import UrlNode
from . import admin, models
# Register this plugin to the page plugin pool.
@page_type_pool.register
class LayoutPagePlugin(FluentContentsPagePlugin):
model = models.LayoutPage
model_admin = admin.LayoutPageAdmin
## Instruction:
Add smart template render method to LayoutPage
## Code After:
from django.conf.urls import patterns, url
from fluent_pages.extensions import page_type_pool
from fluent_pages.integration.fluent_contents.page_type_plugins import FluentContentsPagePlugin
from fluent_pages.models import UrlNode
from . import admin, models
# Register this plugin to the page plugin pool.
@page_type_pool.register
class LayoutPagePlugin(FluentContentsPagePlugin):
model = models.LayoutPage
model_admin = admin.LayoutPageAdmin
def get_render_template(self, request, fluentpage, **kwargs):
# Allow subclasses to easily override it by specifying `render_template` after all.
# The default, is to use the template_path from the layout object.
return self.render_template or fluentpage.layout.template_name
| from django.conf.urls import patterns, url
from fluent_pages.extensions import page_type_pool
from fluent_pages.integration.fluent_contents.page_type_plugins import FluentContentsPagePlugin
from fluent_pages.models import UrlNode
from . import admin, models
# Register this plugin to the page plugin pool.
@page_type_pool.register
class LayoutPagePlugin(FluentContentsPagePlugin):
model = models.LayoutPage
model_admin = admin.LayoutPageAdmin
+ def get_render_template(self, request, fluentpage, **kwargs):
+ # Allow subclasses to easily override it by specifying `render_template` after all.
+ # The default, is to use the template_path from the layout object.
+ return self.render_template or fluentpage.layout.template_name
+ | 5 | 0.357143 | 5 | 0 |
fae3e55b1c472cd314676431a34fe6e160418626 | tests/test_command_line.py | tests/test_command_line.py | import os
import subprocess
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all(args)
self.db.commit()
def test_dallinger_help(self):
output = subprocess.check_output("dallinger", shell=True)
assert("Usage: dallinger [OPTIONS] COMMAND [ARGS]" in output)
| import os
import subprocess
from dallinger.command_line import heroku_id
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all(args)
self.db.commit()
def test_dallinger_help(self):
output = subprocess.check_output("dallinger", shell=True)
assert("Usage: dallinger [OPTIONS] COMMAND [ARGS]" in output)
def test_heroku_app_id(self):
id = "8fbe62f5-2e33-4274-8aeb-40fc3dd621a0"
assert(len(heroku_id(id)) < 30)
| Test for Heroku app name length | Test for Heroku app name length
| Python | mit | jcpeterson/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger | python | ## Code Before:
import os
import subprocess
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all(args)
self.db.commit()
def test_dallinger_help(self):
output = subprocess.check_output("dallinger", shell=True)
assert("Usage: dallinger [OPTIONS] COMMAND [ARGS]" in output)
## Instruction:
Test for Heroku app name length
## Code After:
import os
import subprocess
from dallinger.command_line import heroku_id
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all(args)
self.db.commit()
def test_dallinger_help(self):
output = subprocess.check_output("dallinger", shell=True)
assert("Usage: dallinger [OPTIONS] COMMAND [ARGS]" in output)
def test_heroku_app_id(self):
id = "8fbe62f5-2e33-4274-8aeb-40fc3dd621a0"
assert(len(heroku_id(id)) < 30)
| import os
import subprocess
+ from dallinger.command_line import heroku_id
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all(args)
self.db.commit()
def test_dallinger_help(self):
output = subprocess.check_output("dallinger", shell=True)
assert("Usage: dallinger [OPTIONS] COMMAND [ARGS]" in output)
+
+ def test_heroku_app_id(self):
+ id = "8fbe62f5-2e33-4274-8aeb-40fc3dd621a0"
+ assert(len(heroku_id(id)) < 30) | 5 | 0.25 | 5 | 0 |
0d44fa937798861438c9bacf033aa1f27e68d119 | config/secrets.yml | config/secrets.yml | development:
secret_key_base: 9681e12f70aa75fcf94a467821803a2bf8979a20388cf842aad0a5e44c63d8f6eeb757dab4dd31b870cbd12e66907eba4231b3da0ae17e02fc41886fdab721d7
test:
secret_key_base: fde628fa241d74a55d7b0fc8fe1b650091e296d6a4d1e51beba3bfa2ed5c143801c28aaadf318aaefc4423bca781f9715441298052b4f704a8c44f97968feb00
production:
secret_key_base: <%= ENV['SECRET_TOKEN'] %>
| development:
secret_key_base: 9681e12f70aa75fcf94a467821803a2bf8979a20388cf842aad0a5e44c63d8f6eeb757dab4dd31b870cbd12e66907eba4231b3da0ae17e02fc41886fdab721d7
test:
secret_key_base: fde628fa241d74a55d7b0fc8fe1b650091e296d6a4d1e51beba3bfa2ed5c143801c28aaadf318aaefc4423bca781f9715441298052b4f704a8c44f97968feb00
staging:
secret_key_base: <%= ENV['SECRET_TOKEN'] %>
production:
secret_key_base: <%= ENV['SECRET_TOKEN'] %>
| Add secret token for staging environment | Add secret token for staging environment
| YAML | agpl-3.0 | coopdevs/timeoverflow,coopdevs/timeoverflow,coopdevs/timeoverflow,coopdevs/timeoverflow | yaml | ## Code Before:
development:
secret_key_base: 9681e12f70aa75fcf94a467821803a2bf8979a20388cf842aad0a5e44c63d8f6eeb757dab4dd31b870cbd12e66907eba4231b3da0ae17e02fc41886fdab721d7
test:
secret_key_base: fde628fa241d74a55d7b0fc8fe1b650091e296d6a4d1e51beba3bfa2ed5c143801c28aaadf318aaefc4423bca781f9715441298052b4f704a8c44f97968feb00
production:
secret_key_base: <%= ENV['SECRET_TOKEN'] %>
## Instruction:
Add secret token for staging environment
## Code After:
development:
secret_key_base: 9681e12f70aa75fcf94a467821803a2bf8979a20388cf842aad0a5e44c63d8f6eeb757dab4dd31b870cbd12e66907eba4231b3da0ae17e02fc41886fdab721d7
test:
secret_key_base: fde628fa241d74a55d7b0fc8fe1b650091e296d6a4d1e51beba3bfa2ed5c143801c28aaadf318aaefc4423bca781f9715441298052b4f704a8c44f97968feb00
staging:
secret_key_base: <%= ENV['SECRET_TOKEN'] %>
production:
secret_key_base: <%= ENV['SECRET_TOKEN'] %>
| development:
secret_key_base: 9681e12f70aa75fcf94a467821803a2bf8979a20388cf842aad0a5e44c63d8f6eeb757dab4dd31b870cbd12e66907eba4231b3da0ae17e02fc41886fdab721d7
test:
secret_key_base: fde628fa241d74a55d7b0fc8fe1b650091e296d6a4d1e51beba3bfa2ed5c143801c28aaadf318aaefc4423bca781f9715441298052b4f704a8c44f97968feb00
+ staging:
+ secret_key_base: <%= ENV['SECRET_TOKEN'] %>
+
production:
secret_key_base: <%= ENV['SECRET_TOKEN'] %> | 3 | 0.375 | 3 | 0 |
21cb2badd2729b4c677fa41b564a4634af0fcd0d | src/main/java/com/gr8pefish/portablecrafting/items/craftingItems/ItemSubCrafting.java | src/main/java/com/gr8pefish/portablecrafting/items/craftingItems/ItemSubCrafting.java | package com.gr8pefish.portablecrafting.items.craftingItems;
import com.gr8pefish.portablecrafting.items.ItemBase;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class ItemSubCrafting extends ItemBase {
public String[] names = {"crafting_core", "blueprints"};
public ItemSubCrafting() {
super("subcrafting.");
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list) {
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(id, 1, i));
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
}
| package com.gr8pefish.portablecrafting.items.craftingItems;
import com.gr8pefish.portablecrafting.items.ItemBase;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class ItemSubCrafting extends ItemBase {
public String[] names = {"crafting_core"};
public ItemSubCrafting() {
super("subcrafting.");
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list) {
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(id, 1, i));
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
}
| Fix registry for no-longer-present subItem | Fix registry for no-longer-present subItem
| Java | mit | gr8pefish/PortableCrafting | java | ## Code Before:
package com.gr8pefish.portablecrafting.items.craftingItems;
import com.gr8pefish.portablecrafting.items.ItemBase;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class ItemSubCrafting extends ItemBase {
public String[] names = {"crafting_core", "blueprints"};
public ItemSubCrafting() {
super("subcrafting.");
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list) {
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(id, 1, i));
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
}
## Instruction:
Fix registry for no-longer-present subItem
## Code After:
package com.gr8pefish.portablecrafting.items.craftingItems;
import com.gr8pefish.portablecrafting.items.ItemBase;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class ItemSubCrafting extends ItemBase {
public String[] names = {"crafting_core"};
public ItemSubCrafting() {
super("subcrafting.");
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list) {
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(id, 1, i));
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
}
| package com.gr8pefish.portablecrafting.items.craftingItems;
import com.gr8pefish.portablecrafting.items.ItemBase;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class ItemSubCrafting extends ItemBase {
- public String[] names = {"crafting_core", "blueprints"};
? --------------
+ public String[] names = {"crafting_core"};
public ItemSubCrafting() {
super("subcrafting.");
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list) {
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(id, 1, i));
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
} | 2 | 0.0625 | 1 | 1 |
9ed093d37cc265e8c8021767e9efc3a6d754d95e | api/app/mailers/club_application_mailer.rb | api/app/mailers/club_application_mailer.rb | class ClubApplicationMailer < ApplicationMailer
default from: 'Hack Club Team <team@hackclub.com>'
def application_confirmation(application)
@application = application
to = Mail::Address.new @application.email
to.display_name = @application.full_name
mail(to: to.format, subject: 'Application Confirmation')
end
def admin_notification(application)
@application = application
to = Mail::Address.new 'team@hackclub.com'
to.display_name = 'Hack Club Team'
subject = "Hack Club Application (#{@application.full_name}, "\
"#{@application.high_school})"
mail(to: to.format, reply_to: @application.mail_address.format,
subject: subject)
end
end
| class ClubApplicationMailer < ApplicationMailer
default from: 'Hack Club Team <team@hackclub.com>'
def application_confirmation(application)
@application = application
to = Mail::Address.new @application.email
to.display_name = @application.full_name
mail(to: to.format, subject: 'Application Confirmation')
end
def admin_notification(application)
@application = application
to = Mail::Address.new 'team@hackclub.com'
to.display_name = 'Hack Club Team'
subject = "Hack Club Application (#{@application.full_name}, "\
"#{@application.high_school}, #{@application.id})"
mail(to: to.format, reply_to: @application.mail_address.format,
subject: subject)
end
end
| Add ID to title of club application | Add ID to title of club application
| Ruby | mit | hackclub/api,hackclub/api,hackclub/api | ruby | ## Code Before:
class ClubApplicationMailer < ApplicationMailer
default from: 'Hack Club Team <team@hackclub.com>'
def application_confirmation(application)
@application = application
to = Mail::Address.new @application.email
to.display_name = @application.full_name
mail(to: to.format, subject: 'Application Confirmation')
end
def admin_notification(application)
@application = application
to = Mail::Address.new 'team@hackclub.com'
to.display_name = 'Hack Club Team'
subject = "Hack Club Application (#{@application.full_name}, "\
"#{@application.high_school})"
mail(to: to.format, reply_to: @application.mail_address.format,
subject: subject)
end
end
## Instruction:
Add ID to title of club application
## Code After:
class ClubApplicationMailer < ApplicationMailer
default from: 'Hack Club Team <team@hackclub.com>'
def application_confirmation(application)
@application = application
to = Mail::Address.new @application.email
to.display_name = @application.full_name
mail(to: to.format, subject: 'Application Confirmation')
end
def admin_notification(application)
@application = application
to = Mail::Address.new 'team@hackclub.com'
to.display_name = 'Hack Club Team'
subject = "Hack Club Application (#{@application.full_name}, "\
"#{@application.high_school}, #{@application.id})"
mail(to: to.format, reply_to: @application.mail_address.format,
subject: subject)
end
end
| class ClubApplicationMailer < ApplicationMailer
default from: 'Hack Club Team <team@hackclub.com>'
def application_confirmation(application)
@application = application
to = Mail::Address.new @application.email
to.display_name = @application.full_name
mail(to: to.format, subject: 'Application Confirmation')
end
def admin_notification(application)
@application = application
to = Mail::Address.new 'team@hackclub.com'
to.display_name = 'Hack Club Team'
subject = "Hack Club Application (#{@application.full_name}, "\
- "#{@application.high_school})"
+ "#{@application.high_school}, #{@application.id})"
? ++++++++++++++++++++
mail(to: to.format, reply_to: @application.mail_address.format,
subject: subject)
end
end | 2 | 0.08 | 1 | 1 |
97ae270c41aebb84134a402e0c1cb5d561e2322f | extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/resources/dev-templates/embedded.html | extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/resources/dev-templates/embedded.html | <a href="localhost:{info:rabbitHttpPort.httpPort}" class="badge badge-light">
<i class="fa fa-external-link-alt fa-fw"></i>
RabbitMQ management UI <span class="badge badge-light">{info:rabbitHttpPort.httpPort}</span></a>
<br> | <a target="_blank" href="http://localhost:{info:rabbitHttpPort.httpPort}" class="badge badge-light">
<i class="fa fa-external-link-alt fa-fw"></i>
RabbitMQ management UI <span class="badge badge-light">{info:rabbitHttpPort.httpPort}</span></a>
<br>
| Make RabbitMQ link in DevUI an external link | Make RabbitMQ link in DevUI an external link
| HTML | apache-2.0 | quarkusio/quarkus,quarkusio/quarkus,quarkusio/quarkus,quarkusio/quarkus,quarkusio/quarkus | html | ## Code Before:
<a href="localhost:{info:rabbitHttpPort.httpPort}" class="badge badge-light">
<i class="fa fa-external-link-alt fa-fw"></i>
RabbitMQ management UI <span class="badge badge-light">{info:rabbitHttpPort.httpPort}</span></a>
<br>
## Instruction:
Make RabbitMQ link in DevUI an external link
## Code After:
<a target="_blank" href="http://localhost:{info:rabbitHttpPort.httpPort}" class="badge badge-light">
<i class="fa fa-external-link-alt fa-fw"></i>
RabbitMQ management UI <span class="badge badge-light">{info:rabbitHttpPort.httpPort}</span></a>
<br>
| - <a href="localhost:{info:rabbitHttpPort.httpPort}" class="badge badge-light">
+ <a target="_blank" href="http://localhost:{info:rabbitHttpPort.httpPort}" class="badge badge-light">
? ++++++++++++++++ +++++++
<i class="fa fa-external-link-alt fa-fw"></i>
RabbitMQ management UI <span class="badge badge-light">{info:rabbitHttpPort.httpPort}</span></a>
<br> | 2 | 0.5 | 1 | 1 |
25d44026edee88d857ed4a565dd5407e6491d3ea | server/test/functional/config/configSpec.js | server/test/functional/config/configSpec.js | 'use strict';
var expect = require('chai').expect,
config = require('../../../config/config');
describe('config', function () {
describe('getConfig', function () {
var configDirectory = '../../../config/';
describe('existing configuration', function () {
var testCases = [
{ environment: 'development' },
{ environment: 'integration' },
{ environment: 'production' },
{ environment: 'test' }
];
testCases.forEach(function (testCase) {
it('should successfully load the specified configuration: ' + testCase.environment, function () {
expect(config.getConfig(testCase.environment, configDirectory, require)).to.be.defined;
});
});
});
describe('not existing configuration', function () {
it('should throw an error if the specified configuration does not exist', function () {
var environment = 'any not existing',
expectedErrorMessage = 'Config file for system environment not existing:' + environment,
getConfig = config.getConfig;
expect(getConfig.bind(null, environment, configDirectory, require)).to.throw(expectedErrorMessage);
});
});
});
});
| 'use strict';
var expect = require('chai').expect,
config = require('../../../config/config');
describe('config', function () {
describe('getConfig', function () {
var configDirectory = '../../../config/';
describe('existing configuration', function () {
var testCases = [
{ environment: 'development' },
{ environment: 'integration' },
{ environment: 'production' },
{ environment: 'test' }
];
testCases.forEach(function (testCase) {
it('should successfully load the specified configuration: ' + testCase.environment, function () {
expect(config.getConfig(testCase.environment, configDirectory, require)).to.be.defined;
});
});
});
describe('not existing configuration', function () {
it('should throw an error if the specified configuration does not exist', function () {
var environment = 'any not existing',
expectedErrorMessageStaticPart = 'Config file for system environment not existing: ',
expectedErrorMessage = expectedErrorMessageStaticPart + environment + ' in ' + configDirectory,
getConfig = config.getConfig;
expect(getConfig.bind(null, environment, configDirectory, require)).to.throw(expectedErrorMessage);
});
});
});
});
| Fix config test expected error message. | Fix config test expected error message.
| JavaScript | mit | lxanders/community | javascript | ## Code Before:
'use strict';
var expect = require('chai').expect,
config = require('../../../config/config');
describe('config', function () {
describe('getConfig', function () {
var configDirectory = '../../../config/';
describe('existing configuration', function () {
var testCases = [
{ environment: 'development' },
{ environment: 'integration' },
{ environment: 'production' },
{ environment: 'test' }
];
testCases.forEach(function (testCase) {
it('should successfully load the specified configuration: ' + testCase.environment, function () {
expect(config.getConfig(testCase.environment, configDirectory, require)).to.be.defined;
});
});
});
describe('not existing configuration', function () {
it('should throw an error if the specified configuration does not exist', function () {
var environment = 'any not existing',
expectedErrorMessage = 'Config file for system environment not existing:' + environment,
getConfig = config.getConfig;
expect(getConfig.bind(null, environment, configDirectory, require)).to.throw(expectedErrorMessage);
});
});
});
});
## Instruction:
Fix config test expected error message.
## Code After:
'use strict';
var expect = require('chai').expect,
config = require('../../../config/config');
describe('config', function () {
describe('getConfig', function () {
var configDirectory = '../../../config/';
describe('existing configuration', function () {
var testCases = [
{ environment: 'development' },
{ environment: 'integration' },
{ environment: 'production' },
{ environment: 'test' }
];
testCases.forEach(function (testCase) {
it('should successfully load the specified configuration: ' + testCase.environment, function () {
expect(config.getConfig(testCase.environment, configDirectory, require)).to.be.defined;
});
});
});
describe('not existing configuration', function () {
it('should throw an error if the specified configuration does not exist', function () {
var environment = 'any not existing',
expectedErrorMessageStaticPart = 'Config file for system environment not existing: ',
expectedErrorMessage = expectedErrorMessageStaticPart + environment + ' in ' + configDirectory,
getConfig = config.getConfig;
expect(getConfig.bind(null, environment, configDirectory, require)).to.throw(expectedErrorMessage);
});
});
});
});
| 'use strict';
var expect = require('chai').expect,
config = require('../../../config/config');
describe('config', function () {
describe('getConfig', function () {
var configDirectory = '../../../config/';
describe('existing configuration', function () {
var testCases = [
{ environment: 'development' },
{ environment: 'integration' },
{ environment: 'production' },
{ environment: 'test' }
];
testCases.forEach(function (testCase) {
it('should successfully load the specified configuration: ' + testCase.environment, function () {
expect(config.getConfig(testCase.environment, configDirectory, require)).to.be.defined;
});
});
});
describe('not existing configuration', function () {
it('should throw an error if the specified configuration does not exist', function () {
var environment = 'any not existing',
- expectedErrorMessage = 'Config file for system environment not existing:' + environment,
? --------------
+ expectedErrorMessageStaticPart = 'Config file for system environment not existing: ',
? ++++++++++ +
+ expectedErrorMessage = expectedErrorMessageStaticPart + environment + ' in ' + configDirectory,
getConfig = config.getConfig;
expect(getConfig.bind(null, environment, configDirectory, require)).to.throw(expectedErrorMessage);
});
});
});
}); | 3 | 0.069767 | 2 | 1 |
2fdca9dde9519d6e2e275e520fd5a84de202b5ba | plugin/markdown_pl.vim | plugin/markdown_pl.vim | let s:save_cpo = &cpo
set cpo&vim
if exists('g:markdown_pl_loaded')
finish
endif
let g:markdown_pl_home = fnamemodify(expand('<sfile>'), ':p:h:h:gs?\\?/?')
command! -nargs=0 MarkDownPreview call MarkDownPreview()
function! MarkDownPreview()
let s:fileName = expand("%:p:r").'.html'
silent exec '!'.g:markdown_pl_home.'/bin/markdown.pl % > '.s:fileName
exec '!xdg-open file://'.s:fileName
echon "\r\r"
echon ''
endf
let g:markdown_pl_loaded = 1
let &cpo = s:save_cpo
unlet s:save_cpo
| let s:save_cpo = &cpo
set cpo&vim
if exists('g:markdown_pl_loaded')
finish
endif
let g:markdown_pl_home = fnamemodify(expand('<sfile>'), ':p:h:h:gs?\\?/?')
command! -nargs=0 MarkDownPreview call MarkDownPreview()
function! MarkDownPreview()
let s:fileName = expand("%:p:r").'.html'
silent exec '!'.g:markdown_pl_home.'/bin/markdown.pl % > '.s:fileName
call system('xdg-open file://'.s:fileName)
call system('rm '.s:fileName)
endf
let g:markdown_pl_loaded = 1
let &cpo = s:save_cpo
unlet s:save_cpo
| Remove generate file after preview | Remove generate file after preview
| VimL | bsd-3-clause | wsdjeg/MarkDown.pl | viml | ## Code Before:
let s:save_cpo = &cpo
set cpo&vim
if exists('g:markdown_pl_loaded')
finish
endif
let g:markdown_pl_home = fnamemodify(expand('<sfile>'), ':p:h:h:gs?\\?/?')
command! -nargs=0 MarkDownPreview call MarkDownPreview()
function! MarkDownPreview()
let s:fileName = expand("%:p:r").'.html'
silent exec '!'.g:markdown_pl_home.'/bin/markdown.pl % > '.s:fileName
exec '!xdg-open file://'.s:fileName
echon "\r\r"
echon ''
endf
let g:markdown_pl_loaded = 1
let &cpo = s:save_cpo
unlet s:save_cpo
## Instruction:
Remove generate file after preview
## Code After:
let s:save_cpo = &cpo
set cpo&vim
if exists('g:markdown_pl_loaded')
finish
endif
let g:markdown_pl_home = fnamemodify(expand('<sfile>'), ':p:h:h:gs?\\?/?')
command! -nargs=0 MarkDownPreview call MarkDownPreview()
function! MarkDownPreview()
let s:fileName = expand("%:p:r").'.html'
silent exec '!'.g:markdown_pl_home.'/bin/markdown.pl % > '.s:fileName
call system('xdg-open file://'.s:fileName)
call system('rm '.s:fileName)
endf
let g:markdown_pl_loaded = 1
let &cpo = s:save_cpo
unlet s:save_cpo
| let s:save_cpo = &cpo
set cpo&vim
if exists('g:markdown_pl_loaded')
finish
endif
let g:markdown_pl_home = fnamemodify(expand('<sfile>'), ':p:h:h:gs?\\?/?')
command! -nargs=0 MarkDownPreview call MarkDownPreview()
function! MarkDownPreview()
let s:fileName = expand("%:p:r").'.html'
silent exec '!'.g:markdown_pl_home.'/bin/markdown.pl % > '.s:fileName
- exec '!xdg-open file://'.s:fileName
? ^^^^ -
+ call system('xdg-open file://'.s:fileName)
? +++++++++ ^^ +
+ call system('rm '.s:fileName)
- echon "\r\r"
- echon ''
endf
let g:markdown_pl_loaded = 1
let &cpo = s:save_cpo
unlet s:save_cpo | 5 | 0.217391 | 2 | 3 |
564d271084a2734c846a2c6150f4a84f340bde0d | spec/support/factories/sermons.rb | spec/support/factories/sermons.rb | FactoryGirl.define do
factory :sermon do
group
name { Forgery('lorem_ipsum').sentence }
published_at { DateTime.now }
speaker { Forgery('name').full_name }
audio_url { "http://#{Forgery('internet').domain_name}/audio.mp3" }
banner_url { "http://#{Forgery('internet').domain_name}/banner.jpg" }
trait :completed do
notes { Forgery(:lorem_ipsum).words(10) }
speaker { Forgery('name').full_name }
series { Forgery('lorem_ipsum').title }
end
end
end
| FactoryGirl.define do
factory :sermon do
group
name { Forgery('lorem_ipsum').sentence }
published_at { DateTime.now }
speaker { Forgery('name').full_name }
trait :completed do
notes { Forgery(:lorem_ipsum).words(10) }
series { Forgery('lorem_ipsum').title }
audio_url { "http://#{Forgery('internet').domain_name}/audio.mp3" }
banner_url { "http://#{Forgery('internet').domain_name}/banner.jpg" }
end
end
end
| Revert to minimal sermon factory | Revert to minimal sermon factory
| Ruby | mit | openmcac/basechurch,openmcac/basechurch,openmcac/basechurch,openmcac/basechurch | ruby | ## Code Before:
FactoryGirl.define do
factory :sermon do
group
name { Forgery('lorem_ipsum').sentence }
published_at { DateTime.now }
speaker { Forgery('name').full_name }
audio_url { "http://#{Forgery('internet').domain_name}/audio.mp3" }
banner_url { "http://#{Forgery('internet').domain_name}/banner.jpg" }
trait :completed do
notes { Forgery(:lorem_ipsum).words(10) }
speaker { Forgery('name').full_name }
series { Forgery('lorem_ipsum').title }
end
end
end
## Instruction:
Revert to minimal sermon factory
## Code After:
FactoryGirl.define do
factory :sermon do
group
name { Forgery('lorem_ipsum').sentence }
published_at { DateTime.now }
speaker { Forgery('name').full_name }
trait :completed do
notes { Forgery(:lorem_ipsum).words(10) }
series { Forgery('lorem_ipsum').title }
audio_url { "http://#{Forgery('internet').domain_name}/audio.mp3" }
banner_url { "http://#{Forgery('internet').domain_name}/banner.jpg" }
end
end
end
| FactoryGirl.define do
factory :sermon do
group
name { Forgery('lorem_ipsum').sentence }
published_at { DateTime.now }
speaker { Forgery('name').full_name }
- audio_url { "http://#{Forgery('internet').domain_name}/audio.mp3" }
- banner_url { "http://#{Forgery('internet').domain_name}/banner.jpg" }
trait :completed do
notes { Forgery(:lorem_ipsum).words(10) }
- speaker { Forgery('name').full_name }
series { Forgery('lorem_ipsum').title }
+ audio_url { "http://#{Forgery('internet').domain_name}/audio.mp3" }
+ banner_url { "http://#{Forgery('internet').domain_name}/banner.jpg" }
end
end
end | 5 | 0.3125 | 2 | 3 |
4fa40687a50cc494136ea1acff05049892e90231 | lib/square/connect/connections/items.rb | lib/square/connect/connections/items.rb | module Square
module Connect
module Connections
module Items
def items(params = nil)
access_token_required!
items = handle_response do
access_token.get endpoint_for(identifier, :items), params
end
items.collect do |item|
Item.new item.merge(
access_token: access_token
)
end
end
def item(item_id, params = nil)
access_token_required!
Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
end
def create_item(item_attributes={})
symbol_hash = ActiveSupport::HashWithIndifferentAccess.new item_attributes
access_token_required!
Item.new(
symbol_hash.merge(access_token: access_token, merchant_id: identifier)
).create
end
def apply_fee_to_item(item_id, fee_id)
item = Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
fee = Fee.new(
fee_id,
merchant_id: identifier,
access_token: access_token
).fetch
if fee && item
item.endpoint = item.endpoint + "/fees/" + fee_id
item.update
else
return false
end
end
end
end
end
end | module Square
module Connect
module Connections
module Items
def items(params = nil)
access_token_required!
items = handle_response do
access_token.get endpoint_for(identifier, :items), params
end
items.collect do |item|
Item.new item.merge(
access_token: access_token
)
end
end
def item(item_id, params = nil)
access_token_required!
Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
end
def create_item(item_attributes={})
symbol_hash = ActiveSupport::HashWithIndifferentAccess.new item_attributes
access_token_required!
Item.new(
symbol_hash.merge(access_token: access_token, merchant_id: identifier)
).create
end
def apply_fee_to_item(item_id, fee_id)
access_token_required!
item = Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
fee = Fee.new(
fee_id,
merchant_id: identifier,
access_token: access_token
).fetch
if fee && item
item.endpoint = item.endpoint + "/fees/" + fee_id
item.update
else
return false
end
end
end
end
end
end | Make sure to set access token | Make sure to set access token
| Ruby | mit | namedpipe/square | ruby | ## Code Before:
module Square
module Connect
module Connections
module Items
def items(params = nil)
access_token_required!
items = handle_response do
access_token.get endpoint_for(identifier, :items), params
end
items.collect do |item|
Item.new item.merge(
access_token: access_token
)
end
end
def item(item_id, params = nil)
access_token_required!
Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
end
def create_item(item_attributes={})
symbol_hash = ActiveSupport::HashWithIndifferentAccess.new item_attributes
access_token_required!
Item.new(
symbol_hash.merge(access_token: access_token, merchant_id: identifier)
).create
end
def apply_fee_to_item(item_id, fee_id)
item = Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
fee = Fee.new(
fee_id,
merchant_id: identifier,
access_token: access_token
).fetch
if fee && item
item.endpoint = item.endpoint + "/fees/" + fee_id
item.update
else
return false
end
end
end
end
end
end
## Instruction:
Make sure to set access token
## Code After:
module Square
module Connect
module Connections
module Items
def items(params = nil)
access_token_required!
items = handle_response do
access_token.get endpoint_for(identifier, :items), params
end
items.collect do |item|
Item.new item.merge(
access_token: access_token
)
end
end
def item(item_id, params = nil)
access_token_required!
Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
end
def create_item(item_attributes={})
symbol_hash = ActiveSupport::HashWithIndifferentAccess.new item_attributes
access_token_required!
Item.new(
symbol_hash.merge(access_token: access_token, merchant_id: identifier)
).create
end
def apply_fee_to_item(item_id, fee_id)
access_token_required!
item = Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
fee = Fee.new(
fee_id,
merchant_id: identifier,
access_token: access_token
).fetch
if fee && item
item.endpoint = item.endpoint + "/fees/" + fee_id
item.update
else
return false
end
end
end
end
end
end | module Square
module Connect
module Connections
module Items
def items(params = nil)
access_token_required!
items = handle_response do
access_token.get endpoint_for(identifier, :items), params
end
items.collect do |item|
Item.new item.merge(
access_token: access_token
)
end
end
def item(item_id, params = nil)
access_token_required!
Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
end
def create_item(item_attributes={})
symbol_hash = ActiveSupport::HashWithIndifferentAccess.new item_attributes
access_token_required!
Item.new(
symbol_hash.merge(access_token: access_token, merchant_id: identifier)
).create
end
def apply_fee_to_item(item_id, fee_id)
+ access_token_required!
item = Item.new(
item_id,
merchant_id: identifier,
access_token: access_token
).fetch
fee = Fee.new(
fee_id,
merchant_id: identifier,
access_token: access_token
).fetch
if fee && item
item.endpoint = item.endpoint + "/fees/" + fee_id
item.update
else
return false
end
end
end
end
end
end | 1 | 0.017857 | 1 | 0 |
2240e9b206d020508bef2d23a5c98fc538a674aa | index.js | index.js | const request = require('request');
const fs = require('fs');
const DL_DIR = 'downloads';
const ENDPOINT = 'http://117.56.91.94/KMPublic/searchresult/searchservice.aspx'
+ '?region=documentcategory'
+ '&searchcategory=207'
+ '&desc=true'
+ '&sort=_l_last_modified_datetime'
+ '&pageindex=0'
+ '&pagesize=10';
// Get category list
request({ url: ENDPOINT, jar: true }, (err, response, body) => {
if (response.statusCode === 200) {
const result = JSON.parse(body);
const records = result.Data[0];
// Get array of records
records.forEach((document) => {
const { UniqueKey, Title } = document;
console.log(`[${UniqueKey}] ${Title}`);
});
}
});
| const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const DL_DIR = 'downloads';
const ENDPOINT = 'http://117.56.91.94/KMPublic/searchresult/searchservice.aspx'
+ '?region=documentcategory'
+ '&searchcategory=207'
+ '&desc=true'
+ '&sort=_l_last_modified_datetime'
+ '&pageindex=0'
+ '&pagesize=10';
const DOC_BASE_URL = 'http://117.56.91.94/KMPublic/';
function readDocumentByKey(docKey, docTitle) {
const docUrl = `${DOC_BASE_URL}readdocument.aspx?documentId=${docKey}`
request({ url: docUrl, jar: true }, (err, response, body) => {
console.log(`\n[${docKey}] ${docTitle}`);
if (response && response.statusCode === 200) {
const $ = cheerio.load(body);
const fileTitleDiv = $('.AttachFileTable td.listmode.zx > div');
fileTitleDiv.find('span').remove();
const fileTitle = fileTitleDiv.text();
const fileUrl = $('.AttachFileTable td.listmode.zw a').attr('href');
console.log(` 附件:${fileTitle}`);
console.log(` ${DOC_BASE_URL}/${fileUrl}\n`);
}
});
}
// Get category list
request({ url: ENDPOINT, jar: true }, (err, response, body) => {
if (response.statusCode === 200) {
const result = JSON.parse(body);
const records = result.Data[0];
// Get array of records
records.forEach((document) => {
const { UniqueKey, Title } = document;
readDocumentByKey(UniqueKey, Title);
});
}
});
| Read document and list attachments | Read document and list attachments
| JavaScript | mit | zhusee2/kmpublic-download | javascript | ## Code Before:
const request = require('request');
const fs = require('fs');
const DL_DIR = 'downloads';
const ENDPOINT = 'http://117.56.91.94/KMPublic/searchresult/searchservice.aspx'
+ '?region=documentcategory'
+ '&searchcategory=207'
+ '&desc=true'
+ '&sort=_l_last_modified_datetime'
+ '&pageindex=0'
+ '&pagesize=10';
// Get category list
request({ url: ENDPOINT, jar: true }, (err, response, body) => {
if (response.statusCode === 200) {
const result = JSON.parse(body);
const records = result.Data[0];
// Get array of records
records.forEach((document) => {
const { UniqueKey, Title } = document;
console.log(`[${UniqueKey}] ${Title}`);
});
}
});
## Instruction:
Read document and list attachments
## Code After:
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const DL_DIR = 'downloads';
const ENDPOINT = 'http://117.56.91.94/KMPublic/searchresult/searchservice.aspx'
+ '?region=documentcategory'
+ '&searchcategory=207'
+ '&desc=true'
+ '&sort=_l_last_modified_datetime'
+ '&pageindex=0'
+ '&pagesize=10';
const DOC_BASE_URL = 'http://117.56.91.94/KMPublic/';
function readDocumentByKey(docKey, docTitle) {
const docUrl = `${DOC_BASE_URL}readdocument.aspx?documentId=${docKey}`
request({ url: docUrl, jar: true }, (err, response, body) => {
console.log(`\n[${docKey}] ${docTitle}`);
if (response && response.statusCode === 200) {
const $ = cheerio.load(body);
const fileTitleDiv = $('.AttachFileTable td.listmode.zx > div');
fileTitleDiv.find('span').remove();
const fileTitle = fileTitleDiv.text();
const fileUrl = $('.AttachFileTable td.listmode.zw a').attr('href');
console.log(` 附件:${fileTitle}`);
console.log(` ${DOC_BASE_URL}/${fileUrl}\n`);
}
});
}
// Get category list
request({ url: ENDPOINT, jar: true }, (err, response, body) => {
if (response.statusCode === 200) {
const result = JSON.parse(body);
const records = result.Data[0];
// Get array of records
records.forEach((document) => {
const { UniqueKey, Title } = document;
readDocumentByKey(UniqueKey, Title);
});
}
});
| const request = require('request');
+ const cheerio = require('cheerio');
const fs = require('fs');
const DL_DIR = 'downloads';
const ENDPOINT = 'http://117.56.91.94/KMPublic/searchresult/searchservice.aspx'
+ '?region=documentcategory'
+ '&searchcategory=207'
+ '&desc=true'
+ '&sort=_l_last_modified_datetime'
+ '&pageindex=0'
+ '&pagesize=10';
+ const DOC_BASE_URL = 'http://117.56.91.94/KMPublic/';
+
+ function readDocumentByKey(docKey, docTitle) {
+ const docUrl = `${DOC_BASE_URL}readdocument.aspx?documentId=${docKey}`
+
+ request({ url: docUrl, jar: true }, (err, response, body) => {
+ console.log(`\n[${docKey}] ${docTitle}`);
+
+ if (response && response.statusCode === 200) {
+ const $ = cheerio.load(body);
+
+ const fileTitleDiv = $('.AttachFileTable td.listmode.zx > div');
+ fileTitleDiv.find('span').remove();
+
+ const fileTitle = fileTitleDiv.text();
+ const fileUrl = $('.AttachFileTable td.listmode.zw a').attr('href');
+
+ console.log(` 附件:${fileTitle}`);
+ console.log(` ${DOC_BASE_URL}/${fileUrl}\n`);
+ }
+ });
+ }
// Get category list
request({ url: ENDPOINT, jar: true }, (err, response, body) => {
if (response.statusCode === 200) {
const result = JSON.parse(body);
const records = result.Data[0];
// Get array of records
records.forEach((document) => {
const { UniqueKey, Title } = document;
- console.log(`[${UniqueKey}] ${Title}`);
+ readDocumentByKey(UniqueKey, Title);
});
}
}); | 25 | 0.925926 | 24 | 1 |
4d25ffd5f558f718a60b082a303eb1bb317ffdda | app/assets/javascripts/backbone/views/transition_view.js.coffee | app/assets/javascripts/backbone/views/transition_view.js.coffee |
class UIDemo.Views.TransitionView extends Backbone.View
transitionRemoveClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.removeClass className).then -> p
transitionAddClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.addClass className).then -> p
_transitionPromise: ($el) ->
return `when`.resolve(this) if $('body').is('.no-transitions')
defer = `when`.defer()
transitionEvent = @_whichTransitionEvent()
transitionEndEventHandler = =>
$el[0].removeEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.resolve(this)
$el[0].addEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.promise
_whichTransitionEvent: ->
el = document.createElement('fakeelement')
transitions =
'transition': 'transitionend'
'OTransition': 'oTransitionEnd'
'MozTransition': 'transitionend'
'WebkitTransition': 'webkitTransitionEnd'
return event for property, event of transitions when el.style[property]?
_delay: (code, time = 0) ->
time = 0 if $('body').is('.no-transitions')
defer = `when`.defer()
setTimeout(
-> `when(code())`.then (result) => defer.resolve(result)
time
)
defer.promise
|
class UIDemo.Views.TransitionView extends Backbone.View
transitionRemoveClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.removeClass className).then -> p
transitionAddClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.addClass className).then -> p
_transitionPromise: ($el) ->
return `when`.resolve(this) if $('body').is('.no-transitions')
defer = `when`.defer()
transitionEvent = @_whichTransitionEvent()
transitionEndEventHandler = =>
$el[0].removeEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.resolve(this)
$el[0].addEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.promise
_whichTransitionEvent: ->
el = document.createElement('fakeelement')
transitions =
'transition': 'transitionend'
'OTransition': 'oTransitionEnd'
'MozTransition': 'transitionend'
'WebkitTransition': 'webkitTransitionEnd'
return event for property, event of transitions when el.style[property]?
_delay: (code, time = 0) ->
if $('body').is('.no-transitions')
result = code()
`when`.resolve(result)
defer = `when`.defer()
setTimeout(
-> `when(code())`.then (result) => defer.resolve(result)
time
)
defer.promise
| Remove asynchronous working if transitions are disabled | Remove asynchronous working if transitions are disabled
| CoffeeScript | mit | matthijsgroen/backbone-ui-transitions-demo,matthijsgroen/backbone-ui-transitions-demo | coffeescript | ## Code Before:
class UIDemo.Views.TransitionView extends Backbone.View
transitionRemoveClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.removeClass className).then -> p
transitionAddClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.addClass className).then -> p
_transitionPromise: ($el) ->
return `when`.resolve(this) if $('body').is('.no-transitions')
defer = `when`.defer()
transitionEvent = @_whichTransitionEvent()
transitionEndEventHandler = =>
$el[0].removeEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.resolve(this)
$el[0].addEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.promise
_whichTransitionEvent: ->
el = document.createElement('fakeelement')
transitions =
'transition': 'transitionend'
'OTransition': 'oTransitionEnd'
'MozTransition': 'transitionend'
'WebkitTransition': 'webkitTransitionEnd'
return event for property, event of transitions when el.style[property]?
_delay: (code, time = 0) ->
time = 0 if $('body').is('.no-transitions')
defer = `when`.defer()
setTimeout(
-> `when(code())`.then (result) => defer.resolve(result)
time
)
defer.promise
## Instruction:
Remove asynchronous working if transitions are disabled
## Code After:
class UIDemo.Views.TransitionView extends Backbone.View
transitionRemoveClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.removeClass className).then -> p
transitionAddClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.addClass className).then -> p
_transitionPromise: ($el) ->
return `when`.resolve(this) if $('body').is('.no-transitions')
defer = `when`.defer()
transitionEvent = @_whichTransitionEvent()
transitionEndEventHandler = =>
$el[0].removeEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.resolve(this)
$el[0].addEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.promise
_whichTransitionEvent: ->
el = document.createElement('fakeelement')
transitions =
'transition': 'transitionend'
'OTransition': 'oTransitionEnd'
'MozTransition': 'transitionend'
'WebkitTransition': 'webkitTransitionEnd'
return event for property, event of transitions when el.style[property]?
_delay: (code, time = 0) ->
if $('body').is('.no-transitions')
result = code()
`when`.resolve(result)
defer = `when`.defer()
setTimeout(
-> `when(code())`.then (result) => defer.resolve(result)
time
)
defer.promise
|
class UIDemo.Views.TransitionView extends Backbone.View
transitionRemoveClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.removeClass className).then -> p
transitionAddClass: (className, $el = @$el) ->
p = @_transitionPromise($el)
@_delay(=> $el.addClass className).then -> p
_transitionPromise: ($el) ->
return `when`.resolve(this) if $('body').is('.no-transitions')
defer = `when`.defer()
transitionEvent = @_whichTransitionEvent()
transitionEndEventHandler = =>
$el[0].removeEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.resolve(this)
$el[0].addEventListener(
transitionEvent
transitionEndEventHandler
false
)
defer.promise
_whichTransitionEvent: ->
el = document.createElement('fakeelement')
transitions =
'transition': 'transitionend'
'OTransition': 'oTransitionEnd'
'MozTransition': 'transitionend'
'WebkitTransition': 'webkitTransitionEnd'
return event for property, event of transitions when el.style[property]?
_delay: (code, time = 0) ->
- time = 0 if $('body').is('.no-transitions')
? ---------
+ if $('body').is('.no-transitions')
+ result = code()
+ `when`.resolve(result)
+
defer = `when`.defer()
setTimeout(
-> `when(code())`.then (result) => defer.resolve(result)
time
)
defer.promise | 5 | 0.104167 | 4 | 1 |
19e5351511bcabf38fffbbe2b15ca55a423cf469 | .travis.yml | .travis.yml | language: ruby
before_install:
- sudo apt-get install git subversion mercurial
- gem install rspec -v "~> 3.0"
rvm:
- 2.5
- 2.6
- 2.7
- jruby
- rbx-2
| language: ruby
before_install:
- sudo apt-get install git subversion mercurial
- gem install rspec -v "~> 3.0"
rvm:
- 2.5
- 2.6
- 2.7
- jruby
| Remove rbx-2 from the test matrix. | Remove rbx-2 from the test matrix.
| YAML | mit | postmodern/rubygems-tasks | yaml | ## Code Before:
language: ruby
before_install:
- sudo apt-get install git subversion mercurial
- gem install rspec -v "~> 3.0"
rvm:
- 2.5
- 2.6
- 2.7
- jruby
- rbx-2
## Instruction:
Remove rbx-2 from the test matrix.
## Code After:
language: ruby
before_install:
- sudo apt-get install git subversion mercurial
- gem install rspec -v "~> 3.0"
rvm:
- 2.5
- 2.6
- 2.7
- jruby
| language: ruby
before_install:
- sudo apt-get install git subversion mercurial
- gem install rspec -v "~> 3.0"
rvm:
- 2.5
- 2.6
- 2.7
- jruby
- - rbx-2 | 1 | 0.1 | 0 | 1 |
5d238418e1a9f19d194fd0e55750bea2c36b37a6 | doc/index.rst | doc/index.rst | ===============================
Gerbi's CMS documentation
===============================
Welcome on the documentation of the simple multilingual Gerbi CMS (package name: django-page-cms). You track the latest
changes to the code base on the `github project page <http://github.com/batiste/django-page-cms>`_.
To get more information about this CMS and its feature go to the :doc:`Introduction section </introduction>`.
For a quick install::
$ pip install django-page-cms[full]; gerbi --create mywebsite
For more complete installations instructions go to
the :doc:`Installation section </installation>`. To get source code with git use::
$ git clone git://github.com/batiste/django-page-cms.git django-page-cms
Table of content
======================================
.. toctree::
:maxdepth: 2
introduction.rst
contributions.rst
placeholders.rst
installation.rst
display-content.rst
edit-content.rst
navigation-template-tags.rst
3rd-party-apps.rst
commands.rst
settings-list.rst
changelog.rst
page-api.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| ===============================
Gerbi's CMS documentation
===============================
Welcome on the documentation of the simple multilingual Gerbi CMS (package name: django-page-cms). You track the latest
changes to the code base on the `github project page <http://github.com/batiste/django-page-cms>`_.
To get more information about this CMS and its feature go to the :doc:`Introduction section </introduction>`.
For a quick install::
$ pip install django-page-cms[full]; gerbi --create mywebsite
For more complete installations instructions go to
the :doc:`Installation section </installation>`. To get source code with git use::
$ git clone git://github.com/batiste/django-page-cms.git django-page-cms
Build the documentation from cloned repo
==========================================
$ pip install .[docs]
$ python setup.py build_sphinx
Table of content
======================================
.. toctree::
:maxdepth: 2
introduction.rst
contributions.rst
placeholders.rst
installation.rst
display-content.rst
edit-content.rst
navigation-template-tags.rst
3rd-party-apps.rst
commands.rst
settings-list.rst
changelog.rst
page-api.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| Include building the doc in the doc | Include building the doc in the doc
| reStructuredText | bsd-3-clause | batiste/django-page-cms,batiste/django-page-cms,batiste/django-page-cms | restructuredtext | ## Code Before:
===============================
Gerbi's CMS documentation
===============================
Welcome on the documentation of the simple multilingual Gerbi CMS (package name: django-page-cms). You track the latest
changes to the code base on the `github project page <http://github.com/batiste/django-page-cms>`_.
To get more information about this CMS and its feature go to the :doc:`Introduction section </introduction>`.
For a quick install::
$ pip install django-page-cms[full]; gerbi --create mywebsite
For more complete installations instructions go to
the :doc:`Installation section </installation>`. To get source code with git use::
$ git clone git://github.com/batiste/django-page-cms.git django-page-cms
Table of content
======================================
.. toctree::
:maxdepth: 2
introduction.rst
contributions.rst
placeholders.rst
installation.rst
display-content.rst
edit-content.rst
navigation-template-tags.rst
3rd-party-apps.rst
commands.rst
settings-list.rst
changelog.rst
page-api.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
## Instruction:
Include building the doc in the doc
## Code After:
===============================
Gerbi's CMS documentation
===============================
Welcome on the documentation of the simple multilingual Gerbi CMS (package name: django-page-cms). You track the latest
changes to the code base on the `github project page <http://github.com/batiste/django-page-cms>`_.
To get more information about this CMS and its feature go to the :doc:`Introduction section </introduction>`.
For a quick install::
$ pip install django-page-cms[full]; gerbi --create mywebsite
For more complete installations instructions go to
the :doc:`Installation section </installation>`. To get source code with git use::
$ git clone git://github.com/batiste/django-page-cms.git django-page-cms
Build the documentation from cloned repo
==========================================
$ pip install .[docs]
$ python setup.py build_sphinx
Table of content
======================================
.. toctree::
:maxdepth: 2
introduction.rst
contributions.rst
placeholders.rst
installation.rst
display-content.rst
edit-content.rst
navigation-template-tags.rst
3rd-party-apps.rst
commands.rst
settings-list.rst
changelog.rst
page-api.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| ===============================
Gerbi's CMS documentation
===============================
Welcome on the documentation of the simple multilingual Gerbi CMS (package name: django-page-cms). You track the latest
changes to the code base on the `github project page <http://github.com/batiste/django-page-cms>`_.
To get more information about this CMS and its feature go to the :doc:`Introduction section </introduction>`.
For a quick install::
$ pip install django-page-cms[full]; gerbi --create mywebsite
For more complete installations instructions go to
the :doc:`Installation section </installation>`. To get source code with git use::
$ git clone git://github.com/batiste/django-page-cms.git django-page-cms
+ Build the documentation from cloned repo
+ ==========================================
+
+ $ pip install .[docs]
+ $ python setup.py build_sphinx
Table of content
======================================
.. toctree::
:maxdepth: 2
introduction.rst
contributions.rst
placeholders.rst
installation.rst
display-content.rst
edit-content.rst
navigation-template-tags.rst
3rd-party-apps.rst
commands.rst
settings-list.rst
changelog.rst
page-api.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| 5 | 0.104167 | 5 | 0 |
97f4c0734539c4e3269a8c058e6f8a25b49cf6a5 | src/my_functions.cpp | src/my_functions.cpp |
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return my_vector;
}
int putStringsInVector(int num){
std::vector<std::string> my_strings;
for(int i=0; i<num; i++){
my_strings.push_back(createString());
}
return my_strings.size();
}
|
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return my_vector;
}
int putStringsInVector(int num){
std::vector<std::string> my_strings;
for(int i=0; i<num; i++){
my_strings.push_back(createString());
}
return my_strings.size();
}
void modifyVector(std::vector<int> & vector){
int count = 0;
for(int i:vector){
if(count % 5 == 0){
i = 42;
}
}
}
| Add code for function test. | Add code for function test.
| C++ | mit | irawoodring/CIS263-Intro_to_cpp | c++ | ## Code Before:
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return my_vector;
}
int putStringsInVector(int num){
std::vector<std::string> my_strings;
for(int i=0; i<num; i++){
my_strings.push_back(createString());
}
return my_strings.size();
}
## Instruction:
Add code for function test.
## Code After:
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return my_vector;
}
int putStringsInVector(int num){
std::vector<std::string> my_strings;
for(int i=0; i<num; i++){
my_strings.push_back(createString());
}
return my_strings.size();
}
void modifyVector(std::vector<int> & vector){
int count = 0;
for(int i:vector){
if(count % 5 == 0){
i = 42;
}
}
}
|
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return my_vector;
}
int putStringsInVector(int num){
std::vector<std::string> my_strings;
for(int i=0; i<num; i++){
my_strings.push_back(createString());
}
return my_strings.size();
}
+
+ void modifyVector(std::vector<int> & vector){
+ int count = 0;
+ for(int i:vector){
+ if(count % 5 == 0){
+ i = 42;
+ }
+ }
+ } | 9 | 0.428571 | 9 | 0 |
bd8b23d4bad4191367e7c5eb3297769a2477afec | scripts/createSrcAndDocPackage.sh | scripts/createSrcAndDocPackage.sh | if [[ $# != 2 ]]; then
cat <<USAGE
usage:
$0 <branch> <version>
Creates tar and zip source package from origin/<branch> and documentation-zip from current checkout.
Files and directories are named after <version>.
example:
$0 2.0.0 2.0.0-rc1
USAGE
exit 1
fi
BRANCH=$1
VERSION=$2
cd `dirname $0`/..
echo "Creating tar archive..."
git archive --format=tar --prefix=qt-creator-${VERSION}-src/ origin/${BRANCH} | gzip > qt-creator-${VERSION}-src.tar.gz || exit 1
echo "Creating zip archive..."
git archive --format=zip --prefix=qt-creator-${VERSION}-src/ origin/${BRANCH} > qt-creator-${VERSION}-src.zip || exit 1
echo "Creating documentation..."
rm -r doc/html
qmake -r && make docs_online || exit 1
cd doc
cp -r html qt-creator-${VERSION}
zip -r ../qt-creator-${VERSION}-doc.zip qt-creator-${VERSION}
rm -r qt-creator-${VERSION}
| if [[ $# != 2 ]]; then
cat <<USAGE
usage:
$0 <refspec> <version>
Creates tar and zip source package from <refspec> and documentation-zip from current checkout.
Files and directories are named after <version>.
example:
$0 origin/2.0.0 2.0.0-rc1
USAGE
exit 1
fi
BRANCH=$1
VERSION=$2
cd `dirname $0`/..
echo "Creating tar archive..."
git archive --format=tar --prefix=qt-creator-${VERSION}-src/ ${BRANCH} | gzip > qt-creator-${VERSION}-src.tar.gz || exit 1
echo "Creating zip archive..."
git archive --format=zip --prefix=qt-creator-${VERSION}-src/ ${BRANCH} > qt-creator-${VERSION}-src.zip || exit 1
echo "Creating documentation..."
rm -r doc/html
qmake -r && make docs_online || exit 1
cd doc
cp -r html qt-creator-${VERSION}
zip -r ../qt-creator-${VERSION}-doc.zip qt-creator-${VERSION}
rm -r qt-creator-${VERSION}
| Make src packaging script more flexible. | Make src packaging script more flexible.
| Shell | lgpl-2.1 | amyvmiwei/qt-creator,darksylinc/qt-creator,AltarBeastiful/qt-creator,sandsmark/qtcreator-minimap,darksylinc/qt-creator,Distrotech/qtcreator,hdweiss/qt-creator-visualizer,omniacreator/qtcreator,jonnor/qt-creator,syntheticpp/qt-creator,colede/qtcreator,xianian/qt-creator,pcacjr/qt-creator,jonnor/qt-creator,AltarBeastiful/qt-creator,kuba1/qtcreator,darksylinc/qt-creator,omniacreator/qtcreator,colede/qtcreator,KDAB/KDAB-Creator,syntheticpp/qt-creator,darksylinc/qt-creator,maui-packages/qt-creator,amyvmiwei/qt-creator,dmik/qt-creator-os2,duythanhphan/qt-creator,yinyunqiao/qtcreator,syntheticpp/qt-creator,colede/qtcreator,kuba1/qtcreator,martyone/sailfish-qtcreator,dmik/qt-creator-os2,bakaiadam/collaborative_qt_creator,KDAB/KDAB-Creator,bakaiadam/collaborative_qt_creator,darksylinc/qt-creator,KDE/android-qt-creator,jonnor/qt-creator,amyvmiwei/qt-creator,jonnor/qt-creator,danimo/qt-creator,sandsmark/qtcreator-minimap,danimo/qt-creator,yinyunqiao/qtcreator,KDE/android-qt-creator,malikcjm/qtcreator,azat/qtcreator,amyvmiwei/qt-creator,martyone/sailfish-qtcreator,azat/qtcreator,omniacreator/qtcreator,renatofilho/QtCreator,bakaiadam/collaborative_qt_creator,duythanhphan/qt-creator,kuba1/qtcreator,azat/qtcreator,dmik/qt-creator-os2,omniacreator/qtcreator,duythanhphan/qt-creator,omniacreator/qtcreator,syntheticpp/qt-creator,KDE/android-qt-creator,pcacjr/qt-creator,xianian/qt-creator,richardmg/qtcreator,pcacjr/qt-creator,xianian/qt-creator,Distrotech/qtcreator,sandsmark/qtcreator-minimap,martyone/sailfish-qtcreator,maui-packages/qt-creator,AltarBeastiful/qt-creator,danimo/qt-creator,xianian/qt-creator,sandsmark/qtcreator-minimap,xianian/qt-creator,AltarBeastiful/qt-creator,azat/qtcreator,martyone/sailfish-qtcreator,malikcjm/qtcreator,maui-packages/qt-creator,farseerri/git_code,Distrotech/qtcreator,azat/qtcreator,xianian/qt-creator,bakaiadam/collaborative_qt_creator,amyvmiwei/qt-creator,pcacjr/qt-creator,renatofilho/QtCreator,darksylinc/qt-creator,ostash/qt-creator-i18n-uk,martyone/sailfish-qtcreator,KDE/android-qt-creator,syntheticpp/qt-creator,omniacreator/qtcreator,kuba1/qtcreator,renatofilho/QtCreator,AltarBeastiful/qt-creator,farseerri/git_code,danimo/qt-creator,AltarBeastiful/qt-creator,jonnor/qt-creator,azat/qtcreator,KDE/android-qt-creator,duythanhphan/qt-creator,omniacreator/qtcreator,KDE/android-qt-creator,colede/qtcreator,ostash/qt-creator-i18n-uk,darksylinc/qt-creator,syntheticpp/qt-creator,colede/qtcreator,danimo/qt-creator,yinyunqiao/qtcreator,farseerri/git_code,danimo/qt-creator,richardmg/qtcreator,KDE/android-qt-creator,farseerri/git_code,KDE/android-qt-creator,maui-packages/qt-creator,jonnor/qt-creator,renatofilho/QtCreator,malikcjm/qtcreator,richardmg/qtcreator,danimo/qt-creator,farseerri/git_code,bakaiadam/collaborative_qt_creator,syntheticpp/qt-creator,amyvmiwei/qt-creator,Distrotech/qtcreator,colede/qtcreator,martyone/sailfish-qtcreator,martyone/sailfish-qtcreator,pcacjr/qt-creator,farseerri/git_code,hdweiss/qt-creator-visualizer,bakaiadam/collaborative_qt_creator,dmik/qt-creator-os2,farseerri/git_code,yinyunqiao/qtcreator,malikcjm/qtcreator,AltarBeastiful/qt-creator,KDAB/KDAB-Creator,KDAB/KDAB-Creator,malikcjm/qtcreator,amyvmiwei/qt-creator,ostash/qt-creator-i18n-uk,Distrotech/qtcreator,dmik/qt-creator-os2,richardmg/qtcreator,yinyunqiao/qtcreator,KDAB/KDAB-Creator,richardmg/qtcreator,kuba1/qtcreator,kuba1/qtcreator,dmik/qt-creator-os2,dmik/qt-creator-os2,duythanhphan/qt-creator,kuba1/qtcreator,hdweiss/qt-creator-visualizer,duythanhphan/qt-creator,farseerri/git_code,ostash/qt-creator-i18n-uk,duythanhphan/qt-creator,yinyunqiao/qtcreator,malikcjm/qtcreator,AltarBeastiful/qt-creator,martyone/sailfish-qtcreator,kuba1/qtcreator,Distrotech/qtcreator,xianian/qt-creator,pcacjr/qt-creator,amyvmiwei/qt-creator,hdweiss/qt-creator-visualizer,martyone/sailfish-qtcreator,hdweiss/qt-creator-visualizer,Distrotech/qtcreator,richardmg/qtcreator,danimo/qt-creator,maui-packages/qt-creator,colede/qtcreator,KDAB/KDAB-Creator,ostash/qt-creator-i18n-uk,sandsmark/qtcreator-minimap,ostash/qt-creator-i18n-uk,yinyunqiao/qtcreator,renatofilho/QtCreator,hdweiss/qt-creator-visualizer,ostash/qt-creator-i18n-uk,malikcjm/qtcreator,xianian/qt-creator,xianian/qt-creator,bakaiadam/collaborative_qt_creator,danimo/qt-creator,kuba1/qtcreator,renatofilho/QtCreator,darksylinc/qt-creator,sandsmark/qtcreator-minimap,richardmg/qtcreator,maui-packages/qt-creator,pcacjr/qt-creator,maui-packages/qt-creator | shell | ## Code Before:
if [[ $# != 2 ]]; then
cat <<USAGE
usage:
$0 <branch> <version>
Creates tar and zip source package from origin/<branch> and documentation-zip from current checkout.
Files and directories are named after <version>.
example:
$0 2.0.0 2.0.0-rc1
USAGE
exit 1
fi
BRANCH=$1
VERSION=$2
cd `dirname $0`/..
echo "Creating tar archive..."
git archive --format=tar --prefix=qt-creator-${VERSION}-src/ origin/${BRANCH} | gzip > qt-creator-${VERSION}-src.tar.gz || exit 1
echo "Creating zip archive..."
git archive --format=zip --prefix=qt-creator-${VERSION}-src/ origin/${BRANCH} > qt-creator-${VERSION}-src.zip || exit 1
echo "Creating documentation..."
rm -r doc/html
qmake -r && make docs_online || exit 1
cd doc
cp -r html qt-creator-${VERSION}
zip -r ../qt-creator-${VERSION}-doc.zip qt-creator-${VERSION}
rm -r qt-creator-${VERSION}
## Instruction:
Make src packaging script more flexible.
## Code After:
if [[ $# != 2 ]]; then
cat <<USAGE
usage:
$0 <refspec> <version>
Creates tar and zip source package from <refspec> and documentation-zip from current checkout.
Files and directories are named after <version>.
example:
$0 origin/2.0.0 2.0.0-rc1
USAGE
exit 1
fi
BRANCH=$1
VERSION=$2
cd `dirname $0`/..
echo "Creating tar archive..."
git archive --format=tar --prefix=qt-creator-${VERSION}-src/ ${BRANCH} | gzip > qt-creator-${VERSION}-src.tar.gz || exit 1
echo "Creating zip archive..."
git archive --format=zip --prefix=qt-creator-${VERSION}-src/ ${BRANCH} > qt-creator-${VERSION}-src.zip || exit 1
echo "Creating documentation..."
rm -r doc/html
qmake -r && make docs_online || exit 1
cd doc
cp -r html qt-creator-${VERSION}
zip -r ../qt-creator-${VERSION}-doc.zip qt-creator-${VERSION}
rm -r qt-creator-${VERSION}
| if [[ $# != 2 ]]; then
cat <<USAGE
usage:
- $0 <branch> <version>
? - ^^ -
+ $0 <refspec> <version>
? ^^^^^
- Creates tar and zip source package from origin/<branch> and documentation-zip from current checkout.
? ^ ^^^^^^^^^^ -
+ Creates tar and zip source package from <refspec> and documentation-zip from current checkout.
? ^ ^^^^^
Files and directories are named after <version>.
example:
- $0 2.0.0 2.0.0-rc1
+ $0 origin/2.0.0 2.0.0-rc1
? +++++++
USAGE
exit 1
fi
BRANCH=$1
VERSION=$2
cd `dirname $0`/..
echo "Creating tar archive..."
- git archive --format=tar --prefix=qt-creator-${VERSION}-src/ origin/${BRANCH} | gzip > qt-creator-${VERSION}-src.tar.gz || exit 1
? -------
+ git archive --format=tar --prefix=qt-creator-${VERSION}-src/ ${BRANCH} | gzip > qt-creator-${VERSION}-src.tar.gz || exit 1
echo "Creating zip archive..."
- git archive --format=zip --prefix=qt-creator-${VERSION}-src/ origin/${BRANCH} > qt-creator-${VERSION}-src.zip || exit 1
? -------
+ git archive --format=zip --prefix=qt-creator-${VERSION}-src/ ${BRANCH} > qt-creator-${VERSION}-src.zip || exit 1
echo "Creating documentation..."
rm -r doc/html
qmake -r && make docs_online || exit 1
cd doc
cp -r html qt-creator-${VERSION}
zip -r ../qt-creator-${VERSION}-doc.zip qt-creator-${VERSION}
rm -r qt-creator-${VERSION} | 10 | 0.37037 | 5 | 5 |
b47feb8122cbfb9b56ab135402a4be0f94bbc46c | mariaDB4j-maven-plugin/src/it/start-stop-skip/verify.groovy | mariaDB4j-maven-plugin/src/it/start-stop-skip/verify.groovy | import static org.junit.Assert.assertFalse
def file = new File(basedir, "build.log")
assertFalse 'MariaDB4j should not have run', file.text.contains("Installing a new embedded database")
assertFalse 'MariaDB4j Should not attempt to stop', file.text.contains('Shutdown Hook Deletion Thread for Temporary DB')
| import static org.junit.Assert.assertFalse
def file = new File(basedir, "build.log")
assertFalse 'MariaDB4j should not have run', file.text.contains("Installing a new embedded database")
assertFalse 'MariaDB4j Should not attempt to stop', file.text.contains('ShutdownHook quietly deleting temporary DB data directory')
| Update assertion to use current shutdown thread log message | Update assertion to use current shutdown thread log message
| Groovy | apache-2.0 | vorburger/MariaDB4j,vorburger/MariaDB4j | groovy | ## Code Before:
import static org.junit.Assert.assertFalse
def file = new File(basedir, "build.log")
assertFalse 'MariaDB4j should not have run', file.text.contains("Installing a new embedded database")
assertFalse 'MariaDB4j Should not attempt to stop', file.text.contains('Shutdown Hook Deletion Thread for Temporary DB')
## Instruction:
Update assertion to use current shutdown thread log message
## Code After:
import static org.junit.Assert.assertFalse
def file = new File(basedir, "build.log")
assertFalse 'MariaDB4j should not have run', file.text.contains("Installing a new embedded database")
assertFalse 'MariaDB4j Should not attempt to stop', file.text.contains('ShutdownHook quietly deleting temporary DB data directory')
| import static org.junit.Assert.assertFalse
def file = new File(basedir, "build.log")
assertFalse 'MariaDB4j should not have run', file.text.contains("Installing a new embedded database")
- assertFalse 'MariaDB4j Should not attempt to stop', file.text.contains('Shutdown Hook Deletion Thread for Temporary DB')
? - ^ - ^^^^^^^^^^^^
+ assertFalse 'MariaDB4j Should not attempt to stop', file.text.contains('ShutdownHook quietly deleting temporary DB data directory')
? ^^^^^^^^^ + ^ +++++++++++++++
| 2 | 0.4 | 1 | 1 |
77d72fe0502c64294dbacdbf8defbb44ee21c088 | schools/admin.py | schools/admin.py | from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
list_display = ('__str__', 'has_photo')
list_filter = ('photos',)
inlines = [SchoolBuildingPhotoInline]
| from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
search_fields = ['school__names__types__value']
list_display = ('__str__', 'has_photo')
list_filter = ('photos',)
inlines = [SchoolBuildingPhotoInline]
| Add search based on school name | Add search based on school name
| Python | agpl-3.0 | City-of-Helsinki/kore,City-of-Helsinki/kore,Rikuoja/kore,Rikuoja/kore | python | ## Code Before:
from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
list_display = ('__str__', 'has_photo')
list_filter = ('photos',)
inlines = [SchoolBuildingPhotoInline]
## Instruction:
Add search based on school name
## Code After:
from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
search_fields = ['school__names__types__value']
list_display = ('__str__', 'has_photo')
list_filter = ('photos',)
inlines = [SchoolBuildingPhotoInline]
| from django.contrib import admin
from .models import *
class SchoolBuildingPhotoInline(admin.TabularInline):
model = SchoolBuildingPhoto
@admin.register(SchoolBuilding)
class SchoolBuildingAdmin(admin.ModelAdmin):
fields = ('school', 'building', 'begin_year', 'end_year')
readonly_fields = fields
+ search_fields = ['school__names__types__value']
list_display = ('__str__', 'has_photo')
list_filter = ('photos',)
inlines = [SchoolBuildingPhotoInline] | 1 | 0.066667 | 1 | 0 |
7b87c75c1235732716455cad016c848c6930f03e | app/services/tags/create_service.rb | app/services/tags/create_service.rb |
module Tags
class CreateService < BaseService
def execute(tag_name, target, message, release_description = nil)
valid_tag = Gitlab::GitRefValidator.validate(tag_name)
return error('Tag name invalid') unless valid_tag
repository = project.repository
message&.strip!
new_tag = nil
begin
new_tag = repository.add_tag(current_user, tag_name, target, message)
rescue Gitlab::Git::Repository::TagExistsError
return error("Tag #{tag_name} already exists")
rescue Gitlab::Git::PreReceiveError => ex
return error(ex.message)
end
if new_tag
if release_description
CreateReleaseService.new(@project, @current_user)
.execute(tag_name, release_description)
end
success.merge(tag: new_tag)
else
error("Target #{target} is invalid")
end
end
end
end
|
module Tags
class CreateService < BaseService
def execute(tag_name, target, message, release_description = nil)
valid_tag = Gitlab::GitRefValidator.validate(tag_name)
return error('Tag name invalid') unless valid_tag
repository = project.repository
message = message&.strip
new_tag = nil
begin
new_tag = repository.add_tag(current_user, tag_name, target, message)
rescue Gitlab::Git::Repository::TagExistsError
return error("Tag #{tag_name} already exists")
rescue Gitlab::Git::PreReceiveError => ex
return error(ex.message)
end
if new_tag
if release_description
CreateReleaseService.new(@project, @current_user)
.execute(tag_name, release_description)
end
success.merge(tag: new_tag)
else
error("Target #{target} is invalid")
end
end
end
end
| Tag message is frozen so avoid stripping destructively | Tag message is frozen so avoid stripping destructively
| Ruby | mit | mmkassem/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,axilleas/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,dreampet/gitlab,dreampet/gitlab,jirutka/gitlabhq,iiet/iiet-git,dreampet/gitlab,stoplightio/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq | ruby | ## Code Before:
module Tags
class CreateService < BaseService
def execute(tag_name, target, message, release_description = nil)
valid_tag = Gitlab::GitRefValidator.validate(tag_name)
return error('Tag name invalid') unless valid_tag
repository = project.repository
message&.strip!
new_tag = nil
begin
new_tag = repository.add_tag(current_user, tag_name, target, message)
rescue Gitlab::Git::Repository::TagExistsError
return error("Tag #{tag_name} already exists")
rescue Gitlab::Git::PreReceiveError => ex
return error(ex.message)
end
if new_tag
if release_description
CreateReleaseService.new(@project, @current_user)
.execute(tag_name, release_description)
end
success.merge(tag: new_tag)
else
error("Target #{target} is invalid")
end
end
end
end
## Instruction:
Tag message is frozen so avoid stripping destructively
## Code After:
module Tags
class CreateService < BaseService
def execute(tag_name, target, message, release_description = nil)
valid_tag = Gitlab::GitRefValidator.validate(tag_name)
return error('Tag name invalid') unless valid_tag
repository = project.repository
message = message&.strip
new_tag = nil
begin
new_tag = repository.add_tag(current_user, tag_name, target, message)
rescue Gitlab::Git::Repository::TagExistsError
return error("Tag #{tag_name} already exists")
rescue Gitlab::Git::PreReceiveError => ex
return error(ex.message)
end
if new_tag
if release_description
CreateReleaseService.new(@project, @current_user)
.execute(tag_name, release_description)
end
success.merge(tag: new_tag)
else
error("Target #{target} is invalid")
end
end
end
end
|
module Tags
class CreateService < BaseService
def execute(tag_name, target, message, release_description = nil)
valid_tag = Gitlab::GitRefValidator.validate(tag_name)
return error('Tag name invalid') unless valid_tag
repository = project.repository
- message&.strip!
? -
+ message = message&.strip
? ++++++++++
new_tag = nil
begin
new_tag = repository.add_tag(current_user, tag_name, target, message)
rescue Gitlab::Git::Repository::TagExistsError
return error("Tag #{tag_name} already exists")
rescue Gitlab::Git::PreReceiveError => ex
return error(ex.message)
end
if new_tag
if release_description
CreateReleaseService.new(@project, @current_user)
.execute(tag_name, release_description)
end
success.merge(tag: new_tag)
else
error("Target #{target} is invalid")
end
end
end
end | 2 | 0.060606 | 1 | 1 |
0f746248186d0cb05527127b25b73110329a7f6b | src/scss/modules/_pagination.scss | src/scss/modules/_pagination.scss | /*---------------------------------------------------------------------------*\
BREADCRUMBS
\*---------------------------------------------------------------------------*/
/**
* A breadcrumb trail that can be configured with separators.
*
* Usage:
<div class="breadcrumbs">
<a class="breadcrumbs_crumb" href="#">Home</a>
<span class="breadcrumbs_separator"></span>
<span class="breadcrumbs_crumb disabled">Disabled</span>
<span class="breadcrumbs_separator"></span>
<a class="breadcrumbs_crumb" href="#">Page</a>
<span class="breadcrumbs_separator"></span>
<a class="breadcrumbs_crumb current" href="#">Current Page</a>
</div>
*
*/
/*---------------------------------------------------------------------------*\
VARIABLES
\*---------------------------------------------------------------------------*/
/**
* Base settings applied to the wrapper.
*/
$crumbs-font-size: $milli !default;
$crumbs-wrapper-padding: .25em !default;
/**
* Margin between each breadcrumb_item (crumbs and separators)
*/
$crumbs-item-spacing: .5em !default;
/**
* Padding on each crumb
*/
$crumbs-crumb-padding: .25em .5em !default;
/**
* Separator settings.
*/
$crumbs-separator: ">>" !default;
$crumbs-separator-size: $micro !default;
$crumbs-separator-padding: 0 !default;
/*---------------------------------------------------------------------------*\
MODULE
\*---------------------------------------------------------------------------*/
/**
* Base wrapper.
*/
.breadcrumbs {
display: block;
padding: $crumbs-wrapper-padding;
font-size: $crumbs-font-size;
}
/**
* Generic item styles shared by the sub classed elements below.
*/
%breadcrumbs_item {
display: inline-block;
margin-right: $crumbs-item-spacing;
vertical-align: middle;
}
/**
* The "crumb" or "page".
*
* inherits breadcrumbs_item
*/
.breadcrumbs_crumb {
@extend %breadcrumbs_item;
padding: $crumbs-crumb-padding;
}
/**
* The crumb separator.
*
* inherits breadcrumbs_item
*/
.breadcrumbs_separator {
@extend %breadcrumbs_item;
padding: $crumbs-separator-padding;
font-size: $crumbs-separator-size;
&:after {
content: $crumbs-separator;
}
}
| /*---------------------------------------------------------------------------*\
PAGINATION
\*---------------------------------------------------------------------------*/
/**
* Pagination.
*
* Usage:
*
*/
/*---------------------------------------------------------------------------*\
VARIABLES
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
MODULE
\*---------------------------------------------------------------------------*/
| Create placeholder file for the pagination module | Create placeholder file for the pagination module
| SCSS | mit | aptuitiv/cacao | scss | ## Code Before:
/*---------------------------------------------------------------------------*\
BREADCRUMBS
\*---------------------------------------------------------------------------*/
/**
* A breadcrumb trail that can be configured with separators.
*
* Usage:
<div class="breadcrumbs">
<a class="breadcrumbs_crumb" href="#">Home</a>
<span class="breadcrumbs_separator"></span>
<span class="breadcrumbs_crumb disabled">Disabled</span>
<span class="breadcrumbs_separator"></span>
<a class="breadcrumbs_crumb" href="#">Page</a>
<span class="breadcrumbs_separator"></span>
<a class="breadcrumbs_crumb current" href="#">Current Page</a>
</div>
*
*/
/*---------------------------------------------------------------------------*\
VARIABLES
\*---------------------------------------------------------------------------*/
/**
* Base settings applied to the wrapper.
*/
$crumbs-font-size: $milli !default;
$crumbs-wrapper-padding: .25em !default;
/**
* Margin between each breadcrumb_item (crumbs and separators)
*/
$crumbs-item-spacing: .5em !default;
/**
* Padding on each crumb
*/
$crumbs-crumb-padding: .25em .5em !default;
/**
* Separator settings.
*/
$crumbs-separator: ">>" !default;
$crumbs-separator-size: $micro !default;
$crumbs-separator-padding: 0 !default;
/*---------------------------------------------------------------------------*\
MODULE
\*---------------------------------------------------------------------------*/
/**
* Base wrapper.
*/
.breadcrumbs {
display: block;
padding: $crumbs-wrapper-padding;
font-size: $crumbs-font-size;
}
/**
* Generic item styles shared by the sub classed elements below.
*/
%breadcrumbs_item {
display: inline-block;
margin-right: $crumbs-item-spacing;
vertical-align: middle;
}
/**
* The "crumb" or "page".
*
* inherits breadcrumbs_item
*/
.breadcrumbs_crumb {
@extend %breadcrumbs_item;
padding: $crumbs-crumb-padding;
}
/**
* The crumb separator.
*
* inherits breadcrumbs_item
*/
.breadcrumbs_separator {
@extend %breadcrumbs_item;
padding: $crumbs-separator-padding;
font-size: $crumbs-separator-size;
&:after {
content: $crumbs-separator;
}
}
## Instruction:
Create placeholder file for the pagination module
## Code After:
/*---------------------------------------------------------------------------*\
PAGINATION
\*---------------------------------------------------------------------------*/
/**
* Pagination.
*
* Usage:
*
*/
/*---------------------------------------------------------------------------*\
VARIABLES
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
MODULE
\*---------------------------------------------------------------------------*/
| /*---------------------------------------------------------------------------*\
- BREADCRUMBS
+ PAGINATION
\*---------------------------------------------------------------------------*/
/**
- * A breadcrumb trail that can be configured with separators.
+ * Pagination.
*
* Usage:
-
- <div class="breadcrumbs">
- <a class="breadcrumbs_crumb" href="#">Home</a>
- <span class="breadcrumbs_separator"></span>
- <span class="breadcrumbs_crumb disabled">Disabled</span>
- <span class="breadcrumbs_separator"></span>
- <a class="breadcrumbs_crumb" href="#">Page</a>
- <span class="breadcrumbs_separator"></span>
- <a class="breadcrumbs_crumb current" href="#">Current Page</a>
- </div>
*
*/
/*---------------------------------------------------------------------------*\
VARIABLES
\*---------------------------------------------------------------------------*/
- /**
- * Base settings applied to the wrapper.
- */
- $crumbs-font-size: $milli !default;
- $crumbs-wrapper-padding: .25em !default;
-
- /**
- * Margin between each breadcrumb_item (crumbs and separators)
- */
- $crumbs-item-spacing: .5em !default;
-
- /**
- * Padding on each crumb
- */
- $crumbs-crumb-padding: .25em .5em !default;
-
- /**
- * Separator settings.
- */
- $crumbs-separator: ">>" !default;
- $crumbs-separator-size: $micro !default;
- $crumbs-separator-padding: 0 !default;
-
/*---------------------------------------------------------------------------*\
MODULE
\*---------------------------------------------------------------------------*/
- /**
- * Base wrapper.
- */
- .breadcrumbs {
- display: block;
- padding: $crumbs-wrapper-padding;
- font-size: $crumbs-font-size;
- }
-
- /**
- * Generic item styles shared by the sub classed elements below.
- */
- %breadcrumbs_item {
- display: inline-block;
- margin-right: $crumbs-item-spacing;
- vertical-align: middle;
- }
-
-
-
- /**
- * The "crumb" or "page".
- *
- * inherits breadcrumbs_item
- */
- .breadcrumbs_crumb {
- @extend %breadcrumbs_item;
- padding: $crumbs-crumb-padding;
- }
-
-
-
- /**
- * The crumb separator.
- *
- * inherits breadcrumbs_item
- */
- .breadcrumbs_separator {
- @extend %breadcrumbs_item;
- padding: $crumbs-separator-padding;
- font-size: $crumbs-separator-size;
- &:after {
- content: $crumbs-separator;
- }
- }
-
-
- | 85 | 0.772727 | 2 | 83 |
abb0c4643d56a16ef60b0f29b08407ac6378e043 | src/main/java/net/exkazuu/FileManager.xtend | src/main/java/net/exkazuu/FileManager.xtend | package net.exkazuu
import java.io.File
import java.util.List
import java.util.ArrayList
import java.io.FileReader
import java.io.LineNumberReader
class FileManager {
String root
new(String root) {
this.root = root
}
def getDirList() {
return new File(root).listFiles
}
def List<String> getSourceCodeAbsolutePath(String path, String name) {
val result = new ArrayList<String>
val file = new File(path)
if (file.isFile) {
val fileName = file.getName
if (fileName.contains(".java")) {
val length = fileName.length
if (fileName.substring(length - 5, length).equals(".java")) {
result += file.getAbsolutePath
}
}
} else {
val files = file.listFiles
for (f : files) {
result += getSourceCodeAbsolutePath(f.getAbsolutePath, name)
}
}
return result
}
def int getSourceCodeLOC(String absolutePath) {
val reader = new LineNumberReader(new FileReader(absolutePath))
while (null != reader.readLine) {
}
val result = reader.getLineNumber
reader.close
return result
}
}
| package net.exkazuu
import java.io.File
import java.util.List
import java.util.ArrayList
import java.io.FileReader
import java.io.LineNumberReader
class FileManager {
String root
new(String root) {
this.root = root
}
def getDirList() {
return new File(root).listFiles
}
def List<String> getSourceCodeAbsolutePath(String path, String name) {
val result = new ArrayList<String>
val file = new File(path)
if (file.isFile) {
if (file.getName.endsWith(".java")) {
result += file.getAbsolutePath
}
} else {
val files = file.listFiles
for (f : files) {
result += getSourceCodeAbsolutePath(f.getAbsolutePath, name)
}
}
return result
}
def int getSourceCodeLOC(String absolutePath) {
val reader = new LineNumberReader(new FileReader(absolutePath))
while (null != reader.readLine) {
}
val result = reader.getLineNumber
reader.close
return result
}
}
| Modify code by the comment. | Modify code by the comment.
| Xtend | apache-2.0 | exKAZUu/RepositoryProbe | xtend | ## Code Before:
package net.exkazuu
import java.io.File
import java.util.List
import java.util.ArrayList
import java.io.FileReader
import java.io.LineNumberReader
class FileManager {
String root
new(String root) {
this.root = root
}
def getDirList() {
return new File(root).listFiles
}
def List<String> getSourceCodeAbsolutePath(String path, String name) {
val result = new ArrayList<String>
val file = new File(path)
if (file.isFile) {
val fileName = file.getName
if (fileName.contains(".java")) {
val length = fileName.length
if (fileName.substring(length - 5, length).equals(".java")) {
result += file.getAbsolutePath
}
}
} else {
val files = file.listFiles
for (f : files) {
result += getSourceCodeAbsolutePath(f.getAbsolutePath, name)
}
}
return result
}
def int getSourceCodeLOC(String absolutePath) {
val reader = new LineNumberReader(new FileReader(absolutePath))
while (null != reader.readLine) {
}
val result = reader.getLineNumber
reader.close
return result
}
}
## Instruction:
Modify code by the comment.
## Code After:
package net.exkazuu
import java.io.File
import java.util.List
import java.util.ArrayList
import java.io.FileReader
import java.io.LineNumberReader
class FileManager {
String root
new(String root) {
this.root = root
}
def getDirList() {
return new File(root).listFiles
}
def List<String> getSourceCodeAbsolutePath(String path, String name) {
val result = new ArrayList<String>
val file = new File(path)
if (file.isFile) {
if (file.getName.endsWith(".java")) {
result += file.getAbsolutePath
}
} else {
val files = file.listFiles
for (f : files) {
result += getSourceCodeAbsolutePath(f.getAbsolutePath, name)
}
}
return result
}
def int getSourceCodeLOC(String absolutePath) {
val reader = new LineNumberReader(new FileReader(absolutePath))
while (null != reader.readLine) {
}
val result = reader.getLineNumber
reader.close
return result
}
}
| package net.exkazuu
import java.io.File
import java.util.List
import java.util.ArrayList
import java.io.FileReader
import java.io.LineNumberReader
class FileManager {
String root
new(String root) {
this.root = root
}
def getDirList() {
return new File(root).listFiles
}
def List<String> getSourceCodeAbsolutePath(String path, String name) {
val result = new ArrayList<String>
val file = new File(path)
if (file.isFile) {
- val fileName = file.getName
- if (fileName.contains(".java")) {
? ^^ ^^^^
+ if (file.getName.endsWith(".java")) {
? ++++ ^ ++++ ^
- val length = fileName.length
- if (fileName.substring(length - 5, length).equals(".java")) {
- result += file.getAbsolutePath
? -
+ result += file.getAbsolutePath
- }
}
} else {
val files = file.listFiles
for (f : files) {
result += getSourceCodeAbsolutePath(f.getAbsolutePath, name)
}
}
return result
}
def int getSourceCodeLOC(String absolutePath) {
val reader = new LineNumberReader(new FileReader(absolutePath))
while (null != reader.readLine) {
}
val result = reader.getLineNumber
reader.close
return result
}
} | 8 | 0.150943 | 2 | 6 |
c9e5c8a42ceb67787d060b8bc1e0235214c70891 | src/bin/typings-list.ts | src/bin/typings-list.ts |
import minimist = require('minimist')
import extend = require('xtend')
import { loader, archifyDependencyTree } from '../utils/cli'
import { PROJECT_NAME } from '../utils/config'
import { resolveTypeDependencies } from '../lib/dependencies'
interface Args {
verbose: boolean
help: boolean
ambient: boolean
}
const args = minimist<Args>(process.argv.slice(2), {
boolean: ['verbose', 'help', 'ambient'],
alias: {
verbose: ['v'],
ambient: ['a'],
help: ['h']
}
})
if (args.help) {
console.log(`
${PROJECT_NAME} ls [--ambient]
Aliases: la, ll, list
`)
process.exit(0)
}
const cwd = process.cwd()
const options = extend(args, { cwd })
loader(resolveTypeDependencies({ cwd, ambient: true, dev: true }), options)
.then(function (tree) {
console.log(archifyDependencyTree(tree, options))
})
|
import minimist = require('minimist')
import extend = require('xtend')
import { loader, archifyDependencyTree } from '../utils/cli'
import { PROJECT_NAME } from '../utils/config'
import { resolveTypeDependencies } from '../lib/dependencies'
interface Args {
verbose: boolean
help: boolean
ambient: boolean
production: boolean
}
const args = minimist<Args>(process.argv.slice(2), {
boolean: ['verbose', 'help', 'ambient', 'production'],
alias: {
verbose: ['v'],
ambient: ['a'],
help: ['h']
}
})
if (args.help) {
console.log(`
${PROJECT_NAME} ls [--ambient] [--production]
Aliases: la, ll, list
`)
process.exit(0)
}
const cwd = process.cwd()
const options = extend(args, { cwd })
loader(resolveTypeDependencies({ cwd, ambient: true, dev: !args.production }), options)
.then(function (tree) {
console.log(archifyDependencyTree(tree, options))
})
| Add `production` flag to `ls` | Add `production` flag to `ls` | TypeScript | mit | typings/typings,typings/typings | typescript | ## Code Before:
import minimist = require('minimist')
import extend = require('xtend')
import { loader, archifyDependencyTree } from '../utils/cli'
import { PROJECT_NAME } from '../utils/config'
import { resolveTypeDependencies } from '../lib/dependencies'
interface Args {
verbose: boolean
help: boolean
ambient: boolean
}
const args = minimist<Args>(process.argv.slice(2), {
boolean: ['verbose', 'help', 'ambient'],
alias: {
verbose: ['v'],
ambient: ['a'],
help: ['h']
}
})
if (args.help) {
console.log(`
${PROJECT_NAME} ls [--ambient]
Aliases: la, ll, list
`)
process.exit(0)
}
const cwd = process.cwd()
const options = extend(args, { cwd })
loader(resolveTypeDependencies({ cwd, ambient: true, dev: true }), options)
.then(function (tree) {
console.log(archifyDependencyTree(tree, options))
})
## Instruction:
Add `production` flag to `ls`
## Code After:
import minimist = require('minimist')
import extend = require('xtend')
import { loader, archifyDependencyTree } from '../utils/cli'
import { PROJECT_NAME } from '../utils/config'
import { resolveTypeDependencies } from '../lib/dependencies'
interface Args {
verbose: boolean
help: boolean
ambient: boolean
production: boolean
}
const args = minimist<Args>(process.argv.slice(2), {
boolean: ['verbose', 'help', 'ambient', 'production'],
alias: {
verbose: ['v'],
ambient: ['a'],
help: ['h']
}
})
if (args.help) {
console.log(`
${PROJECT_NAME} ls [--ambient] [--production]
Aliases: la, ll, list
`)
process.exit(0)
}
const cwd = process.cwd()
const options = extend(args, { cwd })
loader(resolveTypeDependencies({ cwd, ambient: true, dev: !args.production }), options)
.then(function (tree) {
console.log(archifyDependencyTree(tree, options))
})
|
import minimist = require('minimist')
import extend = require('xtend')
import { loader, archifyDependencyTree } from '../utils/cli'
import { PROJECT_NAME } from '../utils/config'
import { resolveTypeDependencies } from '../lib/dependencies'
interface Args {
verbose: boolean
help: boolean
ambient: boolean
+ production: boolean
}
const args = minimist<Args>(process.argv.slice(2), {
- boolean: ['verbose', 'help', 'ambient'],
+ boolean: ['verbose', 'help', 'ambient', 'production'],
? ++++++++++++++
alias: {
verbose: ['v'],
ambient: ['a'],
help: ['h']
}
})
if (args.help) {
console.log(`
- ${PROJECT_NAME} ls [--ambient]
+ ${PROJECT_NAME} ls [--ambient] [--production]
? +++++++++++++++
Aliases: la, ll, list
`)
process.exit(0)
}
const cwd = process.cwd()
const options = extend(args, { cwd })
- loader(resolveTypeDependencies({ cwd, ambient: true, dev: true }), options)
? ^^^
+ loader(resolveTypeDependencies({ cwd, ambient: true, dev: !args.production }), options)
? ++++++++++++ ^^^
.then(function (tree) {
console.log(archifyDependencyTree(tree, options))
}) | 7 | 0.179487 | 4 | 3 |
c840616609e27b2ecbe98c1e3a5b4175e98a4cbf | docs/_posts/2017-01-31-bash-unix-env.md | docs/_posts/2017-01-31-bash-unix-env.md | ---
layout: post
title: Navigating bash and UNIX environments -- Akos, Mitch, and Matthias
comments: true
category: upcoming
tags: meeting <+ tags +>
---
| ---
layout: post
title: Navigating bash and UNIX environments -- Akos, Mitch, and Matthias
comments: true
category: upcoming
tags: meeting <+ tags +>
---
# Possible topics
- UNIX in general (intro, some history, roles of UNIX in society)
- Shells and command-line interactions
- Shell scripting (intro)
# Learning resources
For those desiring something more structured, thoughtful, and professional...
- Software Carpentry [Unix Shell Lessons](http://swcarpentry.github.io/shell-novice/)
- [Advanced Bash-Scripting Guide](http://www.thehackerwithin.org/berkeley/upcoming.html) from The Linux Documentation Project
- O'Reilly books on Unix & shell topics. | Add brief description and links to UNIX/BASH post | Add brief description and links to UNIX/BASH post
| Markdown | bsd-3-clause | thehackerwithin/berkeley,thehackerwithin/berkeley,thehackerwithin/berkeley,thehackerwithin/berkeley,thehackerwithin/berkeley,thehackerwithin/berkeley | markdown | ## Code Before:
---
layout: post
title: Navigating bash and UNIX environments -- Akos, Mitch, and Matthias
comments: true
category: upcoming
tags: meeting <+ tags +>
---
## Instruction:
Add brief description and links to UNIX/BASH post
## Code After:
---
layout: post
title: Navigating bash and UNIX environments -- Akos, Mitch, and Matthias
comments: true
category: upcoming
tags: meeting <+ tags +>
---
# Possible topics
- UNIX in general (intro, some history, roles of UNIX in society)
- Shells and command-line interactions
- Shell scripting (intro)
# Learning resources
For those desiring something more structured, thoughtful, and professional...
- Software Carpentry [Unix Shell Lessons](http://swcarpentry.github.io/shell-novice/)
- [Advanced Bash-Scripting Guide](http://www.thehackerwithin.org/berkeley/upcoming.html) from The Linux Documentation Project
- O'Reilly books on Unix & shell topics. | ---
layout: post
title: Navigating bash and UNIX environments -- Akos, Mitch, and Matthias
comments: true
category: upcoming
tags: meeting <+ tags +>
---
+ # Possible topics
+ - UNIX in general (intro, some history, roles of UNIX in society)
+ - Shells and command-line interactions
+ - Shell scripting (intro)
+
+
+ # Learning resources
+
+ For those desiring something more structured, thoughtful, and professional...
+
+ - Software Carpentry [Unix Shell Lessons](http://swcarpentry.github.io/shell-novice/)
+ - [Advanced Bash-Scripting Guide](http://www.thehackerwithin.org/berkeley/upcoming.html) from The Linux Documentation Project
+ - O'Reilly books on Unix & shell topics. | 13 | 1.444444 | 13 | 0 |
7ee566be0abd41a551265712064335b5cec05439 | ui.apps/src/main/README.md | ui.apps/src/main/README.md |
Copy the two Webpack folders into your project:
- `webpack.core` contains basic configurations for npm, Webpack, Babel and Jest. Our goal for further development of this project is to allow you to update this folder without having to manually configure it again. For that reason, since version 2.0.0, we have a second folder...
- `webpack.project` is meant to contain your project-specific configuration. It allows you to override and extend certain parts of `webpack.core`. Check out [the folder's index.js](./webpack.project/index.js) for more details.
# .babelrc
Copy `.babelrc` which is needed for Babel to work.
# .gitignore
A .gitignore file should be added to the project so the files generated by Webpack are not version-controlled. Nobody should ever modify them directly, so you don't have to track them in Git.
```
**/webpack.bundles/*.bundle.*
```
|
Copy the two Webpack folders into your project:
- `webpack.core` contains basic configurations for npm, Webpack, Babel and Jest. Our goal for further development of this project is to allow you to update this folder without having to manually configure it again. For that reason, since version 2.0.0, we have a second folder...
- `webpack.project` is meant to contain your project-specific configuration. It allows you to override and extend certain parts of `webpack.core`. Check out [the folder's index.js](./webpack.project/index.js) for more details.
# .gitignore
A .gitignore file should be added to the project so the files generated by Webpack are not version-controlled. Nobody should ever modify them directly, so you don't have to track them in Git.
```
**/webpack.bundles/*.bundle.*
```
| Remove no longer necessary ".babelrc" instructions | Remove no longer necessary ".babelrc" instructions
| Markdown | mit | infielddigital/aem-webpack-example,infielddigital/aem-webpack-example | markdown | ## Code Before:
Copy the two Webpack folders into your project:
- `webpack.core` contains basic configurations for npm, Webpack, Babel and Jest. Our goal for further development of this project is to allow you to update this folder without having to manually configure it again. For that reason, since version 2.0.0, we have a second folder...
- `webpack.project` is meant to contain your project-specific configuration. It allows you to override and extend certain parts of `webpack.core`. Check out [the folder's index.js](./webpack.project/index.js) for more details.
# .babelrc
Copy `.babelrc` which is needed for Babel to work.
# .gitignore
A .gitignore file should be added to the project so the files generated by Webpack are not version-controlled. Nobody should ever modify them directly, so you don't have to track them in Git.
```
**/webpack.bundles/*.bundle.*
```
## Instruction:
Remove no longer necessary ".babelrc" instructions
## Code After:
Copy the two Webpack folders into your project:
- `webpack.core` contains basic configurations for npm, Webpack, Babel and Jest. Our goal for further development of this project is to allow you to update this folder without having to manually configure it again. For that reason, since version 2.0.0, we have a second folder...
- `webpack.project` is meant to contain your project-specific configuration. It allows you to override and extend certain parts of `webpack.core`. Check out [the folder's index.js](./webpack.project/index.js) for more details.
# .gitignore
A .gitignore file should be added to the project so the files generated by Webpack are not version-controlled. Nobody should ever modify them directly, so you don't have to track them in Git.
```
**/webpack.bundles/*.bundle.*
```
|
Copy the two Webpack folders into your project:
- `webpack.core` contains basic configurations for npm, Webpack, Babel and Jest. Our goal for further development of this project is to allow you to update this folder without having to manually configure it again. For that reason, since version 2.0.0, we have a second folder...
- `webpack.project` is meant to contain your project-specific configuration. It allows you to override and extend certain parts of `webpack.core`. Check out [the folder's index.js](./webpack.project/index.js) for more details.
-
- # .babelrc
-
- Copy `.babelrc` which is needed for Babel to work.
# .gitignore
A .gitignore file should be added to the project so the files generated by Webpack are not version-controlled. Nobody should ever modify them directly, so you don't have to track them in Git.
```
**/webpack.bundles/*.bundle.*
``` | 4 | 0.235294 | 0 | 4 |
2b465d4ed422ee2fd0d7e7bc6c1e3a49a68a1bd2 | README.md | README.md |
[](https://travis-ci.org/tatsuyafw/amc)
CLI tool to open AWS Management Console with your browser.
## Usage
```sh
$ amc ec2
=> open EC2 management console.
```
|
[](https://travis-ci.org/tatsuyafw/amc)
CLI tool to open AWS Management Console with your browser.
## Usage
```sh
$ amc ec2
=> open EC2 management console.
```
| Fix the travis batch branch on master | Fix the travis batch branch on master
| Markdown | mit | tatsuyafw/amc | markdown | ## Code Before:
[](https://travis-ci.org/tatsuyafw/amc)
CLI tool to open AWS Management Console with your browser.
## Usage
```sh
$ amc ec2
=> open EC2 management console.
```
## Instruction:
Fix the travis batch branch on master
## Code After:
[](https://travis-ci.org/tatsuyafw/amc)
CLI tool to open AWS Management Console with your browser.
## Usage
```sh
$ amc ec2
=> open EC2 management console.
```
|
- [](https://travis-ci.org/tatsuyafw/amc)
+ [](https://travis-ci.org/tatsuyafw/amc)
? ++++++++++++++
CLI tool to open AWS Management Console with your browser.
## Usage
```sh
$ amc ec2
=> open EC2 management console.
``` | 2 | 0.181818 | 1 | 1 |
2ef30a8bd847c9473606b12b77f56059ae6433be | src/assets/scss/components/_overlay.scss | src/assets/scss/components/_overlay.scss | .overlay {
display: none;
background: rgba(255,255,255,0.85);
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
}
.overlay:target {
display: block;
}
.overlay__dialog {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: translate(0, -500%);
transition: transform 3s ease-out;
background: white;
border: 1px solid #efefef;
padding: 1em;
overflow: scroll;
padding: 30px 20px;
}
.overlay:target .overlay__dialog {
display: block;
transform: translate(0, 0);
}
.overlay__close {
position: fixed;
top: 10px;
right: 20px;
color: #aaaaaa;
width: 40px;
text-align: right;
font-family: sans-serif;
font-size: 30px;
font-weight: 100;
background: none;
}
| .overlay {
display: none;
background: rgba(255,255,255,0.85);
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
}
.overlay:target {
display: block;
}
.overlay__dialog {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: translate(0, -500%);
transition: transform 3s ease-out;
background: white;
border: 1px solid #efefef;
padding: 1em;
overflow: scroll;
-webkit-overflow-scrolling: touch;
padding: 30px 20px;
}
.overlay:target .overlay__dialog {
display: block;
transform: translate(0, 0);
}
.overlay__close {
position: fixed;
top: 10px;
right: 20px;
color: #aaaaaa;
width: 40px;
text-align: right;
font-family: sans-serif;
font-size: 30px;
font-weight: 100;
background: none;
}
| Add momentum scrolling to ios | Add momentum scrolling to ios
| SCSS | mit | lewisnyman/lewisnyman.co.uk-source,lewisnyman/lewisnyman.co.uk-source,lewisnyman/lewisnyman.co.uk-source | scss | ## Code Before:
.overlay {
display: none;
background: rgba(255,255,255,0.85);
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
}
.overlay:target {
display: block;
}
.overlay__dialog {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: translate(0, -500%);
transition: transform 3s ease-out;
background: white;
border: 1px solid #efefef;
padding: 1em;
overflow: scroll;
padding: 30px 20px;
}
.overlay:target .overlay__dialog {
display: block;
transform: translate(0, 0);
}
.overlay__close {
position: fixed;
top: 10px;
right: 20px;
color: #aaaaaa;
width: 40px;
text-align: right;
font-family: sans-serif;
font-size: 30px;
font-weight: 100;
background: none;
}
## Instruction:
Add momentum scrolling to ios
## Code After:
.overlay {
display: none;
background: rgba(255,255,255,0.85);
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
}
.overlay:target {
display: block;
}
.overlay__dialog {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: translate(0, -500%);
transition: transform 3s ease-out;
background: white;
border: 1px solid #efefef;
padding: 1em;
overflow: scroll;
-webkit-overflow-scrolling: touch;
padding: 30px 20px;
}
.overlay:target .overlay__dialog {
display: block;
transform: translate(0, 0);
}
.overlay__close {
position: fixed;
top: 10px;
right: 20px;
color: #aaaaaa;
width: 40px;
text-align: right;
font-family: sans-serif;
font-size: 30px;
font-weight: 100;
background: none;
}
| .overlay {
display: none;
background: rgba(255,255,255,0.85);
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
}
.overlay:target {
display: block;
}
.overlay__dialog {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: translate(0, -500%);
transition: transform 3s ease-out;
background: white;
border: 1px solid #efefef;
padding: 1em;
overflow: scroll;
+ -webkit-overflow-scrolling: touch;
padding: 30px 20px;
}
.overlay:target .overlay__dialog {
display: block;
transform: translate(0, 0);
}
.overlay__close {
position: fixed;
top: 10px;
right: 20px;
color: #aaaaaa;
width: 40px;
text-align: right;
font-family: sans-serif;
font-size: 30px;
font-weight: 100;
background: none;
} | 1 | 0.022222 | 1 | 0 |
7756a578608dd2cf13191491674b8e198cee0fed | .travis.yml | .travis.yml | language: cpp
compiler:
- gcc
script:
- mkdir build
- cd build
- cmake ..
- cmake --build . --target all --
- cmake --build . --target package --
after_script:
- ctest
- cmake --build . --target Continous
| language: cpp
compiler:
- gcc
before_script:
- sudo apt-get update -qq
- sudo apt-get install libboost-dev
script:
- mkdir build
- cd build
- cmake ..
- cmake --build . --target all --
- cmake --build . --target package --
after_script:
- ctest
- cmake --build . --target Continous
| Install boost dev packages on Travis container before building. | Install boost dev packages on Travis container before building.
Signed-off-by: Peter Hille (png!das-system) <4b8373d016f277527198385ba72fda0feb5da015@das-system-networks.de>
| YAML | bsd-3-clause | png85/dsnutil_cpp | yaml | ## Code Before:
language: cpp
compiler:
- gcc
script:
- mkdir build
- cd build
- cmake ..
- cmake --build . --target all --
- cmake --build . --target package --
after_script:
- ctest
- cmake --build . --target Continous
## Instruction:
Install boost dev packages on Travis container before building.
Signed-off-by: Peter Hille (png!das-system) <4b8373d016f277527198385ba72fda0feb5da015@das-system-networks.de>
## Code After:
language: cpp
compiler:
- gcc
before_script:
- sudo apt-get update -qq
- sudo apt-get install libboost-dev
script:
- mkdir build
- cd build
- cmake ..
- cmake --build . --target all --
- cmake --build . --target package --
after_script:
- ctest
- cmake --build . --target Continous
| language: cpp
compiler:
- gcc
+
+ before_script:
+ - sudo apt-get update -qq
+ - sudo apt-get install libboost-dev
script:
- mkdir build
- cd build
- cmake ..
- cmake --build . --target all --
- cmake --build . --target package --
after_script:
- ctest
- cmake --build . --target Continous | 4 | 0.285714 | 4 | 0 |
070c9bb6105e5ed71b9f9b0822312bc2f2dfbcb5 | bgp/flowspec/src/main/resources/org/opendaylight/blueprint/bgp-flowspec.xml | bgp/flowspec/src/main/resources/org/opendaylight/blueprint/bgp-flowspec.xml | <?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
<bean id="flowSpecExtensionContext" class="org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext"/>
<bean id="flowSpecActivator" class="org.opendaylight.protocol.bgp.flowspec.FlowspecActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<bean id="BGPActivator" class="org.opendaylight.protocol.bgp.flowspec.BGPActivator">
<argument ref="flowSpecExtensionContext"/>
<argument ref="flowSpecActivator"/>
</bean>
<bean id="RIBActivator" class="org.opendaylight.protocol.bgp.flowspec.RIBActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<service ref="BGPActivator" interface="org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.BGPActivator"/>
<service ref="RIBActivator" interface="org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.RIBActivator"/>
</blueprint> | <?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
<bean id="flowSpecExtensionContext" class="org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext"/>
<bean id="flowSpecActivator" class="org.opendaylight.protocol.bgp.flowspec.FlowspecActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<bean id="BGPActivator" class="org.opendaylight.protocol.bgp.flowspec.BGPActivator">
<argument ref="flowSpecActivator"/>
</bean>
<bean id="RIBActivator" class="org.opendaylight.protocol.bgp.flowspec.RIBActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<service ref="BGPActivator" interface="org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.BGPActivator"/>
<service ref="RIBActivator" interface="org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.RIBActivator"/>
</blueprint> | Fix BGP-FS's BGPActivator bean arguments | Fix BGP-FS's BGPActivator bean arguments
Flowspec's BGPActivator constructor signature
has changed recently, reflect the change in
the blueprint container.
Change-Id: I2a3e477b2ec36b4f51dfbf4f53905ab58540f7a5
Signed-off-by: Milos Fabian <30e73a9e3eec1d469ad8bf9af4dd80a6e9c3a404@cisco.com>
| XML | epl-1.0 | opendaylight/bgpcep | xml | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
<bean id="flowSpecExtensionContext" class="org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext"/>
<bean id="flowSpecActivator" class="org.opendaylight.protocol.bgp.flowspec.FlowspecActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<bean id="BGPActivator" class="org.opendaylight.protocol.bgp.flowspec.BGPActivator">
<argument ref="flowSpecExtensionContext"/>
<argument ref="flowSpecActivator"/>
</bean>
<bean id="RIBActivator" class="org.opendaylight.protocol.bgp.flowspec.RIBActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<service ref="BGPActivator" interface="org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.BGPActivator"/>
<service ref="RIBActivator" interface="org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.RIBActivator"/>
</blueprint>
## Instruction:
Fix BGP-FS's BGPActivator bean arguments
Flowspec's BGPActivator constructor signature
has changed recently, reflect the change in
the blueprint container.
Change-Id: I2a3e477b2ec36b4f51dfbf4f53905ab58540f7a5
Signed-off-by: Milos Fabian <30e73a9e3eec1d469ad8bf9af4dd80a6e9c3a404@cisco.com>
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
<bean id="flowSpecExtensionContext" class="org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext"/>
<bean id="flowSpecActivator" class="org.opendaylight.protocol.bgp.flowspec.FlowspecActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<bean id="BGPActivator" class="org.opendaylight.protocol.bgp.flowspec.BGPActivator">
<argument ref="flowSpecActivator"/>
</bean>
<bean id="RIBActivator" class="org.opendaylight.protocol.bgp.flowspec.RIBActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<service ref="BGPActivator" interface="org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.BGPActivator"/>
<service ref="RIBActivator" interface="org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.RIBActivator"/>
</blueprint> | <?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
<bean id="flowSpecExtensionContext" class="org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext"/>
<bean id="flowSpecActivator" class="org.opendaylight.protocol.bgp.flowspec.FlowspecActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<bean id="BGPActivator" class="org.opendaylight.protocol.bgp.flowspec.BGPActivator">
- <argument ref="flowSpecExtensionContext"/>
<argument ref="flowSpecActivator"/>
</bean>
<bean id="RIBActivator" class="org.opendaylight.protocol.bgp.flowspec.RIBActivator">
<argument ref="flowSpecExtensionContext"/>
</bean>
<service ref="BGPActivator" interface="org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.BGPActivator"/>
<service ref="RIBActivator" interface="org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.flowspec.RIBActivator"/>
</blueprint> | 1 | 0.04 | 0 | 1 |
df55617448625673676ef57cb5b2e16098a4d825 | src/sidebar-overlay/components/CongratsMessage.tsx | src/sidebar-overlay/components/CongratsMessage.tsx | import React, { PureComponent } from 'react'
import { browser } from 'webextension-polyfill-ts'
const styles = require('./CongratsMessage.css')
const partyPopperIcon = browser.runtime.getURL('/img/party_popper.svg')
class CongratsMessage extends PureComponent {
moreAboutSidebar = () => {
browser.tabs.create({
url: 'https://worldbrain.io',
})
}
goToDashboard = () => {
browser.tabs.create({
url: browser.runtime.getURL('/options.html#/overview'),
})
}
render() {
return (
<div className={styles.container}>
<div className={styles.firstRow}>
<img
src={partyPopperIcon}
alt="🎉"
className={styles.partyPopper}
/>
<p className={styles.title}>
Congrats on your first annotation
</p>
</div>
<div className={styles.learnMore} onClick={this.goToDashboard}>
Go back to Dashboard
</div>
</div>
)
}
}
export default CongratsMessage
| import React, { PureComponent } from 'react'
import { browser } from 'webextension-polyfill-ts'
import { remoteFunction } from 'src/util/webextensionRPC'
const styles = require('./CongratsMessage.css')
const partyPopperIcon = browser.runtime.getURL('/img/party_popper.svg')
class CongratsMessage extends PureComponent {
openOptionsTab = remoteFunction('openOptionsTab')
moreAboutSidebar = () => {
browser.tabs.create({
url: 'https://worldbrain.io',
})
}
goToDashboard = () => this.openOptionsTab('overview')
render() {
return (
<div className={styles.container}>
<div className={styles.firstRow}>
<img
src={partyPopperIcon}
alt="🎉"
className={styles.partyPopper}
/>
<p className={styles.title}>
Congrats on your first annotation
</p>
</div>
<div className={styles.learnMore} onClick={this.goToDashboard}>
Go back to Dashboard
</div>
</div>
)
}
}
export default CongratsMessage
| Use remote function to open dashboard. | Use remote function to open dashboard.
In the CongratsMessage button. Fixes issue where the button wasn't
working in Firefox. Also, should fix the issue where this didn't work
in content script.
| TypeScript | mit | WorldBrain/WebMemex,WorldBrain/WebMemex | typescript | ## Code Before:
import React, { PureComponent } from 'react'
import { browser } from 'webextension-polyfill-ts'
const styles = require('./CongratsMessage.css')
const partyPopperIcon = browser.runtime.getURL('/img/party_popper.svg')
class CongratsMessage extends PureComponent {
moreAboutSidebar = () => {
browser.tabs.create({
url: 'https://worldbrain.io',
})
}
goToDashboard = () => {
browser.tabs.create({
url: browser.runtime.getURL('/options.html#/overview'),
})
}
render() {
return (
<div className={styles.container}>
<div className={styles.firstRow}>
<img
src={partyPopperIcon}
alt="🎉"
className={styles.partyPopper}
/>
<p className={styles.title}>
Congrats on your first annotation
</p>
</div>
<div className={styles.learnMore} onClick={this.goToDashboard}>
Go back to Dashboard
</div>
</div>
)
}
}
export default CongratsMessage
## Instruction:
Use remote function to open dashboard.
In the CongratsMessage button. Fixes issue where the button wasn't
working in Firefox. Also, should fix the issue where this didn't work
in content script.
## Code After:
import React, { PureComponent } from 'react'
import { browser } from 'webextension-polyfill-ts'
import { remoteFunction } from 'src/util/webextensionRPC'
const styles = require('./CongratsMessage.css')
const partyPopperIcon = browser.runtime.getURL('/img/party_popper.svg')
class CongratsMessage extends PureComponent {
openOptionsTab = remoteFunction('openOptionsTab')
moreAboutSidebar = () => {
browser.tabs.create({
url: 'https://worldbrain.io',
})
}
goToDashboard = () => this.openOptionsTab('overview')
render() {
return (
<div className={styles.container}>
<div className={styles.firstRow}>
<img
src={partyPopperIcon}
alt="🎉"
className={styles.partyPopper}
/>
<p className={styles.title}>
Congrats on your first annotation
</p>
</div>
<div className={styles.learnMore} onClick={this.goToDashboard}>
Go back to Dashboard
</div>
</div>
)
}
}
export default CongratsMessage
| import React, { PureComponent } from 'react'
import { browser } from 'webextension-polyfill-ts'
+ import { remoteFunction } from 'src/util/webextensionRPC'
const styles = require('./CongratsMessage.css')
const partyPopperIcon = browser.runtime.getURL('/img/party_popper.svg')
class CongratsMessage extends PureComponent {
+ openOptionsTab = remoteFunction('openOptionsTab')
+
moreAboutSidebar = () => {
browser.tabs.create({
url: 'https://worldbrain.io',
})
}
+ goToDashboard = () => this.openOptionsTab('overview')
- goToDashboard = () => {
- browser.tabs.create({
- url: browser.runtime.getURL('/options.html#/overview'),
- })
- }
render() {
return (
<div className={styles.container}>
<div className={styles.firstRow}>
<img
src={partyPopperIcon}
alt="🎉"
className={styles.partyPopper}
/>
<p className={styles.title}>
Congrats on your first annotation
</p>
</div>
<div className={styles.learnMore} onClick={this.goToDashboard}>
Go back to Dashboard
</div>
</div>
)
}
}
export default CongratsMessage | 9 | 0.214286 | 4 | 5 |
897bb79e9c7bf3ef698d72e99832c0914b37e507 | .travis.yml | .travis.yml | language: node_js
node_js:
- "0.8"
- "0.10"
before_script:
- npm install -g component
script: npm test
notifications:
irc: "irc.freenode.org#fbp"
| language: node_js
node_js:
- "0.8"
- "0.10"
- "0.11"
before_script:
- npm install -g component
script: npm test
notifications:
irc: "irc.freenode.org#fbp"
| Test with Node.js 0.11 as well | Test with Node.js 0.11 as well
| YAML | mit | jonnor/noflo,npmcomponent/noflo-noflo,trustmaster/noflo,lxfschr/noflo,jonnor/noflo,lxfschr/noflo,trustmaster/noflo,noflo/noflo,saurabhsood91/noflo,saurabhsood91/noflo | yaml | ## Code Before:
language: node_js
node_js:
- "0.8"
- "0.10"
before_script:
- npm install -g component
script: npm test
notifications:
irc: "irc.freenode.org#fbp"
## Instruction:
Test with Node.js 0.11 as well
## Code After:
language: node_js
node_js:
- "0.8"
- "0.10"
- "0.11"
before_script:
- npm install -g component
script: npm test
notifications:
irc: "irc.freenode.org#fbp"
| language: node_js
node_js:
- "0.8"
- "0.10"
+ - "0.11"
before_script:
- npm install -g component
script: npm test
notifications:
irc: "irc.freenode.org#fbp" | 1 | 0.083333 | 1 | 0 |
4b765ef82c90fb2a4cb627c2a6860f60d84e29a4 | Casks/lytro-desktop.rb | Casks/lytro-desktop.rb | cask 'lytro-desktop' do
version '4.3.3,151118.98'
sha256 '500b28ed7d67aaf18a59a8770e3fb83a4b96e692728ddbd522a52879af758966'
# amazonaws.com/lytro-desktop-support was verified as official when first introduced to the cask
url "https://s3.amazonaws.com/lytro-distro/lytro-#{version.after_comma}.dmg"
appcast 'https://pictures.lytro.com/support/software_update',
checkpoint: 'c806ff660e791f181371f9946412ee07ebd03459db8791832ed4b0be378d587a'
name 'Lytro Desktop'
homepage 'https://www.lytro.com/'
license :gratis
app 'Lytro Desktop.app'
end
| cask 'lytro-desktop' do
version '4.3.3,151118.98'
sha256 '500b28ed7d67aaf18a59a8770e3fb83a4b96e692728ddbd522a52879af758966'
# amazonaws.com/lytro-distro was verified as official when first introduced to the cask
url "https://s3.amazonaws.com/lytro-distro/lytro-#{version.after_comma}.dmg"
appcast 'https://pictures.lytro.com/support/software_update',
checkpoint: 'c806ff660e791f181371f9946412ee07ebd03459db8791832ed4b0be378d587a'
name 'Lytro Desktop'
homepage 'https://www.lytro.com/'
license :gratis
app 'Lytro Desktop.app'
end
| Fix `url` stanza comment for Lytro Desktop. | Fix `url` stanza comment for Lytro Desktop.
| Ruby | bsd-2-clause | vitorgalvao/homebrew-cask,bosr/homebrew-cask,jalaziz/homebrew-cask,Cottser/homebrew-cask,jconley/homebrew-cask,seanzxx/homebrew-cask,jedahan/homebrew-cask,lifepillar/homebrew-cask,joschi/homebrew-cask,mattrobenolt/homebrew-cask,sscotth/homebrew-cask,sscotth/homebrew-cask,josa42/homebrew-cask,cprecioso/homebrew-cask,rogeriopradoj/homebrew-cask,dcondrey/homebrew-cask,kamilboratynski/homebrew-cask,hristozov/homebrew-cask,kTitan/homebrew-cask,JosephViolago/homebrew-cask,mazehall/homebrew-cask,ericbn/homebrew-cask,vin047/homebrew-cask,muan/homebrew-cask,jalaziz/homebrew-cask,shonjir/homebrew-cask,alexg0/homebrew-cask,dvdoliveira/homebrew-cask,deiga/homebrew-cask,tyage/homebrew-cask,vin047/homebrew-cask,dcondrey/homebrew-cask,haha1903/homebrew-cask,jiashuw/homebrew-cask,mazehall/homebrew-cask,jangalinski/homebrew-cask,squid314/homebrew-cask,reelsense/homebrew-cask,mauricerkelly/homebrew-cask,imgarylai/homebrew-cask,KosherBacon/homebrew-cask,Ephemera/homebrew-cask,ericbn/homebrew-cask,ninjahoahong/homebrew-cask,jbeagley52/homebrew-cask,kassi/homebrew-cask,thii/homebrew-cask,xyb/homebrew-cask,psibre/homebrew-cask,shoichiaizawa/homebrew-cask,sjackman/homebrew-cask,andrewdisley/homebrew-cask,a1russell/homebrew-cask,uetchy/homebrew-cask,Ngrd/homebrew-cask,colindunn/homebrew-cask,hellosky806/homebrew-cask,usami-k/homebrew-cask,neverfox/homebrew-cask,sjackman/homebrew-cask,malford/homebrew-cask,michelegera/homebrew-cask,My2ndAngelic/homebrew-cask,kongslund/homebrew-cask,diogodamiani/homebrew-cask,rogeriopradoj/homebrew-cask,jasmas/homebrew-cask,FredLackeyOfficial/homebrew-cask,nathancahill/homebrew-cask,ksylvan/homebrew-cask,markthetech/homebrew-cask,lantrix/homebrew-cask,miccal/homebrew-cask,colindean/homebrew-cask,ianyh/homebrew-cask,kingthorin/homebrew-cask,jgarber623/homebrew-cask,morganestes/homebrew-cask,tyage/homebrew-cask,paour/homebrew-cask,lumaxis/homebrew-cask,stephenwade/homebrew-cask,julionc/homebrew-cask,vitorgalvao/homebrew-cask,amatos/homebrew-cask,kingthorin/homebrew-cask,nrlquaker/homebrew-cask,jellyfishcoder/homebrew-cask,toonetown/homebrew-cask,gmkey/homebrew-cask,hristozov/homebrew-cask,stephenwade/homebrew-cask,perfide/homebrew-cask,antogg/homebrew-cask,paour/homebrew-cask,mikem/homebrew-cask,13k/homebrew-cask,jeroenj/homebrew-cask,mlocher/homebrew-cask,hellosky806/homebrew-cask,pkq/homebrew-cask,jacobbednarz/homebrew-cask,sosedoff/homebrew-cask,caskroom/homebrew-cask,inta/homebrew-cask,tjnycum/homebrew-cask,larseggert/homebrew-cask,tangestani/homebrew-cask,timsutton/homebrew-cask,optikfluffel/homebrew-cask,yurikoles/homebrew-cask,mattrobenolt/homebrew-cask,victorpopkov/homebrew-cask,JikkuJose/homebrew-cask,joshka/homebrew-cask,diogodamiani/homebrew-cask,dictcp/homebrew-cask,robertgzr/homebrew-cask,ericbn/homebrew-cask,sgnh/homebrew-cask,boecko/homebrew-cask,nshemonsky/homebrew-cask,dictcp/homebrew-cask,giannitm/homebrew-cask,jasmas/homebrew-cask,chrisfinazzo/homebrew-cask,vigosan/homebrew-cask,wickedsp1d3r/homebrew-cask,franklouwers/homebrew-cask,RJHsiao/homebrew-cask,cobyism/homebrew-cask,MoOx/homebrew-cask,maxnordlund/homebrew-cask,miccal/homebrew-cask,rajiv/homebrew-cask,shoichiaizawa/homebrew-cask,n0ts/homebrew-cask,winkelsdorf/homebrew-cask,puffdad/homebrew-cask,kongslund/homebrew-cask,okket/homebrew-cask,shonjir/homebrew-cask,wKovacs64/homebrew-cask,reitermarkus/homebrew-cask,mathbunnyru/homebrew-cask,bric3/homebrew-cask,RJHsiao/homebrew-cask,MoOx/homebrew-cask,forevergenin/homebrew-cask,jaredsampson/homebrew-cask,samnung/homebrew-cask,mjgardner/homebrew-cask,lumaxis/homebrew-cask,jalaziz/homebrew-cask,kpearson/homebrew-cask,wickles/homebrew-cask,alexg0/homebrew-cask,blainesch/homebrew-cask,coeligena/homebrew-customized,mhubig/homebrew-cask,jawshooah/homebrew-cask,pacav69/homebrew-cask,daften/homebrew-cask,tjt263/homebrew-cask,moimikey/homebrew-cask,tjnycum/homebrew-cask,schneidmaster/homebrew-cask,singingwolfboy/homebrew-cask,yutarody/homebrew-cask,wickles/homebrew-cask,lukasbestle/homebrew-cask,chrisfinazzo/homebrew-cask,arronmabrey/homebrew-cask,mikem/homebrew-cask,ptb/homebrew-cask,reitermarkus/homebrew-cask,robertgzr/homebrew-cask,wmorin/homebrew-cask,hanxue/caskroom,Keloran/homebrew-cask,nathancahill/homebrew-cask,joschi/homebrew-cask,arronmabrey/homebrew-cask,artdevjs/homebrew-cask,daften/homebrew-cask,JosephViolago/homebrew-cask,MichaelPei/homebrew-cask,BenjaminHCCarr/homebrew-cask,miccal/homebrew-cask,pacav69/homebrew-cask,flaviocamilo/homebrew-cask,samdoran/homebrew-cask,ebraminio/homebrew-cask,kronicd/homebrew-cask,dvdoliveira/homebrew-cask,markthetech/homebrew-cask,michelegera/homebrew-cask,tangestani/homebrew-cask,claui/homebrew-cask,BenjaminHCCarr/homebrew-cask,kingthorin/homebrew-cask,sohtsuka/homebrew-cask,alebcay/homebrew-cask,y00rb/homebrew-cask,thehunmonkgroup/homebrew-cask,gilesdring/homebrew-cask,phpwutz/homebrew-cask,ninjahoahong/homebrew-cask,jedahan/homebrew-cask,rajiv/homebrew-cask,kesara/homebrew-cask,singingwolfboy/homebrew-cask,winkelsdorf/homebrew-cask,paour/homebrew-cask,jgarber623/homebrew-cask,bric3/homebrew-cask,giannitm/homebrew-cask,yuhki50/homebrew-cask,sanchezm/homebrew-cask,thehunmonkgroup/homebrew-cask,MircoT/homebrew-cask,cblecker/homebrew-cask,victorpopkov/homebrew-cask,tangestani/homebrew-cask,Labutin/homebrew-cask,Ketouem/homebrew-cask,neverfox/homebrew-cask,stephenwade/homebrew-cask,stonehippo/homebrew-cask,thii/homebrew-cask,My2ndAngelic/homebrew-cask,gabrielizaias/homebrew-cask,klane/homebrew-cask,opsdev-ws/homebrew-cask,aguynamedryan/homebrew-cask,scottsuch/homebrew-cask,Ephemera/homebrew-cask,KosherBacon/homebrew-cask,syscrusher/homebrew-cask,morganestes/homebrew-cask,AnastasiaSulyagina/homebrew-cask,jmeridth/homebrew-cask,0rax/homebrew-cask,0xadada/homebrew-cask,BenjaminHCCarr/homebrew-cask,FredLackeyOfficial/homebrew-cask,skatsuta/homebrew-cask,Saklad5/homebrew-cask,scribblemaniac/homebrew-cask,0xadada/homebrew-cask,AnastasiaSulyagina/homebrew-cask,yutarody/homebrew-cask,deanmorin/homebrew-cask,alexg0/homebrew-cask,claui/homebrew-cask,xyb/homebrew-cask,nathanielvarona/homebrew-cask,xight/homebrew-cask,cobyism/homebrew-cask,nathanielvarona/homebrew-cask,timsutton/homebrew-cask,reelsense/homebrew-cask,mwean/homebrew-cask,colindean/homebrew-cask,Cottser/homebrew-cask,mchlrmrz/homebrew-cask,jangalinski/homebrew-cask,antogg/homebrew-cask,joshka/homebrew-cask,artdevjs/homebrew-cask,bdhess/homebrew-cask,kTitan/homebrew-cask,moogar0880/homebrew-cask,tjt263/homebrew-cask,hanxue/caskroom,coeligena/homebrew-customized,mchlrmrz/homebrew-cask,n0ts/homebrew-cask,klane/homebrew-cask,esebastian/homebrew-cask,hanxue/caskroom,wastrachan/homebrew-cask,johnjelinek/homebrew-cask,deiga/homebrew-cask,schneidmaster/homebrew-cask,doits/homebrew-cask,blogabe/homebrew-cask,nrlquaker/homebrew-cask,ebraminio/homebrew-cask,mattrobenolt/homebrew-cask,cliffcotino/homebrew-cask,cfillion/homebrew-cask,singingwolfboy/homebrew-cask,MichaelPei/homebrew-cask,goxberry/homebrew-cask,m3nu/homebrew-cask,wmorin/homebrew-cask,timsutton/homebrew-cask,jacobbednarz/homebrew-cask,Amorymeltzer/homebrew-cask,athrunsun/homebrew-cask,hovancik/homebrew-cask,leipert/homebrew-cask,gerrypower/homebrew-cask,mhubig/homebrew-cask,squid314/homebrew-cask,reitermarkus/homebrew-cask,asins/homebrew-cask,FinalDes/homebrew-cask,wickedsp1d3r/homebrew-cask,caskroom/homebrew-cask,dictcp/homebrew-cask,moimikey/homebrew-cask,toonetown/homebrew-cask,wKovacs64/homebrew-cask,okket/homebrew-cask,winkelsdorf/homebrew-cask,elyscape/homebrew-cask,wmorin/homebrew-cask,maxnordlund/homebrew-cask,hovancik/homebrew-cask,yutarody/homebrew-cask,JacopKane/homebrew-cask,gmkey/homebrew-cask,lukasbestle/homebrew-cask,kesara/homebrew-cask,cobyism/homebrew-cask,malob/homebrew-cask,coeligena/homebrew-customized,patresi/homebrew-cask,amatos/homebrew-cask,muan/homebrew-cask,kassi/homebrew-cask,sanchezm/homebrew-cask,moogar0880/homebrew-cask,blogabe/homebrew-cask,blainesch/homebrew-cask,riyad/homebrew-cask,hyuna917/homebrew-cask,jeroenj/homebrew-cask,stonehippo/homebrew-cask,syscrusher/homebrew-cask,shoichiaizawa/homebrew-cask,a1russell/homebrew-cask,sanyer/homebrew-cask,danielbayley/homebrew-cask,sohtsuka/homebrew-cask,claui/homebrew-cask,koenrh/homebrew-cask,scribblemaniac/homebrew-cask,psibre/homebrew-cask,usami-k/homebrew-cask,josa42/homebrew-cask,guerrero/homebrew-cask,kpearson/homebrew-cask,tedski/homebrew-cask,jiashuw/homebrew-cask,elyscape/homebrew-cask,josa42/homebrew-cask,andyli/homebrew-cask,mishari/homebrew-cask,xight/homebrew-cask,13k/homebrew-cask,jpmat296/homebrew-cask,yumitsu/homebrew-cask,malob/homebrew-cask,gerrypower/homebrew-cask,pkq/homebrew-cask,tjnycum/homebrew-cask,mahori/homebrew-cask,hyuna917/homebrew-cask,yuhki50/homebrew-cask,esebastian/homebrew-cask,bric3/homebrew-cask,SentinelWarren/homebrew-cask,inz/homebrew-cask,riyad/homebrew-cask,jpmat296/homebrew-cask,samdoran/homebrew-cask,doits/homebrew-cask,Amorymeltzer/homebrew-cask,opsdev-ws/homebrew-cask,kronicd/homebrew-cask,johnjelinek/homebrew-cask,leipert/homebrew-cask,yurikoles/homebrew-cask,optikfluffel/homebrew-cask,sanyer/homebrew-cask,andyli/homebrew-cask,Ketouem/homebrew-cask,seanzxx/homebrew-cask,mishari/homebrew-cask,shorshe/homebrew-cask,mchlrmrz/homebrew-cask,uetchy/homebrew-cask,Keloran/homebrew-cask,mjgardner/homebrew-cask,mathbunnyru/homebrew-cask,lucasmezencio/homebrew-cask,wastrachan/homebrew-cask,janlugt/homebrew-cask,nshemonsky/homebrew-cask,mahori/homebrew-cask,gyndav/homebrew-cask,exherb/homebrew-cask,kkdd/homebrew-cask,malob/homebrew-cask,athrunsun/homebrew-cask,JacopKane/homebrew-cask,chadcatlett/caskroom-homebrew-cask,aguynamedryan/homebrew-cask,xyb/homebrew-cask,adrianchia/homebrew-cask,puffdad/homebrew-cask,lifepillar/homebrew-cask,devmynd/homebrew-cask,gyndav/homebrew-cask,Ephemera/homebrew-cask,mrmachine/homebrew-cask,devmynd/homebrew-cask,JacopKane/homebrew-cask,kesara/homebrew-cask,sosedoff/homebrew-cask,shorshe/homebrew-cask,ptb/homebrew-cask,0rax/homebrew-cask,asins/homebrew-cask,inta/homebrew-cask,haha1903/homebrew-cask,lucasmezencio/homebrew-cask,kamilboratynski/homebrew-cask,tedski/homebrew-cask,cblecker/homebrew-cask,slack4u/homebrew-cask,cprecioso/homebrew-cask,bosr/homebrew-cask,goxberry/homebrew-cask,troyxmccall/homebrew-cask,jgarber623/homebrew-cask,yumitsu/homebrew-cask,mwean/homebrew-cask,antogg/homebrew-cask,deanmorin/homebrew-cask,franklouwers/homebrew-cask,mjgardner/homebrew-cask,kkdd/homebrew-cask,exherb/homebrew-cask,blogabe/homebrew-cask,patresi/homebrew-cask,gabrielizaias/homebrew-cask,skatsuta/homebrew-cask,sanyer/homebrew-cask,chadcatlett/caskroom-homebrew-cask,adrianchia/homebrew-cask,koenrh/homebrew-cask,imgarylai/homebrew-cask,a1russell/homebrew-cask,janlugt/homebrew-cask,rogeriopradoj/homebrew-cask,andrewdisley/homebrew-cask,decrement/homebrew-cask,jmeridth/homebrew-cask,johndbritton/homebrew-cask,chuanxd/homebrew-cask,decrement/homebrew-cask,Amorymeltzer/homebrew-cask,ksylvan/homebrew-cask,mauricerkelly/homebrew-cask,y00rb/homebrew-cask,malford/homebrew-cask,onlynone/homebrew-cask,esebastian/homebrew-cask,diguage/homebrew-cask,bdhess/homebrew-cask,julionc/homebrew-cask,mrmachine/homebrew-cask,jconley/homebrew-cask,flaviocamilo/homebrew-cask,mlocher/homebrew-cask,slack4u/homebrew-cask,vigosan/homebrew-cask,cfillion/homebrew-cask,ianyh/homebrew-cask,rajiv/homebrew-cask,forevergenin/homebrew-cask,MircoT/homebrew-cask,renaudguerin/homebrew-cask,cliffcotino/homebrew-cask,m3nu/homebrew-cask,scottsuch/homebrew-cask,JosephViolago/homebrew-cask,sgnh/homebrew-cask,nathanielvarona/homebrew-cask,boecko/homebrew-cask,hakamadare/homebrew-cask,neverfox/homebrew-cask,yurikoles/homebrew-cask,mathbunnyru/homebrew-cask,inz/homebrew-cask,jellyfishcoder/homebrew-cask,sebcode/homebrew-cask,sebcode/homebrew-cask,SentinelWarren/homebrew-cask,xtian/homebrew-cask,perfide/homebrew-cask,joshka/homebrew-cask,gyndav/homebrew-cask,chuanxd/homebrew-cask,xight/homebrew-cask,xtian/homebrew-cask,larseggert/homebrew-cask,julionc/homebrew-cask,johndbritton/homebrew-cask,jawshooah/homebrew-cask,deiga/homebrew-cask,guerrero/homebrew-cask,stonehippo/homebrew-cask,JikkuJose/homebrew-cask,chrisfinazzo/homebrew-cask,FinalDes/homebrew-cask,phpwutz/homebrew-cask,hakamadare/homebrew-cask,uetchy/homebrew-cask,lantrix/homebrew-cask,Saklad5/homebrew-cask,alebcay/homebrew-cask,colindunn/homebrew-cask,cblecker/homebrew-cask,gilesdring/homebrew-cask,samnung/homebrew-cask,danielbayley/homebrew-cask,adrianchia/homebrew-cask,renaudguerin/homebrew-cask,scribblemaniac/homebrew-cask,danielbayley/homebrew-cask,diguage/homebrew-cask,jaredsampson/homebrew-cask,troyxmccall/homebrew-cask,xcezx/homebrew-cask,moimikey/homebrew-cask,shonjir/homebrew-cask,alebcay/homebrew-cask,xcezx/homebrew-cask,onlynone/homebrew-cask,optikfluffel/homebrew-cask,Ngrd/homebrew-cask,scottsuch/homebrew-cask,sscotth/homebrew-cask,m3nu/homebrew-cask,mahori/homebrew-cask,nrlquaker/homebrew-cask,jbeagley52/homebrew-cask,andrewdisley/homebrew-cask,imgarylai/homebrew-cask,Labutin/homebrew-cask,pkq/homebrew-cask,joschi/homebrew-cask | ruby | ## Code Before:
cask 'lytro-desktop' do
version '4.3.3,151118.98'
sha256 '500b28ed7d67aaf18a59a8770e3fb83a4b96e692728ddbd522a52879af758966'
# amazonaws.com/lytro-desktop-support was verified as official when first introduced to the cask
url "https://s3.amazonaws.com/lytro-distro/lytro-#{version.after_comma}.dmg"
appcast 'https://pictures.lytro.com/support/software_update',
checkpoint: 'c806ff660e791f181371f9946412ee07ebd03459db8791832ed4b0be378d587a'
name 'Lytro Desktop'
homepage 'https://www.lytro.com/'
license :gratis
app 'Lytro Desktop.app'
end
## Instruction:
Fix `url` stanza comment for Lytro Desktop.
## Code After:
cask 'lytro-desktop' do
version '4.3.3,151118.98'
sha256 '500b28ed7d67aaf18a59a8770e3fb83a4b96e692728ddbd522a52879af758966'
# amazonaws.com/lytro-distro was verified as official when first introduced to the cask
url "https://s3.amazonaws.com/lytro-distro/lytro-#{version.after_comma}.dmg"
appcast 'https://pictures.lytro.com/support/software_update',
checkpoint: 'c806ff660e791f181371f9946412ee07ebd03459db8791832ed4b0be378d587a'
name 'Lytro Desktop'
homepage 'https://www.lytro.com/'
license :gratis
app 'Lytro Desktop.app'
end
| cask 'lytro-desktop' do
version '4.3.3,151118.98'
sha256 '500b28ed7d67aaf18a59a8770e3fb83a4b96e692728ddbd522a52879af758966'
- # amazonaws.com/lytro-desktop-support was verified as official when first introduced to the cask
? ^ - ---------
+ # amazonaws.com/lytro-distro was verified as official when first introduced to the cask
? ^ +
url "https://s3.amazonaws.com/lytro-distro/lytro-#{version.after_comma}.dmg"
appcast 'https://pictures.lytro.com/support/software_update',
checkpoint: 'c806ff660e791f181371f9946412ee07ebd03459db8791832ed4b0be378d587a'
name 'Lytro Desktop'
homepage 'https://www.lytro.com/'
license :gratis
app 'Lytro Desktop.app'
end | 2 | 0.142857 | 1 | 1 |
10bfa701f352e0f916b1edd9913bee788f09568f | oscar/apps/catalogue/managers.py | oscar/apps/catalogue/managers.py | from django.db import models
class ProductManager(models.Manager):
def base_queryset(self):
"""
Return ``QuerySet`` with related content pre-loaded.
"""
return self.get_query_set().select_related('product_class')\
.prefetch_related('variants',
'product_options',
'product_class__options',
'stockrecords',
'images',
).all()
class BrowsableProductManager(ProductManager):
"""
Excludes non-canonical products
"""
def get_query_set(self):
return super(BrowsableProductManager, self).get_query_set().filter(
parent=None)
| from django.db import models
class ProductQuerySet(models.query.QuerySet):
def base_queryset(self):
"""
Applies select_related and prefetch_related for commonly related
models to save on queries
"""
return self.select_related('product_class')\
.prefetch_related('variants',
'product_options',
'product_class__options',
'stockrecords',
'images',
)
def browsable(self):
"""
Excludes non-canonical products.
"""
return self.filter(parent=None)
class ProductManager(models.Manager):
"""
Uses ProductQuerySet and proxies its methods to allow chaining
Once Django 1.7 lands, this class can probably be removed:
https://docs.djangoproject.com/en/dev/releases/1.7/#calling-custom-queryset-methods-from-the-manager #n oqa
"""
def get_queryset(self):
return ProductQuerySet(self.model, using=self._db)
def browsable(self):
return self.get_queryset().browsable()
def base_queryset(self):
return self.get_queryset().base_queryset()
class BrowsableProductManager(ProductManager):
"""
Excludes non-canonical products
Could be deprecated after Oscar 0.7 is released
"""
def get_queryset(self):
return super(BrowsableProductManager, self).get_queryset().browsable()
| Allow chaining of Product's custom querysets | Allow chaining of Product's custom querysets
This aligns the implementation of Oscar specific QuerySet Methods with
the implementation in current django core[1].
While this is not DRY, it does deliver on chainability and can be seen
as preparation to take advantage of the improvements coming to this part
of django in 1.7 [2]
The original motivation for this was that using a custom QuerySet while
trying not to copy code from oscar felt too hard.
[1] https://github.com/django/django/blob/1.6.2/django/db/models/manager.py#L123
[2] https://docs.djangoproject.com/en/dev/releases/1.7/#calling-custom-queryset-methods-from-the-manager
Fixes #1278.
Deprecation comments added by @maikhoepfel
| Python | bsd-3-clause | thechampanurag/django-oscar,mexeniz/django-oscar,jinnykoo/wuyisj,monikasulik/django-oscar,dongguangming/django-oscar,QLGu/django-oscar,WadeYuChen/django-oscar,josesanch/django-oscar,vovanbo/django-oscar,sonofatailor/django-oscar,ahmetdaglarbas/e-commerce,itbabu/django-oscar,WadeYuChen/django-oscar,anentropic/django-oscar,dongguangming/django-oscar,QLGu/django-oscar,WadeYuChen/django-oscar,josesanch/django-oscar,eddiep1101/django-oscar,marcoantoniooliveira/labweb,michaelkuty/django-oscar,Bogh/django-oscar,jlmadurga/django-oscar,john-parton/django-oscar,MatthewWilkes/django-oscar,amirrpp/django-oscar,pasqualguerrero/django-oscar,taedori81/django-oscar,michaelkuty/django-oscar,vovanbo/django-oscar,taedori81/django-oscar,QLGu/django-oscar,monikasulik/django-oscar,django-oscar/django-oscar,saadatqadri/django-oscar,Jannes123/django-oscar,amirrpp/django-oscar,manevant/django-oscar,manevant/django-oscar,taedori81/django-oscar,ka7eh/django-oscar,WillisXChen/django-oscar,jmt4/django-oscar,mexeniz/django-oscar,eddiep1101/django-oscar,ademuk/django-oscar,rocopartners/django-oscar,nickpack/django-oscar,anentropic/django-oscar,MatthewWilkes/django-oscar,bschuon/django-oscar,DrOctogon/unwash_ecom,jlmadurga/django-oscar,bschuon/django-oscar,QLGu/django-oscar,pasqualguerrero/django-oscar,pdonadeo/django-oscar,marcoantoniooliveira/labweb,spartonia/django-oscar,lijoantony/django-oscar,saadatqadri/django-oscar,manevant/django-oscar,jinnykoo/wuyisj,thechampanurag/django-oscar,john-parton/django-oscar,jinnykoo/wuyisj.com,adamend/django-oscar,pasqualguerrero/django-oscar,Jannes123/django-oscar,lijoantony/django-oscar,adamend/django-oscar,jmt4/django-oscar,sasha0/django-oscar,jlmadurga/django-oscar,okfish/django-oscar,josesanch/django-oscar,kapari/django-oscar,DrOctogon/unwash_ecom,saadatqadri/django-oscar,sasha0/django-oscar,itbabu/django-oscar,mexeniz/django-oscar,anentropic/django-oscar,MatthewWilkes/django-oscar,bnprk/django-oscar,marcoantoniooliveira/labweb,kapari/django-oscar,binarydud/django-oscar,machtfit/django-oscar,nickpack/django-oscar,adamend/django-oscar,nickpack/django-oscar,ahmetdaglarbas/e-commerce,kapari/django-oscar,jinnykoo/wuyisj.com,binarydud/django-oscar,spartonia/django-oscar,vovanbo/django-oscar,machtfit/django-oscar,kapt/django-oscar,monikasulik/django-oscar,itbabu/django-oscar,ka7eh/django-oscar,john-parton/django-oscar,vovanbo/django-oscar,manevant/django-oscar,Bogh/django-oscar,jlmadurga/django-oscar,eddiep1101/django-oscar,WillisXChen/django-oscar,lijoantony/django-oscar,WillisXChen/django-oscar,nfletton/django-oscar,amirrpp/django-oscar,thechampanurag/django-oscar,lijoantony/django-oscar,bnprk/django-oscar,jinnykoo/wuyisj.com,sonofatailor/django-oscar,amirrpp/django-oscar,nickpack/django-oscar,michaelkuty/django-oscar,michaelkuty/django-oscar,jinnykoo/wuyisj.com,pdonadeo/django-oscar,anentropic/django-oscar,Bogh/django-oscar,faratro/django-oscar,nfletton/django-oscar,jmt4/django-oscar,ademuk/django-oscar,jinnykoo/wuyisj,sonofatailor/django-oscar,rocopartners/django-oscar,faratro/django-oscar,jinnykoo/wuyisj,pdonadeo/django-oscar,itbabu/django-oscar,machtfit/django-oscar,MatthewWilkes/django-oscar,john-parton/django-oscar,ademuk/django-oscar,mexeniz/django-oscar,jinnykoo/christmas,solarissmoke/django-oscar,binarydud/django-oscar,taedori81/django-oscar,dongguangming/django-oscar,WillisXChen/django-oscar,jmt4/django-oscar,solarissmoke/django-oscar,Jannes123/django-oscar,bschuon/django-oscar,solarissmoke/django-oscar,nfletton/django-oscar,jinnykoo/christmas,thechampanurag/django-oscar,saadatqadri/django-oscar,kapt/django-oscar,sonofatailor/django-oscar,okfish/django-oscar,Bogh/django-oscar,spartonia/django-oscar,monikasulik/django-oscar,ka7eh/django-oscar,nfletton/django-oscar,sasha0/django-oscar,dongguangming/django-oscar,sasha0/django-oscar,spartonia/django-oscar,faratro/django-oscar,pasqualguerrero/django-oscar,okfish/django-oscar,DrOctogon/unwash_ecom,django-oscar/django-oscar,ahmetdaglarbas/e-commerce,jinnykoo/christmas,faratro/django-oscar,ka7eh/django-oscar,ahmetdaglarbas/e-commerce,Jannes123/django-oscar,adamend/django-oscar,bnprk/django-oscar,kapari/django-oscar,rocopartners/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,WillisXChen/django-oscar,kapt/django-oscar,django-oscar/django-oscar,bnprk/django-oscar,rocopartners/django-oscar,WillisXChen/django-oscar,bschuon/django-oscar,marcoantoniooliveira/labweb,binarydud/django-oscar,eddiep1101/django-oscar,ademuk/django-oscar,okfish/django-oscar,pdonadeo/django-oscar,WadeYuChen/django-oscar | python | ## Code Before:
from django.db import models
class ProductManager(models.Manager):
def base_queryset(self):
"""
Return ``QuerySet`` with related content pre-loaded.
"""
return self.get_query_set().select_related('product_class')\
.prefetch_related('variants',
'product_options',
'product_class__options',
'stockrecords',
'images',
).all()
class BrowsableProductManager(ProductManager):
"""
Excludes non-canonical products
"""
def get_query_set(self):
return super(BrowsableProductManager, self).get_query_set().filter(
parent=None)
## Instruction:
Allow chaining of Product's custom querysets
This aligns the implementation of Oscar specific QuerySet Methods with
the implementation in current django core[1].
While this is not DRY, it does deliver on chainability and can be seen
as preparation to take advantage of the improvements coming to this part
of django in 1.7 [2]
The original motivation for this was that using a custom QuerySet while
trying not to copy code from oscar felt too hard.
[1] https://github.com/django/django/blob/1.6.2/django/db/models/manager.py#L123
[2] https://docs.djangoproject.com/en/dev/releases/1.7/#calling-custom-queryset-methods-from-the-manager
Fixes #1278.
Deprecation comments added by @maikhoepfel
## Code After:
from django.db import models
class ProductQuerySet(models.query.QuerySet):
def base_queryset(self):
"""
Applies select_related and prefetch_related for commonly related
models to save on queries
"""
return self.select_related('product_class')\
.prefetch_related('variants',
'product_options',
'product_class__options',
'stockrecords',
'images',
)
def browsable(self):
"""
Excludes non-canonical products.
"""
return self.filter(parent=None)
class ProductManager(models.Manager):
"""
Uses ProductQuerySet and proxies its methods to allow chaining
Once Django 1.7 lands, this class can probably be removed:
https://docs.djangoproject.com/en/dev/releases/1.7/#calling-custom-queryset-methods-from-the-manager #n oqa
"""
def get_queryset(self):
return ProductQuerySet(self.model, using=self._db)
def browsable(self):
return self.get_queryset().browsable()
def base_queryset(self):
return self.get_queryset().base_queryset()
class BrowsableProductManager(ProductManager):
"""
Excludes non-canonical products
Could be deprecated after Oscar 0.7 is released
"""
def get_queryset(self):
return super(BrowsableProductManager, self).get_queryset().browsable()
| from django.db import models
- class ProductManager(models.Manager):
+ class ProductQuerySet(models.query.QuerySet):
def base_queryset(self):
"""
- Return ``QuerySet`` with related content pre-loaded.
+ Applies select_related and prefetch_related for commonly related
+ models to save on queries
"""
- return self.get_query_set().select_related('product_class')\
? ----------------
+ return self.select_related('product_class')\
.prefetch_related('variants',
'product_options',
'product_class__options',
'stockrecords',
'images',
- ).all()
? ------
+ )
+
+ def browsable(self):
+ """
+ Excludes non-canonical products.
+ """
+ return self.filter(parent=None)
+
+
+ class ProductManager(models.Manager):
+ """
+ Uses ProductQuerySet and proxies its methods to allow chaining
+
+ Once Django 1.7 lands, this class can probably be removed:
+ https://docs.djangoproject.com/en/dev/releases/1.7/#calling-custom-queryset-methods-from-the-manager #n oqa
+ """
+
+ def get_queryset(self):
+ return ProductQuerySet(self.model, using=self._db)
+
+ def browsable(self):
+ return self.get_queryset().browsable()
+
+ def base_queryset(self):
+ return self.get_queryset().base_queryset()
class BrowsableProductManager(ProductManager):
"""
Excludes non-canonical products
+
+ Could be deprecated after Oscar 0.7 is released
"""
- def get_query_set(self):
? -
+ def get_queryset(self):
- return super(BrowsableProductManager, self).get_query_set().filter(
? - ^^ - -
+ return super(BrowsableProductManager, self).get_queryset().browsable()
? ^^^^^^^ +
- parent=None) | 40 | 1.538462 | 33 | 7 |
e2437ba31ea2c7f35afaeb2ec966062b2dfa2f5e | manage.py | manage.py | from os.path import abspath
from flask import current_app as app
from app import create_app, db
# from app.model import init_db
from flask.ext.script import Manager
manager = Manager(create_app)
manager.add_option('-m', '--cfgmode', dest='config_mode', default='Development')
manager.add_option('-f', '--cfgfile', dest='config_file', type=abspath)
@manager.command
def createdb():
with app.app_context():
"""Creates database"""
db.create_all()
print 'Database created'
@manager.command
def cleardb():
with app.app_context():
"""Clears database"""
db.drop_all()
print 'Database cleared'
@manager.command
def resetdb():
with app.app_context():
"""Resets database"""
db.drop_all()
db.create_all()
print 'Database reset'
@manager.command
def initdb():
with app.app_context():
"""Initializes database with test data"""
if prompt_bool('Are you sure you want to replace all data?'):
init_db()
print 'Database initialized'
else:
print 'Database initialization aborted'
if __name__ == '__main__':
manager.run()
| from os.path import abspath
from flask import current_app as app
from app import create_app, db
# from app.model import init_db, populate_db()
from flask.ext.script import Manager
manager = Manager(create_app)
manager.add_option('-m', '--cfgmode', dest='config_mode', default='Development')
manager.add_option('-f', '--cfgfile', dest='config_file', type=abspath)
@manager.command
def createdb():
with app.app_context():
"""Creates database"""
db.create_all()
print 'Database created'
@manager.command
def cleardb():
with app.app_context():
"""Deletes all database tables"""
db.drop_all()
print 'Database cleared'
@manager.command
def resetdb():
with app.app_context():
"""Removes all content from database"""
db.drop_all()
db.create_all()
print 'Database reset'
@manager.command
def initdb():
with app.app_context():
"""Initializes database with default values"""
db.drop_all()
db.create_all()
init_db()
print 'Database initialized'
@manager.command
def popdb():
with app.app_context():
"""Populates database with sample data"""
db.drop_all()
db.create_all()
init_db()
populate_db()
print 'Database populated'
if __name__ == '__main__':
manager.run()
| Add popdb() and edit descriptions | Add popdb() and edit descriptions
| Python | mit | nerevu/prometheus-api,nerevu/prometheus-api,nerevu/prometheus-api | python | ## Code Before:
from os.path import abspath
from flask import current_app as app
from app import create_app, db
# from app.model import init_db
from flask.ext.script import Manager
manager = Manager(create_app)
manager.add_option('-m', '--cfgmode', dest='config_mode', default='Development')
manager.add_option('-f', '--cfgfile', dest='config_file', type=abspath)
@manager.command
def createdb():
with app.app_context():
"""Creates database"""
db.create_all()
print 'Database created'
@manager.command
def cleardb():
with app.app_context():
"""Clears database"""
db.drop_all()
print 'Database cleared'
@manager.command
def resetdb():
with app.app_context():
"""Resets database"""
db.drop_all()
db.create_all()
print 'Database reset'
@manager.command
def initdb():
with app.app_context():
"""Initializes database with test data"""
if prompt_bool('Are you sure you want to replace all data?'):
init_db()
print 'Database initialized'
else:
print 'Database initialization aborted'
if __name__ == '__main__':
manager.run()
## Instruction:
Add popdb() and edit descriptions
## Code After:
from os.path import abspath
from flask import current_app as app
from app import create_app, db
# from app.model import init_db, populate_db()
from flask.ext.script import Manager
manager = Manager(create_app)
manager.add_option('-m', '--cfgmode', dest='config_mode', default='Development')
manager.add_option('-f', '--cfgfile', dest='config_file', type=abspath)
@manager.command
def createdb():
with app.app_context():
"""Creates database"""
db.create_all()
print 'Database created'
@manager.command
def cleardb():
with app.app_context():
"""Deletes all database tables"""
db.drop_all()
print 'Database cleared'
@manager.command
def resetdb():
with app.app_context():
"""Removes all content from database"""
db.drop_all()
db.create_all()
print 'Database reset'
@manager.command
def initdb():
with app.app_context():
"""Initializes database with default values"""
db.drop_all()
db.create_all()
init_db()
print 'Database initialized'
@manager.command
def popdb():
with app.app_context():
"""Populates database with sample data"""
db.drop_all()
db.create_all()
init_db()
populate_db()
print 'Database populated'
if __name__ == '__main__':
manager.run()
| from os.path import abspath
from flask import current_app as app
from app import create_app, db
- # from app.model import init_db
+ # from app.model import init_db, populate_db()
? +++++++++++++++
from flask.ext.script import Manager
manager = Manager(create_app)
manager.add_option('-m', '--cfgmode', dest='config_mode', default='Development')
manager.add_option('-f', '--cfgfile', dest='config_file', type=abspath)
@manager.command
def createdb():
with app.app_context():
"""Creates database"""
db.create_all()
print 'Database created'
@manager.command
def cleardb():
with app.app_context():
- """Clears database"""
+ """Deletes all database tables"""
db.drop_all()
print 'Database cleared'
@manager.command
def resetdb():
with app.app_context():
- """Resets database"""
+ """Removes all content from database"""
db.drop_all()
db.create_all()
print 'Database reset'
@manager.command
def initdb():
with app.app_context():
- """Initializes database with test data"""
? ------
+ """Initializes database with default values"""
? ++++++ +++++
- if prompt_bool('Are you sure you want to replace all data?'):
+ db.drop_all()
+ db.create_all()
- init_db()
? -
+ init_db()
- print 'Database initialized'
? -
+ print 'Database initialized'
- else:
- print 'Database initialization aborted'
+
+ @manager.command
+ def popdb():
+ with app.app_context():
+
+ """Populates database with sample data"""
+ db.drop_all()
+ db.create_all()
+ init_db()
+ populate_db()
+ print 'Database populated'
if __name__ == '__main__':
manager.run() | 28 | 0.571429 | 19 | 9 |
b0e05495d46f45bea07de5bbdf359fdf8416c7f3 | test/conjoiner.js | test/conjoiner.js | 'use strict';
var conjoiners = require('../lib/conjoiners');
exports['simple inter-process communication'] = function(test) {
test.expect(3);
var value = 'test_value';
var cj1 = {};
var cj1Name = 'test';
var cj2 = {
onTransenlightenment: function (event) {
test.equal(event.property, 'val');
test.equal(this[event.property], value);
}
};
conjoiners.implant(cj1, 'test/conf.json', cj1Name).then(function() {
return conjoiners.implant(cj2, 'test/conf.json', 'test2');
}).then(function () {
cj1.val = value;
setTimeout(function() {
test.equal(cj2.val, value);
test.done();
}, 1500);
}).done();
};
| 'use strict';
var conjoiners = require('../lib/conjoiners');
exports['simple inter-process communication'] = function(test) {
test.expect(3);
var value = 'test_value';
var cj1 = {};
var cj1Name = 'test';
var cj2 = {
onTransenlightenment: function (event) {
test.equal(event.property, 'val');
test.equal(this[event.property], value);
test.equal(cj2.val, value);
test.done();
}
};
conjoiners.implant(cj1, 'test/conf.json', cj1Name).then(function() {
return conjoiners.implant(cj2, 'test/conf.json', 'test2');
}).then(function () {
cj1.val = value;
}).done();
};
| Test should not rely on setTimeout | Test should not rely on setTimeout | JavaScript | apache-2.0 | conjoiners/conjoiners-node.js | javascript | ## Code Before:
'use strict';
var conjoiners = require('../lib/conjoiners');
exports['simple inter-process communication'] = function(test) {
test.expect(3);
var value = 'test_value';
var cj1 = {};
var cj1Name = 'test';
var cj2 = {
onTransenlightenment: function (event) {
test.equal(event.property, 'val');
test.equal(this[event.property], value);
}
};
conjoiners.implant(cj1, 'test/conf.json', cj1Name).then(function() {
return conjoiners.implant(cj2, 'test/conf.json', 'test2');
}).then(function () {
cj1.val = value;
setTimeout(function() {
test.equal(cj2.val, value);
test.done();
}, 1500);
}).done();
};
## Instruction:
Test should not rely on setTimeout
## Code After:
'use strict';
var conjoiners = require('../lib/conjoiners');
exports['simple inter-process communication'] = function(test) {
test.expect(3);
var value = 'test_value';
var cj1 = {};
var cj1Name = 'test';
var cj2 = {
onTransenlightenment: function (event) {
test.equal(event.property, 'val');
test.equal(this[event.property], value);
test.equal(cj2.val, value);
test.done();
}
};
conjoiners.implant(cj1, 'test/conf.json', cj1Name).then(function() {
return conjoiners.implant(cj2, 'test/conf.json', 'test2');
}).then(function () {
cj1.val = value;
}).done();
};
| 'use strict';
var conjoiners = require('../lib/conjoiners');
exports['simple inter-process communication'] = function(test) {
test.expect(3);
var value = 'test_value';
var cj1 = {};
var cj1Name = 'test';
var cj2 = {
onTransenlightenment: function (event) {
test.equal(event.property, 'val');
test.equal(this[event.property], value);
+ test.equal(cj2.val, value);
+ test.done();
}
};
conjoiners.implant(cj1, 'test/conf.json', cj1Name).then(function() {
return conjoiners.implant(cj2, 'test/conf.json', 'test2');
}).then(function () {
cj1.val = value;
-
- setTimeout(function() {
- test.equal(cj2.val, value);
- test.done();
- }, 1500);
}).done();
}; | 7 | 0.25 | 2 | 5 |
700f316c0ca9aa873181111752ba99b0f17a1d35 | src-es6/test/classTest.js | src-es6/test/classTest.js | import test from 'tape'
import { Vector, Polygon, Rectangle, Circle, ShapeEventEmitter } from '..'
test('Polygon#contains', t => {
t.plan(5)
//Disable warning about missing 'new'. That's what we are testing
/*jshint -W064 */
/*eslint-disable new-cap */
t.throws(()=> Polygon(), TypeError)
t.throws(()=> Rectangle(), TypeError)
t.throws(()=> Vector(), TypeError)
t.throws(()=> Circle(), TypeError)
t.throws(()=> ShapeEventEmitter(), TypeError)
/*eslint-enable new-cap */
})
| import test from 'tape'
import { Vector, Polygon, Rectangle, Circle, ShapeEventEmitter } from '..'
test('Classtest', t => {
t.plan(5)
//Disable warning about missing 'new'. That's what we are testing
/*jshint -W064 */
/*eslint-disable new-cap */
t.throws(()=> Polygon(), TypeError)
t.throws(()=> Rectangle(), TypeError)
t.throws(()=> Vector(), TypeError)
t.throws(()=> Circle(), TypeError)
t.throws(()=> ShapeEventEmitter(), TypeError)
/*eslint-enable new-cap */
})
| Fix name for the classtest | Fix name for the classtest
| JavaScript | mit | tillarnold/shapes | javascript | ## Code Before:
import test from 'tape'
import { Vector, Polygon, Rectangle, Circle, ShapeEventEmitter } from '..'
test('Polygon#contains', t => {
t.plan(5)
//Disable warning about missing 'new'. That's what we are testing
/*jshint -W064 */
/*eslint-disable new-cap */
t.throws(()=> Polygon(), TypeError)
t.throws(()=> Rectangle(), TypeError)
t.throws(()=> Vector(), TypeError)
t.throws(()=> Circle(), TypeError)
t.throws(()=> ShapeEventEmitter(), TypeError)
/*eslint-enable new-cap */
})
## Instruction:
Fix name for the classtest
## Code After:
import test from 'tape'
import { Vector, Polygon, Rectangle, Circle, ShapeEventEmitter } from '..'
test('Classtest', t => {
t.plan(5)
//Disable warning about missing 'new'. That's what we are testing
/*jshint -W064 */
/*eslint-disable new-cap */
t.throws(()=> Polygon(), TypeError)
t.throws(()=> Rectangle(), TypeError)
t.throws(()=> Vector(), TypeError)
t.throws(()=> Circle(), TypeError)
t.throws(()=> ShapeEventEmitter(), TypeError)
/*eslint-enable new-cap */
})
| import test from 'tape'
import { Vector, Polygon, Rectangle, Circle, ShapeEventEmitter } from '..'
- test('Polygon#contains', t => {
+ test('Classtest', t => {
t.plan(5)
//Disable warning about missing 'new'. That's what we are testing
/*jshint -W064 */
/*eslint-disable new-cap */
t.throws(()=> Polygon(), TypeError)
t.throws(()=> Rectangle(), TypeError)
t.throws(()=> Vector(), TypeError)
t.throws(()=> Circle(), TypeError)
t.throws(()=> ShapeEventEmitter(), TypeError)
/*eslint-enable new-cap */
})
| 2 | 0.117647 | 1 | 1 |
c40b81c8960477cf4e4f1812b26f794b62c46efd | README.md | README.md | node-fanin [![Build Status][1]][2]
==========
A simple concurrency pattern: fan-in
Status: Untested in production, but ready to be.
## Why do you need fan-in?
- You want to make `total` asynchronous calls simultaneously and make a callback when all have finished.
- You may want to save the callback values of these calls, and definitely want the errors.
- You just want that. Nothing else.
## API
```node.js
var fanin = require('fanin')
, fan = fanin(3, cb);
foo(fan.capture('foo'));
bar(fan.capture('bar'));
baz(fan);
// cb(array_of_errs, {foo: foo_obj, bar: bar_obj}); will be called.
```
- `var fan = fanin(n, cb)` returns a function which will act as a callback to the sub-calls in which you only care about errors.
- `fan.capture(name)` will act as a callback to the sub-calls which you care about return value (placing them in an object under the key `name`.
- options:
- `joinErrs` is an optional argument to join the error list (it can be a string to join on or true for .join('; '))
## Installation
`npm install after`
## Tests
`npm test`
## License
MIT License found in the LICENSE file.
[1]: https://travis-ci.org/yanatan16/node-fanin.png?branch=master
[2]: http://travis-ci.org/yanatan16/node-fanin
| node-fanin [![Build Status][1]][2]
==========
A simple concurrency pattern: fan-in
Status: Untested in production, but ready to be.
## Why do you need fan-in?
- You want to make `n` asynchronous calls simultaneously and make a callback when all have finished.
- You may want to save the callback values of these calls, and definitely want the errors.
- You just want that. Nothing else.
## API
var fanin = require('fanin')
, fan = fanin(3, cb);
foo(fan.capture('foo'));
bar(fan.capture('bar'));
baz(fan);
// cb(array_of_errs, {foo: foo_obj, bar: bar_obj}); will be called.
- `var fan = fanin(n, cb)` returns a function which will act as a callback to the sub-calls in which you only care about errors.
- `fan.capture(name)` will act as a callback to the sub-calls which you care about return value (placing them in an object under the key `name`.
- options:
- `joinErrs` is an optional argument to join the error list (it can be a string to join on or true for .join('; '))
## Installation
`npm install after`
## Tests
`npm test`
## License
MIT License found in the LICENSE file.
[1]: https://travis-ci.org/yanatan16/node-fanin.png?branch=master
[2]: http://travis-ci.org/yanatan16/node-fanin
| Make readme markdown npm friendly | Make readme markdown npm friendly | Markdown | mit | yanatan16/node-fanin | markdown | ## Code Before:
node-fanin [![Build Status][1]][2]
==========
A simple concurrency pattern: fan-in
Status: Untested in production, but ready to be.
## Why do you need fan-in?
- You want to make `total` asynchronous calls simultaneously and make a callback when all have finished.
- You may want to save the callback values of these calls, and definitely want the errors.
- You just want that. Nothing else.
## API
```node.js
var fanin = require('fanin')
, fan = fanin(3, cb);
foo(fan.capture('foo'));
bar(fan.capture('bar'));
baz(fan);
// cb(array_of_errs, {foo: foo_obj, bar: bar_obj}); will be called.
```
- `var fan = fanin(n, cb)` returns a function which will act as a callback to the sub-calls in which you only care about errors.
- `fan.capture(name)` will act as a callback to the sub-calls which you care about return value (placing them in an object under the key `name`.
- options:
- `joinErrs` is an optional argument to join the error list (it can be a string to join on or true for .join('; '))
## Installation
`npm install after`
## Tests
`npm test`
## License
MIT License found in the LICENSE file.
[1]: https://travis-ci.org/yanatan16/node-fanin.png?branch=master
[2]: http://travis-ci.org/yanatan16/node-fanin
## Instruction:
Make readme markdown npm friendly
## Code After:
node-fanin [![Build Status][1]][2]
==========
A simple concurrency pattern: fan-in
Status: Untested in production, but ready to be.
## Why do you need fan-in?
- You want to make `n` asynchronous calls simultaneously and make a callback when all have finished.
- You may want to save the callback values of these calls, and definitely want the errors.
- You just want that. Nothing else.
## API
var fanin = require('fanin')
, fan = fanin(3, cb);
foo(fan.capture('foo'));
bar(fan.capture('bar'));
baz(fan);
// cb(array_of_errs, {foo: foo_obj, bar: bar_obj}); will be called.
- `var fan = fanin(n, cb)` returns a function which will act as a callback to the sub-calls in which you only care about errors.
- `fan.capture(name)` will act as a callback to the sub-calls which you care about return value (placing them in an object under the key `name`.
- options:
- `joinErrs` is an optional argument to join the error list (it can be a string to join on or true for .join('; '))
## Installation
`npm install after`
## Tests
`npm test`
## License
MIT License found in the LICENSE file.
[1]: https://travis-ci.org/yanatan16/node-fanin.png?branch=master
[2]: http://travis-ci.org/yanatan16/node-fanin
| node-fanin [![Build Status][1]][2]
==========
A simple concurrency pattern: fan-in
Status: Untested in production, but ready to be.
## Why do you need fan-in?
- - You want to make `total` asynchronous calls simultaneously and make a callback when all have finished.
? ^^^^^
+ - You want to make `n` asynchronous calls simultaneously and make a callback when all have finished.
? ^
- You may want to save the callback values of these calls, and definitely want the errors.
- You just want that. Nothing else.
## API
- ```node.js
+
- var fanin = require('fanin')
+ var fanin = require('fanin')
? ++++
- , fan = fanin(3, cb);
+ , fan = fanin(3, cb);
? ++++
- foo(fan.capture('foo'));
+ foo(fan.capture('foo'));
? ++++
- bar(fan.capture('bar'));
+ bar(fan.capture('bar'));
? ++++
- baz(fan);
+ baz(fan);
? ++++
- // cb(array_of_errs, {foo: foo_obj, bar: bar_obj}); will be called.
+ // cb(array_of_errs, {foo: foo_obj, bar: bar_obj}); will be called.
? ++++
- ```
- `var fan = fanin(n, cb)` returns a function which will act as a callback to the sub-calls in which you only care about errors.
- `fan.capture(name)` will act as a callback to the sub-calls which you care about return value (placing them in an object under the key `name`.
- options:
- `joinErrs` is an optional argument to join the error list (it can be a string to join on or true for .join('; '))
## Installation
`npm install after`
## Tests
`npm test`
## License
MIT License found in the LICENSE file.
[1]: https://travis-ci.org/yanatan16/node-fanin.png?branch=master
[2]: http://travis-ci.org/yanatan16/node-fanin
| 17 | 0.361702 | 8 | 9 |
e5d4685e2aec3c40253a62f75b1266024ad3af2f | src/server/config/index.js | src/server/config/index.js | import Joi from 'joi';
import jsonServerConfig from 'config/server.json';
import schema from './schema.js';
class ServerConfig {
constructor() {
this._jsonConfig = jsonServerConfig;
/**
* Validate the JSON config
*/
try {
Joi.validate(this._jsonConfig, schema);
} catch (e) {
console.error('The config in \'config/server.json\' is not a valid config configuration. Error: ', e);
}
}
get (value) {
return this._jsonConfig[value];
}
}
export default new ServerConfig();
| import Joi from 'joi';
import jsonServerConfig from 'config/server.json';
import schema from './schema.js';
class ServerConfig {
constructor() {
/**
* Validate the JSON config
*/
try {
this._jsonConfig = Joi.validate(jsonServerConfig, schema).value;
} catch (e) {
console.error('The config in \'config/server.json\' is not a valid config configuration. Error: ', e);
}
}
get (value) {
return this._jsonConfig[value];
}
}
export default new ServerConfig();
| Update logger and add config | Update logger and add config
| JavaScript | mit | LuudJanssen/plus-min-list,LuudJanssen/plus-min-list,LuudJanssen/plus-min-list | javascript | ## Code Before:
import Joi from 'joi';
import jsonServerConfig from 'config/server.json';
import schema from './schema.js';
class ServerConfig {
constructor() {
this._jsonConfig = jsonServerConfig;
/**
* Validate the JSON config
*/
try {
Joi.validate(this._jsonConfig, schema);
} catch (e) {
console.error('The config in \'config/server.json\' is not a valid config configuration. Error: ', e);
}
}
get (value) {
return this._jsonConfig[value];
}
}
export default new ServerConfig();
## Instruction:
Update logger and add config
## Code After:
import Joi from 'joi';
import jsonServerConfig from 'config/server.json';
import schema from './schema.js';
class ServerConfig {
constructor() {
/**
* Validate the JSON config
*/
try {
this._jsonConfig = Joi.validate(jsonServerConfig, schema).value;
} catch (e) {
console.error('The config in \'config/server.json\' is not a valid config configuration. Error: ', e);
}
}
get (value) {
return this._jsonConfig[value];
}
}
export default new ServerConfig();
| import Joi from 'joi';
import jsonServerConfig from 'config/server.json';
import schema from './schema.js';
class ServerConfig {
constructor() {
- this._jsonConfig = jsonServerConfig;
-
/**
* Validate the JSON config
*/
try {
- Joi.validate(this._jsonConfig, schema);
+ this._jsonConfig = Joi.validate(jsonServerConfig, schema).value;
} catch (e) {
console.error('The config in \'config/server.json\' is not a valid config configuration. Error: ', e);
}
}
get (value) {
return this._jsonConfig[value];
}
}
export default new ServerConfig(); | 4 | 0.166667 | 1 | 3 |
a612e39f2395aa04bb3fd063188c4a1038324b04 | stock.py | stock.py | class Stock:
def __init__(self, symbol):
self.symbol = symbol
self.price = None
def update(self, timestamp, price):
self.price = price
| class Stock:
def __init__(self, symbol):
self.symbol = symbol
self.price = None
def update(self, timestamp, price):
if price < 0:
raise ValueError("price should not be negative")
self.price = price
| Update update method for negative price exception. | Update update method for negative price exception.
| Python | mit | bsmukasa/stock_alerter | python | ## Code Before:
class Stock:
def __init__(self, symbol):
self.symbol = symbol
self.price = None
def update(self, timestamp, price):
self.price = price
## Instruction:
Update update method for negative price exception.
## Code After:
class Stock:
def __init__(self, symbol):
self.symbol = symbol
self.price = None
def update(self, timestamp, price):
if price < 0:
raise ValueError("price should not be negative")
self.price = price
| class Stock:
def __init__(self, symbol):
self.symbol = symbol
self.price = None
def update(self, timestamp, price):
+ if price < 0:
+ raise ValueError("price should not be negative")
self.price = price | 2 | 0.285714 | 2 | 0 |
436649e73792da529b5418cf1e8cf3cdf72a6e81 | src/utils.js | src/utils.js | import { spawn } from 'child_process'
const MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
// Simple util for calling a child process
export function cmd (string, options = {}) {
const [ cmd, ...args ] = string.split(' ')
return new Promise((resolve, reject) => {
const child = spawn(cmd, args, options)
let data = ''
child.stdout.on('data', buffer => { data += buffer.toString() })
child.stdout.on('end', () => resolve(data))
child.on('error', reject)
})
}
export function niceDate (string) {
const date = new Date(string)
const day = date.getDate()
const month = MONTH_NAMES[date.getMonth()]
const year = date.getFullYear()
return `${day} ${month} ${year}`
}
export function removeIndentation (string) {
return string.replace(/\n +/g, '\n')
}
export function isLink (string) {
return /^http/.test(string)
}
| import { spawn } from 'child_process'
const MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
// Simple util for calling a child process
export function cmd (string) {
const [ cmd, ...args ] = string.split(' ')
return new Promise((resolve, reject) => {
const child = spawn(cmd, args)
let data = ''
child.stdout.on('data', buffer => { data += buffer.toString() })
child.stdout.on('end', () => resolve(data))
child.on('error', reject)
})
}
export function niceDate (string) {
const date = new Date(string)
const day = date.getDate()
const month = MONTH_NAMES[date.getMonth()]
const year = date.getFullYear()
return `${day} ${month} ${year}`
}
export function removeIndentation (string) {
return string.replace(/\n +/g, '\n')
}
export function isLink (string) {
return /^http/.test(string)
}
| Remove unused options param from cmd util | Remove unused options param from cmd util
| JavaScript | mit | CookPete/auto-changelog,CookPete/auto-changelog | javascript | ## Code Before:
import { spawn } from 'child_process'
const MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
// Simple util for calling a child process
export function cmd (string, options = {}) {
const [ cmd, ...args ] = string.split(' ')
return new Promise((resolve, reject) => {
const child = spawn(cmd, args, options)
let data = ''
child.stdout.on('data', buffer => { data += buffer.toString() })
child.stdout.on('end', () => resolve(data))
child.on('error', reject)
})
}
export function niceDate (string) {
const date = new Date(string)
const day = date.getDate()
const month = MONTH_NAMES[date.getMonth()]
const year = date.getFullYear()
return `${day} ${month} ${year}`
}
export function removeIndentation (string) {
return string.replace(/\n +/g, '\n')
}
export function isLink (string) {
return /^http/.test(string)
}
## Instruction:
Remove unused options param from cmd util
## Code After:
import { spawn } from 'child_process'
const MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
// Simple util for calling a child process
export function cmd (string) {
const [ cmd, ...args ] = string.split(' ')
return new Promise((resolve, reject) => {
const child = spawn(cmd, args)
let data = ''
child.stdout.on('data', buffer => { data += buffer.toString() })
child.stdout.on('end', () => resolve(data))
child.on('error', reject)
})
}
export function niceDate (string) {
const date = new Date(string)
const day = date.getDate()
const month = MONTH_NAMES[date.getMonth()]
const year = date.getFullYear()
return `${day} ${month} ${year}`
}
export function removeIndentation (string) {
return string.replace(/\n +/g, '\n')
}
export function isLink (string) {
return /^http/.test(string)
}
| import { spawn } from 'child_process'
const MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
// Simple util for calling a child process
- export function cmd (string, options = {}) {
? --------------
+ export function cmd (string) {
const [ cmd, ...args ] = string.split(' ')
return new Promise((resolve, reject) => {
- const child = spawn(cmd, args, options)
? ---------
+ const child = spawn(cmd, args)
let data = ''
child.stdout.on('data', buffer => { data += buffer.toString() })
child.stdout.on('end', () => resolve(data))
child.on('error', reject)
})
}
export function niceDate (string) {
const date = new Date(string)
const day = date.getDate()
const month = MONTH_NAMES[date.getMonth()]
const year = date.getFullYear()
return `${day} ${month} ${year}`
}
export function removeIndentation (string) {
return string.replace(/\n +/g, '\n')
}
export function isLink (string) {
return /^http/.test(string)
} | 4 | 0.125 | 2 | 2 |
3196853a02a0eacc5b5f452fdd18d926b928559e | straw-ios-service-http-spec.js | straw-ios-service-http-spec.js | /* global straw, describe, it, chai */
var expect = chai.expect;
describe('straw.service.http', function () {
'use strict';
it('is a object', function () {
expect(straw.service.http).to.be.a('object');
});
describe('get', function () {
it('is a function', function () {
expect(straw.service.http.get).to.be.a('function');
});
});
});
| /* global straw, describe, it, chai, sinon */
var expect = chai.expect;
describe('straw.service.http', function () {
'use strict';
it('is a object', function () {
expect(straw.service.http).to.be.a('object');
});
describe('.get', function () {
it('is a function', function () {
expect(straw.service.http.get).to.be.a('function');
});
it('calls straw.core.serviceCall', function () {
var mock = sinon.mock(straw.core);
mock.expects('serviceCall').once();
straw.service.http.get('http://www.example.com/', {charset: 'utf8', timeout: 3000});
mock.verify();
mock.restore();
});
});
});
| Add the test of get | Add the test of get
| JavaScript | mit | strawjs/straw-ios-service-http.js | javascript | ## Code Before:
/* global straw, describe, it, chai */
var expect = chai.expect;
describe('straw.service.http', function () {
'use strict';
it('is a object', function () {
expect(straw.service.http).to.be.a('object');
});
describe('get', function () {
it('is a function', function () {
expect(straw.service.http.get).to.be.a('function');
});
});
});
## Instruction:
Add the test of get
## Code After:
/* global straw, describe, it, chai, sinon */
var expect = chai.expect;
describe('straw.service.http', function () {
'use strict';
it('is a object', function () {
expect(straw.service.http).to.be.a('object');
});
describe('.get', function () {
it('is a function', function () {
expect(straw.service.http.get).to.be.a('function');
});
it('calls straw.core.serviceCall', function () {
var mock = sinon.mock(straw.core);
mock.expects('serviceCall').once();
straw.service.http.get('http://www.example.com/', {charset: 'utf8', timeout: 3000});
mock.verify();
mock.restore();
});
});
});
| - /* global straw, describe, it, chai */
+ /* global straw, describe, it, chai, sinon */
? +++++++
var expect = chai.expect;
describe('straw.service.http', function () {
'use strict';
it('is a object', function () {
expect(straw.service.http).to.be.a('object');
});
- describe('get', function () {
+ describe('.get', function () {
? +
it('is a function', function () {
expect(straw.service.http.get).to.be.a('function');
});
+ it('calls straw.core.serviceCall', function () {
+
+ var mock = sinon.mock(straw.core);
+ mock.expects('serviceCall').once();
+
+ straw.service.http.get('http://www.example.com/', {charset: 'utf8', timeout: 3000});
+
+ mock.verify();
+ mock.restore();
+
+ });
+
});
}); | 16 | 0.761905 | 14 | 2 |
7a47d27709c5f0fb12a31b04cf81b7b90c5dd3bb | EDMGen.html | EDMGen.html | <script src="js/genEDM.js"> </script>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<div style="margin: 20%">
<h1> EDM Generator (under construction)</h1>
<div> [HUMOR] Generates any number of names in the style of EDM artist names </div>
<h4> Number of Names </h4>
<div>
<input id="number" type="number" name="number of names" min="1" max="10">
<button type="button" onclick="generateEDM()"> Generate names! </button>
</div>
<div style="padding-top: 30px">
<p id="edmout"> </p>
</div>
</div>
| <script src="js/genEDM.js"> </script>
<div style="margin: 20%">
<h1> EDM Generator (under construction)</h1>
<div> [HUMOR] Generates any number of names in the style of EDM artist names </div>
<h4> Number of Names </h4>
<div>
<input id="number" type="number" name="number of names" min="1" max="10">
<button type="button" onclick="generateEDM()"> Generate names! </button>
</div>
<div style="padding-top: 30px">
<p id="edmout"> </p>
</div>
</div>
| Fix charm breaking on edm site | Fix charm breaking on edm site
| HTML | mit | techlover10/techlover10.github.io,techlover10/techlover10.github.io | html | ## Code Before:
<script src="js/genEDM.js"> </script>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<div style="margin: 20%">
<h1> EDM Generator (under construction)</h1>
<div> [HUMOR] Generates any number of names in the style of EDM artist names </div>
<h4> Number of Names </h4>
<div>
<input id="number" type="number" name="number of names" min="1" max="10">
<button type="button" onclick="generateEDM()"> Generate names! </button>
</div>
<div style="padding-top: 30px">
<p id="edmout"> </p>
</div>
</div>
## Instruction:
Fix charm breaking on edm site
## Code After:
<script src="js/genEDM.js"> </script>
<div style="margin: 20%">
<h1> EDM Generator (under construction)</h1>
<div> [HUMOR] Generates any number of names in the style of EDM artist names </div>
<h4> Number of Names </h4>
<div>
<input id="number" type="number" name="number of names" min="1" max="10">
<button type="button" onclick="generateEDM()"> Generate names! </button>
</div>
<div style="padding-top: 30px">
<p id="edmout"> </p>
</div>
</div>
| <script src="js/genEDM.js"> </script>
- <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<div style="margin: 20%">
<h1> EDM Generator (under construction)</h1>
<div> [HUMOR] Generates any number of names in the style of EDM artist names </div>
<h4> Number of Names </h4>
<div>
<input id="number" type="number" name="number of names" min="1" max="10">
<button type="button" onclick="generateEDM()"> Generate names! </button>
</div>
<div style="padding-top: 30px">
<p id="edmout"> </p>
</div>
</div> | 1 | 0.071429 | 0 | 1 |
25abed8e1a6d5326690db34cc87a1a9e99acbca1 | build/build_afl.sh | build/build_afl.sh | pushd $(dirname "$0") >/dev/null
BUILD_DIR="`pwd`"
popd >/dev/null
cd $BUILD_DIR
# require afl 1.83b
AFL_URL="http://lcamtuf.coredump.cx/afl/releases/afl-1.83b.tgz"
ARCHIVE="`basename -- "$AFL_URL"`"
wget -O "$ARCHIVE" -- "$AFL_URL" || exit 1
rm -rf "afl-1.83b" || exit 1
tar xf "$ARCHIVE" || exit 1
# apply the driller patch
cd afl-1.83b
patch afl-fuzz.c < ../../patches/driller-afl.patch
patch qemu_mode/build_qemu_support.sh < ../../patches/driller-afl-qemu-mode.patch
make -j
cd qemu_mode
./build_qemu_support.sh
cd ..
cp afl-fuzz ../../driller-afl-fuzz
echo "All done!"
| pushd $(dirname "$0") >/dev/null
BUILD_DIR="`pwd`"
popd >/dev/null
cd $BUILD_DIR
# require afl 1.83b
VERS="1.83b"
AFL_URL="http://lcamtuf.coredump.cx/afl/releases/afl-$VERS.tgz"
ARCHIVE="`basename -- "$AFL_URL"`"
wget -O "$ARCHIVE" -- "$AFL_URL" || exit 1
rm -rf "afl-$VERS" || exit 1
tar xf "$ARCHIVE" || exit 1
# apply the driller patch
cd afl-$VERS
patch afl-fuzz.c < ../../patches/driller-afl.patch
patch qemu_mode/build_qemu_support.sh < ../../patches/driller-afl-qemu-mode.patch
make -j
cd qemu_mode
./build_qemu_support.sh
cd ..
cp afl-fuzz ../../driller-afl-fuzz
cd ..
ln -s afl-$VERS afl
echo "All done!"
| Put afl version number into an environment variable and soft link the afl build directory to 'afl' | Put afl version number into an environment variable and soft link the afl build directory to 'afl'
| Shell | bsd-2-clause | shellphish/driller | shell | ## Code Before:
pushd $(dirname "$0") >/dev/null
BUILD_DIR="`pwd`"
popd >/dev/null
cd $BUILD_DIR
# require afl 1.83b
AFL_URL="http://lcamtuf.coredump.cx/afl/releases/afl-1.83b.tgz"
ARCHIVE="`basename -- "$AFL_URL"`"
wget -O "$ARCHIVE" -- "$AFL_URL" || exit 1
rm -rf "afl-1.83b" || exit 1
tar xf "$ARCHIVE" || exit 1
# apply the driller patch
cd afl-1.83b
patch afl-fuzz.c < ../../patches/driller-afl.patch
patch qemu_mode/build_qemu_support.sh < ../../patches/driller-afl-qemu-mode.patch
make -j
cd qemu_mode
./build_qemu_support.sh
cd ..
cp afl-fuzz ../../driller-afl-fuzz
echo "All done!"
## Instruction:
Put afl version number into an environment variable and soft link the afl build directory to 'afl'
## Code After:
pushd $(dirname "$0") >/dev/null
BUILD_DIR="`pwd`"
popd >/dev/null
cd $BUILD_DIR
# require afl 1.83b
VERS="1.83b"
AFL_URL="http://lcamtuf.coredump.cx/afl/releases/afl-$VERS.tgz"
ARCHIVE="`basename -- "$AFL_URL"`"
wget -O "$ARCHIVE" -- "$AFL_URL" || exit 1
rm -rf "afl-$VERS" || exit 1
tar xf "$ARCHIVE" || exit 1
# apply the driller patch
cd afl-$VERS
patch afl-fuzz.c < ../../patches/driller-afl.patch
patch qemu_mode/build_qemu_support.sh < ../../patches/driller-afl-qemu-mode.patch
make -j
cd qemu_mode
./build_qemu_support.sh
cd ..
cp afl-fuzz ../../driller-afl-fuzz
cd ..
ln -s afl-$VERS afl
echo "All done!"
| pushd $(dirname "$0") >/dev/null
BUILD_DIR="`pwd`"
popd >/dev/null
cd $BUILD_DIR
# require afl 1.83b
+ VERS="1.83b"
- AFL_URL="http://lcamtuf.coredump.cx/afl/releases/afl-1.83b.tgz"
? ^^^^^
+ AFL_URL="http://lcamtuf.coredump.cx/afl/releases/afl-$VERS.tgz"
? ^^^^^
ARCHIVE="`basename -- "$AFL_URL"`"
wget -O "$ARCHIVE" -- "$AFL_URL" || exit 1
- rm -rf "afl-1.83b" || exit 1
? ^^^^^
+ rm -rf "afl-$VERS" || exit 1
? ^^^^^
tar xf "$ARCHIVE" || exit 1
# apply the driller patch
- cd afl-1.83b
+ cd afl-$VERS
patch afl-fuzz.c < ../../patches/driller-afl.patch
patch qemu_mode/build_qemu_support.sh < ../../patches/driller-afl-qemu-mode.patch
make -j
cd qemu_mode
./build_qemu_support.sh
cd ..
cp afl-fuzz ../../driller-afl-fuzz
+ cd ..
+ ln -s afl-$VERS afl
+
echo "All done!" | 10 | 0.333333 | 7 | 3 |
411ac9be4931ab8c3d46baf82c9d9230fb60a091 | src/pericles/routes.clj | src/pericles/routes.clj | (ns pericles.routes
(:require [compojure.core :refer :all]
[compojure.route :as route]
[compojure.coercions :refer [as-int]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.util.http-response :as resp]
[gpio.core :as gpio]
[pericles.gpio :refer [port]]
[pericles.handlers :as handlers]))
(defroutes api-routes
(GET "/" [] "Hello world!")
(GET "/readPort" [] (name (gpio/read-value @port)))
(GET "/writePort" [value :<< as-int]
(do
(gpio/write-value! @port value)
(name (gpio/read-value @port))))
(GET "/readTemp" [] "27C")
(route/not-found "Not found!"))
(def app (-> #'api-routes
(wrap-defaults (assoc api-defaults :static {:resources "public"}))
handlers/wrap-catch-exceptions
handlers/wrap-log-request))
| (ns pericles.routes
(:require [compojure.core :refer :all]
[compojure.route :as route]
[compojure.coercions :refer [as-int]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.util.http-response :as resp]
[gpio.core :as gpio]
[pericles.gpio :refer [port]]
[pericles.handlers :as handlers]))
(defroutes api-routes
(GET "/" [] (resp/found "/index.html"))
(GET "/readPort" [] (name (gpio/read-value @port)))
(GET "/writePort" [value :<< as-int]
(do
(gpio/write-value! @port value)
(name (gpio/read-value @port))))
(GET "/readTemp" [] "27C")
(route/not-found "Not found!"))
(def app (-> #'api-routes
(wrap-defaults (assoc api-defaults :static {:resources "public"}))
handlers/wrap-catch-exceptions
handlers/wrap-log-request))
| Read port on load; Redirect / to index.html | Read port on load; Redirect / to index.html
| Clojure | epl-1.0 | dimitrijer/pericles,dimitrijer/pericles | clojure | ## Code Before:
(ns pericles.routes
(:require [compojure.core :refer :all]
[compojure.route :as route]
[compojure.coercions :refer [as-int]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.util.http-response :as resp]
[gpio.core :as gpio]
[pericles.gpio :refer [port]]
[pericles.handlers :as handlers]))
(defroutes api-routes
(GET "/" [] "Hello world!")
(GET "/readPort" [] (name (gpio/read-value @port)))
(GET "/writePort" [value :<< as-int]
(do
(gpio/write-value! @port value)
(name (gpio/read-value @port))))
(GET "/readTemp" [] "27C")
(route/not-found "Not found!"))
(def app (-> #'api-routes
(wrap-defaults (assoc api-defaults :static {:resources "public"}))
handlers/wrap-catch-exceptions
handlers/wrap-log-request))
## Instruction:
Read port on load; Redirect / to index.html
## Code After:
(ns pericles.routes
(:require [compojure.core :refer :all]
[compojure.route :as route]
[compojure.coercions :refer [as-int]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.util.http-response :as resp]
[gpio.core :as gpio]
[pericles.gpio :refer [port]]
[pericles.handlers :as handlers]))
(defroutes api-routes
(GET "/" [] (resp/found "/index.html"))
(GET "/readPort" [] (name (gpio/read-value @port)))
(GET "/writePort" [value :<< as-int]
(do
(gpio/write-value! @port value)
(name (gpio/read-value @port))))
(GET "/readTemp" [] "27C")
(route/not-found "Not found!"))
(def app (-> #'api-routes
(wrap-defaults (assoc api-defaults :static {:resources "public"}))
handlers/wrap-catch-exceptions
handlers/wrap-log-request))
| (ns pericles.routes
(:require [compojure.core :refer :all]
[compojure.route :as route]
[compojure.coercions :refer [as-int]]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]
[ring.util.http-response :as resp]
[gpio.core :as gpio]
[pericles.gpio :refer [port]]
[pericles.handlers :as handlers]))
(defroutes api-routes
- (GET "/" [] "Hello world!")
+ (GET "/" [] (resp/found "/index.html"))
(GET "/readPort" [] (name (gpio/read-value @port)))
(GET "/writePort" [value :<< as-int]
(do
(gpio/write-value! @port value)
(name (gpio/read-value @port))))
(GET "/readTemp" [] "27C")
(route/not-found "Not found!"))
(def app (-> #'api-routes
(wrap-defaults (assoc api-defaults :static {:resources "public"}))
handlers/wrap-catch-exceptions
handlers/wrap-log-request)) | 2 | 0.083333 | 1 | 1 |
b2b1c2b8543cae37990262b2a811a9b0f26327da | arm/utils/locker.py | arm/utils/locker.py | from kvs import CacheKvs
class Locker(object):
"""
locker for move the locker
"""
LOCKER_KEY = 'locker'
EXPIRES = 5 # 5 sec
def __init__(self, key=None):
self.key = self.LOCKER_KEY
if key:
self.key += '.{}'.format(key)
self.locker = CacheKvs(self.key)
def lock(self):
self.locker.set('locked', expires=self.EXPIRES, nx=True)
def unlock(self):
self.locker.delete()
def is_lock(self):
return self.locker.get() == 'locked'
def on_lock(self, func):
def wrapper(*args, **kwargs):
if self.is_lock():
return
self.lock()
try:
return func(*args, **kwargs)
except Exception as e:
raise e
finally:
self.unlock()
return wrapper
| from kvs import CacheKvs
class Locker(object):
"""
locker for move the locker
"""
LOCKER_KEY = 'locker'
EXPIRES = 5 # 5 sec
def __init__(self, key=None):
self.key = self.LOCKER_KEY
if key:
self.key += '.{}'.format(key)
self.locker = CacheKvs(self.key)
def lock(self):
self.locker.set('locked', expires=self.EXPIRES, nx=True)
def unlock(self):
self.locker.delete()
def is_lock(self):
return self.locker.get() == 'locked'
def on_lock(self, func):
def wrapper(*args, **kwargs):
if self.lock():
try:
return func(*args, **kwargs)
except Exception as e:
raise e
finally:
self.unlock()
return wrapper
| Fix redis lock, use SETNX | Fix redis lock, use SETNX
| Python | mit | mapler/tuesday,mapler/tuesday,mapler/tuesday | python | ## Code Before:
from kvs import CacheKvs
class Locker(object):
"""
locker for move the locker
"""
LOCKER_KEY = 'locker'
EXPIRES = 5 # 5 sec
def __init__(self, key=None):
self.key = self.LOCKER_KEY
if key:
self.key += '.{}'.format(key)
self.locker = CacheKvs(self.key)
def lock(self):
self.locker.set('locked', expires=self.EXPIRES, nx=True)
def unlock(self):
self.locker.delete()
def is_lock(self):
return self.locker.get() == 'locked'
def on_lock(self, func):
def wrapper(*args, **kwargs):
if self.is_lock():
return
self.lock()
try:
return func(*args, **kwargs)
except Exception as e:
raise e
finally:
self.unlock()
return wrapper
## Instruction:
Fix redis lock, use SETNX
## Code After:
from kvs import CacheKvs
class Locker(object):
"""
locker for move the locker
"""
LOCKER_KEY = 'locker'
EXPIRES = 5 # 5 sec
def __init__(self, key=None):
self.key = self.LOCKER_KEY
if key:
self.key += '.{}'.format(key)
self.locker = CacheKvs(self.key)
def lock(self):
self.locker.set('locked', expires=self.EXPIRES, nx=True)
def unlock(self):
self.locker.delete()
def is_lock(self):
return self.locker.get() == 'locked'
def on_lock(self, func):
def wrapper(*args, **kwargs):
if self.lock():
try:
return func(*args, **kwargs)
except Exception as e:
raise e
finally:
self.unlock()
return wrapper
| from kvs import CacheKvs
class Locker(object):
"""
locker for move the locker
"""
LOCKER_KEY = 'locker'
EXPIRES = 5 # 5 sec
def __init__(self, key=None):
self.key = self.LOCKER_KEY
if key:
self.key += '.{}'.format(key)
self.locker = CacheKvs(self.key)
def lock(self):
self.locker.set('locked', expires=self.EXPIRES, nx=True)
def unlock(self):
self.locker.delete()
def is_lock(self):
return self.locker.get() == 'locked'
def on_lock(self, func):
def wrapper(*args, **kwargs):
- if self.is_lock():
? ---
+ if self.lock():
- return
- self.lock()
- try:
+ try:
? ++++
- return func(*args, **kwargs)
+ return func(*args, **kwargs)
? ++++
- except Exception as e:
+ except Exception as e:
? ++++
- raise e
+ raise e
? ++++
- finally:
+ finally:
? ++++
- self.unlock()
+ self.unlock()
? ++++
return wrapper | 16 | 0.421053 | 7 | 9 |
943fda9bf20a2a852d8a6646f4e099f96a800138 | packages/co/core-compiler.yaml | packages/co/core-compiler.yaml | homepage: https://github.com/aneksteind/Core#readme
changelog-type: ''
hash: 6f2ebf9e83fd38492a7add3c71c57e59dbc01eb2034374749d4e0a607e46ae6a
test-bench-deps: {}
maintainer: aneksteind@gmail.com
synopsis: compile your own mini functional language with Core
changelog: ''
basic-deps:
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
array: -any
containers: -any
core-compiler: -any
all-versions:
- '0.1.0.0'
- '0.1.0.1'
author: David Anekstein
latest: '0.1.0.1'
description-type: haddock
description: This package doubles as a compiler and as a module with which anyone
can compile their own functional programming language by parsing into the 'CoreExpr'
datatype
license-name: MIT
| homepage: https://github.com/aneksteind/Core#readme
changelog-type: ''
hash: ecbee79cdeef270e2718b4c12a5b0d1ee9cacd0350e564d8326efdb5082c7e13
test-bench-deps: {}
maintainer: aneksteind@gmail.com
synopsis: compile your own mini functional language with Core
changelog: ''
basic-deps:
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
array: -any
containers: -any
core-compiler: -any
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.0.2'
author: David Anekstein
latest: '0.1.0.2'
description-type: haddock
description: This package doubles as a compiler and as a module with which anyone
can compile their own functional programming language by parsing into the 'CoreExpr'
datatype
license-name: MIT
| Update from Hackage at 2017-08-06T01:02:07Z | Update from Hackage at 2017-08-06T01:02:07Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/aneksteind/Core#readme
changelog-type: ''
hash: 6f2ebf9e83fd38492a7add3c71c57e59dbc01eb2034374749d4e0a607e46ae6a
test-bench-deps: {}
maintainer: aneksteind@gmail.com
synopsis: compile your own mini functional language with Core
changelog: ''
basic-deps:
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
array: -any
containers: -any
core-compiler: -any
all-versions:
- '0.1.0.0'
- '0.1.0.1'
author: David Anekstein
latest: '0.1.0.1'
description-type: haddock
description: This package doubles as a compiler and as a module with which anyone
can compile their own functional programming language by parsing into the 'CoreExpr'
datatype
license-name: MIT
## Instruction:
Update from Hackage at 2017-08-06T01:02:07Z
## Code After:
homepage: https://github.com/aneksteind/Core#readme
changelog-type: ''
hash: ecbee79cdeef270e2718b4c12a5b0d1ee9cacd0350e564d8326efdb5082c7e13
test-bench-deps: {}
maintainer: aneksteind@gmail.com
synopsis: compile your own mini functional language with Core
changelog: ''
basic-deps:
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
array: -any
containers: -any
core-compiler: -any
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.0.2'
author: David Anekstein
latest: '0.1.0.2'
description-type: haddock
description: This package doubles as a compiler and as a module with which anyone
can compile their own functional programming language by parsing into the 'CoreExpr'
datatype
license-name: MIT
| homepage: https://github.com/aneksteind/Core#readme
changelog-type: ''
- hash: 6f2ebf9e83fd38492a7add3c71c57e59dbc01eb2034374749d4e0a607e46ae6a
+ hash: ecbee79cdeef270e2718b4c12a5b0d1ee9cacd0350e564d8326efdb5082c7e13
test-bench-deps: {}
maintainer: aneksteind@gmail.com
synopsis: compile your own mini functional language with Core
changelog: ''
basic-deps:
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
array: -any
containers: -any
core-compiler: -any
all-versions:
- '0.1.0.0'
- '0.1.0.1'
+ - '0.1.0.2'
author: David Anekstein
- latest: '0.1.0.1'
? ^
+ latest: '0.1.0.2'
? ^
description-type: haddock
description: This package doubles as a compiler and as a module with which anyone
can compile their own functional programming language by parsing into the 'CoreExpr'
datatype
license-name: MIT | 5 | 0.208333 | 3 | 2 |
b4473d45ba5925551334762bc02708fcb373c957 | config.py | config.py | CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False
}
| CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False,
'page_size': 100
}
| Add page size for sql query | Add page size for sql query
| Python | mit | goodwinxp/ATFGenerator,goodwinxp/ATFGenerator,goodwinxp/ATFGenerator | python | ## Code Before:
CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False
}
## Instruction:
Add page size for sql query
## Code After:
CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
'verbose': False,
'page_size': 100
}
| CONFIG = {
'database': './ida_info.sqlite3',
'out_dir': './code_gen/',
- 'verbose': False
+ 'verbose': False,
? +
+ 'page_size': 100
} | 3 | 0.6 | 2 | 1 |
8e0d174cc74fee170bb2749e51f8e14057b48996 | app/assets/stylesheets/global/_site-header.scss | app/assets/stylesheets/global/_site-header.scss | .site-header {
.container {
@media (min-width: $grid-float-breakpoint) and (max-width: $screen-md-max) {
width: 100%;
}
}
form[role="search"] {
// restrict width of search form to avoid nav-bar wrapping
@media (min-width: $grid-float-breakpoint) and (max-width: 67em) {
width: 13em;
}
}
}
// override bootstrap default height, which
// is too short for our content.
.navbar-fixed-top .navbar-collapse {
max-height: 420px;
}
.help .glyphicon-new-window {
font-size: 70%;
}
| .site-header {
.container {
@media (min-width: $grid-float-breakpoint) and (max-width: $screen-md-max) {
width: 100%;
}
}
}
// override bootstrap default height, which
// is too short for our content.
.navbar-fixed-top .navbar-collapse {
max-height: 420px;
}
.help .glyphicon-new-window {
font-size: 70%;
}
| Remove CSS that restricted the search box size | Remove CSS that restricted the search box size
It seems we don't need to worry about restricting the size now that we
have more room.
| SCSS | agpl-3.0 | otherchirps/morph,otherchirps/morph,openaustralia/morph,otherchirps/morph,openaustralia/morph,openaustralia/morph,otherchirps/morph,openaustralia/morph,otherchirps/morph,otherchirps/morph,otherchirps/morph,openaustralia/morph,openaustralia/morph,openaustralia/morph | scss | ## Code Before:
.site-header {
.container {
@media (min-width: $grid-float-breakpoint) and (max-width: $screen-md-max) {
width: 100%;
}
}
form[role="search"] {
// restrict width of search form to avoid nav-bar wrapping
@media (min-width: $grid-float-breakpoint) and (max-width: 67em) {
width: 13em;
}
}
}
// override bootstrap default height, which
// is too short for our content.
.navbar-fixed-top .navbar-collapse {
max-height: 420px;
}
.help .glyphicon-new-window {
font-size: 70%;
}
## Instruction:
Remove CSS that restricted the search box size
It seems we don't need to worry about restricting the size now that we
have more room.
## Code After:
.site-header {
.container {
@media (min-width: $grid-float-breakpoint) and (max-width: $screen-md-max) {
width: 100%;
}
}
}
// override bootstrap default height, which
// is too short for our content.
.navbar-fixed-top .navbar-collapse {
max-height: 420px;
}
.help .glyphicon-new-window {
font-size: 70%;
}
| .site-header {
.container {
@media (min-width: $grid-float-breakpoint) and (max-width: $screen-md-max) {
width: 100%;
- }
- }
-
- form[role="search"] {
- // restrict width of search form to avoid nav-bar wrapping
- @media (min-width: $grid-float-breakpoint) and (max-width: 67em) {
- width: 13em;
}
}
}
// override bootstrap default height, which
// is too short for our content.
.navbar-fixed-top .navbar-collapse {
max-height: 420px;
}
.help .glyphicon-new-window {
font-size: 70%;
} | 7 | 0.291667 | 0 | 7 |
f346650c733d1f4775dc5dfb280565c207e3211e | src/utils/validators.ts | src/utils/validators.ts | import * as _ from 'lodash';
import * as moment from 'moment';
import { badRequest } from 'boom';
import * as Joi from 'joi';
namespace schemas {
export const username = Joi.string().token().empty().min(2).max(20).label('Username');
export const password = Joi.string().empty().min(1).label('Password');
export const user = Joi.object().keys({ username, password }).options({ stripUnknown: true }).label('User');
export const transactionAmount = Joi.number().precision(2).label('Transaction amount');
export const groupName = Joi.string().min(4).max(255).label('Group name');
export const alternativeLoginKey = Joi.string().empty().label('Alternative login key');
export const timestamp = Joi.date().label('Timestamp');
}
function validateSchema<T>(schema: Joi.Schema, value: T): T {
const result = schema.validate(value);
if (result.error) {
throw badRequest(result.error.message, result.error.details);
}
return result.value;
}
export default {
user: _.partial(validateSchema, schemas.user),
username: _.partial(validateSchema, schemas.username),
password: _.partial(validateSchema, schemas.password),
transactionAmount: _.partial(validateSchema, schemas.transactionAmount),
groupName: _.partial(validateSchema, schemas.groupName),
alternativeLoginKey: _.partial(validateSchema, schemas.alternativeLoginKey),
timestamp: (time: any): moment.Moment => moment(validateSchema(schemas.timestamp, time)).utc(),
};
| import * as _ from 'lodash';
import * as moment from 'moment';
import { badRequest } from 'boom';
import * as Joi from 'joi';
namespace schemas {
export const username = Joi.string().token().empty().min(2).max(20).label('Username');
export const password = Joi.string().empty().min(1).label('Password');
export const user = Joi.object().keys({ username, password }).options({ stripUnknown: true }).label('User');
export const transactionAmount = Joi.number().precision(2).min(-1e+6).max(1e+6).label('Transaction amount');
export const groupName = Joi.string().min(4).max(255).label('Group name');
export const alternativeLoginKey = Joi.string().empty().label('Alternative login key');
export const timestamp = Joi.date().label('Timestamp');
}
function validateSchema<T>(schema: Joi.Schema, value: T): T {
const result = schema.validate(value);
if (result.error) {
throw badRequest(result.error.message, result.error.details);
}
return result.value;
}
export default {
user: _.partial(validateSchema, schemas.user),
username: _.partial(validateSchema, schemas.username),
password: _.partial(validateSchema, schemas.password),
transactionAmount: _.partial(validateSchema, schemas.transactionAmount),
groupName: _.partial(validateSchema, schemas.groupName),
alternativeLoginKey: _.partial(validateSchema, schemas.alternativeLoginKey),
timestamp: (time: any): moment.Moment => moment(validateSchema(schemas.timestamp, time)).utc(),
};
| Set minimum and maximum to transaction amount | Set minimum and maximum to transaction amount
| TypeScript | mit | majori/piikki | typescript | ## Code Before:
import * as _ from 'lodash';
import * as moment from 'moment';
import { badRequest } from 'boom';
import * as Joi from 'joi';
namespace schemas {
export const username = Joi.string().token().empty().min(2).max(20).label('Username');
export const password = Joi.string().empty().min(1).label('Password');
export const user = Joi.object().keys({ username, password }).options({ stripUnknown: true }).label('User');
export const transactionAmount = Joi.number().precision(2).label('Transaction amount');
export const groupName = Joi.string().min(4).max(255).label('Group name');
export const alternativeLoginKey = Joi.string().empty().label('Alternative login key');
export const timestamp = Joi.date().label('Timestamp');
}
function validateSchema<T>(schema: Joi.Schema, value: T): T {
const result = schema.validate(value);
if (result.error) {
throw badRequest(result.error.message, result.error.details);
}
return result.value;
}
export default {
user: _.partial(validateSchema, schemas.user),
username: _.partial(validateSchema, schemas.username),
password: _.partial(validateSchema, schemas.password),
transactionAmount: _.partial(validateSchema, schemas.transactionAmount),
groupName: _.partial(validateSchema, schemas.groupName),
alternativeLoginKey: _.partial(validateSchema, schemas.alternativeLoginKey),
timestamp: (time: any): moment.Moment => moment(validateSchema(schemas.timestamp, time)).utc(),
};
## Instruction:
Set minimum and maximum to transaction amount
## Code After:
import * as _ from 'lodash';
import * as moment from 'moment';
import { badRequest } from 'boom';
import * as Joi from 'joi';
namespace schemas {
export const username = Joi.string().token().empty().min(2).max(20).label('Username');
export const password = Joi.string().empty().min(1).label('Password');
export const user = Joi.object().keys({ username, password }).options({ stripUnknown: true }).label('User');
export const transactionAmount = Joi.number().precision(2).min(-1e+6).max(1e+6).label('Transaction amount');
export const groupName = Joi.string().min(4).max(255).label('Group name');
export const alternativeLoginKey = Joi.string().empty().label('Alternative login key');
export const timestamp = Joi.date().label('Timestamp');
}
function validateSchema<T>(schema: Joi.Schema, value: T): T {
const result = schema.validate(value);
if (result.error) {
throw badRequest(result.error.message, result.error.details);
}
return result.value;
}
export default {
user: _.partial(validateSchema, schemas.user),
username: _.partial(validateSchema, schemas.username),
password: _.partial(validateSchema, schemas.password),
transactionAmount: _.partial(validateSchema, schemas.transactionAmount),
groupName: _.partial(validateSchema, schemas.groupName),
alternativeLoginKey: _.partial(validateSchema, schemas.alternativeLoginKey),
timestamp: (time: any): moment.Moment => moment(validateSchema(schemas.timestamp, time)).utc(),
};
| import * as _ from 'lodash';
import * as moment from 'moment';
import { badRequest } from 'boom';
import * as Joi from 'joi';
namespace schemas {
export const username = Joi.string().token().empty().min(2).max(20).label('Username');
export const password = Joi.string().empty().min(1).label('Password');
export const user = Joi.object().keys({ username, password }).options({ stripUnknown: true }).label('User');
- export const transactionAmount = Joi.number().precision(2).label('Transaction amount');
+ export const transactionAmount = Joi.number().precision(2).min(-1e+6).max(1e+6).label('Transaction amount');
? +++++++++++++++++++++
export const groupName = Joi.string().min(4).max(255).label('Group name');
export const alternativeLoginKey = Joi.string().empty().label('Alternative login key');
export const timestamp = Joi.date().label('Timestamp');
}
function validateSchema<T>(schema: Joi.Schema, value: T): T {
const result = schema.validate(value);
if (result.error) {
throw badRequest(result.error.message, result.error.details);
}
return result.value;
}
export default {
user: _.partial(validateSchema, schemas.user),
username: _.partial(validateSchema, schemas.username),
password: _.partial(validateSchema, schemas.password),
transactionAmount: _.partial(validateSchema, schemas.transactionAmount),
groupName: _.partial(validateSchema, schemas.groupName),
alternativeLoginKey: _.partial(validateSchema, schemas.alternativeLoginKey),
timestamp: (time: any): moment.Moment => moment(validateSchema(schemas.timestamp, time)).utc(),
}; | 2 | 0.058824 | 1 | 1 |
843676b04d11bcbdfd09e24e5e61a3ef6340542d | lib/generators/templates/create_diffit_table.rb | lib/generators/templates/create_diffit_table.rb | class CreateColumnDiffs < ActiveRecord::Migration
def change
create_table :column_diffs do |t|
t.datetime :changed_at
t.string :model_name
t.integer :record_id
t.string :column_name
t.hstore :value
end
add_index :column_diffs, :changed_at
add_index :column_diffs, [:changed_at, :model_name]
add_index :column_diffs, [:model_name, :record_id]
add_index :column_diffs, [:changed_at, :model_name, :record_id]
end
end
| class CreateColumnDiffs < ActiveRecord::Migration
def change
create_table :column_diffs do |t|
t.datetime :changed_at
t.string :table_name
t.integer :record_id
t.string :column_name
t.hstore :value
end
add_index :column_diffs, :changed_at
add_index :column_diffs, [:changed_at, :table_name]
add_index :column_diffs, [:table_name, :record_id]
add_index :column_diffs, [:changed_at, :table_name, :record_id]
end
end
| Rename model_name to table_name in diff table | Rename model_name to table_name in diff table
| Ruby | mit | gazay/diffit,gazay/diffit,gazay/diffit | ruby | ## Code Before:
class CreateColumnDiffs < ActiveRecord::Migration
def change
create_table :column_diffs do |t|
t.datetime :changed_at
t.string :model_name
t.integer :record_id
t.string :column_name
t.hstore :value
end
add_index :column_diffs, :changed_at
add_index :column_diffs, [:changed_at, :model_name]
add_index :column_diffs, [:model_name, :record_id]
add_index :column_diffs, [:changed_at, :model_name, :record_id]
end
end
## Instruction:
Rename model_name to table_name in diff table
## Code After:
class CreateColumnDiffs < ActiveRecord::Migration
def change
create_table :column_diffs do |t|
t.datetime :changed_at
t.string :table_name
t.integer :record_id
t.string :column_name
t.hstore :value
end
add_index :column_diffs, :changed_at
add_index :column_diffs, [:changed_at, :table_name]
add_index :column_diffs, [:table_name, :record_id]
add_index :column_diffs, [:changed_at, :table_name, :record_id]
end
end
| class CreateColumnDiffs < ActiveRecord::Migration
def change
create_table :column_diffs do |t|
t.datetime :changed_at
- t.string :model_name
? ^^^ -
+ t.string :table_name
? ^^^^
t.integer :record_id
t.string :column_name
t.hstore :value
end
add_index :column_diffs, :changed_at
- add_index :column_diffs, [:changed_at, :model_name]
? ^^^ -
+ add_index :column_diffs, [:changed_at, :table_name]
? ^^^^
- add_index :column_diffs, [:model_name, :record_id]
? ^^^ -
+ add_index :column_diffs, [:table_name, :record_id]
? ^^^^
- add_index :column_diffs, [:changed_at, :model_name, :record_id]
? ^^^ -
+ add_index :column_diffs, [:changed_at, :table_name, :record_id]
? ^^^^
end
end | 8 | 0.5 | 4 | 4 |
8d400ef82be7cdde34c1fa88b78b05bc47e9894c | app/views/adhoq/queries/index.html.slim | app/views/adhoq/queries/index.html.slim | .col-md-12
ol.breadcrumb
li.active Index
#queries.col-md-3
section.queries
= render 'queries', queries: @queries
#the-query.col-md-9
= render 'query', query: @queries.first
| .col-md-12
ol.breadcrumb
li.active Index
#queries.col-md-3
section.queries
= render 'queries', queries: @queries
#the-query.col-md-9
- if first_query = @queries.first
= render 'query', query: first_query
| Fix error when no Query record | Fix error when no Query record
| Slim | mit | esminc/adhoq,mataki/adhoq,mataki/adhoq,joker1007/adhoq,joker1007/adhoq,joker1007/adhoq,esminc/adhoq,esminc/adhoq,mataki/adhoq | slim | ## Code Before:
.col-md-12
ol.breadcrumb
li.active Index
#queries.col-md-3
section.queries
= render 'queries', queries: @queries
#the-query.col-md-9
= render 'query', query: @queries.first
## Instruction:
Fix error when no Query record
## Code After:
.col-md-12
ol.breadcrumb
li.active Index
#queries.col-md-3
section.queries
= render 'queries', queries: @queries
#the-query.col-md-9
- if first_query = @queries.first
= render 'query', query: first_query
| .col-md-12
ol.breadcrumb
li.active Index
#queries.col-md-3
section.queries
= render 'queries', queries: @queries
#the-query.col-md-9
+ - if first_query = @queries.first
- = render 'query', query: @queries.first
? ---------
+ = render 'query', query: first_query
? ++ ++++++
| 3 | 0.3 | 2 | 1 |
316c885ff2c13a5f333a5cb2bca31407a9011f00 | package_test/test_testsuite.sh | package_test/test_testsuite.sh |
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone git@github.com:C2SM-RCM/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone git@github.com:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone git@github.com:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
|
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
if [ -z "${ORGANIZATION}" ] ; then
export ORGANIZATION="C2SM-RCM"
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone git@github.com:${ORGANIZATION}/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone git@github.com:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone git@github.com:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
| Add github ORGANIZATION variable to testsuite_test | Add github ORGANIZATION variable to testsuite_test | Shell | bsd-2-clause | C2SM-RCM/buildenv,C2SM-RCM/buildenv | shell | ## Code Before:
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone git@github.com:C2SM-RCM/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone git@github.com:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone git@github.com:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
## Instruction:
Add github ORGANIZATION variable to testsuite_test
## Code After:
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
if [ -z "${ORGANIZATION}" ] ; then
export ORGANIZATION="C2SM-RCM"
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone git@github.com:${ORGANIZATION}/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone git@github.com:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone git@github.com:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
|
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
+ if [ -z "${ORGANIZATION}" ] ; then
+ export ORGANIZATION="C2SM-RCM"
+ fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
- git clone git@github.com:C2SM-RCM/testsuite
? ^^^^^ ^^
+ git clone git@github.com:${ORGANIZATION}/testsuite
? ^^^ ^^^^^^^^^^^
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone git@github.com:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone git@github.com:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
| 5 | 0.131579 | 4 | 1 |
b5c1c67a6b193c3df733f18079b9b822682076f3 | docs/views/layout_unbranded.html | docs/views/layout_unbranded.html | {% extends "template.njk" %}
{% block head %}
<link href="/public/stylesheets/unbranded.css" media="screen" rel="stylesheet" type="text/css">
{% endblock %}
{% block header %}{% endblock %}
{% block footer %}{% endblock %}
{% block body_end %}
{% include "includes/scripts.html" %}
{% endblock %}
| {% extends "template.njk" %}
{% block headIcons %}
<link rel="shortcut icon" href="{{ asset_path }}images/unbranded.ico?0.18.3" type="image/x-icon" />
<link rel="mask-icon" href="{{ asset_path }}images/gov.uk_logotype_crown.svg?0.18.3" color="#0b0c0c">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ asset_path }}images/apple-touch-icon-152x152.png?0.18.3">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ asset_path }}images/apple-touch-icon-120x120.png?0.18.3">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{ asset_path }}images/apple-touch-icon-76x76.png?0.18.3">
<link rel="apple-touch-icon-precomposed" href="{{ asset_path }}images/apple-touch-icon-60x60.png?0.18.3">
{% endblock %}
{% block head %}
<link href="/public/stylesheets/unbranded.css" media="screen" rel="stylesheet" type="text/css">
{% endblock %}
{% block header %}{% endblock %}
{% block footer %}{% endblock %}
{% block body_end %}
{% include "includes/scripts.html" %}
{% endblock %}
| Set custom head icons in unbranded template | Set custom head icons in unbranded template
| HTML | mit | dwpdigitaltech/hrt-prototype,alphagov/govuk_prototype_kit,alphagov/govuk_prototype_kit,alphagov/govuk_prototype_kit,dwpdigitaltech/hrt-prototype,dwpdigitaltech/hrt-prototype | html | ## Code Before:
{% extends "template.njk" %}
{% block head %}
<link href="/public/stylesheets/unbranded.css" media="screen" rel="stylesheet" type="text/css">
{% endblock %}
{% block header %}{% endblock %}
{% block footer %}{% endblock %}
{% block body_end %}
{% include "includes/scripts.html" %}
{% endblock %}
## Instruction:
Set custom head icons in unbranded template
## Code After:
{% extends "template.njk" %}
{% block headIcons %}
<link rel="shortcut icon" href="{{ asset_path }}images/unbranded.ico?0.18.3" type="image/x-icon" />
<link rel="mask-icon" href="{{ asset_path }}images/gov.uk_logotype_crown.svg?0.18.3" color="#0b0c0c">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ asset_path }}images/apple-touch-icon-152x152.png?0.18.3">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ asset_path }}images/apple-touch-icon-120x120.png?0.18.3">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{ asset_path }}images/apple-touch-icon-76x76.png?0.18.3">
<link rel="apple-touch-icon-precomposed" href="{{ asset_path }}images/apple-touch-icon-60x60.png?0.18.3">
{% endblock %}
{% block head %}
<link href="/public/stylesheets/unbranded.css" media="screen" rel="stylesheet" type="text/css">
{% endblock %}
{% block header %}{% endblock %}
{% block footer %}{% endblock %}
{% block body_end %}
{% include "includes/scripts.html" %}
{% endblock %}
| {% extends "template.njk" %}
+
+ {% block headIcons %}
+ <link rel="shortcut icon" href="{{ asset_path }}images/unbranded.ico?0.18.3" type="image/x-icon" />
+ <link rel="mask-icon" href="{{ asset_path }}images/gov.uk_logotype_crown.svg?0.18.3" color="#0b0c0c">
+ <link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ asset_path }}images/apple-touch-icon-152x152.png?0.18.3">
+ <link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ asset_path }}images/apple-touch-icon-120x120.png?0.18.3">
+ <link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{ asset_path }}images/apple-touch-icon-76x76.png?0.18.3">
+ <link rel="apple-touch-icon-precomposed" href="{{ asset_path }}images/apple-touch-icon-60x60.png?0.18.3">
+ {% endblock %}
{% block head %}
<link href="/public/stylesheets/unbranded.css" media="screen" rel="stylesheet" type="text/css">
{% endblock %}
{% block header %}{% endblock %}
{% block footer %}{% endblock %}
{% block body_end %}
{% include "includes/scripts.html" %}
{% endblock %} | 9 | 0.75 | 9 | 0 |
0bc4b35e1ceda5e3c833b20c2a584f13c07def65 | app/ReactiveMap.js | app/ReactiveMap.js | import { default as React, Component } from 'react';
import { render } from 'react-dom';
var helper = require('./helper.js');
export class ReactiveMap extends Component {
constructor(props) {
super(props);
this.appbaseRef = helper.getAppbaseRef(this.props.config);
}
render() {
return false;
}
} | import { default as React, Component } from 'react';
import { render } from 'react-dom';
var helper = require('./helper.js');
export class ReactiveMap extends Component {
constructor(props) {
super(props);
helper.setConfigObject(this.props.config);
}
render() {
return false;
}
} | Set the config object in Reactive Map | Set the config object in Reactive Map
| JavaScript | apache-2.0 | appbaseio/reactive-maps,appbaseio/reactive-maps | javascript | ## Code Before:
import { default as React, Component } from 'react';
import { render } from 'react-dom';
var helper = require('./helper.js');
export class ReactiveMap extends Component {
constructor(props) {
super(props);
this.appbaseRef = helper.getAppbaseRef(this.props.config);
}
render() {
return false;
}
}
## Instruction:
Set the config object in Reactive Map
## Code After:
import { default as React, Component } from 'react';
import { render } from 'react-dom';
var helper = require('./helper.js');
export class ReactiveMap extends Component {
constructor(props) {
super(props);
helper.setConfigObject(this.props.config);
}
render() {
return false;
}
} | import { default as React, Component } from 'react';
import { render } from 'react-dom';
var helper = require('./helper.js');
export class ReactiveMap extends Component {
constructor(props) {
super(props);
- this.appbaseRef = helper.getAppbaseRef(this.props.config);
+ helper.setConfigObject(this.props.config);
}
render() {
return false;
}
} | 2 | 0.133333 | 1 | 1 |
483d62c5d39223424ceb182666b606848d96a681 | rundeckapp/grails-spa/packages/ui-trellis/theme/scss/paper/_view.scss | rundeckapp/grails-spa/packages/ui-trellis/theme/scss/paper/_view.scss | .view {
height: 100vh;
width: 100vw;
overflow: hidden;
display: grid;
grid-template-areas:
"header"
"main"
"utility";
grid-template-rows: min-content 1fr 22px;
grid-template-columns: 1fr;
}
.view > section {
overflow: hidden;
}
#section-header {
position: relative;
overflow: visible;
}
#section-navbar {
overflow: hidden;
background-color: var(--sidebar-background-color);
}
#section-content {
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
#section-main {
display: grid;
grid-template-areas: "content";
grid-template-rows: 1fr;
grid-auto-columns: 1fr;
overflow: hidden;
position: relative;
&.with-project {
grid-template-areas: "nav content";
grid-auto-columns: 65px 1fr;
}
}
#section-utility {
position: relative;
box-shadow: 0px -1px 0px #DADADA;
}
#loginpage {
height: 100vh;
width: 100vw;
overflow: hidden;
} | .view {
height: 100vh;
width: 100vw;
overflow: hidden;
display: grid;
grid-template-areas:
"header"
"main"
"utility";
grid-template-rows: min-content 1fr 22px;
grid-template-columns: 1fr;
}
.view > section {
overflow: hidden;
}
#section-header {
position: relative;
z-index: 3;
overflow: visible;
}
#section-navbar {
overflow: hidden;
background-color: var(--sidebar-background-color);
}
#section-content {
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
#section-main {
display: grid;
z-index: 1;
grid-template-areas: "content";
grid-template-rows: 1fr;
grid-auto-columns: 1fr;
overflow: hidden;
position: relative;
&.with-project {
grid-template-areas: "nav content";
grid-auto-columns: 65px 1fr;
}
}
#section-utility {
position: relative;
z-index: 2;
box-shadow: 0px -1px 0px #DADADA;
}
#loginpage {
height: 100vh;
width: 100vw;
overflow: hidden;
} | Adjust zindex so bars are above main area | Adjust zindex so bars are above main area
| SCSS | apache-2.0 | rundeck/rundeck,rundeck/rundeck,rundeck/rundeck,variacode/rundeck,variacode/rundeck,rundeck/rundeck,rundeck/rundeck,variacode/rundeck,variacode/rundeck,variacode/rundeck | scss | ## Code Before:
.view {
height: 100vh;
width: 100vw;
overflow: hidden;
display: grid;
grid-template-areas:
"header"
"main"
"utility";
grid-template-rows: min-content 1fr 22px;
grid-template-columns: 1fr;
}
.view > section {
overflow: hidden;
}
#section-header {
position: relative;
overflow: visible;
}
#section-navbar {
overflow: hidden;
background-color: var(--sidebar-background-color);
}
#section-content {
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
#section-main {
display: grid;
grid-template-areas: "content";
grid-template-rows: 1fr;
grid-auto-columns: 1fr;
overflow: hidden;
position: relative;
&.with-project {
grid-template-areas: "nav content";
grid-auto-columns: 65px 1fr;
}
}
#section-utility {
position: relative;
box-shadow: 0px -1px 0px #DADADA;
}
#loginpage {
height: 100vh;
width: 100vw;
overflow: hidden;
}
## Instruction:
Adjust zindex so bars are above main area
## Code After:
.view {
height: 100vh;
width: 100vw;
overflow: hidden;
display: grid;
grid-template-areas:
"header"
"main"
"utility";
grid-template-rows: min-content 1fr 22px;
grid-template-columns: 1fr;
}
.view > section {
overflow: hidden;
}
#section-header {
position: relative;
z-index: 3;
overflow: visible;
}
#section-navbar {
overflow: hidden;
background-color: var(--sidebar-background-color);
}
#section-content {
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
#section-main {
display: grid;
z-index: 1;
grid-template-areas: "content";
grid-template-rows: 1fr;
grid-auto-columns: 1fr;
overflow: hidden;
position: relative;
&.with-project {
grid-template-areas: "nav content";
grid-auto-columns: 65px 1fr;
}
}
#section-utility {
position: relative;
z-index: 2;
box-shadow: 0px -1px 0px #DADADA;
}
#loginpage {
height: 100vh;
width: 100vw;
overflow: hidden;
} | .view {
height: 100vh;
width: 100vw;
overflow: hidden;
display: grid;
grid-template-areas:
"header"
"main"
"utility";
grid-template-rows: min-content 1fr 22px;
grid-template-columns: 1fr;
}
.view > section {
overflow: hidden;
}
#section-header {
position: relative;
+ z-index: 3;
overflow: visible;
}
#section-navbar {
overflow: hidden;
background-color: var(--sidebar-background-color);
}
#section-content {
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
#section-main {
display: grid;
+ z-index: 1;
grid-template-areas: "content";
grid-template-rows: 1fr;
grid-auto-columns: 1fr;
overflow: hidden;
position: relative;
&.with-project {
grid-template-areas: "nav content";
grid-auto-columns: 65px 1fr;
}
}
#section-utility {
position: relative;
+ z-index: 2;
box-shadow: 0px -1px 0px #DADADA;
}
#loginpage {
height: 100vh;
width: 100vw;
overflow: hidden;
} | 3 | 0.04918 | 3 | 0 |
7245ec3088f760f70bc165b0af3571870e1aac0f | README.md | README.md |
The UI Extensions SDK is a JavaScript library that allows developers to create custom UI Extensions
for the Contentful Web App. Every UI Extension has to include the library in its source.
## Resources
- [UI Extensions general documentation](https://www.contentful.com/developers/docs/extensibility/ui-extensions/)
- [UI Extensions SDK reference](https://www.contentful.com/developers/docs/extensibility/ui-extensions/sdk-reference/)
- [UI Extensions Management HTTP API reference](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions)
- [UI Extensions FAQ](https://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/)
- [Contentful Extensions repository](https://github.com/contentful/extensions)
- [Contentful Marketplace](https://www.contentful.com/developers/marketplace/)
- [Contentful Changelog](https://www.contentful.com/developers/changelog/)
- [Forma 36: The Contentful Design System](https://f36.contentful.com/)
- [`contentful-ui-extensions-sdk` at npm](https://www.npmjs.com/package/contentful-ui-extensions-sdk)
## Getting help
Technical questions, feedback or feature request can be provided directly through the Github issues
for this repository. However, if you are a paying customer or at any point business sensitive
information needs to be discussed, then the conversation should be handled via our
[support system](https://www.contentful.com/support/).
|
The UI Extensions SDK is a JavaScript library that allows developers to create custom UI Extensions
for the Contentful Web App. Every UI Extension has to include the library in its source.
## Resources
- [UI Extensions general documentation](https://www.contentful.com/developers/docs/extensibility/ui-extensions/)
- [UI Extensions SDK reference](https://www.contentful.com/developers/docs/extensibility/ui-extensions/sdk-reference/)
- [UI Extensions Management HTTP API reference](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions)
- [UI Extensions FAQ](https://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/)
- [Contentful Extensions repository](https://github.com/contentful/extensions)
- [Contentful Marketplace](https://www.contentful.com/developers/marketplace/)
- [Contentful Changelog](https://www.contentful.com/developers/changelog/)
- [Forma 36: The Contentful Design System](https://f36.contentful.com/)
- [Forma 36 guide for UI Extensions](https://www.contentful.com/developers/docs/extensibility/ui-extensions/component-library/)
- [`contentful-ui-extensions-sdk` at npm](https://www.npmjs.com/package/contentful-ui-extensions-sdk)
## Getting help
Technical questions, feedback or feature request can be provided directly through the Github issues
for this repository. However, if you are a paying customer or at any point business sensitive
information needs to be discussed, then the conversation should be handled via our
[support system](https://www.contentful.com/support/).
| Add a link for Forma guide | Add a link for Forma guide
| Markdown | mit | contentful/widget-sdk | markdown | ## Code Before:
The UI Extensions SDK is a JavaScript library that allows developers to create custom UI Extensions
for the Contentful Web App. Every UI Extension has to include the library in its source.
## Resources
- [UI Extensions general documentation](https://www.contentful.com/developers/docs/extensibility/ui-extensions/)
- [UI Extensions SDK reference](https://www.contentful.com/developers/docs/extensibility/ui-extensions/sdk-reference/)
- [UI Extensions Management HTTP API reference](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions)
- [UI Extensions FAQ](https://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/)
- [Contentful Extensions repository](https://github.com/contentful/extensions)
- [Contentful Marketplace](https://www.contentful.com/developers/marketplace/)
- [Contentful Changelog](https://www.contentful.com/developers/changelog/)
- [Forma 36: The Contentful Design System](https://f36.contentful.com/)
- [`contentful-ui-extensions-sdk` at npm](https://www.npmjs.com/package/contentful-ui-extensions-sdk)
## Getting help
Technical questions, feedback or feature request can be provided directly through the Github issues
for this repository. However, if you are a paying customer or at any point business sensitive
information needs to be discussed, then the conversation should be handled via our
[support system](https://www.contentful.com/support/).
## Instruction:
Add a link for Forma guide
## Code After:
The UI Extensions SDK is a JavaScript library that allows developers to create custom UI Extensions
for the Contentful Web App. Every UI Extension has to include the library in its source.
## Resources
- [UI Extensions general documentation](https://www.contentful.com/developers/docs/extensibility/ui-extensions/)
- [UI Extensions SDK reference](https://www.contentful.com/developers/docs/extensibility/ui-extensions/sdk-reference/)
- [UI Extensions Management HTTP API reference](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions)
- [UI Extensions FAQ](https://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/)
- [Contentful Extensions repository](https://github.com/contentful/extensions)
- [Contentful Marketplace](https://www.contentful.com/developers/marketplace/)
- [Contentful Changelog](https://www.contentful.com/developers/changelog/)
- [Forma 36: The Contentful Design System](https://f36.contentful.com/)
- [Forma 36 guide for UI Extensions](https://www.contentful.com/developers/docs/extensibility/ui-extensions/component-library/)
- [`contentful-ui-extensions-sdk` at npm](https://www.npmjs.com/package/contentful-ui-extensions-sdk)
## Getting help
Technical questions, feedback or feature request can be provided directly through the Github issues
for this repository. However, if you are a paying customer or at any point business sensitive
information needs to be discussed, then the conversation should be handled via our
[support system](https://www.contentful.com/support/).
|
The UI Extensions SDK is a JavaScript library that allows developers to create custom UI Extensions
for the Contentful Web App. Every UI Extension has to include the library in its source.
## Resources
- [UI Extensions general documentation](https://www.contentful.com/developers/docs/extensibility/ui-extensions/)
- [UI Extensions SDK reference](https://www.contentful.com/developers/docs/extensibility/ui-extensions/sdk-reference/)
- [UI Extensions Management HTTP API reference](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/ui-extensions)
- [UI Extensions FAQ](https://www.contentful.com/developers/docs/extensibility/ui-extensions/faq/)
- [Contentful Extensions repository](https://github.com/contentful/extensions)
- [Contentful Marketplace](https://www.contentful.com/developers/marketplace/)
- [Contentful Changelog](https://www.contentful.com/developers/changelog/)
- [Forma 36: The Contentful Design System](https://f36.contentful.com/)
+ - [Forma 36 guide for UI Extensions](https://www.contentful.com/developers/docs/extensibility/ui-extensions/component-library/)
- [`contentful-ui-extensions-sdk` at npm](https://www.npmjs.com/package/contentful-ui-extensions-sdk)
## Getting help
Technical questions, feedback or feature request can be provided directly through the Github issues
for this repository. However, if you are a paying customer or at any point business sensitive
information needs to be discussed, then the conversation should be handled via our
[support system](https://www.contentful.com/support/). | 1 | 0.045455 | 1 | 0 |
85e99b82e4db8653661f02307dd2a70cc655ed9a | test/controllers/transition_landing_page_controller_test.rb | test/controllers/transition_landing_page_controller_test.rb | require "test_helper"
describe TransitionLandingPageController do
include TaxonHelpers
include GovukAbTesting::MinitestHelpers
describe "GET show" do
before do
brexit_taxon = taxon
brexit_taxon["base_path"] = "/transition"
stub_content_store_has_item(brexit_taxon["base_path"], brexit_taxon)
stub_content_store_has_item(brexit_taxon["base_path"] + ".cy", brexit_taxon)
end
%w[cy en].each do |locale|
params = locale == "en" ? {} : { locale: locale }
it "renders the page for the #{locale} locale" do
get :show, params: params
assert_response :success
end
end
end
end
| require "test_helper"
describe TransitionLandingPageController do
include TaxonHelpers
include GovukAbTesting::MinitestHelpers
describe "GET show" do
before do
brexit_taxon = taxon
brexit_taxon["base_path"] = "/transition"
stub_content_store_has_item(brexit_taxon["base_path"], brexit_taxon)
stub_content_store_has_item(brexit_taxon["base_path"] + ".cy", brexit_taxon)
end
%w[cy en].each do |locale|
params = locale == "en" ? {} : { locale: locale }
it "renders the page for the #{locale} locale" do
get :show, params: params
assert_response :success
end
end
describe "accounts are enabled" do
before do
Rails.configuration.stubs(:feature_flag_govuk_accounts).returns(true)
end
%w[LoggedIn LoggedOut].each do |variant|
it "Variant #{variant} disables the search field" do
with_variant AccountExperiment: variant do
get :show
assert_equal "true", response.headers["X-Slimmer-Remove-Search"]
end
end
end
it "Variant LoggedIn requests the signed-in header" do
with_variant AccountExperiment: "LoggedIn" do
get :show
assert_equal "signed-in", response.headers["X-Slimmer-Show-Accounts"]
end
end
it "Variant LoggedOut requests the signed-out header" do
with_variant AccountExperiment: "LoggedOut" do
get :show
assert_equal "signed-out", response.headers["X-Slimmer-Show-Accounts"]
end
end
end
end
end
| Add tests for accounts A/B test | Add tests for accounts A/B test
| Ruby | mit | alphagov/collections,alphagov/collections,alphagov/collections,alphagov/collections | ruby | ## Code Before:
require "test_helper"
describe TransitionLandingPageController do
include TaxonHelpers
include GovukAbTesting::MinitestHelpers
describe "GET show" do
before do
brexit_taxon = taxon
brexit_taxon["base_path"] = "/transition"
stub_content_store_has_item(brexit_taxon["base_path"], brexit_taxon)
stub_content_store_has_item(brexit_taxon["base_path"] + ".cy", brexit_taxon)
end
%w[cy en].each do |locale|
params = locale == "en" ? {} : { locale: locale }
it "renders the page for the #{locale} locale" do
get :show, params: params
assert_response :success
end
end
end
end
## Instruction:
Add tests for accounts A/B test
## Code After:
require "test_helper"
describe TransitionLandingPageController do
include TaxonHelpers
include GovukAbTesting::MinitestHelpers
describe "GET show" do
before do
brexit_taxon = taxon
brexit_taxon["base_path"] = "/transition"
stub_content_store_has_item(brexit_taxon["base_path"], brexit_taxon)
stub_content_store_has_item(brexit_taxon["base_path"] + ".cy", brexit_taxon)
end
%w[cy en].each do |locale|
params = locale == "en" ? {} : { locale: locale }
it "renders the page for the #{locale} locale" do
get :show, params: params
assert_response :success
end
end
describe "accounts are enabled" do
before do
Rails.configuration.stubs(:feature_flag_govuk_accounts).returns(true)
end
%w[LoggedIn LoggedOut].each do |variant|
it "Variant #{variant} disables the search field" do
with_variant AccountExperiment: variant do
get :show
assert_equal "true", response.headers["X-Slimmer-Remove-Search"]
end
end
end
it "Variant LoggedIn requests the signed-in header" do
with_variant AccountExperiment: "LoggedIn" do
get :show
assert_equal "signed-in", response.headers["X-Slimmer-Show-Accounts"]
end
end
it "Variant LoggedOut requests the signed-out header" do
with_variant AccountExperiment: "LoggedOut" do
get :show
assert_equal "signed-out", response.headers["X-Slimmer-Show-Accounts"]
end
end
end
end
end
| require "test_helper"
describe TransitionLandingPageController do
include TaxonHelpers
include GovukAbTesting::MinitestHelpers
describe "GET show" do
before do
brexit_taxon = taxon
brexit_taxon["base_path"] = "/transition"
stub_content_store_has_item(brexit_taxon["base_path"], brexit_taxon)
stub_content_store_has_item(brexit_taxon["base_path"] + ".cy", brexit_taxon)
end
%w[cy en].each do |locale|
params = locale == "en" ? {} : { locale: locale }
it "renders the page for the #{locale} locale" do
get :show, params: params
assert_response :success
end
end
+
+ describe "accounts are enabled" do
+ before do
+ Rails.configuration.stubs(:feature_flag_govuk_accounts).returns(true)
+ end
+
+ %w[LoggedIn LoggedOut].each do |variant|
+ it "Variant #{variant} disables the search field" do
+ with_variant AccountExperiment: variant do
+ get :show
+ assert_equal "true", response.headers["X-Slimmer-Remove-Search"]
+ end
+ end
+ end
+
+ it "Variant LoggedIn requests the signed-in header" do
+ with_variant AccountExperiment: "LoggedIn" do
+ get :show
+ assert_equal "signed-in", response.headers["X-Slimmer-Show-Accounts"]
+ end
+ end
+
+ it "Variant LoggedOut requests the signed-out header" do
+ with_variant AccountExperiment: "LoggedOut" do
+ get :show
+ assert_equal "signed-out", response.headers["X-Slimmer-Show-Accounts"]
+ end
+ end
+ end
end
end | 29 | 1.208333 | 29 | 0 |
57a494f94d8550a9539c2008ae626cfe9bddaaf9 | tools/webpack.assets.json | tools/webpack.assets.json | {
"activity": "./static/third/sorttable/sorttable.js",
"portico": [
"./static/js/portico/header.js"
],
"common": [
"string.prototype.startswith",
"./node_modules/jquery/dist/jquery.js",
"./node_modules/underscore/underscore.js",
"./static/js/blueslip.js",
"./static/third/bootstrap/js/bootstrap.js",
"./static/js/common.js",
"./node_modules/moment/min/moment.min.js",
"./node_modules/moment-timezone/builds/moment-timezone-with-data.min.js"
],
"help": [
"./node_modules/perfect-scrollbar/dist/perfect-scrollbar.js",
"./static/js/portico/help.js"
],
"katex": "./node_modules/katex/dist/katex.min.js",
"landing-page": "./static/js/portico/landing-page.js",
"integrations": "./static/js/portico/integrations.js",
"signup": [
"./static/js/portico/signup.js",
"./node_modules/jquery-validation/dist/jquery.validate.min.js"
],
"stats": [
"./static/js/stats/stats.js",
"./node_modules/plotly.js/dist/plotly-basic.min.js"
],
"translations": "./static/js/translations.js",
"zxcvbn": "./node_modules/zxcvbn/dist/zxcvbn.js"
}
| {
"activity": "./static/third/sorttable/sorttable.js",
"portico": [
"./static/js/portico/header.js"
],
"common": [
"string.prototype.startswith",
"string.prototype.codepointat",
"./node_modules/jquery/dist/jquery.js",
"./node_modules/underscore/underscore.js",
"./static/js/blueslip.js",
"./static/third/bootstrap/js/bootstrap.js",
"./static/js/common.js",
"./node_modules/moment/min/moment.min.js",
"./node_modules/moment-timezone/builds/moment-timezone-with-data.min.js"
],
"help": [
"./node_modules/perfect-scrollbar/dist/perfect-scrollbar.js",
"./static/js/portico/help.js"
],
"katex": "./node_modules/katex/dist/katex.min.js",
"landing-page": "./static/js/portico/landing-page.js",
"integrations": "./static/js/portico/integrations.js",
"signup": [
"./static/js/portico/signup.js",
"./node_modules/jquery-validation/dist/jquery.validate.min.js"
],
"stats": [
"./static/js/stats/stats.js",
"./node_modules/plotly.js/dist/plotly-basic.min.js"
],
"translations": "./static/js/translations.js",
"zxcvbn": "./node_modules/zxcvbn/dist/zxcvbn.js"
}
| Add codepointat polyfill to `common` entry point. | browser-support: Add codepointat polyfill to `common` entry point.
Adds string.prototype.codepointat which was added as a polyfill
earlier to the project but was not added to `common` entry point.
| JSON | apache-2.0 | eeshangarg/zulip,zulip/zulip,andersk/zulip,tommyip/zulip,punchagan/zulip,showell/zulip,synicalsyntax/zulip,eeshangarg/zulip,hackerkid/zulip,rht/zulip,tommyip/zulip,punchagan/zulip,timabbott/zulip,timabbott/zulip,showell/zulip,zulip/zulip,kou/zulip,dhcrzf/zulip,punchagan/zulip,shubhamdhama/zulip,synicalsyntax/zulip,tommyip/zulip,rht/zulip,rishig/zulip,timabbott/zulip,zulip/zulip,tommyip/zulip,andersk/zulip,dhcrzf/zulip,timabbott/zulip,rishig/zulip,showell/zulip,showell/zulip,jackrzhang/zulip,rht/zulip,kou/zulip,rht/zulip,rht/zulip,rishig/zulip,eeshangarg/zulip,brainwane/zulip,shubhamdhama/zulip,punchagan/zulip,zulip/zulip,rishig/zulip,rht/zulip,jackrzhang/zulip,hackerkid/zulip,brainwane/zulip,shubhamdhama/zulip,punchagan/zulip,eeshangarg/zulip,shubhamdhama/zulip,jackrzhang/zulip,tommyip/zulip,kou/zulip,dhcrzf/zulip,kou/zulip,punchagan/zulip,zulip/zulip,brainwane/zulip,timabbott/zulip,brainwane/zulip,showell/zulip,andersk/zulip,brainwane/zulip,kou/zulip,hackerkid/zulip,shubhamdhama/zulip,eeshangarg/zulip,tommyip/zulip,dhcrzf/zulip,rishig/zulip,shubhamdhama/zulip,zulip/zulip,hackerkid/zulip,timabbott/zulip,rishig/zulip,dhcrzf/zulip,hackerkid/zulip,hackerkid/zulip,eeshangarg/zulip,andersk/zulip,dhcrzf/zulip,andersk/zulip,timabbott/zulip,showell/zulip,kou/zulip,kou/zulip,tommyip/zulip,jackrzhang/zulip,synicalsyntax/zulip,eeshangarg/zulip,hackerkid/zulip,showell/zulip,shubhamdhama/zulip,rishig/zulip,brainwane/zulip,jackrzhang/zulip,synicalsyntax/zulip,brainwane/zulip,andersk/zulip,synicalsyntax/zulip,zulip/zulip,jackrzhang/zulip,rht/zulip,punchagan/zulip,synicalsyntax/zulip,jackrzhang/zulip,andersk/zulip,synicalsyntax/zulip,dhcrzf/zulip | json | ## Code Before:
{
"activity": "./static/third/sorttable/sorttable.js",
"portico": [
"./static/js/portico/header.js"
],
"common": [
"string.prototype.startswith",
"./node_modules/jquery/dist/jquery.js",
"./node_modules/underscore/underscore.js",
"./static/js/blueslip.js",
"./static/third/bootstrap/js/bootstrap.js",
"./static/js/common.js",
"./node_modules/moment/min/moment.min.js",
"./node_modules/moment-timezone/builds/moment-timezone-with-data.min.js"
],
"help": [
"./node_modules/perfect-scrollbar/dist/perfect-scrollbar.js",
"./static/js/portico/help.js"
],
"katex": "./node_modules/katex/dist/katex.min.js",
"landing-page": "./static/js/portico/landing-page.js",
"integrations": "./static/js/portico/integrations.js",
"signup": [
"./static/js/portico/signup.js",
"./node_modules/jquery-validation/dist/jquery.validate.min.js"
],
"stats": [
"./static/js/stats/stats.js",
"./node_modules/plotly.js/dist/plotly-basic.min.js"
],
"translations": "./static/js/translations.js",
"zxcvbn": "./node_modules/zxcvbn/dist/zxcvbn.js"
}
## Instruction:
browser-support: Add codepointat polyfill to `common` entry point.
Adds string.prototype.codepointat which was added as a polyfill
earlier to the project but was not added to `common` entry point.
## Code After:
{
"activity": "./static/third/sorttable/sorttable.js",
"portico": [
"./static/js/portico/header.js"
],
"common": [
"string.prototype.startswith",
"string.prototype.codepointat",
"./node_modules/jquery/dist/jquery.js",
"./node_modules/underscore/underscore.js",
"./static/js/blueslip.js",
"./static/third/bootstrap/js/bootstrap.js",
"./static/js/common.js",
"./node_modules/moment/min/moment.min.js",
"./node_modules/moment-timezone/builds/moment-timezone-with-data.min.js"
],
"help": [
"./node_modules/perfect-scrollbar/dist/perfect-scrollbar.js",
"./static/js/portico/help.js"
],
"katex": "./node_modules/katex/dist/katex.min.js",
"landing-page": "./static/js/portico/landing-page.js",
"integrations": "./static/js/portico/integrations.js",
"signup": [
"./static/js/portico/signup.js",
"./node_modules/jquery-validation/dist/jquery.validate.min.js"
],
"stats": [
"./static/js/stats/stats.js",
"./node_modules/plotly.js/dist/plotly-basic.min.js"
],
"translations": "./static/js/translations.js",
"zxcvbn": "./node_modules/zxcvbn/dist/zxcvbn.js"
}
| {
"activity": "./static/third/sorttable/sorttable.js",
"portico": [
"./static/js/portico/header.js"
],
"common": [
"string.prototype.startswith",
+ "string.prototype.codepointat",
"./node_modules/jquery/dist/jquery.js",
"./node_modules/underscore/underscore.js",
"./static/js/blueslip.js",
"./static/third/bootstrap/js/bootstrap.js",
"./static/js/common.js",
"./node_modules/moment/min/moment.min.js",
"./node_modules/moment-timezone/builds/moment-timezone-with-data.min.js"
],
"help": [
"./node_modules/perfect-scrollbar/dist/perfect-scrollbar.js",
"./static/js/portico/help.js"
],
"katex": "./node_modules/katex/dist/katex.min.js",
"landing-page": "./static/js/portico/landing-page.js",
"integrations": "./static/js/portico/integrations.js",
"signup": [
"./static/js/portico/signup.js",
"./node_modules/jquery-validation/dist/jquery.validate.min.js"
],
"stats": [
"./static/js/stats/stats.js",
"./node_modules/plotly.js/dist/plotly-basic.min.js"
],
"translations": "./static/js/translations.js",
"zxcvbn": "./node_modules/zxcvbn/dist/zxcvbn.js"
} | 1 | 0.030303 | 1 | 0 |
6ba0e4a593b214f3cfdecdd5923e0e33f0b174f0 | server/src/pages/homepage/controller.js | server/src/pages/homepage/controller.js | /* globals Mozilla */
const page = require("./page").page;
let model;
exports.launch = function(m) {
model = m;
render();
};
function render() {
page.render(model);
}
document.addEventListener("addon-present", () => {
if (location.hash === "#hello") {
document.dispatchEvent(new CustomEvent("request-onboarding"));
} else if (location.hash === "#tour") {
try {
Mozilla.UITour.showHighlight("screenshots");
} catch (e) {
console.warn("Attempted to start #tour on non-Firefox version or unsupported version");
throw e;
}
}
});
document.dispatchEvent(new CustomEvent("request-addon-present"));
window.controller = exports;
| /* globals Mozilla */
const page = require("./page").page;
let model;
exports.launch = function(m) {
model = m;
render();
};
function render() {
page.render(model);
}
document.addEventListener("addon-present", () => {
if (location.hash === "#hello") {
document.dispatchEvent(new CustomEvent("request-onboarding"));
} else if (location.hash === "#tour") {
try {
if (typeof Mozilla == "undefined") {
// The UITour-lib.js library hasn't loaded yet
let count = 10;
let interval = setInterval(() => {
if (typeof Mozilla == "undefined") {
count--;
if (count <= 0) {
clearTimeout(interval);
throw new Error("UITour-lib.js didn't load up after 1 second");
}
return;
}
Mozilla.UITour.showHighlight("screenshots");
}, 100);
} else {
Mozilla.UITour.showHighlight("screenshots");
}
} catch (e) {
console.warn("Attempted to start #tour on non-Firefox version or unsupported version");
throw e;
}
}
});
document.dispatchEvent(new CustomEvent("request-addon-present"));
window.controller = exports;
| Fix bug when UITour-lib.js loads after homepage-bundle.js | Fix bug when UITour-lib.js loads after homepage-bundle.js
The UITour-lib.js library is loaded async, and the homepage-bundle can potentially load and run before it (we saw this in Sentry). This puts in a 1 second retry when that happens.
| JavaScript | mpl-2.0 | mozilla-services/pageshot,mozilla-services/screenshots,mozilla-services/pageshot,mozilla-services/pageshot,mozilla-services/screenshots,mozilla-services/screenshots,mozilla-services/pageshot,mozilla-services/screenshots | javascript | ## Code Before:
/* globals Mozilla */
const page = require("./page").page;
let model;
exports.launch = function(m) {
model = m;
render();
};
function render() {
page.render(model);
}
document.addEventListener("addon-present", () => {
if (location.hash === "#hello") {
document.dispatchEvent(new CustomEvent("request-onboarding"));
} else if (location.hash === "#tour") {
try {
Mozilla.UITour.showHighlight("screenshots");
} catch (e) {
console.warn("Attempted to start #tour on non-Firefox version or unsupported version");
throw e;
}
}
});
document.dispatchEvent(new CustomEvent("request-addon-present"));
window.controller = exports;
## Instruction:
Fix bug when UITour-lib.js loads after homepage-bundle.js
The UITour-lib.js library is loaded async, and the homepage-bundle can potentially load and run before it (we saw this in Sentry). This puts in a 1 second retry when that happens.
## Code After:
/* globals Mozilla */
const page = require("./page").page;
let model;
exports.launch = function(m) {
model = m;
render();
};
function render() {
page.render(model);
}
document.addEventListener("addon-present", () => {
if (location.hash === "#hello") {
document.dispatchEvent(new CustomEvent("request-onboarding"));
} else if (location.hash === "#tour") {
try {
if (typeof Mozilla == "undefined") {
// The UITour-lib.js library hasn't loaded yet
let count = 10;
let interval = setInterval(() => {
if (typeof Mozilla == "undefined") {
count--;
if (count <= 0) {
clearTimeout(interval);
throw new Error("UITour-lib.js didn't load up after 1 second");
}
return;
}
Mozilla.UITour.showHighlight("screenshots");
}, 100);
} else {
Mozilla.UITour.showHighlight("screenshots");
}
} catch (e) {
console.warn("Attempted to start #tour on non-Firefox version or unsupported version");
throw e;
}
}
});
document.dispatchEvent(new CustomEvent("request-addon-present"));
window.controller = exports;
| /* globals Mozilla */
const page = require("./page").page;
let model;
exports.launch = function(m) {
model = m;
render();
};
function render() {
page.render(model);
}
document.addEventListener("addon-present", () => {
if (location.hash === "#hello") {
document.dispatchEvent(new CustomEvent("request-onboarding"));
} else if (location.hash === "#tour") {
try {
+ if (typeof Mozilla == "undefined") {
+ // The UITour-lib.js library hasn't loaded yet
+ let count = 10;
+ let interval = setInterval(() => {
+ if (typeof Mozilla == "undefined") {
+ count--;
+ if (count <= 0) {
+ clearTimeout(interval);
+ throw new Error("UITour-lib.js didn't load up after 1 second");
+ }
+ return;
+ }
+ Mozilla.UITour.showHighlight("screenshots");
+ }, 100);
+ } else {
- Mozilla.UITour.showHighlight("screenshots");
+ Mozilla.UITour.showHighlight("screenshots");
? ++
+ }
} catch (e) {
console.warn("Attempted to start #tour on non-Firefox version or unsupported version");
throw e;
}
}
});
document.dispatchEvent(new CustomEvent("request-addon-present"));
window.controller = exports; | 18 | 0.6 | 17 | 1 |
083e928a4b8260b92646fe2ce14a34b6e67c8bb4 | app/initializers/clock-service.js | app/initializers/clock-service.js | // Based on "Continous Redrawing of Objects"
// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/
//
// #pulse is updated every ~15-seconds
//
var ClockService = Ember.Object.extend({
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
Ember.run.later(function () {
var minutes = clock.get('_minutes');
if (typeof minutes === 'number') {
clock.set('_minutes', minutes + (1/4));
}
}, 15000);
}.observes('_minutes').on('init'),
_minutes: 0
});
var ClockServiceInitializer = {
name: "clock-service",
initialize: function(container, application) {
container.register('clock:service', ClockService, { singleton: true });
application.inject('view', 'clock', 'clock:service');
}
};
export default ClockServiceInitializer;
| // Based on "Continous Redrawing of Objects"
// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/
//
// #pulse is updated every ~15-seconds
//
var ClockService = Ember.Object.extend({
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
// This should be the idiomatic `Ember.run.later` but that
// blocks acceptance tests. This is a workaround from
// https://github.com/emberjs/ember.js/issues/3008
setTimeout(function() {
Em.run(function() {
var minutes = clock.get('_minutes');
if (typeof minutes === 'number') {
clock.set('_minutes', minutes + (1/4));
}
})
}, 15000);
}.observes('_minutes').on('init'),
_minutes: 0
});
var ClockServiceInitializer = {
name: "clock-service",
initialize: function(container, application) {
container.register('clock:service', ClockService, { singleton: true });
application.inject('view', 'clock', 'clock:service');
}
};
export default ClockServiceInitializer;
| Fix for stalling acceptance tests. | Fix for stalling acceptance tests.
| JavaScript | mit | substantial/substantial-dash-client | javascript | ## Code Before:
// Based on "Continous Redrawing of Objects"
// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/
//
// #pulse is updated every ~15-seconds
//
var ClockService = Ember.Object.extend({
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
Ember.run.later(function () {
var minutes = clock.get('_minutes');
if (typeof minutes === 'number') {
clock.set('_minutes', minutes + (1/4));
}
}, 15000);
}.observes('_minutes').on('init'),
_minutes: 0
});
var ClockServiceInitializer = {
name: "clock-service",
initialize: function(container, application) {
container.register('clock:service', ClockService, { singleton: true });
application.inject('view', 'clock', 'clock:service');
}
};
export default ClockServiceInitializer;
## Instruction:
Fix for stalling acceptance tests.
## Code After:
// Based on "Continous Redrawing of Objects"
// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/
//
// #pulse is updated every ~15-seconds
//
var ClockService = Ember.Object.extend({
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
// This should be the idiomatic `Ember.run.later` but that
// blocks acceptance tests. This is a workaround from
// https://github.com/emberjs/ember.js/issues/3008
setTimeout(function() {
Em.run(function() {
var minutes = clock.get('_minutes');
if (typeof minutes === 'number') {
clock.set('_minutes', minutes + (1/4));
}
})
}, 15000);
}.observes('_minutes').on('init'),
_minutes: 0
});
var ClockServiceInitializer = {
name: "clock-service",
initialize: function(container, application) {
container.register('clock:service', ClockService, { singleton: true });
application.inject('view', 'clock', 'clock:service');
}
};
export default ClockServiceInitializer;
| // Based on "Continous Redrawing of Objects"
// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/
//
// #pulse is updated every ~15-seconds
//
var ClockService = Ember.Object.extend({
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
+ // This should be the idiomatic `Ember.run.later` but that
+ // blocks acceptance tests. This is a workaround from
+ // https://github.com/emberjs/ember.js/issues/3008
+ setTimeout(function() {
- Ember.run.later(function () {
? --- ------ -
+ Em.run(function() {
? ++
- var minutes = clock.get('_minutes');
+ var minutes = clock.get('_minutes');
? ++
- if (typeof minutes === 'number') {
+ if (typeof minutes === 'number') {
? ++
- clock.set('_minutes', minutes + (1/4));
+ clock.set('_minutes', minutes + (1/4));
? ++
+ }
- }
+ })
? +
}, 15000);
}.observes('_minutes').on('init'),
_minutes: 0
});
var ClockServiceInitializer = {
name: "clock-service",
initialize: function(container, application) {
container.register('clock:service', ClockService, { singleton: true });
application.inject('view', 'clock', 'clock:service');
}
};
export default ClockServiceInitializer; | 15 | 0.517241 | 10 | 5 |
5fee3028e3b4ca43ffc3d1d2b3465b678a8f7fd5 | configs/emacs.d/pkgs/pkg-idris.el | configs/emacs.d/pkgs/pkg-idris.el | (use-package idris-mode
:ensure t
)
(provide 'pkg-idris)
| (use-package idris-mode
:ensure t
:init
(custom-set-faces
'(idris-semantic-bound-face ((t (:foreground "#fe8019"))))
'(idris-semantic-data-face ((t (:foreground "#8ec07c"))))
'(idris-semantic-function-face ((t (:foreground "#d3869b"))))
'(idris-semantic-implicit-face ((t (:foreground "#303030"))))
;; '(idris-semantic-module-face ((t (:foreground "#"))))
;; '(idris-semantic-namespace-face ((t (:foreground "#"))))
'(idris-semantic-postulate-face ((t (:foreground "#98971a"))))
'(idris-semantic-type-face ((t (:foreground "#458588"))))
)
)
(provide 'pkg-idris)
| Fix type faces of idris-mode | Fix type faces of idris-mode
| Emacs Lisp | mit | noraesae/dotfiles,noraesae/dotfiles,noraesae/dotfiles | emacs-lisp | ## Code Before:
(use-package idris-mode
:ensure t
)
(provide 'pkg-idris)
## Instruction:
Fix type faces of idris-mode
## Code After:
(use-package idris-mode
:ensure t
:init
(custom-set-faces
'(idris-semantic-bound-face ((t (:foreground "#fe8019"))))
'(idris-semantic-data-face ((t (:foreground "#8ec07c"))))
'(idris-semantic-function-face ((t (:foreground "#d3869b"))))
'(idris-semantic-implicit-face ((t (:foreground "#303030"))))
;; '(idris-semantic-module-face ((t (:foreground "#"))))
;; '(idris-semantic-namespace-face ((t (:foreground "#"))))
'(idris-semantic-postulate-face ((t (:foreground "#98971a"))))
'(idris-semantic-type-face ((t (:foreground "#458588"))))
)
)
(provide 'pkg-idris)
| (use-package idris-mode
:ensure t
+ :init
+ (custom-set-faces
+ '(idris-semantic-bound-face ((t (:foreground "#fe8019"))))
+ '(idris-semantic-data-face ((t (:foreground "#8ec07c"))))
+ '(idris-semantic-function-face ((t (:foreground "#d3869b"))))
+ '(idris-semantic-implicit-face ((t (:foreground "#303030"))))
+ ;; '(idris-semantic-module-face ((t (:foreground "#"))))
+ ;; '(idris-semantic-namespace-face ((t (:foreground "#"))))
+ '(idris-semantic-postulate-face ((t (:foreground "#98971a"))))
+ '(idris-semantic-type-face ((t (:foreground "#458588"))))
+ )
)
(provide 'pkg-idris) | 11 | 2.2 | 11 | 0 |
ac4ba28e3b3c221f378edb2d0abbc8cc77a8eae4 | src/libmv/multiview/panography_coeffs.py | src/libmv/multiview/panography_coeffs.py | import sympy
f2, a12, a1, a2, b12, b1, b2 = sympy.symbols('f2 a12 a1 a2 b12 b1 b2')
# Equation 12 from the brown paper; see panography.h
equation_12 = ((a12 + f2)**2 * (b1 + f2) * (b2 + f2) -
(b12 + f2)**2 * (a1 + f2) * (a2 + f2))
d = equation_12.as_poly(f2).as_dict()
print ' // Coefficients in ascending powers of alpha, i.e. P[N]*x^N.'
print ' double P[4] = {'
for i in range(4):
print ' ', sympy.printing.ccode(d[(i,)])
print ' }'
|
import sympy
f2, a12, a1, a2, b12, b1, b2 = sympy.symbols('f2 a12 a1 a2 b12 b1 b2')
# Equation 12 from the brown paper; see panography.h
equation_12 = ((a12 + f2)**2 * (b1 + f2) * (b2 + f2) -
(b12 + f2)**2 * (a1 + f2) * (a2 + f2))
d = equation_12.as_poly(f2).as_dict()
print ' // Coefficients in ascending powers of alpha, i.e. P[N]*x^N.'
print ' double P[4] = {'
for i in range(4):
print ' ', sympy.printing.ccode(d[(i,)])
print ' }'
# As long as Python code do not return the correct value
# I prefer use "Xcas Computer Algebra System"
# http://www-fourier.ujf-grenoble.fr/~parisse/giac.html
# Solution for the focal length of a pair of images from a rotating camera.
# comment(" Define the base equation that share the Focal length 'f' ")
# FocalSolver:=(a12+f)^2 / (( a1+f)*(a2+f)) - (b12+f)^2 / ((b1+f)*(b2+f));
# comment(" Solve equation=0 with the unknow 'f' ")
# solve(FocalSolver=0,f);
| Add xcas source code to obtain panography shared Focal polynomial solver. | Add xcas source code to obtain panography shared Focal polynomial solver. | Python | mit | leoujz/libmv,Shinohara-Takayuki/libmv,tanmengwen/libmv,KangKyungSoo/libmv,jackyspeed/libmv,Ashwinning/libmv,Shinohara-Takayuki/libmv,jackyspeed/libmv,manjunathnarayana/libmv,manjunathnarayana/libmv,KangKyungSoo/libmv,leoujz/libmv,hjm168168/libmv,jackyspeed/libmv,Shinohara-Takayuki/libmv,sanyaade-g2g-repos/libmv,tanmengwen/libmv,guivi01/libmv,Danath/libmv,manjunathnarayana/libmv,sanyaade-g2g-repos/libmv,Ashwinning/libmv,tanmengwen/libmv,jackyspeed/libmv,hjm168168/libmv,sanyaade-g2g-repos/libmv,pombreda/libmv,hjm168168/libmv,KangKyungSoo/libmv,KangKyungSoo/libmv,Ashwinning/libmv,Danath/libmv,tanmengwen/libmv,guivi01/libmv,guivi01/libmv,pombreda/libmv,Danath/libmv,sanyaade-g2g-repos/libmv,pombreda/libmv,hjm168168/libmv,manjunathnarayana/libmv,leoujz/libmv,leoujz/libmv,Ashwinning/libmv,Shinohara-Takayuki/libmv,guivi01/libmv,Danath/libmv,pombreda/libmv | python | ## Code Before:
import sympy
f2, a12, a1, a2, b12, b1, b2 = sympy.symbols('f2 a12 a1 a2 b12 b1 b2')
# Equation 12 from the brown paper; see panography.h
equation_12 = ((a12 + f2)**2 * (b1 + f2) * (b2 + f2) -
(b12 + f2)**2 * (a1 + f2) * (a2 + f2))
d = equation_12.as_poly(f2).as_dict()
print ' // Coefficients in ascending powers of alpha, i.e. P[N]*x^N.'
print ' double P[4] = {'
for i in range(4):
print ' ', sympy.printing.ccode(d[(i,)])
print ' }'
## Instruction:
Add xcas source code to obtain panography shared Focal polynomial solver.
## Code After:
import sympy
f2, a12, a1, a2, b12, b1, b2 = sympy.symbols('f2 a12 a1 a2 b12 b1 b2')
# Equation 12 from the brown paper; see panography.h
equation_12 = ((a12 + f2)**2 * (b1 + f2) * (b2 + f2) -
(b12 + f2)**2 * (a1 + f2) * (a2 + f2))
d = equation_12.as_poly(f2).as_dict()
print ' // Coefficients in ascending powers of alpha, i.e. P[N]*x^N.'
print ' double P[4] = {'
for i in range(4):
print ' ', sympy.printing.ccode(d[(i,)])
print ' }'
# As long as Python code do not return the correct value
# I prefer use "Xcas Computer Algebra System"
# http://www-fourier.ujf-grenoble.fr/~parisse/giac.html
# Solution for the focal length of a pair of images from a rotating camera.
# comment(" Define the base equation that share the Focal length 'f' ")
# FocalSolver:=(a12+f)^2 / (( a1+f)*(a2+f)) - (b12+f)^2 / ((b1+f)*(b2+f));
# comment(" Solve equation=0 with the unknow 'f' ")
# solve(FocalSolver=0,f);
| +
import sympy
f2, a12, a1, a2, b12, b1, b2 = sympy.symbols('f2 a12 a1 a2 b12 b1 b2')
# Equation 12 from the brown paper; see panography.h
equation_12 = ((a12 + f2)**2 * (b1 + f2) * (b2 + f2) -
(b12 + f2)**2 * (a1 + f2) * (a2 + f2))
d = equation_12.as_poly(f2).as_dict()
print ' // Coefficients in ascending powers of alpha, i.e. P[N]*x^N.'
print ' double P[4] = {'
for i in range(4):
print ' ', sympy.printing.ccode(d[(i,)])
print ' }'
+
+ # As long as Python code do not return the correct value
+ # I prefer use "Xcas Computer Algebra System"
+ # http://www-fourier.ujf-grenoble.fr/~parisse/giac.html
+
+ # Solution for the focal length of a pair of images from a rotating camera.
+ # comment(" Define the base equation that share the Focal length 'f' ")
+ # FocalSolver:=(a12+f)^2 / (( a1+f)*(a2+f)) - (b12+f)^2 / ((b1+f)*(b2+f));
+ # comment(" Solve equation=0 with the unknow 'f' ")
+ # solve(FocalSolver=0,f); | 11 | 0.733333 | 11 | 0 |
58bc4820878f0f266d54058d73f39bf9d113366a | app/assets/stylesheets/partials/content/_fixed_sidebar.sass | app/assets/stylesheets/partials/content/_fixed_sidebar.sass | // Fixed Sidebar
.container-fluid > .sidebar
position: fixed
top: 66px
right: 20px
left: initial
.container-fluid > .content
margin-left: 20px
margin-right: 240px
| // Fixed Sidebar
.container-fluid > .sidebar
position: fixed
top: 66px
right: 20px
left: initial // Chrome
left: auto // Firefox
.container-fluid > .content
margin-left: 20px
margin-right: 240px
| Fix right side sidebar for firefox. | Fix right side sidebar for firefox.
| Sass | agpl-3.0 | wtag/bookyt,hauledev/bookyt,silvermind/bookyt,gaapt/bookyt,huerlisi/bookyt,xuewenfei/bookyt,hauledev/bookyt,gaapt/bookyt,silvermind/bookyt,gaapt/bookyt,huerlisi/bookyt,silvermind/bookyt,wtag/bookyt,hauledev/bookyt,gaapt/bookyt,huerlisi/bookyt,xuewenfei/bookyt,silvermind/bookyt,wtag/bookyt,hauledev/bookyt,xuewenfei/bookyt | sass | ## Code Before:
// Fixed Sidebar
.container-fluid > .sidebar
position: fixed
top: 66px
right: 20px
left: initial
.container-fluid > .content
margin-left: 20px
margin-right: 240px
## Instruction:
Fix right side sidebar for firefox.
## Code After:
// Fixed Sidebar
.container-fluid > .sidebar
position: fixed
top: 66px
right: 20px
left: initial // Chrome
left: auto // Firefox
.container-fluid > .content
margin-left: 20px
margin-right: 240px
| // Fixed Sidebar
.container-fluid > .sidebar
position: fixed
top: 66px
right: 20px
- left: initial
+ left: initial // Chrome
? ++++++++++
+ left: auto // Firefox
.container-fluid > .content
margin-left: 20px
margin-right: 240px | 3 | 0.3 | 2 | 1 |
37da6856d16b9ac1f201ec6fdabe9d81b9677a30 | php-tools.css | php-tools.css | /*--- SETTINGS DIALOG ---*/
.php-lint-settings-dialog label {
width: 100%;
display: inline-block;
}
.php-lint-settings-dialog fieldset {
margin-bottom: 1em;
}
.php-lint-settings-dialog legend {
margin: 0 0 .25em;
color: inherit;
}
.php-lint-settings-dialog input {
vertical-align: middle;
margin-bottom: 0;
}
.php-lint-settings-dialog .columns label {
width: 33.333%;
float: left;
}
.php-lint-settings-dialog .error {
color: #c95353;
}
.php-lint-settings-dialog .input-php-location {
width: 100%;
}
.php-lint-settings-dialog .php-location-error {
font-size: 0.9em;
color: #a33;
}
| /*--- SETTINGS DIALOG ---*/
.php-lint-settings-dialog label {
width: 100%;
display: inline-block;
}
.php-lint-settings-dialog fieldset {
margin-bottom: 1em;
}
.php-lint-settings-dialog legend {
margin: 0 0 .25em;
color: inherit;
}
.php-lint-settings-dialog input {
vertical-align: middle;
margin-bottom: 0;
}
.php-lint-settings-dialog .columns label {
width: 33.333%;
float: left;
}
.php-lint-settings-dialog .error {
color: #c95353;
}
.php-lint-settings-dialog .input-php-location {
width: 100%;
}
.php-lint-settings-dialog .php-location-error {
font-size: 0.9em;
color: #a33;
}
.php-lint-settings-dialog .tool-phpl label {
box-sizing: border-box;
padding: 0 6px 0 0;
}
| Fix styling issue in settings dialog. | Fix styling issue in settings dialog.
| CSS | mit | mikaeljorhult/brackets-php-code-quality-tools,mikaeljorhult/brackets-php-code-quality-tools | css | ## Code Before:
/*--- SETTINGS DIALOG ---*/
.php-lint-settings-dialog label {
width: 100%;
display: inline-block;
}
.php-lint-settings-dialog fieldset {
margin-bottom: 1em;
}
.php-lint-settings-dialog legend {
margin: 0 0 .25em;
color: inherit;
}
.php-lint-settings-dialog input {
vertical-align: middle;
margin-bottom: 0;
}
.php-lint-settings-dialog .columns label {
width: 33.333%;
float: left;
}
.php-lint-settings-dialog .error {
color: #c95353;
}
.php-lint-settings-dialog .input-php-location {
width: 100%;
}
.php-lint-settings-dialog .php-location-error {
font-size: 0.9em;
color: #a33;
}
## Instruction:
Fix styling issue in settings dialog.
## Code After:
/*--- SETTINGS DIALOG ---*/
.php-lint-settings-dialog label {
width: 100%;
display: inline-block;
}
.php-lint-settings-dialog fieldset {
margin-bottom: 1em;
}
.php-lint-settings-dialog legend {
margin: 0 0 .25em;
color: inherit;
}
.php-lint-settings-dialog input {
vertical-align: middle;
margin-bottom: 0;
}
.php-lint-settings-dialog .columns label {
width: 33.333%;
float: left;
}
.php-lint-settings-dialog .error {
color: #c95353;
}
.php-lint-settings-dialog .input-php-location {
width: 100%;
}
.php-lint-settings-dialog .php-location-error {
font-size: 0.9em;
color: #a33;
}
.php-lint-settings-dialog .tool-phpl label {
box-sizing: border-box;
padding: 0 6px 0 0;
}
| - /*--- SETTINGS DIALOG ---*/
? ----
+ /*--- SETTINGS DIALOG ---*/
.php-lint-settings-dialog label {
- width: 100%;
? ^
+ width: 100%;
? ^^^^
- display: inline-block;
? ^
+ display: inline-block;
? ^^^^
}
.php-lint-settings-dialog fieldset {
- margin-bottom: 1em;
? ^
+ margin-bottom: 1em;
? ^^^^
}
.php-lint-settings-dialog legend {
- margin: 0 0 .25em;
? ^
+ margin: 0 0 .25em;
? ^^^^
- color: inherit;
? ^
+ color: inherit;
? ^^^^
}
.php-lint-settings-dialog input {
- vertical-align: middle;
? ^
+ vertical-align: middle;
? ^^^^
- margin-bottom: 0;
? ^
+ margin-bottom: 0;
? ^^^^
}
.php-lint-settings-dialog .columns label {
- width: 33.333%;
? ^
+ width: 33.333%;
? ^^^^
- float: left;
? ^
+ float: left;
? ^^^^
}
.php-lint-settings-dialog .error {
- color: #c95353;
? ^
+ color: #c95353;
? ^^^^
}
.php-lint-settings-dialog .input-php-location {
- width: 100%;
? ^
+ width: 100%;
? ^^^^
}
.php-lint-settings-dialog .php-location-error {
- font-size: 0.9em;
? ^
+ font-size: 0.9em;
? ^^^^
- color: #a33;
? ^
+ color: #a33;
? ^^^^
}
+
+ .php-lint-settings-dialog .tool-phpl label {
+ box-sizing: border-box;
+ padding: 0 6px 0 0;
+ } | 33 | 0.891892 | 19 | 14 |
4b52f6281f2ec44ea6eef35a60e01a49e858197b | parfait-core/src/test/java/com/custardsource/parfait/CompositeMonitoringViewTest.java | parfait-core/src/test/java/com/custardsource/parfait/CompositeMonitoringViewTest.java | package com.custardsource.parfait;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Collection;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class CompositeMonitoringViewTest {
@Mock
MonitoringView monitoringView1;
@Mock
MonitoringView monitoringView2;
CompositeMonitoringView compositeMonitoringView;
@Mock
Collection<Monitorable<?>> monitorables;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(monitoringView1.isRunning()).thenReturn(false);
when(monitoringView2.isRunning()).thenReturn(true);
when(monitorables.size()).thenReturn(2);
this.compositeMonitoringView = new CompositeMonitoringView(monitoringView1, monitoringView2);
}
@Test
public void testStartMonitoring() {
compositeMonitoringView.startMonitoring(monitorables);
verify(monitoringView1).startMonitoring(monitorables);
verify(monitoringView2).startMonitoring(monitorables);
}
@Test
public void testStopMonitoring() {
compositeMonitoringView.stopMonitoring(monitorables);
verify(monitoringView1).stopMonitoring(monitorables);
verify(monitoringView2).stopMonitoring(monitorables);
}
@Test
public void testIsRunning() {
assertTrue(compositeMonitoringView.isRunning());
}
}
| package com.custardsource.parfait;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Collection;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class CompositeMonitoringViewTest {
@Mock
MonitoringView monitoringView1;
@Mock
MonitoringView monitoringView2;
CompositeMonitoringView compositeMonitoringView;
@Mock
Collection<Monitorable<?>> monitorables;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(monitoringView1.isRunning()).thenReturn(false);
when(monitoringView2.isRunning()).thenReturn(true);
when(monitorables.size()).thenReturn(2);
this.compositeMonitoringView = new CompositeMonitoringView(monitoringView1, monitoringView2);
}
@Test
public void startMonitoringShouldStartAllViews() {
compositeMonitoringView.startMonitoring(monitorables);
verify(monitoringView1).startMonitoring(monitorables);
verify(monitoringView2).startMonitoring(monitorables);
}
@Test
public void stopMonitoringShouldStopAllViews() {
compositeMonitoringView.stopMonitoring(monitorables);
verify(monitoringView1).stopMonitoring(monitorables);
verify(monitoringView2).stopMonitoring(monitorables);
}
@Test
public void isRunningReturnsTrueIfAnyRunning() {
assertTrue(compositeMonitoringView.isRunning());
}
@Test
public void isRunningReturnsFalseIfAllAreNotRunning() {
CompositeMonitoringView monitoringView = new CompositeMonitoringView(monitoringView1);
assertFalse(monitoringView.isRunning());
}
}
| Make test names more readable and add missing test case (Cowan's review comments) | Make test names more readable and add missing test case (Cowan's review comments)
| Java | apache-2.0 | timols/parfait,performancecopilot/parfait,performancecopilot/parfait,akshayahn/parfait | java | ## Code Before:
package com.custardsource.parfait;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Collection;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class CompositeMonitoringViewTest {
@Mock
MonitoringView monitoringView1;
@Mock
MonitoringView monitoringView2;
CompositeMonitoringView compositeMonitoringView;
@Mock
Collection<Monitorable<?>> monitorables;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(monitoringView1.isRunning()).thenReturn(false);
when(monitoringView2.isRunning()).thenReturn(true);
when(monitorables.size()).thenReturn(2);
this.compositeMonitoringView = new CompositeMonitoringView(monitoringView1, monitoringView2);
}
@Test
public void testStartMonitoring() {
compositeMonitoringView.startMonitoring(monitorables);
verify(monitoringView1).startMonitoring(monitorables);
verify(monitoringView2).startMonitoring(monitorables);
}
@Test
public void testStopMonitoring() {
compositeMonitoringView.stopMonitoring(monitorables);
verify(monitoringView1).stopMonitoring(monitorables);
verify(monitoringView2).stopMonitoring(monitorables);
}
@Test
public void testIsRunning() {
assertTrue(compositeMonitoringView.isRunning());
}
}
## Instruction:
Make test names more readable and add missing test case (Cowan's review comments)
## Code After:
package com.custardsource.parfait;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Collection;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class CompositeMonitoringViewTest {
@Mock
MonitoringView monitoringView1;
@Mock
MonitoringView monitoringView2;
CompositeMonitoringView compositeMonitoringView;
@Mock
Collection<Monitorable<?>> monitorables;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(monitoringView1.isRunning()).thenReturn(false);
when(monitoringView2.isRunning()).thenReturn(true);
when(monitorables.size()).thenReturn(2);
this.compositeMonitoringView = new CompositeMonitoringView(monitoringView1, monitoringView2);
}
@Test
public void startMonitoringShouldStartAllViews() {
compositeMonitoringView.startMonitoring(monitorables);
verify(monitoringView1).startMonitoring(monitorables);
verify(monitoringView2).startMonitoring(monitorables);
}
@Test
public void stopMonitoringShouldStopAllViews() {
compositeMonitoringView.stopMonitoring(monitorables);
verify(monitoringView1).stopMonitoring(monitorables);
verify(monitoringView2).stopMonitoring(monitorables);
}
@Test
public void isRunningReturnsTrueIfAnyRunning() {
assertTrue(compositeMonitoringView.isRunning());
}
@Test
public void isRunningReturnsFalseIfAllAreNotRunning() {
CompositeMonitoringView monitoringView = new CompositeMonitoringView(monitoringView1);
assertFalse(monitoringView.isRunning());
}
}
| package com.custardsource.parfait;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Collection;
+ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class CompositeMonitoringViewTest {
@Mock
MonitoringView monitoringView1;
@Mock
MonitoringView monitoringView2;
CompositeMonitoringView compositeMonitoringView;
@Mock
Collection<Monitorable<?>> monitorables;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(monitoringView1.isRunning()).thenReturn(false);
when(monitoringView2.isRunning()).thenReturn(true);
when(monitorables.size()).thenReturn(2);
this.compositeMonitoringView = new CompositeMonitoringView(monitoringView1, monitoringView2);
}
@Test
- public void testStartMonitoring() {
? -- --
+ public void startMonitoringShouldStartAllViews() {
? +++++++++++++++++++
compositeMonitoringView.startMonitoring(monitorables);
verify(monitoringView1).startMonitoring(monitorables);
verify(monitoringView2).startMonitoring(monitorables);
}
@Test
- public void testStopMonitoring() {
? -- --
+ public void stopMonitoringShouldStopAllViews() {
? ++++++++++++++++++
compositeMonitoringView.stopMonitoring(monitorables);
verify(monitoringView1).stopMonitoring(monitorables);
verify(monitoringView2).stopMonitoring(monitorables);
}
@Test
- public void testIsRunning() {
+ public void isRunningReturnsTrueIfAnyRunning() {
assertTrue(compositeMonitoringView.isRunning());
}
+
+ @Test
+ public void isRunningReturnsFalseIfAllAreNotRunning() {
+ CompositeMonitoringView monitoringView = new CompositeMonitoringView(monitoringView1);
+ assertFalse(monitoringView.isRunning());
+ }
} | 13 | 0.209677 | 10 | 3 |
e4b42540336c9eae539b12fdd05e9f9a9ed7ae93 | doc/outcome-templates.md | doc/outcome-templates.md |
The ERB outcome templates live in `lib/smart_answer_flows/<flow-name>/<outcome-name>.govspeak.erb`.
|
Outcome templates live in `lib/smart_answer_flows/<flow-name>/outcomes/<outcome-name>.govspeak.erb`.
Content is defined in `content_for` blocks.
The templates can contain content for the `title`, `body` and `next_steps`, all of which are optional.
## Example
```
<% content_for :title do %>
<% unless calculator.has_commodity_code? %>
The product composition you indicated is not possible.
<% else %>
The Meursing code for a product with this composition is 7<%= calculator.commodity_code %>.
<% end %>
<% end %>
<% content_for :body do %>
<% if calculator.has_commodity_code? %>
Use these four digits together with the ten-digit commodity code from Trade Tariff.
<% end %>
<% end %>
```
| Update docs for Outcome templates | Update docs for Outcome templates
| Markdown | mit | stwalsh/smart-answers,aledelcueto/smart-answers,aledelcueto/smart-answers,stwalsh/smart-answers,stwalsh/smart-answers,stwalsh/smart-answers,alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers,aledelcueto/smart-answers,alphagov/smart-answers,aledelcueto/smart-answers | markdown | ## Code Before:
The ERB outcome templates live in `lib/smart_answer_flows/<flow-name>/<outcome-name>.govspeak.erb`.
## Instruction:
Update docs for Outcome templates
## Code After:
Outcome templates live in `lib/smart_answer_flows/<flow-name>/outcomes/<outcome-name>.govspeak.erb`.
Content is defined in `content_for` blocks.
The templates can contain content for the `title`, `body` and `next_steps`, all of which are optional.
## Example
```
<% content_for :title do %>
<% unless calculator.has_commodity_code? %>
The product composition you indicated is not possible.
<% else %>
The Meursing code for a product with this composition is 7<%= calculator.commodity_code %>.
<% end %>
<% end %>
<% content_for :body do %>
<% if calculator.has_commodity_code? %>
Use these four digits together with the ten-digit commodity code from Trade Tariff.
<% end %>
<% end %>
```
|
- The ERB outcome templates live in `lib/smart_answer_flows/<flow-name>/<outcome-name>.govspeak.erb`.
? ^^^^^^^^^
+ Outcome templates live in `lib/smart_answer_flows/<flow-name>/outcomes/<outcome-name>.govspeak.erb`.
? ^ +++++++++
+
+ Content is defined in `content_for` blocks.
+
+ The templates can contain content for the `title`, `body` and `next_steps`, all of which are optional.
+
+ ## Example
+
+ ```
+ <% content_for :title do %>
+ <% unless calculator.has_commodity_code? %>
+ The product composition you indicated is not possible.
+ <% else %>
+ The Meursing code for a product with this composition is 7<%= calculator.commodity_code %>.
+ <% end %>
+ <% end %>
+
+ <% content_for :body do %>
+ <% if calculator.has_commodity_code? %>
+ Use these four digits together with the ten-digit commodity code from Trade Tariff.
+ <% end %>
+ <% end %>
+ ``` | 24 | 12 | 23 | 1 |
f4f99e96d7b57c431c7538d31b04c2b358128815 | app/src/lib/stores/helpers/onboarding-tutorial.ts | app/src/lib/stores/helpers/onboarding-tutorial.ts | export class OnboardingTutorial {
public constructor() {
this.skipInstallEditor = false
this.skipCreatePR = false
}
getCurrentStep() {
// call all other methods to check where we're at
}
isEditorInstalled() {
if (this.skipInstallEditor) {
return true
}
return false
}
isBranchCreated() {
return false
}
isReadmeEdited() {
return false
}
hasCommit() {
return false
}
commitPushed() {
return false
}
pullRequestCreated() {
if (this.skipCreatePR) {
return true
}
return false
}
skipEditorInstall() {
this.skipEditorInstall = true
}
skipCreatePR() {
this.skipCreatePR = true
}
}
| export class OnboardingTutorial {
public constructor() {
this.skipInstallEditor = false
this.skipCreatePR = false
}
public getCurrentStep() {
// call all other methods to check where we're at
}
if (this.skipInstallEditor) {
private async isEditorInstalled(): Promise<boolean> {
return true
}
return false
}
private isBranchCreated(): boolean {
return false
}
private isReadmeEdited(): boolean {
return false
}
private hasCommit(): boolean {
return false
}
private commitPushed(): boolean {
return false
}
private pullRequestCreated(): boolean {
if (this.skipCreatePR) {
return true
}
return false
}
public skipEditorInstall() {
this.skipEditorInstall = true
}
public skipCreatePR() {
this.skipCreatePR = true
}
}
| Add accessibility modifier and return type | Add accessibility modifier and return type
| TypeScript | mit | j-f1/forked-desktop,desktop/desktop,kactus-io/kactus,say25/desktop,shiftkey/desktop,j-f1/forked-desktop,artivilla/desktop,say25/desktop,desktop/desktop,artivilla/desktop,desktop/desktop,shiftkey/desktop,shiftkey/desktop,kactus-io/kactus,desktop/desktop,artivilla/desktop,artivilla/desktop,kactus-io/kactus,j-f1/forked-desktop,say25/desktop,say25/desktop,kactus-io/kactus,j-f1/forked-desktop,shiftkey/desktop | typescript | ## Code Before:
export class OnboardingTutorial {
public constructor() {
this.skipInstallEditor = false
this.skipCreatePR = false
}
getCurrentStep() {
// call all other methods to check where we're at
}
isEditorInstalled() {
if (this.skipInstallEditor) {
return true
}
return false
}
isBranchCreated() {
return false
}
isReadmeEdited() {
return false
}
hasCommit() {
return false
}
commitPushed() {
return false
}
pullRequestCreated() {
if (this.skipCreatePR) {
return true
}
return false
}
skipEditorInstall() {
this.skipEditorInstall = true
}
skipCreatePR() {
this.skipCreatePR = true
}
}
## Instruction:
Add accessibility modifier and return type
## Code After:
export class OnboardingTutorial {
public constructor() {
this.skipInstallEditor = false
this.skipCreatePR = false
}
public getCurrentStep() {
// call all other methods to check where we're at
}
if (this.skipInstallEditor) {
private async isEditorInstalled(): Promise<boolean> {
return true
}
return false
}
private isBranchCreated(): boolean {
return false
}
private isReadmeEdited(): boolean {
return false
}
private hasCommit(): boolean {
return false
}
private commitPushed(): boolean {
return false
}
private pullRequestCreated(): boolean {
if (this.skipCreatePR) {
return true
}
return false
}
public skipEditorInstall() {
this.skipEditorInstall = true
}
public skipCreatePR() {
this.skipCreatePR = true
}
}
| export class OnboardingTutorial {
public constructor() {
this.skipInstallEditor = false
this.skipCreatePR = false
}
- getCurrentStep() {
+ public getCurrentStep() {
? +++++++
// call all other methods to check where we're at
}
- isEditorInstalled() {
if (this.skipInstallEditor) {
+ private async isEditorInstalled(): Promise<boolean> {
return true
}
return false
}
- isBranchCreated() {
+ private isBranchCreated(): boolean {
return false
}
- isReadmeEdited() {
+ private isReadmeEdited(): boolean {
return false
}
- hasCommit() {
+ private hasCommit(): boolean {
return false
}
- commitPushed() {
+ private commitPushed(): boolean {
return false
}
- pullRequestCreated() {
+ private pullRequestCreated(): boolean {
if (this.skipCreatePR) {
return true
}
return false
}
- skipEditorInstall() {
+ public skipEditorInstall() {
? +++++++
this.skipEditorInstall = true
}
- skipCreatePR() {
+ public skipCreatePR() {
? +++++++
this.skipCreatePR = true
}
} | 18 | 0.375 | 9 | 9 |
91fc21bb4bc27061458a92521bc77047d63c7dbc | test/helpers/connection.json | test/helpers/connection.json | {
"hosts" : [ "172.16.22.114:9160" ],
"timeout" : 3000
}
| {
"hosts" : [ "localhost:9160" ],
"timeout" : 3000
}
| Test on localhost on Travis, please. | Test on localhost on Travis, please.
| JSON | mit | lyveminds/scamandrios | json | ## Code Before:
{
"hosts" : [ "172.16.22.114:9160" ],
"timeout" : 3000
}
## Instruction:
Test on localhost on Travis, please.
## Code After:
{
"hosts" : [ "localhost:9160" ],
"timeout" : 3000
}
| {
- "hosts" : [ "172.16.22.114:9160" ],
+ "hosts" : [ "localhost:9160" ],
"timeout" : 3000
} | 2 | 0.5 | 1 | 1 |
b4fdec74ac1af2b50ab5c79f6127d87033a9d297 | wagtail/wagtailsearch/signal_handlers.py | wagtail/wagtailsearch/signal_handlers.py | from django.db.models.signals import post_save, post_delete
from django.db import models
from wagtail.wagtailsearch.index import Indexed
from wagtail.wagtailsearch.backends import get_search_backends
def post_save_signal_handler(instance, **kwargs):
for backend in get_search_backends():
backend.add(instance)
def post_delete_signal_handler(instance, **kwargs):
for backend in get_search_backends():
backend.delete(instance)
def register_signal_handlers():
# Get list of models that should be indexed
indexed_models = [model for model in models.get_models() if issubclass(model, Indexed)]
# Loop through list and register signal handlers for each one
for model in indexed_models:
post_save.connect(post_save_signal_handler, sender=model)
post_delete.connect(post_delete_signal_handler, sender=model)
| from django.db.models.signals import post_save, post_delete
from django.db import models
from wagtail.wagtailsearch.index import Indexed
from wagtail.wagtailsearch.backends import get_search_backends
def post_save_signal_handler(instance, **kwargs):
if instance not in type(instance).get_indexed_objects():
return
for backend in get_search_backends():
backend.add(instance)
def post_delete_signal_handler(instance, **kwargs):
if instance not in type(instance).get_indexed_objects():
return
for backend in get_search_backends():
backend.delete(instance)
def register_signal_handlers():
# Get list of models that should be indexed
indexed_models = [model for model in models.get_models() if issubclass(model, Indexed)]
# Loop through list and register signal handlers for each one
for model in indexed_models:
post_save.connect(post_save_signal_handler, sender=model)
post_delete.connect(post_delete_signal_handler, sender=model)
| Make search signal handlers use get_indexed_objects | Make search signal handlers use get_indexed_objects
| Python | bsd-3-clause | rv816/wagtail,serzans/wagtail,serzans/wagtail,FlipperPA/wagtail,iansprice/wagtail,nrsimha/wagtail,Toshakins/wagtail,kurtrwall/wagtail,jorge-marques/wagtail,stevenewey/wagtail,darith27/wagtail,kaedroho/wagtail,iho/wagtail,WQuanfeng/wagtail,nealtodd/wagtail,quru/wagtail,mikedingjan/wagtail,timorieber/wagtail,timorieber/wagtail,takeshineshiro/wagtail,gasman/wagtail,nimasmi/wagtail,FlipperPA/wagtail,quru/wagtail,inonit/wagtail,taedori81/wagtail,taedori81/wagtail,davecranwell/wagtail,hamsterbacke23/wagtail,kurtrwall/wagtail,gogobook/wagtail,jorge-marques/wagtail,Klaudit/wagtail,FlipperPA/wagtail,kurtw/wagtail,thenewguy/wagtail,stevenewey/wagtail,JoshBarr/wagtail,nilnvoid/wagtail,hamsterbacke23/wagtail,davecranwell/wagtail,darith27/wagtail,hanpama/wagtail,taedori81/wagtail,mjec/wagtail,thenewguy/wagtail,tangentlabs/wagtail,jordij/wagtail,tangentlabs/wagtail,mayapurmedia/wagtail,gogobook/wagtail,mephizzle/wagtail,rsalmaso/wagtail,iho/wagtail,mephizzle/wagtail,tangentlabs/wagtail,thenewguy/wagtail,iansprice/wagtail,mikedingjan/wagtail,serzans/wagtail,quru/wagtail,chimeno/wagtail,KimGlazebrook/wagtail-experiment,chimeno/wagtail,benjaoming/wagtail,kaedroho/wagtail,hamsterbacke23/wagtail,hanpama/wagtail,Pennebaker/wagtail,jordij/wagtail,rjsproxy/wagtail,janusnic/wagtail,darith27/wagtail,Tivix/wagtail,chrxr/wagtail,dresiu/wagtail,takeflight/wagtail,kurtw/wagtail,mixxorz/wagtail,nealtodd/wagtail,rv816/wagtail,rjsproxy/wagtail,dresiu/wagtail,janusnic/wagtail,iansprice/wagtail,m-sanders/wagtail,takeshineshiro/wagtail,torchbox/wagtail,thenewguy/wagtail,jnns/wagtail,bjesus/wagtail,m-sanders/wagtail,wagtail/wagtail,inonit/wagtail,nrsimha/wagtail,mayapurmedia/wagtail,chimeno/wagtail,benjaoming/wagtail,stevenewey/wagtail,gasman/wagtail,KimGlazebrook/wagtail-experiment,dresiu/wagtail,WQuanfeng/wagtail,kurtrwall/wagtail,gasman/wagtail,wagtail/wagtail,nilnvoid/wagtail,davecranwell/wagtail,jorge-marques/wagtail,chrxr/wagtail,Klaudit/wagtail,mephizzle/wagtail,JoshBarr/wagtail,Klaudit/wagtail,mikedingjan/wagtail,wagtail/wagtail,stevenewey/wagtail,wagtail/wagtail,mjec/wagtail,nimasmi/wagtail,mixxorz/wagtail,iho/wagtail,nealtodd/wagtail,torchbox/wagtail,Pennebaker/wagtail,mikedingjan/wagtail,zerolab/wagtail,mjec/wagtail,rjsproxy/wagtail,kaedroho/wagtail,nutztherookie/wagtail,Toshakins/wagtail,nimasmi/wagtail,iansprice/wagtail,torchbox/wagtail,serzans/wagtail,Tivix/wagtail,kaedroho/wagtail,benjaoming/wagtail,nutztherookie/wagtail,mayapurmedia/wagtail,dresiu/wagtail,JoshBarr/wagtail,jorge-marques/wagtail,zerolab/wagtail,davecranwell/wagtail,takeflight/wagtail,gasman/wagtail,iho/wagtail,Tivix/wagtail,nimasmi/wagtail,mayapurmedia/wagtail,KimGlazebrook/wagtail-experiment,darith27/wagtail,nilnvoid/wagtail,chimeno/wagtail,takeshineshiro/wagtail,chimeno/wagtail,nrsimha/wagtail,kurtw/wagtail,gasman/wagtail,rv816/wagtail,quru/wagtail,rjsproxy/wagtail,jordij/wagtail,marctc/wagtail,taedori81/wagtail,rsalmaso/wagtail,KimGlazebrook/wagtail-experiment,mixxorz/wagtail,gogobook/wagtail,timorieber/wagtail,jorge-marques/wagtail,torchbox/wagtail,Toshakins/wagtail,nutztherookie/wagtail,tangentlabs/wagtail,kurtw/wagtail,jnns/wagtail,janusnic/wagtail,jordij/wagtail,FlipperPA/wagtail,marctc/wagtail,chrxr/wagtail,benjaoming/wagtail,mjec/wagtail,nrsimha/wagtail,rsalmaso/wagtail,takeflight/wagtail,rsalmaso/wagtail,kurtrwall/wagtail,rsalmaso/wagtail,rv816/wagtail,timorieber/wagtail,takeflight/wagtail,mephizzle/wagtail,bjesus/wagtail,kaedroho/wagtail,mixxorz/wagtail,dresiu/wagtail,nilnvoid/wagtail,zerolab/wagtail,thenewguy/wagtail,m-sanders/wagtail,Pennebaker/wagtail,zerolab/wagtail,marctc/wagtail,wagtail/wagtail,hamsterbacke23/wagtail,gogobook/wagtail,JoshBarr/wagtail,WQuanfeng/wagtail,marctc/wagtail,nealtodd/wagtail,mixxorz/wagtail,bjesus/wagtail,taedori81/wagtail,hanpama/wagtail,inonit/wagtail,Pennebaker/wagtail,Toshakins/wagtail,janusnic/wagtail,WQuanfeng/wagtail,zerolab/wagtail,nutztherookie/wagtail,chrxr/wagtail,m-sanders/wagtail,takeshineshiro/wagtail,bjesus/wagtail,Tivix/wagtail,hanpama/wagtail,inonit/wagtail,jnns/wagtail,jnns/wagtail,Klaudit/wagtail | python | ## Code Before:
from django.db.models.signals import post_save, post_delete
from django.db import models
from wagtail.wagtailsearch.index import Indexed
from wagtail.wagtailsearch.backends import get_search_backends
def post_save_signal_handler(instance, **kwargs):
for backend in get_search_backends():
backend.add(instance)
def post_delete_signal_handler(instance, **kwargs):
for backend in get_search_backends():
backend.delete(instance)
def register_signal_handlers():
# Get list of models that should be indexed
indexed_models = [model for model in models.get_models() if issubclass(model, Indexed)]
# Loop through list and register signal handlers for each one
for model in indexed_models:
post_save.connect(post_save_signal_handler, sender=model)
post_delete.connect(post_delete_signal_handler, sender=model)
## Instruction:
Make search signal handlers use get_indexed_objects
## Code After:
from django.db.models.signals import post_save, post_delete
from django.db import models
from wagtail.wagtailsearch.index import Indexed
from wagtail.wagtailsearch.backends import get_search_backends
def post_save_signal_handler(instance, **kwargs):
if instance not in type(instance).get_indexed_objects():
return
for backend in get_search_backends():
backend.add(instance)
def post_delete_signal_handler(instance, **kwargs):
if instance not in type(instance).get_indexed_objects():
return
for backend in get_search_backends():
backend.delete(instance)
def register_signal_handlers():
# Get list of models that should be indexed
indexed_models = [model for model in models.get_models() if issubclass(model, Indexed)]
# Loop through list and register signal handlers for each one
for model in indexed_models:
post_save.connect(post_save_signal_handler, sender=model)
post_delete.connect(post_delete_signal_handler, sender=model)
| from django.db.models.signals import post_save, post_delete
from django.db import models
from wagtail.wagtailsearch.index import Indexed
from wagtail.wagtailsearch.backends import get_search_backends
def post_save_signal_handler(instance, **kwargs):
+ if instance not in type(instance).get_indexed_objects():
+ return
+
+
for backend in get_search_backends():
backend.add(instance)
def post_delete_signal_handler(instance, **kwargs):
+ if instance not in type(instance).get_indexed_objects():
+ return
+
for backend in get_search_backends():
backend.delete(instance)
def register_signal_handlers():
# Get list of models that should be indexed
indexed_models = [model for model in models.get_models() if issubclass(model, Indexed)]
# Loop through list and register signal handlers for each one
for model in indexed_models:
post_save.connect(post_save_signal_handler, sender=model)
post_delete.connect(post_delete_signal_handler, sender=model) | 7 | 0.28 | 7 | 0 |
972140cc6ff11e17a728bdf990f86f01333c059f | tox.ini | tox.ini | [tox]
envlist =
py{36, 37, 38, 39}
[testenv]
deps=
-r requirements_for_test.txt
commands =
make test
make integration-test
# environment variables used by the tests
passenv =
NOTIFY_API_URL
API_KEY
FUNCTIONAL_TEST_EMAIL
FUNCTIONAL_TEST_NUMBER
EMAIL_TEMPLATE_ID
LETTER_TEMPLATE_ID
SMS_TEMPLATE_ID
EMAIL_REPLY_TO_ID
SMS_SENDER_ID
API_SENDING_KEY
INBOUND_SMS_QUERY_KEY
| [tox]
envlist =
py{36, 37, 38, 39}
[testenv]
allowlist_externals = make
deps=
-r requirements_for_test.txt
commands =
make test
make integration-test
# environment variables used by the tests
passenv =
NOTIFY_API_URL
API_KEY
FUNCTIONAL_TEST_EMAIL
FUNCTIONAL_TEST_NUMBER
EMAIL_TEMPLATE_ID
LETTER_TEMPLATE_ID
SMS_TEMPLATE_ID
EMAIL_REPLY_TO_ID
SMS_SENDER_ID
API_SENDING_KEY
INBOUND_SMS_QUERY_KEY
| Fix warning about running external command in Tox | Fix warning about running external command in Tox
Fixes:
WARNING: test command found but not installed in testenv
cmd: /usr/bin/make
env: /Users/benthorner/Documents/Projects/python-client/.tox/py36
Maybe you forgot to specify a dependency? See also the allowlist_externals envconfig setting.
| INI | mit | alphagov/notifications-python-client,alphagov/notifications-python-client | ini | ## Code Before:
[tox]
envlist =
py{36, 37, 38, 39}
[testenv]
deps=
-r requirements_for_test.txt
commands =
make test
make integration-test
# environment variables used by the tests
passenv =
NOTIFY_API_URL
API_KEY
FUNCTIONAL_TEST_EMAIL
FUNCTIONAL_TEST_NUMBER
EMAIL_TEMPLATE_ID
LETTER_TEMPLATE_ID
SMS_TEMPLATE_ID
EMAIL_REPLY_TO_ID
SMS_SENDER_ID
API_SENDING_KEY
INBOUND_SMS_QUERY_KEY
## Instruction:
Fix warning about running external command in Tox
Fixes:
WARNING: test command found but not installed in testenv
cmd: /usr/bin/make
env: /Users/benthorner/Documents/Projects/python-client/.tox/py36
Maybe you forgot to specify a dependency? See also the allowlist_externals envconfig setting.
## Code After:
[tox]
envlist =
py{36, 37, 38, 39}
[testenv]
allowlist_externals = make
deps=
-r requirements_for_test.txt
commands =
make test
make integration-test
# environment variables used by the tests
passenv =
NOTIFY_API_URL
API_KEY
FUNCTIONAL_TEST_EMAIL
FUNCTIONAL_TEST_NUMBER
EMAIL_TEMPLATE_ID
LETTER_TEMPLATE_ID
SMS_TEMPLATE_ID
EMAIL_REPLY_TO_ID
SMS_SENDER_ID
API_SENDING_KEY
INBOUND_SMS_QUERY_KEY
| [tox]
envlist =
py{36, 37, 38, 39}
[testenv]
+ allowlist_externals = make
deps=
-r requirements_for_test.txt
commands =
make test
make integration-test
# environment variables used by the tests
passenv =
NOTIFY_API_URL
API_KEY
FUNCTIONAL_TEST_EMAIL
FUNCTIONAL_TEST_NUMBER
EMAIL_TEMPLATE_ID
LETTER_TEMPLATE_ID
SMS_TEMPLATE_ID
EMAIL_REPLY_TO_ID
SMS_SENDER_ID
API_SENDING_KEY
INBOUND_SMS_QUERY_KEY | 1 | 0.041667 | 1 | 0 |
31bbec5d55437d36b78ca1c36dee19e74203695b | setup.py | setup.py |
from distutils.core import setup
setup(
name = 'ffn',
version = '0.1.0',
author = 'Michal Januszewski',
author_email = 'mjanusz@google.com',
packages = ['ffn', 'ffn.inference', 'ffn.training', 'ffn.utils'],
scripts = ['build_coordinates.py', 'compute_partitions.py', 'run_inference.py', 'train.py'],
url = 'https://github.com/google/ffn',
license = 'LICENSE',
description = 'Flood-Filling Networks for volumetric instance segmentation',
long_description= open('README.md').read(),
install_requires= ['scikit-image', 'scipy', 'numpy', 'tensorflow', 'h5py', 'PIL', 'absl-py'],
)
|
from distutils.core import setup
setup(
name = 'ffn',
version = '0.1.0',
author = 'Michal Januszewski',
author_email = 'mjanusz@google.com',
packages = ['ffn', 'ffn.inference', 'ffn.training', 'ffn.training.models', 'ffn.utils'],
scripts = ['build_coordinates.py', 'compute_partitions.py', 'run_inference.py', 'train.py'],
url = 'https://github.com/google/ffn',
license = 'LICENSE',
description = 'Flood-Filling Networks for volumetric instance segmentation',
long_description= open('README.md').read(),
install_requires= ['scikit-image', 'scipy', 'numpy', 'tensorflow<2', 'h5py', 'Pillow', 'absl-py'],
)
| Add ffn.training.models and switch to Pillow. | Add ffn.training.models and switch to Pillow.
It is still easier to use this repo via git clone rather than pip
install, e.g. from Colab. But this seemed worth updating anyway.
| Python | apache-2.0 | google/ffn | python | ## Code Before:
from distutils.core import setup
setup(
name = 'ffn',
version = '0.1.0',
author = 'Michal Januszewski',
author_email = 'mjanusz@google.com',
packages = ['ffn', 'ffn.inference', 'ffn.training', 'ffn.utils'],
scripts = ['build_coordinates.py', 'compute_partitions.py', 'run_inference.py', 'train.py'],
url = 'https://github.com/google/ffn',
license = 'LICENSE',
description = 'Flood-Filling Networks for volumetric instance segmentation',
long_description= open('README.md').read(),
install_requires= ['scikit-image', 'scipy', 'numpy', 'tensorflow', 'h5py', 'PIL', 'absl-py'],
)
## Instruction:
Add ffn.training.models and switch to Pillow.
It is still easier to use this repo via git clone rather than pip
install, e.g. from Colab. But this seemed worth updating anyway.
## Code After:
from distutils.core import setup
setup(
name = 'ffn',
version = '0.1.0',
author = 'Michal Januszewski',
author_email = 'mjanusz@google.com',
packages = ['ffn', 'ffn.inference', 'ffn.training', 'ffn.training.models', 'ffn.utils'],
scripts = ['build_coordinates.py', 'compute_partitions.py', 'run_inference.py', 'train.py'],
url = 'https://github.com/google/ffn',
license = 'LICENSE',
description = 'Flood-Filling Networks for volumetric instance segmentation',
long_description= open('README.md').read(),
install_requires= ['scikit-image', 'scipy', 'numpy', 'tensorflow<2', 'h5py', 'Pillow', 'absl-py'],
)
|
from distutils.core import setup
setup(
name = 'ffn',
version = '0.1.0',
author = 'Michal Januszewski',
author_email = 'mjanusz@google.com',
- packages = ['ffn', 'ffn.inference', 'ffn.training', 'ffn.utils'],
+ packages = ['ffn', 'ffn.inference', 'ffn.training', 'ffn.training.models', 'ffn.utils'],
? +++++++++++++++++++++++
scripts = ['build_coordinates.py', 'compute_partitions.py', 'run_inference.py', 'train.py'],
url = 'https://github.com/google/ffn',
license = 'LICENSE',
description = 'Flood-Filling Networks for volumetric instance segmentation',
long_description= open('README.md').read(),
- install_requires= ['scikit-image', 'scipy', 'numpy', 'tensorflow', 'h5py', 'PIL', 'absl-py'],
? ^^
+ install_requires= ['scikit-image', 'scipy', 'numpy', 'tensorflow<2', 'h5py', 'Pillow', 'absl-py'],
? ++ ^^^^^
) | 4 | 0.25 | 2 | 2 |
df449280b7aa5c94d78dd6ea6018955fe69e658a | pokedex/data/csv/languages.csv | pokedex/data/csv/languages.csv | id,iso639,iso3166,identifier,official,order
1,ja,jp,ja,1,1
2,ja,jp,roomaji,1,2
3,ko,kr,ko,1,
4,zh,cn,zh,1,
5,fr,fr,fr,1,
6,de,de,de,1,
7,es,es,es,1,
8,it,it,it,1,
9,en,us,en,1,0
10,cs,cz,cs,0,
| id,iso639,iso3166,identifier,official,order
1,ja,jp,ja,1,1
2,ja,jp,roomaji,1,2
3,ko,kr,ko,1,
4,zh,cn,zh,1,
5,fr,fr,fr,1,
6,de,de,de,1,
7,es,es,es,1,
8,it,it,it,1,
9,en,us,en,1,0
10,cs,cz,cs,0,
11,ja,jp,ja-kanji,1,
| Add a separate fucking language for kanji. | Add a separate fucking language for kanji.
| CSV | mit | veekun/pokedex,RK905/pokedex-1,veekun/pokedex,DaMouse404/pokedex,xfix/pokedex,mschex1/pokedex | csv | ## Code Before:
id,iso639,iso3166,identifier,official,order
1,ja,jp,ja,1,1
2,ja,jp,roomaji,1,2
3,ko,kr,ko,1,
4,zh,cn,zh,1,
5,fr,fr,fr,1,
6,de,de,de,1,
7,es,es,es,1,
8,it,it,it,1,
9,en,us,en,1,0
10,cs,cz,cs,0,
## Instruction:
Add a separate fucking language for kanji.
## Code After:
id,iso639,iso3166,identifier,official,order
1,ja,jp,ja,1,1
2,ja,jp,roomaji,1,2
3,ko,kr,ko,1,
4,zh,cn,zh,1,
5,fr,fr,fr,1,
6,de,de,de,1,
7,es,es,es,1,
8,it,it,it,1,
9,en,us,en,1,0
10,cs,cz,cs,0,
11,ja,jp,ja-kanji,1,
| id,iso639,iso3166,identifier,official,order
1,ja,jp,ja,1,1
2,ja,jp,roomaji,1,2
3,ko,kr,ko,1,
4,zh,cn,zh,1,
5,fr,fr,fr,1,
6,de,de,de,1,
7,es,es,es,1,
8,it,it,it,1,
9,en,us,en,1,0
10,cs,cz,cs,0,
+ 11,ja,jp,ja-kanji,1, | 1 | 0.090909 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.