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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ae38b0c8b302b707dadbe647454e0d8bdf86b846 | run.js | run.js | require.paths.unshift("lib");
var fishback = require("fishback.js");
var server = fishback.createServer();
server.addResFilter(function (res) {
// If origin doesn't specify, make everything cachable for an hour
if (!("cache-control" in res.headers)) {
res.headers["cache-control"] = "max-age=3600";
}
});
server.listen();
| require.paths.unshift("lib");
var fishback = require("fishback.js");
var server = fishback.createServer();
server.addResFilter(function (res) {
// If origin doesn't return a cache-control header, make everything cacheable
// for 0 seconds. This seems useless, but it means that if the the client
// explicitly passes max-stale, it will get a cached response.
if (!("cache-control" in res.headers)) {
res.headers["cache-control"] = "max-age=0";
}
});
server.listen();
| Make the automatic header modification a bit safer. | Make the automatic header modification a bit safer. | JavaScript | mit | ithinkihaveacat/node-fishback | javascript | ## Code Before:
require.paths.unshift("lib");
var fishback = require("fishback.js");
var server = fishback.createServer();
server.addResFilter(function (res) {
// If origin doesn't specify, make everything cachable for an hour
if (!("cache-control" in res.headers)) {
res.headers["cache-control"] = "max-age=3600";
}
});
server.listen();
## Instruction:
Make the automatic header modification a bit safer.
## Code After:
require.paths.unshift("lib");
var fishback = require("fishback.js");
var server = fishback.createServer();
server.addResFilter(function (res) {
// If origin doesn't return a cache-control header, make everything cacheable
// for 0 seconds. This seems useless, but it means that if the the client
// explicitly passes max-stale, it will get a cached response.
if (!("cache-control" in res.headers)) {
res.headers["cache-control"] = "max-age=0";
}
});
server.listen();
| require.paths.unshift("lib");
var fishback = require("fishback.js");
var server = fishback.createServer();
server.addResFilter(function (res) {
- // If origin doesn't specify, make everything cachable for an hour
+ // If origin doesn't return a cache-control header, make everything cacheable
+ // for 0 seconds. This seems useless, but it means that if the the client
+ // explicitly passes max-stale, it will get a cached response.
if (!("cache-control" in res.headers)) {
- res.headers["cache-control"] = "max-age=3600";
? ---
+ res.headers["cache-control"] = "max-age=0";
}
});
server.listen(); | 6 | 0.428571 | 4 | 2 |
e6e0d96790d71caccb3f00487bfeeddccdc78139 | app/raw/tasks.py | app/raw/tasks.py | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = url_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_name
| from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = output_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_path
| Fix variable and return value | Fix variable and return value
| Python | mit | legco-watch/legco-watch,comsaint/legco-watch,comsaint/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,legco-watch/legco-watch | python | ## Code Before:
from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = url_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_name
## Instruction:
Fix variable and return value
## Code After:
from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = output_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_path
| from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
- url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
? ^^
+ output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
? + ^^^^
- settings.overrides['FEED_URI'] = url_path
? ^^
+ settings.overrides['FEED_URI'] = output_path
? + ^^^^
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
- return output_name
? ^ ^^
+ return output_path
? ^ ^^
| 6 | 0.222222 | 3 | 3 |
19e88ffd08fc98d4ab0e79b1fe4434d305534760 | lib/thread_list.rb | lib/thread_list.rb | class ThreadList
def self.recent_from_groups(groups, limit)
MessageThread.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.recent_public_from_groups(groups, limit)
MessageThread.public.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.issue_threads_from_group(group)
group.threads.with_issue
end
def self.general_threads_from_group(group)
group.threads.without_issue
end
def self.recent_involved_with(user, limit)
user.involved_threads.order_by_latest_message.limit(limit)
end
def self.recent_public
MessageThread.public.order_by_latest_message
end
end
| class ThreadList
def self.recent_from_groups(groups, limit)
MessageThread.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.recent_public_from_groups(groups, limit)
MessageThread.public.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.issue_threads_from_group(group)
group.threads.order_by_latest_message.with_issue
end
def self.general_threads_from_group(group)
group.threads.order_by_latest_message.without_issue
end
def self.recent_involved_with(user, limit)
user.involved_threads.order_by_latest_message.limit(limit)
end
def self.recent_public
MessageThread.public.order_by_latest_message
end
end
| Order threads by latest message. | Order threads by latest message.
| Ruby | mit | auto-mat/toolkit,cyclestreets/cyclescape,auto-mat/toolkit,cyclestreets/cyclescape,cyclestreets/cyclescape | ruby | ## Code Before:
class ThreadList
def self.recent_from_groups(groups, limit)
MessageThread.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.recent_public_from_groups(groups, limit)
MessageThread.public.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.issue_threads_from_group(group)
group.threads.with_issue
end
def self.general_threads_from_group(group)
group.threads.without_issue
end
def self.recent_involved_with(user, limit)
user.involved_threads.order_by_latest_message.limit(limit)
end
def self.recent_public
MessageThread.public.order_by_latest_message
end
end
## Instruction:
Order threads by latest message.
## Code After:
class ThreadList
def self.recent_from_groups(groups, limit)
MessageThread.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.recent_public_from_groups(groups, limit)
MessageThread.public.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.issue_threads_from_group(group)
group.threads.order_by_latest_message.with_issue
end
def self.general_threads_from_group(group)
group.threads.order_by_latest_message.without_issue
end
def self.recent_involved_with(user, limit)
user.involved_threads.order_by_latest_message.limit(limit)
end
def self.recent_public
MessageThread.public.order_by_latest_message
end
end
| class ThreadList
def self.recent_from_groups(groups, limit)
MessageThread.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.recent_public_from_groups(groups, limit)
MessageThread.public.where(group_id: groups).order_by_latest_message.limit(limit)
end
def self.issue_threads_from_group(group)
- group.threads.with_issue
+ group.threads.order_by_latest_message.with_issue
end
def self.general_threads_from_group(group)
- group.threads.without_issue
+ group.threads.order_by_latest_message.without_issue
end
def self.recent_involved_with(user, limit)
user.involved_threads.order_by_latest_message.limit(limit)
end
def self.recent_public
MessageThread.public.order_by_latest_message
end
end | 4 | 0.16 | 2 | 2 |
33beb7569c13d185e9603d56b2f3268ff591d0c1 | creational/object_pool.go | creational/object_pool.go | package creational
| package creational
import "sync"
// PoolObject represents the object to be stored in the Pool.
type PoolObject struct {
}
// Pool represents the pool of objects to use.
type Pool struct {
*sync.Mutex
inuse []*PoolObject
available []*PoolObject
}
// NewPool creates a new pool.
func NewPool() *Pool {
return &Pool{}
}
// Acquire acquires a new PoolObject to use from the pool.
// Here acquire creates a new instance of a PoolObject if none available.
func (p *Pool) Acquire() *PoolObject {
p.Lock()
var object *PoolObject = nil
if len(p.available) != 0 {
object = p.available[0]
p.available = append(p.available[:0], p.available[1:]...)
p.inuse = append(p.inuse, object)
} else {
object := &PoolObject{}
p.inuse = append(p.inuse, object)
}
p.Unlock()
return object
}
// Release releases a PoolObject back to the Pool.
func (p *Pool) Release(object *PoolObject) {
p.Lock()
p.available = append(p.available, object)
for i, v := range p.inuse {
if v == object {
p.inuse = append(p.inuse[:i], p.inuse[i+1:]...)
break
}
}
p.Unlock()
}
| Add initial version of object pool | Add initial version of object pool
| Go | mit | bvwells/go-patterns,bvwells/go-patterns | go | ## Code Before:
package creational
## Instruction:
Add initial version of object pool
## Code After:
package creational
import "sync"
// PoolObject represents the object to be stored in the Pool.
type PoolObject struct {
}
// Pool represents the pool of objects to use.
type Pool struct {
*sync.Mutex
inuse []*PoolObject
available []*PoolObject
}
// NewPool creates a new pool.
func NewPool() *Pool {
return &Pool{}
}
// Acquire acquires a new PoolObject to use from the pool.
// Here acquire creates a new instance of a PoolObject if none available.
func (p *Pool) Acquire() *PoolObject {
p.Lock()
var object *PoolObject = nil
if len(p.available) != 0 {
object = p.available[0]
p.available = append(p.available[:0], p.available[1:]...)
p.inuse = append(p.inuse, object)
} else {
object := &PoolObject{}
p.inuse = append(p.inuse, object)
}
p.Unlock()
return object
}
// Release releases a PoolObject back to the Pool.
func (p *Pool) Release(object *PoolObject) {
p.Lock()
p.available = append(p.available, object)
for i, v := range p.inuse {
if v == object {
p.inuse = append(p.inuse[:i], p.inuse[i+1:]...)
break
}
}
p.Unlock()
}
| package creational
+
+ import "sync"
+
+ // PoolObject represents the object to be stored in the Pool.
+ type PoolObject struct {
+ }
+
+ // Pool represents the pool of objects to use.
+ type Pool struct {
+ *sync.Mutex
+ inuse []*PoolObject
+ available []*PoolObject
+ }
+
+ // NewPool creates a new pool.
+ func NewPool() *Pool {
+ return &Pool{}
+ }
+
+ // Acquire acquires a new PoolObject to use from the pool.
+ // Here acquire creates a new instance of a PoolObject if none available.
+ func (p *Pool) Acquire() *PoolObject {
+ p.Lock()
+ var object *PoolObject = nil
+ if len(p.available) != 0 {
+ object = p.available[0]
+ p.available = append(p.available[:0], p.available[1:]...)
+ p.inuse = append(p.inuse, object)
+ } else {
+ object := &PoolObject{}
+ p.inuse = append(p.inuse, object)
+ }
+ p.Unlock()
+ return object
+ }
+
+ // Release releases a PoolObject back to the Pool.
+ func (p *Pool) Release(object *PoolObject) {
+ p.Lock()
+ p.available = append(p.available, object)
+ for i, v := range p.inuse {
+ if v == object {
+ p.inuse = append(p.inuse[:i], p.inuse[i+1:]...)
+ break
+ }
+ }
+ p.Unlock()
+ } | 48 | 48 | 48 | 0 |
306b9e4fcd0aa63cdf6b5581c9ed38f64cb5ab60 | readme.md | readme.md | Kevatkartano Modules
====================
A set of modules used in [http://www.kevatkartano.com/](http://www.kevatkartano.com/), which is my private site, playground, and blog. As such they are pretty specific to my site, although they may show some concepts that are useful elsewhere. *Use at your own risk.*
These modules depend on the following
* [jQuery](http://jquery.com)
* [Q](https://github.com/kriskowal/q) -- Promise support
* [HTML5-History-API](https://github.com/devote/HTML5-History-API) -- implementing HTML5 history in older browsers.
Modules
-------
These are currently:
* effects -- reusable visual effects
* ajaxify -- allows fetching next/previous articles via AJAX and updates browser history as needed.
The modules are based on the [sub-module pattern](http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth).
| Kevatkartano Modules
====================
A set of modules used in [http://www.kevatkartano.com/](http://www.kevatkartano.com/), which is my private site, playground, and blog. As such they are pretty specific to my site, although they may show some concepts that are useful elsewhere. *Use at your own risk.*
These modules depend on the following
* [jQuery](http://jquery.com)
* [Q](https://github.com/kriskowal/q) -- Promise support
Modules
-------
These are currently:
* effects -- reusable visual effects
* ajaxify -- allows fetching next/previous articles via AJAX and updates browser history as needed.
The modules are based on the [sub-module pattern](http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth).
| Remove dependency on History shim | Remove dependency on History shim
Not used since it made the CMS too complicated.
| Markdown | mit | jodyfanning/kevatkartano | markdown | ## Code Before:
Kevatkartano Modules
====================
A set of modules used in [http://www.kevatkartano.com/](http://www.kevatkartano.com/), which is my private site, playground, and blog. As such they are pretty specific to my site, although they may show some concepts that are useful elsewhere. *Use at your own risk.*
These modules depend on the following
* [jQuery](http://jquery.com)
* [Q](https://github.com/kriskowal/q) -- Promise support
* [HTML5-History-API](https://github.com/devote/HTML5-History-API) -- implementing HTML5 history in older browsers.
Modules
-------
These are currently:
* effects -- reusable visual effects
* ajaxify -- allows fetching next/previous articles via AJAX and updates browser history as needed.
The modules are based on the [sub-module pattern](http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth).
## Instruction:
Remove dependency on History shim
Not used since it made the CMS too complicated.
## Code After:
Kevatkartano Modules
====================
A set of modules used in [http://www.kevatkartano.com/](http://www.kevatkartano.com/), which is my private site, playground, and blog. As such they are pretty specific to my site, although they may show some concepts that are useful elsewhere. *Use at your own risk.*
These modules depend on the following
* [jQuery](http://jquery.com)
* [Q](https://github.com/kriskowal/q) -- Promise support
Modules
-------
These are currently:
* effects -- reusable visual effects
* ajaxify -- allows fetching next/previous articles via AJAX and updates browser history as needed.
The modules are based on the [sub-module pattern](http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth).
| Kevatkartano Modules
====================
A set of modules used in [http://www.kevatkartano.com/](http://www.kevatkartano.com/), which is my private site, playground, and blog. As such they are pretty specific to my site, although they may show some concepts that are useful elsewhere. *Use at your own risk.*
These modules depend on the following
* [jQuery](http://jquery.com)
* [Q](https://github.com/kriskowal/q) -- Promise support
- * [HTML5-History-API](https://github.com/devote/HTML5-History-API) -- implementing HTML5 history in older browsers.
Modules
-------
These are currently:
* effects -- reusable visual effects
* ajaxify -- allows fetching next/previous articles via AJAX and updates browser history as needed.
The modules are based on the [sub-module pattern](http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth). | 1 | 0.058824 | 0 | 1 |
7f5f353897b48bf6f9c30787989cf03c229127a3 | app/templates/src/test/javascript/spec/helpers/_httpBackend.js | app/templates/src/test/javascript/spec/helpers/_httpBackend.js | function mockApiAccountCall() {
inject(function($httpBackend) {
$httpBackend.whenGET(/api\/account.*/).respond({});
});
}
function mockI18nCalls() {
inject(function($httpBackend) {
$httpBackend.whenGET(/i18n\/[a-z][a-z]\/.+\.json/).respond({});
});
}
| function mockApiAccountCall() {
inject(function($httpBackend) {
$httpBackend.whenGET(/api\/account.*/).respond({});
});
}
function mockI18nCalls() {
inject(function($httpBackend) {
$httpBackend.whenGET(/i18n\/.*\/.+\.json/).respond({});
});
}
| Fix build issue for adding Chinese Simplified ("zh-cn") language | Fix build issue for adding Chinese Simplified ("zh-cn") language
| JavaScript | apache-2.0 | stevehouel/generator-jhipster,rifatdover/generator-jhipster,gzsombor/generator-jhipster,danielpetisme/generator-jhipster,atomfrede/generator-jhipster,sendilkumarn/generator-jhipster,vivekmore/generator-jhipster,eosimosu/generator-jhipster,liseri/generator-jhipster,erikkemperman/generator-jhipster,Tcharl/generator-jhipster,dynamicguy/generator-jhipster,jhipster/generator-jhipster,gmarziou/generator-jhipster,xetys/generator-jhipster,mosoft521/generator-jhipster,sohibegit/generator-jhipster,sohibegit/generator-jhipster,danielpetisme/generator-jhipster,yongli82/generator-jhipster,lrkwz/generator-jhipster,danielpetisme/generator-jhipster,maniacneron/generator-jhipster,vivekmore/generator-jhipster,rkohel/generator-jhipster,eosimosu/generator-jhipster,dalbelap/generator-jhipster,wmarques/generator-jhipster,siliconharborlabs/generator-jhipster,JulienMrgrd/generator-jhipster,dalbelap/generator-jhipster,liseri/generator-jhipster,mosoft521/generator-jhipster,nkolosnjaji/generator-jhipster,eosimosu/generator-jhipster,deepu105/generator-jhipster,dimeros/generator-jhipster,cbornet/generator-jhipster,gmarziou/generator-jhipster,ziogiugno/generator-jhipster,ctamisier/generator-jhipster,robertmilowski/generator-jhipster,sohibegit/generator-jhipster,ramzimaalej/generator-jhipster,robertmilowski/generator-jhipster,cbornet/generator-jhipster,jkutner/generator-jhipster,baskeboler/generator-jhipster,gzsombor/generator-jhipster,stevehouel/generator-jhipster,jkutner/generator-jhipster,gzsombor/generator-jhipster,baskeboler/generator-jhipster,ctamisier/generator-jhipster,siliconharborlabs/generator-jhipster,lrkwz/generator-jhipster,hdurix/generator-jhipster,jhipster/generator-jhipster,ctamisier/generator-jhipster,baskeboler/generator-jhipster,maniacneron/generator-jhipster,JulienMrgrd/generator-jhipster,erikkemperman/generator-jhipster,rifatdover/generator-jhipster,yongli82/generator-jhipster,JulienMrgrd/generator-jhipster,rkohel/generator-jhipster,danielpetisme/generator-jhipster,dalbelap/generator-jhipster,liseri/generator-jhipster,Tcharl/generator-jhipster,jhipster/generator-jhipster,sendilkumarn/generator-jhipster,dimeros/generator-jhipster,jkutner/generator-jhipster,mraible/generator-jhipster,robertmilowski/generator-jhipster,ctamisier/generator-jhipster,pascalgrimaud/generator-jhipster,rkohel/generator-jhipster,Tcharl/generator-jhipster,vivekmore/generator-jhipster,mraible/generator-jhipster,duderoot/generator-jhipster,hdurix/generator-jhipster,ziogiugno/generator-jhipster,robertmilowski/generator-jhipster,wmarques/generator-jhipster,ruddell/generator-jhipster,eosimosu/generator-jhipster,wmarques/generator-jhipster,siliconharborlabs/generator-jhipster,vivekmore/generator-jhipster,xetys/generator-jhipster,cbornet/generator-jhipster,yongli82/generator-jhipster,ziogiugno/generator-jhipster,PierreBesson/generator-jhipster,gzsombor/generator-jhipster,deepu105/generator-jhipster,cbornet/generator-jhipster,jkutner/generator-jhipster,deepu105/generator-jhipster,deepu105/generator-jhipster,liseri/generator-jhipster,gzsombor/generator-jhipster,stevehouel/generator-jhipster,PierreBesson/generator-jhipster,nkolosnjaji/generator-jhipster,deepu105/generator-jhipster,mraible/generator-jhipster,dalbelap/generator-jhipster,erikkemperman/generator-jhipster,gmarziou/generator-jhipster,danielpetisme/generator-jhipster,PierreBesson/generator-jhipster,dimeros/generator-jhipster,liseri/generator-jhipster,PierreBesson/generator-jhipster,hdurix/generator-jhipster,ramzimaalej/generator-jhipster,dynamicguy/generator-jhipster,ziogiugno/generator-jhipster,jhipster/generator-jhipster,stevehouel/generator-jhipster,dimeros/generator-jhipster,baskeboler/generator-jhipster,pascalgrimaud/generator-jhipster,yongli82/generator-jhipster,ctamisier/generator-jhipster,hdurix/generator-jhipster,eosimosu/generator-jhipster,nkolosnjaji/generator-jhipster,erikkemperman/generator-jhipster,lrkwz/generator-jhipster,maniacneron/generator-jhipster,sendilkumarn/generator-jhipster,stevehouel/generator-jhipster,mosoft521/generator-jhipster,sendilkumarn/generator-jhipster,duderoot/generator-jhipster,PierreBesson/generator-jhipster,maniacneron/generator-jhipster,gmarziou/generator-jhipster,hdurix/generator-jhipster,baskeboler/generator-jhipster,ziogiugno/generator-jhipster,rkohel/generator-jhipster,duderoot/generator-jhipster,cbornet/generator-jhipster,dimeros/generator-jhipster,ruddell/generator-jhipster,jkutner/generator-jhipster,pascalgrimaud/generator-jhipster,maniacneron/generator-jhipster,nkolosnjaji/generator-jhipster,gmarziou/generator-jhipster,sohibegit/generator-jhipster,mraible/generator-jhipster,rkohel/generator-jhipster,siliconharborlabs/generator-jhipster,ruddell/generator-jhipster,dynamicguy/generator-jhipster,duderoot/generator-jhipster,siliconharborlabs/generator-jhipster,duderoot/generator-jhipster,atomfrede/generator-jhipster,ramzimaalej/generator-jhipster,dalbelap/generator-jhipster,pascalgrimaud/generator-jhipster,sendilkumarn/generator-jhipster,dynamicguy/generator-jhipster,lrkwz/generator-jhipster,atomfrede/generator-jhipster,jhipster/generator-jhipster,sohibegit/generator-jhipster,wmarques/generator-jhipster,Tcharl/generator-jhipster,erikkemperman/generator-jhipster,pascalgrimaud/generator-jhipster,atomfrede/generator-jhipster,mosoft521/generator-jhipster,nkolosnjaji/generator-jhipster,mosoft521/generator-jhipster,vivekmore/generator-jhipster,mraible/generator-jhipster,atomfrede/generator-jhipster,JulienMrgrd/generator-jhipster,JulienMrgrd/generator-jhipster,Tcharl/generator-jhipster,wmarques/generator-jhipster,xetys/generator-jhipster,ruddell/generator-jhipster,ruddell/generator-jhipster,yongli82/generator-jhipster,xetys/generator-jhipster,robertmilowski/generator-jhipster,rifatdover/generator-jhipster,lrkwz/generator-jhipster | javascript | ## Code Before:
function mockApiAccountCall() {
inject(function($httpBackend) {
$httpBackend.whenGET(/api\/account.*/).respond({});
});
}
function mockI18nCalls() {
inject(function($httpBackend) {
$httpBackend.whenGET(/i18n\/[a-z][a-z]\/.+\.json/).respond({});
});
}
## Instruction:
Fix build issue for adding Chinese Simplified ("zh-cn") language
## Code After:
function mockApiAccountCall() {
inject(function($httpBackend) {
$httpBackend.whenGET(/api\/account.*/).respond({});
});
}
function mockI18nCalls() {
inject(function($httpBackend) {
$httpBackend.whenGET(/i18n\/.*\/.+\.json/).respond({});
});
}
| function mockApiAccountCall() {
inject(function($httpBackend) {
$httpBackend.whenGET(/api\/account.*/).respond({});
});
}
function mockI18nCalls() {
inject(function($httpBackend) {
- $httpBackend.whenGET(/i18n\/[a-z][a-z]\/.+\.json/).respond({});
? ^^^^^^^^^^
+ $httpBackend.whenGET(/i18n\/.*\/.+\.json/).respond({});
? ^^
});
} | 2 | 0.181818 | 1 | 1 |
71a254cdc3137a23e61cccc1de2bb65df6aa2d32 | ontology-rest/src/main/java/uk/ac/ebi/quickgo/ontology/metadata/MetaDataProvider.java | ontology-rest/src/main/java/uk/ac/ebi/quickgo/ontology/metadata/MetaDataProvider.java | package uk.ac.ebi.quickgo.ontology.metadata;
import uk.ac.ebi.quickgo.common.loader.GZIPFiles;
import uk.ac.ebi.quickgo.rest.metadata.MetaData;
import java.nio.file.Path;
import java.util.List;
import static java.util.stream.Collectors.toList;
/**
* Populate a MetaData instance with information about the data provided by this service
*
* @author Tony Wardell
* Date: 07/03/2017
* Time: 10:51
* Created with IntelliJ IDEA.
*/
public class MetaDataProvider {
private final Path ontologyPath;
public MetaDataProvider(Path ontologyPath) {
this.ontologyPath = ontologyPath;
}
public MetaData lookupMetaData() {
List<MetaData> goLines = GZIPFiles.lines(ontologyPath)
.skip(1)
.filter(s -> s.startsWith("GO"))
.limit(1)
.map(s -> {
String[] a = s.split("\t");
return new MetaData(a[2], a[1]);
})
.collect(toList());
return (goLines.size() == 1) ? goLines.get(0) : null;
}
}
| package uk.ac.ebi.quickgo.ontology.metadata;
import uk.ac.ebi.quickgo.common.loader.GZIPFiles;
import uk.ac.ebi.quickgo.rest.metadata.MetaData;
import uk.ac.ebi.quickgo.rest.service.ServiceConfigException;
import com.google.common.base.Preconditions;
import java.nio.file.Path;
import java.util.List;
import static java.util.stream.Collectors.toList;
/**
* Populate a MetaData instance with information about the data provided by this service
*
* @author Tony Wardell
* Date: 07/03/2017
* Time: 10:51
* Created with IntelliJ IDEA.
*/
public class MetaDataProvider {
private final Path ontologyPath;
public MetaDataProvider(Path ontologyPath) {
Preconditions.checkArgument(ontologyPath != null, "The path to the source of the Ontology metadata cannot " +
"be null.");
this.ontologyPath = ontologyPath;
}
/**
* Lookup the MetaData for the Ontology service
* @return MetaData instance
*/
public MetaData lookupMetaData() {
try {
List<MetaData> goLines = GZIPFiles.lines(ontologyPath)
.skip(1)
.filter(s -> s.startsWith("GO"))
.map(s -> {
String[] a = s.split("\t");
return new MetaData(a[2], a[1]);
})
.collect(toList());
Preconditions.checkState(goLines.size() == 1, "Unable to read the correct number of lines for Ontology " +
"metadata");
return goLines.get(0);
} catch (Exception e) {
throw new ServiceConfigException(e);
}
}
}
| Add preconditions, cope with exception during file read. | Add preconditions, cope with exception during file read.
| Java | apache-2.0 | ebi-uniprot/QuickGOBE,ebi-uniprot/QuickGOBE,ebi-uniprot/QuickGOBE,ebi-uniprot/QuickGOBE,ebi-uniprot/QuickGOBE | java | ## Code Before:
package uk.ac.ebi.quickgo.ontology.metadata;
import uk.ac.ebi.quickgo.common.loader.GZIPFiles;
import uk.ac.ebi.quickgo.rest.metadata.MetaData;
import java.nio.file.Path;
import java.util.List;
import static java.util.stream.Collectors.toList;
/**
* Populate a MetaData instance with information about the data provided by this service
*
* @author Tony Wardell
* Date: 07/03/2017
* Time: 10:51
* Created with IntelliJ IDEA.
*/
public class MetaDataProvider {
private final Path ontologyPath;
public MetaDataProvider(Path ontologyPath) {
this.ontologyPath = ontologyPath;
}
public MetaData lookupMetaData() {
List<MetaData> goLines = GZIPFiles.lines(ontologyPath)
.skip(1)
.filter(s -> s.startsWith("GO"))
.limit(1)
.map(s -> {
String[] a = s.split("\t");
return new MetaData(a[2], a[1]);
})
.collect(toList());
return (goLines.size() == 1) ? goLines.get(0) : null;
}
}
## Instruction:
Add preconditions, cope with exception during file read.
## Code After:
package uk.ac.ebi.quickgo.ontology.metadata;
import uk.ac.ebi.quickgo.common.loader.GZIPFiles;
import uk.ac.ebi.quickgo.rest.metadata.MetaData;
import uk.ac.ebi.quickgo.rest.service.ServiceConfigException;
import com.google.common.base.Preconditions;
import java.nio.file.Path;
import java.util.List;
import static java.util.stream.Collectors.toList;
/**
* Populate a MetaData instance with information about the data provided by this service
*
* @author Tony Wardell
* Date: 07/03/2017
* Time: 10:51
* Created with IntelliJ IDEA.
*/
public class MetaDataProvider {
private final Path ontologyPath;
public MetaDataProvider(Path ontologyPath) {
Preconditions.checkArgument(ontologyPath != null, "The path to the source of the Ontology metadata cannot " +
"be null.");
this.ontologyPath = ontologyPath;
}
/**
* Lookup the MetaData for the Ontology service
* @return MetaData instance
*/
public MetaData lookupMetaData() {
try {
List<MetaData> goLines = GZIPFiles.lines(ontologyPath)
.skip(1)
.filter(s -> s.startsWith("GO"))
.map(s -> {
String[] a = s.split("\t");
return new MetaData(a[2], a[1]);
})
.collect(toList());
Preconditions.checkState(goLines.size() == 1, "Unable to read the correct number of lines for Ontology " +
"metadata");
return goLines.get(0);
} catch (Exception e) {
throw new ServiceConfigException(e);
}
}
}
| package uk.ac.ebi.quickgo.ontology.metadata;
import uk.ac.ebi.quickgo.common.loader.GZIPFiles;
import uk.ac.ebi.quickgo.rest.metadata.MetaData;
+ import uk.ac.ebi.quickgo.rest.service.ServiceConfigException;
+ import com.google.common.base.Preconditions;
import java.nio.file.Path;
import java.util.List;
import static java.util.stream.Collectors.toList;
/**
* Populate a MetaData instance with information about the data provided by this service
*
* @author Tony Wardell
* Date: 07/03/2017
* Time: 10:51
* Created with IntelliJ IDEA.
*/
public class MetaDataProvider {
private final Path ontologyPath;
public MetaDataProvider(Path ontologyPath) {
+ Preconditions.checkArgument(ontologyPath != null, "The path to the source of the Ontology metadata cannot " +
+ "be null.");
this.ontologyPath = ontologyPath;
}
+ /**
+ * Lookup the MetaData for the Ontology service
+ * @return MetaData instance
+ */
public MetaData lookupMetaData() {
+ try {
- List<MetaData> goLines = GZIPFiles.lines(ontologyPath)
+ List<MetaData> goLines = GZIPFiles.lines(ontologyPath)
? ++++
- .skip(1)
+ .skip(1)
? ++++
- .filter(s -> s.startsWith("GO"))
+ .filter(s -> s.startsWith("GO"))
? ++++
- .limit(1)
- .map(s -> {
+ .map(s -> {
? ++++
- String[] a = s.split("\t");
+ String[] a = s.split("\t");
? ++++
- return new MetaData(a[2], a[1]);
+ return new MetaData(a[2], a[1]);
? ++++
- })
+ })
? ++++
- .collect(toList());
+ .collect(toList());
? ++++
- return (goLines.size() == 1) ? goLines.get(0) : null;
+ Preconditions.checkState(goLines.size() == 1, "Unable to read the correct number of lines for Ontology " +
+ "metadata");
+ return goLines.get(0);
+ } catch (Exception e) {
+ throw new ServiceConfigException(e);
+ }
+
}
} | 34 | 0.894737 | 24 | 10 |
57befd8b2514af3df7dd6b9db4a464ab62877229 | resources/views/keys/show.blade.php | resources/views/keys/show.blade.php | @extends('layout.master')
@section('main_content')
@include('layout.header', ['header' => 'API Keys', 'subtitle' => 'Northstar application access & permissions'])
<div class="container -padded">
<div class="wrapper">
<div class="container__block">
<h1>{{ $key->app_id }}</h1>
</div>
<div class="container__block">
<h4>Credentials:</h4>
<!-- Strange indentation due to `<pre>` tag respecting all whitespace. -->
<pre> X-DS-Application-Id: {{ $key->app_id }}
X-DS-REST-API-Key: {{ $key->api_key }}</pre>
</div>
<div class="container__block">
<h4>Scopes</h4>
<ul class="list -compacted">
@foreach($key->scope as $scope)
<li>{{ $scope }}</li>
@endforeach
</ul>
</div>
<div class="container__block">
<ul class="form-actions -inline">
<li><a class="button -secondary" href="{{ route('keys.edit', [ $key->api_key]) }}">Edit Key</a></li>
<li>
<form action="{{ route('keys.destroy', $key->api_key) }}" method="POST">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button class="button -secondary -danger">Delete Key</button>
</form>
</li>
</ul>
</div>
</div>
</div>
@stop
| @extends('layout.master')
@section('main_content')
@include('layout.header', ['header' => 'API Keys', 'subtitle' => 'Northstar application access & permissions'])
<div class="container -padded">
<div class="wrapper">
<div class="container__block">
<h1>{{ $key->app_id }}</h1>
</div>
<div class="container__block">
<h4>Credentials:</h4>
<pre>X-DS-REST-API-Key: {{ $key->api_key }}</pre>
<p class="footnote">Send this header with any requests to use this API key.</p>
</div>
<div class="container__block">
<h4>Scopes</h4>
<ul class="list -compacted">
@foreach($key->scope as $scope)
<li>{{ $scope }}</li>
@endforeach
</ul>
</div>
<div class="container__block">
<ul class="form-actions -inline">
<li><a class="button -secondary" href="{{ route('keys.edit', [ $key->api_key]) }}">Edit Key</a></li>
<li>
<form action="{{ route('keys.destroy', $key->api_key) }}" method="POST">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button class="button -secondary -danger">Delete Key</button>
</form>
</li>
</ul>
</div>
</div>
</div>
@stop
| Remove application ID header from example. | Remove application ID header from example.
This is no longer required, so no need to present it in the admin panel.
| PHP | mit | DoSomething/aurora,DoSomething/aurora,DoSomething/aurora | php | ## Code Before:
@extends('layout.master')
@section('main_content')
@include('layout.header', ['header' => 'API Keys', 'subtitle' => 'Northstar application access & permissions'])
<div class="container -padded">
<div class="wrapper">
<div class="container__block">
<h1>{{ $key->app_id }}</h1>
</div>
<div class="container__block">
<h4>Credentials:</h4>
<!-- Strange indentation due to `<pre>` tag respecting all whitespace. -->
<pre> X-DS-Application-Id: {{ $key->app_id }}
X-DS-REST-API-Key: {{ $key->api_key }}</pre>
</div>
<div class="container__block">
<h4>Scopes</h4>
<ul class="list -compacted">
@foreach($key->scope as $scope)
<li>{{ $scope }}</li>
@endforeach
</ul>
</div>
<div class="container__block">
<ul class="form-actions -inline">
<li><a class="button -secondary" href="{{ route('keys.edit', [ $key->api_key]) }}">Edit Key</a></li>
<li>
<form action="{{ route('keys.destroy', $key->api_key) }}" method="POST">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button class="button -secondary -danger">Delete Key</button>
</form>
</li>
</ul>
</div>
</div>
</div>
@stop
## Instruction:
Remove application ID header from example.
This is no longer required, so no need to present it in the admin panel.
## Code After:
@extends('layout.master')
@section('main_content')
@include('layout.header', ['header' => 'API Keys', 'subtitle' => 'Northstar application access & permissions'])
<div class="container -padded">
<div class="wrapper">
<div class="container__block">
<h1>{{ $key->app_id }}</h1>
</div>
<div class="container__block">
<h4>Credentials:</h4>
<pre>X-DS-REST-API-Key: {{ $key->api_key }}</pre>
<p class="footnote">Send this header with any requests to use this API key.</p>
</div>
<div class="container__block">
<h4>Scopes</h4>
<ul class="list -compacted">
@foreach($key->scope as $scope)
<li>{{ $scope }}</li>
@endforeach
</ul>
</div>
<div class="container__block">
<ul class="form-actions -inline">
<li><a class="button -secondary" href="{{ route('keys.edit', [ $key->api_key]) }}">Edit Key</a></li>
<li>
<form action="{{ route('keys.destroy', $key->api_key) }}" method="POST">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button class="button -secondary -danger">Delete Key</button>
</form>
</li>
</ul>
</div>
</div>
</div>
@stop
| @extends('layout.master')
@section('main_content')
@include('layout.header', ['header' => 'API Keys', 'subtitle' => 'Northstar application access & permissions'])
<div class="container -padded">
<div class="wrapper">
<div class="container__block">
<h1>{{ $key->app_id }}</h1>
</div>
<div class="container__block">
<h4>Credentials:</h4>
- <!-- Strange indentation due to `<pre>` tag respecting all whitespace. -->
- <pre> X-DS-Application-Id: {{ $key->app_id }}
- X-DS-REST-API-Key: {{ $key->api_key }}</pre>
+ <pre>X-DS-REST-API-Key: {{ $key->api_key }}</pre>
? +++++++++++++++++++
+ <p class="footnote">Send this header with any requests to use this API key.</p>
</div>
<div class="container__block">
<h4>Scopes</h4>
<ul class="list -compacted">
@foreach($key->scope as $scope)
<li>{{ $scope }}</li>
@endforeach
</ul>
</div>
<div class="container__block">
<ul class="form-actions -inline">
<li><a class="button -secondary" href="{{ route('keys.edit', [ $key->api_key]) }}">Edit Key</a></li>
<li>
<form action="{{ route('keys.destroy', $key->api_key) }}" method="POST">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button class="button -secondary -danger">Delete Key</button>
</form>
</li>
</ul>
</div>
</div>
</div>
@stop | 5 | 0.113636 | 2 | 3 |
a8922e4d2b2b5c4e4d5f1330264a2a16c273e6cb | README.md | README.md | A Python bot designed to create original tweets from the most recent @realdonaldtrump tweets.
[@trumpatron1](https://twitter.com/trumpatron1)
## Usage
Nothing is easier than running this application. It's the greatest syntax ever, believe me!
```bash
# ./trumpatron.py
```
### Customizing Application
A configuration file is used by the application for various settings, mostly related to Twitter API authentication.
It's located at `conf/main.cfg`. Open the file to take a look at the various settings and customize them to your liking.
# What is this?
The @trumpatron1 Twitter account is a mock account ran by this bot. At a regular interval, this bot runs, fetches
the most recent @realdonaldtrump tweets, and mixes statements from those tweets together to create a new, original Tweet.
After being generated, it's tweeted to the @trumpatron1 account. | A Python bot designed to create original tweets from the most recent @realdonaldtrump tweets.
[@trumpatron1](https://twitter.com/trumpatron1)
## Usage
Nothing is easier than running this application. It's the greatest syntax ever, believe me!
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -h
usage: trumpatron.py [-h] [-c CONFIG] [-n NUM_CLAUSES] [-y]
A Python bot designed to create original tweets from the most recent
@realdonaldtrump tweets.
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Configuration file to be used
-n NUM_CLAUSES, --num-clauses NUM_CLAUSES
Number of clauses to use in Tweet
-y, --assume-yes Assume YES for all prompts
```
### Examples
Use tertiary config file:
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -c conf/tertiary.cfg
```
Assume yes to all prompts using the default settings (automated tweeting):
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -y
```
Use the settings in `conf/secondary.cfg`, generate a tweet with three clauses, and assume yes for all prompts:
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -c conf/secondary.cfg -n 3 -y
```
### Customizing Application
A configuration file is used by the application for various settings, mostly related to Twitter API authentication.
It's located at `conf/main.cfg`. Open the file to take a look at the various settings and customize them to your liking.
# What is this?
The @trumpatron1 Twitter account is a mock account ran by this bot. At a regular interval, this bot runs, fetches
the most recent @realdonaldtrump tweets, and mixes statements from those tweets together to create a new, original Tweet.
After being generated, it's tweeted to the @trumpatron1 account. | Add Documentation for CLI Param Support | Add Documentation for CLI Param Support
| Markdown | mit | magneticstain/TrumpaTron,magneticstain/TrumpaTron | markdown | ## Code Before:
A Python bot designed to create original tweets from the most recent @realdonaldtrump tweets.
[@trumpatron1](https://twitter.com/trumpatron1)
## Usage
Nothing is easier than running this application. It's the greatest syntax ever, believe me!
```bash
# ./trumpatron.py
```
### Customizing Application
A configuration file is used by the application for various settings, mostly related to Twitter API authentication.
It's located at `conf/main.cfg`. Open the file to take a look at the various settings and customize them to your liking.
# What is this?
The @trumpatron1 Twitter account is a mock account ran by this bot. At a regular interval, this bot runs, fetches
the most recent @realdonaldtrump tweets, and mixes statements from those tweets together to create a new, original Tweet.
After being generated, it's tweeted to the @trumpatron1 account.
## Instruction:
Add Documentation for CLI Param Support
## Code After:
A Python bot designed to create original tweets from the most recent @realdonaldtrump tweets.
[@trumpatron1](https://twitter.com/trumpatron1)
## Usage
Nothing is easier than running this application. It's the greatest syntax ever, believe me!
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -h
usage: trumpatron.py [-h] [-c CONFIG] [-n NUM_CLAUSES] [-y]
A Python bot designed to create original tweets from the most recent
@realdonaldtrump tweets.
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Configuration file to be used
-n NUM_CLAUSES, --num-clauses NUM_CLAUSES
Number of clauses to use in Tweet
-y, --assume-yes Assume YES for all prompts
```
### Examples
Use tertiary config file:
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -c conf/tertiary.cfg
```
Assume yes to all prompts using the default settings (automated tweeting):
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -y
```
Use the settings in `conf/secondary.cfg`, generate a tweet with three clauses, and assume yes for all prompts:
```bash
bot@trumpatron1 ~ $ ./trumpatron.py -c conf/secondary.cfg -n 3 -y
```
### Customizing Application
A configuration file is used by the application for various settings, mostly related to Twitter API authentication.
It's located at `conf/main.cfg`. Open the file to take a look at the various settings and customize them to your liking.
# What is this?
The @trumpatron1 Twitter account is a mock account ran by this bot. At a regular interval, this bot runs, fetches
the most recent @realdonaldtrump tweets, and mixes statements from those tweets together to create a new, original Tweet.
After being generated, it's tweeted to the @trumpatron1 account. | A Python bot designed to create original tweets from the most recent @realdonaldtrump tweets.
[@trumpatron1](https://twitter.com/trumpatron1)
## Usage
Nothing is easier than running this application. It's the greatest syntax ever, believe me!
```bash
- # ./trumpatron.py
+ bot@trumpatron1 ~ $ ./trumpatron.py -h
+ usage: trumpatron.py [-h] [-c CONFIG] [-n NUM_CLAUSES] [-y]
+
+ A Python bot designed to create original tweets from the most recent
+ @realdonaldtrump tweets.
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -c CONFIG, --config CONFIG
+ Configuration file to be used
+ -n NUM_CLAUSES, --num-clauses NUM_CLAUSES
+ Number of clauses to use in Tweet
+ -y, --assume-yes Assume YES for all prompts
+
```
+
+ ### Examples
+ Use tertiary config file:
+ ```bash
+ bot@trumpatron1 ~ $ ./trumpatron.py -c conf/tertiary.cfg
+ ```
+
+ Assume yes to all prompts using the default settings (automated tweeting):
+ ```bash
+ bot@trumpatron1 ~ $ ./trumpatron.py -y
+ ```
+
+ Use the settings in `conf/secondary.cfg`, generate a tweet with three clauses, and assume yes for all prompts:
+ ```bash
+ bot@trumpatron1 ~ $ ./trumpatron.py -c conf/secondary.cfg -n 3 -y
+ ```
### Customizing Application
A configuration file is used by the application for various settings, mostly related to Twitter API authentication.
It's located at `conf/main.cfg`. Open the file to take a look at the various settings and customize them to your liking.
# What is this?
The @trumpatron1 Twitter account is a mock account ran by this bot. At a regular interval, this bot runs, fetches
the most recent @realdonaldtrump tweets, and mixes statements from those tweets together to create a new, original Tweet.
After being generated, it's tweeted to the @trumpatron1 account. | 31 | 1.631579 | 30 | 1 |
bbaf4584286657582a92d5bb4038a5a06654ebb1 | fetch-pack.h | fetch-pack.h |
struct fetch_pack_args
{
const char *uploadpack;
int quiet;
int keep_pack;
int unpacklimit;
int use_thin_pack;
int fetch_all;
int verbose;
int depth;
int no_progress;
};
void setup_fetch_pack(struct fetch_pack_args *args);
struct ref *fetch_pack(const char *dest, int nr_heads, char **heads, char **pack_lockfile);
#endif
|
struct fetch_pack_args
{
const char *uploadpack;
int unpacklimit;
int depth;
unsigned quiet:1,
keep_pack:1,
use_thin_pack:1,
fetch_all:1,
verbose:1,
no_progress:1;
};
void setup_fetch_pack(struct fetch_pack_args *args);
struct ref *fetch_pack(const char *dest, int nr_heads, char **heads, char **pack_lockfile);
#endif
| Use 'unsigned:1' when we mean boolean options | Use 'unsigned:1' when we mean boolean options
These options are all strictly boolean (true/false). Its easier to
document this implicitly by making their storage type a single bit.
There is no compelling memory space reduction reason for this change,
it just makes the structure definition slightly more readable.
Signed-off-by: Shawn O. Pearce <f01032651c12a22b2103346ba96b3b6b231f9d3c@spearce.org>
| C | mit | destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git | c | ## Code Before:
struct fetch_pack_args
{
const char *uploadpack;
int quiet;
int keep_pack;
int unpacklimit;
int use_thin_pack;
int fetch_all;
int verbose;
int depth;
int no_progress;
};
void setup_fetch_pack(struct fetch_pack_args *args);
struct ref *fetch_pack(const char *dest, int nr_heads, char **heads, char **pack_lockfile);
#endif
## Instruction:
Use 'unsigned:1' when we mean boolean options
These options are all strictly boolean (true/false). Its easier to
document this implicitly by making their storage type a single bit.
There is no compelling memory space reduction reason for this change,
it just makes the structure definition slightly more readable.
Signed-off-by: Shawn O. Pearce <f01032651c12a22b2103346ba96b3b6b231f9d3c@spearce.org>
## Code After:
struct fetch_pack_args
{
const char *uploadpack;
int unpacklimit;
int depth;
unsigned quiet:1,
keep_pack:1,
use_thin_pack:1,
fetch_all:1,
verbose:1,
no_progress:1;
};
void setup_fetch_pack(struct fetch_pack_args *args);
struct ref *fetch_pack(const char *dest, int nr_heads, char **heads, char **pack_lockfile);
#endif
|
struct fetch_pack_args
{
const char *uploadpack;
- int quiet;
- int keep_pack;
int unpacklimit;
- int use_thin_pack;
- int fetch_all;
- int verbose;
int depth;
+ unsigned quiet:1,
+ keep_pack:1,
+ use_thin_pack:1,
+ fetch_all:1,
+ verbose:1,
- int no_progress;
? ^^^^
+ no_progress:1;
? ^ ++
};
void setup_fetch_pack(struct fetch_pack_args *args);
struct ref *fetch_pack(const char *dest, int nr_heads, char **heads, char **pack_lockfile);
#endif | 12 | 0.631579 | 6 | 6 |
3245433b82f8dbfbaf6a388574ba7cb448535c24 | src/editor-prose-mirror/index.js | src/editor-prose-mirror/index.js | var ProseMirror = require("prosemirror/dist/edit").ProseMirror
require("prosemirror/dist/menu/menubar") // Load menubar module
module.exports = {
data: function() {
return {
doc: '',
docFormat: 'html'
}
},
attached: function() {
var self = this;
var editor = new ProseMirror({
menuBar: true,
place: self.$el,
doc: self.doc,
docFormat: self.docFormat
});
editor.on('change', function() {
self.doc = editor.getContent('html');
});
}
};
| var ProseMirror = require("prosemirror/dist/edit").ProseMirror
require("prosemirror/dist/menu/menubar") // Load menubar module
module.exports = {
data: function() {
return {
doc: '<p></p>',
docFormat: 'html'
}
},
attached: function() {
var self = this;
var editor = new ProseMirror({
menuBar: true,
place: self.$el,
doc: self.doc || '<p></p>',
docFormat: self.docFormat
});
editor.on('change', function() {
self.doc = editor.getContent('html');
});
}
};
| Make sure prosemirror always has a default | Make sure prosemirror always has a default
| JavaScript | apache-2.0 | BigBlueHat/BlueInk,BigBlueHat/BlueInk | javascript | ## Code Before:
var ProseMirror = require("prosemirror/dist/edit").ProseMirror
require("prosemirror/dist/menu/menubar") // Load menubar module
module.exports = {
data: function() {
return {
doc: '',
docFormat: 'html'
}
},
attached: function() {
var self = this;
var editor = new ProseMirror({
menuBar: true,
place: self.$el,
doc: self.doc,
docFormat: self.docFormat
});
editor.on('change', function() {
self.doc = editor.getContent('html');
});
}
};
## Instruction:
Make sure prosemirror always has a default
## Code After:
var ProseMirror = require("prosemirror/dist/edit").ProseMirror
require("prosemirror/dist/menu/menubar") // Load menubar module
module.exports = {
data: function() {
return {
doc: '<p></p>',
docFormat: 'html'
}
},
attached: function() {
var self = this;
var editor = new ProseMirror({
menuBar: true,
place: self.$el,
doc: self.doc || '<p></p>',
docFormat: self.docFormat
});
editor.on('change', function() {
self.doc = editor.getContent('html');
});
}
};
| var ProseMirror = require("prosemirror/dist/edit").ProseMirror
require("prosemirror/dist/menu/menubar") // Load menubar module
module.exports = {
data: function() {
return {
- doc: '',
+ doc: '<p></p>',
? +++++++
docFormat: 'html'
}
},
attached: function() {
var self = this;
var editor = new ProseMirror({
menuBar: true,
place: self.$el,
- doc: self.doc,
+ doc: self.doc || '<p></p>',
? +++++++++++++
docFormat: self.docFormat
});
editor.on('change', function() {
self.doc = editor.getContent('html');
});
}
}; | 4 | 0.173913 | 2 | 2 |
cbcc080ceec2b56d2270a216d242460aae85b8cc | _config.yml | _config.yml | title: Researcher
url: "https://ankitsultana.com"
baseurl: "/researcher"
markdown: kramdown
tracking_id: #
footer: yes
footer_url: "https://github.com/bk2dcradle"
footer_text: "Page design by Ankit Sultana"
sass:
style: compressed
sass_dir: _sass
nav:
- name: "Contact"
link: "contact"
- name: "Resume"
link: "resume.pdf"
- name: "About"
link: "/researcher/"
| title: Researcher
url: "https://ankitsultana.com"
baseurl: "/researcher"
markdown: kramdown
tracking_id: #
footer: yes
footer_url: "https://github.com/ankitsultana"
footer_text: "Page design by Ankit Sultana"
sass:
style: compressed
sass_dir: _sass
nav:
- name: "Contact"
link: "contact"
- name: "Resume"
link: "resume.pdf"
- name: "About"
link: "/researcher/"
| Update footer_url with updated username | Update footer_url with updated username | YAML | unlicense | SharonBrizinov/SharonBrizinov.github.io,SharonBrizinov/SharonBrizinov.github.io | yaml | ## Code Before:
title: Researcher
url: "https://ankitsultana.com"
baseurl: "/researcher"
markdown: kramdown
tracking_id: #
footer: yes
footer_url: "https://github.com/bk2dcradle"
footer_text: "Page design by Ankit Sultana"
sass:
style: compressed
sass_dir: _sass
nav:
- name: "Contact"
link: "contact"
- name: "Resume"
link: "resume.pdf"
- name: "About"
link: "/researcher/"
## Instruction:
Update footer_url with updated username
## Code After:
title: Researcher
url: "https://ankitsultana.com"
baseurl: "/researcher"
markdown: kramdown
tracking_id: #
footer: yes
footer_url: "https://github.com/ankitsultana"
footer_text: "Page design by Ankit Sultana"
sass:
style: compressed
sass_dir: _sass
nav:
- name: "Contact"
link: "contact"
- name: "Resume"
link: "resume.pdf"
- name: "About"
link: "/researcher/"
| title: Researcher
url: "https://ankitsultana.com"
baseurl: "/researcher"
markdown: kramdown
tracking_id: #
footer: yes
- footer_url: "https://github.com/bk2dcradle"
? ^ ^^^^ ^^^
+ footer_url: "https://github.com/ankitsultana"
? ^^ ^^^^^^ ^^
footer_text: "Page design by Ankit Sultana"
sass:
style: compressed
sass_dir: _sass
nav:
- name: "Contact"
link: "contact"
- name: "Resume"
link: "resume.pdf"
- name: "About"
link: "/researcher/" | 2 | 0.086957 | 1 | 1 |
5d5b59bde655fbeb2d07bd5539c2ff9b29879d1d | pythontutorials/books/AutomateTheBoringStuff/Ch14/P2_writeCSV.py | pythontutorials/books/AutomateTheBoringStuff/Ch14/P2_writeCSV.py |
import csv
# Writer Objects
outputFile = open("output.csv", "w", newline='')
outputWriter = csv.writer(outputFile)
print(outputWriter.writerow(['spam', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow(['Hello, world!', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow([1, 2, 3.141592, 4]))
outputFile.close()
# Delimiter and lineterminator Keyword Arguments
csvFile = open("example.tsv", 'w', newline='')
csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
print(csvWriter.writerow(['apples', 'oranges', 'grapes']))
print(csvWriter.writerow(['eggs', 'bacon', 'ham']))
print(csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam']))
csvFile.close()
|
def main():
import csv
# Writer Objects
outputFile = open("output.csv", "w", newline='')
outputWriter = csv.writer(outputFile)
print(outputWriter.writerow(['spam', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow(['Hello, world!', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow([1, 2, 3.141592, 4]))
outputFile.close()
# Delimiter and lineterminator Keyword Arguments
csvFile = open("example.tsv", 'w', newline='')
csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
print(csvWriter.writerow(['apples', 'oranges', 'grapes']))
print(csvWriter.writerow(['eggs', 'bacon', 'ham']))
print(csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam']))
csvFile.close()
if __name__ == '__main__':
main()
| Update P1_writeCSV.py added docstring and wrapped in main function | Update P1_writeCSV.py
added docstring and wrapped in main function
| Python | mit | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | python | ## Code Before:
import csv
# Writer Objects
outputFile = open("output.csv", "w", newline='')
outputWriter = csv.writer(outputFile)
print(outputWriter.writerow(['spam', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow(['Hello, world!', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow([1, 2, 3.141592, 4]))
outputFile.close()
# Delimiter and lineterminator Keyword Arguments
csvFile = open("example.tsv", 'w', newline='')
csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
print(csvWriter.writerow(['apples', 'oranges', 'grapes']))
print(csvWriter.writerow(['eggs', 'bacon', 'ham']))
print(csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam']))
csvFile.close()
## Instruction:
Update P1_writeCSV.py
added docstring and wrapped in main function
## Code After:
def main():
import csv
# Writer Objects
outputFile = open("output.csv", "w", newline='')
outputWriter = csv.writer(outputFile)
print(outputWriter.writerow(['spam', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow(['Hello, world!', 'eggs', 'bacon', 'ham']))
print(outputWriter.writerow([1, 2, 3.141592, 4]))
outputFile.close()
# Delimiter and lineterminator Keyword Arguments
csvFile = open("example.tsv", 'w', newline='')
csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
print(csvWriter.writerow(['apples', 'oranges', 'grapes']))
print(csvWriter.writerow(['eggs', 'bacon', 'ham']))
print(csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam']))
csvFile.close()
if __name__ == '__main__':
main()
|
- import csv
+ def main():
+ import csv
- # Writer Objects
- outputFile = open("output.csv", "w", newline='')
- outputWriter = csv.writer(outputFile)
- print(outputWriter.writerow(['spam', 'eggs', 'bacon', 'ham']))
- print(outputWriter.writerow(['Hello, world!', 'eggs', 'bacon', 'ham']))
- print(outputWriter.writerow([1, 2, 3.141592, 4]))
- outputFile.close()
+ # Writer Objects
+ outputFile = open("output.csv", "w", newline='')
+ outputWriter = csv.writer(outputFile)
+ print(outputWriter.writerow(['spam', 'eggs', 'bacon', 'ham']))
+ print(outputWriter.writerow(['Hello, world!', 'eggs', 'bacon', 'ham']))
+ print(outputWriter.writerow([1, 2, 3.141592, 4]))
+ outputFile.close()
+
- # Delimiter and lineterminator Keyword Arguments
+ # Delimiter and lineterminator Keyword Arguments
? ++++
- csvFile = open("example.tsv", 'w', newline='')
+ csvFile = open("example.tsv", 'w', newline='')
? ++++
- csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
+ csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
? ++++
- print(csvWriter.writerow(['apples', 'oranges', 'grapes']))
+ print(csvWriter.writerow(['apples', 'oranges', 'grapes']))
? ++++
- print(csvWriter.writerow(['eggs', 'bacon', 'ham']))
+ print(csvWriter.writerow(['eggs', 'bacon', 'ham']))
? ++++
- print(csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam']))
+ print(csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam']))
? ++++
- csvFile.close()
+ csvFile.close()
? ++++
+
+
+ if __name__ == '__main__':
+ main() | 36 | 2 | 21 | 15 |
6d07640770859db286ee210a39cd93efa415f160 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
install:
- python setup.py develop
- pushd api/faers && npm install && popd
script:
- python setup.py test
- pushd api/faers && npm test && popd
| language: python
python:
- "2.7"
before_install:
- npm install -g grunt-cli
install:
- python setup.py develop
- pushd api/faers && npm install && popd
script:
- python setup.py test
- pushd api/faers && npm test && popd
| Install grunt-cli for 'npm test' | Install grunt-cli for 'npm test' | YAML | cc0-1.0 | HiTechIronMan/openfda,HiTechIronMan/openfda,HiTechIronMan/openfda,FDA/openfda,FDA/openfda,HiTechIronMan/openfda,FDA/openfda,FDA/openfda | yaml | ## Code Before:
language: python
python:
- "2.7"
install:
- python setup.py develop
- pushd api/faers && npm install && popd
script:
- python setup.py test
- pushd api/faers && npm test && popd
## Instruction:
Install grunt-cli for 'npm test'
## Code After:
language: python
python:
- "2.7"
before_install:
- npm install -g grunt-cli
install:
- python setup.py develop
- pushd api/faers && npm install && popd
script:
- python setup.py test
- pushd api/faers && npm test && popd
| language: python
python:
- "2.7"
+ before_install:
+ - npm install -g grunt-cli
install:
- python setup.py develop
- pushd api/faers && npm install && popd
script:
- python setup.py test
- pushd api/faers && npm test && popd
- | 3 | 0.3 | 2 | 1 |
9d66a0141141ecbbc3e43349acf6c309ffca4e55 | README.md | README.md | Kitten Automator
================
This is a tool to automate some aspects of [Kittens Game][kittens], especially
with an eye towards making the game more idle-friendly.
[kittens]: (http://bloodrizer.ru/games/kittens/)
Installation
------------
You can either paste this into Firefox's scratch pad, or install it with
[Greasemonkey][] by [clicking here][install].
[Greasemonkey]: https://greasespot.net
[install]: https://raw.githubusercontent.com/mythmon/kittenautomator/master/kittenautomator.user.js
| Kitten Automator
================
This is a tool to automate some aspects of [Kittens Game][kittens], especially
with an eye towards making the game more idle-friendly.
[kittens]: http://bloodrizer.ru/games/kittens/
Installation
------------
If you already have [Greasemonkey][] installed, [**click here**][install] to
install. Then it will run every time you load the game. If you install this
way, by default Greasemonkey will automatically update the script.
Otherwise, you could paste this into Firefox's scratch pad. It works fine there
too, but you'll need to run it manually every time you reload the page, and it
won't automatically update.
[Greasemonkey]: https://greasespot.net
[install]: https://raw.githubusercontent.com/mythmon/kittenautomator/master/kittenautomator.user.js
| Write more things in the readme. | Write more things in the readme.
| Markdown | mit | mythmon/kittenautomator | markdown | ## Code Before:
Kitten Automator
================
This is a tool to automate some aspects of [Kittens Game][kittens], especially
with an eye towards making the game more idle-friendly.
[kittens]: (http://bloodrizer.ru/games/kittens/)
Installation
------------
You can either paste this into Firefox's scratch pad, or install it with
[Greasemonkey][] by [clicking here][install].
[Greasemonkey]: https://greasespot.net
[install]: https://raw.githubusercontent.com/mythmon/kittenautomator/master/kittenautomator.user.js
## Instruction:
Write more things in the readme.
## Code After:
Kitten Automator
================
This is a tool to automate some aspects of [Kittens Game][kittens], especially
with an eye towards making the game more idle-friendly.
[kittens]: http://bloodrizer.ru/games/kittens/
Installation
------------
If you already have [Greasemonkey][] installed, [**click here**][install] to
install. Then it will run every time you load the game. If you install this
way, by default Greasemonkey will automatically update the script.
Otherwise, you could paste this into Firefox's scratch pad. It works fine there
too, but you'll need to run it manually every time you reload the page, and it
won't automatically update.
[Greasemonkey]: https://greasespot.net
[install]: https://raw.githubusercontent.com/mythmon/kittenautomator/master/kittenautomator.user.js
| Kitten Automator
================
This is a tool to automate some aspects of [Kittens Game][kittens], especially
with an eye towards making the game more idle-friendly.
- [kittens]: (http://bloodrizer.ru/games/kittens/)
? - -
+ [kittens]: http://bloodrizer.ru/games/kittens/
Installation
------------
- You can either paste this into Firefox's scratch pad, or install it with
- [Greasemonkey][] by [clicking here][install].
+ If you already have [Greasemonkey][] installed, [**click here**][install] to
+ install. Then it will run every time you load the game. If you install this
+ way, by default Greasemonkey will automatically update the script.
+
+ Otherwise, you could paste this into Firefox's scratch pad. It works fine there
+ too, but you'll need to run it manually every time you reload the page, and it
+ won't automatically update.
+
[Greasemonkey]: https://greasespot.net
[install]: https://raw.githubusercontent.com/mythmon/kittenautomator/master/kittenautomator.user.js | 12 | 0.75 | 9 | 3 |
0b1eecf180c79d6196d796ba786a46b1158abbbc | scripts/objects/2-cleaver.js | scripts/objects/2-cleaver.js | exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
}
},
remove: function (l10n) {
return function (player) {
player.say('You place the bulky cleaver in your pack.');
player.combat.deleteAllMods('cleaver' + this.getUuid());
}
},
hit: function (l10n) {
return function (player) {
player.say('<bold>The blade of your cleaver <red>does its job.</red></bold>');
player.combat.addDamageMod({
name: 'cleaver' + this.getUuid(),
effect: damage => damage + .5
});
}
}
};
| exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
player.combat.addToDodgeMod({
name: 'cleaver ' + this.getUuid(),
effect: dodge => dodge - 1
});
}
},
remove: function (l10n) {
return function (player) {
player.say('You place the bulky cleaver in your pack.');
player.combat.deleteAllMods('cleaver' + this.getUuid());
}
},
hit: function (l10n) {
return function (player) {
player.say('<bold>The blade of your cleaver <red>does its job.</red></bold>');
player.combat.addDamageMod({
name: 'cleaver' + this.getUuid(),
effect: damage => damage + .5
});
}
},
parry: function(l10n) {
return function (player) {
player.say('<bold><white>The blade of your cleaver halts their attack.</white></bold>');
player.combat.addDamageMod({
name: 'cleaver' + this.getUuid(),
effect: damage => damage - .5
});
}
}
};
| Add balancing for cleaver scripts. | Add balancing for cleaver scripts.
| JavaScript | mit | seanohue/ranviermud,seanohue/ranviermud,shawncplus/ranviermud | javascript | ## Code Before:
exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
}
},
remove: function (l10n) {
return function (player) {
player.say('You place the bulky cleaver in your pack.');
player.combat.deleteAllMods('cleaver' + this.getUuid());
}
},
hit: function (l10n) {
return function (player) {
player.say('<bold>The blade of your cleaver <red>does its job.</red></bold>');
player.combat.addDamageMod({
name: 'cleaver' + this.getUuid(),
effect: damage => damage + .5
});
}
}
};
## Instruction:
Add balancing for cleaver scripts.
## Code After:
exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
});
player.combat.addToDodgeMod({
name: 'cleaver ' + this.getUuid(),
effect: dodge => dodge - 1
});
}
},
remove: function (l10n) {
return function (player) {
player.say('You place the bulky cleaver in your pack.');
player.combat.deleteAllMods('cleaver' + this.getUuid());
}
},
hit: function (l10n) {
return function (player) {
player.say('<bold>The blade of your cleaver <red>does its job.</red></bold>');
player.combat.addDamageMod({
name: 'cleaver' + this.getUuid(),
effect: damage => damage + .5
});
}
},
parry: function(l10n) {
return function (player) {
player.say('<bold><white>The blade of your cleaver halts their attack.</white></bold>');
player.combat.addDamageMod({
name: 'cleaver' + this.getUuid(),
effect: damage => damage - .5
});
}
}
};
| exports.listeners = {
wield: function (l10n) {
return function (location, player, players) {
player.say('You ready the weighty cleaver.');
player.combat.addToHitMod({
name: 'cleaver ' + this.getUuid(),
effect: toHit => toHit + 1
+ });
+ player.combat.addToDodgeMod({
+ name: 'cleaver ' + this.getUuid(),
+ effect: dodge => dodge - 1
});
}
},
remove: function (l10n) {
return function (player) {
player.say('You place the bulky cleaver in your pack.');
player.combat.deleteAllMods('cleaver' + this.getUuid());
}
},
hit: function (l10n) {
return function (player) {
player.say('<bold>The blade of your cleaver <red>does its job.</red></bold>');
player.combat.addDamageMod({
name: 'cleaver' + this.getUuid(),
effect: damage => damage + .5
});
}
- }
+ },
? +
+
+ parry: function(l10n) {
+ return function (player) {
+ player.say('<bold><white>The blade of your cleaver halts their attack.</white></bold>');
+ player.combat.addDamageMod({
+ name: 'cleaver' + this.getUuid(),
+ effect: damage => damage - .5
+ });
+ }
+ }
}; | 16 | 0.551724 | 15 | 1 |
b1e6b991bf2f84730fa731a24654a455baf9cd46 | modules/intentManager.js | modules/intentManager.js | var CONTEXT_URI = process.env.CONTEXT_URI;
var _ = require('underscore');
var IntentManager = function () {
};
IntentManager.prototype.process = function (intent, req, res) {
var redirect = function (url) {
console.log("And CONTEXT URI IS ->", CONTEXT_URI);
res.redirect(CONTEXT_URI + url + "?username=" + req.session.oneselfUsername);
};
if (_.isEmpty(intent)) {
res.redirect("/dashboard");
} else {
var intentName = intent.name;
var intentData = intent.data;
console.log("intentName -#-#->", intentName);
if (intentName === "website_signup") {
res.redirect("http://1self.co/confirmation.html");
} else if (intentName === "chart.comment") {
res.redirect(intentData.url);
} else {
redirect("/dashboard");
}
}
};
module.exports = new IntentManager();
| var CONTEXT_URI = process.env.CONTEXT_URI;
var _ = require('underscore');
var IntentManager = function () {
};
IntentManager.prototype.process = function (intent, req, res) {
var redirect = function (url) {
console.log("And CONTEXT URI IS ->", CONTEXT_URI);
res.redirect(CONTEXT_URI + url + "?username=" + req.session.oneselfUsername);
};
if (_.isEmpty(intent)) {
res.redirect("/dashboard");
} else {
var intentName = intent.name;
var intentData = intent.data;
console.log("intentName -#-#->", intentName);
if (intentName === "website_signup") {
res.redirect("http://www-staging.1self.co/confirmation.html");
} else if (intentName === "chart.comment") {
res.redirect(intentData.url);
} else {
redirect("/dashboard");
}
}
};
module.exports = new IntentManager();
| Use staging for confirmation while testing | Use staging for confirmation while testing
| JavaScript | agpl-3.0 | maximilianhp/api,1self/api,maximilianhp/api,1self/api,maximilianhp/api,1self/api,1self/api | javascript | ## Code Before:
var CONTEXT_URI = process.env.CONTEXT_URI;
var _ = require('underscore');
var IntentManager = function () {
};
IntentManager.prototype.process = function (intent, req, res) {
var redirect = function (url) {
console.log("And CONTEXT URI IS ->", CONTEXT_URI);
res.redirect(CONTEXT_URI + url + "?username=" + req.session.oneselfUsername);
};
if (_.isEmpty(intent)) {
res.redirect("/dashboard");
} else {
var intentName = intent.name;
var intentData = intent.data;
console.log("intentName -#-#->", intentName);
if (intentName === "website_signup") {
res.redirect("http://1self.co/confirmation.html");
} else if (intentName === "chart.comment") {
res.redirect(intentData.url);
} else {
redirect("/dashboard");
}
}
};
module.exports = new IntentManager();
## Instruction:
Use staging for confirmation while testing
## Code After:
var CONTEXT_URI = process.env.CONTEXT_URI;
var _ = require('underscore');
var IntentManager = function () {
};
IntentManager.prototype.process = function (intent, req, res) {
var redirect = function (url) {
console.log("And CONTEXT URI IS ->", CONTEXT_URI);
res.redirect(CONTEXT_URI + url + "?username=" + req.session.oneselfUsername);
};
if (_.isEmpty(intent)) {
res.redirect("/dashboard");
} else {
var intentName = intent.name;
var intentData = intent.data;
console.log("intentName -#-#->", intentName);
if (intentName === "website_signup") {
res.redirect("http://www-staging.1self.co/confirmation.html");
} else if (intentName === "chart.comment") {
res.redirect(intentData.url);
} else {
redirect("/dashboard");
}
}
};
module.exports = new IntentManager();
| var CONTEXT_URI = process.env.CONTEXT_URI;
var _ = require('underscore');
var IntentManager = function () {
};
IntentManager.prototype.process = function (intent, req, res) {
var redirect = function (url) {
console.log("And CONTEXT URI IS ->", CONTEXT_URI);
res.redirect(CONTEXT_URI + url + "?username=" + req.session.oneselfUsername);
};
if (_.isEmpty(intent)) {
res.redirect("/dashboard");
} else {
var intentName = intent.name;
var intentData = intent.data;
console.log("intentName -#-#->", intentName);
if (intentName === "website_signup") {
- res.redirect("http://1self.co/confirmation.html");
+ res.redirect("http://www-staging.1self.co/confirmation.html");
? ++++++++++++
} else if (intentName === "chart.comment") {
res.redirect(intentData.url);
} else {
redirect("/dashboard");
}
}
};
module.exports = new IntentManager(); | 2 | 0.058824 | 1 | 1 |
25442638c021605494b405f60da2787ce2b926fd | vocab.jl | vocab.jl | counts = Dict{String,Int}()
open(ARGS[1],"r") do f
for line in eachline(f)
for word in split(line)
counts[word] = get(counts,word,0) + 1
end
end
end
cut = 10
guys = collect(counts)
sort!( guys, by=(x)->x[2], rev=true )
for x in guys
if x[2] > cut
println(x[1], '\t', x[2])
end
end
|
function vocab(file)
cut = 10
counter = Dict{String, Int}()
open(file, "r") do io
for line in eachline(io)
for word in split(line)
counter[word] = 1 + get(counter, word, 0)
end
end
end
# Sort and display
guys = collect(counter)
sort!(guys, by=(x) -> x[2], rev=true)
for x in guys
if x[2] > cut
println(x[1], '\t', x[2])
end
end
end
vocab(ARGS[1])
| Update Julia code to encapsulate processing into a function. | Update Julia code to encapsulate processing into a function.
| Julia | mit | alexalemi/textbench,alexalemi/textbench,alexalemi/textbench,alexalemi/textbench,alexalemi/textbench | julia | ## Code Before:
counts = Dict{String,Int}()
open(ARGS[1],"r") do f
for line in eachline(f)
for word in split(line)
counts[word] = get(counts,word,0) + 1
end
end
end
cut = 10
guys = collect(counts)
sort!( guys, by=(x)->x[2], rev=true )
for x in guys
if x[2] > cut
println(x[1], '\t', x[2])
end
end
## Instruction:
Update Julia code to encapsulate processing into a function.
## Code After:
function vocab(file)
cut = 10
counter = Dict{String, Int}()
open(file, "r") do io
for line in eachline(io)
for word in split(line)
counter[word] = 1 + get(counter, word, 0)
end
end
end
# Sort and display
guys = collect(counter)
sort!(guys, by=(x) -> x[2], rev=true)
for x in guys
if x[2] > cut
println(x[1], '\t', x[2])
end
end
end
vocab(ARGS[1])
| - counts = Dict{String,Int}()
- open(ARGS[1],"r") do f
+ function vocab(file)
+ cut = 10
+ counter = Dict{String, Int}()
+ open(file, "r") do io
- for line in eachline(f)
? ^
+ for line in eachline(io)
? ++++ ^^
- for word in split(line)
+ for word in split(line)
? ++++
- counts[word] = get(counts,word,0) + 1
? ^ ^ -----
+ counter[word] = 1 + get(counter, word, 0)
? ++++ ^^ ++++ ^^ + +
+ end
+ end
+ end
+
+ # Sort and display
+ guys = collect(counter)
+ sort!(guys, by=(x) -> x[2], rev=true)
+
+ for x in guys
+ if x[2] > cut
+ println(x[1], '\t', x[2])
end
end
end
- cut = 10
+ vocab(ARGS[1])
- guys = collect(counts)
- sort!( guys, by=(x)->x[2], rev=true )
-
- for x in guys
- if x[2] > cut
- println(x[1], '\t', x[2])
- end
- end
- | 34 | 1.619048 | 19 | 15 |
69e7c35ed30ebeda6a5d701dad3abc10542d4088 | app/assets/javascripts/behaviors/toggle_disable_list_command.js | app/assets/javascripts/behaviors/toggle_disable_list_command.js | $(function() {
$(document).on("change", "[data-behavior~=toggle-disable-list-command]", function(e) {
var commandButtonsSelector = $(e.target).data("commands");
var commandButtons = $(e.target).closest(commandButtonsSelector);
console.log(commandButtons.length);
});
});
| $(function() {
$(document).on("change", "[data-behavior~=toggle-disable-list-command]", function(e) {
var commandButtonsSelector = $(e.target).data("commands");
var commandButtons = $(document).find(commandButtonsSelector);
var list = $(document).find("[name='" + $(e.target).attr("name") + "']:checked");
if (list.length > 0) {
commandButtons.removeClass("disabled").attr("disabled", false);
} else {
commandButtons.addClass("disabled").attr("disabled", true);
}
});
});
| Implement toggle behavior from checkbox change | Implement toggle behavior from checkbox change
| JavaScript | agpl-3.0 | UM-USElab/gradecraft-development,UM-USElab/gradecraft-development,mkoon/gradecraft-development,UM-USElab/gradecraft-development,mkoon/gradecraft-development,UM-USElab/gradecraft-development,mkoon/gradecraft-development | javascript | ## Code Before:
$(function() {
$(document).on("change", "[data-behavior~=toggle-disable-list-command]", function(e) {
var commandButtonsSelector = $(e.target).data("commands");
var commandButtons = $(e.target).closest(commandButtonsSelector);
console.log(commandButtons.length);
});
});
## Instruction:
Implement toggle behavior from checkbox change
## Code After:
$(function() {
$(document).on("change", "[data-behavior~=toggle-disable-list-command]", function(e) {
var commandButtonsSelector = $(e.target).data("commands");
var commandButtons = $(document).find(commandButtonsSelector);
var list = $(document).find("[name='" + $(e.target).attr("name") + "']:checked");
if (list.length > 0) {
commandButtons.removeClass("disabled").attr("disabled", false);
} else {
commandButtons.addClass("disabled").attr("disabled", true);
}
});
});
| $(function() {
$(document).on("change", "[data-behavior~=toggle-disable-list-command]", function(e) {
var commandButtonsSelector = $(e.target).data("commands");
- var commandButtons = $(e.target).closest(commandButtonsSelector);
? ^^^^^^ ^^^^^^^
+ var commandButtons = $(document).find(commandButtonsSelector);
? +++++ ^ ^^^^
- console.log(commandButtons.length);
+ var list = $(document).find("[name='" + $(e.target).attr("name") + "']:checked");
+ if (list.length > 0) {
+ commandButtons.removeClass("disabled").attr("disabled", false);
+ } else {
+ commandButtons.addClass("disabled").attr("disabled", true);
+ }
});
}); | 9 | 1.285714 | 7 | 2 |
bad05d0cbf6ace2fb264e1af1a482fcc40130ef4 | app/partials/socialwork.html | app/partials/socialwork.html | <div class="jumbotron section-header">
<div class="container">
<h1>Social Work Student Volunteers</h1>
<p> </p>
</div>
</div>
<div class="container">
<h2>Sign Up</h2>
<ol>
<li> Use <a href="https://docs.google.com/spreadsheets/d/1YEm_5rrInPfIclW4BwW0rqcFl5t_KA6PxfM4q_Ap68c/edit?usp=sharing">this</a> GoogleDoc to sign up for shifts!
| <div class="jumbotron section-header">
<div class="container">
<h1>Social Work Student Volunteers</h1>
<p> Coming soon! </p>
</div>
</div>
| Revert "added SW sign up link" | Revert "added SW sign up link"
This reverts commit 5f3498e789ee090d67b132501c3c910e6c50e754.
| HTML | mit | SaturdayNeighborhoodHealthClinic/snhc-web,SaturdayNeighborhoodHealthClinic/snhc-web,SaturdayNeighborhoodHealthClinic/snhc-web | html | ## Code Before:
<div class="jumbotron section-header">
<div class="container">
<h1>Social Work Student Volunteers</h1>
<p> </p>
</div>
</div>
<div class="container">
<h2>Sign Up</h2>
<ol>
<li> Use <a href="https://docs.google.com/spreadsheets/d/1YEm_5rrInPfIclW4BwW0rqcFl5t_KA6PxfM4q_Ap68c/edit?usp=sharing">this</a> GoogleDoc to sign up for shifts!
## Instruction:
Revert "added SW sign up link"
This reverts commit 5f3498e789ee090d67b132501c3c910e6c50e754.
## Code After:
<div class="jumbotron section-header">
<div class="container">
<h1>Social Work Student Volunteers</h1>
<p> Coming soon! </p>
</div>
</div>
| <div class="jumbotron section-header">
<div class="container">
<h1>Social Work Student Volunteers</h1>
- <p> </p>
+ <p> Coming soon! </p>
</div>
</div>
-
- <div class="container">
- <h2>Sign Up</h2>
- <ol>
- <li> Use <a href="https://docs.google.com/spreadsheets/d/1YEm_5rrInPfIclW4BwW0rqcFl5t_KA6PxfM4q_Ap68c/edit?usp=sharing">this</a> GoogleDoc to sign up for shifts! | 7 | 0.636364 | 1 | 6 |
3ffad2b9cbc4358d0a75766afc7257701d7829e3 | app/controllers/items_controller.rb | app/controllers/items_controller.rb | class ItemsController < ApplicationController
def index
@items = Item.all
end
def create
@item = Item.create(item_params)
# if item.save
# else
# end
end
def show
@item = Item.find(params[:section][:item])
end
def destroy
item = Item.find(params[:section][:item])
item.destroy
end
private
def item_params
params.require(:item).permit(:user_id, :section_id, :image)
end
end
| class ItemsController < ApplicationController
def index
@items = Item.all
respond_to do |format|
format.html # index.html.erb
format.xml { render xml: @items }
format.json { render json: @items }
end
def create
@item = Item.new(item_params)
if @item.save
render json: @item
else
# ?
end
end
def show
@item = Item.find(params[:section][:item])
end
def destroy
item = Item.find(params[:section][:item])
item.destroy
end
private
def item_params
params.require(:item).permit(:user_id, :section_id, :image)
end
end
| Add respond_to method to user controller specifying response format | Add respond_to method to user controller specifying response format
| Ruby | mit | dannynpham/nevernude-backend,dannynpham/nevernude-backend | ruby | ## Code Before:
class ItemsController < ApplicationController
def index
@items = Item.all
end
def create
@item = Item.create(item_params)
# if item.save
# else
# end
end
def show
@item = Item.find(params[:section][:item])
end
def destroy
item = Item.find(params[:section][:item])
item.destroy
end
private
def item_params
params.require(:item).permit(:user_id, :section_id, :image)
end
end
## Instruction:
Add respond_to method to user controller specifying response format
## Code After:
class ItemsController < ApplicationController
def index
@items = Item.all
respond_to do |format|
format.html # index.html.erb
format.xml { render xml: @items }
format.json { render json: @items }
end
def create
@item = Item.new(item_params)
if @item.save
render json: @item
else
# ?
end
end
def show
@item = Item.find(params[:section][:item])
end
def destroy
item = Item.find(params[:section][:item])
item.destroy
end
private
def item_params
params.require(:item).permit(:user_id, :section_id, :image)
end
end
| class ItemsController < ApplicationController
def index
@items = Item.all
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render xml: @items }
+ format.json { render json: @items }
end
def create
- @item = Item.create(item_params)
? ^^ ^^^
+ @item = Item.new(item_params)
? ^ ^
- # if item.save
? --
+ if @item.save
? +
+ render json: @item
- # else
? --
+ else
+ # ?
- # end
? --
+ end
end
def show
@item = Item.find(params[:section][:item])
end
def destroy
item = Item.find(params[:section][:item])
item.destroy
end
private
def item_params
params.require(:item).permit(:user_id, :section_id, :image)
end
end | 14 | 0.5 | 10 | 4 |
8549aeb466781393cec1af0cc93fee2de475a7a8 | .github/PULL_REQUEST_TEMPLATE.md | .github/PULL_REQUEST_TEMPLATE.md | > Please send your PR's the develop branch.
> Don't forget to add the change to changelog.md.
* Does the pull request solve a **related** issue? [yes | no]
* If so, can you reference the issue?
* What does the pull request accomplish? (please list)
* If it includes major visual changes please add screenshots.
| > Please send your pull requests the develop branch.
> Don't forget to add the change to CHANGELOG.md.
* Does the pull request solve a **related** issue?
* If so, can you reference the issue?
* What does the pull request accomplish? Use a list if needed.
* If it includes major visual changes please add screenshots.
| Clean Up the Contributing Documentation and Process: Part VI | Clean Up the Contributing Documentation and Process: Part VI
* Alter the pull request template to look a little better. | Markdown | mit | kevinatown/MM,ConnorChristie/MagicMirror,heyheyhexi/MagicMirror,aschulz90/MagicMirror,fullbright/MagicMirror,berlincount/MagicMirror,wszgxa/magic-mirror,thunderseethe/MagicMirror,marc-86/MagicMirror,aghth/MagicMirror,phareim/magic-mirror,kthorri/MagicMirror,Rimap47/MagicMirror,marcroga/sMirror,marc-86/MagicMirror,skippengs/MagicMirror,aschulz90/MagicMirror,enith2478/spegel,cs499Mirror/MagicMirror,roramirez/MagicMirror,phareim/magic-mirror,jamessalvatore/MagicMirror,mbalfour/MagicMirror,ryanlawler/MagicMirror,Tyvonne/MagicMirror,kevinatown/MM,huntersiniard/MagicMirror,cmwalshWVU/smartMirror,roramirez/MagicMirror,Tyvonne/MagicMirror,MichMich/MagicMirror,soapdx/MagicMirror,skippengs/MagicMirror,phareim/magic-mirror,Devan0369/AI-Project,kevinatown/MM,berlincount/MagicMirror,fullbright/MagicMirror,Leniox/MagicMirror,kevinatown/MM,ConnorChristie/MagicMirror,thobach/MagicMirror,morozgrafix/MagicMirror,aschulz90/MagicMirror,vyazadji/MagicMirror,berlincount/MagicMirror,thobach/MagicMirror,huntersiniard/MagicMirror,MichMich/MagicMirror,cmwalshWVU/smartMirror,huntersiniard/MagicMirror,jodybrewster/hkthon,Devan0369/AI-Project,he3/MagicMirror,Devan0369/AI-Project,cameronediger/MagicMirror,mbalfour/MagicMirror,jodybrewster/hkthon,n8many/MagicMirror,cameronediger/MagicMirror,thunderseethe/MagicMirror,roramirez/MagicMirror,NoroffNIS/MagicMirror,NoroffNIS/MagicMirror,marc-86/MagicMirror,OniDotun123/MirrorMirror,Makerspace-IDI/magic-mirror,thobach/MagicMirror,aghth/MagicMirror,n8many/MagicMirror,Leniox/MagicMirror,enith2478/spegel,Tyvonne/MagicMirror,ryanlawler/MagicMirror,heyheyhexi/MagicMirror,jodybrewster/hkthon,cmwalshWVU/smartMirror,heyheyhexi/MagicMirror,MichMich/MagicMirror,OniDotun123/MirrorMirror,cs499Mirror/MagicMirror,vyazadji/MagicMirror,morozgrafix/MagicMirror,berlincount/MagicMirror,mbalfour/MagicMirror,he3/MagicMirror,Rimap47/MagicMirror,ConnorChristie/MagicMirror,marc-86/MagicMirror,n8many/MagicMirror,ShivamShrivastava/Smart-Mirror,kthorri/MagicMirror,thunderseethe/MagicMirror,Makerspace-IDI/magic-mirror,soapdx/MagicMirror,OniDotun123/MirrorMirror,wszgxa/magic-mirror,ShivamShrivastava/Smart-Mirror,NoroffNIS/MagicMirror,roramirez/MagicMirror,marcroga/sMirror,he3/MagicMirror,MichMich/MagicMirror,soapdx/MagicMirror,jamessalvatore/MagicMirror,jamessalvatore/MagicMirror,n8many/MagicMirror,ShivamShrivastava/Smart-Mirror,Tyvonne/MagicMirror,enith2478/spegel,marcroga/sMirror,cameronediger/MagicMirror,skippengs/MagicMirror,vyazadji/MagicMirror,aghth/MagicMirror,thobach/MagicMirror,marcroga/sMirror,morozgrafix/MagicMirror,heyheyhexi/MagicMirror,Rimap47/MagicMirror,kthorri/MagicMirror,fullbright/MagicMirror,morozgrafix/MagicMirror,cs499Mirror/MagicMirror,Makerspace-IDI/magic-mirror,n8many/MagicMirror,cameronediger/MagicMirror,Leniox/MagicMirror,ryanlawler/MagicMirror,wszgxa/magic-mirror | markdown | ## Code Before:
> Please send your PR's the develop branch.
> Don't forget to add the change to changelog.md.
* Does the pull request solve a **related** issue? [yes | no]
* If so, can you reference the issue?
* What does the pull request accomplish? (please list)
* If it includes major visual changes please add screenshots.
## Instruction:
Clean Up the Contributing Documentation and Process: Part VI
* Alter the pull request template to look a little better.
## Code After:
> Please send your pull requests the develop branch.
> Don't forget to add the change to CHANGELOG.md.
* Does the pull request solve a **related** issue?
* If so, can you reference the issue?
* What does the pull request accomplish? Use a list if needed.
* If it includes major visual changes please add screenshots.
| - > Please send your PR's the develop branch.
? ^^^
+ > Please send your pull requests the develop branch.
? ^^^^^^^^^^^^
- > Don't forget to add the change to changelog.md.
? ^^^^^^^^^
+ > Don't forget to add the change to CHANGELOG.md.
? ^^^^^^^^^
- * Does the pull request solve a **related** issue? [yes | no]
? -----------
+ * Does the pull request solve a **related** issue?
* If so, can you reference the issue?
- * What does the pull request accomplish? (please list)
? ^^^^^ ^
+ * What does the pull request accomplish? Use a list if needed.
? ^ ++ ^^^^^^^^^^^
* If it includes major visual changes please add screenshots.
-
- | 10 | 1.111111 | 4 | 6 |
a457a9bd82e6a20062c318ba2a5cb42a6b047db7 | content/imageforward.js | content/imageforward.js | var gImageForward = {
onLoad: function() {
if ('undefined' == typeof gBrowser) {
return;
}
window.removeEventListener('load', gImageForward.onLoad, false);
window.addEventListener('unload', gImageForward.onUnload, false);
},
onUnload: function() {
window.removeEventListener('unload', gImageForward.onUnload, false);
},
onClick: function() {
}
};
window.addEventListener('load', gImageForward.onLoad, false);
| var gImageForward = {
onLoad: function() {
if ('undefined' == typeof gBrowser) {
return;
}
window.removeEventListener('load', gImageForward.onLoad, false);
window.addEventListener('unload', gImageForward.onUnload, false);
document.getElementById("contentAreaContextMenu").addEventListener("popupshowing", gImageForward.onPopupShowing, false);
},
onUnload: function() {
window.removeEventListener('unload', gImageForward.onUnload, false);
},
onPopupShowing: function(anEvent) {
document.getElementById("imageForwardContextMenuItem").disabled = !gContextMenu.onImage;
},
onClick: function() {
}
};
window.addEventListener('load', gImageForward.onLoad, false);
| Disable context menu entry if not on imagewq | Disable context menu entry if not on imagewq
| JavaScript | mit | sblask/firefox-image-forward,sblask/firefox-image-forward | javascript | ## Code Before:
var gImageForward = {
onLoad: function() {
if ('undefined' == typeof gBrowser) {
return;
}
window.removeEventListener('load', gImageForward.onLoad, false);
window.addEventListener('unload', gImageForward.onUnload, false);
},
onUnload: function() {
window.removeEventListener('unload', gImageForward.onUnload, false);
},
onClick: function() {
}
};
window.addEventListener('load', gImageForward.onLoad, false);
## Instruction:
Disable context menu entry if not on imagewq
## Code After:
var gImageForward = {
onLoad: function() {
if ('undefined' == typeof gBrowser) {
return;
}
window.removeEventListener('load', gImageForward.onLoad, false);
window.addEventListener('unload', gImageForward.onUnload, false);
document.getElementById("contentAreaContextMenu").addEventListener("popupshowing", gImageForward.onPopupShowing, false);
},
onUnload: function() {
window.removeEventListener('unload', gImageForward.onUnload, false);
},
onPopupShowing: function(anEvent) {
document.getElementById("imageForwardContextMenuItem").disabled = !gContextMenu.onImage;
},
onClick: function() {
}
};
window.addEventListener('load', gImageForward.onLoad, false);
| var gImageForward = {
onLoad: function() {
if ('undefined' == typeof gBrowser) {
return;
}
window.removeEventListener('load', gImageForward.onLoad, false);
window.addEventListener('unload', gImageForward.onUnload, false);
+ document.getElementById("contentAreaContextMenu").addEventListener("popupshowing", gImageForward.onPopupShowing, false);
},
onUnload: function() {
window.removeEventListener('unload', gImageForward.onUnload, false);
+ },
+
+ onPopupShowing: function(anEvent) {
+ document.getElementById("imageForwardContextMenuItem").disabled = !gContextMenu.onImage;
},
onClick: function() {
}
};
window.addEventListener('load', gImageForward.onLoad, false);
| 5 | 0.238095 | 5 | 0 |
48960394ab7f36ccd1b18609677b40721c30d7a2 | spec/language/alias_spec.rb | spec/language/alias_spec.rb | require File.dirname(__FILE__) + '/../spec_helper'
| require File.dirname(__FILE__) + '/../spec_helper'
class AliasObject
def value; 5; end
def false_value; 6; end
end
describe "The alias keyword" do
before(:each) do
@obj = AliasObject.new
@meta = class << @obj;self;end
end
it "should create a new name for an existing method" do
@meta.class_eval do
alias __value value
end
@obj.__value.should == 5
end
it "should overwrite an existing method with the target name" do
@meta.class_eval do
alias false_value value
end
@obj.false_value.should == 5
end
it "should be reversible" do
@meta.class_eval do
alias __value value
alias value false_value
end
@obj.value.should == 6
@meta.class_eval do
alias value __value
end
@obj.value.should == 5
end
end
| Add some 'alias' specs that fail on rbx and pass on MRI | Add some 'alias' specs that fail on rbx and pass on MRI
| Ruby | bsd-3-clause | chad/rubinius,heftig/rubinius,lgierth/rubinius,chad/rubinius,jemc/rubinius,mlarraz/rubinius,ngpestelos/rubinius,kachick/rubinius,pH14/rubinius,digitalextremist/rubinius,ruipserra/rubinius,dblock/rubinius,Azizou/rubinius,digitalextremist/rubinius,sferik/rubinius,dblock/rubinius,chad/rubinius,slawosz/rubinius,jemc/rubinius,ruipserra/rubinius,lgierth/rubinius,slawosz/rubinius,heftig/rubinius,ruipserra/rubinius,sferik/rubinius,travis-repos/rubinius,pH14/rubinius,kachick/rubinius,kachick/rubinius,sferik/rubinius,benlovell/rubinius,Azizou/rubinius,lgierth/rubinius,ngpestelos/rubinius,travis-repos/rubinius,Azizou/rubinius,dblock/rubinius,benlovell/rubinius,benlovell/rubinius,ngpestelos/rubinius,ngpestelos/rubinius,travis-repos/rubinius,Azizou/rubinius,ruipserra/rubinius,ruipserra/rubinius,pH14/rubinius,heftig/rubinius,jsyeo/rubinius,travis-repos/rubinius,slawosz/rubinius,sferik/rubinius,chad/rubinius,jsyeo/rubinius,jemc/rubinius,jsyeo/rubinius,jemc/rubinius,pH14/rubinius,ruipserra/rubinius,mlarraz/rubinius,benlovell/rubinius,heftig/rubinius,jemc/rubinius,lgierth/rubinius,benlovell/rubinius,ngpestelos/rubinius,digitalextremist/rubinius,Wirachmat/rubinius,Azizou/rubinius,heftig/rubinius,dblock/rubinius,lgierth/rubinius,sferik/rubinius,Azizou/rubinius,mlarraz/rubinius,travis-repos/rubinius,digitalextremist/rubinius,chad/rubinius,travis-repos/rubinius,kachick/rubinius,pH14/rubinius,mlarraz/rubinius,kachick/rubinius,chad/rubinius,Wirachmat/rubinius,Azizou/rubinius,Wirachmat/rubinius,jsyeo/rubinius,pH14/rubinius,jsyeo/rubinius,dblock/rubinius,digitalextremist/rubinius,lgierth/rubinius,Wirachmat/rubinius,jsyeo/rubinius,ngpestelos/rubinius,chad/rubinius,dblock/rubinius,travis-repos/rubinius,jemc/rubinius,jemc/rubinius,chad/rubinius,slawosz/rubinius,slawosz/rubinius,mlarraz/rubinius,pH14/rubinius,Wirachmat/rubinius,mlarraz/rubinius,kachick/rubinius,chad/rubinius,sferik/rubinius,ngpestelos/rubinius,heftig/rubinius,jsyeo/rubinius,slawosz/rubinius,digitalextremist/rubinius,benlovell/rubinius,kachick/rubinius,ruipserra/rubinius,Wirachmat/rubinius,chad/rubinius,dblock/rubinius,kachick/rubinius,Wirachmat/rubinius,sferik/rubinius,slawosz/rubinius,heftig/rubinius,lgierth/rubinius,digitalextremist/rubinius,mlarraz/rubinius,benlovell/rubinius | ruby | ## Code Before:
require File.dirname(__FILE__) + '/../spec_helper'
## Instruction:
Add some 'alias' specs that fail on rbx and pass on MRI
## Code After:
require File.dirname(__FILE__) + '/../spec_helper'
class AliasObject
def value; 5; end
def false_value; 6; end
end
describe "The alias keyword" do
before(:each) do
@obj = AliasObject.new
@meta = class << @obj;self;end
end
it "should create a new name for an existing method" do
@meta.class_eval do
alias __value value
end
@obj.__value.should == 5
end
it "should overwrite an existing method with the target name" do
@meta.class_eval do
alias false_value value
end
@obj.false_value.should == 5
end
it "should be reversible" do
@meta.class_eval do
alias __value value
alias value false_value
end
@obj.value.should == 6
@meta.class_eval do
alias value __value
end
@obj.value.should == 5
end
end
| require File.dirname(__FILE__) + '/../spec_helper'
+
+ class AliasObject
+ def value; 5; end
+ def false_value; 6; end
+ end
+
+ describe "The alias keyword" do
+ before(:each) do
+ @obj = AliasObject.new
+ @meta = class << @obj;self;end
+ end
+
+ it "should create a new name for an existing method" do
+ @meta.class_eval do
+ alias __value value
+ end
+ @obj.__value.should == 5
+ end
+
+ it "should overwrite an existing method with the target name" do
+ @meta.class_eval do
+ alias false_value value
+ end
+ @obj.false_value.should == 5
+ end
+
+ it "should be reversible" do
+ @meta.class_eval do
+ alias __value value
+ alias value false_value
+ end
+ @obj.value.should == 6
+
+ @meta.class_eval do
+ alias value __value
+ end
+ @obj.value.should == 5
+ end
+ end | 39 | 39 | 39 | 0 |
8ef4659848b8af24a82be7ac5a2c07ddff35c3be | _config.yml | _config.yml | exclude: ['LICENSE', 'README.md', 'build.js']
| exclude: ['LICENSE', 'README.md', 'build.js', 'about-me/README.md', 'page/page.html', 'page/redirect.html']
| Exclude more files from GitHub Pages's Jekyll | Exclude more files from GitHub Pages's Jekyll
| YAML | mit | demoneaux/demoneaux.github.io,d10/d10.github.io,d10/d10.github.io | yaml | ## Code Before:
exclude: ['LICENSE', 'README.md', 'build.js']
## Instruction:
Exclude more files from GitHub Pages's Jekyll
## Code After:
exclude: ['LICENSE', 'README.md', 'build.js', 'about-me/README.md', 'page/page.html', 'page/redirect.html']
| - exclude: ['LICENSE', 'README.md', 'build.js']
+ exclude: ['LICENSE', 'README.md', 'build.js', 'about-me/README.md', 'page/page.html', 'page/redirect.html'] | 2 | 2 | 1 | 1 |
61d2ea514ac224dc8947af4af509f626412464cc | pack/assets/glsl/glow_extraction.frag | pack/assets/glsl/glow_extraction.frag | precision highp float;
in vec2 vfPosition;
in vec2 vfCoord;
uniform sampler2D s0;
void main()
{
vec4 src = texture2D(s0, vfCoord);
float result = src.w;
gl_FragColor = vec4(result);
}
| precision highp float;
varying vec2 vfPosition;
varying vec2 vfCoord;
uniform sampler2D s0;
void main()
{
vec4 src = texture2D(s0, vfCoord);
float result = src.w;
gl_FragColor = vec4(result);
}
| Fix wrong keyword; Must be 'varying' in ES 2.0. | Fix wrong keyword; Must be 'varying' in ES 2.0.
| GLSL | mit | yorung/AdamasFramework,yorung/AdamasFramework,yorung/AdamasFramework | glsl | ## Code Before:
precision highp float;
in vec2 vfPosition;
in vec2 vfCoord;
uniform sampler2D s0;
void main()
{
vec4 src = texture2D(s0, vfCoord);
float result = src.w;
gl_FragColor = vec4(result);
}
## Instruction:
Fix wrong keyword; Must be 'varying' in ES 2.0.
## Code After:
precision highp float;
varying vec2 vfPosition;
varying vec2 vfCoord;
uniform sampler2D s0;
void main()
{
vec4 src = texture2D(s0, vfCoord);
float result = src.w;
gl_FragColor = vec4(result);
}
| precision highp float;
- in vec2 vfPosition;
+ varying vec2 vfPosition;
? ++++ +
- in vec2 vfCoord;
+ varying vec2 vfCoord;
? ++++ +
uniform sampler2D s0;
void main()
{
vec4 src = texture2D(s0, vfCoord);
float result = src.w;
gl_FragColor = vec4(result);
} | 4 | 0.363636 | 2 | 2 |
e070be126d3fe3b0baddbcc3cad7e52077d8f427 | ide/pubspec.yaml | ide/pubspec.yaml | name: spark
author: Chrome Team <apps-dev@chromium.org>
version: 0.1.4-dev
homepage: https://github.com/GoogleChrome/spark
description: A Chrome app based development environment.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
ace:
path: /Users/ericarnold/src/ace.dart
analyzer: '>=0.10.1 <0.11.0'
archive: 1.0.8
bootjack: any
browser: any
chrome: '>=0.4.0 <0.5.0'
cipher: '>=0.4.0 <0.5.0'
crypto: any
dquery: 0.5.3+7
intl: any
logging: any
mime: any
path: any
polymer: '>=0.9.2'
spark_widgets:
path: ../widgets
unittest: any
uuid: any
dev_dependencies:
args: any
grinder: '>=0.5.0 <0.6.0'
transformers:
- polymer:
entry_points: web/spark_polymer.html
csp: 'true'
| name: spark
author: Chrome Team <apps-dev@chromium.org>
version: 0.1.4-dev
homepage: https://github.com/GoogleChrome/spark
description: A Chrome app based development environment.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
ace: '>=0.1.7 <0.2.0'
analyzer: '>=0.10.1 <0.11.0'
archive: 1.0.8
bootjack: any
browser: any
chrome: '>=0.4.0 <0.5.0'
cipher: '>=0.4.0 <0.5.0'
crypto: any
dquery: 0.5.3+7
intl: any
logging: any
mime: any
path: any
polymer: '>=0.9.2'
spark_widgets:
path: ../widgets
unittest: any
uuid: any
dev_dependencies:
args: any
grinder: '>=0.5.0 <0.6.0'
transformers:
- polymer:
entry_points: web/spark_polymer.html
csp: true
| Revert "TESTING: Local ace.dart package" | Revert "TESTING: Local ace.dart package"
This reverts commit 0faae91d834ebb2459d51a7d7d28e7a2ce9d4017.
| YAML | bsd-3-clause | ussuri/chromedeveditor,yikaraman/chromedeveditor,devoncarew/spark,vivalaralstin/chromedeveditor,valmzetvn/chromedeveditor,googlearchive/chromedeveditor,2947721120/choredev,beaufortfrancois/chromedeveditor,valmzetvn/chromedeveditor,b0dh1sattva/chromedeveditor,b0dh1sattva/chromedeveditor,devoncarew/spark,valmzetvn/chromedeveditor,hxddh/chromedeveditor,beaufortfrancois/chromedeveditor,2947721120/chromedeveditor,modulexcite/chromedeveditor,ussuri/chromedeveditor,valmzetvn/chromedeveditor,modulexcite/chromedeveditor,2947721120/choredev,googlearchive/chromedeveditor,b0dh1sattva/chromedeveditor,2947721120/choredev,hxddh/chromedeveditor,hxddh/chromedeveditor,yikaraman/chromedeveditor,yikaraman/chromedeveditor,devoncarew/spark,vivalaralstin/chromedeveditor,devoncarew/spark,ussuri/chromedeveditor,yikaraman/chromedeveditor,vivalaralstin/chromedeveditor,modulexcite/chromedeveditor,2947721120/chromedeveditor,googlearchive/chromedeveditor,2947721120/choredev,2947721120/choredev,b0dh1sattva/chromedeveditor,modulexcite/chromedeveditor,b0dh1sattva/chromedeveditor,ussuri/chromedeveditor,beaufortfrancois/chromedeveditor,yikaraman/chromedeveditor,valmzetvn/chromedeveditor,devoncarew/spark,hxddh/chromedeveditor,googlearchive/chromedeveditor,ussuri/chromedeveditor,googlearchive/chromedeveditor,b0dh1sattva/chromedeveditor,vivalaralstin/chromedeveditor,ussuri/chromedeveditor,beaufortfrancois/chromedeveditor,2947721120/choredev,2947721120/chromedeveditor,valmzetvn/chromedeveditor,hxddh/chromedeveditor,hxddh/chromedeveditor,vivalaralstin/chromedeveditor,hxddh/chromedeveditor,2947721120/choredev,2947721120/chromedeveditor,beaufortfrancois/chromedeveditor,googlearchive/chromedeveditor,ussuri/chromedeveditor,yikaraman/chromedeveditor,vivalaralstin/chromedeveditor,2947721120/chromedeveditor,valmzetvn/chromedeveditor,beaufortfrancois/chromedeveditor,devoncarew/spark,beaufortfrancois/chromedeveditor,yikaraman/chromedeveditor,vivalaralstin/chromedeveditor,modulexcite/chromedeveditor,2947721120/chromedeveditor,googlearchive/chromedeveditor,b0dh1sattva/chromedeveditor,modulexcite/chromedeveditor,modulexcite/chromedeveditor,2947721120/chromedeveditor | yaml | ## Code Before:
name: spark
author: Chrome Team <apps-dev@chromium.org>
version: 0.1.4-dev
homepage: https://github.com/GoogleChrome/spark
description: A Chrome app based development environment.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
ace:
path: /Users/ericarnold/src/ace.dart
analyzer: '>=0.10.1 <0.11.0'
archive: 1.0.8
bootjack: any
browser: any
chrome: '>=0.4.0 <0.5.0'
cipher: '>=0.4.0 <0.5.0'
crypto: any
dquery: 0.5.3+7
intl: any
logging: any
mime: any
path: any
polymer: '>=0.9.2'
spark_widgets:
path: ../widgets
unittest: any
uuid: any
dev_dependencies:
args: any
grinder: '>=0.5.0 <0.6.0'
transformers:
- polymer:
entry_points: web/spark_polymer.html
csp: 'true'
## Instruction:
Revert "TESTING: Local ace.dart package"
This reverts commit 0faae91d834ebb2459d51a7d7d28e7a2ce9d4017.
## Code After:
name: spark
author: Chrome Team <apps-dev@chromium.org>
version: 0.1.4-dev
homepage: https://github.com/GoogleChrome/spark
description: A Chrome app based development environment.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
ace: '>=0.1.7 <0.2.0'
analyzer: '>=0.10.1 <0.11.0'
archive: 1.0.8
bootjack: any
browser: any
chrome: '>=0.4.0 <0.5.0'
cipher: '>=0.4.0 <0.5.0'
crypto: any
dquery: 0.5.3+7
intl: any
logging: any
mime: any
path: any
polymer: '>=0.9.2'
spark_widgets:
path: ../widgets
unittest: any
uuid: any
dev_dependencies:
args: any
grinder: '>=0.5.0 <0.6.0'
transformers:
- polymer:
entry_points: web/spark_polymer.html
csp: true
| name: spark
author: Chrome Team <apps-dev@chromium.org>
version: 0.1.4-dev
homepage: https://github.com/GoogleChrome/spark
description: A Chrome app based development environment.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
+ ace: '>=0.1.7 <0.2.0'
- ace:
- path: /Users/ericarnold/src/ace.dart
analyzer: '>=0.10.1 <0.11.0'
archive: 1.0.8
bootjack: any
browser: any
chrome: '>=0.4.0 <0.5.0'
cipher: '>=0.4.0 <0.5.0'
crypto: any
dquery: 0.5.3+7
intl: any
logging: any
mime: any
path: any
polymer: '>=0.9.2'
spark_widgets:
path: ../widgets
unittest: any
uuid: any
dev_dependencies:
args: any
grinder: '>=0.5.0 <0.6.0'
transformers:
- polymer:
entry_points: web/spark_polymer.html
- csp: 'true'
? - -
+ csp: true | 5 | 0.147059 | 2 | 3 |
2e6acf6dd10c153bb3dd29fa35998cdc12629237 | .travis.yml | .travis.yml | language: objective-c
osx_image: xcode8.3
rvm:
- 2.2
before_install:
- gem install xcpretty
script:
- set -o pipefail
- ./Scripts/test_crypto
- ./Scripts/test_buy
- ./Scripts/test_pay
| language: objective-c
osx_image: xcode8.3
before_install:
- gem install xcpretty
script:
- set -o pipefail
- ./Scripts/test_crypto
- ./Scripts/test_buy
- ./Scripts/test_pay
| Remove `ram 2.2` requirement in CI config. | Remove `ram 2.2` requirement in CI config.
| YAML | mit | Shopify/mobile-buy-sdk-ios,Shopify/mobile-buy-sdk-ios,Shopify/mobile-buy-sdk-ios | yaml | ## Code Before:
language: objective-c
osx_image: xcode8.3
rvm:
- 2.2
before_install:
- gem install xcpretty
script:
- set -o pipefail
- ./Scripts/test_crypto
- ./Scripts/test_buy
- ./Scripts/test_pay
## Instruction:
Remove `ram 2.2` requirement in CI config.
## Code After:
language: objective-c
osx_image: xcode8.3
before_install:
- gem install xcpretty
script:
- set -o pipefail
- ./Scripts/test_crypto
- ./Scripts/test_buy
- ./Scripts/test_pay
| language: objective-c
osx_image: xcode8.3
- rvm:
- - 2.2
before_install:
- gem install xcpretty
script:
- set -o pipefail
- ./Scripts/test_crypto
- ./Scripts/test_buy
- ./Scripts/test_pay | 2 | 0.153846 | 0 | 2 |
d4cbf30d3bb8f0d16b0b7ef3cad134e1238053d4 | metadata/com.chessclock.android.yml | metadata/com.chessclock.android.yml | Categories:
- Games
License: GPL-3.0-only
SourceCode: https://github.com/simenheg/simple-chess-clock
IssueTracker: https://github.com/simenheg/simple-chess-clock/issues
Changelog: https://github.com/simenheg/simple-chess-clock#changelog
AutoName: Simple Chess Clock
Description: |-
Simple Chess Clock is what its name implies: a chess clock (that’s simple!). It
aims to be easy to use and easy to read, while also providing some reasonably
expected features.
RepoType: git
Repo: https://github.com/simenheg/simple-chess-clock
Builds:
- versionName: 1.2.0
versionCode: 8
commit: 379155447bff
subdir: simplechessclock
target: android-8
- versionName: 2.1.0
versionCode: 10
commit: v2.1.0
target: android-23
- versionName: 2.1.1
versionCode: 11
commit: v2.1.1
target: android-23
- versionName: 2.1.2
versionCode: 12
commit: v2.1.2
target: android-23
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 2.1.2
CurrentVersionCode: 12
| Categories:
- Games
License: GPL-3.0-only
SourceCode: https://github.com/simenheg/simple-chess-clock
IssueTracker: https://github.com/simenheg/simple-chess-clock/issues
Changelog: https://github.com/simenheg/simple-chess-clock#changelog
AutoName: Simple Chess Clock
Description: |-
Simple Chess Clock is what its name implies: a chess clock (that’s simple!). It
aims to be easy to use and easy to read, while also providing some reasonably
expected features.
RepoType: git
Repo: https://github.com/simenheg/simple-chess-clock
Builds:
- versionName: 1.2.0
versionCode: 8
commit: 379155447bff
subdir: simplechessclock
target: android-8
- versionName: 2.1.0
versionCode: 10
commit: v2.1.0
target: android-23
- versionName: 2.1.1
versionCode: 11
commit: v2.1.1
target: android-23
- versionName: 2.1.2
versionCode: 12
commit: v2.1.2
target: android-23
- versionName: 2.2.0
versionCode: 13
commit: v2.2.0
target: android-23
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 2.2.0
CurrentVersionCode: 13
| Update Simple Chess Clock to 2.2.0 (13) | Update Simple Chess Clock to 2.2.0 (13)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- Games
License: GPL-3.0-only
SourceCode: https://github.com/simenheg/simple-chess-clock
IssueTracker: https://github.com/simenheg/simple-chess-clock/issues
Changelog: https://github.com/simenheg/simple-chess-clock#changelog
AutoName: Simple Chess Clock
Description: |-
Simple Chess Clock is what its name implies: a chess clock (that’s simple!). It
aims to be easy to use and easy to read, while also providing some reasonably
expected features.
RepoType: git
Repo: https://github.com/simenheg/simple-chess-clock
Builds:
- versionName: 1.2.0
versionCode: 8
commit: 379155447bff
subdir: simplechessclock
target: android-8
- versionName: 2.1.0
versionCode: 10
commit: v2.1.0
target: android-23
- versionName: 2.1.1
versionCode: 11
commit: v2.1.1
target: android-23
- versionName: 2.1.2
versionCode: 12
commit: v2.1.2
target: android-23
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 2.1.2
CurrentVersionCode: 12
## Instruction:
Update Simple Chess Clock to 2.2.0 (13)
## Code After:
Categories:
- Games
License: GPL-3.0-only
SourceCode: https://github.com/simenheg/simple-chess-clock
IssueTracker: https://github.com/simenheg/simple-chess-clock/issues
Changelog: https://github.com/simenheg/simple-chess-clock#changelog
AutoName: Simple Chess Clock
Description: |-
Simple Chess Clock is what its name implies: a chess clock (that’s simple!). It
aims to be easy to use and easy to read, while also providing some reasonably
expected features.
RepoType: git
Repo: https://github.com/simenheg/simple-chess-clock
Builds:
- versionName: 1.2.0
versionCode: 8
commit: 379155447bff
subdir: simplechessclock
target: android-8
- versionName: 2.1.0
versionCode: 10
commit: v2.1.0
target: android-23
- versionName: 2.1.1
versionCode: 11
commit: v2.1.1
target: android-23
- versionName: 2.1.2
versionCode: 12
commit: v2.1.2
target: android-23
- versionName: 2.2.0
versionCode: 13
commit: v2.2.0
target: android-23
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 2.2.0
CurrentVersionCode: 13
| Categories:
- Games
License: GPL-3.0-only
SourceCode: https://github.com/simenheg/simple-chess-clock
IssueTracker: https://github.com/simenheg/simple-chess-clock/issues
Changelog: https://github.com/simenheg/simple-chess-clock#changelog
AutoName: Simple Chess Clock
Description: |-
Simple Chess Clock is what its name implies: a chess clock (that’s simple!). It
aims to be easy to use and easy to read, while also providing some reasonably
expected features.
RepoType: git
Repo: https://github.com/simenheg/simple-chess-clock
Builds:
- versionName: 1.2.0
versionCode: 8
commit: 379155447bff
subdir: simplechessclock
target: android-8
- versionName: 2.1.0
versionCode: 10
commit: v2.1.0
target: android-23
- versionName: 2.1.1
versionCode: 11
commit: v2.1.1
target: android-23
- versionName: 2.1.2
versionCode: 12
commit: v2.1.2
target: android-23
+ - versionName: 2.2.0
+ versionCode: 13
+ commit: v2.2.0
+ target: android-23
+
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
- CurrentVersion: 2.1.2
? ^ ^
+ CurrentVersion: 2.2.0
? ^ ^
- CurrentVersionCode: 12
? ^
+ CurrentVersionCode: 13
? ^
| 9 | 0.214286 | 7 | 2 |
a8b3d59731442de572eb04560823202e83c69aec | spec/metric_fu/metric_spec.rb | spec/metric_fu/metric_spec.rb | require 'spec_helper'
describe MetricFu::Metric do
it 'can have its run_options over-written' do
metric = MetricFu::Metric.get_metric(:flog)
original_options = metric.run_options.dup
new_options = {:foo => 'bar'}
metric.run_options = new_options
expect(original_options).to_not eq(new_options)
expect(metric.run_options).to eq(new_options)
end
it 'can have its run_options modified' do
metric = MetricFu::Metric.get_metric(:flog)
original_options = metric.run_options.dup
new_options = {:foo => 'bar'}
metric.run_options.merge!(new_options)
expect(metric.run_options).to eq(original_options.merge(new_options))
end
end
| require 'spec_helper'
describe MetricFu::Metric do
before do
@metric = MetricFu::Metric.get_metric(:flog)
@original_options = @metric.run_options.dup
end
it 'can have its run_options over-written' do
new_options = {:foo => 'bar'}
@metric.run_options = new_options
expect(@original_options).to_not eq(new_options)
expect(@metric.run_options).to eq(new_options)
end
it 'can have its run_options modified' do
new_options = {:foo => 'bar'}
@metric.run_options.merge!(new_options)
expect(@metric.run_options).to eq(@original_options.merge(new_options))
end
after do
@metric.run_options = @original_options
end
end
| Clean up spec with side effect. | Clean up spec with side effect.
| Ruby | mit | metricfu/metric_fu,metricfu/metric_fu,metricfu/metric_fu | ruby | ## Code Before:
require 'spec_helper'
describe MetricFu::Metric do
it 'can have its run_options over-written' do
metric = MetricFu::Metric.get_metric(:flog)
original_options = metric.run_options.dup
new_options = {:foo => 'bar'}
metric.run_options = new_options
expect(original_options).to_not eq(new_options)
expect(metric.run_options).to eq(new_options)
end
it 'can have its run_options modified' do
metric = MetricFu::Metric.get_metric(:flog)
original_options = metric.run_options.dup
new_options = {:foo => 'bar'}
metric.run_options.merge!(new_options)
expect(metric.run_options).to eq(original_options.merge(new_options))
end
end
## Instruction:
Clean up spec with side effect.
## Code After:
require 'spec_helper'
describe MetricFu::Metric do
before do
@metric = MetricFu::Metric.get_metric(:flog)
@original_options = @metric.run_options.dup
end
it 'can have its run_options over-written' do
new_options = {:foo => 'bar'}
@metric.run_options = new_options
expect(@original_options).to_not eq(new_options)
expect(@metric.run_options).to eq(new_options)
end
it 'can have its run_options modified' do
new_options = {:foo => 'bar'}
@metric.run_options.merge!(new_options)
expect(@metric.run_options).to eq(@original_options.merge(new_options))
end
after do
@metric.run_options = @original_options
end
end
| require 'spec_helper'
describe MetricFu::Metric do
+ before do
+ @metric = MetricFu::Metric.get_metric(:flog)
+ @original_options = @metric.run_options.dup
+ end
+
it 'can have its run_options over-written' do
- metric = MetricFu::Metric.get_metric(:flog)
- original_options = metric.run_options.dup
new_options = {:foo => 'bar'}
- metric.run_options = new_options
+ @metric.run_options = new_options
? +
- expect(original_options).to_not eq(new_options)
+ expect(@original_options).to_not eq(new_options)
? +
- expect(metric.run_options).to eq(new_options)
+ expect(@metric.run_options).to eq(new_options)
? +
end
+
it 'can have its run_options modified' do
- metric = MetricFu::Metric.get_metric(:flog)
- original_options = metric.run_options.dup
new_options = {:foo => 'bar'}
- metric.run_options.merge!(new_options)
+ @metric.run_options.merge!(new_options)
? +
- expect(metric.run_options).to eq(original_options.merge(new_options))
+ expect(@metric.run_options).to eq(@original_options.merge(new_options))
? + +
+ end
+
+ after do
+ @metric.run_options = @original_options
end
end | 24 | 1.263158 | 15 | 9 |
f11e56076e10d2c7e1db529751c53c1c5dc2074f | cihai/_compat.py | cihai/_compat.py | import sys
PY2 = sys.version_info[0] == 2
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
from urllib import urlretrieve
from cStringIO import StringIO as BytesIO
from StringIO import StringIO
import cPickle as pickle
import urlparse
def console_to_str(s):
return s.decode('utf_8')
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
else:
unichr = chr
text_type = str
string_types = (str,)
integer_types = (int,)
from io import StringIO, BytesIO
import urllib.parse as urllib
import urllib.parse as urlparse
from urllib.request import urlretrieve
console_encoding = sys.__stdout__.encoding
def console_to_str(s):
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """
try:
return s.decode(console_encoding)
except UnicodeDecodeError:
return s.decode('utf_8')
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise (value.with_traceback(tb))
raise value
def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass.
class metaclass(type):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)
return type.__new__(metaclass, 'temporary_class', (), {})
| import sys
PY2 = sys.version_info[0] == 2
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
from urllib import urlretrieve
from cStringIO import StringIO as BytesIO
from StringIO import StringIO
import cPickle as pickle
import urlparse
def console_to_str(s):
return s.decode('utf_8')
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
else:
unichr = chr
text_type = str
string_types = (str,)
integer_types = (int,)
from io import StringIO, BytesIO
import urllib.parse as urllib
import urllib.parse as urlparse
from urllib.request import urlretrieve
console_encoding = sys.__stdout__.encoding
def console_to_str(s):
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """
try:
return s.decode(console_encoding)
except UnicodeDecodeError:
return s.decode('utf_8')
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise (value.with_traceback(tb))
raise value
| Revert "Port with_metaclass from flask" | Revert "Port with_metaclass from flask"
This reverts commit db23ed0d62789ca995d2dceefd0a1468348c488b.
| Python | mit | cihai/cihai,cihai/cihai-python,cihai/cihai | python | ## Code Before:
import sys
PY2 = sys.version_info[0] == 2
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
from urllib import urlretrieve
from cStringIO import StringIO as BytesIO
from StringIO import StringIO
import cPickle as pickle
import urlparse
def console_to_str(s):
return s.decode('utf_8')
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
else:
unichr = chr
text_type = str
string_types = (str,)
integer_types = (int,)
from io import StringIO, BytesIO
import urllib.parse as urllib
import urllib.parse as urlparse
from urllib.request import urlretrieve
console_encoding = sys.__stdout__.encoding
def console_to_str(s):
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """
try:
return s.decode(console_encoding)
except UnicodeDecodeError:
return s.decode('utf_8')
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise (value.with_traceback(tb))
raise value
def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass.
class metaclass(type):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)
return type.__new__(metaclass, 'temporary_class', (), {})
## Instruction:
Revert "Port with_metaclass from flask"
This reverts commit db23ed0d62789ca995d2dceefd0a1468348c488b.
## Code After:
import sys
PY2 = sys.version_info[0] == 2
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
from urllib import urlretrieve
from cStringIO import StringIO as BytesIO
from StringIO import StringIO
import cPickle as pickle
import urlparse
def console_to_str(s):
return s.decode('utf_8')
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
else:
unichr = chr
text_type = str
string_types = (str,)
integer_types = (int,)
from io import StringIO, BytesIO
import urllib.parse as urllib
import urllib.parse as urlparse
from urllib.request import urlretrieve
console_encoding = sys.__stdout__.encoding
def console_to_str(s):
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """
try:
return s.decode(console_encoding)
except UnicodeDecodeError:
return s.decode('utf_8')
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise (value.with_traceback(tb))
raise value
| import sys
PY2 = sys.version_info[0] == 2
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
from urllib import urlretrieve
from cStringIO import StringIO as BytesIO
from StringIO import StringIO
import cPickle as pickle
import urlparse
def console_to_str(s):
return s.decode('utf_8')
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
else:
unichr = chr
text_type = str
string_types = (str,)
integer_types = (int,)
from io import StringIO, BytesIO
import urllib.parse as urllib
import urllib.parse as urlparse
from urllib.request import urlretrieve
console_encoding = sys.__stdout__.encoding
def console_to_str(s):
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """
try:
return s.decode(console_encoding)
except UnicodeDecodeError:
return s.decode('utf_8')
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise (value.with_traceback(tb))
raise value
-
-
- def with_metaclass(meta, *bases):
- """Create a base class with a metaclass."""
- # This requires a bit of explanation: the basic idea is to make a
- # dummy metaclass for one level of class instantiation that replaces
- # itself with the actual metaclass.
- class metaclass(type):
- def __new__(cls, name, this_bases, d):
- return meta(name, bases, d)
- return type.__new__(metaclass, 'temporary_class', (), {}) | 11 | 0.189655 | 0 | 11 |
9f1d89d87a870afb0d018f87ec9ac9f98cf12a62 | package.xml | package.xml | <package>
<name>sdformat</name>
<version>1.4.11</version>
<description>
ROS wrapper for sdformat.
</description>
<maintainer email="foo@foo.com">Ivana Bildbotz</maintainer>
<license>BSD</license>
<buildtool_depend>cmake</buildtool_depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
| <package>
<name>sdformat</name>
<version>1.4.11</version>
<description>
ROS wrapper for sdformat.
</description>
<maintainer email="foo@foo.com">Ivana Bildbotz</maintainer>
<license>BSD</license>
<buildtool_depend>cmake</buildtool_depend>
<build_depend>tinyxml</build_depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
| Add build dependencies for sdformat install | Add build dependencies for sdformat install
| XML | apache-2.0 | jonbinney/sdformat_ros_wrapper,jonbinney/sdformat_ros_wrapper,jonbinney/sdformat_ros_wrapper | xml | ## Code Before:
<package>
<name>sdformat</name>
<version>1.4.11</version>
<description>
ROS wrapper for sdformat.
</description>
<maintainer email="foo@foo.com">Ivana Bildbotz</maintainer>
<license>BSD</license>
<buildtool_depend>cmake</buildtool_depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
## Instruction:
Add build dependencies for sdformat install
## Code After:
<package>
<name>sdformat</name>
<version>1.4.11</version>
<description>
ROS wrapper for sdformat.
</description>
<maintainer email="foo@foo.com">Ivana Bildbotz</maintainer>
<license>BSD</license>
<buildtool_depend>cmake</buildtool_depend>
<build_depend>tinyxml</build_depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
| <package>
<name>sdformat</name>
<version>1.4.11</version>
<description>
ROS wrapper for sdformat.
</description>
<maintainer email="foo@foo.com">Ivana Bildbotz</maintainer>
<license>BSD</license>
<buildtool_depend>cmake</buildtool_depend>
+ <build_depend>tinyxml</build_depend>
<export>
<build_type>cmake</build_type>
</export>
</package> | 1 | 0.066667 | 1 | 0 |
076e90b88859e883519c78899bd21eff7bbc68b7 | hikaricp-common/src/test/java/com/zaxxer/hikari/TestHibernate.java | hikaricp-common/src/test/java/com/zaxxer/hikari/TestHibernate.java | package com.zaxxer.hikari;
import java.sql.Connection;
import java.util.Properties;
import org.junit.Assert;
import org.junit.Test;
import com.zaxxer.hikari.hibernate.HikariConnectionProvider;
public class TestHibernate
{
@Test
public void testConnectionProvider() throws Exception
{
HikariConnectionProvider provider = new HikariConnectionProvider();
Properties props = new Properties();
props.load(getClass().getResourceAsStream("/hibernate.properties"));
provider.configure(props);
Connection connection = provider.getConnection();
provider.closeConnection(connection);
Assert.assertNotNull(provider.unwrap(HikariConnectionProvider.class));
Assert.assertFalse(provider.supportsAggressiveRelease());
provider.stop();
}
}
| package com.zaxxer.hikari;
import java.sql.Connection;
import java.util.Properties;
import org.hibernate.service.UnknownUnwrapTypeException;
import org.junit.Assert;
import org.junit.Test;
import com.zaxxer.hikari.hibernate.HikariConnectionProvider;
public class TestHibernate
{
@Test
public void testConnectionProvider() throws Exception
{
HikariConnectionProvider provider = new HikariConnectionProvider();
Properties props = new Properties();
props.load(getClass().getResourceAsStream("/hibernate.properties"));
provider.configure(props);
Connection connection = provider.getConnection();
provider.closeConnection(connection);
Assert.assertNotNull(provider.unwrap(HikariConnectionProvider.class));
Assert.assertFalse(provider.supportsAggressiveRelease());
try {
provider.unwrap(TestHibernate.class);
Assert.fail("Expected exception");
}
catch (UnknownUnwrapTypeException e) {
}
provider.stop();
}
}
| Test unwrap exception for Hibernate | Test unwrap exception for Hibernate
| Java | apache-2.0 | brettwooldridge/HikariCP,newsky/HikariCP,Violantic/HikariCP,sridhar-newsdistill/HikariCP,atschx/HikariCP,yaojuncn/HikariCP,barrysun/HikariCP,junlapong/HikariCP,brettwooldridge/HikariCP,polpot78/HikariCP,zhuyihao/HikariCP,ams2990/HikariCP,mwegrz/HikariCP,hito-asa/HikariCP,nitincchauhan/HikariCP,openbouquet/HikariCP,kschmit90/HikariCP,ligzy/HikariCP,guai/HikariCP,guai/HikariCP,785468931/HikariCP,schlosna/HikariCP,squidsolutions/HikariCP,udayshnk/HikariCP | java | ## Code Before:
package com.zaxxer.hikari;
import java.sql.Connection;
import java.util.Properties;
import org.junit.Assert;
import org.junit.Test;
import com.zaxxer.hikari.hibernate.HikariConnectionProvider;
public class TestHibernate
{
@Test
public void testConnectionProvider() throws Exception
{
HikariConnectionProvider provider = new HikariConnectionProvider();
Properties props = new Properties();
props.load(getClass().getResourceAsStream("/hibernate.properties"));
provider.configure(props);
Connection connection = provider.getConnection();
provider.closeConnection(connection);
Assert.assertNotNull(provider.unwrap(HikariConnectionProvider.class));
Assert.assertFalse(provider.supportsAggressiveRelease());
provider.stop();
}
}
## Instruction:
Test unwrap exception for Hibernate
## Code After:
package com.zaxxer.hikari;
import java.sql.Connection;
import java.util.Properties;
import org.hibernate.service.UnknownUnwrapTypeException;
import org.junit.Assert;
import org.junit.Test;
import com.zaxxer.hikari.hibernate.HikariConnectionProvider;
public class TestHibernate
{
@Test
public void testConnectionProvider() throws Exception
{
HikariConnectionProvider provider = new HikariConnectionProvider();
Properties props = new Properties();
props.load(getClass().getResourceAsStream("/hibernate.properties"));
provider.configure(props);
Connection connection = provider.getConnection();
provider.closeConnection(connection);
Assert.assertNotNull(provider.unwrap(HikariConnectionProvider.class));
Assert.assertFalse(provider.supportsAggressiveRelease());
try {
provider.unwrap(TestHibernate.class);
Assert.fail("Expected exception");
}
catch (UnknownUnwrapTypeException e) {
}
provider.stop();
}
}
| package com.zaxxer.hikari;
import java.sql.Connection;
import java.util.Properties;
+ import org.hibernate.service.UnknownUnwrapTypeException;
import org.junit.Assert;
import org.junit.Test;
import com.zaxxer.hikari.hibernate.HikariConnectionProvider;
public class TestHibernate
{
@Test
public void testConnectionProvider() throws Exception
{
HikariConnectionProvider provider = new HikariConnectionProvider();
Properties props = new Properties();
props.load(getClass().getResourceAsStream("/hibernate.properties"));
provider.configure(props);
Connection connection = provider.getConnection();
provider.closeConnection(connection);
Assert.assertNotNull(provider.unwrap(HikariConnectionProvider.class));
Assert.assertFalse(provider.supportsAggressiveRelease());
+
+ try {
+ provider.unwrap(TestHibernate.class);
+ Assert.fail("Expected exception");
+ }
+ catch (UnknownUnwrapTypeException e) {
+ }
+
provider.stop();
}
} | 9 | 0.310345 | 9 | 0 |
76af7aa2bde154d090c0ea8a510b79642d5139de | styles/modules/modals/_moderatorDetails.scss | styles/modules/modals/_moderatorDetails.scss | .moderatorDetails {
.contentBox.mDetailWrapper {
min-height: 90px;
& > .mDetail,
& > .verifiedWrapper {
min-width: 20%;
flex-grow: 1;
}
& > .mDetail > * {
max-width: 100%;
overflow: hidden;
}
.verifiedWrapper {
display: flex;
align-self: stretch;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
text-align: center;
border-width: 1px;
border-style: solid;
padding: $pad;
.verifiedMod {
display: block;
bottom: 0;
font-weight: 700;
font-size: $tx5b;
& > .badge {
margin: 0 auto $padTn auto;
}
.tooltipWrapper {
.arrowBoxWrapper {
right: 0;
bottom: 0;
width: 11px;
.arrowBox {
top: 16px; // height of the i icon plus a little
left: 50%;
}
}
}
}
}
}
}
| .moderatorDetails {
.contentBox.mDetailWrapper {
min-height: 90px;
& > .mDetail,
& > .verifiedWrapper {
min-width: 20%;
flex-grow: 1;
max-width: 50%;
word-break: break-word;
}
.verifiedWrapper {
display: flex;
align-self: stretch;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
text-align: center;
border-width: 1px;
border-style: solid;
padding: $pad;
.verifiedMod {
display: block;
bottom: 0;
font-weight: 700;
font-size: $tx5b;
& > .badge {
margin: 0 auto $padTn auto;
}
.tooltipWrapper {
.arrowBoxWrapper {
right: 0;
bottom: 0;
width: 11px;
.arrowBox {
top: 16px; // height of the i icon plus a little
left: 50%;
}
}
}
}
}
}
}
| Fix overflows so they wrap and don't grow too much. | Fix overflows so they wrap and don't grow too much.
| SCSS | mit | OpenBazaar/openbazaar-desktop,jashot7/openbazaar-desktop,OpenBazaar/openbazaar-desktop,OpenBazaar/openbazaar-desktop,jashot7/openbazaar-desktop,jashot7/openbazaar-desktop | scss | ## Code Before:
.moderatorDetails {
.contentBox.mDetailWrapper {
min-height: 90px;
& > .mDetail,
& > .verifiedWrapper {
min-width: 20%;
flex-grow: 1;
}
& > .mDetail > * {
max-width: 100%;
overflow: hidden;
}
.verifiedWrapper {
display: flex;
align-self: stretch;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
text-align: center;
border-width: 1px;
border-style: solid;
padding: $pad;
.verifiedMod {
display: block;
bottom: 0;
font-weight: 700;
font-size: $tx5b;
& > .badge {
margin: 0 auto $padTn auto;
}
.tooltipWrapper {
.arrowBoxWrapper {
right: 0;
bottom: 0;
width: 11px;
.arrowBox {
top: 16px; // height of the i icon plus a little
left: 50%;
}
}
}
}
}
}
}
## Instruction:
Fix overflows so they wrap and don't grow too much.
## Code After:
.moderatorDetails {
.contentBox.mDetailWrapper {
min-height: 90px;
& > .mDetail,
& > .verifiedWrapper {
min-width: 20%;
flex-grow: 1;
max-width: 50%;
word-break: break-word;
}
.verifiedWrapper {
display: flex;
align-self: stretch;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
text-align: center;
border-width: 1px;
border-style: solid;
padding: $pad;
.verifiedMod {
display: block;
bottom: 0;
font-weight: 700;
font-size: $tx5b;
& > .badge {
margin: 0 auto $padTn auto;
}
.tooltipWrapper {
.arrowBoxWrapper {
right: 0;
bottom: 0;
width: 11px;
.arrowBox {
top: 16px; // height of the i icon plus a little
left: 50%;
}
}
}
}
}
}
}
| .moderatorDetails {
.contentBox.mDetailWrapper {
min-height: 90px;
& > .mDetail,
& > .verifiedWrapper {
min-width: 20%;
flex-grow: 1;
- }
-
- & > .mDetail > * {
- max-width: 100%;
? ^^
+ max-width: 50%;
? ^
- overflow: hidden;
+ word-break: break-word;
}
.verifiedWrapper {
display: flex;
align-self: stretch;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
text-align: center;
border-width: 1px;
border-style: solid;
padding: $pad;
.verifiedMod {
display: block;
bottom: 0;
font-weight: 700;
font-size: $tx5b;
& > .badge {
margin: 0 auto $padTn auto;
}
.tooltipWrapper {
.arrowBoxWrapper {
right: 0;
bottom: 0;
width: 11px;
.arrowBox {
top: 16px; // height of the i icon plus a little
left: 50%;
}
}
}
}
}
}
} | 7 | 0.132075 | 2 | 5 |
e68fc4e55c26c185a6f65a011689abb790112d59 | dev/plugins/hu.elte.txtuml.api.model.execution/src/hu/elte/txtuml/api/model/execution/impl/seqdiag/fragments/execstrats/ExecutionStrategySeq.java | dev/plugins/hu.elte.txtuml.api.model.execution/src/hu/elte/txtuml/api/model/execution/impl/seqdiag/fragments/execstrats/ExecutionStrategySeq.java | package hu.elte.txtuml.api.model.execution.impl.seqdiag.fragments.execstrats;
import java.util.Queue;
import hu.elte.txtuml.api.model.seqdiag.BaseCombinedFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseMessageWrapper;
public class ExecutionStrategySeq implements ExecutionStrategy {
@Override
public boolean containsMessage(Queue<BaseFragmentWrapper> containedFragments, BaseMessageWrapper message) {
BaseFragmentWrapper wrapper = containedFragments.peek();
if (wrapper instanceof BaseCombinedFragmentWrapper) {
return ((BaseCombinedFragmentWrapper) wrapper).containsMessage(message);
} else {
return wrapper.equals(message);
}
}
@Override
public boolean checkMessageSendToPattern(Queue<BaseFragmentWrapper> containedFragments,
BaseMessageWrapper message) {
BaseFragmentWrapper fragment = containedFragments.peek();
if (fragment instanceof BaseCombinedFragmentWrapper) {
return ((BaseCombinedFragmentWrapper) fragment).checkMessageSendToPattern(message);
} else {
BaseMessageWrapper required = (BaseMessageWrapper) fragment;
if (!required.equals(message)) {
return false;
}
containedFragments.remove();
return true;
}
}
}
| package hu.elte.txtuml.api.model.execution.impl.seqdiag.fragments.execstrats;
import java.util.Queue;
import hu.elte.txtuml.api.model.seqdiag.BaseCombinedFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseMessageWrapper;
public class ExecutionStrategySeq implements ExecutionStrategy {
@Override
public boolean containsMessage(Queue<BaseFragmentWrapper> containedFragments, BaseMessageWrapper message) {
BaseFragmentWrapper wrapper = containedFragments.peek();
if (wrapper instanceof BaseCombinedFragmentWrapper) {
return ((BaseCombinedFragmentWrapper) wrapper).containsMessage(message);
} else {
return wrapper.equals(message);
}
}
@Override
public boolean checkMessageSendToPattern(Queue<BaseFragmentWrapper> containedFragments,
BaseMessageWrapper message) {
BaseFragmentWrapper fragment = containedFragments.peek();
if (fragment instanceof BaseCombinedFragmentWrapper) {
boolean result = ((BaseCombinedFragmentWrapper) fragment).checkMessageSendToPattern(message);
if (result && fragment.size() == 0) {
containedFragments.remove();
}
return result;
} else {
BaseMessageWrapper required = (BaseMessageWrapper) fragment;
if (!required.equals(message)) {
return false;
}
containedFragments.remove();
return true;
}
}
}
| Fix a bug with normal execution mode | Fix a bug with normal execution mode
If all of the messages of a CombinedFragment got processed and deleted
from the queue during the execution, null pointer exceptions where thrown
because the fragment itself wasn't deleted from the queue and the method tried to process the next message of the empty fragment.
| Java | epl-1.0 | ELTE-Soft/txtUML,ELTE-Soft/txtUML,ELTE-Soft/txtUML,ELTE-Soft/txtUML | java | ## Code Before:
package hu.elte.txtuml.api.model.execution.impl.seqdiag.fragments.execstrats;
import java.util.Queue;
import hu.elte.txtuml.api.model.seqdiag.BaseCombinedFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseMessageWrapper;
public class ExecutionStrategySeq implements ExecutionStrategy {
@Override
public boolean containsMessage(Queue<BaseFragmentWrapper> containedFragments, BaseMessageWrapper message) {
BaseFragmentWrapper wrapper = containedFragments.peek();
if (wrapper instanceof BaseCombinedFragmentWrapper) {
return ((BaseCombinedFragmentWrapper) wrapper).containsMessage(message);
} else {
return wrapper.equals(message);
}
}
@Override
public boolean checkMessageSendToPattern(Queue<BaseFragmentWrapper> containedFragments,
BaseMessageWrapper message) {
BaseFragmentWrapper fragment = containedFragments.peek();
if (fragment instanceof BaseCombinedFragmentWrapper) {
return ((BaseCombinedFragmentWrapper) fragment).checkMessageSendToPattern(message);
} else {
BaseMessageWrapper required = (BaseMessageWrapper) fragment;
if (!required.equals(message)) {
return false;
}
containedFragments.remove();
return true;
}
}
}
## Instruction:
Fix a bug with normal execution mode
If all of the messages of a CombinedFragment got processed and deleted
from the queue during the execution, null pointer exceptions where thrown
because the fragment itself wasn't deleted from the queue and the method tried to process the next message of the empty fragment.
## Code After:
package hu.elte.txtuml.api.model.execution.impl.seqdiag.fragments.execstrats;
import java.util.Queue;
import hu.elte.txtuml.api.model.seqdiag.BaseCombinedFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseMessageWrapper;
public class ExecutionStrategySeq implements ExecutionStrategy {
@Override
public boolean containsMessage(Queue<BaseFragmentWrapper> containedFragments, BaseMessageWrapper message) {
BaseFragmentWrapper wrapper = containedFragments.peek();
if (wrapper instanceof BaseCombinedFragmentWrapper) {
return ((BaseCombinedFragmentWrapper) wrapper).containsMessage(message);
} else {
return wrapper.equals(message);
}
}
@Override
public boolean checkMessageSendToPattern(Queue<BaseFragmentWrapper> containedFragments,
BaseMessageWrapper message) {
BaseFragmentWrapper fragment = containedFragments.peek();
if (fragment instanceof BaseCombinedFragmentWrapper) {
boolean result = ((BaseCombinedFragmentWrapper) fragment).checkMessageSendToPattern(message);
if (result && fragment.size() == 0) {
containedFragments.remove();
}
return result;
} else {
BaseMessageWrapper required = (BaseMessageWrapper) fragment;
if (!required.equals(message)) {
return false;
}
containedFragments.remove();
return true;
}
}
}
| package hu.elte.txtuml.api.model.execution.impl.seqdiag.fragments.execstrats;
import java.util.Queue;
import hu.elte.txtuml.api.model.seqdiag.BaseCombinedFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseFragmentWrapper;
import hu.elte.txtuml.api.model.seqdiag.BaseMessageWrapper;
public class ExecutionStrategySeq implements ExecutionStrategy {
@Override
public boolean containsMessage(Queue<BaseFragmentWrapper> containedFragments, BaseMessageWrapper message) {
BaseFragmentWrapper wrapper = containedFragments.peek();
if (wrapper instanceof BaseCombinedFragmentWrapper) {
return ((BaseCombinedFragmentWrapper) wrapper).containsMessage(message);
} else {
return wrapper.equals(message);
}
}
@Override
public boolean checkMessageSendToPattern(Queue<BaseFragmentWrapper> containedFragments,
BaseMessageWrapper message) {
BaseFragmentWrapper fragment = containedFragments.peek();
if (fragment instanceof BaseCombinedFragmentWrapper) {
- return ((BaseCombinedFragmentWrapper) fragment).checkMessageSendToPattern(message);
? ^^^
+ boolean result = ((BaseCombinedFragmentWrapper) fragment).checkMessageSendToPattern(message);
? ++++++++ +++ ^^
+
+ if (result && fragment.size() == 0) {
+ containedFragments.remove();
+ }
+
+ return result;
} else {
BaseMessageWrapper required = (BaseMessageWrapper) fragment;
if (!required.equals(message)) {
return false;
}
containedFragments.remove();
return true;
}
}
} | 8 | 0.216216 | 7 | 1 |
b4ae6d7bb2ea21e037875b42fbb04932b0120ddf | source/tasks/startTaskScheduler.ts | source/tasks/startTaskScheduler.ts | import { MONGODB_URI, PERIL_WEBHOOK_SECRET, PUBLIC_FACING_API } from "../globals"
import * as Agenda from "agenda"
import db from "../db/getDB"
import logger from "../logger"
import { runTask } from "./runTask"
export interface DangerFileTaskConfig {
installationID: number
taskName: string
data: any
}
export let agenda: Agenda
export const runDangerfileTaskName = "runDangerfile"
export const startTaskScheduler = async () => {
agenda = new Agenda({ db: { address: MONGODB_URI } })
agenda.define(runDangerfileTaskName, async (job, done) => {
const data = job.attrs.data as DangerFileTaskConfig
const installation = await db.getInstallation(data.installationID)
if (!installation) {
logger.error(`Could not find installation for task: ${data.taskName}`)
return
}
const taskString = installation.tasks[data.taskName]
if (!taskString) {
logger.error(`Could not find the task: ${data.taskName} on installation ${data.installationID}`)
return
}
runTask(installation, taskString, data.data)
})
}
| import { MONGODB_URI, PERIL_WEBHOOK_SECRET, PUBLIC_FACING_API } from "../globals"
import * as Agenda from "agenda"
import db from "../db/getDB"
import logger from "../logger"
import { runTask } from "./runTask"
export interface DangerFileTaskConfig {
installationID: number
taskName: string
data: any
}
export let agenda: Agenda
export const runDangerfileTaskName = "runDangerfile"
export const startTaskScheduler = async () => {
agenda = new Agenda({ db: { address: MONGODB_URI } })
agenda.on("ready", () => {
logger.info("Task runner ready")
agenda.start()
})
agenda.define(runDangerfileTaskName, async (job, done) => {
const data = job.attrs.data as DangerFileTaskConfig
logger.info(`Recieved a new task, ${data.taskName}`)
const installation = await db.getInstallation(data.installationID)
if (!installation) {
logger.error(`Could not find installation for task: ${data.taskName}`)
return
}
const taskString = installation.tasks[data.taskName]
if (!taskString) {
logger.error(`Could not find the task: ${data.taskName} on installation ${data.installationID}`)
return
}
runTask(installation, taskString, data.data)
})
}
| Add some notes to the scheduler, and make it start | Add some notes to the scheduler, and make it start
| TypeScript | mit | danger/peril,danger/peril,danger/peril,danger/peril,danger/peril | typescript | ## Code Before:
import { MONGODB_URI, PERIL_WEBHOOK_SECRET, PUBLIC_FACING_API } from "../globals"
import * as Agenda from "agenda"
import db from "../db/getDB"
import logger from "../logger"
import { runTask } from "./runTask"
export interface DangerFileTaskConfig {
installationID: number
taskName: string
data: any
}
export let agenda: Agenda
export const runDangerfileTaskName = "runDangerfile"
export const startTaskScheduler = async () => {
agenda = new Agenda({ db: { address: MONGODB_URI } })
agenda.define(runDangerfileTaskName, async (job, done) => {
const data = job.attrs.data as DangerFileTaskConfig
const installation = await db.getInstallation(data.installationID)
if (!installation) {
logger.error(`Could not find installation for task: ${data.taskName}`)
return
}
const taskString = installation.tasks[data.taskName]
if (!taskString) {
logger.error(`Could not find the task: ${data.taskName} on installation ${data.installationID}`)
return
}
runTask(installation, taskString, data.data)
})
}
## Instruction:
Add some notes to the scheduler, and make it start
## Code After:
import { MONGODB_URI, PERIL_WEBHOOK_SECRET, PUBLIC_FACING_API } from "../globals"
import * as Agenda from "agenda"
import db from "../db/getDB"
import logger from "../logger"
import { runTask } from "./runTask"
export interface DangerFileTaskConfig {
installationID: number
taskName: string
data: any
}
export let agenda: Agenda
export const runDangerfileTaskName = "runDangerfile"
export const startTaskScheduler = async () => {
agenda = new Agenda({ db: { address: MONGODB_URI } })
agenda.on("ready", () => {
logger.info("Task runner ready")
agenda.start()
})
agenda.define(runDangerfileTaskName, async (job, done) => {
const data = job.attrs.data as DangerFileTaskConfig
logger.info(`Recieved a new task, ${data.taskName}`)
const installation = await db.getInstallation(data.installationID)
if (!installation) {
logger.error(`Could not find installation for task: ${data.taskName}`)
return
}
const taskString = installation.tasks[data.taskName]
if (!taskString) {
logger.error(`Could not find the task: ${data.taskName} on installation ${data.installationID}`)
return
}
runTask(installation, taskString, data.data)
})
}
| import { MONGODB_URI, PERIL_WEBHOOK_SECRET, PUBLIC_FACING_API } from "../globals"
import * as Agenda from "agenda"
import db from "../db/getDB"
import logger from "../logger"
import { runTask } from "./runTask"
export interface DangerFileTaskConfig {
installationID: number
taskName: string
data: any
}
export let agenda: Agenda
export const runDangerfileTaskName = "runDangerfile"
export const startTaskScheduler = async () => {
agenda = new Agenda({ db: { address: MONGODB_URI } })
+ agenda.on("ready", () => {
+ logger.info("Task runner ready")
+ agenda.start()
+ })
agenda.define(runDangerfileTaskName, async (job, done) => {
const data = job.attrs.data as DangerFileTaskConfig
+ logger.info(`Recieved a new task, ${data.taskName}`)
const installation = await db.getInstallation(data.installationID)
if (!installation) {
logger.error(`Could not find installation for task: ${data.taskName}`)
return
}
const taskString = installation.tasks[data.taskName]
if (!taskString) {
logger.error(`Could not find the task: ${data.taskName} on installation ${data.installationID}`)
return
}
runTask(installation, taskString, data.data)
})
} | 5 | 0.135135 | 5 | 0 |
c537a37c9166388e1777aa1f6e3fb3bfc86907f5 | composer.json | composer.json | {
"name": "cardgate/cardgate-clientlib-php",
"description": "CardGate API client library for PHP",
"homepage": "https://github.com/cardgate/cardgate-clientlib-php",
"version": "1.1.7",
"license": "MIT",
"authors": [
{
"name": "CardGate",
"email": "tech@cardgate.com"
},
{
"name": "CardGate",
"homepage": "https://www.cardgate.com"
}
],
"keywords": [
"cardgate", "secure", "payment", "ideal", "bancontact", "sofort", "sofortbanking", "banktransfer", "paypal",
"afterpay", "bitcoin", "directdebit"
],
"require" : {
"php": "~5.6.0|~7.0.0|~7.1.0"
},
"autoload": {
"psr-4": {
"cardgate\\api\\": "src/"
}
}
}
| {
"name": "cardgate/cardgate-clientlib-php",
"description": "CardGate API client library for PHP",
"homepage": "https://github.com/cardgate/cardgate-clientlib-php",
"version": "1.1.7",
"license": "MIT",
"authors": [
{
"name": "CardGate",
"email": "tech@cardgate.com"
},
{
"name": "CardGate",
"homepage": "https://www.cardgate.com"
}
],
"keywords": [
"cardgate", "secure", "payment", "ideal", "bancontact", "sofort", "sofortbanking", "banktransfer", "paypal",
"afterpay", "bitcoin", "directdebit"
],
"require" : {
"php": "^5.6 | ^ 7.0"
},
"autoload": {
"psr-4": {
"cardgate\\api\\": "src/"
}
}
}
| Add support for PHP 7.2 and 7.3 | Add support for PHP 7.2 and 7.3 | JSON | mit | cardgate/cardgate-clientlib-php | json | ## Code Before:
{
"name": "cardgate/cardgate-clientlib-php",
"description": "CardGate API client library for PHP",
"homepage": "https://github.com/cardgate/cardgate-clientlib-php",
"version": "1.1.7",
"license": "MIT",
"authors": [
{
"name": "CardGate",
"email": "tech@cardgate.com"
},
{
"name": "CardGate",
"homepage": "https://www.cardgate.com"
}
],
"keywords": [
"cardgate", "secure", "payment", "ideal", "bancontact", "sofort", "sofortbanking", "banktransfer", "paypal",
"afterpay", "bitcoin", "directdebit"
],
"require" : {
"php": "~5.6.0|~7.0.0|~7.1.0"
},
"autoload": {
"psr-4": {
"cardgate\\api\\": "src/"
}
}
}
## Instruction:
Add support for PHP 7.2 and 7.3
## Code After:
{
"name": "cardgate/cardgate-clientlib-php",
"description": "CardGate API client library for PHP",
"homepage": "https://github.com/cardgate/cardgate-clientlib-php",
"version": "1.1.7",
"license": "MIT",
"authors": [
{
"name": "CardGate",
"email": "tech@cardgate.com"
},
{
"name": "CardGate",
"homepage": "https://www.cardgate.com"
}
],
"keywords": [
"cardgate", "secure", "payment", "ideal", "bancontact", "sofort", "sofortbanking", "banktransfer", "paypal",
"afterpay", "bitcoin", "directdebit"
],
"require" : {
"php": "^5.6 | ^ 7.0"
},
"autoload": {
"psr-4": {
"cardgate\\api\\": "src/"
}
}
}
| {
"name": "cardgate/cardgate-clientlib-php",
"description": "CardGate API client library for PHP",
"homepage": "https://github.com/cardgate/cardgate-clientlib-php",
"version": "1.1.7",
"license": "MIT",
"authors": [
{
"name": "CardGate",
"email": "tech@cardgate.com"
},
{
"name": "CardGate",
"homepage": "https://www.cardgate.com"
}
],
"keywords": [
"cardgate", "secure", "payment", "ideal", "bancontact", "sofort", "sofortbanking", "banktransfer", "paypal",
"afterpay", "bitcoin", "directdebit"
],
"require" : {
- "php": "~5.6.0|~7.0.0|~7.1.0"
+ "php": "^5.6 | ^ 7.0"
},
"autoload": {
"psr-4": {
"cardgate\\api\\": "src/"
}
}
} | 2 | 0.068966 | 1 | 1 |
a1db3418db31dc2093acf7548b1bac667969ded0 | README.md | README.md |
[](https://travis-ci.com/celilileri/colorname)
Ruby Gem for decide name of a given color.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'colorname'
```
And then execute:
```
$ bundle
```
Or install it yourself as:
```
$ gem install colorname
```
## Usage
```ruby
color_code = Color::RGB.new(0,0,0)
color_name = Colorname.find(color_code)
puts color_name # black
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/celilileri/colorname. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
[](https://travis-ci.com/celilileri/colorname)
Ruby Gem for decide name of a given color.
## Installation
### Easy Gem Installation
```
$ gem install colorname
```
### Gemfile Integration
Add this line to your application's Gemfile:
```ruby
gem 'colorname'
```
And then execute:
```
$ bundle
```
## Usage
```ruby
Colorname.find 'f0f8ff' # [:aliceblue]
Colorname.find '#00ffff' # [:aqua, :cyan]
Colorname.find 143, 188, 143 # [:darkseagreen]
Colorname.find Color::RGB.new(255, 0, 255) # [:fuchsia, :magenta]
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/celilileri/colorname. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
| Update usages and gem installation | Update usages and gem installation
| Markdown | mit | celilileri/colorname,celilileri/colorname | markdown | ## Code Before:
[](https://travis-ci.com/celilileri/colorname)
Ruby Gem for decide name of a given color.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'colorname'
```
And then execute:
```
$ bundle
```
Or install it yourself as:
```
$ gem install colorname
```
## Usage
```ruby
color_code = Color::RGB.new(0,0,0)
color_name = Colorname.find(color_code)
puts color_name # black
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/celilileri/colorname. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
## Instruction:
Update usages and gem installation
## Code After:
[](https://travis-ci.com/celilileri/colorname)
Ruby Gem for decide name of a given color.
## Installation
### Easy Gem Installation
```
$ gem install colorname
```
### Gemfile Integration
Add this line to your application's Gemfile:
```ruby
gem 'colorname'
```
And then execute:
```
$ bundle
```
## Usage
```ruby
Colorname.find 'f0f8ff' # [:aliceblue]
Colorname.find '#00ffff' # [:aqua, :cyan]
Colorname.find 143, 188, 143 # [:darkseagreen]
Colorname.find Color::RGB.new(255, 0, 255) # [:fuchsia, :magenta]
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/celilileri/colorname. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
[](https://travis-ci.com/celilileri/colorname)
Ruby Gem for decide name of a given color.
## Installation
+
+ ### Easy Gem Installation
+
+ ```
+ $ gem install colorname
+ ```
+ ### Gemfile Integration
Add this line to your application's Gemfile:
```ruby
gem 'colorname'
```
And then execute:
```
$ bundle
```
- Or install it yourself as:
- ```
- $ gem install colorname
- ```
## Usage
```ruby
- color_code = Color::RGB.new(0,0,0)
- color_name = Colorname.find(color_code)
- puts color_name # black
+ Colorname.find 'f0f8ff' # [:aliceblue]
+
+ Colorname.find '#00ffff' # [:aqua, :cyan]
+
+ Colorname.find 143, 188, 143 # [:darkseagreen]
+
+ Colorname.find Color::RGB.new(255, 0, 255) # [:fuchsia, :magenta]
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/celilileri/colorname. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
| 21 | 0.552632 | 14 | 7 |
ca50295c71432dde32eff813e5bd05b7a8e40ad1 | cdflib/__init__.py | cdflib/__init__.py | import os
from . import cdfread
from . import cdfwrite
from .epochs import CDFepoch as cdfepoch
# This function determines if we are reading or writing a file
def CDF(path, cdf_spec=None, delete=False, validate=None):
if (os.path.exists(path)):
if delete:
os.remove(path)
return
else:
return cdfread.CDF(path, validate=validate)
else:
return cdfwrite.CDF(path, cdf_spec=cdf_spec, delete=delete)
| import os
from . import cdfread
from . import cdfwrite
from .epochs import CDFepoch as cdfepoch
# This function determines if we are reading or writing a file
def CDF(path, cdf_spec=None, delete=False, validate=None):
path = os.path.expanduser(path)
if (os.path.exists(path)):
if delete:
os.remove(path)
return
else:
return cdfread.CDF(path, validate=validate)
else:
return cdfwrite.CDF(path, cdf_spec=cdf_spec, delete=delete)
| Expand user path when reading CDF | Expand user path when reading CDF
| Python | mit | MAVENSDC/cdflib | python | ## Code Before:
import os
from . import cdfread
from . import cdfwrite
from .epochs import CDFepoch as cdfepoch
# This function determines if we are reading or writing a file
def CDF(path, cdf_spec=None, delete=False, validate=None):
if (os.path.exists(path)):
if delete:
os.remove(path)
return
else:
return cdfread.CDF(path, validate=validate)
else:
return cdfwrite.CDF(path, cdf_spec=cdf_spec, delete=delete)
## Instruction:
Expand user path when reading CDF
## Code After:
import os
from . import cdfread
from . import cdfwrite
from .epochs import CDFepoch as cdfepoch
# This function determines if we are reading or writing a file
def CDF(path, cdf_spec=None, delete=False, validate=None):
path = os.path.expanduser(path)
if (os.path.exists(path)):
if delete:
os.remove(path)
return
else:
return cdfread.CDF(path, validate=validate)
else:
return cdfwrite.CDF(path, cdf_spec=cdf_spec, delete=delete)
| import os
from . import cdfread
from . import cdfwrite
from .epochs import CDFepoch as cdfepoch
# This function determines if we are reading or writing a file
def CDF(path, cdf_spec=None, delete=False, validate=None):
+ path = os.path.expanduser(path)
if (os.path.exists(path)):
if delete:
os.remove(path)
return
else:
return cdfread.CDF(path, validate=validate)
else:
return cdfwrite.CDF(path, cdf_spec=cdf_spec, delete=delete) | 1 | 0.058824 | 1 | 0 |
1e113ce7d3d9f6ee64ec9bc0b569f9eb52dd2329 | thrift/lib/py3/thrift_server.pyx | thrift/lib/py3/thrift_server.pyx | cimport cython
from libcpp.memory cimport unique_ptr, make_unique, shared_ptr
from thrift_server cimport (
cThriftServer,
cServerInterface,
ServiceInterface
)
from folly_futures cimport cFollyPromise, cFollyUnit, c_unit
import asyncio
cdef class ThriftServer:
cdef unique_ptr[cThriftServer] server
cdef ServiceInterface handler
cdef object loop
def __cinit__(self):
self.server = make_unique[cThriftServer]()
def __init__(self, ServiceInterface handler, port, loop=None):
self.loop = loop or asyncio.get_event_loop()
self.handler = handler
self.server.get().setInterface(handler.interface_wrapper)
self.server.get().setPort(port)
async def serve(self):
def _serve():
with nogil:
self.server.get().serve()
try:
await self.loop.run_in_executor(None, _serve)
except asyncio.CancelledError:
self.server.get().stop()
raise
| cimport cython
from libcpp.memory cimport unique_ptr, make_unique, shared_ptr
from thrift_server cimport (
cThriftServer,
cServerInterface,
ServiceInterface
)
from folly_futures cimport cFollyPromise, cFollyUnit, c_unit
import asyncio
cdef class ThriftServer:
cdef unique_ptr[cThriftServer] server
cdef ServiceInterface handler
cdef object loop
def __cinit__(self):
self.server = make_unique[cThriftServer]()
def __init__(self, ServiceInterface handler, port, loop=None):
self.loop = loop or asyncio.get_event_loop()
self.handler = handler
self.server.get().setInterface(handler.interface_wrapper)
self.server.get().setPort(port)
async def serve(self):
def _serve():
with nogil:
self.server.get().serve()
try:
await self.loop.run_in_executor(None, _serve)
except Exception:
self.server.get().stop()
raise
| Correct cleanup when server fails | Correct cleanup when server fails
Summary:
Server has been crashing hard when it should be crashing soft (for
example, when binding to the same port. This diff fixes it.
Reviewed By: yfeldblum
Differential Revision: D4242841
fbshipit-source-id: 242ee09ea244ce662c3122f25a96b8b4e8d60fcf
| Cython | apache-2.0 | getyourguide/fbthrift,getyourguide/fbthrift,facebook/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,facebook/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift | cython | ## Code Before:
cimport cython
from libcpp.memory cimport unique_ptr, make_unique, shared_ptr
from thrift_server cimport (
cThriftServer,
cServerInterface,
ServiceInterface
)
from folly_futures cimport cFollyPromise, cFollyUnit, c_unit
import asyncio
cdef class ThriftServer:
cdef unique_ptr[cThriftServer] server
cdef ServiceInterface handler
cdef object loop
def __cinit__(self):
self.server = make_unique[cThriftServer]()
def __init__(self, ServiceInterface handler, port, loop=None):
self.loop = loop or asyncio.get_event_loop()
self.handler = handler
self.server.get().setInterface(handler.interface_wrapper)
self.server.get().setPort(port)
async def serve(self):
def _serve():
with nogil:
self.server.get().serve()
try:
await self.loop.run_in_executor(None, _serve)
except asyncio.CancelledError:
self.server.get().stop()
raise
## Instruction:
Correct cleanup when server fails
Summary:
Server has been crashing hard when it should be crashing soft (for
example, when binding to the same port. This diff fixes it.
Reviewed By: yfeldblum
Differential Revision: D4242841
fbshipit-source-id: 242ee09ea244ce662c3122f25a96b8b4e8d60fcf
## Code After:
cimport cython
from libcpp.memory cimport unique_ptr, make_unique, shared_ptr
from thrift_server cimport (
cThriftServer,
cServerInterface,
ServiceInterface
)
from folly_futures cimport cFollyPromise, cFollyUnit, c_unit
import asyncio
cdef class ThriftServer:
cdef unique_ptr[cThriftServer] server
cdef ServiceInterface handler
cdef object loop
def __cinit__(self):
self.server = make_unique[cThriftServer]()
def __init__(self, ServiceInterface handler, port, loop=None):
self.loop = loop or asyncio.get_event_loop()
self.handler = handler
self.server.get().setInterface(handler.interface_wrapper)
self.server.get().setPort(port)
async def serve(self):
def _serve():
with nogil:
self.server.get().serve()
try:
await self.loop.run_in_executor(None, _serve)
except Exception:
self.server.get().stop()
raise
| cimport cython
from libcpp.memory cimport unique_ptr, make_unique, shared_ptr
from thrift_server cimport (
cThriftServer,
cServerInterface,
ServiceInterface
)
from folly_futures cimport cFollyPromise, cFollyUnit, c_unit
import asyncio
cdef class ThriftServer:
cdef unique_ptr[cThriftServer] server
cdef ServiceInterface handler
cdef object loop
def __cinit__(self):
self.server = make_unique[cThriftServer]()
def __init__(self, ServiceInterface handler, port, loop=None):
self.loop = loop or asyncio.get_event_loop()
self.handler = handler
self.server.get().setInterface(handler.interface_wrapper)
self.server.get().setPort(port)
async def serve(self):
def _serve():
with nogil:
self.server.get().serve()
try:
await self.loop.run_in_executor(None, _serve)
- except asyncio.CancelledError:
+ except Exception:
- self.server.get().stop()
+ self.server.get().stop()
? ++
- raise
+ raise
? ++
| 6 | 0.162162 | 3 | 3 |
679c9e4083a7c24275b6edae6a343ce5f10e6a45 | dev/assets/sass/tipi.core/containers/combined/_combined.scss | dev/assets/sass/tipi.core/containers/combined/_combined.scss | @import "__config";
@import "__core";
@import "__construct";
@mixin container_combined--smartphone {
@include core_combined;
@include construct_combined-reset(smartphone, 0, $smartphone-max-width);
@include construct_combined-reset(phablet, $phablet-min-width, $phablet-max-width);
@include construct_combined-reset(tablet, $tablet-min-width, $tablet-max-width);
@include construct_combined-reset(tablet-landscape, $tablet-landscape-min-width, $tablet-landscape-max-width);
@include construct_combined-reset(desktop, $desktop-min-width, $desktop-max-width);
@include construct_combined-reset(widescreen, $widescreen-min-width, $widescreen-max-width);
@include construct_combined-reset(highroller, $highroller-min-width, $highroller-max-width);
} | @import "__config";
@import "__core";
@import "__construct";
@include core_combined;
@include construct_combined-reset(smartphone, 0, $smartphone-max-width);
@include construct_combined-reset(phablet, $phablet-min-width, $phablet-max-width);
@include construct_combined-reset(tablet, $tablet-min-width, $tablet-max-width);
@include construct_combined-reset(tablet-landscape, $tablet-landscape-min-width, $tablet-landscape-max-width);
@include construct_combined-reset(desktop, $desktop-min-width, $desktop-max-width);
@include construct_combined-reset(widescreen, $widescreen-min-width, $widescreen-max-width);
@include construct_combined-reset(highroller, $highroller-min-width, $highroller-max-width); | Correct include for the combined container | Correct include for the combined container
| SCSS | mit | toolbarthomas/tipi,toolbarthomas/tipi | scss | ## Code Before:
@import "__config";
@import "__core";
@import "__construct";
@mixin container_combined--smartphone {
@include core_combined;
@include construct_combined-reset(smartphone, 0, $smartphone-max-width);
@include construct_combined-reset(phablet, $phablet-min-width, $phablet-max-width);
@include construct_combined-reset(tablet, $tablet-min-width, $tablet-max-width);
@include construct_combined-reset(tablet-landscape, $tablet-landscape-min-width, $tablet-landscape-max-width);
@include construct_combined-reset(desktop, $desktop-min-width, $desktop-max-width);
@include construct_combined-reset(widescreen, $widescreen-min-width, $widescreen-max-width);
@include construct_combined-reset(highroller, $highroller-min-width, $highroller-max-width);
}
## Instruction:
Correct include for the combined container
## Code After:
@import "__config";
@import "__core";
@import "__construct";
@include core_combined;
@include construct_combined-reset(smartphone, 0, $smartphone-max-width);
@include construct_combined-reset(phablet, $phablet-min-width, $phablet-max-width);
@include construct_combined-reset(tablet, $tablet-min-width, $tablet-max-width);
@include construct_combined-reset(tablet-landscape, $tablet-landscape-min-width, $tablet-landscape-max-width);
@include construct_combined-reset(desktop, $desktop-min-width, $desktop-max-width);
@include construct_combined-reset(widescreen, $widescreen-min-width, $widescreen-max-width);
@include construct_combined-reset(highroller, $highroller-min-width, $highroller-max-width); | @import "__config";
@import "__core";
@import "__construct";
- @mixin container_combined--smartphone {
- @include core_combined;
? -
+ @include core_combined;
-
- @include construct_combined-reset(smartphone, 0, $smartphone-max-width);
? -
+ @include construct_combined-reset(smartphone, 0, $smartphone-max-width);
- @include construct_combined-reset(phablet, $phablet-min-width, $phablet-max-width);
? -
+ @include construct_combined-reset(phablet, $phablet-min-width, $phablet-max-width);
- @include construct_combined-reset(tablet, $tablet-min-width, $tablet-max-width);
? -
+ @include construct_combined-reset(tablet, $tablet-min-width, $tablet-max-width);
- @include construct_combined-reset(tablet-landscape, $tablet-landscape-min-width, $tablet-landscape-max-width);
? -
+ @include construct_combined-reset(tablet-landscape, $tablet-landscape-min-width, $tablet-landscape-max-width);
- @include construct_combined-reset(desktop, $desktop-min-width, $desktop-max-width);
? -
+ @include construct_combined-reset(desktop, $desktop-min-width, $desktop-max-width);
- @include construct_combined-reset(widescreen, $widescreen-min-width, $widescreen-max-width);
? -
+ @include construct_combined-reset(widescreen, $widescreen-min-width, $widescreen-max-width);
- @include construct_combined-reset(highroller, $highroller-min-width, $highroller-max-width);
? -
+ @include construct_combined-reset(highroller, $highroller-min-width, $highroller-max-width);
- } | 19 | 1.266667 | 8 | 11 |
5f10c13c4c8f20e9f9d716c021b0b666f7e1a3ad | classes/RO/Zone.php | classes/RO/Zone.php | <?php
/**
* Represents a zone
*
* @author Edward Rudd <urkle at outoforder.cc>
*/
class RO_Zone extends RO_Base {
protected function configSQL()
{
return "SELECT * FROM zones WHERE zone_id = ?";
}
protected function configCache()
{
return array('zones','zone_id');
}
protected function mobs()
{
FB::log($this->extra);
$min_level = empty($this->extra->min_level) ? null : $this->extra->min_level;
$max_level = empty($this->extra->max_level) ? null : $this->extra->max_level;
$stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level);
$rows = $stmt->fetchAll(PDO::FETCH_COLUMN);
return new ResultIterator($rows,'RO_Mob');
}
}
?>
| <?php
/**
* Represents a zone
*
* @author Edward Rudd <urkle at outoforder.cc>
*/
class RO_Zone extends RO_Base {
protected function configSQL()
{
return "SELECT * FROM zones WHERE zone_id = ?";
}
protected function configCache()
{
return array('zones','zone_id');
}
protected function mobs()
{
$min_level = empty($this->extra->min_level) ? null : $this->extra->min_level;
$max_level = empty($this->extra->max_level) ? null : $this->extra->max_level;
$stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level);
$rows = $stmt->fetchAll(PDO::FETCH_COLUMN);
return new ResultIterator($rows,'RO_Mob');
}
}
?>
| Remove debug line from class | Remove debug line from class
| PHP | agpl-3.0 | Anpu/INQ-Calculators,Anpu/INQ-Calculators,Anpu/INQ-Calculators | php | ## Code Before:
<?php
/**
* Represents a zone
*
* @author Edward Rudd <urkle at outoforder.cc>
*/
class RO_Zone extends RO_Base {
protected function configSQL()
{
return "SELECT * FROM zones WHERE zone_id = ?";
}
protected function configCache()
{
return array('zones','zone_id');
}
protected function mobs()
{
FB::log($this->extra);
$min_level = empty($this->extra->min_level) ? null : $this->extra->min_level;
$max_level = empty($this->extra->max_level) ? null : $this->extra->max_level;
$stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level);
$rows = $stmt->fetchAll(PDO::FETCH_COLUMN);
return new ResultIterator($rows,'RO_Mob');
}
}
?>
## Instruction:
Remove debug line from class
## Code After:
<?php
/**
* Represents a zone
*
* @author Edward Rudd <urkle at outoforder.cc>
*/
class RO_Zone extends RO_Base {
protected function configSQL()
{
return "SELECT * FROM zones WHERE zone_id = ?";
}
protected function configCache()
{
return array('zones','zone_id');
}
protected function mobs()
{
$min_level = empty($this->extra->min_level) ? null : $this->extra->min_level;
$max_level = empty($this->extra->max_level) ? null : $this->extra->max_level;
$stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level);
$rows = $stmt->fetchAll(PDO::FETCH_COLUMN);
return new ResultIterator($rows,'RO_Mob');
}
}
?>
| <?php
/**
* Represents a zone
*
* @author Edward Rudd <urkle at outoforder.cc>
*/
class RO_Zone extends RO_Base {
protected function configSQL()
{
return "SELECT * FROM zones WHERE zone_id = ?";
}
protected function configCache()
{
return array('zones','zone_id');
}
protected function mobs()
{
- FB::log($this->extra);
$min_level = empty($this->extra->min_level) ? null : $this->extra->min_level;
$max_level = empty($this->extra->max_level) ? null : $this->extra->max_level;
$stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level);
$rows = $stmt->fetchAll(PDO::FETCH_COLUMN);
return new ResultIterator($rows,'RO_Mob');
}
}
?> | 1 | 0.035714 | 0 | 1 |
c2562a8cb2e3d5d3f68604c32d4db7e62422e7a5 | pathvalidate/_symbol.py | pathvalidate/_symbol.py |
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".format(re.escape("".join(ascii_symbol_list + unprintable_ascii_char_list))), re.UNICODE
)
def validate_symbol(text):
"""
Verifying whether symbol(s) included in the ``text`` or not.
:param str text: Input text.
:raises pathvalidate.InvalidCharError:
If symbol(s) included in the ``text``.
"""
match_list = __RE_SYMBOL.findall(_preprocess(text))
if match_list:
raise InvalidCharError("invalid symbols found: {}".format(match_list))
def replace_symbol(text, replacement_text=""):
"""
Replace all of the symbols in the ``text``.
:param str text: Input text.
:param str replacement_text: Replacement text.
:return: A replacement string.
:rtype: str
:Examples:
:ref:`example-sanitize-symbol`
"""
try:
return __RE_SYMBOL.sub(replacement_text, _preprocess(text))
except (TypeError, AttributeError):
raise TypeError("text must be a string")
|
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".format(re.escape("".join(ascii_symbol_list + unprintable_ascii_char_list))), re.UNICODE
)
def validate_symbol(text):
"""
Verifying whether symbol(s) included in the ``text`` or not.
:param str text: Input text.
:raises pathvalidate.InvalidCharError:
If symbol(s) included in the ``text``.
"""
match_list = __RE_SYMBOL.findall(_preprocess(text))
if match_list:
raise InvalidCharError("invalid symbols found: {}".format(match_list))
def replace_symbol(text, replacement_text=""):
"""
Replace all of the symbols in the ``text``.
:param str text: Input text.
:param str replacement_text: Replacement text.
:return: A replacement string.
:rtype: str
:Examples:
:ref:`example-sanitize-symbol`
"""
try:
return __RE_SYMBOL.sub(replacement_text, _preprocess(text))
except (TypeError, AttributeError):
raise TypeError("text must be a string")
| Remove an import that no longer used | Remove an import that no longer used
| Python | mit | thombashi/pathvalidate | python | ## Code Before:
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".format(re.escape("".join(ascii_symbol_list + unprintable_ascii_char_list))), re.UNICODE
)
def validate_symbol(text):
"""
Verifying whether symbol(s) included in the ``text`` or not.
:param str text: Input text.
:raises pathvalidate.InvalidCharError:
If symbol(s) included in the ``text``.
"""
match_list = __RE_SYMBOL.findall(_preprocess(text))
if match_list:
raise InvalidCharError("invalid symbols found: {}".format(match_list))
def replace_symbol(text, replacement_text=""):
"""
Replace all of the symbols in the ``text``.
:param str text: Input text.
:param str replacement_text: Replacement text.
:return: A replacement string.
:rtype: str
:Examples:
:ref:`example-sanitize-symbol`
"""
try:
return __RE_SYMBOL.sub(replacement_text, _preprocess(text))
except (TypeError, AttributeError):
raise TypeError("text must be a string")
## Instruction:
Remove an import that no longer used
## Code After:
from __future__ import absolute_import, unicode_literals
import re
from ._common import _preprocess, ascii_symbol_list, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".format(re.escape("".join(ascii_symbol_list + unprintable_ascii_char_list))), re.UNICODE
)
def validate_symbol(text):
"""
Verifying whether symbol(s) included in the ``text`` or not.
:param str text: Input text.
:raises pathvalidate.InvalidCharError:
If symbol(s) included in the ``text``.
"""
match_list = __RE_SYMBOL.findall(_preprocess(text))
if match_list:
raise InvalidCharError("invalid symbols found: {}".format(match_list))
def replace_symbol(text, replacement_text=""):
"""
Replace all of the symbols in the ``text``.
:param str text: Input text.
:param str replacement_text: Replacement text.
:return: A replacement string.
:rtype: str
:Examples:
:ref:`example-sanitize-symbol`
"""
try:
return __RE_SYMBOL.sub(replacement_text, _preprocess(text))
except (TypeError, AttributeError):
raise TypeError("text must be a string")
|
from __future__ import absolute_import, unicode_literals
import re
- from ._common import _preprocess, ascii_symbol_list, is_not_null_string, unprintable_ascii_char_list
? --------------------
+ from ._common import _preprocess, ascii_symbol_list, unprintable_ascii_char_list
from .error import InvalidCharError
__RE_SYMBOL = re.compile(
"[{}]".format(re.escape("".join(ascii_symbol_list + unprintable_ascii_char_list))), re.UNICODE
)
def validate_symbol(text):
"""
Verifying whether symbol(s) included in the ``text`` or not.
:param str text: Input text.
:raises pathvalidate.InvalidCharError:
If symbol(s) included in the ``text``.
"""
match_list = __RE_SYMBOL.findall(_preprocess(text))
if match_list:
raise InvalidCharError("invalid symbols found: {}".format(match_list))
def replace_symbol(text, replacement_text=""):
"""
Replace all of the symbols in the ``text``.
:param str text: Input text.
:param str replacement_text: Replacement text.
:return: A replacement string.
:rtype: str
:Examples:
:ref:`example-sanitize-symbol`
"""
try:
return __RE_SYMBOL.sub(replacement_text, _preprocess(text))
except (TypeError, AttributeError):
raise TypeError("text must be a string") | 2 | 0.043478 | 1 | 1 |
17f011eedfe8438e20206d8f658ca3db0ee66d9b | lib/middleman-title/helpers.rb | lib/middleman-title/helpers.rb | module Middleman
module Title
module Helpers
def page_title
current_page_title = current_page.data.page_title
return current_page_title unless current_page_title.nil?
title = []
title = add_page_name_to_title(title)
title = add_website_name_to_title(title)
title.compact.join(title_separator)
end
private
def title_options
::Middleman::TitleExtension.options
end
def website_name
current_page.data.title_site || title_options.site
end
def title_separator
title_options.separator
end
def title_reverse
if current_page.data.title_reverse.nil? == false
current_page.data.title_reverse
else
title_options.reverse
end
end
def page_name
page_name = current_page.data.title
if page_name.is_a? Array
page_name = page_name.join(title_separator)
end
page_name
end
def add_website_name_to_title(title)
if current_page.data.title_site == false || website_name == false
title
elsif website_name_first?
title.unshift(website_name)
else
title << website_name
end
end
def add_page_name_to_title(title)
title << page_name
end
def website_name_first?
title_reverse
end
end
end
end
| module Middleman
module Title
module Helpers
def page_title
current_page_title = current_page.data.page_title
return current_page_title unless current_page_title.nil?
title = []
title = add_page_name_to_title(title)
title = add_website_name_to_title(title)
title.compact.join(title_separator)
end
private
def title_options
::Middleman::TitleExtension.options
end
def website_name
current_page.data.title_site || title_options.site
end
def title_separator
title_options.separator
end
def title_reverse
if current_page.data.title_reverse.nil? == false
current_page.data.title_reverse
else
title_options.reverse
end
end
def page_name
page_name = current_page.data.title
if page_name.is_a? Array
page_name = page_name.join(title_separator)
end
page_name
end
def add_website_name_to_title(title)
if current_page.data.title_site == false || website_name == false
title
elsif website_name_first?
title.unshift(website_name)
else
title << website_name
end
end
def add_page_name_to_title(title)
title << page_name
end
def website_name_first?
title_reverse
end
end
end
end
| Fix indention of private methods | Fix indention of private methods
| Ruby | mit | jcypret/middleman-title | ruby | ## Code Before:
module Middleman
module Title
module Helpers
def page_title
current_page_title = current_page.data.page_title
return current_page_title unless current_page_title.nil?
title = []
title = add_page_name_to_title(title)
title = add_website_name_to_title(title)
title.compact.join(title_separator)
end
private
def title_options
::Middleman::TitleExtension.options
end
def website_name
current_page.data.title_site || title_options.site
end
def title_separator
title_options.separator
end
def title_reverse
if current_page.data.title_reverse.nil? == false
current_page.data.title_reverse
else
title_options.reverse
end
end
def page_name
page_name = current_page.data.title
if page_name.is_a? Array
page_name = page_name.join(title_separator)
end
page_name
end
def add_website_name_to_title(title)
if current_page.data.title_site == false || website_name == false
title
elsif website_name_first?
title.unshift(website_name)
else
title << website_name
end
end
def add_page_name_to_title(title)
title << page_name
end
def website_name_first?
title_reverse
end
end
end
end
## Instruction:
Fix indention of private methods
## Code After:
module Middleman
module Title
module Helpers
def page_title
current_page_title = current_page.data.page_title
return current_page_title unless current_page_title.nil?
title = []
title = add_page_name_to_title(title)
title = add_website_name_to_title(title)
title.compact.join(title_separator)
end
private
def title_options
::Middleman::TitleExtension.options
end
def website_name
current_page.data.title_site || title_options.site
end
def title_separator
title_options.separator
end
def title_reverse
if current_page.data.title_reverse.nil? == false
current_page.data.title_reverse
else
title_options.reverse
end
end
def page_name
page_name = current_page.data.title
if page_name.is_a? Array
page_name = page_name.join(title_separator)
end
page_name
end
def add_website_name_to_title(title)
if current_page.data.title_site == false || website_name == false
title
elsif website_name_first?
title.unshift(website_name)
else
title << website_name
end
end
def add_page_name_to_title(title)
title << page_name
end
def website_name_first?
title_reverse
end
end
end
end
| module Middleman
module Title
module Helpers
def page_title
current_page_title = current_page.data.page_title
return current_page_title unless current_page_title.nil?
title = []
title = add_page_name_to_title(title)
title = add_website_name_to_title(title)
title.compact.join(title_separator)
end
private
+
- def title_options
? --
+ def title_options
- ::Middleman::TitleExtension.options
? --
+ ::Middleman::TitleExtension.options
+ end
+
+ def website_name
+ current_page.data.title_site || title_options.site
+ end
+
+ def title_separator
+ title_options.separator
+ end
+
+ def title_reverse
+ if current_page.data.title_reverse.nil? == false
+ current_page.data.title_reverse
+ else
+ title_options.reverse
+ end
+ end
+
+ def page_name
+ page_name = current_page.data.title
+
+ if page_name.is_a? Array
+ page_name = page_name.join(title_separator)
end
+ page_name
+ end
+
+ def add_website_name_to_title(title)
+ if current_page.data.title_site == false || website_name == false
+ title
- def website_name
? -
+ elsif website_name_first?
? +++ +++++++
- current_page.data.title_site || title_options.site
+ title.unshift(website_name)
+ else
+ title << website_name
end
+ end
- def title_separator
- title_options.separator
+ def add_page_name_to_title(title)
+ title << page_name
- end
? --
+ end
- def title_reverse
- if current_page.data.title_reverse.nil? == false
- current_page.data.title_reverse
- else
- title_options.reverse
- end
- end
-
- def page_name
- page_name = current_page.data.title
-
- if page_name.is_a? Array
- page_name = page_name.join(title_separator)
- end
-
- page_name
- end
-
- def add_website_name_to_title(title)
- if current_page.data.title_site == false || website_name == false
- title
- elsif website_name_first?
- title.unshift(website_name)
- else
- title << website_name
- end
- end
-
- def add_page_name_to_title(title)
- title << page_name
- end
-
- def website_name_first?
? --
+ def website_name_first?
- title_reverse
? --
+ title_reverse
- end
? --
+ end
end
end
end | 85 | 1.287879 | 43 | 42 |
1364193f3ef426a2a15c71942303bf51d4f257ec | app/config/initializers/active_admin.rb | app/config/initializers/active_admin.rb | ActiveAdmin.application.register_stylesheet "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"
# Add Apple web application icons
base_url = "//s3.amazonaws.com/codelation.activeadmin/apple-touch-icon"
sizes = [76, 120, 152, 167, 180]
ActiveAdmin.application.register_stylesheet "#{base_url}.png", media: nil, rel: "apple-touch-icon"
sizes.each do |size|
ActiveAdmin.application.register_stylesheet(
"#{base_url}-#{size}x#{size}.png",
media: nil,
rel: "apple-touch-icon",
sizes: "#{size}x#{size}"
)
end
# Add the meta tags to enable Active Admin as an iOS home screen app
ActiveAdmin.application.meta_tags ||= {}
ActiveAdmin.application.meta_tags["apple-mobile-web-app-capable"] ||= "yes"
ActiveAdmin.application.meta_tags["apple-mobile-web-app-title"] ||= "Admin"
ActiveAdmin.application.meta_tags["viewport"] ||= "width=device-width, initial-scale=1.0"
| config = ActiveAdmin.application
config.register_stylesheet "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"
# Add Apple web application icons
base_url = "//s3.amazonaws.com/codelation.activeadmin/apple-touch-icon"
sizes = [76, 120, 152, 167, 180]
config.register_stylesheet "#{base_url}.png", media: nil, rel: "apple-touch-icon"
sizes.each do |size|
config.register_stylesheet(
"#{base_url}-#{size}x#{size}.png",
media: nil,
rel: "apple-touch-icon",
sizes: "#{size}x#{size}"
)
end
# Add the meta tags to enable Active Admin as an iOS home screen app
config.meta_tags ||= {}
config.meta_tags["apple-mobile-web-app-capable"] ||= "yes"
config.meta_tags["apple-mobile-web-app-title"] ||= "Admin"
config.meta_tags["viewport"] ||= "width=device-width, initial-scale=1.0"
| Clean up active admin initializer | Clean up active admin initializer
| Ruby | mit | codelation/activeadmin_pro,codelation/active_admin_pro,codelation/active_admin_pro,codelation/activeadmin_pro | ruby | ## Code Before:
ActiveAdmin.application.register_stylesheet "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"
# Add Apple web application icons
base_url = "//s3.amazonaws.com/codelation.activeadmin/apple-touch-icon"
sizes = [76, 120, 152, 167, 180]
ActiveAdmin.application.register_stylesheet "#{base_url}.png", media: nil, rel: "apple-touch-icon"
sizes.each do |size|
ActiveAdmin.application.register_stylesheet(
"#{base_url}-#{size}x#{size}.png",
media: nil,
rel: "apple-touch-icon",
sizes: "#{size}x#{size}"
)
end
# Add the meta tags to enable Active Admin as an iOS home screen app
ActiveAdmin.application.meta_tags ||= {}
ActiveAdmin.application.meta_tags["apple-mobile-web-app-capable"] ||= "yes"
ActiveAdmin.application.meta_tags["apple-mobile-web-app-title"] ||= "Admin"
ActiveAdmin.application.meta_tags["viewport"] ||= "width=device-width, initial-scale=1.0"
## Instruction:
Clean up active admin initializer
## Code After:
config = ActiveAdmin.application
config.register_stylesheet "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"
# Add Apple web application icons
base_url = "//s3.amazonaws.com/codelation.activeadmin/apple-touch-icon"
sizes = [76, 120, 152, 167, 180]
config.register_stylesheet "#{base_url}.png", media: nil, rel: "apple-touch-icon"
sizes.each do |size|
config.register_stylesheet(
"#{base_url}-#{size}x#{size}.png",
media: nil,
rel: "apple-touch-icon",
sizes: "#{size}x#{size}"
)
end
# Add the meta tags to enable Active Admin as an iOS home screen app
config.meta_tags ||= {}
config.meta_tags["apple-mobile-web-app-capable"] ||= "yes"
config.meta_tags["apple-mobile-web-app-title"] ||= "Admin"
config.meta_tags["viewport"] ||= "width=device-width, initial-scale=1.0"
| + config = ActiveAdmin.application
- ActiveAdmin.application.register_stylesheet "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"
? - -------------------
+ config.register_stylesheet "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"
? +++
# Add Apple web application icons
base_url = "//s3.amazonaws.com/codelation.activeadmin/apple-touch-icon"
sizes = [76, 120, 152, 167, 180]
- ActiveAdmin.application.register_stylesheet "#{base_url}.png", media: nil, rel: "apple-touch-icon"
? - -------------------
+ config.register_stylesheet "#{base_url}.png", media: nil, rel: "apple-touch-icon"
? +++
sizes.each do |size|
- ActiveAdmin.application.register_stylesheet(
+ config.register_stylesheet(
"#{base_url}-#{size}x#{size}.png",
media: nil,
rel: "apple-touch-icon",
sizes: "#{size}x#{size}"
)
end
# Add the meta tags to enable Active Admin as an iOS home screen app
- ActiveAdmin.application.meta_tags ||= {}
+ config.meta_tags ||= {}
- ActiveAdmin.application.meta_tags["apple-mobile-web-app-capable"] ||= "yes"
? - -------------------
+ config.meta_tags["apple-mobile-web-app-capable"] ||= "yes"
? +++
- ActiveAdmin.application.meta_tags["apple-mobile-web-app-title"] ||= "Admin"
? - -------------------
+ config.meta_tags["apple-mobile-web-app-title"] ||= "Admin"
? +++
- ActiveAdmin.application.meta_tags["viewport"] ||= "width=device-width, initial-scale=1.0"
? - -------------------
+ config.meta_tags["viewport"] ||= "width=device-width, initial-scale=1.0"
? +++
| 15 | 0.75 | 8 | 7 |
87bfc05401d40f6d6e1a9bf4078e61d1909e49a4 | test/tests/php-ext-install/container.sh | test/tests/php-ext-install/container.sh | set -e
docker-php-ext-install pdo_mysql 2>&1
php -r 'exit(extension_loaded("pdo_mysql") ? 0 : 1);'
| set -e
docker-php-ext-install pdo_mysql 2>&1
php -r 'exit(extension_loaded("pdo_mysql") ? 0 : 1);'
grep -q '^extension=' /usr/local/etc/php/conf.d/*pdo_mysql*.ini
docker-php-ext-install opcache 2>&1
php -r 'exit(extension_loaded("Zend OPcache") ? 0 : 1);'
grep -q '^zend_extension=' /usr/local/etc/php/conf.d/*opcache*.ini
| Update php-ext-install test to install both a normal extension and a zend_extension, and verify that they're configured appropriately by docker-php-ext-enable | Update php-ext-install test to install both a normal extension and a zend_extension, and verify that they're configured appropriately by docker-php-ext-enable
| Shell | apache-2.0 | docker-solr/official-images,thresheek/official-images,docker-library/official-images,chorrell/official-images,davidl-zend/official-images,docker-solr/official-images,chorrell/official-images,neo-technology/docker-official-images,neo-technology/docker-official-images,thresheek/official-images,docker-flink/official-images,infosiftr/stackbrew,jperrin/official-images,dinogun/official-images,davidl-zend/official-images,docker-library/official-images,robfrank/official-images,dinogun/official-images,robfrank/official-images,docker-flink/official-images,infosiftr/stackbrew,robfrank/official-images,dinogun/official-images,docker-solr/official-images,davidl-zend/official-images,thresheek/official-images,31z4/official-images,31z4/official-images,dinogun/official-images,31z4/official-images,docker-flink/official-images,infosiftr/stackbrew,robfrank/official-images,chorrell/official-images,infosiftr/stackbrew,robfrank/official-images,jperrin/official-images,neo-technology/docker-official-images,robfrank/official-images,docker-flink/official-images,docker-flink/official-images,thresheek/official-images,neo-technology/docker-official-images,docker-library/official-images,jperrin/official-images,docker-library/official-images,chorrell/official-images,dinogun/official-images,docker-solr/official-images,docker-library/official-images,robfrank/official-images,chorrell/official-images,31z4/official-images,infosiftr/stackbrew,31z4/official-images,thresheek/official-images,docker-flink/official-images,davidl-zend/official-images,docker-solr/official-images,thresheek/official-images,31z4/official-images,31z4/official-images,chorrell/official-images,docker-library/official-images,chorrell/official-images,docker-flink/official-images,infosiftr/stackbrew,davidl-zend/official-images,robfrank/official-images,docker-solr/official-images,jperrin/official-images,davidl-zend/official-images,docker-library/official-images,31z4/official-images,dinogun/official-images,dinogun/official-images,31z4/official-images,thresheek/official-images,31z4/official-images,31z4/official-images,thresheek/official-images,31z4/official-images,jperrin/official-images,chorrell/official-images,thresheek/official-images,robfrank/official-images,robfrank/official-images,31z4/official-images,docker-library/official-images,docker-library/official-images,neo-technology/docker-official-images,chorrell/official-images,chorrell/official-images,dinogun/official-images,docker-library/official-images,jperrin/official-images,docker-flink/official-images,davidl-zend/official-images,robfrank/official-images,dinogun/official-images,dinogun/official-images,chorrell/official-images,docker-solr/official-images,docker-flink/official-images,docker-solr/official-images,infosiftr/stackbrew,docker-solr/official-images,neo-technology/docker-official-images,docker-solr/official-images,thresheek/official-images,docker-solr/official-images,jperrin/official-images,docker-library/official-images,robfrank/official-images,dinogun/official-images,docker-flink/official-images,infosiftr/stackbrew,infosiftr/stackbrew,davidl-zend/official-images,davidl-zend/official-images,docker-solr/official-images,chorrell/official-images,neo-technology/docker-official-images,jperrin/official-images,dinogun/official-images,davidl-zend/official-images,davidl-zend/official-images,thresheek/official-images,neo-technology/docker-official-images,docker-library/official-images,infosiftr/stackbrew,infosiftr/stackbrew,dinogun/official-images,jperrin/official-images,infosiftr/stackbrew,thresheek/official-images,neo-technology/docker-official-images,31z4/official-images,docker-solr/official-images,docker-library/official-images,davidl-zend/official-images,neo-technology/docker-official-images,jperrin/official-images,neo-technology/docker-official-images,docker-library/official-images,neo-technology/docker-official-images,jperrin/official-images,infosiftr/stackbrew,docker-flink/official-images,thresheek/official-images,infosiftr/stackbrew,docker-solr/official-images,robfrank/official-images,docker-flink/official-images,neo-technology/docker-official-images,davidl-zend/official-images,docker-flink/official-images,thresheek/official-images,jperrin/official-images,jperrin/official-images,chorrell/official-images,neo-technology/docker-official-images | shell | ## Code Before:
set -e
docker-php-ext-install pdo_mysql 2>&1
php -r 'exit(extension_loaded("pdo_mysql") ? 0 : 1);'
## Instruction:
Update php-ext-install test to install both a normal extension and a zend_extension, and verify that they're configured appropriately by docker-php-ext-enable
## Code After:
set -e
docker-php-ext-install pdo_mysql 2>&1
php -r 'exit(extension_loaded("pdo_mysql") ? 0 : 1);'
grep -q '^extension=' /usr/local/etc/php/conf.d/*pdo_mysql*.ini
docker-php-ext-install opcache 2>&1
php -r 'exit(extension_loaded("Zend OPcache") ? 0 : 1);'
grep -q '^zend_extension=' /usr/local/etc/php/conf.d/*opcache*.ini
| set -e
docker-php-ext-install pdo_mysql 2>&1
php -r 'exit(extension_loaded("pdo_mysql") ? 0 : 1);'
+ grep -q '^extension=' /usr/local/etc/php/conf.d/*pdo_mysql*.ini
+
+ docker-php-ext-install opcache 2>&1
+ php -r 'exit(extension_loaded("Zend OPcache") ? 0 : 1);'
+ grep -q '^zend_extension=' /usr/local/etc/php/conf.d/*opcache*.ini | 5 | 1.25 | 5 | 0 |
e0be052df4c4afc1af61ba2e90033a0eaf93c113 | src/renderer/components/open-torrent-address-modal.js | src/renderer/components/open-torrent-address-modal.js | const React = require('react')
const TextField = require('material-ui/TextField').default
const ModalOKCancel = require('./modal-ok-cancel')
const {dispatch, dispatcher} = require('../lib/dispatcher')
module.exports = class OpenTorrentAddressModal extends React.Component {
render () {
return (
<div className='open-torrent-address-modal'>
<p><label>Enter torrent address or magnet link</label></p>
<div>
<TextField
className='control'
ref={(c) => { this.torrentURL = c }}
fullWidth
onKeyDown={handleKeyDown.bind(this)} />
</div>
<ModalOKCancel
cancelText='CANCEL'
onCancel={dispatcher('exitModal')}
okText='OK'
onOK={handleOK.bind(this)} />
</div>
)
}
componentDidMount () {
this.torrentURL.input.focus()
}
}
function handleKeyDown (e) {
if (e.which === 13) this.handleOK() /* hit Enter to submit */
}
function handleOK () {
dispatch('exitModal')
dispatch('addTorrent', this.torrentURL.input.value)
}
| const React = require('react')
const TextField = require('material-ui/TextField').default
const ModalOKCancel = require('./modal-ok-cancel')
const {dispatch, dispatcher} = require('../lib/dispatcher')
module.exports = class OpenTorrentAddressModal extends React.Component {
render () {
return (
<div className='open-torrent-address-modal'>
<p><label>Enter torrent address or magnet link</label></p>
<div>
<TextField
id='torrent-address-field'
className='control'
ref={(c) => { this.torrentURL = c }}
fullWidth
onKeyDown={handleKeyDown.bind(this)} />
</div>
<ModalOKCancel
cancelText='CANCEL'
onCancel={dispatcher('exitModal')}
okText='OK'
onOK={handleOK.bind(this)} />
</div>
)
}
componentDidMount () {
this.torrentURL.input.focus()
}
}
function handleKeyDown (e) {
if (e.which === 13) handleOK.call(this) /* hit Enter to submit */
}
function handleOK () {
dispatch('exitModal')
dispatch('addTorrent', this.torrentURL.input.value)
}
| Fix Open Torrent Address modal | Fix Open Torrent Address modal
Fixes a bug introduced in 0.14.0: cicking OK works, but hitting Enter doesn't do anything
| JavaScript | mit | feross/webtorrent-app,michaelgeorgeattard/webtorrent-desktop,michaelgeorgeattard/webtorrent-desktop,webtorrent/webtorrent-desktop,michaelgeorgeattard/webtorrent-desktop,feross/webtorrent-desktop,feross/webtorrent-app,webtorrent/webtorrent-desktop,webtorrent/webtorrent-desktop,feross/webtorrent-desktop,feross/webtorrent-desktop,feross/webtorrent-app | javascript | ## Code Before:
const React = require('react')
const TextField = require('material-ui/TextField').default
const ModalOKCancel = require('./modal-ok-cancel')
const {dispatch, dispatcher} = require('../lib/dispatcher')
module.exports = class OpenTorrentAddressModal extends React.Component {
render () {
return (
<div className='open-torrent-address-modal'>
<p><label>Enter torrent address or magnet link</label></p>
<div>
<TextField
className='control'
ref={(c) => { this.torrentURL = c }}
fullWidth
onKeyDown={handleKeyDown.bind(this)} />
</div>
<ModalOKCancel
cancelText='CANCEL'
onCancel={dispatcher('exitModal')}
okText='OK'
onOK={handleOK.bind(this)} />
</div>
)
}
componentDidMount () {
this.torrentURL.input.focus()
}
}
function handleKeyDown (e) {
if (e.which === 13) this.handleOK() /* hit Enter to submit */
}
function handleOK () {
dispatch('exitModal')
dispatch('addTorrent', this.torrentURL.input.value)
}
## Instruction:
Fix Open Torrent Address modal
Fixes a bug introduced in 0.14.0: cicking OK works, but hitting Enter doesn't do anything
## Code After:
const React = require('react')
const TextField = require('material-ui/TextField').default
const ModalOKCancel = require('./modal-ok-cancel')
const {dispatch, dispatcher} = require('../lib/dispatcher')
module.exports = class OpenTorrentAddressModal extends React.Component {
render () {
return (
<div className='open-torrent-address-modal'>
<p><label>Enter torrent address or magnet link</label></p>
<div>
<TextField
id='torrent-address-field'
className='control'
ref={(c) => { this.torrentURL = c }}
fullWidth
onKeyDown={handleKeyDown.bind(this)} />
</div>
<ModalOKCancel
cancelText='CANCEL'
onCancel={dispatcher('exitModal')}
okText='OK'
onOK={handleOK.bind(this)} />
</div>
)
}
componentDidMount () {
this.torrentURL.input.focus()
}
}
function handleKeyDown (e) {
if (e.which === 13) handleOK.call(this) /* hit Enter to submit */
}
function handleOK () {
dispatch('exitModal')
dispatch('addTorrent', this.torrentURL.input.value)
}
| const React = require('react')
const TextField = require('material-ui/TextField').default
const ModalOKCancel = require('./modal-ok-cancel')
const {dispatch, dispatcher} = require('../lib/dispatcher')
module.exports = class OpenTorrentAddressModal extends React.Component {
render () {
return (
<div className='open-torrent-address-modal'>
<p><label>Enter torrent address or magnet link</label></p>
<div>
<TextField
+ id='torrent-address-field'
className='control'
ref={(c) => { this.torrentURL = c }}
fullWidth
onKeyDown={handleKeyDown.bind(this)} />
</div>
<ModalOKCancel
cancelText='CANCEL'
onCancel={dispatcher('exitModal')}
okText='OK'
onOK={handleOK.bind(this)} />
</div>
)
}
componentDidMount () {
this.torrentURL.input.focus()
}
}
function handleKeyDown (e) {
- if (e.which === 13) this.handleOK() /* hit Enter to submit */
? -----
+ if (e.which === 13) handleOK.call(this) /* hit Enter to submit */
? +++++ ++++
}
function handleOK () {
dispatch('exitModal')
dispatch('addTorrent', this.torrentURL.input.value)
} | 3 | 0.075 | 2 | 1 |
f3a322ff97f7d8020ed13084252bc5f3bb8bcb75 | addressbook-web-tests/src/test/resources/testng-groups.xml | addressbook-web-tests/src/test/resources/testng-groups.xml | <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1">
<test name="Groups">
<classes>
<class name="ru.vitali.pft.addressbook.tests.GroupCreationTests"/>
<class name="ru.vitali.pft.addressbook.tests.GroupModificationTests"/>
<class name="ru.vitali.pft.addressbook.tests.GroupDeletionTests"/>
</classes>
</test>
</suite>
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1">
<test name="Groups">
<classes>
<class name="ru.vitali.pft.addressbook.tests.GroupModificationTests"/>
</classes>
</test>
</suite>
| Reduce the number of tests in test suite | Reduce the number of tests in test suite
| XML | apache-2.0 | vlucenco/java_learn,vlucenco/java_learn | xml | ## Code Before:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1">
<test name="Groups">
<classes>
<class name="ru.vitali.pft.addressbook.tests.GroupCreationTests"/>
<class name="ru.vitali.pft.addressbook.tests.GroupModificationTests"/>
<class name="ru.vitali.pft.addressbook.tests.GroupDeletionTests"/>
</classes>
</test>
</suite>
## Instruction:
Reduce the number of tests in test suite
## Code After:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1">
<test name="Groups">
<classes>
<class name="ru.vitali.pft.addressbook.tests.GroupModificationTests"/>
</classes>
</test>
</suite>
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1">
<test name="Groups">
<classes>
- <class name="ru.vitali.pft.addressbook.tests.GroupCreationTests"/>
<class name="ru.vitali.pft.addressbook.tests.GroupModificationTests"/>
- <class name="ru.vitali.pft.addressbook.tests.GroupDeletionTests"/>
</classes>
</test>
</suite> | 2 | 0.181818 | 0 | 2 |
0a7f94f1b693f87585e3d9977961528314f4d71c | app/src/main/java/util/prefs/RegisterTermsPref.kt | app/src/main/java/util/prefs/RegisterTermsPref.kt | /*
* Copyright 2014-2018 Julien Guerinet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.guerinet.mymartlet.util.prefs
import android.content.SharedPreferences
import com.guerinet.mymartlet.model.Term
import com.guerinet.suitcase.prefs.StringPref
/**
* Stores and loads the list of [Term]s a user can currently register in
* @author Julien Guerinet
* @since 1.0.0
*/
class RegisterTermsPref(prefs: SharedPreferences) : StringPref(prefs, "register_terms", "") {
var terms: List<Term> = value.split(",").map { Term.parseTerm(it) }
set(value) {
field = value
super.value = value.joinToString(",") { term -> term.id }
}
override fun clear() {
super.clear()
terms = listOf()
}
} | /*
* Copyright 2014-2018 Julien Guerinet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.guerinet.mymartlet.util.prefs
import android.content.SharedPreferences
import com.guerinet.mymartlet.model.Term
import com.guerinet.suitcase.prefs.StringPref
/**
* Stores and loads the list of [Term]s a user can currently register in
* @author Julien Guerinet
* @since 1.0.0
*/
class RegisterTermsPref(prefs: SharedPreferences) : StringPref(prefs, "register_terms", "") {
var terms: List<Term> = value.split(",").filter { it.isNotBlank() }.map { Term.parseTerm(it) }
set(value) {
field = value
super.value = value.joinToString(",") { term -> term.id }
}
override fun clear() {
super.clear()
terms = listOf()
}
} | Fix parsing of empty register terms | Fix parsing of empty register terms
| Kotlin | apache-2.0 | jguerinet/MyMartlet,jguerinet/MyMartlet-Android,jguerinet/MyMartlet,jguerinet/MyMartlet,jguerinet/MyMartlet | kotlin | ## Code Before:
/*
* Copyright 2014-2018 Julien Guerinet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.guerinet.mymartlet.util.prefs
import android.content.SharedPreferences
import com.guerinet.mymartlet.model.Term
import com.guerinet.suitcase.prefs.StringPref
/**
* Stores and loads the list of [Term]s a user can currently register in
* @author Julien Guerinet
* @since 1.0.0
*/
class RegisterTermsPref(prefs: SharedPreferences) : StringPref(prefs, "register_terms", "") {
var terms: List<Term> = value.split(",").map { Term.parseTerm(it) }
set(value) {
field = value
super.value = value.joinToString(",") { term -> term.id }
}
override fun clear() {
super.clear()
terms = listOf()
}
}
## Instruction:
Fix parsing of empty register terms
## Code After:
/*
* Copyright 2014-2018 Julien Guerinet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.guerinet.mymartlet.util.prefs
import android.content.SharedPreferences
import com.guerinet.mymartlet.model.Term
import com.guerinet.suitcase.prefs.StringPref
/**
* Stores and loads the list of [Term]s a user can currently register in
* @author Julien Guerinet
* @since 1.0.0
*/
class RegisterTermsPref(prefs: SharedPreferences) : StringPref(prefs, "register_terms", "") {
var terms: List<Term> = value.split(",").filter { it.isNotBlank() }.map { Term.parseTerm(it) }
set(value) {
field = value
super.value = value.joinToString(",") { term -> term.id }
}
override fun clear() {
super.clear()
terms = listOf()
}
} | /*
* Copyright 2014-2018 Julien Guerinet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.guerinet.mymartlet.util.prefs
import android.content.SharedPreferences
import com.guerinet.mymartlet.model.Term
import com.guerinet.suitcase.prefs.StringPref
/**
* Stores and loads the list of [Term]s a user can currently register in
* @author Julien Guerinet
* @since 1.0.0
*/
class RegisterTermsPref(prefs: SharedPreferences) : StringPref(prefs, "register_terms", "") {
- var terms: List<Term> = value.split(",").map { Term.parseTerm(it) }
+ var terms: List<Term> = value.split(",").filter { it.isNotBlank() }.map { Term.parseTerm(it) }
? +++++++++++++++++++++++++++
set(value) {
field = value
super.value = value.joinToString(",") { term -> term.id }
}
override fun clear() {
super.clear()
terms = listOf()
}
} | 2 | 0.05 | 1 | 1 |
72c4301a4fc926b44343d1c79e0f0706181381de | index.html | index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-mdl-datepicker</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-mdl-datepicker</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
| Remove useless mdl css link | Remove useless mdl css link
| HTML | mit | CYBAI/vue-mdl-datepicker,CYBAI/vue-mdl-datepicker | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-mdl-datepicker</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
## Instruction:
Remove useless mdl css link
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-mdl-datepicker</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-mdl-datepicker</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
- <script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html> | 1 | 0.071429 | 0 | 1 |
71f7e54e7130baf05adec17235d413e8aa7432e2 | .travis/matrix-script.sh | .travis/matrix-script.sh | set -ev
source docker/utils.sh
FLAVOUR='travis'
if [ "${MATRIX_TYPE}" = "javascript" ]; then
FLAVOUR='travis-js'
fi
run_tests() {
# This function allows overriding the test comnmand and the test that get run
# which is used by 'simulate.sh'
TESTS=${TEST_OVERRIDE:-"$1"}
ENV_VARS=""
if [ $# -eq 2 ]; then
ENV_VARS="$2"
fi
if [ -z ${COMMAND_OVERRIDE} ]; then
docker_run $ENV_VARS web_test ".travis/test_runner.sh $TESTS"
else
docker_run $ENV_VARS web_test $COMMAND_OVERRIDE
fi
}
if [ "${MATRIX_TYPE}" = "python" ]; then
TESTS="--testrunner=$TESTRUNNER"
run_tests "$TESTS"
elif [ "${MATRIX_TYPE}" = "python-sharded" ]; then
SHARDED_TEST_APPS="form_processor sql_db couchforms case phone receiverwrapper"
ENV="-e USE_PARTITIONED_DATABASE=yes"
run_tests "$SHARDED_TEST_APPS" "$ENV"
elif [ "${MATRIX_TYPE}" = "javascript" ]; then
docker_run web_test python manage.py migrate --noinput
docker_run web_test docker/wait.sh WEB_TEST
docker_run web_test grunt mocha
fi
| set -ev
source docker/utils.sh
FLAVOUR='travis'
if [ "${MATRIX_TYPE}" = "javascript" ]; then
FLAVOUR='travis-js'
fi
run_tests() {
# This function allows overriding the test comnmand and the test that get run
# which is used by 'simulate.sh'
TESTS=${TEST_OVERRIDE:-"$1"}
ENV_VARS=""
if [ $# -eq 2 ]; then
ENV_VARS="$2"
fi
if [ -z ${COMMAND_OVERRIDE} ]; then
docker_run $ENV_VARS web_test ".travis/test_runner.sh $TESTS"
else
docker_run $ENV_VARS web_test $COMMAND_OVERRIDE
fi
}
if [ "${MATRIX_TYPE}" = "python" ]; then
TESTS="--testrunner=$TESTRUNNER"
run_tests "$TESTS"
elif [ "${MATRIX_TYPE}" = "python-sharded" ]; then
SHARDED_TEST_APPS="corehq.form_processor \
corehq.sql_db \
couchforms \
casexml.apps.case \
casexml.apps.phone \
corehq.apps.receiverwrapper"
ENV="-e USE_PARTITIONED_DATABASE=yes"
run_tests "$SHARDED_TEST_APPS" "$ENV"
elif [ "${MATRIX_TYPE}" = "javascript" ]; then
docker_run web_test python manage.py migrate --noinput
docker_run web_test docker/wait.sh WEB_TEST
docker_run web_test grunt mocha
fi
| Fix shareded test run on travis | Fix shareded test run on travis | Shell | bsd-3-clause | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | shell | ## Code Before:
set -ev
source docker/utils.sh
FLAVOUR='travis'
if [ "${MATRIX_TYPE}" = "javascript" ]; then
FLAVOUR='travis-js'
fi
run_tests() {
# This function allows overriding the test comnmand and the test that get run
# which is used by 'simulate.sh'
TESTS=${TEST_OVERRIDE:-"$1"}
ENV_VARS=""
if [ $# -eq 2 ]; then
ENV_VARS="$2"
fi
if [ -z ${COMMAND_OVERRIDE} ]; then
docker_run $ENV_VARS web_test ".travis/test_runner.sh $TESTS"
else
docker_run $ENV_VARS web_test $COMMAND_OVERRIDE
fi
}
if [ "${MATRIX_TYPE}" = "python" ]; then
TESTS="--testrunner=$TESTRUNNER"
run_tests "$TESTS"
elif [ "${MATRIX_TYPE}" = "python-sharded" ]; then
SHARDED_TEST_APPS="form_processor sql_db couchforms case phone receiverwrapper"
ENV="-e USE_PARTITIONED_DATABASE=yes"
run_tests "$SHARDED_TEST_APPS" "$ENV"
elif [ "${MATRIX_TYPE}" = "javascript" ]; then
docker_run web_test python manage.py migrate --noinput
docker_run web_test docker/wait.sh WEB_TEST
docker_run web_test grunt mocha
fi
## Instruction:
Fix shareded test run on travis
## Code After:
set -ev
source docker/utils.sh
FLAVOUR='travis'
if [ "${MATRIX_TYPE}" = "javascript" ]; then
FLAVOUR='travis-js'
fi
run_tests() {
# This function allows overriding the test comnmand and the test that get run
# which is used by 'simulate.sh'
TESTS=${TEST_OVERRIDE:-"$1"}
ENV_VARS=""
if [ $# -eq 2 ]; then
ENV_VARS="$2"
fi
if [ -z ${COMMAND_OVERRIDE} ]; then
docker_run $ENV_VARS web_test ".travis/test_runner.sh $TESTS"
else
docker_run $ENV_VARS web_test $COMMAND_OVERRIDE
fi
}
if [ "${MATRIX_TYPE}" = "python" ]; then
TESTS="--testrunner=$TESTRUNNER"
run_tests "$TESTS"
elif [ "${MATRIX_TYPE}" = "python-sharded" ]; then
SHARDED_TEST_APPS="corehq.form_processor \
corehq.sql_db \
couchforms \
casexml.apps.case \
casexml.apps.phone \
corehq.apps.receiverwrapper"
ENV="-e USE_PARTITIONED_DATABASE=yes"
run_tests "$SHARDED_TEST_APPS" "$ENV"
elif [ "${MATRIX_TYPE}" = "javascript" ]; then
docker_run web_test python manage.py migrate --noinput
docker_run web_test docker/wait.sh WEB_TEST
docker_run web_test grunt mocha
fi
| set -ev
source docker/utils.sh
FLAVOUR='travis'
if [ "${MATRIX_TYPE}" = "javascript" ]; then
FLAVOUR='travis-js'
fi
run_tests() {
# This function allows overriding the test comnmand and the test that get run
# which is used by 'simulate.sh'
TESTS=${TEST_OVERRIDE:-"$1"}
ENV_VARS=""
if [ $# -eq 2 ]; then
ENV_VARS="$2"
fi
if [ -z ${COMMAND_OVERRIDE} ]; then
docker_run $ENV_VARS web_test ".travis/test_runner.sh $TESTS"
else
docker_run $ENV_VARS web_test $COMMAND_OVERRIDE
fi
}
if [ "${MATRIX_TYPE}" = "python" ]; then
TESTS="--testrunner=$TESTRUNNER"
run_tests "$TESTS"
elif [ "${MATRIX_TYPE}" = "python-sharded" ]; then
- SHARDED_TEST_APPS="form_processor sql_db couchforms case phone receiverwrapper"
+ SHARDED_TEST_APPS="corehq.form_processor \
+ corehq.sql_db \
+ couchforms \
+ casexml.apps.case \
+ casexml.apps.phone \
+ corehq.apps.receiverwrapper"
ENV="-e USE_PARTITIONED_DATABASE=yes"
run_tests "$SHARDED_TEST_APPS" "$ENV"
elif [ "${MATRIX_TYPE}" = "javascript" ]; then
docker_run web_test python manage.py migrate --noinput
docker_run web_test docker/wait.sh WEB_TEST
docker_run web_test grunt mocha
fi | 7 | 0.162791 | 6 | 1 |
44c99192a35a228a97b109fa7bc597caedaed28f | admin/static/handlebars/resolve_issues-resolved-template.handlebars | admin/static/handlebars/resolve_issues-resolved-template.handlebars | <div class="alert" data-alert="alert">
<a class="close" href="#">×</a>
{{#if name_conflict}}
<p>You successfully solved the name conflict.</p>
{{/if}}
{{#if server_dead}}
<p>You successfully removed the server <span class="name">{{server_name}}</span>.</p>
{{/if}}
{{#if unsatisfiable_goals}}
<p>You successfully solved {{#unless can_be_solved}}a part of{{/unless}} the unsatisfiable goals issue.</p>
{{/if}}
</div>
| <div class="alert" data-alert="alert">
<a class="close" href="#">×</a>
{{#if name_conflict}}
<p>You successfully solved the name conflict.</p>
{{/if}}
{{#if server_dead}}
<p>You successfully removed the server <span class="name">{{server_name}}</span>.</p>
{{/if}}
</div>
| Remove unneeded piece of template | Remove unneeded piece of template
| Handlebars | apache-2.0 | yakovenkodenis/rethinkdb,JackieXie168/rethinkdb,mcanthony/rethinkdb,jmptrader/rethinkdb,matthaywardwebdesign/rethinkdb,mquandalle/rethinkdb,eliangidoni/rethinkdb,Wilbeibi/rethinkdb,wkennington/rethinkdb,tempbottle/rethinkdb,losywee/rethinkdb,4talesa/rethinkdb,rrampage/rethinkdb,urandu/rethinkdb,Qinusty/rethinkdb,yakovenkodenis/rethinkdb,wojons/rethinkdb,AntouanK/rethinkdb,ajose01/rethinkdb,JackieXie168/rethinkdb,captainpete/rethinkdb,lenstr/rethinkdb,urandu/rethinkdb,wojons/rethinkdb,bchavez/rethinkdb,marshall007/rethinkdb,rrampage/rethinkdb,wojons/rethinkdb,marshall007/rethinkdb,yaolinz/rethinkdb,catroot/rethinkdb,robertjpayne/rethinkdb,rrampage/rethinkdb,grandquista/rethinkdb,elkingtonmcb/rethinkdb,ayumilong/rethinkdb,RubenKelevra/rethinkdb,4talesa/rethinkdb,losywee/rethinkdb,rrampage/rethinkdb,gavioto/rethinkdb,mbroadst/rethinkdb,bpradipt/rethinkdb,eliangidoni/rethinkdb,niieani/rethinkdb,elkingtonmcb/rethinkdb,bpradipt/rethinkdb,losywee/rethinkdb,KSanthanam/rethinkdb,sebadiaz/rethinkdb,bchavez/rethinkdb,grandquista/rethinkdb,eliangidoni/rethinkdb,ajose01/rethinkdb,ajose01/rethinkdb,robertjpayne/rethinkdb,eliangidoni/rethinkdb,scripni/rethinkdb,KSanthanam/rethinkdb,grandquista/rethinkdb,grandquista/rethinkdb,sontek/rethinkdb,robertjpayne/rethinkdb,grandquista/rethinkdb,grandquista/rethinkdb,Qinusty/rethinkdb,sontek/rethinkdb,mbroadst/rethinkdb,Wilbeibi/rethinkdb,yaolinz/rethinkdb,marshall007/rethinkdb,mquandalle/rethinkdb,elkingtonmcb/rethinkdb,victorbriz/rethinkdb,niieani/rethinkdb,greyhwndz/rethinkdb,jmptrader/rethinkdb,sbusso/rethinkdb,mbroadst/rethinkdb,sontek/rethinkdb,catroot/rethinkdb,wkennington/rethinkdb,yakovenkodenis/rethinkdb,scripni/rethinkdb,captainpete/rethinkdb,matthaywardwebdesign/rethinkdb,spblightadv/rethinkdb,rrampage/rethinkdb,elkingtonmcb/rethinkdb,sebadiaz/rethinkdb,tempbottle/rethinkdb,bchavez/rethinkdb,captainpete/rethinkdb,yaolinz/rethinkdb,yaolinz/rethinkdb,niieani/rethinkdb,mcanthony/rethinkdb,lenstr/rethinkdb,bpradipt/rethinkdb,ayumilong/rethinkdb,lenstr/rethinkdb,mquandalle/rethinkdb,eliangidoni/rethinkdb,gavioto/rethinkdb,catroot/rethinkdb,AntouanK/rethinkdb,sebadiaz/rethinkdb,eliangidoni/rethinkdb,jmptrader/rethinkdb,marshall007/rethinkdb,alash3al/rethinkdb,RubenKelevra/rethinkdb,wkennington/rethinkdb,catroot/rethinkdb,jesseditson/rethinkdb,yakovenkodenis/rethinkdb,niieani/rethinkdb,yaolinz/rethinkdb,matthaywardwebdesign/rethinkdb,bpradipt/rethinkdb,KSanthanam/rethinkdb,jesseditson/rethinkdb,mcanthony/rethinkdb,greyhwndz/rethinkdb,sebadiaz/rethinkdb,mbroadst/rethinkdb,spblightadv/rethinkdb,wkennington/rethinkdb,yakovenkodenis/rethinkdb,niieani/rethinkdb,sontek/rethinkdb,greyhwndz/rethinkdb,wkennington/rethinkdb,pap/rethinkdb,alash3al/rethinkdb,matthaywardwebdesign/rethinkdb,alash3al/rethinkdb,wojons/rethinkdb,dparnell/rethinkdb,ayumilong/rethinkdb,tempbottle/rethinkdb,catroot/rethinkdb,4talesa/rethinkdb,matthaywardwebdesign/rethinkdb,4talesa/rethinkdb,bpradipt/rethinkdb,victorbriz/rethinkdb,sebadiaz/rethinkdb,dparnell/rethinkdb,dparnell/rethinkdb,marshall007/rethinkdb,4talesa/rethinkdb,gavioto/rethinkdb,jesseditson/rethinkdb,ajose01/rethinkdb,scripni/rethinkdb,mquandalle/rethinkdb,Wilbeibi/rethinkdb,tempbottle/rethinkdb,jesseditson/rethinkdb,jmptrader/rethinkdb,victorbriz/rethinkdb,robertjpayne/rethinkdb,urandu/rethinkdb,dparnell/rethinkdb,dparnell/rethinkdb,4talesa/rethinkdb,yakovenkodenis/rethinkdb,lenstr/rethinkdb,wkennington/rethinkdb,KSanthanam/rethinkdb,AntouanK/rethinkdb,AntouanK/rethinkdb,ajose01/rethinkdb,mcanthony/rethinkdb,robertjpayne/rethinkdb,sbusso/rethinkdb,greyhwndz/rethinkdb,wkennington/rethinkdb,robertjpayne/rethinkdb,losywee/rethinkdb,eliangidoni/rethinkdb,Qinusty/rethinkdb,Qinusty/rethinkdb,Qinusty/rethinkdb,jesseditson/rethinkdb,gavioto/rethinkdb,victorbriz/rethinkdb,catroot/rethinkdb,bpradipt/rethinkdb,bchavez/rethinkdb,matthaywardwebdesign/rethinkdb,tempbottle/rethinkdb,gavioto/rethinkdb,robertjpayne/rethinkdb,sebadiaz/rethinkdb,mcanthony/rethinkdb,sebadiaz/rethinkdb,jmptrader/rethinkdb,ajose01/rethinkdb,marshall007/rethinkdb,KSanthanam/rethinkdb,pap/rethinkdb,scripni/rethinkdb,jmptrader/rethinkdb,tempbottle/rethinkdb,RubenKelevra/rethinkdb,rrampage/rethinkdb,scripni/rethinkdb,catroot/rethinkdb,sbusso/rethinkdb,urandu/rethinkdb,captainpete/rethinkdb,Wilbeibi/rethinkdb,Wilbeibi/rethinkdb,lenstr/rethinkdb,jesseditson/rethinkdb,dparnell/rethinkdb,yaolinz/rethinkdb,urandu/rethinkdb,victorbriz/rethinkdb,JackieXie168/rethinkdb,JackieXie168/rethinkdb,mbroadst/rethinkdb,grandquista/rethinkdb,mcanthony/rethinkdb,KSanthanam/rethinkdb,spblightadv/rethinkdb,scripni/rethinkdb,Qinusty/rethinkdb,wojons/rethinkdb,robertjpayne/rethinkdb,RubenKelevra/rethinkdb,wojons/rethinkdb,spblightadv/rethinkdb,losywee/rethinkdb,4talesa/rethinkdb,ayumilong/rethinkdb,bchavez/rethinkdb,eliangidoni/rethinkdb,jesseditson/rethinkdb,JackieXie168/rethinkdb,lenstr/rethinkdb,Qinusty/rethinkdb,losywee/rethinkdb,KSanthanam/rethinkdb,Qinusty/rethinkdb,pap/rethinkdb,mbroadst/rethinkdb,sbusso/rethinkdb,Wilbeibi/rethinkdb,catroot/rethinkdb,sbusso/rethinkdb,scripni/rethinkdb,victorbriz/rethinkdb,sontek/rethinkdb,JackieXie168/rethinkdb,greyhwndz/rethinkdb,rrampage/rethinkdb,captainpete/rethinkdb,yakovenkodenis/rethinkdb,scripni/rethinkdb,alash3al/rethinkdb,mquandalle/rethinkdb,gavioto/rethinkdb,jmptrader/rethinkdb,ajose01/rethinkdb,mcanthony/rethinkdb,tempbottle/rethinkdb,tempbottle/rethinkdb,captainpete/rethinkdb,captainpete/rethinkdb,Wilbeibi/rethinkdb,greyhwndz/rethinkdb,JackieXie168/rethinkdb,mbroadst/rethinkdb,losywee/rethinkdb,sebadiaz/rethinkdb,JackieXie168/rethinkdb,wojons/rethinkdb,AntouanK/rethinkdb,dparnell/rethinkdb,mquandalle/rethinkdb,rrampage/rethinkdb,urandu/rethinkdb,RubenKelevra/rethinkdb,captainpete/rethinkdb,grandquista/rethinkdb,gavioto/rethinkdb,mbroadst/rethinkdb,AntouanK/rethinkdb,RubenKelevra/rethinkdb,jesseditson/rethinkdb,greyhwndz/rethinkdb,bpradipt/rethinkdb,sbusso/rethinkdb,niieani/rethinkdb,sontek/rethinkdb,niieani/rethinkdb,niieani/rethinkdb,sbusso/rethinkdb,losywee/rethinkdb,marshall007/rethinkdb,spblightadv/rethinkdb,pap/rethinkdb,greyhwndz/rethinkdb,urandu/rethinkdb,gavioto/rethinkdb,robertjpayne/rethinkdb,pap/rethinkdb,lenstr/rethinkdb,ayumilong/rethinkdb,bchavez/rethinkdb,bpradipt/rethinkdb,elkingtonmcb/rethinkdb,spblightadv/rethinkdb,mbroadst/rethinkdb,matthaywardwebdesign/rethinkdb,wkennington/rethinkdb,eliangidoni/rethinkdb,urandu/rethinkdb,marshall007/rethinkdb,ajose01/rethinkdb,jmptrader/rethinkdb,RubenKelevra/rethinkdb,elkingtonmcb/rethinkdb,spblightadv/rethinkdb,victorbriz/rethinkdb,AntouanK/rethinkdb,Wilbeibi/rethinkdb,yaolinz/rethinkdb,alash3al/rethinkdb,pap/rethinkdb,bchavez/rethinkdb,grandquista/rethinkdb,elkingtonmcb/rethinkdb,dparnell/rethinkdb,ayumilong/rethinkdb,bpradipt/rethinkdb,matthaywardwebdesign/rethinkdb,sontek/rethinkdb,yaolinz/rethinkdb,wojons/rethinkdb,mcanthony/rethinkdb,elkingtonmcb/rethinkdb,ayumilong/rethinkdb,dparnell/rethinkdb,bchavez/rethinkdb,Qinusty/rethinkdb,pap/rethinkdb,alash3al/rethinkdb,JackieXie168/rethinkdb,spblightadv/rethinkdb,AntouanK/rethinkdb,yakovenkodenis/rethinkdb,lenstr/rethinkdb,ayumilong/rethinkdb,alash3al/rethinkdb,KSanthanam/rethinkdb,mquandalle/rethinkdb,alash3al/rethinkdb,RubenKelevra/rethinkdb,victorbriz/rethinkdb,sontek/rethinkdb,bchavez/rethinkdb,4talesa/rethinkdb,mquandalle/rethinkdb,sbusso/rethinkdb,pap/rethinkdb | handlebars | ## Code Before:
<div class="alert" data-alert="alert">
<a class="close" href="#">×</a>
{{#if name_conflict}}
<p>You successfully solved the name conflict.</p>
{{/if}}
{{#if server_dead}}
<p>You successfully removed the server <span class="name">{{server_name}}</span>.</p>
{{/if}}
{{#if unsatisfiable_goals}}
<p>You successfully solved {{#unless can_be_solved}}a part of{{/unless}} the unsatisfiable goals issue.</p>
{{/if}}
</div>
## Instruction:
Remove unneeded piece of template
## Code After:
<div class="alert" data-alert="alert">
<a class="close" href="#">×</a>
{{#if name_conflict}}
<p>You successfully solved the name conflict.</p>
{{/if}}
{{#if server_dead}}
<p>You successfully removed the server <span class="name">{{server_name}}</span>.</p>
{{/if}}
</div>
| <div class="alert" data-alert="alert">
<a class="close" href="#">×</a>
{{#if name_conflict}}
<p>You successfully solved the name conflict.</p>
{{/if}}
{{#if server_dead}}
<p>You successfully removed the server <span class="name">{{server_name}}</span>.</p>
{{/if}}
- {{#if unsatisfiable_goals}}
- <p>You successfully solved {{#unless can_be_solved}}a part of{{/unless}} the unsatisfiable goals issue.</p>
- {{/if}}
</div> | 3 | 0.25 | 0 | 3 |
9e56285beadb4bc883945b23cc5c46fa693308c0 | salt/mopidy/pillar_check.sls | salt/mopidy/pillar_check.sls |
def run():
""" Sanity check the mopidy pillar to ensure that all required fields
are present.
"""
mopidy = __pillar__.get('mopidy', {})
if not mopidy:
# no config is valid
return {}
validate_spotify(mopidy)
validate_local(mopidy)
return {}
def validate_spotify(mopidy):
if 'spotify' in mopidy:
assert 'username' in mopidy['spotify']
assert 'password' in mopidy['spotify']
def validate_local(mopidy):
if 'local' in mopidy:
assert 'media_dir' in mopidy['local']
|
def run():
""" Sanity check the mopidy pillar to ensure that all required fields
are present.
"""
mopidy = __pillar__.get('mopidy', {})
if not mopidy:
# no config is valid
return {}
validate_spotify(mopidy)
validate_local(mopidy)
return {}
def validate_spotify(mopidy):
if 'spotify' in mopidy:
assert 'username' in mopidy['spotify']
assert 'password' in mopidy['spotify']
assert 'client_id' in mopidy['spotify']
assert 'client_secret' in mopidy['spotify']
def validate_local(mopidy):
if 'local' in mopidy:
assert 'media_dir' in mopidy['local']
| Check for spotify client id/secret | Check for spotify client id/secret
| SaltStack | mit | thusoy/salt-states,thusoy/salt-states,thusoy/salt-states,thusoy/salt-states | saltstack | ## Code Before:
def run():
""" Sanity check the mopidy pillar to ensure that all required fields
are present.
"""
mopidy = __pillar__.get('mopidy', {})
if not mopidy:
# no config is valid
return {}
validate_spotify(mopidy)
validate_local(mopidy)
return {}
def validate_spotify(mopidy):
if 'spotify' in mopidy:
assert 'username' in mopidy['spotify']
assert 'password' in mopidy['spotify']
def validate_local(mopidy):
if 'local' in mopidy:
assert 'media_dir' in mopidy['local']
## Instruction:
Check for spotify client id/secret
## Code After:
def run():
""" Sanity check the mopidy pillar to ensure that all required fields
are present.
"""
mopidy = __pillar__.get('mopidy', {})
if not mopidy:
# no config is valid
return {}
validate_spotify(mopidy)
validate_local(mopidy)
return {}
def validate_spotify(mopidy):
if 'spotify' in mopidy:
assert 'username' in mopidy['spotify']
assert 'password' in mopidy['spotify']
assert 'client_id' in mopidy['spotify']
assert 'client_secret' in mopidy['spotify']
def validate_local(mopidy):
if 'local' in mopidy:
assert 'media_dir' in mopidy['local']
|
def run():
""" Sanity check the mopidy pillar to ensure that all required fields
are present.
"""
mopidy = __pillar__.get('mopidy', {})
if not mopidy:
# no config is valid
return {}
validate_spotify(mopidy)
validate_local(mopidy)
return {}
def validate_spotify(mopidy):
if 'spotify' in mopidy:
assert 'username' in mopidy['spotify']
assert 'password' in mopidy['spotify']
+ assert 'client_id' in mopidy['spotify']
+ assert 'client_secret' in mopidy['spotify']
def validate_local(mopidy):
if 'local' in mopidy:
assert 'media_dir' in mopidy['local'] | 2 | 0.08 | 2 | 0 |
4b459a367c67b40561b170b86c2df8882880d2be | test/test_examples.py | test/test_examples.py |
import os
import pytest
from os.path import join, dirname
from glob import glob
# tests to exclude
excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py', 'alchemy_language_v1.py']
# examples path. /examples
examples_path = join(dirname(__file__), '../', 'examples', '*.py')
# environment variables
try:
from dotenv import load_dotenv
except:
print('warning: dotenv module could not be imported')
try:
dotenv_path = join(dirname(__file__), '../', '.env')
load_dotenv(dotenv_path)
except:
print('warning: no .env file loaded')
@pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
def test_examples():
examples = glob(examples_path)
for example in examples:
name = example.split('/')[-1]
# exclude some tests cases like authorization
if name in excludes:
continue
try:
exec(open(example).read(), globals())
except Exception as e:
assert False, 'example in file ' + name + ' failed with error: ' + str(e)
|
import os
import pytest
import json as json_import
from os.path import join, dirname
from glob import glob
# tests to exclude
excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py', 'alchemy_language_v1.py', 'discovery_v1.ipynb', '__init__.py']
# examples path. /examples
examples_path = join(dirname(__file__), '../', 'examples', '*.py')
# environment variables
try:
from dotenv import load_dotenv
except:
print('warning: dotenv module could not be imported')
try:
dotenv_path = join(dirname(__file__), '../', '.env')
load_dotenv(dotenv_path)
except:
print('warning: no .env file loaded')
@pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
def test_examples():
vcapServices = json_import.loads(os.getenv('VCAP_SERVICES'))
examples = glob(examples_path)
for example in examples:
name = example.split('/')[-1]
# exclude some tests cases like authorization
if name in excludes:
continue
# exclude tests if there are no credentials for that service
serviceName = name[:-6] if not name.startswith('visual_recognition') else 'watson_vision_combined'
if serviceName not in vcapServices:
print('%s does not have credentials in VCAP_SERVICES', serviceName)
continue
try:
exec(open(example).read(), globals())
except Exception as e:
assert False, 'example in file ' + name + ' failed with error: ' + str(e)
| Exclude tests if there are no credentials in VCAP_SERVICES | Exclude tests if there are no credentials in VCAP_SERVICES
| Python | apache-2.0 | ehdsouza/python-sdk,ehdsouza/python-sdk,ehdsouza/python-sdk | python | ## Code Before:
import os
import pytest
from os.path import join, dirname
from glob import glob
# tests to exclude
excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py', 'alchemy_language_v1.py']
# examples path. /examples
examples_path = join(dirname(__file__), '../', 'examples', '*.py')
# environment variables
try:
from dotenv import load_dotenv
except:
print('warning: dotenv module could not be imported')
try:
dotenv_path = join(dirname(__file__), '../', '.env')
load_dotenv(dotenv_path)
except:
print('warning: no .env file loaded')
@pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
def test_examples():
examples = glob(examples_path)
for example in examples:
name = example.split('/')[-1]
# exclude some tests cases like authorization
if name in excludes:
continue
try:
exec(open(example).read(), globals())
except Exception as e:
assert False, 'example in file ' + name + ' failed with error: ' + str(e)
## Instruction:
Exclude tests if there are no credentials in VCAP_SERVICES
## Code After:
import os
import pytest
import json as json_import
from os.path import join, dirname
from glob import glob
# tests to exclude
excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py', 'alchemy_language_v1.py', 'discovery_v1.ipynb', '__init__.py']
# examples path. /examples
examples_path = join(dirname(__file__), '../', 'examples', '*.py')
# environment variables
try:
from dotenv import load_dotenv
except:
print('warning: dotenv module could not be imported')
try:
dotenv_path = join(dirname(__file__), '../', '.env')
load_dotenv(dotenv_path)
except:
print('warning: no .env file loaded')
@pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
def test_examples():
vcapServices = json_import.loads(os.getenv('VCAP_SERVICES'))
examples = glob(examples_path)
for example in examples:
name = example.split('/')[-1]
# exclude some tests cases like authorization
if name in excludes:
continue
# exclude tests if there are no credentials for that service
serviceName = name[:-6] if not name.startswith('visual_recognition') else 'watson_vision_combined'
if serviceName not in vcapServices:
print('%s does not have credentials in VCAP_SERVICES', serviceName)
continue
try:
exec(open(example).read(), globals())
except Exception as e:
assert False, 'example in file ' + name + ' failed with error: ' + str(e)
|
import os
import pytest
+ import json as json_import
+
from os.path import join, dirname
from glob import glob
# tests to exclude
- excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py', 'alchemy_language_v1.py']
+ excludes = ['authorization_v1.py', 'alchemy_data_news_v1.py', 'alchemy_language_v1.py', 'discovery_v1.ipynb', '__init__.py']
? +++++++++++++++++++++++++++++++++++++
# examples path. /examples
examples_path = join(dirname(__file__), '../', 'examples', '*.py')
# environment variables
try:
from dotenv import load_dotenv
except:
print('warning: dotenv module could not be imported')
try:
dotenv_path = join(dirname(__file__), '../', '.env')
load_dotenv(dotenv_path)
except:
print('warning: no .env file loaded')
@pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
def test_examples():
+ vcapServices = json_import.loads(os.getenv('VCAP_SERVICES'))
examples = glob(examples_path)
for example in examples:
name = example.split('/')[-1]
+
# exclude some tests cases like authorization
if name in excludes:
+ continue
+
+ # exclude tests if there are no credentials for that service
+ serviceName = name[:-6] if not name.startswith('visual_recognition') else 'watson_vision_combined'
+
+ if serviceName not in vcapServices:
+ print('%s does not have credentials in VCAP_SERVICES', serviceName)
continue
try:
exec(open(example).read(), globals())
except Exception as e:
assert False, 'example in file ' + name + ' failed with error: ' + str(e)
- | 14 | 0.35 | 12 | 2 |
688e2647dc85c0743fb2c16f27705077fb478999 | app/default/services/storage.js | app/default/services/storage.js | /* global angular */
angular.module('app')
.factory('Storage', function ($window) {
'use strict';
function getItem(key) {
var value = $window.localStorage.getItem(key);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
if (key.startsWith('$$')) {
return undefined;
}
if (key === 'eventsource') {
return undefined;
}
return value;
}));
}
function removeItem(key) {
$window.localStorage.removeItem(key);
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem
};
});
| /* global angular */
angular.module('app')
.factory('Storage', function ($window) {
'use strict';
function getItem(key) {
var value = $window.localStorage.getItem(key);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
if (key.slice(0, 2) === '$$') {
return undefined;
}
if (key === 'eventsource') {
return undefined;
}
return value;
}));
}
function removeItem(key) {
$window.localStorage.removeItem(key);
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem
};
});
| Fix issue with startsWith not existing(?) | Fix issue with startsWith not existing(?)
| JavaScript | agpl-3.0 | johansten/stargazer,johansten/stargazer,johansten/stargazer | javascript | ## Code Before:
/* global angular */
angular.module('app')
.factory('Storage', function ($window) {
'use strict';
function getItem(key) {
var value = $window.localStorage.getItem(key);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
if (key.startsWith('$$')) {
return undefined;
}
if (key === 'eventsource') {
return undefined;
}
return value;
}));
}
function removeItem(key) {
$window.localStorage.removeItem(key);
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem
};
});
## Instruction:
Fix issue with startsWith not existing(?)
## Code After:
/* global angular */
angular.module('app')
.factory('Storage', function ($window) {
'use strict';
function getItem(key) {
var value = $window.localStorage.getItem(key);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
if (key.slice(0, 2) === '$$') {
return undefined;
}
if (key === 'eventsource') {
return undefined;
}
return value;
}));
}
function removeItem(key) {
$window.localStorage.removeItem(key);
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem
};
});
| /* global angular */
angular.module('app')
.factory('Storage', function ($window) {
'use strict';
function getItem(key) {
var value = $window.localStorage.getItem(key);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
function setItem(key, value) {
$window.localStorage.setItem(key, JSON.stringify(value, function (key, value) {
- if (key.startsWith('$$')) {
+ if (key.slice(0, 2) === '$$') {
return undefined;
}
if (key === 'eventsource') {
return undefined;
}
return value;
}));
}
function removeItem(key) {
$window.localStorage.removeItem(key);
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem
};
}); | 2 | 0.051282 | 1 | 1 |
3be62e32fea11eefc06bd9436d45e94ab19a0e16 | eventPage.js | eventPage.js | chrome.extension.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(request);
console.log(sender);
getOtherBookmarksChildren(function(other){
if (other == null) {
console.error("'Other Bookmarks' not found.");
return;
}
var folders = retrieveFolders(other);
var folder = determineBestFolder(request, folders);
});
});
function getOtherBookmarksChildren(callback) {
chrome.bookmarks.getTree(function(results){
var title = "Other Bookmarks";
var topLevel = results[0].children;
for (var nodeKey in topLevel){
var node = topLevel[nodeKey];
if (node.title == title)
return callback(node.children);
}
return callback(null);
});
}
function retrieveFolders(folder) {
var folders = [];
for (var nodeKey in folder){
var node = folder[nodeKey];
if (!node.hasOwnProperty("url"))
folders.push(node);
}
return folders;
}
function getUncategorizedFolder(folders){
}
function determineBestFolder(page, folders){
return "Folder";
}
| chrome.extension.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(request);
console.log(sender);
getOtherBookmarksChildren(function(other, otherID){
if (other == null) {
console.error("'Other Bookmarks' not found.");
return;
}
var folders = retrieveFolders(other, otherID);
var folder = determineBestFolder(request, folders);
getUncategorizedFolder(other, otherID, function(uncategorized){
console.log(uncategorized);
});
});
});
function getOtherBookmarksChildren(callback) {
chrome.bookmarks.getTree(function(results){
var title = "Other Bookmarks";
var topLevel = results[0].children;
for (var nodeKey in topLevel){
var node = topLevel[nodeKey];
if (node.title == title)
return callback(node.children, node.id);
}
return callback(null, null);
});
}
function retrieveFolders(folder) {
var folders = [];
for (var nodeKey in folder){
var node = folder[nodeKey];
if (!node.hasOwnProperty("url"))
folders.push(node);
}
return folders;
}
function getUncategorizedFolder(folders, otherID, callback){
for (var folderKey in folders){
var folder = folders[folderKey];
if (folder.title == "Uncategorized")
return callback(folder);
}
// Create uncategorized folder
chrome.bookmarks.create({'parentId': otherID, 'title': 'Uncategorized'},
function(uncategorizedFolder) {
callback(uncategorizedFolder);
}
);
}
function determineBestFolder(page, folders){
}
| Create uncategorized folder if it does not exist. | Create uncategorized folder if it does not exist.
| JavaScript | mit | jeffmax/bettermark | javascript | ## Code Before:
chrome.extension.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(request);
console.log(sender);
getOtherBookmarksChildren(function(other){
if (other == null) {
console.error("'Other Bookmarks' not found.");
return;
}
var folders = retrieveFolders(other);
var folder = determineBestFolder(request, folders);
});
});
function getOtherBookmarksChildren(callback) {
chrome.bookmarks.getTree(function(results){
var title = "Other Bookmarks";
var topLevel = results[0].children;
for (var nodeKey in topLevel){
var node = topLevel[nodeKey];
if (node.title == title)
return callback(node.children);
}
return callback(null);
});
}
function retrieveFolders(folder) {
var folders = [];
for (var nodeKey in folder){
var node = folder[nodeKey];
if (!node.hasOwnProperty("url"))
folders.push(node);
}
return folders;
}
function getUncategorizedFolder(folders){
}
function determineBestFolder(page, folders){
return "Folder";
}
## Instruction:
Create uncategorized folder if it does not exist.
## Code After:
chrome.extension.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(request);
console.log(sender);
getOtherBookmarksChildren(function(other, otherID){
if (other == null) {
console.error("'Other Bookmarks' not found.");
return;
}
var folders = retrieveFolders(other, otherID);
var folder = determineBestFolder(request, folders);
getUncategorizedFolder(other, otherID, function(uncategorized){
console.log(uncategorized);
});
});
});
function getOtherBookmarksChildren(callback) {
chrome.bookmarks.getTree(function(results){
var title = "Other Bookmarks";
var topLevel = results[0].children;
for (var nodeKey in topLevel){
var node = topLevel[nodeKey];
if (node.title == title)
return callback(node.children, node.id);
}
return callback(null, null);
});
}
function retrieveFolders(folder) {
var folders = [];
for (var nodeKey in folder){
var node = folder[nodeKey];
if (!node.hasOwnProperty("url"))
folders.push(node);
}
return folders;
}
function getUncategorizedFolder(folders, otherID, callback){
for (var folderKey in folders){
var folder = folders[folderKey];
if (folder.title == "Uncategorized")
return callback(folder);
}
// Create uncategorized folder
chrome.bookmarks.create({'parentId': otherID, 'title': 'Uncategorized'},
function(uncategorizedFolder) {
callback(uncategorizedFolder);
}
);
}
function determineBestFolder(page, folders){
}
| chrome.extension.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(request);
console.log(sender);
- getOtherBookmarksChildren(function(other){
+ getOtherBookmarksChildren(function(other, otherID){
? +++++++++
if (other == null) {
console.error("'Other Bookmarks' not found.");
return;
}
- var folders = retrieveFolders(other);
+ var folders = retrieveFolders(other, otherID);
? +++++++++
var folder = determineBestFolder(request, folders);
+ getUncategorizedFolder(other, otherID, function(uncategorized){
+ console.log(uncategorized);
+ });
});
});
function getOtherBookmarksChildren(callback) {
chrome.bookmarks.getTree(function(results){
var title = "Other Bookmarks";
var topLevel = results[0].children;
for (var nodeKey in topLevel){
var node = topLevel[nodeKey];
if (node.title == title)
- return callback(node.children);
+ return callback(node.children, node.id);
? +++++++++
}
- return callback(null);
+ return callback(null, null);
? ++++++
});
}
function retrieveFolders(folder) {
var folders = [];
for (var nodeKey in folder){
var node = folder[nodeKey];
if (!node.hasOwnProperty("url"))
folders.push(node);
}
return folders;
}
- function getUncategorizedFolder(folders){
+ function getUncategorizedFolder(folders, otherID, callback){
? +++++++++++++++++++
-
+ for (var folderKey in folders){
+ var folder = folders[folderKey];
+ if (folder.title == "Uncategorized")
+ return callback(folder);
+ }
+ // Create uncategorized folder
+ chrome.bookmarks.create({'parentId': otherID, 'title': 'Uncategorized'},
+ function(uncategorizedFolder) {
+ callback(uncategorizedFolder);
+ }
+ );
}
function determineBestFolder(page, folders){
- return "Folder";
+
} | 27 | 0.613636 | 20 | 7 |
a5f948bec814faf3f0e75edfd9102c73127afb53 | app/ModelContracts/Grant.php | app/ModelContracts/Grant.php | <?php
namespace CodeDay\Clear\ModelContracts;
use \CodeDay\Clear\Models;
class Grant extends ModelContract
{
public static function getFields()
{
return [
'id' => [
'name' => 'ID',
'description' => 'The ID of the grant. Numeric.',
'example' => '1',
'value' => function($model) { return $model->id; }
],
'username' => [
'name' => 'Username',
'description' => 'Username of the user that this grant belongs to.',
'example' => 'tylermenezes',
'value' => function($model) { return $model->username; }
],
'event' => [
'name' => 'Event',
'description' => 'The event that this grant gave the user access to.',
'type' => 'Event',
'rich' => true,
'value' => function($model, $permissions) { return new Event($model->event, $permissions, true); }
]
];
}
}
| <?php
namespace CodeDay\Clear\ModelContracts;
use \CodeDay\Clear\Models;
class Grant extends ModelContract
{
public static function getFields()
{
return [
'id' => [
'name' => 'ID',
'description' => 'The ID of the grant. Numeric.',
'example' => '1',
'value' => function($model) { return $model->id; }
],
'username' => [
'name' => 'Username',
'description' => 'Username of the user that this grant belongs to.',
'example' => 'tylermenezes',
'value' => function($model) { return $model->username; }
],
'event' => [
'name' => 'Event',
'description' => 'The event that this grant gave the user access to.',
'type' => 'Event',
'rich' => true,
'value' => function($model, $permissions) { return new Event($model->event, $permissions, true); }
],
'region' => [
'name' => 'Event',
'description' => 'The region of the event that this grant gave the user access to.',
'type' => 'Event',
'rich' => true,
'value' => function($model, $permissions) { return new Region($model->event->region, $permissions, true); }
]
];
}
}
| Add region in the new API route | Add region in the new API route
| PHP | artistic-2.0 | srnd/Clear,srnd/Clear,srnd/Clear,StudentRND/Clear,StudentRND/Clear,srnd/Clear,StudentRND/Clear | php | ## Code Before:
<?php
namespace CodeDay\Clear\ModelContracts;
use \CodeDay\Clear\Models;
class Grant extends ModelContract
{
public static function getFields()
{
return [
'id' => [
'name' => 'ID',
'description' => 'The ID of the grant. Numeric.',
'example' => '1',
'value' => function($model) { return $model->id; }
],
'username' => [
'name' => 'Username',
'description' => 'Username of the user that this grant belongs to.',
'example' => 'tylermenezes',
'value' => function($model) { return $model->username; }
],
'event' => [
'name' => 'Event',
'description' => 'The event that this grant gave the user access to.',
'type' => 'Event',
'rich' => true,
'value' => function($model, $permissions) { return new Event($model->event, $permissions, true); }
]
];
}
}
## Instruction:
Add region in the new API route
## Code After:
<?php
namespace CodeDay\Clear\ModelContracts;
use \CodeDay\Clear\Models;
class Grant extends ModelContract
{
public static function getFields()
{
return [
'id' => [
'name' => 'ID',
'description' => 'The ID of the grant. Numeric.',
'example' => '1',
'value' => function($model) { return $model->id; }
],
'username' => [
'name' => 'Username',
'description' => 'Username of the user that this grant belongs to.',
'example' => 'tylermenezes',
'value' => function($model) { return $model->username; }
],
'event' => [
'name' => 'Event',
'description' => 'The event that this grant gave the user access to.',
'type' => 'Event',
'rich' => true,
'value' => function($model, $permissions) { return new Event($model->event, $permissions, true); }
],
'region' => [
'name' => 'Event',
'description' => 'The region of the event that this grant gave the user access to.',
'type' => 'Event',
'rich' => true,
'value' => function($model, $permissions) { return new Region($model->event->region, $permissions, true); }
]
];
}
}
| <?php
namespace CodeDay\Clear\ModelContracts;
use \CodeDay\Clear\Models;
class Grant extends ModelContract
{
public static function getFields()
{
return [
'id' => [
'name' => 'ID',
'description' => 'The ID of the grant. Numeric.',
'example' => '1',
'value' => function($model) { return $model->id; }
],
'username' => [
'name' => 'Username',
'description' => 'Username of the user that this grant belongs to.',
'example' => 'tylermenezes',
'value' => function($model) { return $model->username; }
],
'event' => [
'name' => 'Event',
'description' => 'The event that this grant gave the user access to.',
'type' => 'Event',
'rich' => true,
'value' => function($model, $permissions) { return new Event($model->event, $permissions, true); }
+ ],
+
+ 'region' => [
+ 'name' => 'Event',
+ 'description' => 'The region of the event that this grant gave the user access to.',
+ 'type' => 'Event',
+ 'rich' => true,
+ 'value' => function($model, $permissions) { return new Region($model->event->region, $permissions, true); }
]
];
}
} | 8 | 0.235294 | 8 | 0 |
5e716e07eb610803ff4b8d33c3d81049001788f5 | netlify.toml | netlify.toml | [build]
command = "npm run build"
publish = "dist"
[context.production.environment]
HUGO_VERSION = "0.42"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview]
command = "npm run build-preview"
[context.deploy-preview.environment]
HUGO_VERSION = "0.42"
| [build]
command = "npm run build"
publish = "dist"
[context.production.environment]
HUGO_VERSION = "0.42.2"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview]
HUGO_VERSION = "0.42.2"
[context.deploy-preview.environment]
HUGO_VERSION = "0.42.2"
| Update hugo version on Netlify | Update hugo version on Netlify
| TOML | mit | dzello/estelle-and-josh,dzello/estelle-and-josh,dzello/estelle-and-josh | toml | ## Code Before:
[build]
command = "npm run build"
publish = "dist"
[context.production.environment]
HUGO_VERSION = "0.42"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview]
command = "npm run build-preview"
[context.deploy-preview.environment]
HUGO_VERSION = "0.42"
## Instruction:
Update hugo version on Netlify
## Code After:
[build]
command = "npm run build"
publish = "dist"
[context.production.environment]
HUGO_VERSION = "0.42.2"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview]
HUGO_VERSION = "0.42.2"
[context.deploy-preview.environment]
HUGO_VERSION = "0.42.2"
| [build]
command = "npm run build"
publish = "dist"
[context.production.environment]
- HUGO_VERSION = "0.42"
+ HUGO_VERSION = "0.42.2"
? ++
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview]
- command = "npm run build-preview"
+ HUGO_VERSION = "0.42.2"
[context.deploy-preview.environment]
- HUGO_VERSION = "0.42"
+ HUGO_VERSION = "0.42.2"
? ++
| 6 | 0.428571 | 3 | 3 |
5a564a4f16764d0ae1b4050bbe6354c685e6facf | source/404.html.slim | source/404.html.slim | ---
title: 404
description: Page 404 du site de Labo3G
keywords: labo3G, galerie, art, lille, 404
changefreq: "monthly"
priority: "0.4"
---
header id="header-small" class="quatrecentquatre"
a href="/"
img src="assets/images/logo-black.svg" alt="#{data.settings.site.title} - logo"
h1 Oups ! Il n'y a rien, ici... | ---
title: 404
description: Page 404 du site de Labo3G
keywords: labo3G, galerie, art, lille, 404
changefreq: "monthly"
priority: "0.4"
---
header id="header-small" class="quatrecentquatre"
a href="/"
img src="assets/images/logo-black.svg" alt="#{data.settings.site.title} - logo"
h1 Oups ! Il n'y a rien, ici...
= link_to "Retour au site", "http://www.labo3g.fr", class:"button primary", style:"margin-top:60px;"
| Add a "back to home" button to 404 page | Add a "back to home" button to 404 page | Slim | mit | gregoiredierendonck/Labo3G,gregoiredierendonck/Labo3G,gregoiredierendonck/Labo3G | slim | ## Code Before:
---
title: 404
description: Page 404 du site de Labo3G
keywords: labo3G, galerie, art, lille, 404
changefreq: "monthly"
priority: "0.4"
---
header id="header-small" class="quatrecentquatre"
a href="/"
img src="assets/images/logo-black.svg" alt="#{data.settings.site.title} - logo"
h1 Oups ! Il n'y a rien, ici...
## Instruction:
Add a "back to home" button to 404 page
## Code After:
---
title: 404
description: Page 404 du site de Labo3G
keywords: labo3G, galerie, art, lille, 404
changefreq: "monthly"
priority: "0.4"
---
header id="header-small" class="quatrecentquatre"
a href="/"
img src="assets/images/logo-black.svg" alt="#{data.settings.site.title} - logo"
h1 Oups ! Il n'y a rien, ici...
= link_to "Retour au site", "http://www.labo3g.fr", class:"button primary", style:"margin-top:60px;"
| ---
title: 404
description: Page 404 du site de Labo3G
keywords: labo3G, galerie, art, lille, 404
changefreq: "monthly"
priority: "0.4"
---
header id="header-small" class="quatrecentquatre"
a href="/"
img src="assets/images/logo-black.svg" alt="#{data.settings.site.title} - logo"
h1 Oups ! Il n'y a rien, ici...
+ = link_to "Retour au site", "http://www.labo3g.fr", class:"button primary", style:"margin-top:60px;" | 1 | 0.083333 | 1 | 0 |
99383e17faf141533c35468fe8fb30f773de43c3 | features/support/settings.rb | features/support/settings.rb | require 'yaml'
def settings_file
Pathname.new(File.expand_path("../../settings.yml", __FILE__))
end
SETTINGS = (File.exists?(settings_file) && yaml= YAML.load_file(settings_file)) ? yaml : {}
| require 'yaml'
def settings_file
Pathname.new(File.expand_path("../../settings.yml", __FILE__))
end
SETTINGS = (File.exists?(settings_file) && yaml= YAML.load_file(settings_file)) ? yaml : {'basic_auth' => 'login:password', 'oauth_token' => 'as79asfd79ads', 'user'=> 'octokat', 'repo' => 'dummy'}
| Add dummy parameters to satisfy vcr for travis setup. | Add dummy parameters to satisfy vcr for travis setup.
| Ruby | mit | wicky-info/github,peter-murach/github,MalachiTatum/github,joshsoftware/github,samphilipd/github,firstval/github,yaoxiaoyong/github,piotrmurach/github,davengeo/github,GistBox/github,befairyliu/github,anabhilash619/github,cocktail-io/github,durai145/github | ruby | ## Code Before:
require 'yaml'
def settings_file
Pathname.new(File.expand_path("../../settings.yml", __FILE__))
end
SETTINGS = (File.exists?(settings_file) && yaml= YAML.load_file(settings_file)) ? yaml : {}
## Instruction:
Add dummy parameters to satisfy vcr for travis setup.
## Code After:
require 'yaml'
def settings_file
Pathname.new(File.expand_path("../../settings.yml", __FILE__))
end
SETTINGS = (File.exists?(settings_file) && yaml= YAML.load_file(settings_file)) ? yaml : {'basic_auth' => 'login:password', 'oauth_token' => 'as79asfd79ads', 'user'=> 'octokat', 'repo' => 'dummy'}
| require 'yaml'
def settings_file
Pathname.new(File.expand_path("../../settings.yml", __FILE__))
end
- SETTINGS = (File.exists?(settings_file) && yaml= YAML.load_file(settings_file)) ? yaml : {}
+ SETTINGS = (File.exists?(settings_file) && yaml= YAML.load_file(settings_file)) ? yaml : {'basic_auth' => 'login:password', 'oauth_token' => 'as79asfd79ads', 'user'=> 'octokat', 'repo' => 'dummy'} | 2 | 0.285714 | 1 | 1 |
00ddc1d18988d039e059e66549aa9925fdb8460e | README.md | README.md | <p align="center">
<img src="http://res.cloudinary.com/dkxp3eifs/image/upload/c_scale,w_200/v1465057926/go-bc-logo_ofgay7.png"/>
</p>
# Trabandcamp
Download tracks from bandcamp **GO** style
Installation
-
Download the latest binary from the [releases](https://github.com/stefanoschrs/trabandcamp/releases) page
Usage
-
`./trabandcamp-<os>-<arch>[.exe] <Band Name>`
*e.g for https://dopethrone.bandcamp.com/ you should run* `./trabandcamp-linux-amd64 dopethrone`
Development
-
If you want to build the binary yourself
`(export GOOS=<Operating System>; export GOARCH=<Architecture>; go build -o build/trabandcamp-$GOOS-$GOARCH trabandcamp.go)`
| <p align="center">
<img src="http://res.cloudinary.com/dkxp3eifs/image/upload/c_scale,w_200/v1465057926/go-bc-logo_ofgay7.png"/>
</p>
# Trabandcamp [](https://travis-ci.org/stefanoschrs/trabandcamp)
Download tracks from bandcamp **GO** style
Installation
-
Download the latest binary from the [releases](https://github.com/stefanoschrs/trabandcamp/releases) page
Usage
-
`./trabandcamp-<os>-<arch>[.exe] <Band Name>`
*e.g for https://dopethrone.bandcamp.com/ you should run* `./trabandcamp-linux-amd64 dopethrone`
Development
-
If you want to build the binary yourself
`(export GOOS=<Operating System>; export GOARCH=<Architecture>; go build -o build/trabandcamp-$GOOS-$GOARCH trabandcamp.go)`
| Add travis build status :boom: | Add travis build status :boom: | Markdown | mit | stefanoschrs/trabandcamp,stefanoschrs/trabandcamp | markdown | ## Code Before:
<p align="center">
<img src="http://res.cloudinary.com/dkxp3eifs/image/upload/c_scale,w_200/v1465057926/go-bc-logo_ofgay7.png"/>
</p>
# Trabandcamp
Download tracks from bandcamp **GO** style
Installation
-
Download the latest binary from the [releases](https://github.com/stefanoschrs/trabandcamp/releases) page
Usage
-
`./trabandcamp-<os>-<arch>[.exe] <Band Name>`
*e.g for https://dopethrone.bandcamp.com/ you should run* `./trabandcamp-linux-amd64 dopethrone`
Development
-
If you want to build the binary yourself
`(export GOOS=<Operating System>; export GOARCH=<Architecture>; go build -o build/trabandcamp-$GOOS-$GOARCH trabandcamp.go)`
## Instruction:
Add travis build status :boom:
## Code After:
<p align="center">
<img src="http://res.cloudinary.com/dkxp3eifs/image/upload/c_scale,w_200/v1465057926/go-bc-logo_ofgay7.png"/>
</p>
# Trabandcamp [](https://travis-ci.org/stefanoschrs/trabandcamp)
Download tracks from bandcamp **GO** style
Installation
-
Download the latest binary from the [releases](https://github.com/stefanoschrs/trabandcamp/releases) page
Usage
-
`./trabandcamp-<os>-<arch>[.exe] <Band Name>`
*e.g for https://dopethrone.bandcamp.com/ you should run* `./trabandcamp-linux-amd64 dopethrone`
Development
-
If you want to build the binary yourself
`(export GOOS=<Operating System>; export GOARCH=<Architecture>; go build -o build/trabandcamp-$GOOS-$GOARCH trabandcamp.go)`
| <p align="center">
<img src="http://res.cloudinary.com/dkxp3eifs/image/upload/c_scale,w_200/v1465057926/go-bc-logo_ofgay7.png"/>
</p>
- # Trabandcamp
+ # Trabandcamp [](https://travis-ci.org/stefanoschrs/trabandcamp)
Download tracks from bandcamp **GO** style
Installation
-
Download the latest binary from the [releases](https://github.com/stefanoschrs/trabandcamp/releases) page
Usage
-
`./trabandcamp-<os>-<arch>[.exe] <Band Name>`
*e.g for https://dopethrone.bandcamp.com/ you should run* `./trabandcamp-linux-amd64 dopethrone`
Development
-
If you want to build the binary yourself
`(export GOOS=<Operating System>; export GOARCH=<Architecture>; go build -o build/trabandcamp-$GOOS-$GOARCH trabandcamp.go)` | 2 | 0.1 | 1 | 1 |
e615aefc57589c6b27e4297f9814f2d6eca12dbd | docs/index.rst | docs/index.rst | .. pyaavso documentation master file, created by
sphinx-quickstart on Fri Aug 30 22:12:51 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. include:: ../README.rst
Gittip
------
Like this project? You can support it via `Gittip`_!
.. _`Gittip`: https://www.gittip.com/zsiciarz
Documentation
-------------
.. toctree::
:maxdepth: 3
usage
reference
development
changes
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| .. pyaavso documentation master file, created by
sphinx-quickstart on Fri Aug 30 22:12:51 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. include:: ../README.rst
Documentation
-------------
.. toctree::
:maxdepth: 3
usage
reference
development
changes
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| Remove gittip note from docs. | Remove gittip note from docs.
| reStructuredText | mit | zsiciarz/pyaavso | restructuredtext | ## Code Before:
.. pyaavso documentation master file, created by
sphinx-quickstart on Fri Aug 30 22:12:51 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. include:: ../README.rst
Gittip
------
Like this project? You can support it via `Gittip`_!
.. _`Gittip`: https://www.gittip.com/zsiciarz
Documentation
-------------
.. toctree::
:maxdepth: 3
usage
reference
development
changes
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
## Instruction:
Remove gittip note from docs.
## Code After:
.. pyaavso documentation master file, created by
sphinx-quickstart on Fri Aug 30 22:12:51 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. include:: ../README.rst
Documentation
-------------
.. toctree::
:maxdepth: 3
usage
reference
development
changes
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| .. pyaavso documentation master file, created by
sphinx-quickstart on Fri Aug 30 22:12:51 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. include:: ../README.rst
-
- Gittip
- ------
-
- Like this project? You can support it via `Gittip`_!
-
- .. _`Gittip`: https://www.gittip.com/zsiciarz
Documentation
-------------
.. toctree::
:maxdepth: 3
usage
reference
development
changes
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search` | 7 | 0.225806 | 0 | 7 |
4a294776dd42eae28bca2a7d2f6b56a6902d52b7 | app/scripts/components/BsBtnGroup.coffee | app/scripts/components/BsBtnGroup.coffee | Button Group.
In its simple form, each item in the button group is a Bootstrap.Button component,
In case this is a Radio, each item is rendered as a label.
###
Bootstrap.BsBtnGroup = Bootstrap.ItemsView.extend(Bootstrap.SizeSupport, Bootstrap.ItemsSelection,
classTypePrefix: ['btn-group']
classNames: ['btn-group']
classNameBindings: ['vertical:btn-group-vertical']
#TODO: This is a hack until it will be possible to extend from component as it looses the template association
#see https://github.com/emberjs/ember.js/issues/3376
itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection,
layoutName: 'components/bs-button'
)
)
Ember.Handlebars.helper 'bs-btn-group', Bootstrap.BsBtnGroup | Button Group.
In its simple form, each item in the button group is a Bootstrap.Button component,
In case this is a Radio, each item is rendered as a label.
###
Bootstrap.BsBtnGroup = Bootstrap.ItemsView.extend(Bootstrap.SizeSupport, Bootstrap.ItemsSelection,
classTypePrefix: ['btn-group']
classNames: ['btn-group']
classNameBindings: ['vertical:btn-group-vertical']
itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection)
)
Ember.Handlebars.helper 'bs-btn-group', Bootstrap.BsBtnGroup | Clear layout set in button group component as it seems not to be needed anymore. | Clear layout set in button group component as it seems not to be needed anymore.
| CoffeeScript | apache-2.0 | ritesh83/bootstrap-for-ember,ritesh83/bootstrap-for-ember,duereg/bootstrap-for-ember,rpharrison/bootstrap-for-ember,ember-addons/bootstrap-for-ember,rpharrison/bootstrap-for-ember | coffeescript | ## Code Before:
Button Group.
In its simple form, each item in the button group is a Bootstrap.Button component,
In case this is a Radio, each item is rendered as a label.
###
Bootstrap.BsBtnGroup = Bootstrap.ItemsView.extend(Bootstrap.SizeSupport, Bootstrap.ItemsSelection,
classTypePrefix: ['btn-group']
classNames: ['btn-group']
classNameBindings: ['vertical:btn-group-vertical']
#TODO: This is a hack until it will be possible to extend from component as it looses the template association
#see https://github.com/emberjs/ember.js/issues/3376
itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection,
layoutName: 'components/bs-button'
)
)
Ember.Handlebars.helper 'bs-btn-group', Bootstrap.BsBtnGroup
## Instruction:
Clear layout set in button group component as it seems not to be needed anymore.
## Code After:
Button Group.
In its simple form, each item in the button group is a Bootstrap.Button component,
In case this is a Radio, each item is rendered as a label.
###
Bootstrap.BsBtnGroup = Bootstrap.ItemsView.extend(Bootstrap.SizeSupport, Bootstrap.ItemsSelection,
classTypePrefix: ['btn-group']
classNames: ['btn-group']
classNameBindings: ['vertical:btn-group-vertical']
itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection)
)
Ember.Handlebars.helper 'bs-btn-group', Bootstrap.BsBtnGroup | Button Group.
In its simple form, each item in the button group is a Bootstrap.Button component,
In case this is a Radio, each item is rendered as a label.
###
Bootstrap.BsBtnGroup = Bootstrap.ItemsView.extend(Bootstrap.SizeSupport, Bootstrap.ItemsSelection,
classTypePrefix: ['btn-group']
classNames: ['btn-group']
classNameBindings: ['vertical:btn-group-vertical']
- #TODO: This is a hack until it will be possible to extend from component as it looses the template association
- #see https://github.com/emberjs/ember.js/issues/3376
- itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection,
? ^
+ itemViewClass: Bootstrap.BsButtonComponent.extend(Bootstrap.ItemValue, Bootstrap.ItemSelection)
? ^
- layoutName: 'components/bs-button'
- )
)
Ember.Handlebars.helper 'bs-btn-group', Bootstrap.BsBtnGroup | 6 | 0.352941 | 1 | 5 |
9cb99ff0f63f19a1a193b1eef545a37cd531d9c1 | 2/10/src/aes_cbc.rs | 2/10/src/aes_cbc.rs | /* AES-128 CBC mode
*
* Dmitry Vasiliev <dima@hlabs.org>
*/
extern crate serialize;
extern crate aes_lib;
use std::path::Path;
use std::io::fs::File;
use std::iter::repeat;
use serialize::base64::FromBase64;
use aes_lib::{decrypt_aes_cbc, encrypt_aes_cbc};
fn read_hex_file(path: &Path) -> Vec<u8> {
match File::open(path) {
Ok(mut file) => {
let data = file.read_to_end().unwrap();
let text = String::from_utf8(data).unwrap();
text.from_base64().unwrap()
},
Err(err) => panic!("Unable to open {}: {}", path.display(), err)
}
}
/*
* Main entry point
*/
fn main() {
let path = Path::new("10.txt");
let data = read_hex_file(&path);
let key = b"YELLOW SUBMARINE";
let iv: Vec<u8> = repeat(0u8).take(16).collect();
let decrypted = decrypt_aes_cbc(data.as_slice(), key.as_slice(),
iv.as_slice());
println!("Decrypted => \"{}\"",
String::from_utf8(decrypted.clone()).unwrap());
assert_eq!(data, encrypt_aes_cbc(decrypted.as_slice(), key.as_slice(),
iv.as_slice()));
println!("Encryption OK!");
}
| /* AES-128 CBC mode
*
* Dmitry Vasiliev <dima@hlabs.org>
*/
extern crate serialize;
extern crate aes_lib;
use std::path::Path;
use std::io::fs::File;
use serialize::base64::FromBase64;
use aes_lib::{decrypt_aes_cbc, encrypt_aes_cbc};
fn read_hex_file(path: &Path) -> Vec<u8> {
match File::open(path) {
Ok(mut file) => {
let data = file.read_to_end().unwrap();
let text = String::from_utf8(data).unwrap();
text.from_base64().unwrap()
},
Err(err) => panic!("Unable to open {}: {}", path.display(), err)
}
}
/*
* Main entry point
*/
fn main() {
let path = Path::new("10.txt");
let data = read_hex_file(&path);
let key = b"YELLOW SUBMARINE";
let iv: Vec<u8> = [0u8; 16].to_vec();
let decrypted = decrypt_aes_cbc(data.as_slice(), key.as_slice(),
iv.as_slice());
println!("Decrypted => \"{}\"",
String::from_utf8(decrypted.clone()).unwrap());
assert_eq!(data, encrypt_aes_cbc(decrypted.as_slice(), key.as_slice(),
iv.as_slice()));
println!("Encryption OK!");
}
| Replace repeat() with static array | Replace repeat() with static array
| Rust | mit | hdima/matasano-crypto-challenges | rust | ## Code Before:
/* AES-128 CBC mode
*
* Dmitry Vasiliev <dima@hlabs.org>
*/
extern crate serialize;
extern crate aes_lib;
use std::path::Path;
use std::io::fs::File;
use std::iter::repeat;
use serialize::base64::FromBase64;
use aes_lib::{decrypt_aes_cbc, encrypt_aes_cbc};
fn read_hex_file(path: &Path) -> Vec<u8> {
match File::open(path) {
Ok(mut file) => {
let data = file.read_to_end().unwrap();
let text = String::from_utf8(data).unwrap();
text.from_base64().unwrap()
},
Err(err) => panic!("Unable to open {}: {}", path.display(), err)
}
}
/*
* Main entry point
*/
fn main() {
let path = Path::new("10.txt");
let data = read_hex_file(&path);
let key = b"YELLOW SUBMARINE";
let iv: Vec<u8> = repeat(0u8).take(16).collect();
let decrypted = decrypt_aes_cbc(data.as_slice(), key.as_slice(),
iv.as_slice());
println!("Decrypted => \"{}\"",
String::from_utf8(decrypted.clone()).unwrap());
assert_eq!(data, encrypt_aes_cbc(decrypted.as_slice(), key.as_slice(),
iv.as_slice()));
println!("Encryption OK!");
}
## Instruction:
Replace repeat() with static array
## Code After:
/* AES-128 CBC mode
*
* Dmitry Vasiliev <dima@hlabs.org>
*/
extern crate serialize;
extern crate aes_lib;
use std::path::Path;
use std::io::fs::File;
use serialize::base64::FromBase64;
use aes_lib::{decrypt_aes_cbc, encrypt_aes_cbc};
fn read_hex_file(path: &Path) -> Vec<u8> {
match File::open(path) {
Ok(mut file) => {
let data = file.read_to_end().unwrap();
let text = String::from_utf8(data).unwrap();
text.from_base64().unwrap()
},
Err(err) => panic!("Unable to open {}: {}", path.display(), err)
}
}
/*
* Main entry point
*/
fn main() {
let path = Path::new("10.txt");
let data = read_hex_file(&path);
let key = b"YELLOW SUBMARINE";
let iv: Vec<u8> = [0u8; 16].to_vec();
let decrypted = decrypt_aes_cbc(data.as_slice(), key.as_slice(),
iv.as_slice());
println!("Decrypted => \"{}\"",
String::from_utf8(decrypted.clone()).unwrap());
assert_eq!(data, encrypt_aes_cbc(decrypted.as_slice(), key.as_slice(),
iv.as_slice()));
println!("Encryption OK!");
}
| /* AES-128 CBC mode
*
* Dmitry Vasiliev <dima@hlabs.org>
*/
extern crate serialize;
extern crate aes_lib;
use std::path::Path;
use std::io::fs::File;
- use std::iter::repeat;
use serialize::base64::FromBase64;
use aes_lib::{decrypt_aes_cbc, encrypt_aes_cbc};
fn read_hex_file(path: &Path) -> Vec<u8> {
match File::open(path) {
Ok(mut file) => {
let data = file.read_to_end().unwrap();
let text = String::from_utf8(data).unwrap();
text.from_base64().unwrap()
},
Err(err) => panic!("Unable to open {}: {}", path.display(), err)
}
}
/*
* Main entry point
*/
fn main() {
let path = Path::new("10.txt");
let data = read_hex_file(&path);
let key = b"YELLOW SUBMARINE";
- let iv: Vec<u8> = repeat(0u8).take(16).collect();
+ let iv: Vec<u8> = [0u8; 16].to_vec();
let decrypted = decrypt_aes_cbc(data.as_slice(), key.as_slice(),
iv.as_slice());
println!("Decrypted => \"{}\"",
String::from_utf8(decrypted.clone()).unwrap());
assert_eq!(data, encrypt_aes_cbc(decrypted.as_slice(), key.as_slice(),
iv.as_slice()));
println!("Encryption OK!");
} | 3 | 0.068182 | 1 | 2 |
4584a19933c61938c323c89a0ee0a3afef866b0b | .travis.yml | .travis.yml | language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- pypy
virtualenv:
system_site_packages: true
before_script:
- source test.env
install:
- export PYTHONIOENCODING=UTF8
- python setup.py install
- pip install coveralls --use-mirrors
script:
- coverage run tools/testall.py
after_success:
coveralls
| language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- pypy
virtualenv:
system_site_packages: true
before_install:
- sudo apt-get install python-yaml python3-yaml
install:
- export PYTHONIOENCODING=UTF8
- python setup.py install
- pip install coveralls --use-mirrors
before_script:
- source test.env
script:
- coverage run tools/testall.py
after_success:
coveralls
| Install PyYAML from apt, should be quicker | Install PyYAML from apt, should be quicker
| YAML | isc | blink1073/pexpect,Wakeupbuddy/pexpect,Depado/pexpect,nodish/pexpect,quatanium/pexpect,Wakeupbuddy/pexpect,dongguangming/pexpect,blink1073/pexpect,Depado/pexpect,nodish/pexpect,dongguangming/pexpect,Depado/pexpect,crdoconnor/pexpect,Wakeupbuddy/pexpect,bangi123/pexpect,nodish/pexpect,bangi123/pexpect,Depado/pexpect,dongguangming/pexpect,crdoconnor/pexpect,blink1073/pexpect,Wakeupbuddy/pexpect,crdoconnor/pexpect,bangi123/pexpect,bangi123/pexpect,quatanium/pexpect,dongguangming/pexpect,quatanium/pexpect | yaml | ## Code Before:
language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- pypy
virtualenv:
system_site_packages: true
before_script:
- source test.env
install:
- export PYTHONIOENCODING=UTF8
- python setup.py install
- pip install coveralls --use-mirrors
script:
- coverage run tools/testall.py
after_success:
coveralls
## Instruction:
Install PyYAML from apt, should be quicker
## Code After:
language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- pypy
virtualenv:
system_site_packages: true
before_install:
- sudo apt-get install python-yaml python3-yaml
install:
- export PYTHONIOENCODING=UTF8
- python setup.py install
- pip install coveralls --use-mirrors
before_script:
- source test.env
script:
- coverage run tools/testall.py
after_success:
coveralls
| language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- pypy
virtualenv:
system_site_packages: true
+ before_install:
+ - sudo apt-get install python-yaml python3-yaml
- before_script:
- - source test.env
-
install:
- export PYTHONIOENCODING=UTF8
- python setup.py install
- pip install coveralls --use-mirrors
+ before_script:
+ - source test.env
script:
- coverage run tools/testall.py
after_success:
coveralls | 7 | 0.28 | 4 | 3 |
57c6fe7d1f0183b1c6eb7a8f451bc569f0bf482d | README.md | README.md | Powercores
==========
Higher level multithreading for C++. This library uses only C++11 features, and thus runs anywhere C++11 runs.
Note: This is definitely a work in progress and will develop alongside [Libaudioverse](http://github.com/camlorn/libaudioverse). unlike Libaudioverse, it is released under the unlicense, so you can use it or modify it for any reason and any purpose. See the LICENSE file for specifics.
the purpose of this library is to provide some higher level primitives needed for [Libaudioverse](http://github.com/camlorn/libaudioverse). While C++11 provides some lower-level features, the higher level abstractions are missing. This library aims to fill that gap.
| Powercores
==========
Higher level multithreading for C++. This library uses C++11 features wherever possible.
Note: This is definitely a work in progress and will develop alongside [Libaudioverse](http://github.com/camlorn/libaudioverse). unlike Libaudioverse, it is released under the unlicense, so you can use it or modify it for any reason and any purpose. See the LICENSE file for specifics.
the purpose of this library is to provide some higher level primitives needed for [Libaudioverse](http://github.com/camlorn/libaudioverse). While C++11 provides some lower-level features, the higher level abstractions are missing. This library aims to fill that gap.
Current features:
- Function to safely start a thread.
- Threadsafe Multiproducer multi-consumer queue.
- Thread pool, including support for waiting on results of a job (using `std::future`) and submitting barriers.
| Update the readme a bit. | Update the readme a bit.
| Markdown | unlicense | camlorn/powercores | markdown | ## Code Before:
Powercores
==========
Higher level multithreading for C++. This library uses only C++11 features, and thus runs anywhere C++11 runs.
Note: This is definitely a work in progress and will develop alongside [Libaudioverse](http://github.com/camlorn/libaudioverse). unlike Libaudioverse, it is released under the unlicense, so you can use it or modify it for any reason and any purpose. See the LICENSE file for specifics.
the purpose of this library is to provide some higher level primitives needed for [Libaudioverse](http://github.com/camlorn/libaudioverse). While C++11 provides some lower-level features, the higher level abstractions are missing. This library aims to fill that gap.
## Instruction:
Update the readme a bit.
## Code After:
Powercores
==========
Higher level multithreading for C++. This library uses C++11 features wherever possible.
Note: This is definitely a work in progress and will develop alongside [Libaudioverse](http://github.com/camlorn/libaudioverse). unlike Libaudioverse, it is released under the unlicense, so you can use it or modify it for any reason and any purpose. See the LICENSE file for specifics.
the purpose of this library is to provide some higher level primitives needed for [Libaudioverse](http://github.com/camlorn/libaudioverse). While C++11 provides some lower-level features, the higher level abstractions are missing. This library aims to fill that gap.
Current features:
- Function to safely start a thread.
- Threadsafe Multiproducer multi-consumer queue.
- Thread pool, including support for waiting on results of a job (using `std::future`) and submitting barriers.
| Powercores
==========
- Higher level multithreading for C++. This library uses only C++11 features, and thus runs anywhere C++11 runs.
? ----- - ----------------- ^^^^^^^^^
+ Higher level multithreading for C++. This library uses C++11 features wherever possible.
? +++ ^^ +++++
Note: This is definitely a work in progress and will develop alongside [Libaudioverse](http://github.com/camlorn/libaudioverse). unlike Libaudioverse, it is released under the unlicense, so you can use it or modify it for any reason and any purpose. See the LICENSE file for specifics.
the purpose of this library is to provide some higher level primitives needed for [Libaudioverse](http://github.com/camlorn/libaudioverse). While C++11 provides some lower-level features, the higher level abstractions are missing. This library aims to fill that gap.
+ Current features:
+
+ - Function to safely start a thread.
+
+ - Threadsafe Multiproducer multi-consumer queue.
+
+ - Thread pool, including support for waiting on results of a job (using `std::future`) and submitting barriers.
+ | 10 | 1.111111 | 9 | 1 |
c4f59c0d44382e21b44fa31d78ade828c9f674a1 | README.md | README.md |
Visit [orktes.github.io/atom-react](https://orktes.github.io/atom-react) for more information.
Initially a port of [sublime-react](https://github.com/reactjs/sublime-react) for [Atom](https://github.com/atom/atom).
## Features
- Syntax highlighting
- Snippets
- Automatic indentation and folding
- JSX Reformatting
- HTML to JSX conversion
Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc.
| [](https://travis-ci.org/orktes/atom-react)
# Atom React.js support
Visit [orktes.github.io/atom-react](https://orktes.github.io/atom-react) for more information.
Initially a port of [sublime-react](https://github.com/reactjs/sublime-react) for [Atom](https://github.com/atom/atom).
## Features
- Syntax highlighting
- Snippets
- Automatic indentation and folding
- JSX Reformatting
- HTML to JSX conversion
Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc.
| Add travis status to readme | Add travis status to readme
| Markdown | mit | AdshadLib/atom-react,gre/atom-react,MiincGu/atom-react,jeffshaver/atom-react,orktes/atom-react,blurrah/atom-react,rylanc/atom-react,nickhudkins/atom-react,extrabacon/atom-react,Nihu98/atom-react | markdown | ## Code Before:
Visit [orktes.github.io/atom-react](https://orktes.github.io/atom-react) for more information.
Initially a port of [sublime-react](https://github.com/reactjs/sublime-react) for [Atom](https://github.com/atom/atom).
## Features
- Syntax highlighting
- Snippets
- Automatic indentation and folding
- JSX Reformatting
- HTML to JSX conversion
Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc.
## Instruction:
Add travis status to readme
## Code After:
[](https://travis-ci.org/orktes/atom-react)
# Atom React.js support
Visit [orktes.github.io/atom-react](https://orktes.github.io/atom-react) for more information.
Initially a port of [sublime-react](https://github.com/reactjs/sublime-react) for [Atom](https://github.com/atom/atom).
## Features
- Syntax highlighting
- Snippets
- Automatic indentation and folding
- JSX Reformatting
- HTML to JSX conversion
Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc.
| + [](https://travis-ci.org/orktes/atom-react)
+
+ # Atom React.js support
Visit [orktes.github.io/atom-react](https://orktes.github.io/atom-react) for more information.
Initially a port of [sublime-react](https://github.com/reactjs/sublime-react) for [Atom](https://github.com/atom/atom).
## Features
- Syntax highlighting
- Snippets
- Automatic indentation and folding
- JSX Reformatting
- HTML to JSX conversion
Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc. | 3 | 0.214286 | 3 | 0 |
a3ed60fee75ac3467f283ac63749628c70020b52 | README.md | README.md | <div> <img
src="https://raw.githubusercontent.com/djsegal/Julz.jl/master/docs/public/assets/images/logo.png"
alt="Julz" width="250"></img> </div>
A framework for creating scalable Julia packages.
## Installation
```julia
Pkg.clone("git://github.com/djsegal/Julz.jl.git")
```
## Documentation
- http://djsegal.github.io/Julz.jl
| [](http://djsegal.github.io/Julz.jl) [](https://travis-ci.org/djsegal/Julz.jl) [](https://codecov.io/gh/djsegal/Julz.jl)
<div> <img
src="https://raw.githubusercontent.com/djsegal/Julz.jl/master/docs/public/assets/images/logo.png"
alt="Julz" width="250"></img> </div>
A framework for creating scalable Julia packages.
## Installation
```julia
Pkg.clone("git://github.com/djsegal/Julz.jl.git")
```
## Documentation
- http://djsegal.github.io/Julz.jl
| Add various badges to readme | Add various badges to readme | Markdown | mit | djsegal/julz,djsegal/julz | markdown | ## Code Before:
<div> <img
src="https://raw.githubusercontent.com/djsegal/Julz.jl/master/docs/public/assets/images/logo.png"
alt="Julz" width="250"></img> </div>
A framework for creating scalable Julia packages.
## Installation
```julia
Pkg.clone("git://github.com/djsegal/Julz.jl.git")
```
## Documentation
- http://djsegal.github.io/Julz.jl
## Instruction:
Add various badges to readme
## Code After:
[](http://djsegal.github.io/Julz.jl) [](https://travis-ci.org/djsegal/Julz.jl) [](https://codecov.io/gh/djsegal/Julz.jl)
<div> <img
src="https://raw.githubusercontent.com/djsegal/Julz.jl/master/docs/public/assets/images/logo.png"
alt="Julz" width="250"></img> </div>
A framework for creating scalable Julia packages.
## Installation
```julia
Pkg.clone("git://github.com/djsegal/Julz.jl.git")
```
## Documentation
- http://djsegal.github.io/Julz.jl
| + [](http://djsegal.github.io/Julz.jl) [](https://travis-ci.org/djsegal/Julz.jl) [](https://codecov.io/gh/djsegal/Julz.jl)
+
<div> <img
src="https://raw.githubusercontent.com/djsegal/Julz.jl/master/docs/public/assets/images/logo.png"
alt="Julz" width="250"></img> </div>
A framework for creating scalable Julia packages.
## Installation
```julia
Pkg.clone("git://github.com/djsegal/Julz.jl.git")
```
## Documentation
- http://djsegal.github.io/Julz.jl | 2 | 0.133333 | 2 | 0 |
9ebd1390fd7243cfa4e818b45b7c2d9d115fd21b | src/google/protobuf/compiler/perlxs/main.cc | src/google/protobuf/compiler/perlxs/main.cc |
using namespace std;
int main(int argc, char* argv[]) {
google::protobuf::compiler::CommandLineInterface cli;
// Proto2 C++ (for convenience, so the user doesn't need to call
// protoc separately)
google::protobuf::compiler::cpp::CppGenerator cpp_generator;
cli.RegisterGenerator("--cpp_out", &cpp_generator,
"Generate C++ header and source.");
// Proto2 Perl/XS
google::protobuf::compiler::perlxs::PerlXSGenerator perlxs_generator;
cli.RegisterGenerator("--out", &perlxs_generator,
"Generate Perl/XS source files.");
cli.SetVersionInfo(perlxs_generator.GetVersionInfo());
// process Perl/XS command line options first, and filter them out
// of the argument list. we really need to be able to register
// options with the CLI instead of doing this stupid hack here.
int j = 1;
for (int i = 1; i < argc; i++) {
if (perlxs_generator.ProcessOption(argv[i]) == false) {
argv[j++] = argv[i];
}
}
return cli.Run(j, argv);
}
|
int main(int argc, char* argv[]) {
google::protobuf::compiler::CommandLineInterface cli;
// Proto2 C++ (for convenience, so the user doesn't need to call
// protoc separately)
google::protobuf::compiler::cpp::CppGenerator cpp_generator;
cli.RegisterGenerator("--cpp_out", &cpp_generator,
"Generate C++ header and source.");
// Proto2 Perl/XS
google::protobuf::compiler::perlxs::PerlXSGenerator perlxs_generator;
cli.RegisterGenerator("--out", &perlxs_generator,
"Generate Perl/XS source files.");
cli.SetVersionInfo(perlxs_generator.GetVersionInfo());
// process Perl/XS command line options first, and filter them out
// of the argument list. we really need to be able to register
// options with the CLI instead of doing this stupid hack here.
int j = 1;
for (int i = 1; i < argc; i++) {
if (perlxs_generator.ProcessOption(argv[i]) == false) {
argv[j++] = argv[i];
}
}
return cli.Run(j, argv);
}
| Remove unused `using namespace std` | Remove unused `using namespace std`
| C++ | apache-2.0 | spiritloose/protobuf-perlxs | c++ | ## Code Before:
using namespace std;
int main(int argc, char* argv[]) {
google::protobuf::compiler::CommandLineInterface cli;
// Proto2 C++ (for convenience, so the user doesn't need to call
// protoc separately)
google::protobuf::compiler::cpp::CppGenerator cpp_generator;
cli.RegisterGenerator("--cpp_out", &cpp_generator,
"Generate C++ header and source.");
// Proto2 Perl/XS
google::protobuf::compiler::perlxs::PerlXSGenerator perlxs_generator;
cli.RegisterGenerator("--out", &perlxs_generator,
"Generate Perl/XS source files.");
cli.SetVersionInfo(perlxs_generator.GetVersionInfo());
// process Perl/XS command line options first, and filter them out
// of the argument list. we really need to be able to register
// options with the CLI instead of doing this stupid hack here.
int j = 1;
for (int i = 1; i < argc; i++) {
if (perlxs_generator.ProcessOption(argv[i]) == false) {
argv[j++] = argv[i];
}
}
return cli.Run(j, argv);
}
## Instruction:
Remove unused `using namespace std`
## Code After:
int main(int argc, char* argv[]) {
google::protobuf::compiler::CommandLineInterface cli;
// Proto2 C++ (for convenience, so the user doesn't need to call
// protoc separately)
google::protobuf::compiler::cpp::CppGenerator cpp_generator;
cli.RegisterGenerator("--cpp_out", &cpp_generator,
"Generate C++ header and source.");
// Proto2 Perl/XS
google::protobuf::compiler::perlxs::PerlXSGenerator perlxs_generator;
cli.RegisterGenerator("--out", &perlxs_generator,
"Generate Perl/XS source files.");
cli.SetVersionInfo(perlxs_generator.GetVersionInfo());
// process Perl/XS command line options first, and filter them out
// of the argument list. we really need to be able to register
// options with the CLI instead of doing this stupid hack here.
int j = 1;
for (int i = 1; i < argc; i++) {
if (perlxs_generator.ProcessOption(argv[i]) == false) {
argv[j++] = argv[i];
}
}
return cli.Run(j, argv);
}
| -
- using namespace std;
int main(int argc, char* argv[]) {
google::protobuf::compiler::CommandLineInterface cli;
// Proto2 C++ (for convenience, so the user doesn't need to call
// protoc separately)
google::protobuf::compiler::cpp::CppGenerator cpp_generator;
cli.RegisterGenerator("--cpp_out", &cpp_generator,
"Generate C++ header and source.");
// Proto2 Perl/XS
google::protobuf::compiler::perlxs::PerlXSGenerator perlxs_generator;
cli.RegisterGenerator("--out", &perlxs_generator,
"Generate Perl/XS source files.");
cli.SetVersionInfo(perlxs_generator.GetVersionInfo());
// process Perl/XS command line options first, and filter them out
// of the argument list. we really need to be able to register
// options with the CLI instead of doing this stupid hack here.
int j = 1;
for (int i = 1; i < argc; i++) {
if (perlxs_generator.ProcessOption(argv[i]) == false) {
argv[j++] = argv[i];
}
}
return cli.Run(j, argv);
} | 2 | 0.060606 | 0 | 2 |
6d81447d67c636244b6af85ac6596ed5876f2f8f | doc/requirements.txt | doc/requirements.txt | setuptools_scm
git+https://github.com/wallento/sphinx@fix-latex-figure-in-admonition#egg=sphinx
sphinx_rtd_theme
sphinxcontrib-wavedrom
wavedrom>=1.9.0rc1
| setuptools_scm
sphinx>=2.1.0
sphinx_rtd_theme
sphinxcontrib-wavedrom
wavedrom>=1.9.0rc1
| Switch back to upstream Sphinx | Doc: Switch back to upstream Sphinx
Upstream has now released a new version which includes Stefan's patch to
correctly build the PDFs.
Fixes #41
| Text | apache-2.0 | AmbiML/ibex,lowRISC/ibex,lowRISC/ibex,AmbiML/ibex,AmbiML/ibex,lowRISC/ibex,AmbiML/ibex,lowRISC/ibex | text | ## Code Before:
setuptools_scm
git+https://github.com/wallento/sphinx@fix-latex-figure-in-admonition#egg=sphinx
sphinx_rtd_theme
sphinxcontrib-wavedrom
wavedrom>=1.9.0rc1
## Instruction:
Doc: Switch back to upstream Sphinx
Upstream has now released a new version which includes Stefan's patch to
correctly build the PDFs.
Fixes #41
## Code After:
setuptools_scm
sphinx>=2.1.0
sphinx_rtd_theme
sphinxcontrib-wavedrom
wavedrom>=1.9.0rc1
| setuptools_scm
- git+https://github.com/wallento/sphinx@fix-latex-figure-in-admonition#egg=sphinx
+ sphinx>=2.1.0
sphinx_rtd_theme
sphinxcontrib-wavedrom
wavedrom>=1.9.0rc1 | 2 | 0.4 | 1 | 1 |
e9133bdac241fbe4974ba256f4b9793db2689e76 | test/serializer.cpp | test/serializer.cpp |
void test(const double in) {
Serializer s;
writer<decltype(+in)>::write(s, in);
const auto buf = s.data();
Deserializer d(s.buffer, s.buffer.size() - buf.second);
const auto out = reader<decltype(+in)>::read(d);
assert(in == out || (std::isnan(in) && std::isnan(out)));
}
int main() {
test(std::numeric_limits<double>::infinity());
test(-std::numeric_limits<double>::infinity());
test(std::numeric_limits<double>::quiet_NaN());
test(1.0);
test(-1.0);
test(2.0);
test(-2.0);
test(M_PI);
test(-M_PI);
test(std::numeric_limits<double>::epsilon());
test(std::numeric_limits<double>::min());
test(std::numeric_limits<double>::max());
test(std::numeric_limits<double>::denorm_min());
}
|
void test(const double in) {
Serializer s;
writer<decltype(+in)>::write(s, in);
const auto buf = s.data();
Deserializer d(s.buffer, s.buffer.size() - buf.second);
const auto out = reader<decltype(+in)>::read(d);
assert(in == out || (std::isnan(in) && std::isnan(out)));
}
int main() {
test(std::numeric_limits<double>::infinity());
test(-std::numeric_limits<double>::infinity());
test(std::numeric_limits<double>::quiet_NaN());
test(0.0);
test(-0.0);
test(1.0);
test(-1.0);
test(2.0);
test(-2.0);
test(M_PI);
test(-M_PI);
test(std::numeric_limits<double>::epsilon());
test(std::numeric_limits<double>::min());
test(std::numeric_limits<double>::max());
test(std::numeric_limits<double>::denorm_min());
}
| Test serialization of zero too | Test serialization of zero too
| C++ | mit | muggenhor/rapscallion,dascandy/rapscallion | c++ | ## Code Before:
void test(const double in) {
Serializer s;
writer<decltype(+in)>::write(s, in);
const auto buf = s.data();
Deserializer d(s.buffer, s.buffer.size() - buf.second);
const auto out = reader<decltype(+in)>::read(d);
assert(in == out || (std::isnan(in) && std::isnan(out)));
}
int main() {
test(std::numeric_limits<double>::infinity());
test(-std::numeric_limits<double>::infinity());
test(std::numeric_limits<double>::quiet_NaN());
test(1.0);
test(-1.0);
test(2.0);
test(-2.0);
test(M_PI);
test(-M_PI);
test(std::numeric_limits<double>::epsilon());
test(std::numeric_limits<double>::min());
test(std::numeric_limits<double>::max());
test(std::numeric_limits<double>::denorm_min());
}
## Instruction:
Test serialization of zero too
## Code After:
void test(const double in) {
Serializer s;
writer<decltype(+in)>::write(s, in);
const auto buf = s.data();
Deserializer d(s.buffer, s.buffer.size() - buf.second);
const auto out = reader<decltype(+in)>::read(d);
assert(in == out || (std::isnan(in) && std::isnan(out)));
}
int main() {
test(std::numeric_limits<double>::infinity());
test(-std::numeric_limits<double>::infinity());
test(std::numeric_limits<double>::quiet_NaN());
test(0.0);
test(-0.0);
test(1.0);
test(-1.0);
test(2.0);
test(-2.0);
test(M_PI);
test(-M_PI);
test(std::numeric_limits<double>::epsilon());
test(std::numeric_limits<double>::min());
test(std::numeric_limits<double>::max());
test(std::numeric_limits<double>::denorm_min());
}
|
void test(const double in) {
Serializer s;
writer<decltype(+in)>::write(s, in);
const auto buf = s.data();
Deserializer d(s.buffer, s.buffer.size() - buf.second);
const auto out = reader<decltype(+in)>::read(d);
assert(in == out || (std::isnan(in) && std::isnan(out)));
}
int main() {
test(std::numeric_limits<double>::infinity());
test(-std::numeric_limits<double>::infinity());
test(std::numeric_limits<double>::quiet_NaN());
+ test(0.0);
+ test(-0.0);
test(1.0);
test(-1.0);
test(2.0);
test(-2.0);
test(M_PI);
test(-M_PI);
test(std::numeric_limits<double>::epsilon());
test(std::numeric_limits<double>::min());
test(std::numeric_limits<double>::max());
test(std::numeric_limits<double>::denorm_min());
} | 2 | 0.08 | 2 | 0 |
468ad37082749ccc867eb691ee64b3d9872af33d | README.md | README.md | [](https://opensource.org/licenses/MIT)
| [](https://travis-ci.org/ZZBGames/core)
[](https://coveralls.io/github/ZZBGames/core?branch=master)
[](https://opensource.org/licenses/MIT)
| Add build status and code coverage badges | Add build status and code coverage badges
| Markdown | mit | ZZBGames/core | markdown | ## Code Before:
[](https://opensource.org/licenses/MIT)
## Instruction:
Add build status and code coverage badges
## Code After:
[](https://travis-ci.org/ZZBGames/core)
[](https://coveralls.io/github/ZZBGames/core?branch=master)
[](https://opensource.org/licenses/MIT)
| + [](https://travis-ci.org/ZZBGames/core)
+ [](https://coveralls.io/github/ZZBGames/core?branch=master)
- [](https://opensource.org/licenses/MIT)
? --------------
+ [](https://opensource.org/licenses/MIT) | 4 | 4 | 3 | 1 |
516a18055fa77a754c8c28ba56293946ab2c7638 | devilry/apps/examiner/templates/devilry/examiner/include/deliverylisting.django.html | devilry/apps/examiner/templates/devilry/examiner/include/deliverylisting.django.html | {% load i18n %}
{% load inlinestyles %}
<li {% if selected_delivery_id == delivery.id %}class="selected-delivery"{% endif %}>
<div class="deliverynumber">
{{ delivery.number }}:
</div>
<div class="deliveryinfo">
<a href='{% url devilry-examiner-edit-feedback delivery.id %}' class="deliverydate">
{{ delivery.time_of_delivery|date:"DATETIME_FORMAT" }}
</a>
<div class="unimportant">
{% spaceless %}
{{ delivery|status }}
{% if delivery.feedback %}
({{ delivery.feedback.get_grade_as_short_string }})
{% endif %}
{% comment %}
{% if delivery.feedback.published %}
<span class='delivery_published_msg'>({% trans "Published" %})</span>
{% endif %}
{% if delivery.feedback and not delivery.feedback.published %}
<span class='status_corrected_not_published'>({% trans "Feedback is not published, and not viewable by the student(s)" %})</span>
{% endif %}
{% endcomment %}
{% if after_last_deadline_msg %}
<span class='bad'> ({% trans "After last deadline" %})</span>
{% endif %}
{% endspaceless %}
</div>
</div>
</li>
| {% load i18n %}
{% load inlinestyles %}
<li {% if selected_delivery_id == delivery.id %}class="selected-delivery"{% endif %}>
<div class="deliverynumber">
{{ delivery.number }}:
</div>
<div class="deliveryinfo">
<a href='{% url devilry-examiner-edit-feedback delivery.id %}' class="deliverydate">
{{ delivery.time_of_delivery|date:"DATETIME_FORMAT" }}
</a>
{% if delivery.after_deadline %}
<div class="bad">
After deadline
</div>
{% endif %}
<div class="unimportant">
{% spaceless %}
{{ delivery|status }}
{% if delivery.feedback %}
({{ delivery.feedback.get_grade_as_short_string }})
{% endif %}
{% comment %}
{% if delivery.feedback.published %}
<span class='delivery_published_msg'>({% trans "Published" %})</span>
{% endif %}
{% if delivery.feedback and not delivery.feedback.published %}
<span class='status_corrected_not_published'>({% trans "Feedback is not published, and not viewable by the student(s)" %})</span>
{% endif %}
{% endcomment %}
{% if after_last_deadline_msg %}
<span class='bad'> ({% trans "After last deadline" %})</span>
{% endif %}
{% endspaceless %}
</div>
</div>
</li>
| Add warning of 'After deadline' | Add warning of 'After deadline'
| HTML | bsd-3-clause | devilry/devilry-django,vegarang/devilry-django,devilry/devilry-django,vegarang/devilry-django,devilry/devilry-django,devilry/devilry-django | html | ## Code Before:
{% load i18n %}
{% load inlinestyles %}
<li {% if selected_delivery_id == delivery.id %}class="selected-delivery"{% endif %}>
<div class="deliverynumber">
{{ delivery.number }}:
</div>
<div class="deliveryinfo">
<a href='{% url devilry-examiner-edit-feedback delivery.id %}' class="deliverydate">
{{ delivery.time_of_delivery|date:"DATETIME_FORMAT" }}
</a>
<div class="unimportant">
{% spaceless %}
{{ delivery|status }}
{% if delivery.feedback %}
({{ delivery.feedback.get_grade_as_short_string }})
{% endif %}
{% comment %}
{% if delivery.feedback.published %}
<span class='delivery_published_msg'>({% trans "Published" %})</span>
{% endif %}
{% if delivery.feedback and not delivery.feedback.published %}
<span class='status_corrected_not_published'>({% trans "Feedback is not published, and not viewable by the student(s)" %})</span>
{% endif %}
{% endcomment %}
{% if after_last_deadline_msg %}
<span class='bad'> ({% trans "After last deadline" %})</span>
{% endif %}
{% endspaceless %}
</div>
</div>
</li>
## Instruction:
Add warning of 'After deadline'
## Code After:
{% load i18n %}
{% load inlinestyles %}
<li {% if selected_delivery_id == delivery.id %}class="selected-delivery"{% endif %}>
<div class="deliverynumber">
{{ delivery.number }}:
</div>
<div class="deliveryinfo">
<a href='{% url devilry-examiner-edit-feedback delivery.id %}' class="deliverydate">
{{ delivery.time_of_delivery|date:"DATETIME_FORMAT" }}
</a>
{% if delivery.after_deadline %}
<div class="bad">
After deadline
</div>
{% endif %}
<div class="unimportant">
{% spaceless %}
{{ delivery|status }}
{% if delivery.feedback %}
({{ delivery.feedback.get_grade_as_short_string }})
{% endif %}
{% comment %}
{% if delivery.feedback.published %}
<span class='delivery_published_msg'>({% trans "Published" %})</span>
{% endif %}
{% if delivery.feedback and not delivery.feedback.published %}
<span class='status_corrected_not_published'>({% trans "Feedback is not published, and not viewable by the student(s)" %})</span>
{% endif %}
{% endcomment %}
{% if after_last_deadline_msg %}
<span class='bad'> ({% trans "After last deadline" %})</span>
{% endif %}
{% endspaceless %}
</div>
</div>
</li>
| {% load i18n %}
{% load inlinestyles %}
<li {% if selected_delivery_id == delivery.id %}class="selected-delivery"{% endif %}>
<div class="deliverynumber">
{{ delivery.number }}:
</div>
<div class="deliveryinfo">
<a href='{% url devilry-examiner-edit-feedback delivery.id %}' class="deliverydate">
{{ delivery.time_of_delivery|date:"DATETIME_FORMAT" }}
</a>
+
+ {% if delivery.after_deadline %}
+ <div class="bad">
+ After deadline
+ </div>
+ {% endif %}
+
<div class="unimportant">
{% spaceless %}
{{ delivery|status }}
{% if delivery.feedback %}
({{ delivery.feedback.get_grade_as_short_string }})
{% endif %}
{% comment %}
{% if delivery.feedback.published %}
<span class='delivery_published_msg'>({% trans "Published" %})</span>
{% endif %}
{% if delivery.feedback and not delivery.feedback.published %}
<span class='status_corrected_not_published'>({% trans "Feedback is not published, and not viewable by the student(s)" %})</span>
{% endif %}
{% endcomment %}
{% if after_last_deadline_msg %}
<span class='bad'> ({% trans "After last deadline" %})</span>
{% endif %}
{% endspaceless %}
</div>
</div>
</li> | 7 | 0.21875 | 7 | 0 |
c273889f44a5e5dd369c8749cafc737bb9363491 | packages/cli/templates/default/package.json | packages/cli/templates/default/package.json | {
"name": "PROJECT-NAME-CLEANED",
"description": "",
"version": "0.0.1",
"author": "AUTHOR",
"homepage": "HOMEPAGE",
"license": "LICENSE",
"devDependencies": {
"browser-sync": "^2.18.8",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-cleancss": "^0.2.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.4.1",
"node-sass-magic-importer": "^4.1.3"
},
"scripts": {
"start": "gulp"
}
}
| {
"name": "PROJECT-NAME-CLEANED",
"description": "",
"version": "0.0.1",
"author": "AUTHOR",
"homepage": "HOMEPAGE",
"license": "LICENSE",
"devDependencies": {
"browser-sync": "^2.18.8",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-cleancss": "^0.2.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.4.1",
"node-sass-magic-importer": "^4.1.3"
},
"scripts": {
"start": "gulp",
"serve": "gulp serve",
"styles": "gulp styles",
"minify:styles": "gulp minify:styles",
"clean:styles": "gulp clean:styles"
}
}
| Make CLI gulp tasks available as npm scripts. | Make CLI gulp tasks available as npm scripts.
In doing so, a global installed version of gulp is not necessary.
| JSON | mit | avalanchesass/avalanche,avalanchesass/avalanche,avalanchesass/avalanche | json | ## Code Before:
{
"name": "PROJECT-NAME-CLEANED",
"description": "",
"version": "0.0.1",
"author": "AUTHOR",
"homepage": "HOMEPAGE",
"license": "LICENSE",
"devDependencies": {
"browser-sync": "^2.18.8",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-cleancss": "^0.2.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.4.1",
"node-sass-magic-importer": "^4.1.3"
},
"scripts": {
"start": "gulp"
}
}
## Instruction:
Make CLI gulp tasks available as npm scripts.
In doing so, a global installed version of gulp is not necessary.
## Code After:
{
"name": "PROJECT-NAME-CLEANED",
"description": "",
"version": "0.0.1",
"author": "AUTHOR",
"homepage": "HOMEPAGE",
"license": "LICENSE",
"devDependencies": {
"browser-sync": "^2.18.8",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-cleancss": "^0.2.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.4.1",
"node-sass-magic-importer": "^4.1.3"
},
"scripts": {
"start": "gulp",
"serve": "gulp serve",
"styles": "gulp styles",
"minify:styles": "gulp minify:styles",
"clean:styles": "gulp clean:styles"
}
}
| {
"name": "PROJECT-NAME-CLEANED",
"description": "",
"version": "0.0.1",
"author": "AUTHOR",
"homepage": "HOMEPAGE",
"license": "LICENSE",
"devDependencies": {
"browser-sync": "^2.18.8",
"del": "^2.2.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-cleancss": "^0.2.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.4.1",
"node-sass-magic-importer": "^4.1.3"
},
"scripts": {
- "start": "gulp"
+ "start": "gulp",
? +
+ "serve": "gulp serve",
+ "styles": "gulp styles",
+ "minify:styles": "gulp minify:styles",
+ "clean:styles": "gulp clean:styles"
}
} | 6 | 0.272727 | 5 | 1 |
b8aee29ea598fb46067242f0aafc55169a0c334e | Android/DoseNet/app/src/main/java/com/navrit/dosenet/Dosimeter.java | Android/DoseNet/app/src/main/java/com/navrit/dosenet/Dosimeter.java | package com.navrit.dosenet;
public class Dosimeter {
String name;
double lastDose_uSv;
String lastTime;
//double lastDose_mRem;
//double distance;
//double lat;
//double lon;
// Image for card view
//List<double> doses_uSv; // For dose over time plots
//List<String> times;
Dosimeter(String name, double lastDose_uSv, String lastTime){
this.name = name;
this.lastDose_uSv = lastDose_uSv;
this.lastTime = lastTime;
}
}
| package com.navrit.dosenet;
public class Dosimeter {
String name;
double lastDose_uSv;
String lastTime;
double lastDose_mRem;
//double distance;
//double lat;
//double lon;
// Image for card view
//List<double> doses_uSv; // For dose over time plots
//List<String> times;
Dosimeter(String name, double lastDose_uSv, String lastTime){
this.name = name;
this.lastDose_uSv = lastDose_uSv;
this.lastTime = lastTime;
this.lastDose_mRem = lastDose_uSv/10;
}
}
| Convert to mRem from uSv | Convert to mRem from uSv
| Java | mit | bearing/dosenet-apps,bearing/dosenet-apps,bearing/dosenet-apps,bearing/dosenet-apps | java | ## Code Before:
package com.navrit.dosenet;
public class Dosimeter {
String name;
double lastDose_uSv;
String lastTime;
//double lastDose_mRem;
//double distance;
//double lat;
//double lon;
// Image for card view
//List<double> doses_uSv; // For dose over time plots
//List<String> times;
Dosimeter(String name, double lastDose_uSv, String lastTime){
this.name = name;
this.lastDose_uSv = lastDose_uSv;
this.lastTime = lastTime;
}
}
## Instruction:
Convert to mRem from uSv
## Code After:
package com.navrit.dosenet;
public class Dosimeter {
String name;
double lastDose_uSv;
String lastTime;
double lastDose_mRem;
//double distance;
//double lat;
//double lon;
// Image for card view
//List<double> doses_uSv; // For dose over time plots
//List<String> times;
Dosimeter(String name, double lastDose_uSv, String lastTime){
this.name = name;
this.lastDose_uSv = lastDose_uSv;
this.lastTime = lastTime;
this.lastDose_mRem = lastDose_uSv/10;
}
}
| package com.navrit.dosenet;
public class Dosimeter {
String name;
double lastDose_uSv;
String lastTime;
- //double lastDose_mRem;
? --
+ double lastDose_mRem;
//double distance;
//double lat;
//double lon;
// Image for card view
//List<double> doses_uSv; // For dose over time plots
//List<String> times;
Dosimeter(String name, double lastDose_uSv, String lastTime){
this.name = name;
this.lastDose_uSv = lastDose_uSv;
this.lastTime = lastTime;
+ this.lastDose_mRem = lastDose_uSv/10;
}
} | 3 | 0.130435 | 2 | 1 |
3a43c6bd085a55715ee844e01aedf8d1816d0615 | _people/leon-derczynski.md | _people/leon-derczynski.md | ---
layout: master
include: person
name: Leon Derczynski
home: <a href="https://pure.itu.dk/portal/en/organisations/machine-learning(5f657c5d-532f-41df-b1e5-891f50d7062b).html">ITU</a>
country: "DK"
photo:
email:leod@itu.dk
phone:
on_contract: yes
has_been_on_contract: yes
groups
nlpl:
nlpl-sg:
| ---
layout: master
include: person
name: Leon Derczynski
home: <a href="https://pure.itu.dk/portal/en/organisations/machine-learning(5f657c5d-532f-41df-b1e5-891f50d7062b).html">ITU</a>
country: "DK"
photo:
email:leod@itu.dk
phone:
on_contract: no
has_been_on_contract: no
groups
nlpl:
nlpl-sg:
---
| Add missing --- end lines in file about Leon | Add missing --- end lines in file about Leon
| Markdown | mpl-2.0 | neicnordic/experimental.neic.nordforsk.org,neicnordic/neic.no,neicnordic/neic.no,neicnordic/experimental.neic.nordforsk.org,neicnordic/neic.no,neicnordic/experimental.neic.nordforsk.org | markdown | ## Code Before:
---
layout: master
include: person
name: Leon Derczynski
home: <a href="https://pure.itu.dk/portal/en/organisations/machine-learning(5f657c5d-532f-41df-b1e5-891f50d7062b).html">ITU</a>
country: "DK"
photo:
email:leod@itu.dk
phone:
on_contract: yes
has_been_on_contract: yes
groups
nlpl:
nlpl-sg:
## Instruction:
Add missing --- end lines in file about Leon
## Code After:
---
layout: master
include: person
name: Leon Derczynski
home: <a href="https://pure.itu.dk/portal/en/organisations/machine-learning(5f657c5d-532f-41df-b1e5-891f50d7062b).html">ITU</a>
country: "DK"
photo:
email:leod@itu.dk
phone:
on_contract: no
has_been_on_contract: no
groups
nlpl:
nlpl-sg:
---
| ---
layout: master
include: person
name: Leon Derczynski
home: <a href="https://pure.itu.dk/portal/en/organisations/machine-learning(5f657c5d-532f-41df-b1e5-891f50d7062b).html">ITU</a>
country: "DK"
photo:
email:leod@itu.dk
phone:
- on_contract: yes
? ^^^
+ on_contract: no
? ^^
- has_been_on_contract: yes
? ^^^
+ has_been_on_contract: no
? ^^
groups
nlpl:
nlpl-sg:
+ ---
| 5 | 0.333333 | 3 | 2 |
b73ee79294911b5f46d1cb01642c028412c72477 | src/Models/User/Validation/UserValidator.php | src/Models/User/Validation/UserValidator.php | <?php
namespace Nodes\Backend\Models\User\Validation;
use Nodes\Validation\AbstractValidator;
/**
* Class UserValidation.
*/
class UserValidator extends AbstractValidator
{
/**
* Validation rules.
*
* @var array
*/
protected $rules = [
'create' => [
'name' => ['required'],
'email' => ['required', 'email', 'unique:backend_users,email,{:id}', 'max:190'],
'password' => [
'required_without:id',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'user_role' => ['required', 'exists:backend_roles,slug'],
'image' => ['mimes:jpeg,png'],
],
'update-password' => [
'password' => [
'required_without:id',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'image' => ['mimes:jpeg,png'],
],
];
}
| <?php
namespace Nodes\Backend\Models\User\Validation;
use Nodes\Validation\AbstractValidator;
/**
* Class UserValidation.
*/
class UserValidator extends AbstractValidator
{
/**
* Validation rules.
*
* @var array
*/
protected $rules = [
'create' => [
'name' => ['required'],
'email' => ['required', 'email', 'unique:backend_users,email,{:id}', 'max:190'],
'password' => [
'required_without:id',
'nullable',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'user_role' => ['required', 'exists:backend_roles,slug'],
'image' => ['mimes:jpeg,png'],
],
'update-password' => [
'password' => [
'required_without:id',
'nullable',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'image' => ['mimes:jpeg,png'],
],
];
}
| Add 'nullable' validation to password field | Add 'nullable' validation to password field
| PHP | mit | nodes-php/backend,nodes-php/backend,nodes-php/backend | php | ## Code Before:
<?php
namespace Nodes\Backend\Models\User\Validation;
use Nodes\Validation\AbstractValidator;
/**
* Class UserValidation.
*/
class UserValidator extends AbstractValidator
{
/**
* Validation rules.
*
* @var array
*/
protected $rules = [
'create' => [
'name' => ['required'],
'email' => ['required', 'email', 'unique:backend_users,email,{:id}', 'max:190'],
'password' => [
'required_without:id',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'user_role' => ['required', 'exists:backend_roles,slug'],
'image' => ['mimes:jpeg,png'],
],
'update-password' => [
'password' => [
'required_without:id',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'image' => ['mimes:jpeg,png'],
],
];
}
## Instruction:
Add 'nullable' validation to password field
## Code After:
<?php
namespace Nodes\Backend\Models\User\Validation;
use Nodes\Validation\AbstractValidator;
/**
* Class UserValidation.
*/
class UserValidator extends AbstractValidator
{
/**
* Validation rules.
*
* @var array
*/
protected $rules = [
'create' => [
'name' => ['required'],
'email' => ['required', 'email', 'unique:backend_users,email,{:id}', 'max:190'],
'password' => [
'required_without:id',
'nullable',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'user_role' => ['required', 'exists:backend_roles,slug'],
'image' => ['mimes:jpeg,png'],
],
'update-password' => [
'password' => [
'required_without:id',
'nullable',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'image' => ['mimes:jpeg,png'],
],
];
}
| <?php
namespace Nodes\Backend\Models\User\Validation;
use Nodes\Validation\AbstractValidator;
/**
* Class UserValidation.
*/
class UserValidator extends AbstractValidator
{
/**
* Validation rules.
*
* @var array
*/
protected $rules = [
'create' => [
'name' => ['required'],
'email' => ['required', 'email', 'unique:backend_users,email,{:id}', 'max:190'],
'password' => [
'required_without:id',
+ 'nullable',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'user_role' => ['required', 'exists:backend_roles,slug'],
'image' => ['mimes:jpeg,png'],
],
'update-password' => [
'password' => [
'required_without:id',
+ 'nullable',
'min:8',
'confirmed',
'regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/'
],
'image' => ['mimes:jpeg,png'],
],
];
} | 2 | 0.05 | 2 | 0 |
2d19d2f97f9603eb96042f6a08154006847bd62d | backend/app/assets/javascripts/spree/backend/taxon_autocomplete.js | backend/app/assets/javascripts/spree/backend/taxon_autocomplete.js | 'use strict';
var set_taxon_select = function(selector){
if ($(selector).length > 0) {
$(selector).select2({
placeholder: Spree.translations.taxon_placeholder,
multiple: true,
initSelection: function (element, callback) {
var url = Spree.url(Spree.routes.taxons_search, {
ids: element.val(),
token: Spree.api_key
});
return $.getJSON(url, null, function (data) {
return callback(data['taxons']);
});
},
ajax: {
url: Spree.routes.taxons_search,
datatype: 'json',
data: function (term, page) {
return {
per_page: 50,
page: page,
without_children: true,
q: {
name_cont: term
},
token: Spree.api_key
};
},
results: function (data, page) {
var more = page < data.pages;
return {
results: data['taxons'],
more: more
};
}
},
formatResult: function (taxon) {
return taxon.pretty_name;
},
formatSelection: function (taxon) {
return taxon.pretty_name;
}
});
}
}
$(document).ready(function () {
set_taxon_select('#product_taxon_ids')
});
| 'use strict';
var set_taxon_select = function(selector){
if ($(selector).length > 0) {
$(selector).select2({
placeholder: Spree.translations.taxon_placeholder,
multiple: true,
initSelection: function (element, callback) {
var url = Spree.url(Spree.routes.taxons_search, {
ids: element.val(),
without_children: true,
token: Spree.api_key
});
return $.getJSON(url, null, function (data) {
return callback(data['taxons']);
});
},
ajax: {
url: Spree.routes.taxons_search,
datatype: 'json',
data: function (term, page) {
return {
per_page: 50,
page: page,
without_children: true,
q: {
name_cont: term
},
token: Spree.api_key
};
},
results: function (data, page) {
var more = page < data.pages;
return {
results: data['taxons'],
more: more
};
}
},
formatResult: function (taxon) {
return taxon.pretty_name;
},
formatSelection: function (taxon) {
return taxon.pretty_name;
}
});
}
}
$(document).ready(function () {
set_taxon_select('#product_taxon_ids')
});
| Increase perfs when loading a product's page | Increase perfs when loading a product's page | JavaScript | bsd-3-clause | zaeznet/spree,orenf/spree,imella/spree,CJMrozek/spree,lsirivong/spree,rajeevriitm/spree,gregoryrikson/spree-sample,robodisco/spree,calvinl/spree,joanblake/spree,gautamsawhney/spree,robodisco/spree,zaeznet/spree,jparr/spree,orenf/spree,volpejoaquin/spree,lyzxsc/spree,vinsol/spree,vinsol/spree,abhishekjain16/spree,wolfieorama/spree,vinayvinsol/spree,robodisco/spree,dafontaine/spree,patdec/spree,rakibulislam/spree,piousbox/spree,JDutil/spree,priyank-gupta/spree,priyank-gupta/spree,berkes/spree,joanblake/spree,gautamsawhney/spree,cutefrank/spree,abhishekjain16/spree,locomotivapro/spree,orenf/spree,priyank-gupta/spree,joanblake/spree,shekibobo/spree,DarkoP/spree,yiqing95/spree,vmatekole/spree,DarkoP/spree,gautamsawhney/spree,odk211/spree,shekibobo/spree,volpejoaquin/spree,lyzxsc/spree,azranel/spree,DarkoP/spree,TimurTarasenko/spree,piousbox/spree,softr8/spree,trigrass2/spree,dafontaine/spree,azranel/spree,lyzxsc/spree,dafontaine/spree,volpejoaquin/spree,jaspreet21anand/spree,CiscoCloud/spree,joanblake/spree,cutefrank/spree,patdec/spree,berkes/spree,patdec/spree,odk211/spree,brchristian/spree,shekibobo/spree,rakibulislam/spree,trigrass2/spree,JDutil/spree,pulkit21/spree,wolfieorama/spree,ayb/spree,CiscoCloud/spree,berkes/spree,karlitxo/spree,rakibulislam/spree,patdec/spree,wolfieorama/spree,TimurTarasenko/spree,berkes/spree,trigrass2/spree,calvinl/spree,locomotivapro/spree,pulkit21/spree,lsirivong/spree,maybii/spree,gautamsawhney/spree,softr8/spree,robodisco/spree,kewaunited/spree,CJMrozek/spree,karlitxo/spree,zaeznet/spree,rakibulislam/spree,orenf/spree,njerrywerry/spree,odk211/spree,kewaunited/spree,maybii/spree,jparr/spree,ayb/spree,lsirivong/spree,maybii/spree,ayb/spree,rajeevriitm/spree,gregoryrikson/spree-sample,TimurTarasenko/spree,FadliKun/spree,vmatekole/spree,brchristian/spree,yiqing95/spree,jaspreet21anand/spree,vinsol/spree,gregoryrikson/spree-sample,pulkit21/spree,calvinl/spree,brchristian/spree,DarkoP/spree,rajeevriitm/spree,dafontaine/spree,njerrywerry/spree,azranel/spree,volpejoaquin/spree,vmatekole/spree,brchristian/spree,CJMrozek/spree,vinayvinsol/spree,wolfieorama/spree,locomotivapro/spree,calvinl/spree,softr8/spree,softr8/spree,zaeznet/spree,vinayvinsol/spree,jaspreet21anand/spree,njerrywerry/spree,vinsol/spree,vinayvinsol/spree,JDutil/spree,trigrass2/spree,cutefrank/spree,siddharth28/spree,ayb/spree,TimurTarasenko/spree,maybii/spree,gregoryrikson/spree-sample,CJMrozek/spree,karlitxo/spree,azranel/spree,shekibobo/spree,yiqing95/spree,lyzxsc/spree,FadliKun/spree,priyank-gupta/spree,abhishekjain16/spree,yiqing95/spree,siddharth28/spree,jaspreet21anand/spree,kewaunited/spree,vmatekole/spree,siddharth28/spree,odk211/spree,njerrywerry/spree,CiscoCloud/spree,jparr/spree,JDutil/spree,karlitxo/spree,abhishekjain16/spree,CiscoCloud/spree,lsirivong/spree,piousbox/spree,pulkit21/spree,FadliKun/spree,cutefrank/spree,jparr/spree,siddharth28/spree,imella/spree,imella/spree,FadliKun/spree,kewaunited/spree,piousbox/spree,rajeevriitm/spree,locomotivapro/spree | javascript | ## Code Before:
'use strict';
var set_taxon_select = function(selector){
if ($(selector).length > 0) {
$(selector).select2({
placeholder: Spree.translations.taxon_placeholder,
multiple: true,
initSelection: function (element, callback) {
var url = Spree.url(Spree.routes.taxons_search, {
ids: element.val(),
token: Spree.api_key
});
return $.getJSON(url, null, function (data) {
return callback(data['taxons']);
});
},
ajax: {
url: Spree.routes.taxons_search,
datatype: 'json',
data: function (term, page) {
return {
per_page: 50,
page: page,
without_children: true,
q: {
name_cont: term
},
token: Spree.api_key
};
},
results: function (data, page) {
var more = page < data.pages;
return {
results: data['taxons'],
more: more
};
}
},
formatResult: function (taxon) {
return taxon.pretty_name;
},
formatSelection: function (taxon) {
return taxon.pretty_name;
}
});
}
}
$(document).ready(function () {
set_taxon_select('#product_taxon_ids')
});
## Instruction:
Increase perfs when loading a product's page
## Code After:
'use strict';
var set_taxon_select = function(selector){
if ($(selector).length > 0) {
$(selector).select2({
placeholder: Spree.translations.taxon_placeholder,
multiple: true,
initSelection: function (element, callback) {
var url = Spree.url(Spree.routes.taxons_search, {
ids: element.val(),
without_children: true,
token: Spree.api_key
});
return $.getJSON(url, null, function (data) {
return callback(data['taxons']);
});
},
ajax: {
url: Spree.routes.taxons_search,
datatype: 'json',
data: function (term, page) {
return {
per_page: 50,
page: page,
without_children: true,
q: {
name_cont: term
},
token: Spree.api_key
};
},
results: function (data, page) {
var more = page < data.pages;
return {
results: data['taxons'],
more: more
};
}
},
formatResult: function (taxon) {
return taxon.pretty_name;
},
formatSelection: function (taxon) {
return taxon.pretty_name;
}
});
}
}
$(document).ready(function () {
set_taxon_select('#product_taxon_ids')
});
| 'use strict';
var set_taxon_select = function(selector){
if ($(selector).length > 0) {
$(selector).select2({
placeholder: Spree.translations.taxon_placeholder,
multiple: true,
initSelection: function (element, callback) {
var url = Spree.url(Spree.routes.taxons_search, {
ids: element.val(),
+ without_children: true,
token: Spree.api_key
});
return $.getJSON(url, null, function (data) {
return callback(data['taxons']);
});
},
ajax: {
url: Spree.routes.taxons_search,
datatype: 'json',
data: function (term, page) {
return {
per_page: 50,
page: page,
without_children: true,
q: {
name_cont: term
},
token: Spree.api_key
};
},
results: function (data, page) {
var more = page < data.pages;
return {
results: data['taxons'],
more: more
};
}
},
formatResult: function (taxon) {
return taxon.pretty_name;
},
formatSelection: function (taxon) {
return taxon.pretty_name;
}
});
}
}
$(document).ready(function () {
set_taxon_select('#product_taxon_ids')
}); | 1 | 0.019608 | 1 | 0 |
21acd10f757a29dda085e3cc7c2dc27c5682db60 | src/modules/postgres/setup/10-06-2016.update.sql | src/modules/postgres/setup/10-06-2016.update.sql | UPDATE users SET updateTime = createtime where updatetime is null;
UPDATE items SET updateTime = createtime where updatetime is null
UPDATE rels SET updateTime = createtime where updatetime is null
ALTER TABLE users ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE items ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE rels ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
CREATE INDEX ON threads((parents[1]));
CREATE INDEX ON texts((parents[1]));
CREATE INDEX ON users((params->>'email'));
CREATE INDEX ON roomrels(presencetime);
CREATE INDEX ON roomrels("user");
CREATE INDEX ON roomrels using gin (roles);
CREATE INDEX ON roomrels(item);
| UPDATE users SET updateTime = createtime where updatetime is null;
UPDATE items SET updateTime = createtime where updatetime is null
UPDATE rels SET updateTime = createtime where updatetime is null
ALTER TABLE users ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE items ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE rels ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
CREATE INDEX ON threads((parents[1]));
CREATE INDEX ON threads(createtime);
CREATE INDEX ON texts((parents[1]));
CREATE INDEX ON users((params->>'email'));
CREATE INDEX ON roomrels(presencetime);
CREATE INDEX ON roomrels("user");
CREATE INDEX ON roomrels using gin (roles);
CREATE INDEX ON roomrels(item);
| Add index on thrads createtime | Add index on thrads createtime
| SQL | agpl-3.0 | belng/pure,belng/pure,belng/pure,scrollback/pure,scrollback/pure,belng/pure,scrollback/pure,scrollback/pure | sql | ## Code Before:
UPDATE users SET updateTime = createtime where updatetime is null;
UPDATE items SET updateTime = createtime where updatetime is null
UPDATE rels SET updateTime = createtime where updatetime is null
ALTER TABLE users ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE items ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE rels ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
CREATE INDEX ON threads((parents[1]));
CREATE INDEX ON texts((parents[1]));
CREATE INDEX ON users((params->>'email'));
CREATE INDEX ON roomrels(presencetime);
CREATE INDEX ON roomrels("user");
CREATE INDEX ON roomrels using gin (roles);
CREATE INDEX ON roomrels(item);
## Instruction:
Add index on thrads createtime
## Code After:
UPDATE users SET updateTime = createtime where updatetime is null;
UPDATE items SET updateTime = createtime where updatetime is null
UPDATE rels SET updateTime = createtime where updatetime is null
ALTER TABLE users ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE items ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE rels ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
CREATE INDEX ON threads((parents[1]));
CREATE INDEX ON threads(createtime);
CREATE INDEX ON texts((parents[1]));
CREATE INDEX ON users((params->>'email'));
CREATE INDEX ON roomrels(presencetime);
CREATE INDEX ON roomrels("user");
CREATE INDEX ON roomrels using gin (roles);
CREATE INDEX ON roomrels(item);
| UPDATE users SET updateTime = createtime where updatetime is null;
UPDATE items SET updateTime = createtime where updatetime is null
UPDATE rels SET updateTime = createtime where updatetime is null
ALTER TABLE users ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE items ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
ALTER TABLE rels ALTER COLUMN updatetime SET DEFAULT extract(epoch from now())*1000;
CREATE INDEX ON threads((parents[1]));
+ CREATE INDEX ON threads(createtime);
CREATE INDEX ON texts((parents[1]));
CREATE INDEX ON users((params->>'email'));
CREATE INDEX ON roomrels(presencetime);
CREATE INDEX ON roomrels("user");
CREATE INDEX ON roomrels using gin (roles);
CREATE INDEX ON roomrels(item); | 1 | 0.066667 | 1 | 0 |
ecdecaa1691128adc099c5873524f19a6d19fbc3 | templates/default/com.opscode.chef-client.plist.erb | templates/default/com.opscode.chef-client.plist.erb | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.opscode.chef-client</string>
<%- if @launchd_mode == "interval" %>
<key>Program</key>
<string><%= @client_bin %></string>
<key>StartInterval</key>
<integer><%= node["chef_client"]["interval"] %></integer>
<key>RunAtLoad</key>
<true/>
<%- else %>
<key>ProgramArguments</key>
<array>
<string><%= @client_bin %></string>
<string>-i <%= node["chef_client"]["interval"] %></string>
<string>-s <%= node["chef_client"]["splay"] %></string>
<% node["chef_client"]["daemon_options"].each do |option| -%>
<string><%= option %></string>
<% end -%>
</array>
<%- end %>
<key>UserName</key>
<string>root</string>
<key>StandardOutPath</key>
<string><%= node["chef_client"]["log_dir"] %>/client.log</string>
</dict>
</plist>
| <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.opscode.chef-client</string>
<%- if @launchd_mode == "interval" %>
<key>Program</key>
<string><%= @client_bin %></string>
<key>StartInterval</key>
<integer><%= node["chef_client"]["interval"] %></integer>
<key>RunAtLoad</key>
<true/>
<%- else %>
<key>ProgramArguments</key>
<array>
<string><%= @client_bin %></string>
<string>-i <%= node["chef_client"]["interval"] %></string>
<string>-s <%= node["chef_client"]["splay"] %></string>
<% node["chef_client"]["daemon_options"].each do |option| -%>
<string><%= option %></string>
<% end -%>
</array>
<key>KeepAlive</key>
<true/>
<%- end %>
<key>StandardOutPath</key>
<string><%= node["chef_client"]["log_dir"] %>/client.log</string>
</dict>
</plist>
| Add KeepAlive so that launchd will "daemonize" chef-client for us. | [COOK-4092] Add KeepAlive so that launchd will "daemonize" chef-client for us.
Signed-off-by: Sean OMeara <4025b808ec3cf11e3d5c9a1a3bd1e7c4003cb3a1@opscode.com>
| HTML+ERB | apache-2.0 | josephholsten/opscode-cookbooks-chef-client,fxlv/chef-client,juliandunn/chef-client,lamont/chef-client,mattray/chef-client,drrk/chef-client,GannettDigital/chef-client,burnzy/chef-client,chef-cookbooks/chef-client,juliandunn/chef-client,mateuszkwiatkowski/chef-client,burnzy/chef-client,michaelklishin/chef-client,scalp42/chef-client,wanelo-chef/chef-client,drrk/chef-client,michaelklishin/chef-client,drrk/chef-client,5apps-caboose/chef-client,GannettDigital/chef-client,philoserf/chef-client,gh2k/chef-client,criteo-forks/chef-client,timurb/chef-client,cachamber/chef-client-Solaris11_updates,cachamber/chef-client-Solaris11_updates,vkhatri/chef-client,dgivens/chef-client,cachamber/chef-client-Solaris11_updates,lamont/chef-client,rapid7-cookbooks/chef-client,5apps-caboose/chef-client,chef-cookbooks/chef-client,criteo-forks/chef-client,philoserf/chef-client,jedipunkz/chef-client,mateuszkwiatkowski/chef-client,philoserf/chef-client,GannettDigital/chef-client,chef-cookbooks/chef-client,pdf/chef-client,gh2k/chef-client,josephholsten/opscode-cookbooks-chef-client,5apps-caboose/chef-client,vinyar/chef-client,opscode-cookbooks/chef-client,micgo/chef-client,leoh0/chef-client,criteo-forks/chef-client,josephholsten/opscode-cookbooks-chef-client,gh2k/chef-client,scalp42/chef-client,burtlo/chef-client,burnzy/chef-client,evertrue/chef-client,juliandunn/chef-client,opscode-cookbooks/chef-client,lamont/chef-client,mattray/chef-client,scalp42/chef-client,michaelklishin/chef-client,mattray/chef-client,opscode-cookbooks/chef-client,mateuszkwiatkowski/chef-client | html+erb | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.opscode.chef-client</string>
<%- if @launchd_mode == "interval" %>
<key>Program</key>
<string><%= @client_bin %></string>
<key>StartInterval</key>
<integer><%= node["chef_client"]["interval"] %></integer>
<key>RunAtLoad</key>
<true/>
<%- else %>
<key>ProgramArguments</key>
<array>
<string><%= @client_bin %></string>
<string>-i <%= node["chef_client"]["interval"] %></string>
<string>-s <%= node["chef_client"]["splay"] %></string>
<% node["chef_client"]["daemon_options"].each do |option| -%>
<string><%= option %></string>
<% end -%>
</array>
<%- end %>
<key>UserName</key>
<string>root</string>
<key>StandardOutPath</key>
<string><%= node["chef_client"]["log_dir"] %>/client.log</string>
</dict>
</plist>
## Instruction:
[COOK-4092] Add KeepAlive so that launchd will "daemonize" chef-client for us.
Signed-off-by: Sean OMeara <4025b808ec3cf11e3d5c9a1a3bd1e7c4003cb3a1@opscode.com>
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.opscode.chef-client</string>
<%- if @launchd_mode == "interval" %>
<key>Program</key>
<string><%= @client_bin %></string>
<key>StartInterval</key>
<integer><%= node["chef_client"]["interval"] %></integer>
<key>RunAtLoad</key>
<true/>
<%- else %>
<key>ProgramArguments</key>
<array>
<string><%= @client_bin %></string>
<string>-i <%= node["chef_client"]["interval"] %></string>
<string>-s <%= node["chef_client"]["splay"] %></string>
<% node["chef_client"]["daemon_options"].each do |option| -%>
<string><%= option %></string>
<% end -%>
</array>
<key>KeepAlive</key>
<true/>
<%- end %>
<key>StandardOutPath</key>
<string><%= node["chef_client"]["log_dir"] %>/client.log</string>
</dict>
</plist>
| <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.opscode.chef-client</string>
<%- if @launchd_mode == "interval" %>
<key>Program</key>
<string><%= @client_bin %></string>
<key>StartInterval</key>
<integer><%= node["chef_client"]["interval"] %></integer>
<key>RunAtLoad</key>
<true/>
<%- else %>
<key>ProgramArguments</key>
<array>
<string><%= @client_bin %></string>
<string>-i <%= node["chef_client"]["interval"] %></string>
<string>-s <%= node["chef_client"]["splay"] %></string>
<% node["chef_client"]["daemon_options"].each do |option| -%>
<string><%= option %></string>
<% end -%>
</array>
+ <key>KeepAlive</key>
+ <true/>
<%- end %>
- <key>UserName</key>
- <string>root</string>
<key>StandardOutPath</key>
<string><%= node["chef_client"]["log_dir"] %>/client.log</string>
</dict>
</plist> | 4 | 0.125 | 2 | 2 |
2471588bbf385259974f9118ca2ad9250888ed38 | app/assets/javascripts/tandem/pages.js.coffee | app/assets/javascripts/tandem/pages.js.coffee |
$(document).ready ->
$('.page_link').colorbox
onCleanup: ->
location.reload()
if $('#tandem_page_links').length > 0
$('body').addClass('tandem-admin-bar')
$('.tandem_content').live
'mouseenter': ->
$('.tandem_toolbar', $(this)).fadeIn('slow')
'mouseleave': ->
$('.tandem_toolbar', $(this)).fadeOut('slow')
$('.tandem_content').live 'click', ->
$.fn.colorbox
href: $('.tandem_edit_link', $(this)).attr('href')
iframe: true
width: '80%'
height: '80%'
open: true
return false
reload_tandem_content = (resource_id,resource_url) ->
$.fn.colorbox.close()
resource_id = '#'+resource_id
$(resource_id).load resource_url+' '+resource_id, ->
bind_tandem_events($(resource_id))
|
$(document).ready ->
$('.page_link').colorbox
onCleanup: ->
location.reload()
if $('#tandem_page_links').length > 0
$('body').addClass('tandem-admin-bar')
$('div.tandem_content').on
'mouseenter': ->
$('div.tandem_toolbar', $(this)).fadeIn('slow')
'mouseleave': ->
$('div.tandem_toolbar', $(this)).fadeOut('slow')
'click': ->
$.fn.colorbox
href: $('a.tandem_edit_link', $(this)).attr('href')
iframe: true
width: '80%'
height: '80%'
open: true
return false
reload_tandem_content = (resource_id,resource_url) ->
$.fn.colorbox.close()
resource_id = '#'+resource_id
$(resource_id).load resource_url+' '+resource_id, ->
bind_tandem_events($(resource_id))
| Switch to using jQuery's on() function instead of live for tandem_content events. | Switch to using jQuery's on() function instead of live for tandem_content events. | CoffeeScript | mit | 12spokes/tandem,Quimbee/tandem,aaron/tandem,12spokes/tandem,Quimbee/tandem,aaron/tandem | coffeescript | ## Code Before:
$(document).ready ->
$('.page_link').colorbox
onCleanup: ->
location.reload()
if $('#tandem_page_links').length > 0
$('body').addClass('tandem-admin-bar')
$('.tandem_content').live
'mouseenter': ->
$('.tandem_toolbar', $(this)).fadeIn('slow')
'mouseleave': ->
$('.tandem_toolbar', $(this)).fadeOut('slow')
$('.tandem_content').live 'click', ->
$.fn.colorbox
href: $('.tandem_edit_link', $(this)).attr('href')
iframe: true
width: '80%'
height: '80%'
open: true
return false
reload_tandem_content = (resource_id,resource_url) ->
$.fn.colorbox.close()
resource_id = '#'+resource_id
$(resource_id).load resource_url+' '+resource_id, ->
bind_tandem_events($(resource_id))
## Instruction:
Switch to using jQuery's on() function instead of live for tandem_content events.
## Code After:
$(document).ready ->
$('.page_link').colorbox
onCleanup: ->
location.reload()
if $('#tandem_page_links').length > 0
$('body').addClass('tandem-admin-bar')
$('div.tandem_content').on
'mouseenter': ->
$('div.tandem_toolbar', $(this)).fadeIn('slow')
'mouseleave': ->
$('div.tandem_toolbar', $(this)).fadeOut('slow')
'click': ->
$.fn.colorbox
href: $('a.tandem_edit_link', $(this)).attr('href')
iframe: true
width: '80%'
height: '80%'
open: true
return false
reload_tandem_content = (resource_id,resource_url) ->
$.fn.colorbox.close()
resource_id = '#'+resource_id
$(resource_id).load resource_url+' '+resource_id, ->
bind_tandem_events($(resource_id))
|
$(document).ready ->
$('.page_link').colorbox
onCleanup: ->
location.reload()
if $('#tandem_page_links').length > 0
$('body').addClass('tandem-admin-bar')
- $('.tandem_content').live
? ^^^^
+ $('div.tandem_content').on
? +++ ^^
'mouseenter': ->
- $('.tandem_toolbar', $(this)).fadeIn('slow')
+ $('div.tandem_toolbar', $(this)).fadeIn('slow')
? +++
'mouseleave': ->
- $('.tandem_toolbar', $(this)).fadeOut('slow')
+ $('div.tandem_toolbar', $(this)).fadeOut('slow')
? +++
- $('.tandem_content').live 'click', ->
+ 'click': ->
- $.fn.colorbox
+ $.fn.colorbox
? ++
- href: $('.tandem_edit_link', $(this)).attr('href')
+ href: $('a.tandem_edit_link', $(this)).attr('href')
? ++ +
- iframe: true
+ iframe: true
? ++
- width: '80%'
+ width: '80%'
? ++
- height: '80%'
+ height: '80%'
? ++
- open: true
+ open: true
? ++
- return false
+ return false
? ++
reload_tandem_content = (resource_id,resource_url) ->
$.fn.colorbox.close()
resource_id = '#'+resource_id
$(resource_id).load resource_url+' '+resource_id, ->
bind_tandem_events($(resource_id)) | 22 | 0.733333 | 11 | 11 |
6635f7273d2792ce7164233678705b06f6ee4807 | ci/libindy-deb-build-and-upload.sh | ci/libindy-deb-build-and-upload.sh |
if [ "$1" = "--help" ] ; then
echo "Usage: $0 <commit> $1 <key> $2 <number>"
fi
commit="$1"
key="$2"
number="$3"
version=$(wget -q https://raw.githubusercontent.com/hyperledger/indy-sdk/$commit/libindy/Cargo.toml -O - | grep -E '^version =' | head -n1 | cut -f2 -d= | tr -d '" ')
[ -z $version ] && exit 1
[ -z $commit ] && exit 2
[ -z $key ] && exit 3
dpkg-buildpackage
cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key repo@192.168.11.111
mkdir /var/repository/repos/deb/indy-sdk
mkdir /var/repository/repos/deb/indy-sdk/$version-$number
cd /var/repository/repos/deb/indy-sdk/$version-$number
put -r /var/lib/jenkins/workspace/indy-sdk-dev_"$version"_amd64.deb
put -r /var/lib/jenkins/workspace/indy-sdk_"$version"_amd64.deb
ls -l /var/repository/repos/deb/indy-sdk/$version-$number
EOF
|
if [ "$1" = "--help" ] ; then
echo "Usage: $0 <commit> $1 <key> $2 <number>"
fi
commit="$1"
key="$2"
number="$3"
version=$(wget -q https://raw.githubusercontent.com/hyperledger/indy-sdk/$commit/libindy/Cargo.toml -O - | grep -E '^version =' | head -n1 | cut -f2 -d= | tr -d '" ')
[ -z $version ] && exit 1
[ -z $commit ] && exit 2
[ -z $key ] && exit 3
dpkg-buildpackage
cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key repo@192.168.11.111
mkdir /var/repository/repos/deb/indy-sdk
mkdir /var/repository/repos/deb/indy-sdk/$version-$number
cd /var/repository/repos/deb/indy-sdk/$version-$number
put -r ../indy-sdk-dev_"$version"_amd64.deb
put -r ../indy-sdk_"$version"_amd64.deb
ls -l /var/repository/repos/deb/indy-sdk/$version-$number
EOF
| Change source for uploading to relative paths. | Change source for uploading to relative paths.
| Shell | apache-2.0 | Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,peacekeeper/indy-sdk,korsimoro/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,korsimoro/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,korsimoro/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,srottem/indy-sdk,srottem/indy-sdk,korsimoro/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,Artemkaaas/indy-sdk,korsimoro/indy-sdk,anastasia-tarasova/indy-sdk,korsimoro/indy-sdk,Artemkaaas/indy-sdk,korsimoro/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,anastasia-tarasova/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,srottem/indy-sdk,peacekeeper/indy-sdk,korsimoro/indy-sdk,anastasia-tarasova/indy-sdk,anastasia-tarasova/indy-sdk,korsimoro/indy-sdk,anastasia-tarasova/indy-sdk,korsimoro/indy-sdk | shell | ## Code Before:
if [ "$1" = "--help" ] ; then
echo "Usage: $0 <commit> $1 <key> $2 <number>"
fi
commit="$1"
key="$2"
number="$3"
version=$(wget -q https://raw.githubusercontent.com/hyperledger/indy-sdk/$commit/libindy/Cargo.toml -O - | grep -E '^version =' | head -n1 | cut -f2 -d= | tr -d '" ')
[ -z $version ] && exit 1
[ -z $commit ] && exit 2
[ -z $key ] && exit 3
dpkg-buildpackage
cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key repo@192.168.11.111
mkdir /var/repository/repos/deb/indy-sdk
mkdir /var/repository/repos/deb/indy-sdk/$version-$number
cd /var/repository/repos/deb/indy-sdk/$version-$number
put -r /var/lib/jenkins/workspace/indy-sdk-dev_"$version"_amd64.deb
put -r /var/lib/jenkins/workspace/indy-sdk_"$version"_amd64.deb
ls -l /var/repository/repos/deb/indy-sdk/$version-$number
EOF
## Instruction:
Change source for uploading to relative paths.
## Code After:
if [ "$1" = "--help" ] ; then
echo "Usage: $0 <commit> $1 <key> $2 <number>"
fi
commit="$1"
key="$2"
number="$3"
version=$(wget -q https://raw.githubusercontent.com/hyperledger/indy-sdk/$commit/libindy/Cargo.toml -O - | grep -E '^version =' | head -n1 | cut -f2 -d= | tr -d '" ')
[ -z $version ] && exit 1
[ -z $commit ] && exit 2
[ -z $key ] && exit 3
dpkg-buildpackage
cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key repo@192.168.11.111
mkdir /var/repository/repos/deb/indy-sdk
mkdir /var/repository/repos/deb/indy-sdk/$version-$number
cd /var/repository/repos/deb/indy-sdk/$version-$number
put -r ../indy-sdk-dev_"$version"_amd64.deb
put -r ../indy-sdk_"$version"_amd64.deb
ls -l /var/repository/repos/deb/indy-sdk/$version-$number
EOF
|
if [ "$1" = "--help" ] ; then
echo "Usage: $0 <commit> $1 <key> $2 <number>"
fi
commit="$1"
key="$2"
number="$3"
version=$(wget -q https://raw.githubusercontent.com/hyperledger/indy-sdk/$commit/libindy/Cargo.toml -O - | grep -E '^version =' | head -n1 | cut -f2 -d= | tr -d '" ')
[ -z $version ] && exit 1
[ -z $commit ] && exit 2
[ -z $key ] && exit 3
dpkg-buildpackage
cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key repo@192.168.11.111
mkdir /var/repository/repos/deb/indy-sdk
mkdir /var/repository/repos/deb/indy-sdk/$version-$number
cd /var/repository/repos/deb/indy-sdk/$version-$number
- put -r /var/lib/jenkins/workspace/indy-sdk-dev_"$version"_amd64.deb
- put -r /var/lib/jenkins/workspace/indy-sdk_"$version"_amd64.deb
+ put -r ../indy-sdk-dev_"$version"_amd64.deb
+ put -r ../indy-sdk_"$version"_amd64.deb
ls -l /var/repository/repos/deb/indy-sdk/$version-$number
EOF | 4 | 0.16 | 2 | 2 |
491cd53204d081ef3de5291a453866ea3e931749 | README.md | README.md | GemStone.app
====
GemStone.app is a macOS application that manages GemStone/S 64 Bit application servers.
You can download a disk image (~800KB) with the latest version from [here](https://github.com/jgfoster/GemStoneApp/raw/master/GemStoneApp.dmg).
| GemStone.app
====
GemStone.app is a macOS application that manages GemStone/S 64 Bit application servers.
Read about this tool [here](https://programminggems.wordpress.com/2013/09/25/gemstone-on-the-macintosh/) and a 10-minute screencast is [here](https://www.youtube.com/watch?v=6Oz4RLcEWXs). You can download a disk image (~800KB) with the latest version from [here](https://github.com/jgfoster/GemStoneApp/raw/master/GemStoneApp.dmg).
| Add links to blog and video. | Add links to blog and video. | Markdown | mit | jgfoster/GemStoneApp,jgfoster/GemStoneApp,jgfoster/GemStoneApp | markdown | ## Code Before:
GemStone.app
====
GemStone.app is a macOS application that manages GemStone/S 64 Bit application servers.
You can download a disk image (~800KB) with the latest version from [here](https://github.com/jgfoster/GemStoneApp/raw/master/GemStoneApp.dmg).
## Instruction:
Add links to blog and video.
## Code After:
GemStone.app
====
GemStone.app is a macOS application that manages GemStone/S 64 Bit application servers.
Read about this tool [here](https://programminggems.wordpress.com/2013/09/25/gemstone-on-the-macintosh/) and a 10-minute screencast is [here](https://www.youtube.com/watch?v=6Oz4RLcEWXs). You can download a disk image (~800KB) with the latest version from [here](https://github.com/jgfoster/GemStoneApp/raw/master/GemStoneApp.dmg).
| GemStone.app
====
GemStone.app is a macOS application that manages GemStone/S 64 Bit application servers.
- You can download a disk image (~800KB) with the latest version from [here](https://github.com/jgfoster/GemStoneApp/raw/master/GemStoneApp.dmg).
+ Read about this tool [here](https://programminggems.wordpress.com/2013/09/25/gemstone-on-the-macintosh/) and a 10-minute screencast is [here](https://www.youtube.com/watch?v=6Oz4RLcEWXs). You can download a disk image (~800KB) with the latest version from [here](https://github.com/jgfoster/GemStoneApp/raw/master/GemStoneApp.dmg). | 2 | 0.333333 | 1 | 1 |
ea831eb679008f6ad8f819973f4f771cba291d46 | component-playground/public/index.html | component-playground/public/index.html | <html>
<head>
<meta charset="utf-8">
<title>React Component Playground</title>
<!-- Patreon font -->
<link href='http://fonts.googleapis.com/css?family=Lato:400,100,300,700,900,400italic'
rel='stylesheet'
type='text/css'>
</head>
<body>
<div id="component-playground"></div>
<script src="build/bundle.js"></script>
</body>
</html>
| <html>
<head>
<meta charset="utf-8">
<title>React Component Playground</title>
<!-- Patreon font -->
<link href='http://fonts.googleapis.com/css?family=Lato:400,100,100italic,300,300italic,400italic,500,700,700italic,900,900italic'
rel='stylesheet'
type='text/css'>
</head>
<body>
<div id="component-playground"></div>
<script src="build/bundle.js"></script>
</body>
</html>
| Update late font to match patreon_py | Update late font to match patreon_py
| HTML | mit | Patreon/cosmos,Patreon/cosmos | html | ## Code Before:
<html>
<head>
<meta charset="utf-8">
<title>React Component Playground</title>
<!-- Patreon font -->
<link href='http://fonts.googleapis.com/css?family=Lato:400,100,300,700,900,400italic'
rel='stylesheet'
type='text/css'>
</head>
<body>
<div id="component-playground"></div>
<script src="build/bundle.js"></script>
</body>
</html>
## Instruction:
Update late font to match patreon_py
## Code After:
<html>
<head>
<meta charset="utf-8">
<title>React Component Playground</title>
<!-- Patreon font -->
<link href='http://fonts.googleapis.com/css?family=Lato:400,100,100italic,300,300italic,400italic,500,700,700italic,900,900italic'
rel='stylesheet'
type='text/css'>
</head>
<body>
<div id="component-playground"></div>
<script src="build/bundle.js"></script>
</body>
</html>
| <html>
<head>
<meta charset="utf-8">
<title>React Component Playground</title>
<!-- Patreon font -->
- <link href='http://fonts.googleapis.com/css?family=Lato:400,100,300,700,900,400italic'
? ^ ^^^^
+ <link href='http://fonts.googleapis.com/css?family=Lato:400,100,100italic,300,300italic,400italic,500,700,700italic,900,900italic'
? ++++++++++ ^ ^^^^^^ ++++++++++++++++++++++++++++++++
rel='stylesheet'
type='text/css'>
</head>
<body>
<div id="component-playground"></div>
<script src="build/bundle.js"></script>
</body>
</html> | 2 | 0.142857 | 1 | 1 |
d9b0ee0e13462c8819ccc1688802219ad1b12197 | app/views/hovercard/challenges/_hovercard.html.erb | app/views/hovercard/challenges/_hovercard.html.erb | <%= render :layout => "hovercard/hovercard", :locals => { :object => @challenge, :photo => @challenge.main_photo } do %>
<h5><%= link_to @challenge.title, challenge_domain_url(@challenge) %></h5>
<p class="subtitle"></p>
<% state = challenge_status @challenge %>
<%= render "hovercard/data", :data => [
{ :text => pluralize(@challenge.submissions_count, "submission"), :class => "submissions" },
{ :text => "$#{@challenge.total_cash_value} in prizes", :class => "awards" },
{ :text => "#{state[:status]} — #{state[:time]}".html_safe, :class => "state" }
] %>
<% end %> | <% prize_value = number_to_currency(@challenge.prize_value || 0,
:unit => @challenge.currency_unit,
:format => @challenge.currency_format,
:precision => 0) %>
<%= render :layout => "hovercard/hovercard", :locals => { :object => @challenge, :photo => @challenge.main_photo } do %>
<h5><%= link_to @challenge.title, challenge_domain_url(@challenge) %></h5>
<p class="subtitle"></p>
<% state = challenge_status @challenge %>
<%= render "hovercard/data", :data => [
{ :text => pluralize(@challenge.submissions_count, "submission"), :class => "submissions" },
{ :text => "#{prize_value} in prizes", :class => "awards" },
{ :text => "#{state[:status]} — #{state[:time]}".html_safe, :class => "state" }
] %>
<% end %>
| Update prize to use challenge currency | Update prize to use challenge currency
| HTML+ERB | mit | challengepost/hovercard,challengepost/hovercard | html+erb | ## Code Before:
<%= render :layout => "hovercard/hovercard", :locals => { :object => @challenge, :photo => @challenge.main_photo } do %>
<h5><%= link_to @challenge.title, challenge_domain_url(@challenge) %></h5>
<p class="subtitle"></p>
<% state = challenge_status @challenge %>
<%= render "hovercard/data", :data => [
{ :text => pluralize(@challenge.submissions_count, "submission"), :class => "submissions" },
{ :text => "$#{@challenge.total_cash_value} in prizes", :class => "awards" },
{ :text => "#{state[:status]} — #{state[:time]}".html_safe, :class => "state" }
] %>
<% end %>
## Instruction:
Update prize to use challenge currency
## Code After:
<% prize_value = number_to_currency(@challenge.prize_value || 0,
:unit => @challenge.currency_unit,
:format => @challenge.currency_format,
:precision => 0) %>
<%= render :layout => "hovercard/hovercard", :locals => { :object => @challenge, :photo => @challenge.main_photo } do %>
<h5><%= link_to @challenge.title, challenge_domain_url(@challenge) %></h5>
<p class="subtitle"></p>
<% state = challenge_status @challenge %>
<%= render "hovercard/data", :data => [
{ :text => pluralize(@challenge.submissions_count, "submission"), :class => "submissions" },
{ :text => "#{prize_value} in prizes", :class => "awards" },
{ :text => "#{state[:status]} — #{state[:time]}".html_safe, :class => "state" }
] %>
<% end %>
| + <% prize_value = number_to_currency(@challenge.prize_value || 0,
+ :unit => @challenge.currency_unit,
+ :format => @challenge.currency_format,
+ :precision => 0) %>
+
<%= render :layout => "hovercard/hovercard", :locals => { :object => @challenge, :photo => @challenge.main_photo } do %>
<h5><%= link_to @challenge.title, challenge_domain_url(@challenge) %></h5>
<p class="subtitle"></p>
<% state = challenge_status @challenge %>
<%= render "hovercard/data", :data => [
{ :text => pluralize(@challenge.submissions_count, "submission"), :class => "submissions" },
- { :text => "$#{@challenge.total_cash_value} in prizes", :class => "awards" },
? - ^^^^^^ --------------
+ { :text => "#{prize_value} in prizes", :class => "awards" },
? ^^^^
{ :text => "#{state[:status]} — #{state[:time]}".html_safe, :class => "state" }
] %>
<% end %> | 7 | 0.7 | 6 | 1 |
9eb8c655c6367b5776991f764f75db09899ded21 | lib/smart_answer_flows/coronavirus-employee-risk-assessment/outcomes/_come_back.erb | lib/smart_answer_flows/coronavirus-employee-risk-assessment/outcomes/_come_back.erb | You should come back and use this service again to check the latest guidance if your circumstances change (for example, when your employer asks you to return to work) as new rules may be decided.
| You should come back and use this service again to check the latest guidance if your circumstances change as new rules may be decided.
| Remove example from return to service prompt on outcome pages | Remove example from return to service prompt on outcome pages
This is to simplify content in the coronavirus employee risk assessment.
| HTML+ERB | mit | alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers | html+erb | ## Code Before:
You should come back and use this service again to check the latest guidance if your circumstances change (for example, when your employer asks you to return to work) as new rules may be decided.
## Instruction:
Remove example from return to service prompt on outcome pages
This is to simplify content in the coronavirus employee risk assessment.
## Code After:
You should come back and use this service again to check the latest guidance if your circumstances change as new rules may be decided.
| - You should come back and use this service again to check the latest guidance if your circumstances change (for example, when your employer asks you to return to work) as new rules may be decided.
? -------------------------------------------------------------
+ You should come back and use this service again to check the latest guidance if your circumstances change as new rules may be decided. | 2 | 2 | 1 | 1 |
b385e8a595ed7334f9bc482f990129b29f4e825b | bokehjs/src/coffee/config.coffee | bokehjs/src/coffee/config.coffee | require.config
paths:
jquery: "vendor/jquery/jquery"
jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui"
jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel"
jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min"
handsontable: "vendor/handsontable/jquery.handsontable"
numeral: "vendor/numeral/numeral"
underscore: "vendor/underscore-amd/underscore"
backbone: "vendor/backbone-amd/backbone"
bootstrap: "vendor/bootstrap-3.1.1/js"
modal: "vendor/bootstrap/modal"
timezone: "vendor/timezone/src/timezone"
sprintf: "vendor/sprintf/src/sprintf"
rbush: "vendor/rbush/rbush"
jstree: "vendor/jstree/dist/jstree"
shim:
sprintf:
exports: 'sprintf'
handsontable:
deps: ["numeral"]
exports: "$.fn.handsontable"
jqrangeslider:
deps: ["jquery_ui/core", "jquery_ui/widget", "jquery_mousewheel"]
exports: "$.fn.rangeSlider"
| require.config
paths:
jquery: "vendor/jquery/jquery"
jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui"
jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel"
jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min"
handsontable: "vendor/handsontable/jquery.handsontable"
numeral: "vendor/numeral/numeral"
underscore: "vendor/underscore-amd/underscore"
backbone: "vendor/backbone-amd/backbone"
bootstrap: "vendor/bootstrap-3.1.1/js"
modal: "vendor/bootstrap/modal"
timezone: "vendor/timezone/src/timezone"
sprintf: "vendor/sprintf/src/sprintf"
rbush: "vendor/rbush/rbush"
jstree: "vendor/jstree/dist/jstree"
shim:
sprintf:
exports: 'sprintf'
handsontable:
deps: ["numeral"]
exports: "$.fn.handsontable"
jqrangeslider:
deps: ["jquery_ui/core", "jquery_ui/widget", "jquery_ui/mouse", "jquery_mousewheel"]
exports: "$.fn.rangeSlider"
| Add jquery_ui/mouse to jqrangeslider's dependencies | Add jquery_ui/mouse to jqrangeslider's dependencies
| CoffeeScript | bsd-3-clause | philippjfr/bokeh,jplourenco/bokeh,phobson/bokeh,srinathv/bokeh,PythonCharmers/bokeh,carlvlewis/bokeh,jplourenco/bokeh,josherick/bokeh,timsnyder/bokeh,awanke/bokeh,saifrahmed/bokeh,evidation-health/bokeh,saifrahmed/bokeh,ericmjl/bokeh,rhiever/bokeh,ahmadia/bokeh,htygithub/bokeh,Karel-van-de-Plassche/bokeh,aiguofer/bokeh,rs2/bokeh,alan-unravel/bokeh,bokeh/bokeh,rhiever/bokeh,ericmjl/bokeh,bsipocz/bokeh,justacec/bokeh,deeplook/bokeh,abele/bokeh,daodaoliang/bokeh,azjps/bokeh,DuCorey/bokeh,aavanian/bokeh,clairetang6/bokeh,akloster/bokeh,CrazyGuo/bokeh,laurent-george/bokeh,sahat/bokeh,akloster/bokeh,muku42/bokeh,srinathv/bokeh,paultcochrane/bokeh,awanke/bokeh,deeplook/bokeh,bsipocz/bokeh,alan-unravel/bokeh,eteq/bokeh,jplourenco/bokeh,PythonCharmers/bokeh,percyfal/bokeh,timsnyder/bokeh,timothydmorton/bokeh,gpfreitas/bokeh,aavanian/bokeh,dennisobrien/bokeh,alan-unravel/bokeh,ahmadia/bokeh,schoolie/bokeh,aiguofer/bokeh,stuart-knock/bokeh,ptitjano/bokeh,rothnic/bokeh,saifrahmed/bokeh,CrazyGuo/bokeh,abele/bokeh,khkaminska/bokeh,KasperPRasmussen/bokeh,htygithub/bokeh,PythonCharmers/bokeh,ChinaQuants/bokeh,matbra/bokeh,Karel-van-de-Plassche/bokeh,KasperPRasmussen/bokeh,timsnyder/bokeh,gpfreitas/bokeh,dennisobrien/bokeh,draperjames/bokeh,josherick/bokeh,mutirri/bokeh,bokeh/bokeh,stuart-knock/bokeh,muku42/bokeh,ptitjano/bokeh,deeplook/bokeh,quasiben/bokeh,mindriot101/bokeh,rothnic/bokeh,azjps/bokeh,mindriot101/bokeh,maxalbert/bokeh,sahat/bokeh,bokeh/bokeh,matbra/bokeh,xguse/bokeh,phobson/bokeh,carlvlewis/bokeh,htygithub/bokeh,alan-unravel/bokeh,eteq/bokeh,msarahan/bokeh,lukebarnard1/bokeh,ChristosChristofidis/bokeh,caseyclements/bokeh,jakirkham/bokeh,satishgoda/bokeh,laurent-george/bokeh,stonebig/bokeh,rhiever/bokeh,aiguofer/bokeh,phobson/bokeh,laurent-george/bokeh,percyfal/bokeh,Karel-van-de-Plassche/bokeh,PythonCharmers/bokeh,xguse/bokeh,muku42/bokeh,ChinaQuants/bokeh,paultcochrane/bokeh,canavandl/bokeh,ptitjano/bokeh,caseyclements/bokeh,schoolie/bokeh,rs2/bokeh,stonebig/bokeh,msarahan/bokeh,carlvlewis/bokeh,evidation-health/bokeh,aiguofer/bokeh,daodaoliang/bokeh,stonebig/bokeh,eteq/bokeh,khkaminska/bokeh,justacec/bokeh,roxyboy/bokeh,maxalbert/bokeh,gpfreitas/bokeh,josherick/bokeh,philippjfr/bokeh,dennisobrien/bokeh,jakirkham/bokeh,akloster/bokeh,satishgoda/bokeh,paultcochrane/bokeh,muku42/bokeh,stuart-knock/bokeh,schoolie/bokeh,justacec/bokeh,DuCorey/bokeh,evidation-health/bokeh,bokeh/bokeh,khkaminska/bokeh,ericdill/bokeh,birdsarah/bokeh,tacaswell/bokeh,lukebarnard1/bokeh,DuCorey/bokeh,roxyboy/bokeh,rs2/bokeh,percyfal/bokeh,bokeh/bokeh,quasiben/bokeh,caseyclements/bokeh,tacaswell/bokeh,satishgoda/bokeh,ptitjano/bokeh,draperjames/bokeh,azjps/bokeh,rhiever/bokeh,xguse/bokeh,ericdill/bokeh,almarklein/bokeh,ahmadia/bokeh,dennisobrien/bokeh,clairetang6/bokeh,philippjfr/bokeh,abele/bokeh,daodaoliang/bokeh,aavanian/bokeh,awanke/bokeh,gpfreitas/bokeh,jplourenco/bokeh,azjps/bokeh,mutirri/bokeh,htygithub/bokeh,msarahan/bokeh,draperjames/bokeh,lukebarnard1/bokeh,mutirri/bokeh,rs2/bokeh,phobson/bokeh,ericmjl/bokeh,deeplook/bokeh,bsipocz/bokeh,dennisobrien/bokeh,clairetang6/bokeh,clairetang6/bokeh,srinathv/bokeh,rothnic/bokeh,abele/bokeh,canavandl/bokeh,timothydmorton/bokeh,saifrahmed/bokeh,ChinaQuants/bokeh,laurent-george/bokeh,msarahan/bokeh,bsipocz/bokeh,ericmjl/bokeh,timothydmorton/bokeh,paultcochrane/bokeh,eteq/bokeh,caseyclements/bokeh,timothydmorton/bokeh,ericdill/bokeh,justacec/bokeh,stuart-knock/bokeh,matbra/bokeh,khkaminska/bokeh,almarklein/bokeh,percyfal/bokeh,aavanian/bokeh,ptitjano/bokeh,srinathv/bokeh,DuCorey/bokeh,CrazyGuo/bokeh,tacaswell/bokeh,lukebarnard1/bokeh,quasiben/bokeh,carlvlewis/bokeh,KasperPRasmussen/bokeh,canavandl/bokeh,azjps/bokeh,timsnyder/bokeh,awanke/bokeh,xguse/bokeh,ahmadia/bokeh,aavanian/bokeh,philippjfr/bokeh,maxalbert/bokeh,tacaswell/bokeh,rs2/bokeh,roxyboy/bokeh,phobson/bokeh,canavandl/bokeh,ericmjl/bokeh,CrazyGuo/bokeh,roxyboy/bokeh,draperjames/bokeh,birdsarah/bokeh,maxalbert/bokeh,sahat/bokeh,Karel-van-de-Plassche/bokeh,birdsarah/bokeh,matbra/bokeh,DuCorey/bokeh,ChristosChristofidis/bokeh,KasperPRasmussen/bokeh,birdsarah/bokeh,mindriot101/bokeh,mindriot101/bokeh,evidation-health/bokeh,aiguofer/bokeh,akloster/bokeh,timsnyder/bokeh,philippjfr/bokeh,KasperPRasmussen/bokeh,schoolie/bokeh,daodaoliang/bokeh,percyfal/bokeh,ericdill/bokeh,rothnic/bokeh,jakirkham/bokeh,ChinaQuants/bokeh,ChristosChristofidis/bokeh,Karel-van-de-Plassche/bokeh,jakirkham/bokeh,stonebig/bokeh,jakirkham/bokeh,ChristosChristofidis/bokeh,schoolie/bokeh,josherick/bokeh,almarklein/bokeh,satishgoda/bokeh,mutirri/bokeh,draperjames/bokeh | coffeescript | ## Code Before:
require.config
paths:
jquery: "vendor/jquery/jquery"
jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui"
jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel"
jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min"
handsontable: "vendor/handsontable/jquery.handsontable"
numeral: "vendor/numeral/numeral"
underscore: "vendor/underscore-amd/underscore"
backbone: "vendor/backbone-amd/backbone"
bootstrap: "vendor/bootstrap-3.1.1/js"
modal: "vendor/bootstrap/modal"
timezone: "vendor/timezone/src/timezone"
sprintf: "vendor/sprintf/src/sprintf"
rbush: "vendor/rbush/rbush"
jstree: "vendor/jstree/dist/jstree"
shim:
sprintf:
exports: 'sprintf'
handsontable:
deps: ["numeral"]
exports: "$.fn.handsontable"
jqrangeslider:
deps: ["jquery_ui/core", "jquery_ui/widget", "jquery_mousewheel"]
exports: "$.fn.rangeSlider"
## Instruction:
Add jquery_ui/mouse to jqrangeslider's dependencies
## Code After:
require.config
paths:
jquery: "vendor/jquery/jquery"
jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui"
jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel"
jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min"
handsontable: "vendor/handsontable/jquery.handsontable"
numeral: "vendor/numeral/numeral"
underscore: "vendor/underscore-amd/underscore"
backbone: "vendor/backbone-amd/backbone"
bootstrap: "vendor/bootstrap-3.1.1/js"
modal: "vendor/bootstrap/modal"
timezone: "vendor/timezone/src/timezone"
sprintf: "vendor/sprintf/src/sprintf"
rbush: "vendor/rbush/rbush"
jstree: "vendor/jstree/dist/jstree"
shim:
sprintf:
exports: 'sprintf'
handsontable:
deps: ["numeral"]
exports: "$.fn.handsontable"
jqrangeslider:
deps: ["jquery_ui/core", "jquery_ui/widget", "jquery_ui/mouse", "jquery_mousewheel"]
exports: "$.fn.rangeSlider"
| require.config
paths:
jquery: "vendor/jquery/jquery"
jquery_ui: "vendor/jquery-ui-amd/jquery-ui-1.10.0/jqueryui"
jquery_mousewheel: "vendor/jquery-mousewheel/jquery.mousewheel"
jqrangeslider: "vendor/jqrangeslider/jQAllRangeSliders-withRuler-min"
handsontable: "vendor/handsontable/jquery.handsontable"
numeral: "vendor/numeral/numeral"
underscore: "vendor/underscore-amd/underscore"
backbone: "vendor/backbone-amd/backbone"
bootstrap: "vendor/bootstrap-3.1.1/js"
modal: "vendor/bootstrap/modal"
timezone: "vendor/timezone/src/timezone"
sprintf: "vendor/sprintf/src/sprintf"
rbush: "vendor/rbush/rbush"
jstree: "vendor/jstree/dist/jstree"
shim:
sprintf:
exports: 'sprintf'
handsontable:
deps: ["numeral"]
exports: "$.fn.handsontable"
jqrangeslider:
- deps: ["jquery_ui/core", "jquery_ui/widget", "jquery_mousewheel"]
+ deps: ["jquery_ui/core", "jquery_ui/widget", "jquery_ui/mouse", "jquery_mousewheel"]
? +++++++++++++++++++
exports: "$.fn.rangeSlider" | 2 | 0.08 | 1 | 1 |
4114443db6e0a68e40a0e9a02b3292f0e3a267a9 | server/controllers/list/get-list-subscribers.js | server/controllers/list/get-list-subscribers.js | const list = require('../../models').list;
const listsubscriber = require('../../models').listsubscriber;
module.exports = (req, res) => {
// Find all subscribers belonging to a list
const userId = req.user.id;
const listId = req.query.listId;
list.findOne({
where: {
userId,
id: listId
},
attributes: ['name', 'createdAt', 'updatedAt'],
raw: true
}).then(instancesArray => {
if (!instancesArray) {
res.status(401) //??
.send({
message: 'not authorised to view list or list does not exist'
});
return;
} else {
listsubscriber.findAll({
where: { listId },
attributes: ['email', 'subscribed', 'createdAt', 'updatedAt'],
raw: true
}).then(instancesArray => {
res.send({ subscribers: instancesArray });
});
}
});
};
| const list = require('../../models').list;
const listsubscriber = require('../../models').listsubscriber;
module.exports = (req, res) => {
// Find all subscribers belonging to a list
const userId = req.user.id;
const listId = req.query.listId;
list.findOne({
where: {
userId,
id: listId
},
attributes: ['name', 'createdAt', 'updatedAt'],
raw: true
}).then(instancesArray => {
if (!instancesArray) {
res.status(401) //??
.send({
message: 'not authorised to view list or list does not exist'
});
return;
} else {
listsubscriber.findAll({
where: { listId },
attributes: ['email', 'subscribed', 'createdAt', 'updatedAt', 'mostRecentStatus'],
raw: true
}).then(instancesArray => {
res.send({ subscribers: instancesArray });
});
}
});
};
| Send most recent status in GET list-subscribers | Send most recent status in GET list-subscribers
| JavaScript | bsd-3-clause | karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good | javascript | ## Code Before:
const list = require('../../models').list;
const listsubscriber = require('../../models').listsubscriber;
module.exports = (req, res) => {
// Find all subscribers belonging to a list
const userId = req.user.id;
const listId = req.query.listId;
list.findOne({
where: {
userId,
id: listId
},
attributes: ['name', 'createdAt', 'updatedAt'],
raw: true
}).then(instancesArray => {
if (!instancesArray) {
res.status(401) //??
.send({
message: 'not authorised to view list or list does not exist'
});
return;
} else {
listsubscriber.findAll({
where: { listId },
attributes: ['email', 'subscribed', 'createdAt', 'updatedAt'],
raw: true
}).then(instancesArray => {
res.send({ subscribers: instancesArray });
});
}
});
};
## Instruction:
Send most recent status in GET list-subscribers
## Code After:
const list = require('../../models').list;
const listsubscriber = require('../../models').listsubscriber;
module.exports = (req, res) => {
// Find all subscribers belonging to a list
const userId = req.user.id;
const listId = req.query.listId;
list.findOne({
where: {
userId,
id: listId
},
attributes: ['name', 'createdAt', 'updatedAt'],
raw: true
}).then(instancesArray => {
if (!instancesArray) {
res.status(401) //??
.send({
message: 'not authorised to view list or list does not exist'
});
return;
} else {
listsubscriber.findAll({
where: { listId },
attributes: ['email', 'subscribed', 'createdAt', 'updatedAt', 'mostRecentStatus'],
raw: true
}).then(instancesArray => {
res.send({ subscribers: instancesArray });
});
}
});
};
| const list = require('../../models').list;
const listsubscriber = require('../../models').listsubscriber;
module.exports = (req, res) => {
// Find all subscribers belonging to a list
const userId = req.user.id;
const listId = req.query.listId;
list.findOne({
where: {
userId,
id: listId
},
attributes: ['name', 'createdAt', 'updatedAt'],
raw: true
}).then(instancesArray => {
if (!instancesArray) {
res.status(401) //??
.send({
message: 'not authorised to view list or list does not exist'
});
return;
} else {
listsubscriber.findAll({
where: { listId },
- attributes: ['email', 'subscribed', 'createdAt', 'updatedAt'],
+ attributes: ['email', 'subscribed', 'createdAt', 'updatedAt', 'mostRecentStatus'],
? ++++++++++++++++++++
raw: true
}).then(instancesArray => {
res.send({ subscribers: instancesArray });
});
}
});
}; | 2 | 0.060606 | 1 | 1 |
7fc2d1c81b4c72d171c7ccde3c75c87df841db64 | metadata.rb | metadata.rb | name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs git and/or sets up a Git server daemon'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.5.0'
recipe 'git', 'Installs git'
recipe 'git::server', 'Sets up a runit_service for git daemon'
recipe 'git::source', 'Installs git from source'
supports 'amazon'
supports 'arch'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x', '>= 10.6.0'
supports 'omnios'
supports 'oracle'
supports 'redhat'
supports 'smartos'
supports 'scientific'
supports 'ubuntu'
supports 'windows'
depends 'build-essential'
depends 'dmg'
depends 'windows'
depends 'yum-epel'
source_url 'https://github.com/chef-cookbooks/git' if respond_to?(:source_url)
issues_url 'https://github.com/chef-cookbooks/git/issues' if respond_to?(:issues_url)
| name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs git and/or sets up a Git server daemon'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.5.0'
recipe 'git', 'Installs git'
recipe 'git::server', 'Sets up a runit_service for git daemon'
recipe 'git::source', 'Installs git from source'
supports 'amazon'
supports 'arch'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x', '>= 10.6.0'
supports 'omnios'
supports 'oracle'
supports 'redhat'
supports 'smartos'
supports 'scientific'
supports 'suse'
supports 'opensuse'
supports 'opensuseleap'
supports 'ubuntu'
supports 'windows'
depends 'build-essential'
depends 'dmg'
depends 'windows'
depends 'yum-epel'
source_url 'https://github.com/chef-cookbooks/git' if respond_to?(:source_url)
issues_url 'https://github.com/chef-cookbooks/git/issues' if respond_to?(:issues_url)
| Add suse to the readme | Add suse to the readme
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
| Ruby | apache-2.0 | protec-cookbooks/git,jssjr/git,jssjr/git,chef-cookbooks/git,protec-cookbooks/git,chef-cookbooks/git,jssjr/git,protec-cookbooks/git | ruby | ## Code Before:
name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs git and/or sets up a Git server daemon'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.5.0'
recipe 'git', 'Installs git'
recipe 'git::server', 'Sets up a runit_service for git daemon'
recipe 'git::source', 'Installs git from source'
supports 'amazon'
supports 'arch'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x', '>= 10.6.0'
supports 'omnios'
supports 'oracle'
supports 'redhat'
supports 'smartos'
supports 'scientific'
supports 'ubuntu'
supports 'windows'
depends 'build-essential'
depends 'dmg'
depends 'windows'
depends 'yum-epel'
source_url 'https://github.com/chef-cookbooks/git' if respond_to?(:source_url)
issues_url 'https://github.com/chef-cookbooks/git/issues' if respond_to?(:issues_url)
## Instruction:
Add suse to the readme
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
## Code After:
name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs git and/or sets up a Git server daemon'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.5.0'
recipe 'git', 'Installs git'
recipe 'git::server', 'Sets up a runit_service for git daemon'
recipe 'git::source', 'Installs git from source'
supports 'amazon'
supports 'arch'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x', '>= 10.6.0'
supports 'omnios'
supports 'oracle'
supports 'redhat'
supports 'smartos'
supports 'scientific'
supports 'suse'
supports 'opensuse'
supports 'opensuseleap'
supports 'ubuntu'
supports 'windows'
depends 'build-essential'
depends 'dmg'
depends 'windows'
depends 'yum-epel'
source_url 'https://github.com/chef-cookbooks/git' if respond_to?(:source_url)
issues_url 'https://github.com/chef-cookbooks/git/issues' if respond_to?(:issues_url)
| name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs git and/or sets up a Git server daemon'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.5.0'
recipe 'git', 'Installs git'
recipe 'git::server', 'Sets up a runit_service for git daemon'
recipe 'git::source', 'Installs git from source'
supports 'amazon'
supports 'arch'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x', '>= 10.6.0'
supports 'omnios'
supports 'oracle'
supports 'redhat'
supports 'smartos'
supports 'scientific'
+ supports 'suse'
+ supports 'opensuse'
+ supports 'opensuseleap'
supports 'ubuntu'
supports 'windows'
depends 'build-essential'
depends 'dmg'
depends 'windows'
depends 'yum-epel'
source_url 'https://github.com/chef-cookbooks/git' if respond_to?(:source_url)
issues_url 'https://github.com/chef-cookbooks/git/issues' if respond_to?(:issues_url) | 3 | 0.090909 | 3 | 0 |
08ec212b6903bd8ba28206dd44525aef37756976 | app/system/trigger/impl/push.coffee | app/system/trigger/impl/push.coffee |
Bacon = require 'baconjs'
router = require '../../../router'
module.exports = (config) ->
bus = new Bacon.Bus
url = if config.url? then "/repo/poll/#{url}" else '/repo/poll'
router.api.post url, (req, res) -> bus.push reason: "request from #{req.ip}"
bus.toEventStream()
|
Bacon = require 'baconjs'
router = require '../../../router'
module.exports = (config) ->
bus = new Bacon.Bus
url = if config.url? then "/repo/poll/#{url}" else '/repo/poll'
router.api.post url, (req, res) ->
bus.push reason: "request from #{req.ip}"
res.sendStatus 202
bus.toEventStream()
| Make sure `/repo/poll` endpoint sends a response | Make sure `/repo/poll` endpoint sends a response
| CoffeeScript | mit | baffles/awesome-build | coffeescript | ## Code Before:
Bacon = require 'baconjs'
router = require '../../../router'
module.exports = (config) ->
bus = new Bacon.Bus
url = if config.url? then "/repo/poll/#{url}" else '/repo/poll'
router.api.post url, (req, res) -> bus.push reason: "request from #{req.ip}"
bus.toEventStream()
## Instruction:
Make sure `/repo/poll` endpoint sends a response
## Code After:
Bacon = require 'baconjs'
router = require '../../../router'
module.exports = (config) ->
bus = new Bacon.Bus
url = if config.url? then "/repo/poll/#{url}" else '/repo/poll'
router.api.post url, (req, res) ->
bus.push reason: "request from #{req.ip}"
res.sendStatus 202
bus.toEventStream()
|
Bacon = require 'baconjs'
router = require '../../../router'
module.exports = (config) ->
bus = new Bacon.Bus
url = if config.url? then "/repo/poll/#{url}" else '/repo/poll'
- router.api.post url, (req, res) -> bus.push reason: "request from #{req.ip}"
+ router.api.post url, (req, res) ->
+ bus.push reason: "request from #{req.ip}"
+ res.sendStatus 202
bus.toEventStream() | 4 | 0.363636 | 3 | 1 |
8c97ed12b9c3e18fe355fd2e0b65f01ae66d45b4 | app/src/main/java/com/oxapps/tradenotifications/NotificationDeleteReceiver.java | app/src/main/java/com/oxapps/tradenotifications/NotificationDeleteReceiver.java | package com.oxapps.tradenotifications;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
public class NotificationDeleteReceiver extends BroadcastReceiver {
private static final String TRADE_OFFERS_URL = "https://steamcommunity.com/id/id/tradeoffers/";
@Override
public void onReceive(Context context, Intent intent) {
long newRequestTime = System.currentTimeMillis() / 1000;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
editor.putLong(BackgroundIntentService.LAST_DELETE_KEY, newRequestTime);
editor.apply();
if(intent.hasExtra(BackgroundIntentService.NOTIFICATION_CLICKED)) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW);
browserIntent.setData(Uri.parse(TRADE_OFFERS_URL));
context.getApplicationContext().startActivity(browserIntent);
}
}
}
| package com.oxapps.tradenotifications;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
public class NotificationDeleteReceiver extends BroadcastReceiver {
private static final String TRADE_OFFERS_URL = "https://steamcommunity.com/id/id/tradeoffers/";
@Override
public void onReceive(Context context, Intent intent) {
long newRequestTime = System.currentTimeMillis() / 1000;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
editor.putLong(BackgroundIntentService.LAST_DELETE_KEY, newRequestTime);
editor.apply();
if(intent.hasExtra(BackgroundIntentService.NOTIFICATION_CLICKED)) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW);
browserIntent.setData(Uri.parse(TRADE_OFFERS_URL));
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.getApplicationContext().startActivity(browserIntent);
}
}
}
| Fix bug causing app to crash on clicking notification | Fix bug causing app to crash on clicking notification
| Java | apache-2.0 | Flozzo/Trade-Notifications-for-Steam | java | ## Code Before:
package com.oxapps.tradenotifications;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
public class NotificationDeleteReceiver extends BroadcastReceiver {
private static final String TRADE_OFFERS_URL = "https://steamcommunity.com/id/id/tradeoffers/";
@Override
public void onReceive(Context context, Intent intent) {
long newRequestTime = System.currentTimeMillis() / 1000;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
editor.putLong(BackgroundIntentService.LAST_DELETE_KEY, newRequestTime);
editor.apply();
if(intent.hasExtra(BackgroundIntentService.NOTIFICATION_CLICKED)) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW);
browserIntent.setData(Uri.parse(TRADE_OFFERS_URL));
context.getApplicationContext().startActivity(browserIntent);
}
}
}
## Instruction:
Fix bug causing app to crash on clicking notification
## Code After:
package com.oxapps.tradenotifications;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
public class NotificationDeleteReceiver extends BroadcastReceiver {
private static final String TRADE_OFFERS_URL = "https://steamcommunity.com/id/id/tradeoffers/";
@Override
public void onReceive(Context context, Intent intent) {
long newRequestTime = System.currentTimeMillis() / 1000;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
editor.putLong(BackgroundIntentService.LAST_DELETE_KEY, newRequestTime);
editor.apply();
if(intent.hasExtra(BackgroundIntentService.NOTIFICATION_CLICKED)) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW);
browserIntent.setData(Uri.parse(TRADE_OFFERS_URL));
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.getApplicationContext().startActivity(browserIntent);
}
}
}
| package com.oxapps.tradenotifications;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
public class NotificationDeleteReceiver extends BroadcastReceiver {
private static final String TRADE_OFFERS_URL = "https://steamcommunity.com/id/id/tradeoffers/";
@Override
public void onReceive(Context context, Intent intent) {
long newRequestTime = System.currentTimeMillis() / 1000;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
editor.putLong(BackgroundIntentService.LAST_DELETE_KEY, newRequestTime);
editor.apply();
if(intent.hasExtra(BackgroundIntentService.NOTIFICATION_CLICKED)) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW);
browserIntent.setData(Uri.parse(TRADE_OFFERS_URL));
+ browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.getApplicationContext().startActivity(browserIntent);
}
}
} | 1 | 0.035714 | 1 | 0 |
57b27e5a4f0b81507440db7ccdc089814e5067da | spec/libraries/acts_as_attachable_spec.rb | spec/libraries/acts_as_attachable_spec.rb | require 'rails_helper'
RSpec.describe 'ActsAsAttachable' do
class SampleModel < ActiveRecord::Base
def self.columns
[]
end
acts_as_attachable
end
describe SampleModel do
it { is_expected.to have_many(:attachments) }
end
describe 'controller' do
class SampleController < ActionController::Base; end
context 'class methods' do
subject { SampleController }
it { is_expected.to respond_to(:accepts_attachments) }
end
context 'instance methods' do
subject { SampleController.new }
it { is_expected.to respond_to(:attachments_params) }
end
end
describe 'form_builder helper' do
class SampleView < ActionView::Base; end
class SampleFormBuilder < ActionView::Helpers::FormBuilder; end
let(:template) { SampleView.new }
let(:resource) { SampleModel.new }
subject { SampleFormBuilder.new(:sample, resource, template, {}) }
it { is_expected.to respond_to(:attachments) }
end
end
| require 'rails_helper'
RSpec.describe 'ActsAsAttachable' do
class SampleModel < ActiveRecord::Base
def self.columns
[]
end
acts_as_attachable
end
describe SampleModel do
it { is_expected.to have_many(:attachments) }
end
describe 'controller' do
class SampleController < ActionController::Base; end
context 'class methods' do
subject { SampleController }
it { is_expected.to respond_to(:accepts_attachments) }
end
context 'instance methods' do
subject { SampleController.new }
it { is_expected.to respond_to(:attachments_params) }
end
end
describe 'form_builder helper' do
class SampleView < ActionView::Base; end
class SampleFormBuilder < ActionView::Helpers::FormBuilder; end
let(:template) { SampleView.new(Rails.root.join('app', 'views')) }
let(:resource) do
model = SampleModel.new
model.attachments << build(:attachment)
model
end
let(:form_builder) { SampleFormBuilder.new(:sample, resource, template, {}) }
subject { form_builder }
it { is_expected.to respond_to(:attachments) }
describe '#attachments' do
before { I18n.locale = I18n.default_locale }
subject { form_builder.attachments }
it { is_expected.to have_tag('div', text: 'Upload new file') }
end
end
end
| Test case for form_builder attachments helper | Test case for form_builder attachments helper
| Ruby | mit | harryggg/coursemology2,xzhflying/coursemology2,xzhflying/coursemology2,Coursemology/coursemology2,BenMQ/coursemology2,Coursemology/coursemology2,xzhflying/coursemology2,cysjonathan/coursemology2,harryggg/coursemology2,cysjonathan/coursemology2,BenMQ/coursemology2,harryggg/coursemology2,Coursemology/coursemology2,Coursemology/coursemology2,Coursemology/coursemology2,cysjonathan/coursemology2,Coursemology/coursemology2,BenMQ/coursemology2,Coursemology/coursemology2 | ruby | ## Code Before:
require 'rails_helper'
RSpec.describe 'ActsAsAttachable' do
class SampleModel < ActiveRecord::Base
def self.columns
[]
end
acts_as_attachable
end
describe SampleModel do
it { is_expected.to have_many(:attachments) }
end
describe 'controller' do
class SampleController < ActionController::Base; end
context 'class methods' do
subject { SampleController }
it { is_expected.to respond_to(:accepts_attachments) }
end
context 'instance methods' do
subject { SampleController.new }
it { is_expected.to respond_to(:attachments_params) }
end
end
describe 'form_builder helper' do
class SampleView < ActionView::Base; end
class SampleFormBuilder < ActionView::Helpers::FormBuilder; end
let(:template) { SampleView.new }
let(:resource) { SampleModel.new }
subject { SampleFormBuilder.new(:sample, resource, template, {}) }
it { is_expected.to respond_to(:attachments) }
end
end
## Instruction:
Test case for form_builder attachments helper
## Code After:
require 'rails_helper'
RSpec.describe 'ActsAsAttachable' do
class SampleModel < ActiveRecord::Base
def self.columns
[]
end
acts_as_attachable
end
describe SampleModel do
it { is_expected.to have_many(:attachments) }
end
describe 'controller' do
class SampleController < ActionController::Base; end
context 'class methods' do
subject { SampleController }
it { is_expected.to respond_to(:accepts_attachments) }
end
context 'instance methods' do
subject { SampleController.new }
it { is_expected.to respond_to(:attachments_params) }
end
end
describe 'form_builder helper' do
class SampleView < ActionView::Base; end
class SampleFormBuilder < ActionView::Helpers::FormBuilder; end
let(:template) { SampleView.new(Rails.root.join('app', 'views')) }
let(:resource) do
model = SampleModel.new
model.attachments << build(:attachment)
model
end
let(:form_builder) { SampleFormBuilder.new(:sample, resource, template, {}) }
subject { form_builder }
it { is_expected.to respond_to(:attachments) }
describe '#attachments' do
before { I18n.locale = I18n.default_locale }
subject { form_builder.attachments }
it { is_expected.to have_tag('div', text: 'Upload new file') }
end
end
end
| require 'rails_helper'
RSpec.describe 'ActsAsAttachable' do
class SampleModel < ActiveRecord::Base
def self.columns
[]
end
acts_as_attachable
end
describe SampleModel do
it { is_expected.to have_many(:attachments) }
end
describe 'controller' do
class SampleController < ActionController::Base; end
context 'class methods' do
subject { SampleController }
it { is_expected.to respond_to(:accepts_attachments) }
end
context 'instance methods' do
subject { SampleController.new }
it { is_expected.to respond_to(:attachments_params) }
end
end
describe 'form_builder helper' do
class SampleView < ActionView::Base; end
class SampleFormBuilder < ActionView::Helpers::FormBuilder; end
- let(:template) { SampleView.new }
- let(:resource) { SampleModel.new }
+ let(:template) { SampleView.new(Rails.root.join('app', 'views')) }
+ let(:resource) do
+ model = SampleModel.new
+ model.attachments << build(:attachment)
+ model
+ end
- subject { SampleFormBuilder.new(:sample, resource, template, {}) }
? ^ ^^ ^^
+ let(:form_builder) { SampleFormBuilder.new(:sample, resource, template, {}) }
? ^^^^^^^^^^^ ^^^ ^^
+ subject { form_builder }
it { is_expected.to respond_to(:attachments) }
+
+ describe '#attachments' do
+ before { I18n.locale = I18n.default_locale }
+ subject { form_builder.attachments }
+
+ it { is_expected.to have_tag('div', text: 'Upload new file') }
+ end
end
end | 18 | 0.428571 | 15 | 3 |
e54332b2fedde298dd3734a0a505d8159d62c3fd | templates/index.html | templates/index.html | <h1>Posts</h1>
{% for post in posts_list %}
<div class="post">
{{ post.user.display_name }}: {{ post.text }}
</div>
{% endfor %}
| <h1>Posts</h1>
{% for post in posts_list %}
<div class="post">
<div class="author">
{{ post.user.display_name }}
</div>
<div class="text">
{{ post.text }}
</div>
</div>
{% endfor %}
| Add more DOM elements to the post div | Add more DOM elements to the post div | HTML | mit | SyntaxBlitz/bridie,SyntaxBlitz/bridie | html | ## Code Before:
<h1>Posts</h1>
{% for post in posts_list %}
<div class="post">
{{ post.user.display_name }}: {{ post.text }}
</div>
{% endfor %}
## Instruction:
Add more DOM elements to the post div
## Code After:
<h1>Posts</h1>
{% for post in posts_list %}
<div class="post">
<div class="author">
{{ post.user.display_name }}
</div>
<div class="text">
{{ post.text }}
</div>
</div>
{% endfor %}
| <h1>Posts</h1>
{% for post in posts_list %}
<div class="post">
+ <div class="author">
- {{ post.user.display_name }}: {{ post.text }}
? -----------------
+ {{ post.user.display_name }}
? ++
+ </div>
+ <div class="text">
+ {{ post.text }}
+ </div>
</div>
{% endfor %} | 7 | 1 | 6 | 1 |
8bcfcf3ca35754821082623068c77aba0e4a64c0 | _documentation/user/flags/narrow.md | _documentation/user/flags/narrow.md | ---
name: Narrow
abbreviation: N
type: Good
summary: Tank is super thin. Very hard to hit from front but is normal size from side. Can get through small openings.
---
...
| ---
name: Narrow
abbreviation: N
type: Good
summary: Tank is super thin. Very hard to hit from front but is normal size from side. Can get through small openings.
---
The Narrow (N) flag makes your tank be incredibly thin from the front but you'll be normal size from the side. Even though narrow tanks are super thin, it's not impossible to be shot from the front.
## Tactics
Having a very thin tank is helpful when it comes to dodging shots even when they're tightly grouped in a spray. While carrying the Narrow flag, it's in your best to fight your enemies head on where it's harder to hit; avoid turning too much making your regular sized side an easier target.
Maps may have secret areas available through tiny gaps intended for Narrow tanks to be able to fit through. Be careful with these small gaps because they put you at risk with dangerous ricohets that are incredibly difficult to dodge, making you a very easy target.
| Add documentation for Narrow flag | Add documentation for Narrow flag
| Markdown | mit | BZFlag-Dev/bzflag.org,BZFlag-Dev/bzflag.org,BZFlag-Dev/bzflag.org | markdown | ## Code Before:
---
name: Narrow
abbreviation: N
type: Good
summary: Tank is super thin. Very hard to hit from front but is normal size from side. Can get through small openings.
---
...
## Instruction:
Add documentation for Narrow flag
## Code After:
---
name: Narrow
abbreviation: N
type: Good
summary: Tank is super thin. Very hard to hit from front but is normal size from side. Can get through small openings.
---
The Narrow (N) flag makes your tank be incredibly thin from the front but you'll be normal size from the side. Even though narrow tanks are super thin, it's not impossible to be shot from the front.
## Tactics
Having a very thin tank is helpful when it comes to dodging shots even when they're tightly grouped in a spray. While carrying the Narrow flag, it's in your best to fight your enemies head on where it's harder to hit; avoid turning too much making your regular sized side an easier target.
Maps may have secret areas available through tiny gaps intended for Narrow tanks to be able to fit through. Be careful with these small gaps because they put you at risk with dangerous ricohets that are incredibly difficult to dodge, making you a very easy target.
| ---
name: Narrow
abbreviation: N
type: Good
summary: Tank is super thin. Very hard to hit from front but is normal size from side. Can get through small openings.
---
- ...
+ The Narrow (N) flag makes your tank be incredibly thin from the front but you'll be normal size from the side. Even though narrow tanks are super thin, it's not impossible to be shot from the front.
+
+ ## Tactics
+
+ Having a very thin tank is helpful when it comes to dodging shots even when they're tightly grouped in a spray. While carrying the Narrow flag, it's in your best to fight your enemies head on where it's harder to hit; avoid turning too much making your regular sized side an easier target.
+
+ Maps may have secret areas available through tiny gaps intended for Narrow tanks to be able to fit through. Be careful with these small gaps because they put you at risk with dangerous ricohets that are incredibly difficult to dodge, making you a very easy target. | 8 | 1 | 7 | 1 |
b346610e2dd2ce98e9f0735f8fc84f5e6077d9ac | lib/pkgcloud/openstack/index.js | lib/pkgcloud/openstack/index.js | /*
* index.js: Top-level include for the OpenStack module.
*
* (C) 2013 Nodejitsu Inc.
*
*/
exports.blockstorage = require('./blockstorage');
exports.compute = require('./compute');
exports.identity = require('./identity');
exports.orchestration = require('./orchestration');
exports.network = require('./network');
exports.storage = require('./storage');
exports.database = require('./database');
| /*
* index.js: Top-level include for the OpenStack module.
*
* (C) 2013 Nodejitsu Inc.
*
*/
exports.blockstorage = require('./blockstorage');
exports.compute = require('./compute');
exports.identity = require('./identity');
exports.orchestration = require('./orchestration');
exports.network = require('./network');
exports.storage = require('./storage');
exports.database = require('./database');
exports.cdn = require('./cdn');
| Enable CDN service in OpenStack. | Enable CDN service in OpenStack.
| JavaScript | mit | temka1234/pkgcloud,pkgcloud/pkgcloud,Phanatic/pkgcloud,Phanatic/pkgcloud,Hopebaytech/pkgcloud | javascript | ## Code Before:
/*
* index.js: Top-level include for the OpenStack module.
*
* (C) 2013 Nodejitsu Inc.
*
*/
exports.blockstorage = require('./blockstorage');
exports.compute = require('./compute');
exports.identity = require('./identity');
exports.orchestration = require('./orchestration');
exports.network = require('./network');
exports.storage = require('./storage');
exports.database = require('./database');
## Instruction:
Enable CDN service in OpenStack.
## Code After:
/*
* index.js: Top-level include for the OpenStack module.
*
* (C) 2013 Nodejitsu Inc.
*
*/
exports.blockstorage = require('./blockstorage');
exports.compute = require('./compute');
exports.identity = require('./identity');
exports.orchestration = require('./orchestration');
exports.network = require('./network');
exports.storage = require('./storage');
exports.database = require('./database');
exports.cdn = require('./cdn');
| /*
* index.js: Top-level include for the OpenStack module.
*
* (C) 2013 Nodejitsu Inc.
*
*/
exports.blockstorage = require('./blockstorage');
exports.compute = require('./compute');
exports.identity = require('./identity');
exports.orchestration = require('./orchestration');
exports.network = require('./network');
exports.storage = require('./storage');
exports.database = require('./database');
+ exports.cdn = require('./cdn'); | 1 | 0.071429 | 1 | 0 |
50cde2ac191ccc92097d4376a88091bc76e5f022 | spec/lib/terraforming/resource/db_parameter_group_spec.rb | spec/lib/terraforming/resource/db_parameter_group_spec.rb | require "spec_helper"
module Terraforming::Resource
describe DBParameterGroup do
describe ".tf" do
let(:json) do
JSON.parse(open(fixture_path("rds/describe-db-parameter-groups")).read)
end
describe ".tf" do
it "should generate tf" do
expect(described_class.tf(json)).to eq <<-EOS
resource "aws_db_parameter_group" "default.mysql5.6" {
name = "default.mysql5.6"
family = "mysql5.6"
description = "Default parameter group for mysql5.6"
}
resource "aws_db_parameter_group" "default.postgres9.4" {
name = "default.postgres9.4"
family = "postgres9.4"
description = "Default parameter group for postgres9.4"
}
EOS
end
end
describe ".tfstate" do
it "should raise NotImplementedError" do
expect do
described_class.tfstate(json)
end.to raise_error NotImplementedError
end
end
end
end
end
| require "spec_helper"
module Terraforming::Resource
describe DBParameterGroup do
let(:client) do
Aws::RDS::Client.new(stub_responses: true)
end
let(:db_parameter_groups) do
[
{
db_parameter_group_name: "default.mysql5.6",
db_parameter_group_family: "mysql5.6",
description: "Default parameter group for mysql5.6"
},
{
db_parameter_group_name: "default.postgres9.4",
db_parameter_group_family: "postgres9.4",
description: "Default parameter group for postgres9.4"
}
]
end
before do
client.stub_responses(:describe_db_parameter_groups, db_parameter_groups: db_parameter_groups)
end
describe ".tf" do
it "should generate tf" do
expect(described_class.tf(client)).to eq <<-EOS
resource "aws_db_parameter_group" "default.mysql5.6" {
name = "default.mysql5.6"
family = "mysql5.6"
description = "Default parameter group for mysql5.6"
}
resource "aws_db_parameter_group" "default.postgres9.4" {
name = "default.postgres9.4"
family = "postgres9.4"
description = "Default parameter group for postgres9.4"
}
EOS
end
describe ".tfstate" do
it "should raise NotImplementedError" do
expect do
described_class.tfstate(client)
end.to raise_error NotImplementedError
end
end
end
end
end
| Modify DBParameterGroup tests to use aws-sdk | Modify DBParameterGroup tests to use aws-sdk
| Ruby | mit | masayuki038/terraforming,ngs/terraforming,Banno/terraforming,rlister/terraforming,Banno/terraforming,ketzacoatl/terraforming,ketzacoatl/terraforming,dtan4/terraforming,TheWeatherCompany/terraforming,rlister/terraforming,rlister/terraforming,TheWeatherCompany/terraforming,ngs/terraforming,ngs/terraforming,dtan4/terraforming,masayuki038/terraforming,masayuki038/terraforming,ketzacoatl/terraforming,TheWeatherCompany/terraforming,Banno/terraforming,dtan4/terraforming | ruby | ## Code Before:
require "spec_helper"
module Terraforming::Resource
describe DBParameterGroup do
describe ".tf" do
let(:json) do
JSON.parse(open(fixture_path("rds/describe-db-parameter-groups")).read)
end
describe ".tf" do
it "should generate tf" do
expect(described_class.tf(json)).to eq <<-EOS
resource "aws_db_parameter_group" "default.mysql5.6" {
name = "default.mysql5.6"
family = "mysql5.6"
description = "Default parameter group for mysql5.6"
}
resource "aws_db_parameter_group" "default.postgres9.4" {
name = "default.postgres9.4"
family = "postgres9.4"
description = "Default parameter group for postgres9.4"
}
EOS
end
end
describe ".tfstate" do
it "should raise NotImplementedError" do
expect do
described_class.tfstate(json)
end.to raise_error NotImplementedError
end
end
end
end
end
## Instruction:
Modify DBParameterGroup tests to use aws-sdk
## Code After:
require "spec_helper"
module Terraforming::Resource
describe DBParameterGroup do
let(:client) do
Aws::RDS::Client.new(stub_responses: true)
end
let(:db_parameter_groups) do
[
{
db_parameter_group_name: "default.mysql5.6",
db_parameter_group_family: "mysql5.6",
description: "Default parameter group for mysql5.6"
},
{
db_parameter_group_name: "default.postgres9.4",
db_parameter_group_family: "postgres9.4",
description: "Default parameter group for postgres9.4"
}
]
end
before do
client.stub_responses(:describe_db_parameter_groups, db_parameter_groups: db_parameter_groups)
end
describe ".tf" do
it "should generate tf" do
expect(described_class.tf(client)).to eq <<-EOS
resource "aws_db_parameter_group" "default.mysql5.6" {
name = "default.mysql5.6"
family = "mysql5.6"
description = "Default parameter group for mysql5.6"
}
resource "aws_db_parameter_group" "default.postgres9.4" {
name = "default.postgres9.4"
family = "postgres9.4"
description = "Default parameter group for postgres9.4"
}
EOS
end
describe ".tfstate" do
it "should raise NotImplementedError" do
expect do
described_class.tfstate(client)
end.to raise_error NotImplementedError
end
end
end
end
end
| require "spec_helper"
module Terraforming::Resource
describe DBParameterGroup do
+ let(:client) do
+ Aws::RDS::Client.new(stub_responses: true)
+ end
+
+ let(:db_parameter_groups) do
+ [
+ {
+ db_parameter_group_name: "default.mysql5.6",
+ db_parameter_group_family: "mysql5.6",
+ description: "Default parameter group for mysql5.6"
+ },
+ {
+ db_parameter_group_name: "default.postgres9.4",
+ db_parameter_group_family: "postgres9.4",
+ description: "Default parameter group for postgres9.4"
+ }
+ ]
+ end
+
+ before do
+ client.stub_responses(:describe_db_parameter_groups, db_parameter_groups: db_parameter_groups)
+ end
+
describe ".tf" do
- let(:json) do
- JSON.parse(open(fixture_path("rds/describe-db-parameter-groups")).read)
- end
-
- describe ".tf" do
- it "should generate tf" do
? --
+ it "should generate tf" do
- expect(described_class.tf(json)).to eq <<-EOS
? -- ^^^
+ expect(described_class.tf(client)).to eq <<-EOS
? ^^^^ +
resource "aws_db_parameter_group" "default.mysql5.6" {
name = "default.mysql5.6"
family = "mysql5.6"
description = "Default parameter group for mysql5.6"
}
resource "aws_db_parameter_group" "default.postgres9.4" {
name = "default.postgres9.4"
family = "postgres9.4"
description = "Default parameter group for postgres9.4"
}
EOS
- end
end
describe ".tfstate" do
it "should raise NotImplementedError" do
expect do
- described_class.tfstate(json)
? ^^^
+ described_class.tfstate(client)
? ^^^^ +
end.to raise_error NotImplementedError
end
end
end
end
end | 35 | 0.921053 | 26 | 9 |
8285ab1f37440e0d80f6fa901925f8299ec1ca97 | bin/day4.dart | bin/day4.dart | import 'dart:convert';
import 'dart:math';
import 'package:crypto/crypto.dart';
void main() {
var secretKey = 'ckczppom';
print('Part one: ${partOne(secretKey) ?? 'No MD5 hash found.'}');
}
int partOne(String secretKey) {
var hash;
print('Calculating...');
for (var i = 0; i < pow(10, secretKey.length) - 1; i++) {
hash = md5.convert(UTF8.encode('${secretKey}${i}'));
if (hash.toString().startsWith(new RegExp(r'0{5,}'))) {
print('MD5 hash: ${hash}');
return i;
}
}
return null;
}
| import 'dart:convert';
import 'dart:math';
import 'package:crypto/crypto.dart';
/// Shows the solutions to both puzzles.
void main() {
var secretKey = 'ckczppom';
print('Part one: ${partOne(secretKey) ?? 'No MD5 hash found.'}');
print('Part two: ${partTwo(secretKey) ?? 'No MD5 hash found.'}');
}
/// Returns the answer to part one given a [secretKey], or [null] if no hash can
/// be produced.
int partOne(String secretKey) => getHash(secretKey, 5);
/// Returns the answer to part one given a [secretKey], or [null] if no hash can
/// be produced.
int partTwo(String secretKey) => getHash(secretKey, 6);
/// Returns the lowest positive number that, together with the [secretKey],
/// produces an MD5 hash which, in hexadecimal, starts with a sequence of zeros
/// whose length is greater than or equal to [zeros]. If such a hash cannot be
/// produced, returns [null] instead.
int getHash(String secretKey, int zeros) {
var hash;
print('Calculating...');
for (var i = 0; i < pow(10, secretKey.length) - 1; i++) {
hash = md5.convert(UTF8.encode('${secretKey}${i}'));
if (hash.toString().startsWith(new RegExp('0{${zeros},}'))) {
print('MD5 hash: ${hash}');
return i;
}
}
return null;
}
| Add solution to part 2 day 4 and optimizations | Add solution to part 2 day 4 and optimizations
| Dart | apache-2.0 | raphalvessa/advent-of-code,raphbot/advent-of-code | dart | ## Code Before:
import 'dart:convert';
import 'dart:math';
import 'package:crypto/crypto.dart';
void main() {
var secretKey = 'ckczppom';
print('Part one: ${partOne(secretKey) ?? 'No MD5 hash found.'}');
}
int partOne(String secretKey) {
var hash;
print('Calculating...');
for (var i = 0; i < pow(10, secretKey.length) - 1; i++) {
hash = md5.convert(UTF8.encode('${secretKey}${i}'));
if (hash.toString().startsWith(new RegExp(r'0{5,}'))) {
print('MD5 hash: ${hash}');
return i;
}
}
return null;
}
## Instruction:
Add solution to part 2 day 4 and optimizations
## Code After:
import 'dart:convert';
import 'dart:math';
import 'package:crypto/crypto.dart';
/// Shows the solutions to both puzzles.
void main() {
var secretKey = 'ckczppom';
print('Part one: ${partOne(secretKey) ?? 'No MD5 hash found.'}');
print('Part two: ${partTwo(secretKey) ?? 'No MD5 hash found.'}');
}
/// Returns the answer to part one given a [secretKey], or [null] if no hash can
/// be produced.
int partOne(String secretKey) => getHash(secretKey, 5);
/// Returns the answer to part one given a [secretKey], or [null] if no hash can
/// be produced.
int partTwo(String secretKey) => getHash(secretKey, 6);
/// Returns the lowest positive number that, together with the [secretKey],
/// produces an MD5 hash which, in hexadecimal, starts with a sequence of zeros
/// whose length is greater than or equal to [zeros]. If such a hash cannot be
/// produced, returns [null] instead.
int getHash(String secretKey, int zeros) {
var hash;
print('Calculating...');
for (var i = 0; i < pow(10, secretKey.length) - 1; i++) {
hash = md5.convert(UTF8.encode('${secretKey}${i}'));
if (hash.toString().startsWith(new RegExp('0{${zeros},}'))) {
print('MD5 hash: ${hash}');
return i;
}
}
return null;
}
| import 'dart:convert';
import 'dart:math';
import 'package:crypto/crypto.dart';
+ /// Shows the solutions to both puzzles.
void main() {
var secretKey = 'ckczppom';
print('Part one: ${partOne(secretKey) ?? 'No MD5 hash found.'}');
+ print('Part two: ${partTwo(secretKey) ?? 'No MD5 hash found.'}');
}
- int partOne(String secretKey) {
+ /// Returns the answer to part one given a [secretKey], or [null] if no hash can
+ /// be produced.
+ int partOne(String secretKey) => getHash(secretKey, 5);
+
+ /// Returns the answer to part one given a [secretKey], or [null] if no hash can
+ /// be produced.
+ int partTwo(String secretKey) => getHash(secretKey, 6);
+
+ /// Returns the lowest positive number that, together with the [secretKey],
+ /// produces an MD5 hash which, in hexadecimal, starts with a sequence of zeros
+ /// whose length is greater than or equal to [zeros]. If such a hash cannot be
+ /// produced, returns [null] instead.
+ int getHash(String secretKey, int zeros) {
var hash;
print('Calculating...');
for (var i = 0; i < pow(10, secretKey.length) - 1; i++) {
hash = md5.convert(UTF8.encode('${secretKey}${i}'));
- if (hash.toString().startsWith(new RegExp(r'0{5,}'))) {
? - ^
+ if (hash.toString().startsWith(new RegExp('0{${zeros},}'))) {
? ^^^^^^^^
print('MD5 hash: ${hash}');
return i;
}
}
return null;
} | 18 | 0.857143 | 16 | 2 |
fb1422c22e570da21279edee0ea79605e74f7a92 | crispy/__init__.py | crispy/__init__.py | import logging
logging.basicConfig(level=logging.WARNING)
| import logging
# These are required to activate the cx_Freeze hooks
import matplotlib
import matplotlib.backends.backend_qt5agg
import PyQt5.QtPrintSupport
logging.basicConfig(level=logging.WARNING)
| Add imports imports to trigger cx_Freeze hooks | Add imports imports to trigger cx_Freeze hooks
| Python | mit | mretegan/crispy,mretegan/crispy | python | ## Code Before:
import logging
logging.basicConfig(level=logging.WARNING)
## Instruction:
Add imports imports to trigger cx_Freeze hooks
## Code After:
import logging
# These are required to activate the cx_Freeze hooks
import matplotlib
import matplotlib.backends.backend_qt5agg
import PyQt5.QtPrintSupport
logging.basicConfig(level=logging.WARNING)
| import logging
+ # These are required to activate the cx_Freeze hooks
+ import matplotlib
+ import matplotlib.backends.backend_qt5agg
+ import PyQt5.QtPrintSupport
+
logging.basicConfig(level=logging.WARNING) | 5 | 1.666667 | 5 | 0 |
69e6137d7ae18950ce1df593abc4f837f81fa3fc | app/game.js | app/game.js | import Crafty from 'crafty';
import 'app/components/camera_relative_motion';
Crafty.init(800,600, document.getElementById('game'));
Crafty.background('#000');
Crafty.e('2D, WebGL, Color, Fourway').attr({
x: 0,
y: 0,
w: 20,
h: 20
}).color('#F00').fourway(100).bind('MotionChange', function(property) {
let newValue = {};
newValue[property.key] = this[property.key];
Crafty.s('CameraSystem').camera.attr(newValue);
})
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 400,
y: 400,
w: 20,
h: 20
}).color('#00F')
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 300,
y: 200,
w: 20,
h: 20
}).color('#0F0').cameraRelativeMotion({ xResponse: 0.5, yResponse: 0.5 });
| import Crafty from 'crafty';
import 'app/components/camera_relative_motion';
Crafty.init(800,600, document.getElementById('game'));
Crafty.background('#000');
Crafty.e('2D, WebGL, Color, Fourway').attr({
x: 200,
y: 200,
w: 20,
h: 20,
z: 5
}).color('#F00');
Crafty.e('2D, Fourway').fourway(100).bind('MotionChange', function(property) {
let newValue = {};
newValue[property.key] = this[property.key];
Crafty.s('CameraSystem').camera.attr(newValue);
})
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 700,
y: 100,
w: 30,
h: 400,
z: 10
}).color('#00F')
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 500,
y: 150,
w: 20,
h: 300
}).color('#0F0').cameraRelativeMotion({ xResponse: 0.5, yResponse: 0.5 });
| Make it a bit more demo-able | Make it a bit more demo-able
| JavaScript | mit | matthijsgroen/speedlazer | javascript | ## Code Before:
import Crafty from 'crafty';
import 'app/components/camera_relative_motion';
Crafty.init(800,600, document.getElementById('game'));
Crafty.background('#000');
Crafty.e('2D, WebGL, Color, Fourway').attr({
x: 0,
y: 0,
w: 20,
h: 20
}).color('#F00').fourway(100).bind('MotionChange', function(property) {
let newValue = {};
newValue[property.key] = this[property.key];
Crafty.s('CameraSystem').camera.attr(newValue);
})
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 400,
y: 400,
w: 20,
h: 20
}).color('#00F')
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 300,
y: 200,
w: 20,
h: 20
}).color('#0F0').cameraRelativeMotion({ xResponse: 0.5, yResponse: 0.5 });
## Instruction:
Make it a bit more demo-able
## Code After:
import Crafty from 'crafty';
import 'app/components/camera_relative_motion';
Crafty.init(800,600, document.getElementById('game'));
Crafty.background('#000');
Crafty.e('2D, WebGL, Color, Fourway').attr({
x: 200,
y: 200,
w: 20,
h: 20,
z: 5
}).color('#F00');
Crafty.e('2D, Fourway').fourway(100).bind('MotionChange', function(property) {
let newValue = {};
newValue[property.key] = this[property.key];
Crafty.s('CameraSystem').camera.attr(newValue);
})
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 700,
y: 100,
w: 30,
h: 400,
z: 10
}).color('#00F')
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
x: 500,
y: 150,
w: 20,
h: 300
}).color('#0F0').cameraRelativeMotion({ xResponse: 0.5, yResponse: 0.5 });
| import Crafty from 'crafty';
import 'app/components/camera_relative_motion';
Crafty.init(800,600, document.getElementById('game'));
Crafty.background('#000');
Crafty.e('2D, WebGL, Color, Fourway').attr({
- x: 0,
+ x: 200,
? ++
- y: 0,
+ y: 200,
? ++
w: 20,
- h: 20
+ h: 20,
? +
+ z: 5
+ }).color('#F00');
+
- }).color('#F00').fourway(100).bind('MotionChange', function(property) {
? ^^ ^^^^^ ^ ^^
+ Crafty.e('2D, Fourway').fourway(100).bind('MotionChange', function(property) {
? ^^^^^^ ^ ^^^^ ^^^^^^
let newValue = {};
newValue[property.key] = this[property.key];
Crafty.s('CameraSystem').camera.attr(newValue);
})
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
- x: 400,
? ^
+ x: 700,
? ^
- y: 400,
? ^
+ y: 100,
? ^
- w: 20,
? ^
+ w: 30,
? ^
- h: 20
? ^
+ h: 400,
? ^ ++
+ z: 10
}).color('#00F')
Crafty.e('2D, WebGL, Color, CameraRelativeMotion').attr({
- x: 300,
? ^
+ x: 500,
? ^
- y: 200,
? ^^
+ y: 150,
? ^^
w: 20,
- h: 20
? ^
+ h: 300
? ^ +
}).color('#0F0').cameraRelativeMotion({ xResponse: 0.5, yResponse: 0.5 });
| 26 | 0.83871 | 15 | 11 |
3897e90a4fbe99adec6c3e3d40f9e230bbbd9dd7 | res/ungrey.fs.glsl | res/ungrey.fs.glsl | in vec2 tex_coord;
out vec3 color;
uniform isampler2D low;
uniform isampler2D high;
void main() {
int s=int(tex_coord.s);
int t=int(tex_coord.t);
float y;
float v;
if ((t&0x4)==0) {
y=float(texelFetch(low, ivec2(s,t>>3),0)[t&3])+128;
}
else {
y=float(texelFetch(high, ivec2(s,t>>3),0)[t&3])+128;
}
color=vec3(y,y,y)/255.0;
}
| in vec2 tex_coord;
out vec3 color;
uniform isampler2D low;
uniform isampler2D high;
void main() {
int s=int(tex_coord.s);
int t=int(tex_coord.t);
float y;
if ((t&0x4)==0) {
y=float(texelFetch(low, ivec2(s,t>>3),0)[t&3])+128;
}
else {
y=float(texelFetch(high, ivec2(s,t>>3),0)[t&3])+128;
}
color=vec3(y,y,y)/255.0;
}
| Remove unused variable in ungrey fragment shader. | Remove unused variable in ungrey fragment shader.
| GLSL | apache-2.0 | negge/jpeg_gpu,negge/jpeg_gpu | glsl | ## Code Before:
in vec2 tex_coord;
out vec3 color;
uniform isampler2D low;
uniform isampler2D high;
void main() {
int s=int(tex_coord.s);
int t=int(tex_coord.t);
float y;
float v;
if ((t&0x4)==0) {
y=float(texelFetch(low, ivec2(s,t>>3),0)[t&3])+128;
}
else {
y=float(texelFetch(high, ivec2(s,t>>3),0)[t&3])+128;
}
color=vec3(y,y,y)/255.0;
}
## Instruction:
Remove unused variable in ungrey fragment shader.
## Code After:
in vec2 tex_coord;
out vec3 color;
uniform isampler2D low;
uniform isampler2D high;
void main() {
int s=int(tex_coord.s);
int t=int(tex_coord.t);
float y;
if ((t&0x4)==0) {
y=float(texelFetch(low, ivec2(s,t>>3),0)[t&3])+128;
}
else {
y=float(texelFetch(high, ivec2(s,t>>3),0)[t&3])+128;
}
color=vec3(y,y,y)/255.0;
}
| in vec2 tex_coord;
out vec3 color;
uniform isampler2D low;
uniform isampler2D high;
void main() {
int s=int(tex_coord.s);
int t=int(tex_coord.t);
float y;
- float v;
if ((t&0x4)==0) {
y=float(texelFetch(low, ivec2(s,t>>3),0)[t&3])+128;
}
else {
y=float(texelFetch(high, ivec2(s,t>>3),0)[t&3])+128;
}
color=vec3(y,y,y)/255.0;
} | 1 | 0.058824 | 0 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.