commit stringlengths 40 40 | old_file stringlengths 4 237 | new_file stringlengths 4 237 | old_contents stringlengths 1 4.24k | new_contents stringlengths 5 4.84k | subject stringlengths 15 778 | message stringlengths 16 6.86k | lang stringlengths 1 30 | license stringclasses 13 values | repos stringlengths 5 116k | config stringlengths 1 30 | content stringlengths 105 8.72k |
|---|---|---|---|---|---|---|---|---|---|---|---|
3ed9736f59ed1b39d1345fe83763ff1f18fd8834 | app/renderers/spree/retail/redcarpet_html_renderer.rb | app/renderers/spree/retail/redcarpet_html_renderer.rb | require 'redcarpet'
module Spree
module Retail
class RedcarpetHTMLRenderer
def initialize(options: {}, extensions: {})
@options = options
@extensions = extensions
@renderer = Redcarpet::Render::HTML.new(default_options)
@converter = Redcarpet::Markdown.new(@renderer, default_extensions)
end
def render(content)
converter.render(content).strip
end
private
attr_accessor :options, :extensions, :renderer, :converter
def default_options
{
filter_html: false,
hard_wrap: true,
link_attributes: { rel: 'nofollow', target: '_blank' },
space_after_headers: true,
fenced_code_blocks: true,
no_images: true,
no_styles: true
}.merge(options)
end
def default_extensions
{
autolink: true,
superscript: true,
disable_indented_code_blocks: true
}.merge(extensions)
end
end
end
end
| require 'redcarpet'
module Spree
module Retail
class RedcarpetHTMLRenderer
def initialize(options: {}, extensions: {})
@options = options
@extensions = extensions
@renderer = Redcarpet::Render::HTML.new(default_options)
@converter = Redcarpet::Markdown.new(@renderer, default_extensions)
end
def render(content)
return '' if content.nil?
converter.render(content).strip
end
private
attr_accessor :options, :extensions, :renderer, :converter
def default_options
{
filter_html: false,
hard_wrap: true,
link_attributes: { rel: 'nofollow', target: '_blank' },
space_after_headers: true,
fenced_code_blocks: true,
no_images: true,
no_styles: true
}.merge(options)
end
def default_extensions
{
autolink: true,
superscript: true,
disable_indented_code_blocks: true
}.merge(extensions)
end
end
end
end
| Return an empty string if product's content is nil | Return an empty string if product's content is nil
| Ruby | bsd-3-clause | glossier/solidus_retail,glossier/solidus_retail,glossier/solidus_retail | ruby | ## Code Before:
require 'redcarpet'
module Spree
module Retail
class RedcarpetHTMLRenderer
def initialize(options: {}, extensions: {})
@options = options
@extensions = extensions
@renderer = Redcarpet::Render::HTML.new(default_options)
@converter = Redcarpet::Markdown.new(@renderer, default_extensions)
end
def render(content)
converter.render(content).strip
end
private
attr_accessor :options, :extensions, :renderer, :converter
def default_options
{
filter_html: false,
hard_wrap: true,
link_attributes: { rel: 'nofollow', target: '_blank' },
space_after_headers: true,
fenced_code_blocks: true,
no_images: true,
no_styles: true
}.merge(options)
end
def default_extensions
{
autolink: true,
superscript: true,
disable_indented_code_blocks: true
}.merge(extensions)
end
end
end
end
## Instruction:
Return an empty string if product's content is nil
## Code After:
require 'redcarpet'
module Spree
module Retail
class RedcarpetHTMLRenderer
def initialize(options: {}, extensions: {})
@options = options
@extensions = extensions
@renderer = Redcarpet::Render::HTML.new(default_options)
@converter = Redcarpet::Markdown.new(@renderer, default_extensions)
end
def render(content)
return '' if content.nil?
converter.render(content).strip
end
private
attr_accessor :options, :extensions, :renderer, :converter
def default_options
{
filter_html: false,
hard_wrap: true,
link_attributes: { rel: 'nofollow', target: '_blank' },
space_after_headers: true,
fenced_code_blocks: true,
no_images: true,
no_styles: true
}.merge(options)
end
def default_extensions
{
autolink: true,
superscript: true,
disable_indented_code_blocks: true
}.merge(extensions)
end
end
end
end
|
f263d23ee3fc216027c4ee047778b491766d3647 | app/controllers/api/application_controller.rb | app/controllers/api/application_controller.rb | class Api::ApplicationController < ActionController::Base
respond_to :json
rescue_from ActiveRecord::RecordNotFound, :with => :handle_not_found
rescue_from ActionController::ParameterMissing, :with => :handle_unprocessable_entity
before_action :verify_api_key
def verify_api_key
api_user
end
def api_user
begin
@api_key_user ||= User.find_by_api_key!(params[:api_key])
rescue ActiveRecord::RecordNotFound
head :unauthorized
end
end
def uid_user
@uid_user ||= User.find_by_uid(params[:steam_uid])
end
def current_user
@current_user ||= begin
if api_user && api_user.admin? && uid_user
uid_user
else
api_user
end
end
end
def handle_not_found
head :not_found
end
def handle_unprocessable_entity
Rails.logger.warn "UNPROCESSABLE ENTITY: #{request.body.read}"
head :unprocessable_entity
end
end
| class Api::ApplicationController < ActionController::Base
respond_to :json
rescue_from ActiveRecord::RecordNotFound, :with => :handle_not_found
rescue_from ActionController::ParameterMissing, :with => :handle_unprocessable_entity
before_action :verify_api_key
def verify_api_key
api_user
end
def api_user
begin
@api_key_user ||= User.find_by_api_key!(params[:api_key])
rescue ActiveRecord::RecordNotFound
head :unauthorized
nil
end
end
def uid_user
@uid_user ||= User.find_by_uid(params[:steam_uid])
end
def current_user
@current_user ||= begin
if api_user && api_user.admin? && uid_user
uid_user
else
api_user
end
end
end
def handle_not_found
head :not_found
end
def handle_unprocessable_entity
Rails.logger.warn "UNPROCESSABLE ENTITY: #{request.body.read}"
head :unprocessable_entity
end
end
| Return nil for api_user when api key invalid | Return nil for api_user when api key invalid
| Ruby | apache-2.0 | Arie/serveme,Arie/serveme,Arie/serveme,Arie/serveme | ruby | ## Code Before:
class Api::ApplicationController < ActionController::Base
respond_to :json
rescue_from ActiveRecord::RecordNotFound, :with => :handle_not_found
rescue_from ActionController::ParameterMissing, :with => :handle_unprocessable_entity
before_action :verify_api_key
def verify_api_key
api_user
end
def api_user
begin
@api_key_user ||= User.find_by_api_key!(params[:api_key])
rescue ActiveRecord::RecordNotFound
head :unauthorized
end
end
def uid_user
@uid_user ||= User.find_by_uid(params[:steam_uid])
end
def current_user
@current_user ||= begin
if api_user && api_user.admin? && uid_user
uid_user
else
api_user
end
end
end
def handle_not_found
head :not_found
end
def handle_unprocessable_entity
Rails.logger.warn "UNPROCESSABLE ENTITY: #{request.body.read}"
head :unprocessable_entity
end
end
## Instruction:
Return nil for api_user when api key invalid
## Code After:
class Api::ApplicationController < ActionController::Base
respond_to :json
rescue_from ActiveRecord::RecordNotFound, :with => :handle_not_found
rescue_from ActionController::ParameterMissing, :with => :handle_unprocessable_entity
before_action :verify_api_key
def verify_api_key
api_user
end
def api_user
begin
@api_key_user ||= User.find_by_api_key!(params[:api_key])
rescue ActiveRecord::RecordNotFound
head :unauthorized
nil
end
end
def uid_user
@uid_user ||= User.find_by_uid(params[:steam_uid])
end
def current_user
@current_user ||= begin
if api_user && api_user.admin? && uid_user
uid_user
else
api_user
end
end
end
def handle_not_found
head :not_found
end
def handle_unprocessable_entity
Rails.logger.warn "UNPROCESSABLE ENTITY: #{request.body.read}"
head :unprocessable_entity
end
end
|
6ee2b75438c9c423a261e0743be5bc09ad1ccbe0 | fixture/Lua/input_code/Seed.lua | fixture/Lua/input_code/Seed.lua | i = 0
f()
if i == 0 then
if j ~= 0 then
elseif 2 > j then
end
elseif 1 < i then
end
while i ~= 0 do
while j == 0 do
end
end
repeat
repeat
until j ~= 0
until i == 0
for i = 0, 1, 1 do
for j = 2, 3, 4 do
end
end
;
::Label::
i = 0
| print(1)
print(1, 2)
i = 0
f()
if i == 0 then
if j ~= 0 then
elseif 2 > j then
end
elseif 1 < i then
end
while i ~= 0 do
while j == 0 do
end
end
repeat
repeat
until j ~= 0
until i == 0
for i = 0, 1, 1 do
for j = 2, 3, 4 do
end
end
;
::Label::
i = 0
| Enhance seed code of Lua. | Enhance seed code of Lua.
| Lua | apache-2.0 | exKAZUu/ParserTests,exKAZUu/ParserTests,exKAZUu/ParserTests,exKAZUu/ParserTests,exKAZUu/ParserTests,exKAZUu/ParserTests,exKAZUu/ParserTests | lua | ## Code Before:
i = 0
f()
if i == 0 then
if j ~= 0 then
elseif 2 > j then
end
elseif 1 < i then
end
while i ~= 0 do
while j == 0 do
end
end
repeat
repeat
until j ~= 0
until i == 0
for i = 0, 1, 1 do
for j = 2, 3, 4 do
end
end
;
::Label::
i = 0
## Instruction:
Enhance seed code of Lua.
## Code After:
print(1)
print(1, 2)
i = 0
f()
if i == 0 then
if j ~= 0 then
elseif 2 > j then
end
elseif 1 < i then
end
while i ~= 0 do
while j == 0 do
end
end
repeat
repeat
until j ~= 0
until i == 0
for i = 0, 1, 1 do
for j = 2, 3, 4 do
end
end
;
::Label::
i = 0
|
4d489c5be7e823e7e5fa1155d84060af47dd613f | src/util/Interrupt.cpp | src/util/Interrupt.cpp | /**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2012 Sandro Santilli <strk@keybit.net>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#include <geos/util/Interrupt.h>
#include <geos/util/GEOSException.h> // for inheritance
namespace geos {
namespace util { // geos::util
class GEOS_DLL InterruptedException: public GEOSException {
public:
InterruptedException() :
GEOSException("InterruptedException", "Interrupted!") {}
};
void
Interrupt::interrupt() { throw InterruptedException(); }
bool Interrupt::requested = false;
Interrupt::Callback *Interrupt::callback = 0;
void *Interrupt::callback_arg = 0;
} // namespace geos::util
} // namespace geos
| /**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2012 Sandro Santilli <strk@keybit.net>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#include <geos/util/Interrupt.h>
#include <geos/util/GEOSException.h> // for inheritance
namespace geos {
namespace util { // geos::util
class GEOS_DLL InterruptedException: public GEOSException {
public:
InterruptedException() :
GEOSException("InterruptedException", "Interrupted!") {}
};
void
Interrupt::interrupt() {
requested = false;
throw InterruptedException();
}
bool Interrupt::requested = false;
Interrupt::Callback *Interrupt::callback = 0;
void *Interrupt::callback_arg = 0;
} // namespace geos::util
} // namespace geos
| Clear interruption request flag just before interrupting | Clear interruption request flag just before interrupting
git-svn-id: 6c2b1bd10c324c49ea9d9e6e31006a80e70507cb@3670 5242fede-7e19-0410-aef8-94bd7d2200fb
| C++ | lgpl-2.1 | WillieMaddox/libgeos,rkanavath/libgeos,gtourkas/libgeos,strk/libgeos,WillieMaddox/libgeos,manisandro/libgeos,mwtoews/libgeos,rkanavath/libgeos,libgeos/libgeos,rkanavath/libgeos,mwtoews/libgeos,mwtoews/libgeos,gtourkas/libgeos,manisandro/libgeos,WillieMaddox/libgeos,gtourkas/libgeos,mwtoews/libgeos,libgeos/libgeos,strk/libgeos,strk/libgeos,rkanavath/libgeos,libgeos/libgeos,WillieMaddox/libgeos,mwtoews/libgeos,kyroskoh/libgeos,libgeos/libgeos,WillieMaddox/libgeos,kyroskoh/libgeos,manisandro/libgeos,kyroskoh/libgeos,manisandro/libgeos,gtourkas/libgeos,strk/libgeos,libgeos/libgeos,rkanavath/libgeos,manisandro/libgeos,WillieMaddox/libgeos,manisandro/libgeos,WillieMaddox/libgeos,manisandro/libgeos,strk/libgeos,kyroskoh/libgeos,mwtoews/libgeos,gtourkas/libgeos,kyroskoh/libgeos,mwtoews/libgeos,kyroskoh/libgeos,kyroskoh/libgeos | c++ | ## Code Before:
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2012 Sandro Santilli <strk@keybit.net>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#include <geos/util/Interrupt.h>
#include <geos/util/GEOSException.h> // for inheritance
namespace geos {
namespace util { // geos::util
class GEOS_DLL InterruptedException: public GEOSException {
public:
InterruptedException() :
GEOSException("InterruptedException", "Interrupted!") {}
};
void
Interrupt::interrupt() { throw InterruptedException(); }
bool Interrupt::requested = false;
Interrupt::Callback *Interrupt::callback = 0;
void *Interrupt::callback_arg = 0;
} // namespace geos::util
} // namespace geos
## Instruction:
Clear interruption request flag just before interrupting
git-svn-id: 6c2b1bd10c324c49ea9d9e6e31006a80e70507cb@3670 5242fede-7e19-0410-aef8-94bd7d2200fb
## Code After:
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2012 Sandro Santilli <strk@keybit.net>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#include <geos/util/Interrupt.h>
#include <geos/util/GEOSException.h> // for inheritance
namespace geos {
namespace util { // geos::util
class GEOS_DLL InterruptedException: public GEOSException {
public:
InterruptedException() :
GEOSException("InterruptedException", "Interrupted!") {}
};
void
Interrupt::interrupt() {
requested = false;
throw InterruptedException();
}
bool Interrupt::requested = false;
Interrupt::Callback *Interrupt::callback = 0;
void *Interrupt::callback_arg = 0;
} // namespace geos::util
} // namespace geos
|
c8ed53166ea9f9cab1f6ef44b19b309024403308 | HISTORY.rst | HISTORY.rst | Changelog
=========
0.2.0 - 2013-07-26
------------------
- Refactor the library a bit and add more tests.
- Backwards incompatible with 0.1.x if using ``URIVariable`` directly from
``uritemplate.template``
0.1.1 - 2013-05-19
------------------
- Add ability to get set of variable names in the current URI
- If there is no value or default given, simply return an empty string
- Fix sdist
0.1.0 - 2013-05-14
------------------
- Initial Release
| Changelog
=========
0.3.0 - 2013-10-22
------------------
- Add ``#partial`` to partially expand templates and return new instances of
``URITemplate``.
0.2.0 - 2013-07-26
------------------
- Refactor the library a bit and add more tests.
- Backwards incompatible with 0.1.x if using ``URIVariable`` directly from
``uritemplate.template``
0.1.1 - 2013-05-19
------------------
- Add ability to get set of variable names in the current URI
- If there is no value or default given, simply return an empty string
- Fix sdist
0.1.0 - 2013-05-14
------------------
- Initial Release
| Update history in prep for new version | Update history in prep for new version
| reStructuredText | bsd-3-clause | pombredanne/uritemplate | restructuredtext | ## Code Before:
Changelog
=========
0.2.0 - 2013-07-26
------------------
- Refactor the library a bit and add more tests.
- Backwards incompatible with 0.1.x if using ``URIVariable`` directly from
``uritemplate.template``
0.1.1 - 2013-05-19
------------------
- Add ability to get set of variable names in the current URI
- If there is no value or default given, simply return an empty string
- Fix sdist
0.1.0 - 2013-05-14
------------------
- Initial Release
## Instruction:
Update history in prep for new version
## Code After:
Changelog
=========
0.3.0 - 2013-10-22
------------------
- Add ``#partial`` to partially expand templates and return new instances of
``URITemplate``.
0.2.0 - 2013-07-26
------------------
- Refactor the library a bit and add more tests.
- Backwards incompatible with 0.1.x if using ``URIVariable`` directly from
``uritemplate.template``
0.1.1 - 2013-05-19
------------------
- Add ability to get set of variable names in the current URI
- If there is no value or default given, simply return an empty string
- Fix sdist
0.1.0 - 2013-05-14
------------------
- Initial Release
|
5ad06cc851338c6edf8cb49d8c009dc5102ae664 | apps/galleries_institutions2/routes.coffee | apps/galleries_institutions2/routes.coffee | PartnerCategories = require '../../collections/partner_categories'
Backbone = require 'backbone'
Q = require 'bluebird-q'
PrimaryCarousel = require './components/primary_carousel/fetch'
CategoryCarousel = require './components/partner_cell_carousel/fetch'
_ = require 'underscore'
fetchCategories = (type) ->
categories = new PartnerCategories()
categories.fetchUntilEnd cache: true, data: category_type: type
.then ->
Q.all categories.map (category) ->
carousel = new CategoryCarousel(category: category)
carousel.fetch()
.then (carousels) ->
_.select carousels, (carousel) ->
carousel.partners.length > 0
@galleries = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all([
carousel.fetch()
fetchCategories('Gallery')
])
.spread (shows, carousels) ->
res.render 'index',
type: 'gallery'
shows: shows
carousels: carousels
.catch next
.done()
@institutions = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all([
carousel.fetch()
fetchCategories('Institution')
])
.spread (shows, carousels) ->
res.render 'index',
type: 'institution'
shows: shows
carousels: carousels
.catch next
.done() | _ = require 'underscore'
Q = require 'bluebird-q'
Backbone = require 'backbone'
PartnerCategories = require '../../collections/partner_categories'
PrimaryCarousel = require './components/primary_carousel/fetch'
CategoryCarousel = require './components/partner_cell_carousel/fetch'
fetchCategories = (type) ->
categories = new PartnerCategories
categories.fetchUntilEnd cache: true, data: category_type: type
.then ->
Q.all categories.map (category) ->
carousel = new CategoryCarousel category: category
carousel.fetch()
.then (carousels) ->
_.select carousels, (carousel) ->
carousel.partners.length > 0
@galleries = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all [
carousel.fetch()
fetchCategories 'Gallery'
]
.spread (shows, carousels) ->
res.locals.sd.CAROUSELS = carousels
res.render 'index',
type: 'gallery'
shows: shows
carousels: carousels
.catch next
.done()
@institutions = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all([
carousel.fetch()
fetchCategories('Institution')
])
.spread (shows, carousels) ->
res.render 'index',
type: 'institution'
shows: shows
carousels: carousels
.catch next
.done() | Fix indentation; bootstrap carousels data | Fix indentation; bootstrap carousels data
| CoffeeScript | mit | cavvia/force-1,izakp/force,kanaabe/force,yuki24/force,dblock/force,cavvia/force-1,oxaudo/force,artsy/force-public,anandaroop/force,mzikherman/force,anandaroop/force,erikdstock/force,kanaabe/force,artsy/force,yuki24/force,eessex/force,yuki24/force,oxaudo/force,yuki24/force,eessex/force,cavvia/force-1,cavvia/force-1,oxaudo/force,damassi/force,kanaabe/force,dblock/force,xtina-starr/force,anandaroop/force,xtina-starr/force,damassi/force,mzikherman/force,artsy/force,izakp/force,eessex/force,erikdstock/force,joeyAghion/force,xtina-starr/force,dblock/force,artsy/force-public,izakp/force,damassi/force,kanaabe/force,joeyAghion/force,eessex/force,artsy/force,xtina-starr/force,mzikherman/force,erikdstock/force,oxaudo/force,damassi/force,joeyAghion/force,artsy/force,mzikherman/force,anandaroop/force,erikdstock/force,joeyAghion/force,kanaabe/force,izakp/force | coffeescript | ## Code Before:
PartnerCategories = require '../../collections/partner_categories'
Backbone = require 'backbone'
Q = require 'bluebird-q'
PrimaryCarousel = require './components/primary_carousel/fetch'
CategoryCarousel = require './components/partner_cell_carousel/fetch'
_ = require 'underscore'
fetchCategories = (type) ->
categories = new PartnerCategories()
categories.fetchUntilEnd cache: true, data: category_type: type
.then ->
Q.all categories.map (category) ->
carousel = new CategoryCarousel(category: category)
carousel.fetch()
.then (carousels) ->
_.select carousels, (carousel) ->
carousel.partners.length > 0
@galleries = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all([
carousel.fetch()
fetchCategories('Gallery')
])
.spread (shows, carousels) ->
res.render 'index',
type: 'gallery'
shows: shows
carousels: carousels
.catch next
.done()
@institutions = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all([
carousel.fetch()
fetchCategories('Institution')
])
.spread (shows, carousels) ->
res.render 'index',
type: 'institution'
shows: shows
carousels: carousels
.catch next
.done()
## Instruction:
Fix indentation; bootstrap carousels data
## Code After:
_ = require 'underscore'
Q = require 'bluebird-q'
Backbone = require 'backbone'
PartnerCategories = require '../../collections/partner_categories'
PrimaryCarousel = require './components/primary_carousel/fetch'
CategoryCarousel = require './components/partner_cell_carousel/fetch'
fetchCategories = (type) ->
categories = new PartnerCategories
categories.fetchUntilEnd cache: true, data: category_type: type
.then ->
Q.all categories.map (category) ->
carousel = new CategoryCarousel category: category
carousel.fetch()
.then (carousels) ->
_.select carousels, (carousel) ->
carousel.partners.length > 0
@galleries = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all [
carousel.fetch()
fetchCategories 'Gallery'
]
.spread (shows, carousels) ->
res.locals.sd.CAROUSELS = carousels
res.render 'index',
type: 'gallery'
shows: shows
carousels: carousels
.catch next
.done()
@institutions = (req, res, next) ->
carousel = new PrimaryCarousel
Q.all([
carousel.fetch()
fetchCategories('Institution')
])
.spread (shows, carousels) ->
res.render 'index',
type: 'institution'
shows: shows
carousels: carousels
.catch next
.done() |
21e5beee94ad077072a080efd4e14346a2d77b79 | lib/recaptcha_mailhide/configuration.rb | lib/recaptcha_mailhide/configuration.rb | module RecaptchaMailhide
class Configuration
attr_accessor :private_key, :public_key
end
end
| module RecaptchaMailhide
class Configuration
attr_writer :private_key, :public_key
def private_key
raise "RecaptchaMailhide's private_key is not set. If you're using Rails add an initializer to config/initializers." unless @private_key
@private_key
end
def public_key
raise "RecaptchaMailhide's public_key is not set. If you're using Rails add an initializer to config/initializers." unless @public_key
@public_key
end
end
end
| Make private_key and public_key raise exceptions if missing from config. | Make private_key and public_key raise exceptions if missing from config.
| Ruby | mit | pilaf/recaptcha-mailhide | ruby | ## Code Before:
module RecaptchaMailhide
class Configuration
attr_accessor :private_key, :public_key
end
end
## Instruction:
Make private_key and public_key raise exceptions if missing from config.
## Code After:
module RecaptchaMailhide
class Configuration
attr_writer :private_key, :public_key
def private_key
raise "RecaptchaMailhide's private_key is not set. If you're using Rails add an initializer to config/initializers." unless @private_key
@private_key
end
def public_key
raise "RecaptchaMailhide's public_key is not set. If you're using Rails add an initializer to config/initializers." unless @public_key
@public_key
end
end
end
|
42d27344488b126f394eb8ee78903bb39166edcc | docker-compose.yml | docker-compose.yml | version: '3'
services:
mysql:
image: ${MYSQL_IMAGE:-percona/percona-server:5.7}
ports:
- ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}:3306
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
mongo:
image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4}
ports:
- ${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}:27017
| version: '3'
services:
mysql:
image: ${MYSQL_IMAGE:-percona/percona-server:5.7}
ports:
- ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}:3306
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
# MariaDB doesn't enable Performance Schema by default so we need to do it manually
# https://mariadb.com/kb/en/mariadb/performance-schema-overview/#activating-the-performance-schema
command: --performance-schema
mongo:
image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4}
ports:
- ${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}:27017
| Enable Performance Schema for MariaDB >= 10.0.12 | Enable Performance Schema for MariaDB >= 10.0.12
| YAML | agpl-3.0 | percona/qan-agent,percona/qan-agent | yaml | ## Code Before:
version: '3'
services:
mysql:
image: ${MYSQL_IMAGE:-percona/percona-server:5.7}
ports:
- ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}:3306
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
mongo:
image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4}
ports:
- ${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}:27017
## Instruction:
Enable Performance Schema for MariaDB >= 10.0.12
## Code After:
version: '3'
services:
mysql:
image: ${MYSQL_IMAGE:-percona/percona-server:5.7}
ports:
- ${MYSQL_HOST:-127.0.0.1}:${MYSQL_PORT:-3306}:3306
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
# MariaDB doesn't enable Performance Schema by default so we need to do it manually
# https://mariadb.com/kb/en/mariadb/performance-schema-overview/#activating-the-performance-schema
command: --performance-schema
mongo:
image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4}
ports:
- ${MONGODB_HOST:-127.0.0.1}:${MONGODB_PORT:-27017}:27017
|
c47093e82a1814dd421c37fc3cbef9512541d526 | test/website.js | test/website.js | var path = require('path');
var _ = require('lodash');
var assert = require('assert');
var fs = require("fs");
var fsUtil = require("../lib/utils/fs");
describe('Website Generator', function () {
it('should correctly generate a book to website', function(done) {
testGeneration(books[1], "site", function(output) {
assert(fs.existsSync(path.join(output, "index.html")));
}, done);
});
it('should correctly include styles in website', function(done) {
testGeneration(books[0], "site", function(output) {
assert(fs.existsSync(path.join(output, "styles/website.css")));
var INDEX = fs.readFileSync(path.join(output, "index.html")).toString();
assert(INDEX.indexOf("styles/website.css") > 0);
}, done);
});
});
| var path = require('path');
var _ = require('lodash');
var assert = require('assert');
var fs = require("fs");
var fsUtil = require("../lib/utils/fs");
describe('Website Generator', function () {
it('should correctly generate a book to website', function(done) {
testGeneration(books[1], "site", function(output) {
assert(fs.existsSync(path.join(output, "index.html")));
}, done);
});
it('should correctly include styles in website', function(done) {
testGeneration(books[0], "site", function(output) {
assert(fs.existsSync(path.join(output, "styles/website.css")));
var INDEX = fs.readFileSync(path.join(output, "index.html")).toString();
assert(INDEX.indexOf("styles/website.css") > 0);
}, done);
});
it('should correctly generate a multilingual book to website', function(done) {
testGeneration(books[2], "site", function(output) {
assert(fs.existsSync(path.join(output, "index.html")));
assert(fs.existsSync(path.join(output, "fr/index.html")));
assert(fs.existsSync(path.join(output, "en/index.html")));
}, done);
});
});
| Add test for generation of multilingual book | Add test for generation of multilingual book
| JavaScript | apache-2.0 | mautic/documentation,JohnTroony/gitbook,justinleoye/gitbook,alex-dixon/gitbook,mautic/documentation,iamchenxin/gitbook,rohan07/gitbook,ryanswanson/gitbook,youprofit/gitbook,strawluffy/gitbook,a-moses/gitbook,OriPekelman/gitbook,tshoper/gitbook,CN-Sean/gitbook,thelastmile/gitbook,OriPekelman/gitbook,2390183798/gitbook,megumiteam/documentation,switchspan/gitbook,xxxhycl2010/gitbook,grokcoder/gitbook,palerdot/gitbook,lucciano/gitbook,sudobashme/gitbook,tshoper/gitbook,ferrior30/gitbook,grokcoder/gitbook,npracht/documentation,ZachLamb/gitbook,guiquanz/gitbook,palerdot/gitbook,guiquanz/gitbook,vehar/gitbook,gaearon/gitbook,wewelove/gitbook,jocr1627/gitbook,ZachLamb/gitbook,switchspan/gitbook,shibe97/gitbook,escopecz/documentation,npracht/documentation,justinleoye/gitbook,gencer/gitbook,xxxhycl2010/gitbook,intfrr/gitbook,athiruban/gitbook,youprofit/gitbook,gencer/gitbook,sunlianghua/gitbook,bradparks/gitbook,webwlsong/gitbook,xcv58/gitbook,minghe/gitbook,boyXiong/gitbook,FKV587/gitbook,minghe/gitbook,tzq668766/gitbook,haamop/documentation,megumiteam/documentation,snowsnail/gitbook,kamyu104/gitbook,athiruban/gitbook,mruse/gitbook,gdbooks/gitbook,alex-dixon/gitbook,iflyup/gitbook,wewelove/gitbook,vehar/gitbook,lucciano/gitbook,intfrr/gitbook,qingying5810/gitbook,hongbinz/gitbook,haamop/documentation,bradparks/gitbook,mruse/gitbook,gaearon/gitbook,qingying5810/gitbook,jasonslyvia/gitbook,sunlianghua/gitbook,gdbooks/gitbook,nycitt/gitbook,GitbookIO/gitbook,shibe97/gitbook,hujianfei1989/gitbook,iamchenxin/gitbook,boyXiong/gitbook,xcv58/gitbook,escopecz/documentation,thelastmile/gitbook,ferrior30/gitbook,nycitt/gitbook,iflyup/gitbook,tzq668766/gitbook,webwlsong/gitbook,CN-Sean/gitbook,sudobashme/gitbook,a-moses/gitbook,FKV587/gitbook,JohnTroony/gitbook,hujianfei1989/gitbook,jocr1627/gitbook,2390183798/gitbook,snowsnail/gitbook,kamyu104/gitbook,jasonslyvia/gitbook,rohan07/gitbook,hongbinz/gitbook | javascript | ## Code Before:
var path = require('path');
var _ = require('lodash');
var assert = require('assert');
var fs = require("fs");
var fsUtil = require("../lib/utils/fs");
describe('Website Generator', function () {
it('should correctly generate a book to website', function(done) {
testGeneration(books[1], "site", function(output) {
assert(fs.existsSync(path.join(output, "index.html")));
}, done);
});
it('should correctly include styles in website', function(done) {
testGeneration(books[0], "site", function(output) {
assert(fs.existsSync(path.join(output, "styles/website.css")));
var INDEX = fs.readFileSync(path.join(output, "index.html")).toString();
assert(INDEX.indexOf("styles/website.css") > 0);
}, done);
});
});
## Instruction:
Add test for generation of multilingual book
## Code After:
var path = require('path');
var _ = require('lodash');
var assert = require('assert');
var fs = require("fs");
var fsUtil = require("../lib/utils/fs");
describe('Website Generator', function () {
it('should correctly generate a book to website', function(done) {
testGeneration(books[1], "site", function(output) {
assert(fs.existsSync(path.join(output, "index.html")));
}, done);
});
it('should correctly include styles in website', function(done) {
testGeneration(books[0], "site", function(output) {
assert(fs.existsSync(path.join(output, "styles/website.css")));
var INDEX = fs.readFileSync(path.join(output, "index.html")).toString();
assert(INDEX.indexOf("styles/website.css") > 0);
}, done);
});
it('should correctly generate a multilingual book to website', function(done) {
testGeneration(books[2], "site", function(output) {
assert(fs.existsSync(path.join(output, "index.html")));
assert(fs.existsSync(path.join(output, "fr/index.html")));
assert(fs.existsSync(path.join(output, "en/index.html")));
}, done);
});
});
|
f6a37eae5b86b40ee55bbc67401fd24d44647d76 | tests/embodiment/Learning/behavior/CMakeLists.txt | tests/embodiment/Learning/behavior/CMakeLists.txt |
LINK_LIBRARIES (
Control
behavior
comboreduct
util
${PROJECT_LIBRARIES}
)
ADD_CXXTEST(BehaviorDescriptionMatcherUTest)
ADD_CXXTEST(CompositeBehaviorDescriptionUTest)
ADD_CXXTEST(BehaviorCategoryUTest)
ADD_CXXTEST(BDRetrieverUTest)
LINK_LIBRARIES(
oac
lslib
Control
AvatarComboVocabulary
comboreduct
)
ADD_CXXTEST(BEUTest)
|
INCLUDE_DIRECTORIES (
${PYTHON_INCLUDE_PATH}
)
LINK_LIBRARIES (
Control
behavior
comboreduct
util
${PROJECT_LIBRARIES}
)
ADD_CXXTEST(BehaviorDescriptionMatcherUTest)
ADD_CXXTEST(CompositeBehaviorDescriptionUTest)
ADD_CXXTEST(BehaviorCategoryUTest)
ADD_CXXTEST(BDRetrieverUTest)
LINK_LIBRARIES(
oac
lslib
Control
AvatarComboVocabulary
comboreduct
)
ADD_CXXTEST(BEUTest)
| Add explicit python include path | Add explicit python include path
| Text | agpl-3.0 | MarcosPividori/atomspace,rohit12/opencog,ceefour/opencog,shujingke/opencog,Selameab/opencog,kinoc/opencog,kim135797531/opencog,eddiemonroe/atomspace,ceefour/atomspace,eddiemonroe/opencog,kim135797531/opencog,iAMr00t/opencog,gaapt/opencog,shujingke/opencog,ceefour/opencog,misgeatgit/opencog,gavrieltal/opencog,eddiemonroe/atomspace,gaapt/opencog,kinoc/opencog,virneo/opencog,ruiting/opencog,andre-senna/opencog,ceefour/opencog,ruiting/opencog,jswiergo/atomspace,williampma/opencog,kim135797531/opencog,misgeatgit/atomspace,sumitsourabh/opencog,ArvinPan/opencog,zhaozengguang/opencog,prateeksaxena2809/opencog,rodsol/atomspace,ArvinPan/atomspace,gaapt/opencog,Allend575/opencog,roselleebarle04/opencog,inflector/atomspace,sumitsourabh/opencog,rodsol/opencog,Selameab/opencog,gavrieltal/opencog,Allend575/opencog,virneo/atomspace,Selameab/atomspace,iAMr00t/opencog,ruiting/opencog,roselleebarle04/opencog,shujingke/opencog,williampma/opencog,jswiergo/atomspace,prateeksaxena2809/opencog,TheNameIsNigel/opencog,virneo/opencog,printedheart/opencog,Allend575/opencog,tim777z/opencog,cosmoharrigan/opencog,TheNameIsNigel/opencog,sumitsourabh/opencog,cosmoharrigan/atomspace,ArvinPan/atomspace,ceefour/opencog,cosmoharrigan/atomspace,TheNameIsNigel/opencog,jlegendary/opencog,misgeatgit/opencog,jlegendary/opencog,shujingke/opencog,misgeatgit/opencog,zhaozengguang/opencog,williampma/atomspace,cosmoharrigan/opencog,williampma/opencog,cosmoharrigan/opencog,williampma/opencog,yantrabuddhi/opencog,zhaozengguang/opencog,kim135797531/opencog,jlegendary/opencog,rohit12/atomspace,eddiemonroe/opencog,andre-senna/opencog,rohit12/opencog,virneo/opencog,rodsol/opencog,sumitsourabh/opencog,williampma/atomspace,rohit12/atomspace,eddiemonroe/opencog,Tiggels/opencog,UIKit0/atomspace,eddiemonroe/opencog,jlegendary/opencog,TheNameIsNigel/opencog,Allend575/opencog,virneo/atomspace,andre-senna/opencog,yantrabuddhi/opencog,inflector/atomspace,rohit12/opencog,AmeBel/atomspace,inflector/opencog,inflector/atomspace,eddiemonroe/atomspace,roselleebarle04/opencog,Selameab/atomspace,eddiemonroe/opencog,gaapt/opencog,inflector/opencog,williampma/opencog,jlegendary/opencog,inflector/opencog,AmeBel/atomspace,ruiting/opencog,rohit12/atomspace,rTreutlein/atomspace,ArvinPan/atomspace,cosmoharrigan/opencog,MarcosPividori/atomspace,yantrabuddhi/atomspace,williampma/atomspace,rTreutlein/atomspace,rodsol/atomspace,ArvinPan/opencog,Selameab/atomspace,ruiting/opencog,misgeatgit/atomspace,printedheart/atomspace,inflector/opencog,Allend575/opencog,rodsol/opencog,virneo/opencog,tim777z/opencog,virneo/atomspace,prateeksaxena2809/opencog,kim135797531/opencog,Tiggels/opencog,jswiergo/atomspace,rTreutlein/atomspace,printedheart/atomspace,Selameab/opencog,gaapt/opencog,iAMr00t/opencog,printedheart/atomspace,andre-senna/opencog,misgeatgit/opencog,tim777z/opencog,yantrabuddhi/atomspace,kinoc/opencog,MarcosPividori/atomspace,UIKit0/atomspace,misgeatgit/atomspace,virneo/atomspace,cosmoharrigan/atomspace,jswiergo/atomspace,roselleebarle04/opencog,yantrabuddhi/atomspace,Allend575/opencog,ruiting/opencog,roselleebarle04/opencog,Tiggels/opencog,virneo/opencog,sumitsourabh/opencog,eddiemonroe/opencog,ceefour/atomspace,sanuj/opencog,williampma/atomspace,iAMr00t/opencog,inflector/opencog,ceefour/atomspace,yantrabuddhi/opencog,roselleebarle04/opencog,anitzkin/opencog,Selameab/atomspace,rTreutlein/atomspace,sumitsourabh/opencog,andre-senna/opencog,ruiting/opencog,prateeksaxena2809/opencog,yantrabuddhi/atomspace,printedheart/opencog,AmeBel/opencog,kinoc/opencog,gavrieltal/opencog,sanuj/opencog,gavrieltal/opencog,tim777z/opencog,rohit12/atomspace,sanuj/opencog,jlegendary/opencog,AmeBel/opencog,printedheart/atomspace,anitzkin/opencog,eddiemonroe/atomspace,ArvinPan/opencog,yantrabuddhi/opencog,Selameab/opencog,shujingke/opencog,prateeksaxena2809/opencog,Tiggels/opencog,ArvinPan/opencog,zhaozengguang/opencog,sanuj/opencog,AmeBel/opencog,inflector/atomspace,shujingke/opencog,sanuj/opencog,inflector/atomspace,iAMr00t/opencog,zhaozengguang/opencog,rTreutlein/atomspace,andre-senna/opencog,rodsol/opencog,kinoc/opencog,inflector/opencog,rohit12/opencog,zhaozengguang/opencog,AmeBel/opencog,iAMr00t/opencog,printedheart/opencog,tim777z/opencog,AmeBel/opencog,misgeatgit/opencog,rodsol/atomspace,misgeatgit/opencog,Selameab/opencog,shujingke/opencog,tim777z/opencog,roselleebarle04/opencog,ArvinPan/atomspace,ArvinPan/opencog,inflector/opencog,printedheart/opencog,andre-senna/opencog,UIKit0/atomspace,AmeBel/atomspace,rohit12/opencog,gavrieltal/opencog,sumitsourabh/opencog,kinoc/opencog,Allend575/opencog,anitzkin/opencog,ArvinPan/opencog,TheNameIsNigel/opencog,rodsol/opencog,rodsol/atomspace,anitzkin/opencog,Selameab/opencog,cosmoharrigan/opencog,AmeBel/atomspace,prateeksaxena2809/opencog,printedheart/opencog,ceefour/atomspace,yantrabuddhi/atomspace,gavrieltal/opencog,printedheart/opencog,yantrabuddhi/opencog,TheNameIsNigel/opencog,Tiggels/opencog,inflector/opencog,sanuj/opencog,kim135797531/opencog,AmeBel/opencog,gavrieltal/opencog,jlegendary/opencog,virneo/opencog,ceefour/opencog,misgeatgit/atomspace,williampma/opencog,yantrabuddhi/opencog,misgeatgit/opencog,ceefour/opencog,MarcosPividori/atomspace,cosmoharrigan/atomspace,kim135797531/opencog,prateeksaxena2809/opencog,misgeatgit/opencog,cosmoharrigan/opencog,ceefour/opencog,eddiemonroe/atomspace,kinoc/opencog,yantrabuddhi/opencog,eddiemonroe/opencog,anitzkin/opencog,AmeBel/atomspace,misgeatgit/atomspace,rodsol/opencog,gaapt/opencog,AmeBel/opencog,anitzkin/opencog,gaapt/opencog,anitzkin/opencog,virneo/opencog,UIKit0/atomspace,misgeatgit/opencog,Tiggels/opencog,rohit12/opencog | text | ## Code Before:
LINK_LIBRARIES (
Control
behavior
comboreduct
util
${PROJECT_LIBRARIES}
)
ADD_CXXTEST(BehaviorDescriptionMatcherUTest)
ADD_CXXTEST(CompositeBehaviorDescriptionUTest)
ADD_CXXTEST(BehaviorCategoryUTest)
ADD_CXXTEST(BDRetrieverUTest)
LINK_LIBRARIES(
oac
lslib
Control
AvatarComboVocabulary
comboreduct
)
ADD_CXXTEST(BEUTest)
## Instruction:
Add explicit python include path
## Code After:
INCLUDE_DIRECTORIES (
${PYTHON_INCLUDE_PATH}
)
LINK_LIBRARIES (
Control
behavior
comboreduct
util
${PROJECT_LIBRARIES}
)
ADD_CXXTEST(BehaviorDescriptionMatcherUTest)
ADD_CXXTEST(CompositeBehaviorDescriptionUTest)
ADD_CXXTEST(BehaviorCategoryUTest)
ADD_CXXTEST(BDRetrieverUTest)
LINK_LIBRARIES(
oac
lslib
Control
AvatarComboVocabulary
comboreduct
)
ADD_CXXTEST(BEUTest)
|
2249452542dee82b463de4870b40f05ff467a99b | list/list.go | list/list.go | package list
import "fmt"
type List struct {
first *Node
last *Node
size int
}
type Node struct {
next *Node
val int
}
func (l *List) String() string {
if l.IsEmpty() {
return "List()"
} else {
return fmt.Sprintf("List(%s)", l.first.Stringl())
}
}
func (n *Node) String() string {
return fmt.Sprintf("%d", n.val)
}
func (n *Node) Stringl() string {
if n.next == nil {
return fmt.Sprintf("%q", n)
} else {
return fmt.Sprintf("%q, %s", n, n.next.Stringl())
}
}
func (l *List) IsEmpty() bool {
return l.size == 0
}
func (l *List) Push(i int) {
n := &Node{val: i}
if l.IsEmpty() {
l.first = n
l.last = n
} else {
l.last.next = n
l.last = n
}
l.size++
}
| package list
import "fmt"
type List struct {
first *Node
last *Node
size int
}
type Node struct {
next *Node
val int
}
func (l *List) String() string {
if l.IsEmpty() {
return "List()"
} else {
return fmt.Sprintf("List(%s)", l.first.Stringl())
}
}
func (n *Node) String() string {
return fmt.Sprintf("%d", n.val)
}
func (n *Node) Stringl() string {
if n.next == nil {
return fmt.Sprintf("%q", n)
} else {
return fmt.Sprintf("%q, %s", n, n.next.Stringl())
}
}
func (l *List) IsEmpty() bool {
return l.size == 0
}
func (l *List) Push(i int) {
n := &Node{val: i}
if l.IsEmpty() {
l.first = n
l.last = n
} else {
l.last.next = n
l.last = n
}
l.size++
}
func (l *List) Shift() (i int, err error) {
if l.IsEmpty() {
err = fmt.Errorf("Shift from empty list")
return
}
i, l.first = l.first.val, l.first.next
l.size--
return
}
| Add Shift and you've got a Queue going... | Add Shift and you've got a Queue going...
| Go | unlicense | neilvallon/alGo | go | ## Code Before:
package list
import "fmt"
type List struct {
first *Node
last *Node
size int
}
type Node struct {
next *Node
val int
}
func (l *List) String() string {
if l.IsEmpty() {
return "List()"
} else {
return fmt.Sprintf("List(%s)", l.first.Stringl())
}
}
func (n *Node) String() string {
return fmt.Sprintf("%d", n.val)
}
func (n *Node) Stringl() string {
if n.next == nil {
return fmt.Sprintf("%q", n)
} else {
return fmt.Sprintf("%q, %s", n, n.next.Stringl())
}
}
func (l *List) IsEmpty() bool {
return l.size == 0
}
func (l *List) Push(i int) {
n := &Node{val: i}
if l.IsEmpty() {
l.first = n
l.last = n
} else {
l.last.next = n
l.last = n
}
l.size++
}
## Instruction:
Add Shift and you've got a Queue going...
## Code After:
package list
import "fmt"
type List struct {
first *Node
last *Node
size int
}
type Node struct {
next *Node
val int
}
func (l *List) String() string {
if l.IsEmpty() {
return "List()"
} else {
return fmt.Sprintf("List(%s)", l.first.Stringl())
}
}
func (n *Node) String() string {
return fmt.Sprintf("%d", n.val)
}
func (n *Node) Stringl() string {
if n.next == nil {
return fmt.Sprintf("%q", n)
} else {
return fmt.Sprintf("%q, %s", n, n.next.Stringl())
}
}
func (l *List) IsEmpty() bool {
return l.size == 0
}
func (l *List) Push(i int) {
n := &Node{val: i}
if l.IsEmpty() {
l.first = n
l.last = n
} else {
l.last.next = n
l.last = n
}
l.size++
}
func (l *List) Shift() (i int, err error) {
if l.IsEmpty() {
err = fmt.Errorf("Shift from empty list")
return
}
i, l.first = l.first.val, l.first.next
l.size--
return
}
|
256f4f64c3ba119b9b27537200643bd0879b009d | lib/theme-and-appearance.zsh | lib/theme-and-appearance.zsh | autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
export LS_COLORS
# Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ]
then
# Find the option for using colors in ls, depending on the version: Linux or BSD
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
# setup LS_COLORS (Linux)
eval $(dircolors -b)
fi
#setopt no_beep
setopt auto_cd
setopt multios
setopt cdablevarS
if [[ x$WINDOW != x ]]
then
SCREEN_NO="%B$WINDOW%b "
else
SCREEN_NO=""
fi
# Apply theming defaults
PS1="%n@%m:%~%# "
# git theming default: Variables for theming the git info prompt
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
# Setup the prompt with pretty colors
setopt prompt_subst
| autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
export LS_COLORS
# Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ]; then
# Find the option for using colors in ls, depending on the version: Linux or BSD
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
# setup LS_COLORS (Linux)
: ${DIRCOLORS_FILE:=~/.dotfiles/lib/LS_COLORS/LS_COLORS}
if [ -f $DIRCOLORS_FILE ] ; then
eval $(dircolors -b $DIRCOLORS_FILE)
else
eval $(dircolors -b)
fi
fi
#setopt no_beep
setopt auto_cd
setopt multios
setopt cdablevarS
if [[ x$WINDOW != x ]]
then
SCREEN_NO="%B$WINDOW%b "
else
SCREEN_NO=""
fi
# Apply theming defaults
PS1="%n@%m:%~%# "
# git theming default: Variables for theming the git info prompt
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
# Setup the prompt with pretty colors
setopt prompt_subst
| Use LS_COLORS (git submodule) if available. | Use LS_COLORS (git submodule) if available.
| Shell | mit | blueyed/oh-my-zsh,blueyed/oh-my-zsh,blueyed/oh-my-zsh | shell | ## Code Before:
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
export LS_COLORS
# Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ]
then
# Find the option for using colors in ls, depending on the version: Linux or BSD
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
# setup LS_COLORS (Linux)
eval $(dircolors -b)
fi
#setopt no_beep
setopt auto_cd
setopt multios
setopt cdablevarS
if [[ x$WINDOW != x ]]
then
SCREEN_NO="%B$WINDOW%b "
else
SCREEN_NO=""
fi
# Apply theming defaults
PS1="%n@%m:%~%# "
# git theming default: Variables for theming the git info prompt
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
# Setup the prompt with pretty colors
setopt prompt_subst
## Instruction:
Use LS_COLORS (git submodule) if available.
## Code After:
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
export LS_COLORS
# Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ]; then
# Find the option for using colors in ls, depending on the version: Linux or BSD
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
# setup LS_COLORS (Linux)
: ${DIRCOLORS_FILE:=~/.dotfiles/lib/LS_COLORS/LS_COLORS}
if [ -f $DIRCOLORS_FILE ] ; then
eval $(dircolors -b $DIRCOLORS_FILE)
else
eval $(dircolors -b)
fi
fi
#setopt no_beep
setopt auto_cd
setopt multios
setopt cdablevarS
if [[ x$WINDOW != x ]]
then
SCREEN_NO="%B$WINDOW%b "
else
SCREEN_NO=""
fi
# Apply theming defaults
PS1="%n@%m:%~%# "
# git theming default: Variables for theming the git info prompt
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
# Setup the prompt with pretty colors
setopt prompt_subst
|
c695c5b60f638ea803ca82110841ef5bb7b7133c | server/validations/project.js | server/validations/project.js | const Joi = require('joi');
const PARAMS = {
name: Joi.string().required()
};
const PAYLOAD = {
name: Joi.string().required(),
maintainers: Joi.array(),
description: Joi.string(),
hasLicense: Joi.boolean(),
hasLinter: Joi.boolean(),
hasReadme: Joi.boolean(),
engines: {
npm: Joi.string(),
node: Joi.string()
}
};
exports.create = {
payload: PAYLOAD
};
exports.delete = {
params: PARAMS
};
exports.getOne = {
params: PARAMS
};
exports.update = {
params: PARAMS,
payload: PAYLOAD
};
| const Joi = require('joi');
const PARAMS = {
name: Joi.string().required()
};
const PAYLOAD = {
name: Joi.string().required(),
maintainers: Joi.array(),
description: Joi.string(),
hasLicense: Joi.boolean(),
hasLinter: Joi.boolean(),
hasReadme: Joi.boolean(),
engines: {
npm: Joi.string(),
node: Joi.string()
}
};
const QUERY = {
limit: Joi.number(),
offset: Joi.number(),
sort: Joi.string().allow('asc', 'ascending', 'desc', 'descending')
};
exports.create = {
payload: PAYLOAD
};
exports.delete = {
params: PARAMS
};
exports.getOne = {
params: PARAMS
};
exports.getAll = {
query: QUERY
};
exports.update = {
params: PARAMS,
payload: PAYLOAD
};
| Add validation rules for limit, offset, and sorting | Add validation rules for limit, offset, and sorting
| JavaScript | mit | onmodulus/demographics | javascript | ## Code Before:
const Joi = require('joi');
const PARAMS = {
name: Joi.string().required()
};
const PAYLOAD = {
name: Joi.string().required(),
maintainers: Joi.array(),
description: Joi.string(),
hasLicense: Joi.boolean(),
hasLinter: Joi.boolean(),
hasReadme: Joi.boolean(),
engines: {
npm: Joi.string(),
node: Joi.string()
}
};
exports.create = {
payload: PAYLOAD
};
exports.delete = {
params: PARAMS
};
exports.getOne = {
params: PARAMS
};
exports.update = {
params: PARAMS,
payload: PAYLOAD
};
## Instruction:
Add validation rules for limit, offset, and sorting
## Code After:
const Joi = require('joi');
const PARAMS = {
name: Joi.string().required()
};
const PAYLOAD = {
name: Joi.string().required(),
maintainers: Joi.array(),
description: Joi.string(),
hasLicense: Joi.boolean(),
hasLinter: Joi.boolean(),
hasReadme: Joi.boolean(),
engines: {
npm: Joi.string(),
node: Joi.string()
}
};
const QUERY = {
limit: Joi.number(),
offset: Joi.number(),
sort: Joi.string().allow('asc', 'ascending', 'desc', 'descending')
};
exports.create = {
payload: PAYLOAD
};
exports.delete = {
params: PARAMS
};
exports.getOne = {
params: PARAMS
};
exports.getAll = {
query: QUERY
};
exports.update = {
params: PARAMS,
payload: PAYLOAD
};
|
5700c905ca156d311f6edb48347f17783f3f4439 | test/attr/attr_availability.swift | test/attr/attr_availability.swift | // RUN: %swift %s -parse -verify
@availability(*, unavailable)
func unavailable_func() {}
@availability(*, unavailable, message="message")
func unavailable_func_with_message() {}
@availability(iOS, unavailable)
@availability(OSX, unavailable)
func unavailable_multiple_platforms() {}
@availability(badPlatform, unavailable) // expected-error {{unknown platform 'badPlatform' for attribute 'availability'}}
func unavailable_bad_platform() {}
// Handle unknown platform.
@availability(HAL9000, unavailable) // expected-error {{unknown platform 'HAL9000'}}
func availabilityUnknownPlatform() {}
// <rdar://problem/17669805> Availability can't appear on a typealias
@availability(*, unavailable, message="oh no you dont")
typealias int = Int
var x : int // expected-error {{'int' is unavailable: oh no you dont}}
| // RUN: %swift %s -parse -verify
@availability(*, unavailable)
func unavailable_func() {}
@availability(*, unavailable, message="message")
func unavailable_func_with_message() {}
@availability(iOS, unavailable)
@availability(OSX, unavailable)
func unavailable_multiple_platforms() {}
@availability // expected-error {{expected '(' in 'availability' attribute}}
func noArgs() {}
@availability(*) // expected-error {{expected ',' in 'availability' attribute}} expected-error {{expected declaration}}
func noKind() {}
@availability(badPlatform, unavailable) // expected-error {{unknown platform 'badPlatform' for attribute 'availability'}}
func unavailable_bad_platform() {}
// Handle unknown platform.
@availability(HAL9000, unavailable) // expected-error {{unknown platform 'HAL9000'}}
func availabilityUnknownPlatform() {}
// <rdar://problem/17669805> Availability can't appear on a typealias
@availability(*, unavailable, message="oh no you dont")
typealias int = Int
var x : int // expected-error {{'int' is unavailable: oh no you dont}}
| Add some tests for malformed availability attributes. | Add some tests for malformed availability attributes.
This tests a few diagnostics that hadn't ever been tested before
(for any attributes).
Swift SVN r20029
| Swift | apache-2.0 | xedin/swift,gottesmm/swift,parkera/swift,CodaFi/swift,calebd/swift,huonw/swift,benlangmuir/swift,felix91gr/swift,amraboelela/swift,kusl/swift,KrishMunot/swift,khizkhiz/swift,zisko/swift,LeoShimonaka/swift,tinysun212/swift-windows,harlanhaskins/swift,LeoShimonaka/swift,LeoShimonaka/swift,glessard/swift,brentdax/swift,khizkhiz/swift,allevato/swift,milseman/swift,jmgc/swift,return/swift,djwbrown/swift,bitjammer/swift,gmilos/swift,brentdax/swift,adrfer/swift,hooman/swift,arvedviehweger/swift,sschiau/swift,rudkx/swift,shahmishal/swift,ahoppen/swift,swiftix/swift,Ivacker/swift,natecook1000/swift,shahmishal/swift,alblue/swift,OscarSwanros/swift,swiftix/swift.old,jopamer/swift,tkremenek/swift,tardieu/swift,lorentey/swift,sschiau/swift,alblue/swift,JaSpa/swift,frootloops/swift,austinzheng/swift,jckarter/swift,harlanhaskins/swift,milseman/swift,xedin/swift,sschiau/swift,codestergit/swift,uasys/swift,gribozavr/swift,danielmartin/swift,harlanhaskins/swift,arvedviehweger/swift,cbrentharris/swift,sdulal/swift,roambotics/swift,deyton/swift,russbishop/swift,atrick/swift,slavapestov/swift,JaSpa/swift,allevato/swift,Ivacker/swift,therealbnut/swift,harlanhaskins/swift,tinysun212/swift-windows,benlangmuir/swift,therealbnut/swift,swiftix/swift.old,austinzheng/swift,swiftix/swift.old,ken0nek/swift,xedin/swift,alblue/swift,practicalswift/swift,kstaring/swift,amraboelela/swift,gottesmm/swift,shahmishal/swift,therealbnut/swift,kperryua/swift,harlanhaskins/swift,JGiola/swift,swiftix/swift.old,karwa/swift,jmgc/swift,bitjammer/swift,shajrawi/swift,djwbrown/swift,cbrentharris/swift,kusl/swift,austinzheng/swift,tinysun212/swift-windows,lorentey/swift,mightydeveloper/swift,emilstahl/swift,danielmartin/swift,modocache/swift,SwiftAndroid/swift,nathawes/swift,calebd/swift,djwbrown/swift,alblue/swift,gmilos/swift,emilstahl/swift,shajrawi/swift,swiftix/swift.old,karwa/swift,tinysun212/swift-windows,Jnosh/swift,hughbe/swift,shahmishal/swift,apple/swift,emilstahl/swift,IngmarStein/swift,brentdax/swift,ahoppen/swift,shahmishal/swift,hughbe/swift,SwiftAndroid/swift,alblue/swift,kusl/swift,lorentey/swift,codestergit/swift,kstaring/swift,khizkhiz/swift,glessard/swift,hughbe/swift,devincoughlin/swift,hooman/swift,tjw/swift,sdulal/swift,kstaring/swift,gribozavr/swift,xedin/swift,jmgc/swift,Ivacker/swift,Jnosh/swift,shajrawi/swift,dduan/swift,jopamer/swift,milseman/swift,danielmartin/swift,johnno1962d/swift,russbishop/swift,LeoShimonaka/swift,KrishMunot/swift,sdulal/swift,kentya6/swift,emilstahl/swift,stephentyrone/swift,gribozavr/swift,xwu/swift,frootloops/swift,SwiftAndroid/swift,MukeshKumarS/Swift,slavapestov/swift,practicalswift/swift,SwiftAndroid/swift,huonw/swift,aschwaighofer/swift,frootloops/swift,Ivacker/swift,austinzheng/swift,russbishop/swift,ahoppen/swift,ken0nek/swift,felix91gr/swift,gottesmm/swift,ben-ng/swift,khizkhiz/swift,JGiola/swift,natecook1000/swift,adrfer/swift,devincoughlin/swift,jopamer/swift,kstaring/swift,natecook1000/swift,austinzheng/swift,xedin/swift,shajrawi/swift,airspeedswift/swift,swiftix/swift.old,sschiau/swift,tinysun212/swift-windows,ahoppen/swift,gmilos/swift,karwa/swift,return/swift,OscarSwanros/swift,arvedviehweger/swift,allevato/swift,kperryua/swift,hughbe/swift,milseman/swift,amraboelela/swift,tjw/swift,austinzheng/swift,gregomni/swift,ben-ng/swift,jckarter/swift,kstaring/swift,arvedviehweger/swift,swiftix/swift,OscarSwanros/swift,devincoughlin/swift,gribozavr/swift,swiftix/swift,johnno1962d/swift,nathawes/swift,russbishop/swift,ken0nek/swift,khizkhiz/swift,tardieu/swift,practicalswift/swift,uasys/swift,Jnosh/swift,codestergit/swift,dduan/swift,emilstahl/swift,karwa/swift,russbishop/swift,KrishMunot/swift,modocache/swift,swiftix/swift,amraboelela/swift,emilstahl/swift,swiftix/swift.old,sdulal/swift,allevato/swift,LeoShimonaka/swift,johnno1962d/swift,tjw/swift,hooman/swift,gregomni/swift,deyton/swift,natecook1000/swift,rudkx/swift,harlanhaskins/swift,roambotics/swift,roambotics/swift,rudkx/swift,roambotics/swift,cbrentharris/swift,zisko/swift,parkera/swift,modocache/swift,adrfer/swift,hooman/swift,mightydeveloper/swift,jckarter/swift,lorentey/swift,gribozavr/swift,shajrawi/swift,arvedviehweger/swift,apple/swift,deyton/swift,djwbrown/swift,ben-ng/swift,tkremenek/swift,shahmishal/swift,milseman/swift,deyton/swift,danielmartin/swift,slavapestov/swift,glessard/swift,adrfer/swift,zisko/swift,JaSpa/swift,return/swift,milseman/swift,MukeshKumarS/Swift,CodaFi/swift,jmgc/swift,shahmishal/swift,gottesmm/swift,OscarSwanros/swift,Jnosh/swift,tardieu/swift,frootloops/swift,jckarter/swift,parkera/swift,KrishMunot/swift,return/swift,uasys/swift,zisko/swift,khizkhiz/swift,russbishop/swift,IngmarStein/swift,modocache/swift,apple/swift,practicalswift/swift,aschwaighofer/swift,swiftix/swift,ken0nek/swift,mightydeveloper/swift,benlangmuir/swift,tjw/swift,mightydeveloper/swift,MukeshKumarS/Swift,hooman/swift,johnno1962d/swift,bitjammer/swift,ken0nek/swift,practicalswift/swift,danielmartin/swift,jopamer/swift,johnno1962d/swift,slavapestov/swift,KrishMunot/swift,calebd/swift,uasys/swift,deyton/swift,IngmarStein/swift,kusl/swift,nathawes/swift,kentya6/swift,brentdax/swift,glessard/swift,dduan/swift,kentya6/swift,dreamsxin/swift,sdulal/swift,therealbnut/swift,devincoughlin/swift,allevato/swift,parkera/swift,natecook1000/swift,swiftix/swift,jtbandes/swift,Ivacker/swift,IngmarStein/swift,tjw/swift,karwa/swift,IngmarStein/swift,sschiau/swift,harlanhaskins/swift,gregomni/swift,xwu/swift,kperryua/swift,glessard/swift,gmilos/swift,kusl/swift,jtbandes/swift,hooman/swift,devincoughlin/swift,nathawes/swift,gregomni/swift,alblue/swift,jckarter/swift,tkremenek/swift,lorentey/swift,sdulal/swift,KrishMunot/swift,airspeedswift/swift,parkera/swift,airspeedswift/swift,xwu/swift,ben-ng/swift,huonw/swift,tinysun212/swift-windows,lorentey/swift,slavapestov/swift,stephentyrone/swift,jopamer/swift,shahmishal/swift,dreamsxin/swift,hughbe/swift,MukeshKumarS/Swift,tinysun212/swift-windows,rudkx/swift,IngmarStein/swift,OscarSwanros/swift,ahoppen/swift,kentya6/swift,rudkx/swift,atrick/swift,practicalswift/swift,CodaFi/swift,mightydeveloper/swift,LeoShimonaka/swift,felix91gr/swift,tkremenek/swift,Ivacker/swift,djwbrown/swift,slavapestov/swift,jopamer/swift,roambotics/swift,zisko/swift,Ivacker/swift,gribozavr/swift,sschiau/swift,adrfer/swift,OscarSwanros/swift,johnno1962d/swift,gottesmm/swift,SwiftAndroid/swift,stephentyrone/swift,nathawes/swift,gregomni/swift,jtbandes/swift,kperryua/swift,ken0nek/swift,mightydeveloper/swift,aschwaighofer/swift,CodaFi/swift,return/swift,sdulal/swift,therealbnut/swift,atrick/swift,tkremenek/swift,devincoughlin/swift,felix91gr/swift,practicalswift/swift,cbrentharris/swift,sdulal/swift,bitjammer/swift,aschwaighofer/swift,calebd/swift,amraboelela/swift,bitjammer/swift,tjw/swift,LeoShimonaka/swift,gregomni/swift,SwiftAndroid/swift,JGiola/swift,kusl/swift,frootloops/swift,kperryua/swift,gribozavr/swift,manavgabhawala/swift,parkera/swift,kentya6/swift,hooman/swift,uasys/swift,jtbandes/swift,felix91gr/swift,codestergit/swift,jtbandes/swift,codestergit/swift,sschiau/swift,danielmartin/swift,MukeshKumarS/Swift,deyton/swift,karwa/swift,frootloops/swift,Jnosh/swift,IngmarStein/swift,brentdax/swift,cbrentharris/swift,natecook1000/swift,kentya6/swift,JaSpa/swift,devincoughlin/swift,glessard/swift,parkera/swift,milseman/swift,codestergit/swift,xwu/swift,sschiau/swift,ahoppen/swift,aschwaighofer/swift,djwbrown/swift,arvedviehweger/swift,adrfer/swift,adrfer/swift,felix91gr/swift,therealbnut/swift,tardieu/swift,mightydeveloper/swift,apple/swift,kentya6/swift,karwa/swift,apple/swift,natecook1000/swift,nathawes/swift,dduan/swift,tkremenek/swift,Jnosh/swift,benlangmuir/swift,xwu/swift,benlangmuir/swift,calebd/swift,kstaring/swift,jckarter/swift,allevato/swift,shajrawi/swift,devincoughlin/swift,gottesmm/swift,roambotics/swift,manavgabhawala/swift,LeoShimonaka/swift,shajrawi/swift,Ivacker/swift,danielmartin/swift,gmilos/swift,rudkx/swift,JaSpa/swift,allevato/swift,felix91gr/swift,Jnosh/swift,jckarter/swift,swiftix/swift,KrishMunot/swift,emilstahl/swift,aschwaighofer/swift,emilstahl/swift,manavgabhawala/swift,SwiftAndroid/swift,xwu/swift,kusl/swift,xedin/swift,shajrawi/swift,atrick/swift,karwa/swift,CodaFi/swift,kstaring/swift,xedin/swift,airspeedswift/swift,zisko/swift,dduan/swift,uasys/swift,calebd/swift,OscarSwanros/swift,airspeedswift/swift,tardieu/swift,bitjammer/swift,manavgabhawala/swift,manavgabhawala/swift,lorentey/swift,modocache/swift,stephentyrone/swift,uasys/swift,dduan/swift,tardieu/swift,ken0nek/swift,cbrentharris/swift,JaSpa/swift,manavgabhawala/swift,tjw/swift,russbishop/swift,hughbe/swift,jmgc/swift,kusl/swift,JGiola/swift,dduan/swift,aschwaighofer/swift,JGiola/swift,gribozavr/swift,atrick/swift,khizkhiz/swift,benlangmuir/swift,huonw/swift,huonw/swift,jmgc/swift,kperryua/swift,mightydeveloper/swift,MukeshKumarS/Swift,tardieu/swift,xwu/swift,airspeedswift/swift,jtbandes/swift,nathawes/swift,deyton/swift,jopamer/swift,gmilos/swift,return/swift,huonw/swift,amraboelela/swift,modocache/swift,brentdax/swift,airspeedswift/swift,bitjammer/swift,frootloops/swift,lorentey/swift,jtbandes/swift,modocache/swift,ben-ng/swift,tkremenek/swift,kperryua/swift,djwbrown/swift,atrick/swift,JGiola/swift,JaSpa/swift,ben-ng/swift,stephentyrone/swift,cbrentharris/swift,practicalswift/swift,austinzheng/swift,gottesmm/swift,MukeshKumarS/Swift,slavapestov/swift,johnno1962d/swift,gmilos/swift,swiftix/swift.old,jmgc/swift,CodaFi/swift,manavgabhawala/swift,ben-ng/swift,arvedviehweger/swift,parkera/swift,alblue/swift,brentdax/swift,stephentyrone/swift,xedin/swift,hughbe/swift,apple/swift,therealbnut/swift,cbrentharris/swift,kentya6/swift,stephentyrone/swift,CodaFi/swift,amraboelela/swift,huonw/swift,return/swift,calebd/swift,zisko/swift,codestergit/swift | swift | ## Code Before:
// RUN: %swift %s -parse -verify
@availability(*, unavailable)
func unavailable_func() {}
@availability(*, unavailable, message="message")
func unavailable_func_with_message() {}
@availability(iOS, unavailable)
@availability(OSX, unavailable)
func unavailable_multiple_platforms() {}
@availability(badPlatform, unavailable) // expected-error {{unknown platform 'badPlatform' for attribute 'availability'}}
func unavailable_bad_platform() {}
// Handle unknown platform.
@availability(HAL9000, unavailable) // expected-error {{unknown platform 'HAL9000'}}
func availabilityUnknownPlatform() {}
// <rdar://problem/17669805> Availability can't appear on a typealias
@availability(*, unavailable, message="oh no you dont")
typealias int = Int
var x : int // expected-error {{'int' is unavailable: oh no you dont}}
## Instruction:
Add some tests for malformed availability attributes.
This tests a few diagnostics that hadn't ever been tested before
(for any attributes).
Swift SVN r20029
## Code After:
// RUN: %swift %s -parse -verify
@availability(*, unavailable)
func unavailable_func() {}
@availability(*, unavailable, message="message")
func unavailable_func_with_message() {}
@availability(iOS, unavailable)
@availability(OSX, unavailable)
func unavailable_multiple_platforms() {}
@availability // expected-error {{expected '(' in 'availability' attribute}}
func noArgs() {}
@availability(*) // expected-error {{expected ',' in 'availability' attribute}} expected-error {{expected declaration}}
func noKind() {}
@availability(badPlatform, unavailable) // expected-error {{unknown platform 'badPlatform' for attribute 'availability'}}
func unavailable_bad_platform() {}
// Handle unknown platform.
@availability(HAL9000, unavailable) // expected-error {{unknown platform 'HAL9000'}}
func availabilityUnknownPlatform() {}
// <rdar://problem/17669805> Availability can't appear on a typealias
@availability(*, unavailable, message="oh no you dont")
typealias int = Int
var x : int // expected-error {{'int' is unavailable: oh no you dont}}
|
57d8ad9d10bc1c122e7fad33d015c9d505c8de56 | docs/faqs.rst | docs/faqs.rst | FAQ
=======
*Q: Why do I get "Timestamp for this request is not valid"*
*A*: This occurs in 2 different cases.
The timestamp sent is outside of the serverTime - recvWindow value
The timestamp sent is more than 1000ms ahead of the server time
Check that your system time is in sync. See `this issue <https://github.com/sammchardy/python-binance/issues/2#issuecomment-324878152>`_ for some sample code to check the difference between your local
time and the Binance server time.
*Q: Why do I get "Signature for this request is not valid"*
*A1*: One of your parameters may not be in the correct format.
Check recvWindow is an integer and not a string.
*A2*: You may be attempting to access the API from a Chinese IP address, these are now restricted by Binance.
.. image:: https://analytics-pixel.appspot.com/UA-111417213-1/github/python-binance/docs/faqs?pixel
| FAQ
=======
*Q: Why do I get "Timestamp for this request is not valid"*
*A*: This occurs in 2 different cases.
The timestamp sent is outside of the serverTime - recvWindow value
The timestamp sent is more than 1000ms ahead of the server time
Check that your system time is in sync. See `this issue <https://github.com/sammchardy/python-binance/issues/2#issuecomment-324878152>`_ for some sample code to check the difference between your local
time and the Binance server time.
*Q: Why do I get "Signature for this request is not valid"*
*A1*: One of your parameters may not be in the correct format.
Check recvWindow is an integer and not a string.
*A2*: You may need to regenerate your API Key and Secret
*A3*: You may be attempting to access the API from a Chinese IP address, these are now restricted by Binance.
.. image:: https://analytics-pixel.appspot.com/UA-111417213-1/github/python-binance/docs/faqs?pixel
| Add note about regenerating API key if getting signature error | Add note about regenerating API key if getting signature error
| reStructuredText | mit | sammchardy/python-binance | restructuredtext | ## Code Before:
FAQ
=======
*Q: Why do I get "Timestamp for this request is not valid"*
*A*: This occurs in 2 different cases.
The timestamp sent is outside of the serverTime - recvWindow value
The timestamp sent is more than 1000ms ahead of the server time
Check that your system time is in sync. See `this issue <https://github.com/sammchardy/python-binance/issues/2#issuecomment-324878152>`_ for some sample code to check the difference between your local
time and the Binance server time.
*Q: Why do I get "Signature for this request is not valid"*
*A1*: One of your parameters may not be in the correct format.
Check recvWindow is an integer and not a string.
*A2*: You may be attempting to access the API from a Chinese IP address, these are now restricted by Binance.
.. image:: https://analytics-pixel.appspot.com/UA-111417213-1/github/python-binance/docs/faqs?pixel
## Instruction:
Add note about regenerating API key if getting signature error
## Code After:
FAQ
=======
*Q: Why do I get "Timestamp for this request is not valid"*
*A*: This occurs in 2 different cases.
The timestamp sent is outside of the serverTime - recvWindow value
The timestamp sent is more than 1000ms ahead of the server time
Check that your system time is in sync. See `this issue <https://github.com/sammchardy/python-binance/issues/2#issuecomment-324878152>`_ for some sample code to check the difference between your local
time and the Binance server time.
*Q: Why do I get "Signature for this request is not valid"*
*A1*: One of your parameters may not be in the correct format.
Check recvWindow is an integer and not a string.
*A2*: You may need to regenerate your API Key and Secret
*A3*: You may be attempting to access the API from a Chinese IP address, these are now restricted by Binance.
.. image:: https://analytics-pixel.appspot.com/UA-111417213-1/github/python-binance/docs/faqs?pixel
|
9c864b5a6af44acd07e5b7f2a2c742dcf8f4aa30 | README.md | README.md | PluginUnloadingTest
===================
A proof of concept of dynamic plugin unloading.
| PluginUnloadingTest
===================
A simple example of dynamic plugin unloading in java.
1. Run `mvn package`
2. Run `copy.sh`
3. Run `start.sh`
4. In another terminal check who's using plugin-1.jar `fuser plugin-1.jar`.
There shouldn't be anyone. Or at least process id of the JVM running the example shouldn't be on the list.
5. Type `load plugin-1.jar com.github.wolf480pl.test.plugin_unloading.plugin1.Plugin1` in the example's console and press enter.
It should output "Plugin name: plugin-1"
6. Check who's using plugin-1.jar again. The process id of the JVM running the example should be there.
7. Type `enable plugin-1` in the example's console to see if the plugin works. It should output "Plugin1 enabled"
8. Type `disable plugin-1`. It should output "Plugin1 disabled"
9. Type `unload plugin-1`. It shouldn't output anything.
10. Check who's using plugin-1.jar again. The process id of the JVM should be still there.
11. Type `check` in the example's console. It should output "Plugin still reachable"
12. Type `gc` in the example's console. It shouldn't output anything.
13. Check who's using plugin-1.jar again. The process id of the JVM should be still there.
14. Type `check` in the example's console. It should output "Plugin succesfully unloaded"
15. Check who's using plugin-1.jar again. Now process id of the JVM should be gone.
BTW. the example doesn't have "exit" command. You need to Ctrl+C it in order to exit.
Copyright (c) 2012-2013 Wolf480pl (wolf480@interia.pl)
PluginUnloadingTest is licensed under MIT license. Please see LICENSE.txt for details.
| Put some content in the readme. | Put some content in the readme. | Markdown | mit | Wolf480pl/PluginUnloadingTest,Wolf480pl/PluginUnloadingTest | markdown | ## Code Before:
PluginUnloadingTest
===================
A proof of concept of dynamic plugin unloading.
## Instruction:
Put some content in the readme.
## Code After:
PluginUnloadingTest
===================
A simple example of dynamic plugin unloading in java.
1. Run `mvn package`
2. Run `copy.sh`
3. Run `start.sh`
4. In another terminal check who's using plugin-1.jar `fuser plugin-1.jar`.
There shouldn't be anyone. Or at least process id of the JVM running the example shouldn't be on the list.
5. Type `load plugin-1.jar com.github.wolf480pl.test.plugin_unloading.plugin1.Plugin1` in the example's console and press enter.
It should output "Plugin name: plugin-1"
6. Check who's using plugin-1.jar again. The process id of the JVM running the example should be there.
7. Type `enable plugin-1` in the example's console to see if the plugin works. It should output "Plugin1 enabled"
8. Type `disable plugin-1`. It should output "Plugin1 disabled"
9. Type `unload plugin-1`. It shouldn't output anything.
10. Check who's using plugin-1.jar again. The process id of the JVM should be still there.
11. Type `check` in the example's console. It should output "Plugin still reachable"
12. Type `gc` in the example's console. It shouldn't output anything.
13. Check who's using plugin-1.jar again. The process id of the JVM should be still there.
14. Type `check` in the example's console. It should output "Plugin succesfully unloaded"
15. Check who's using plugin-1.jar again. Now process id of the JVM should be gone.
BTW. the example doesn't have "exit" command. You need to Ctrl+C it in order to exit.
Copyright (c) 2012-2013 Wolf480pl (wolf480@interia.pl)
PluginUnloadingTest is licensed under MIT license. Please see LICENSE.txt for details.
|
27bf208ca665c6ce67296c050ccd7e08e7c106d7 | web/public/css/base/_form.less | web/public/css/base/_form.less | input[type='date'],
input[type='email'],
input[type='number'],
input[type='text'],
textarea {
&.ng-dirty {
&.ng-valid {
border-color: @success-color;
}
&.ng-invalid {
border-color: @error-color;
}
}
}
.timepicker.ng-dirty {
&.ng-valid-time input {
border: 1px solid @success-color !important;
}
&.ng-invalid-time input {
border: 1px solid @error-color !important;
}
}
legend::after{
width: 50% !important;
}
.padding input[type=number]{
width:75px;
}
.padding {
margin-left: 10px;
}
.icon-group {
padding-right:1em;
}
@media (max-width: 1200px) {
.padding {
margin-left: 0px;
}
} | input[type='date'],
input[type='email'],
input[type='number'],
input[type='text'],
textarea {
&.ng-dirty {
&.ng-valid {
border-color: @success-color;
}
&.ng-invalid {
border-color: @error-color;
}
}
}
.timepicker.ng-dirty {
&.ng-valid-time input {
border: 1px solid @success-color !important;
}
&.ng-invalid-time input {
border: 1px solid @error-color !important;
}
}
legend::after{
width: 50% !important;
}
legend.hidden-lg{
clear: both;
}
.padding input[type=number]{
width:75px;
}
.padding {
margin-left: 10px;
}
.icon-group {
padding-right:1em;
}
@media (max-width: 1200px) {
.padding {
margin-left: 0px;
}
}
| Fix responsiveness issue for floating element on edit-form | Fix responsiveness issue for floating element on edit-form
which was making date unselectable
| Less | mit | CoderDojo/cp-zen-platform,CoderDojo/cp-zen-platform | less | ## Code Before:
input[type='date'],
input[type='email'],
input[type='number'],
input[type='text'],
textarea {
&.ng-dirty {
&.ng-valid {
border-color: @success-color;
}
&.ng-invalid {
border-color: @error-color;
}
}
}
.timepicker.ng-dirty {
&.ng-valid-time input {
border: 1px solid @success-color !important;
}
&.ng-invalid-time input {
border: 1px solid @error-color !important;
}
}
legend::after{
width: 50% !important;
}
.padding input[type=number]{
width:75px;
}
.padding {
margin-left: 10px;
}
.icon-group {
padding-right:1em;
}
@media (max-width: 1200px) {
.padding {
margin-left: 0px;
}
}
## Instruction:
Fix responsiveness issue for floating element on edit-form
which was making date unselectable
## Code After:
input[type='date'],
input[type='email'],
input[type='number'],
input[type='text'],
textarea {
&.ng-dirty {
&.ng-valid {
border-color: @success-color;
}
&.ng-invalid {
border-color: @error-color;
}
}
}
.timepicker.ng-dirty {
&.ng-valid-time input {
border: 1px solid @success-color !important;
}
&.ng-invalid-time input {
border: 1px solid @error-color !important;
}
}
legend::after{
width: 50% !important;
}
legend.hidden-lg{
clear: both;
}
.padding input[type=number]{
width:75px;
}
.padding {
margin-left: 10px;
}
.icon-group {
padding-right:1em;
}
@media (max-width: 1200px) {
.padding {
margin-left: 0px;
}
}
|
d380e54a153e8a8b6a6ec72a7ec582a0075430ef | template-2_col-pics.php | template-2_col-pics.php | <?php
/*
Template Name: 2 Spalten und Bilder
*/
?>
<div class="row">
<div class="medium-8 small-12 column">
<div class="white-bg vines">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/page', 'header'); ?>
<ul class="large-block-grid-2 medium-block-grid-2 small-block-grid-1">
<li>
<?php get_template_part('templates/content', 'page'); ?>
<?php endwhile ?>
</li>
<li>
<?php the_field('2-col-pics-text_col2'); ?>
</li>
</ul>
</div>
</div>
<div class="medium-4 small-12 column image-list">
<?php if( have_rows('2-col-pics_pictures') ) { ?>
<ul>
<?php while ( have_rows('2-col-pics_pictures') ) { the_row(); ?>
<li>
<?php $sub = get_sub_field('2-col-pics_picture'); ?>
<img src="<?php echo $sub['url']; ?>">
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div> | <?php
/*
Template Name: 2 Spalten und Bilder
*/
?>
<div class="row">
<div class="medium-8 small-12 column">
<div class="white-bg vines">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/page', 'header'); ?>
<ul class="large-block-grid-2 medium-block-grid-2 small-block-grid-1">
<li>
<?php get_template_part('templates/content', 'page'); ?>
<?php endwhile ?>
</li>
<li>
<?php the_field('2-col-pics-text_col2'); ?>
</li>
</ul>
</div>
</div>
<div class="medium-4 small-12 column image-list">
<?php if( have_rows('2-col-pics_pictures') ) { ?>
<ul>
<?php while ( have_rows('2-col-pics_pictures') ) { the_row(); ?>
<li>
<?php $sub = get_sub_field('2-col-pics_picture'); ?>
<img src="<?php echo $sub['url']; ?>" rel="lightbox[pp_gal]">
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div> | Fix lightbox on two col page. | Fix lightbox on two col page.
| PHP | mit | juliabode/anisah,juliabode/anisah,juliabode/anisah | php | ## Code Before:
<?php
/*
Template Name: 2 Spalten und Bilder
*/
?>
<div class="row">
<div class="medium-8 small-12 column">
<div class="white-bg vines">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/page', 'header'); ?>
<ul class="large-block-grid-2 medium-block-grid-2 small-block-grid-1">
<li>
<?php get_template_part('templates/content', 'page'); ?>
<?php endwhile ?>
</li>
<li>
<?php the_field('2-col-pics-text_col2'); ?>
</li>
</ul>
</div>
</div>
<div class="medium-4 small-12 column image-list">
<?php if( have_rows('2-col-pics_pictures') ) { ?>
<ul>
<?php while ( have_rows('2-col-pics_pictures') ) { the_row(); ?>
<li>
<?php $sub = get_sub_field('2-col-pics_picture'); ?>
<img src="<?php echo $sub['url']; ?>">
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
## Instruction:
Fix lightbox on two col page.
## Code After:
<?php
/*
Template Name: 2 Spalten und Bilder
*/
?>
<div class="row">
<div class="medium-8 small-12 column">
<div class="white-bg vines">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/page', 'header'); ?>
<ul class="large-block-grid-2 medium-block-grid-2 small-block-grid-1">
<li>
<?php get_template_part('templates/content', 'page'); ?>
<?php endwhile ?>
</li>
<li>
<?php the_field('2-col-pics-text_col2'); ?>
</li>
</ul>
</div>
</div>
<div class="medium-4 small-12 column image-list">
<?php if( have_rows('2-col-pics_pictures') ) { ?>
<ul>
<?php while ( have_rows('2-col-pics_pictures') ) { the_row(); ?>
<li>
<?php $sub = get_sub_field('2-col-pics_picture'); ?>
<img src="<?php echo $sub['url']; ?>" rel="lightbox[pp_gal]">
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div> |
e6093bc71147e692d25464f4f23842423cda797e | Tests/Loader/GlobFileLoaderTest.php | Tests/Loader/GlobFileLoaderTest.php | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Tests\Loader;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\GlobResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
class GlobFileLoaderTest extends TestCase
{
public function testSupports()
{
$loader = new GlobFileLoader(new ContainerBuilder(), new FileLocator());
$this->assertTrue($loader->supports('any-path', 'glob'), '->supports() returns true if the resource has the glob type');
$this->assertFalse($loader->supports('any-path'), '->supports() returns false if the resource is not of glob type');
}
public function testLoadAddsTheGlobResourceToTheContainer()
{
$loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
$loader->load(__DIR__.'/../Fixtures/config/*');
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
}
}
class GlobFileLoaderWithoutImport extends GlobFileLoader
{
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null)
{
}
}
| <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Tests\Loader;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\GlobResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
class GlobFileLoaderTest extends TestCase
{
public function testSupports()
{
$loader = new GlobFileLoader(new ContainerBuilder(), new FileLocator());
$this->assertTrue($loader->supports('any-path', 'glob'), '->supports() returns true if the resource has the glob type');
$this->assertFalse($loader->supports('any-path'), '->supports() returns false if the resource is not of glob type');
}
public function testLoadAddsTheGlobResourceToTheContainer()
{
$loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
$loader->load(__DIR__.'/../Fixtures/config/*');
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
}
}
class GlobFileLoaderWithoutImport extends GlobFileLoader
{
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null, $exclude = null)
{
}
}
| Allow patterns of resources to be excluded from config loading | [Routing][Config] Allow patterns of resources to be excluded from config loading
| PHP | mit | symfony/dependency-injection | php | ## Code Before:
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Tests\Loader;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\GlobResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
class GlobFileLoaderTest extends TestCase
{
public function testSupports()
{
$loader = new GlobFileLoader(new ContainerBuilder(), new FileLocator());
$this->assertTrue($loader->supports('any-path', 'glob'), '->supports() returns true if the resource has the glob type');
$this->assertFalse($loader->supports('any-path'), '->supports() returns false if the resource is not of glob type');
}
public function testLoadAddsTheGlobResourceToTheContainer()
{
$loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
$loader->load(__DIR__.'/../Fixtures/config/*');
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
}
}
class GlobFileLoaderWithoutImport extends GlobFileLoader
{
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null)
{
}
}
## Instruction:
[Routing][Config] Allow patterns of resources to be excluded from config loading
## Code After:
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Tests\Loader;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\GlobResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
class GlobFileLoaderTest extends TestCase
{
public function testSupports()
{
$loader = new GlobFileLoader(new ContainerBuilder(), new FileLocator());
$this->assertTrue($loader->supports('any-path', 'glob'), '->supports() returns true if the resource has the glob type');
$this->assertFalse($loader->supports('any-path'), '->supports() returns false if the resource is not of glob type');
}
public function testLoadAddsTheGlobResourceToTheContainer()
{
$loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
$loader->load(__DIR__.'/../Fixtures/config/*');
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
}
}
class GlobFileLoaderWithoutImport extends GlobFileLoader
{
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null, $exclude = null)
{
}
}
|
d8ba2ce7df764a8d4cd542af618ddf757dc6aa65 | app/src/js/modules/buic/listing.js | app/src/js/modules/buic/listing.js | /**
* Handling of BUIC listings.
*
* @mixin
* @namespace Bolt.buic.listing
*
* @param {Object} bolt - The Bolt module.
* @param {Object} $ - jQuery.
*/
(function (bolt, $) {
'use strict';
/**
* Bolt.buic.listing mixin container.
*
* @private
* @type {Object}
*/
var listing = {};
/**
* Bind BUIC listings.
*
* @static
* @function init
* @memberof Bolt.buic.listing
*
* @param {Object} buic
*/
listing.init = function (buic) {
// Select/unselect all rows in a listing section.
$(buic).find('tr.header input:checkbox[name="checkRow"]').on('click', function () {
var setStatus = this.checked;
$(this).closest('tbody').find('td input:checkbox[name="checkRow"]').each(function () {
var row = $(this).closest('tr');
this.checked = setStatus;
if (setStatus) {
row.addClass('row-checked');
} else {
row.removeClass('row-checked');
}
});
});
};
// Apply mixin container
bolt.buic.listing = listing;
})(Bolt || {}, jQuery);
| /**
* Handling of BUIC listings.
*
* @mixin
* @namespace Bolt.buic.listing
*
* @param {Object} bolt - The Bolt module.
* @param {Object} $ - jQuery.
*/
(function (bolt, $) {
'use strict';
/**
* Bolt.buic.listing mixin container.
*
* @private
* @type {Object}
*/
var listing = {};
/**
* Bind BUIC listings.
*
* @static
* @function init
* @memberof Bolt.buic.listing
*
* @param {Object} buic
*/
listing.init = function (buic) {
// Select/unselect all rows in a listing section.
$(buic).find('tr.header input:checkbox[name="checkRow"]').on('click', function () {
var setStatus = this.checked;
$(this).closest('tbody').find('td input:checkbox[name="checkRow"]').each(function () {
this.checked = setStatus;
rowSelection(this);
});
});
// On check/unchecking a row selector.
$(buic).find('td input:checkbox[name="checkRow"]').on('click', function () {
rowSelection(this);
});
};
/**
* Handle row selection.
*
* @private
* @static
* @function rowSelection
* @memberof Bolt.files
*
* @param {object} checkbox - Checkbox clicked.
*/
function rowSelection(checkbox) {
var row = $(checkbox).closest('tr');
if (checkbox.checked) {
row.addClass('row-checked');
} else {
row.removeClass('row-checked');
}
}
// Apply mixin container
bolt.buic.listing = listing;
})(Bolt || {}, jQuery);
| Handle select/unselect of a single row | Handle select/unselect of a single row | JavaScript | mit | GawainLynch/bolt,rarila/bolt,lenvanessen/bolt,rossriley/bolt,joshuan/bolt,romulo1984/bolt,electrolinux/bolt,cdowdy/bolt,one988/cm,GawainLynch/bolt,rarila/bolt,rossriley/bolt,HonzaMikula/masivnipostele,lenvanessen/bolt,Raistlfiren/bolt,GawainLynch/bolt,CarsonF/bolt,rarila/bolt,cdowdy/bolt,bolt/bolt,CarsonF/bolt,Intendit/bolt,Raistlfiren/bolt,nantunes/bolt,Intendit/bolt,Raistlfiren/bolt,bolt/bolt,electrolinux/bolt,joshuan/bolt,rarila/bolt,bolt/bolt,nikgo/bolt,CarsonF/bolt,one988/cm,HonzaMikula/masivnipostele,rossriley/bolt,bolt/bolt,richardhinkamp/bolt,HonzaMikula/masivnipostele,nantunes/bolt,nikgo/bolt,nikgo/bolt,cdowdy/bolt,HonzaMikula/masivnipostele,CarsonF/bolt,electrolinux/bolt,nantunes/bolt,electrolinux/bolt,nikgo/bolt,rossriley/bolt,richardhinkamp/bolt,romulo1984/bolt,one988/cm,lenvanessen/bolt,joshuan/bolt,romulo1984/bolt,GawainLynch/bolt,richardhinkamp/bolt,Intendit/bolt,Raistlfiren/bolt,lenvanessen/bolt,joshuan/bolt,romulo1984/bolt,nantunes/bolt,richardhinkamp/bolt,Intendit/bolt,one988/cm,cdowdy/bolt | javascript | ## Code Before:
/**
* Handling of BUIC listings.
*
* @mixin
* @namespace Bolt.buic.listing
*
* @param {Object} bolt - The Bolt module.
* @param {Object} $ - jQuery.
*/
(function (bolt, $) {
'use strict';
/**
* Bolt.buic.listing mixin container.
*
* @private
* @type {Object}
*/
var listing = {};
/**
* Bind BUIC listings.
*
* @static
* @function init
* @memberof Bolt.buic.listing
*
* @param {Object} buic
*/
listing.init = function (buic) {
// Select/unselect all rows in a listing section.
$(buic).find('tr.header input:checkbox[name="checkRow"]').on('click', function () {
var setStatus = this.checked;
$(this).closest('tbody').find('td input:checkbox[name="checkRow"]').each(function () {
var row = $(this).closest('tr');
this.checked = setStatus;
if (setStatus) {
row.addClass('row-checked');
} else {
row.removeClass('row-checked');
}
});
});
};
// Apply mixin container
bolt.buic.listing = listing;
})(Bolt || {}, jQuery);
## Instruction:
Handle select/unselect of a single row
## Code After:
/**
* Handling of BUIC listings.
*
* @mixin
* @namespace Bolt.buic.listing
*
* @param {Object} bolt - The Bolt module.
* @param {Object} $ - jQuery.
*/
(function (bolt, $) {
'use strict';
/**
* Bolt.buic.listing mixin container.
*
* @private
* @type {Object}
*/
var listing = {};
/**
* Bind BUIC listings.
*
* @static
* @function init
* @memberof Bolt.buic.listing
*
* @param {Object} buic
*/
listing.init = function (buic) {
// Select/unselect all rows in a listing section.
$(buic).find('tr.header input:checkbox[name="checkRow"]').on('click', function () {
var setStatus = this.checked;
$(this).closest('tbody').find('td input:checkbox[name="checkRow"]').each(function () {
this.checked = setStatus;
rowSelection(this);
});
});
// On check/unchecking a row selector.
$(buic).find('td input:checkbox[name="checkRow"]').on('click', function () {
rowSelection(this);
});
};
/**
* Handle row selection.
*
* @private
* @static
* @function rowSelection
* @memberof Bolt.files
*
* @param {object} checkbox - Checkbox clicked.
*/
function rowSelection(checkbox) {
var row = $(checkbox).closest('tr');
if (checkbox.checked) {
row.addClass('row-checked');
} else {
row.removeClass('row-checked');
}
}
// Apply mixin container
bolt.buic.listing = listing;
})(Bolt || {}, jQuery);
|
e57eb82bba4d6c28dc99f868b8f16b805e0bdade | spec/lib/guard/rspec/formatter_spec.rb | spec/lib/guard/rspec/formatter_spec.rb | require 'spec_helper.rb'
require 'guard/rspec/formatter'
describe Guard::RSpec::Formatter do
let(:formatter) { Guard::RSpec::Formatter.new(StringIO.new) }
describe '#dump_summary' do
after { File.delete('./tmp/rspec_guard_result') }
context 'with failures' do
let(:example) { double(
execution_result: { status: 'failed' },
metadata: { location: 'failed_location' }
) }
it 'writes summary line and failed location in tmp dir' do
formatter.stub(:examples) { [example] }
formatter.dump_summary(123, 3, 1, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\nfailed_location\n$/
end
end
context 'with only success' do
it 'notifies success' do
formatter.dump_summary(123, 3, 0, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures in 123\.0 seconds\n$/
end
end
context 'with pending' do
it "notifies pending too" do
formatter.dump_summary(123, 3, 0, 1)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures \(1 pending\) in 123\.0 seconds\n$/
end
end
end
end
| require 'spec_helper.rb'
require 'guard/rspec/formatter'
describe Guard::RSpec::Formatter do
let(:formatter) { Guard::RSpec::Formatter.new(StringIO.new) }
describe '#dump_summary' do
after { File.delete('./tmp/rspec_guard_result') }
context 'with failures' do
let(:failed_example) { double(
execution_result: { status: 'failed' },
metadata: { location: 'failed_location' }
) }
it 'writes summary line and failed location in tmp dir' do
formatter.stub(:examples) { [failed_example] }
formatter.dump_summary(123, 3, 1, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\nfailed_location\n$/
end
end
context 'with only success' do
it 'notifies success' do
formatter.dump_summary(123, 3, 0, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures in 123\.0 seconds\n$/
end
end
context 'with pending' do
it "notifies pending too" do
formatter.dump_summary(123, 3, 0, 1)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures \(1 pending\) in 123\.0 seconds\n$/
end
end
end
end
| Rename example to failed_example to avoid confusion with implicit example object. | Rename example to failed_example to avoid confusion with implicit
example object.
| Ruby | mit | kvokka/guard-rspec,mes/guard-rspec,baberthal/guard-rspec,consti/guard-rspec,guard/guard-rspec | ruby | ## Code Before:
require 'spec_helper.rb'
require 'guard/rspec/formatter'
describe Guard::RSpec::Formatter do
let(:formatter) { Guard::RSpec::Formatter.new(StringIO.new) }
describe '#dump_summary' do
after { File.delete('./tmp/rspec_guard_result') }
context 'with failures' do
let(:example) { double(
execution_result: { status: 'failed' },
metadata: { location: 'failed_location' }
) }
it 'writes summary line and failed location in tmp dir' do
formatter.stub(:examples) { [example] }
formatter.dump_summary(123, 3, 1, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\nfailed_location\n$/
end
end
context 'with only success' do
it 'notifies success' do
formatter.dump_summary(123, 3, 0, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures in 123\.0 seconds\n$/
end
end
context 'with pending' do
it "notifies pending too" do
formatter.dump_summary(123, 3, 0, 1)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures \(1 pending\) in 123\.0 seconds\n$/
end
end
end
end
## Instruction:
Rename example to failed_example to avoid confusion with implicit
example object.
## Code After:
require 'spec_helper.rb'
require 'guard/rspec/formatter'
describe Guard::RSpec::Formatter do
let(:formatter) { Guard::RSpec::Formatter.new(StringIO.new) }
describe '#dump_summary' do
after { File.delete('./tmp/rspec_guard_result') }
context 'with failures' do
let(:failed_example) { double(
execution_result: { status: 'failed' },
metadata: { location: 'failed_location' }
) }
it 'writes summary line and failed location in tmp dir' do
formatter.stub(:examples) { [failed_example] }
formatter.dump_summary(123, 3, 1, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\nfailed_location\n$/
end
end
context 'with only success' do
it 'notifies success' do
formatter.dump_summary(123, 3, 0, 0)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures in 123\.0 seconds\n$/
end
end
context 'with pending' do
it "notifies pending too" do
formatter.dump_summary(123, 3, 0, 1)
result = File.open('./tmp/rspec_guard_result').read
expect(result).to match /^3 examples, 0 failures \(1 pending\) in 123\.0 seconds\n$/
end
end
end
end
|
c9c810e23e9acf93e497aa522e62afef336aa69f | app/views/users/_admin.html.erb | app/views/users/_admin.html.erb | <h1>Admin</h1>
<h2>Groups</h2>
<ul>
<li><a href="/groups/new">Add</a></li>
<li><a href="/groups/">List</a></li>
</ul>
<h2>Parties</h2>
<ul>
<li><a href="/parties/new">Add</a></li>
<li><a href="/parties/">List</a></li>
</ul>
<h2>Politicians</h2>
<ul>
<li><a href="/politicians/new">Add</a></li>
<li><a href="/politicians/">List</a></li>
</ul>
<h2>Users</h2>
<ul>
<li><a href="/account/edit">Edit account</a></li>
<li><a href="/users/new">Add</a></li>
<li><a href="/users/">List</a></li>
</ul>
<h2>Pages</h2>
<ul>
<li><a href="/pages/new">Add page</a></li>
<li><a href="/pages/">List</a></li>
</ul> | <h1>Admin</h1>
<h2>Groups</h2>
<ul>
<li><a href="/groups/new">Add</a></li>
<li><a href="/groups/">List</a></li>
</ul>
<h2>Parties</h2>
<ul>
<li><a href="/parties/new">Add</a></li>
<li><a href="/parties/">List</a></li>
</ul>
<h2>Politicians</h2>
<ul>
<li><a href="/politicians/new">Add</a></li>
<li><a href="/politicians/">List</a></li>
</ul>
<h2>Users</h2>
<ul>
<li><a href="/account/edit">Edit account</a></li>
<li><a href="/users/new">Add</a></li>
<li><a href="/users/">List</a></li>
</ul>
<h2>Pages</h2>
<ul>
<li><a href="/pages/new">Add page</a></li>
<li><a href="/pages/">List</a></li>
</ul>
<h2>Tools</h2>
<ul>
<li><a href="/statistics/">Statistics</a></li>
</ul>
| Add a link to statistics in menu. | Add a link to statistics in menu.
| HTML+ERB | bsd-3-clause | 4bic/politwoops,Saworieza/politwoops,sunlightlabs/politwoops,sunlightlabs/politwoops,4bic/politwoops,4bic/politwoops,Saworieza/politwoops,sunlightlabs/politwoops,Saworieza/politwoops | html+erb | ## Code Before:
<h1>Admin</h1>
<h2>Groups</h2>
<ul>
<li><a href="/groups/new">Add</a></li>
<li><a href="/groups/">List</a></li>
</ul>
<h2>Parties</h2>
<ul>
<li><a href="/parties/new">Add</a></li>
<li><a href="/parties/">List</a></li>
</ul>
<h2>Politicians</h2>
<ul>
<li><a href="/politicians/new">Add</a></li>
<li><a href="/politicians/">List</a></li>
</ul>
<h2>Users</h2>
<ul>
<li><a href="/account/edit">Edit account</a></li>
<li><a href="/users/new">Add</a></li>
<li><a href="/users/">List</a></li>
</ul>
<h2>Pages</h2>
<ul>
<li><a href="/pages/new">Add page</a></li>
<li><a href="/pages/">List</a></li>
</ul>
## Instruction:
Add a link to statistics in menu.
## Code After:
<h1>Admin</h1>
<h2>Groups</h2>
<ul>
<li><a href="/groups/new">Add</a></li>
<li><a href="/groups/">List</a></li>
</ul>
<h2>Parties</h2>
<ul>
<li><a href="/parties/new">Add</a></li>
<li><a href="/parties/">List</a></li>
</ul>
<h2>Politicians</h2>
<ul>
<li><a href="/politicians/new">Add</a></li>
<li><a href="/politicians/">List</a></li>
</ul>
<h2>Users</h2>
<ul>
<li><a href="/account/edit">Edit account</a></li>
<li><a href="/users/new">Add</a></li>
<li><a href="/users/">List</a></li>
</ul>
<h2>Pages</h2>
<ul>
<li><a href="/pages/new">Add page</a></li>
<li><a href="/pages/">List</a></li>
</ul>
<h2>Tools</h2>
<ul>
<li><a href="/statistics/">Statistics</a></li>
</ul>
|
9738e87b3e49d4b6ce429413ba37eefa9f506ea5 | README.md | README.md |
Turn Timer is a simple Javascript file that integrates with the Roll20 API.
To use it, enable the script, and type the following commands into the Roll20 chat.
General Syntax:
```
!t <seconds>
```
*Note: <seconds> is optional.*
To use the default time (60 seconds), type the following into the Roll20 chat:
```
!t
```
*This will start a 60-second timer.*
To customize the time (e.g., a two minute timer), type the following:
```
!t 120
```
*This will start a 120 second timer.*
## License
All of the code of the API scripts in this repository is released under the MIT license (see LICENSE file for details). If you contribute a new script or help improve an existing script, you agree that your contribution is released under the MIT License as well.
|
All of the code of the API scripts in this repository is released under the MIT license (see LICENSE file for details). If you contribute a new script or help improve an existing script, you agree that your contribution is released under the MIT License as well.
| Revert "Adds instructions to the read" | Revert "Adds instructions to the read"
This reverts commit 849d736ad5dacb915ddefd694bc5ff270b2f8d3e.
| Markdown | mit | JamesMowery/turn-timer,JamesMowery/onward | markdown | ## Code Before:
Turn Timer is a simple Javascript file that integrates with the Roll20 API.
To use it, enable the script, and type the following commands into the Roll20 chat.
General Syntax:
```
!t <seconds>
```
*Note: <seconds> is optional.*
To use the default time (60 seconds), type the following into the Roll20 chat:
```
!t
```
*This will start a 60-second timer.*
To customize the time (e.g., a two minute timer), type the following:
```
!t 120
```
*This will start a 120 second timer.*
## License
All of the code of the API scripts in this repository is released under the MIT license (see LICENSE file for details). If you contribute a new script or help improve an existing script, you agree that your contribution is released under the MIT License as well.
## Instruction:
Revert "Adds instructions to the read"
This reverts commit 849d736ad5dacb915ddefd694bc5ff270b2f8d3e.
## Code After:
All of the code of the API scripts in this repository is released under the MIT license (see LICENSE file for details). If you contribute a new script or help improve an existing script, you agree that your contribution is released under the MIT License as well.
|
a2faef4d0f9bf2b9268c41cfe0a6f48b9d494f3b | .scrutinizer.yml | .scrutinizer.yml | imports:
- php
filter:
excluded_paths:
- 'bin/*'
- 'vendor/*'
- 'features/*'
- 'spec/*'
- 'tests/*'
before_commands:
- composer install --prefer-source --dev --optimize-autoloader --no-interaction
tools:
php_sim: true
php_cpd: false
# PHP Code Sniffer
php_code_sniffer:
config:
standard: PSR2
build:
tests:
override:
-
command: 'phpunit --coverage-clover=code_coverage.xml'
coverage:
file: 'code_coverage.xml'
format: 'php-clover' | imports:
- php
filter:
excluded_paths:
- 'bin/*'
- 'vendor/*'
- 'features/*'
- 'spec/*'
- 'tests/*'
before_commands:
- composer install --prefer-source --dev --optimize-autoloader --no-interaction
tools:
php_sim: true
php_cpd: false
# PHP Code Sniffer
php_code_sniffer:
config:
standard: PSR2
build:
dependencies:
before:
- 'pecl install SPL_Types'
environment:
timezone: 'UTC'
tests:
override:
-
command: 'phpunit --coverage-clover=code_coverage.xml'
coverage:
file: 'code_coverage.xml'
format: 'php-clover' | Install SPL types when building with scruitinizer | Install SPL types when building with scruitinizer
| YAML | mit | jk/RestServer | yaml | ## Code Before:
imports:
- php
filter:
excluded_paths:
- 'bin/*'
- 'vendor/*'
- 'features/*'
- 'spec/*'
- 'tests/*'
before_commands:
- composer install --prefer-source --dev --optimize-autoloader --no-interaction
tools:
php_sim: true
php_cpd: false
# PHP Code Sniffer
php_code_sniffer:
config:
standard: PSR2
build:
tests:
override:
-
command: 'phpunit --coverage-clover=code_coverage.xml'
coverage:
file: 'code_coverage.xml'
format: 'php-clover'
## Instruction:
Install SPL types when building with scruitinizer
## Code After:
imports:
- php
filter:
excluded_paths:
- 'bin/*'
- 'vendor/*'
- 'features/*'
- 'spec/*'
- 'tests/*'
before_commands:
- composer install --prefer-source --dev --optimize-autoloader --no-interaction
tools:
php_sim: true
php_cpd: false
# PHP Code Sniffer
php_code_sniffer:
config:
standard: PSR2
build:
dependencies:
before:
- 'pecl install SPL_Types'
environment:
timezone: 'UTC'
tests:
override:
-
command: 'phpunit --coverage-clover=code_coverage.xml'
coverage:
file: 'code_coverage.xml'
format: 'php-clover' |
87aab5305813be396bba83af816ad538851381e1 | fix_unity_issues.sh | fix_unity_issues.sh | path=${PWD}
unity_location=/Applications/Unity/Unity.app/Contents/MacOS/Unity
guisystem_location=/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity
echo $path
mkdir -p ~/tmp/
mv $guisystem_location/GUISystem ~/tmp
$unity_location -projectPath $path -quit
mv ~/tmp/GUISystem $guisystem_location
| path=${PWD}
unity_location=/Applications/Unity/Unity.app/Contents/MacOS/Unity
guisystem_location=/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity
echo $path
mkdir -p ~/tmp/
mv $guisystem_location/GUISystem ~/tmp
mv $guisystem_location/Networking ~/tmp
mv $guisystem_location/UnityAnalytics ~/tmp
$unity_location -projectPath $path -quit
mv ~/tmp/GUISystem $guisystem_location
mv ~/tmp/Networking $guisystem_location
mv ~/tmp/UnityAnalytics $guisystem_location
| Improve unity fix-it script to do more improvin' | Improve unity fix-it script to do more improvin'
| Shell | apache-2.0 | stlgamedev/gateway2dwest,stlgamedev/gateway2dwest,IGDAStl/gateway2dwest,IGDAStl/gateway2dwest,stlgamedev/gateway2dwest,IGDAStl/gateway2dwest | shell | ## Code Before:
path=${PWD}
unity_location=/Applications/Unity/Unity.app/Contents/MacOS/Unity
guisystem_location=/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity
echo $path
mkdir -p ~/tmp/
mv $guisystem_location/GUISystem ~/tmp
$unity_location -projectPath $path -quit
mv ~/tmp/GUISystem $guisystem_location
## Instruction:
Improve unity fix-it script to do more improvin'
## Code After:
path=${PWD}
unity_location=/Applications/Unity/Unity.app/Contents/MacOS/Unity
guisystem_location=/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity
echo $path
mkdir -p ~/tmp/
mv $guisystem_location/GUISystem ~/tmp
mv $guisystem_location/Networking ~/tmp
mv $guisystem_location/UnityAnalytics ~/tmp
$unity_location -projectPath $path -quit
mv ~/tmp/GUISystem $guisystem_location
mv ~/tmp/Networking $guisystem_location
mv ~/tmp/UnityAnalytics $guisystem_location
|
e10540a851b34f5b3a8c111786c9fb5b06fea86e | pillars/profile/common/system_features/maven_installation_configuration.sls | pillars/profile/common/system_features/maven_installation_configuration.sls |
system_features:
maven_installation_configuration:
maven_home_dir: '/usr/share/maven'
# Specify list of (additionally) activated profiles.
# These profiles will be added to `<activeProfiles>`
# system-wide (per user) `settings.xml` configuration file.
activate_profiles:
[]
###############################################################################
# EOF
###############################################################################
|
system_features:
maven_installation_configuration:
# NOTE: Use custom Maven installation instead of standard one.
{% if False %}
maven_home_dir: '/usr/share/maven'
{% else %}
maven_home_dir: '/opt/maven/apache-maven-3.2.5'
{% endif %}
# Specify list of (additionally) activated profiles.
# These profiles will be added to `<activeProfiles>`
# system-wide (per user) `settings.xml` configuration file.
activate_profiles:
[]
###############################################################################
# EOF
###############################################################################
| Use custom Maven installation for Jenkins | Use custom Maven installation for Jenkins
| SaltStack | apache-2.0 | uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states | saltstack | ## Code Before:
system_features:
maven_installation_configuration:
maven_home_dir: '/usr/share/maven'
# Specify list of (additionally) activated profiles.
# These profiles will be added to `<activeProfiles>`
# system-wide (per user) `settings.xml` configuration file.
activate_profiles:
[]
###############################################################################
# EOF
###############################################################################
## Instruction:
Use custom Maven installation for Jenkins
## Code After:
system_features:
maven_installation_configuration:
# NOTE: Use custom Maven installation instead of standard one.
{% if False %}
maven_home_dir: '/usr/share/maven'
{% else %}
maven_home_dir: '/opt/maven/apache-maven-3.2.5'
{% endif %}
# Specify list of (additionally) activated profiles.
# These profiles will be added to `<activeProfiles>`
# system-wide (per user) `settings.xml` configuration file.
activate_profiles:
[]
###############################################################################
# EOF
###############################################################################
|
537d48ef943bfb6dd0dd9996eee5a7c8c0ac3f79 | src/main/js/formatter/number.ts | src/main/js/formatter/number.ts | import {Formatter} from './formatter';
/**
* @hidden
*/
export class NumberFormatter implements Formatter<number> {
private digits_: number;
constructor(digits: number) {
this.digits_ = digits;
}
get digits(): number {
return this.digits_;
}
public format(value: number): string {
return value.toFixed(this.digits_);
}
}
| import {Formatter} from './formatter';
/**
* @hidden
*/
export class NumberFormatter implements Formatter<number> {
private digits_: number;
constructor(digits: number) {
this.digits_ = digits;
}
get digits(): number {
return this.digits_;
}
public format(value: number): string {
return value.toFixed(Math.max(Math.min(this.digits_, 20), 0));
}
}
| Fix error on Safari: toFixed() argument must be between 0 and 20 | Fix error on Safari: toFixed() argument must be between 0 and 20
| TypeScript | mit | cocopon/tweakpane,cocopon/tweakpane,cocopon/tweakpane | typescript | ## Code Before:
import {Formatter} from './formatter';
/**
* @hidden
*/
export class NumberFormatter implements Formatter<number> {
private digits_: number;
constructor(digits: number) {
this.digits_ = digits;
}
get digits(): number {
return this.digits_;
}
public format(value: number): string {
return value.toFixed(this.digits_);
}
}
## Instruction:
Fix error on Safari: toFixed() argument must be between 0 and 20
## Code After:
import {Formatter} from './formatter';
/**
* @hidden
*/
export class NumberFormatter implements Formatter<number> {
private digits_: number;
constructor(digits: number) {
this.digits_ = digits;
}
get digits(): number {
return this.digits_;
}
public format(value: number): string {
return value.toFixed(Math.max(Math.min(this.digits_, 20), 0));
}
}
|
5c9e9d33113c7fcf49223853abf52f1e91b17687 | frappe/integrations/doctype/google_maps_settings/google_maps_settings.py | frappe/integrations/doctype/google_maps_settings/google_maps_settings.py |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
import googlemaps
import datetime
class GoogleMapsSettings(Document):
def validate(self):
if self.enabled:
if not self.client_key:
frappe.throw(_("Client key is required"))
if not self.home_address:
frappe.throw(_("Home Address is required"))
def get_client(self):
try:
client = googlemaps.Client(key=self.client_key)
except Exception as e:
frappe.throw(e.message)
return client
|
from __future__ import unicode_literals
import googlemaps
import frappe
from frappe import _
from frappe.model.document import Document
class GoogleMapsSettings(Document):
def validate(self):
if self.enabled:
if not self.client_key:
frappe.throw(_("Client key is required"))
if not self.home_address:
frappe.throw(_("Home Address is required"))
def get_client(self):
if not self.enabled:
frappe.throw(_("Google Maps integration is not enabled"))
try:
client = googlemaps.Client(key=self.client_key)
except Exception as e:
frappe.throw(e.message)
return client
| Check if Google Maps is enabled when trying to get the client | Check if Google Maps is enabled when trying to get the client
| Python | mit | adityahase/frappe,adityahase/frappe,ESS-LLP/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,yashodhank/frappe,RicardoJohann/frappe,yashodhank/frappe,ESS-LLP/frappe,frappe/frappe,mhbu50/frappe,saurabh6790/frappe,saurabh6790/frappe,adityahase/frappe,vjFaLk/frappe,yashodhank/frappe,mhbu50/frappe,vjFaLk/frappe,almeidapaulopt/frappe,frappe/frappe,vjFaLk/frappe,StrellaGroup/frappe,ESS-LLP/frappe,yashodhank/frappe,RicardoJohann/frappe,mhbu50/frappe,mhbu50/frappe,RicardoJohann/frappe,RicardoJohann/frappe,saurabh6790/frappe,StrellaGroup/frappe,frappe/frappe,ESS-LLP/frappe,saurabh6790/frappe,adityahase/frappe,vjFaLk/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe | python | ## Code Before:
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
import googlemaps
import datetime
class GoogleMapsSettings(Document):
def validate(self):
if self.enabled:
if not self.client_key:
frappe.throw(_("Client key is required"))
if not self.home_address:
frappe.throw(_("Home Address is required"))
def get_client(self):
try:
client = googlemaps.Client(key=self.client_key)
except Exception as e:
frappe.throw(e.message)
return client
## Instruction:
Check if Google Maps is enabled when trying to get the client
## Code After:
from __future__ import unicode_literals
import googlemaps
import frappe
from frappe import _
from frappe.model.document import Document
class GoogleMapsSettings(Document):
def validate(self):
if self.enabled:
if not self.client_key:
frappe.throw(_("Client key is required"))
if not self.home_address:
frappe.throw(_("Home Address is required"))
def get_client(self):
if not self.enabled:
frappe.throw(_("Google Maps integration is not enabled"))
try:
client = googlemaps.Client(key=self.client_key)
except Exception as e:
frappe.throw(e.message)
return client
|
ed5ab0523f6550cb8f4730f4f66cf305a4eba26e | index.rst | index.rst |
.. Introduction to Virtualization slides file, created by
hieroglyph-quickstart on Mon Dec 15 21:52:38 2014.
Introduction to Virtualization
==============================
Contents:
.. toctree::
:maxdepth: 2
|
.. Introduction to Virtualization slides file, created by
hieroglyph-quickstart on Mon Dec 15 21:52:38 2014.
.. Copyright {yyyy} {name of copyright owner}
.. 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.
Introduction to Virtualization
==============================
'I herd U liked computers, so I put a computer in your computer so you can compute while you compute'
Contents:
.. toctree::
:maxdepth: 2
Virtualization
==============
* Virtualization is a word with many meanings.
* The type covered here is 'to run one computer (Operating System and software) inside another'
* Gives additional control and options that may not be available on the 'inner' OS
Uses
----
* Learning - OSes, configurations, software
* Testing
Technologies - Backend
======================
Small Scale
-----------
* Virtualbox
* VMware Workstation (Windows/Linux) & Fusion (Mac)
* QEMU/KVM
* Xen
Large Scale
-----------
* VMware ESXi
* QEMU/KVM
* Xen
* OpenStack Nova
Technologies - Frontend
=======================
Small Scale
-----------
* VirtualBox
* VMware Client
* Vagrant
- Universal CLI Frontend
* Libvirt (QEMU/KVM, Xen)
- virsh CLI
- VMM (Virtual Machine Manager) GUI
- Universal CLI & GUI interface
Large Scale
-----------
* VMware vSphere Client/Web
* Ganeti (KVM)
* Xen Orchestra
* OpenStack Horizon
- Universal Web Frontend
| Add slides from initial brainstorming session | Add slides from initial brainstorming session
| reStructuredText | apache-2.0 | finchd/virtualization-dump,finchd/virtualization-dump | restructuredtext | ## Code Before:
.. Introduction to Virtualization slides file, created by
hieroglyph-quickstart on Mon Dec 15 21:52:38 2014.
Introduction to Virtualization
==============================
Contents:
.. toctree::
:maxdepth: 2
## Instruction:
Add slides from initial brainstorming session
## Code After:
.. Introduction to Virtualization slides file, created by
hieroglyph-quickstart on Mon Dec 15 21:52:38 2014.
.. Copyright {yyyy} {name of copyright owner}
.. 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.
Introduction to Virtualization
==============================
'I herd U liked computers, so I put a computer in your computer so you can compute while you compute'
Contents:
.. toctree::
:maxdepth: 2
Virtualization
==============
* Virtualization is a word with many meanings.
* The type covered here is 'to run one computer (Operating System and software) inside another'
* Gives additional control and options that may not be available on the 'inner' OS
Uses
----
* Learning - OSes, configurations, software
* Testing
Technologies - Backend
======================
Small Scale
-----------
* Virtualbox
* VMware Workstation (Windows/Linux) & Fusion (Mac)
* QEMU/KVM
* Xen
Large Scale
-----------
* VMware ESXi
* QEMU/KVM
* Xen
* OpenStack Nova
Technologies - Frontend
=======================
Small Scale
-----------
* VirtualBox
* VMware Client
* Vagrant
- Universal CLI Frontend
* Libvirt (QEMU/KVM, Xen)
- virsh CLI
- VMM (Virtual Machine Manager) GUI
- Universal CLI & GUI interface
Large Scale
-----------
* VMware vSphere Client/Web
* Ganeti (KVM)
* Xen Orchestra
* OpenStack Horizon
- Universal Web Frontend
|
fb852af2fff883dd03037a067929861a8fa786ac | README.md | README.md | openFrameworks Addon For Neuraltalk2
| [`openFrameworks`][1], addon for IP Cameras using [Neuralktalk2][2] for automatic captioning. This is using the [`ofxIpVideoGrabber`][3] addon's example code. We've just modified it to read captions from neuraltalk2 and display it.
If you haven't seen this [video][4] already, go check it out.
It demenonstrates how deep learning can be used for automatic captioning based on what
the webcam sees.
What we've done here is, instead of using a webcam attached directly to the computer, we're feeding neuraltalk2 with feeds from an IP camera. In addition to that we've added text to speech so it reads what the camera sees as well. Useful for a blind person interested in hearing what the camera sees.
This is a hack my friend and I worked on after seeing the original video demo of what neuraltalk2 can do.
We also modified neuraltalk2's `eval.lua`[5] script and so it's possible to read the image feed from the IP camera.
# Dependencies
1. Neuraltalk2 [2]
2. Our modified version of `eval.lua`
3. `sudo apt-get install libttspico0 libttspico-utils libttspico-data`
4. Ubuntu
[1]: http://openframeworks.cc/
[2]: https://github.com/karpathy/neuraltalk2
[3]: https://github.com/bakercp/ofxIpVideoGrabber
[3]: https://vimeo.com/146492001
[4]: https://github.com/karpathy/neuraltalk2/blob/master/eval.lua | Update readme with description of what the addon does | Update readme with description of what the addon does
| Markdown | mit | eyedol/ofxIPNeuraltalk2 | markdown | ## Code Before:
openFrameworks Addon For Neuraltalk2
## Instruction:
Update readme with description of what the addon does
## Code After:
[`openFrameworks`][1], addon for IP Cameras using [Neuralktalk2][2] for automatic captioning. This is using the [`ofxIpVideoGrabber`][3] addon's example code. We've just modified it to read captions from neuraltalk2 and display it.
If you haven't seen this [video][4] already, go check it out.
It demenonstrates how deep learning can be used for automatic captioning based on what
the webcam sees.
What we've done here is, instead of using a webcam attached directly to the computer, we're feeding neuraltalk2 with feeds from an IP camera. In addition to that we've added text to speech so it reads what the camera sees as well. Useful for a blind person interested in hearing what the camera sees.
This is a hack my friend and I worked on after seeing the original video demo of what neuraltalk2 can do.
We also modified neuraltalk2's `eval.lua`[5] script and so it's possible to read the image feed from the IP camera.
# Dependencies
1. Neuraltalk2 [2]
2. Our modified version of `eval.lua`
3. `sudo apt-get install libttspico0 libttspico-utils libttspico-data`
4. Ubuntu
[1]: http://openframeworks.cc/
[2]: https://github.com/karpathy/neuraltalk2
[3]: https://github.com/bakercp/ofxIpVideoGrabber
[3]: https://vimeo.com/146492001
[4]: https://github.com/karpathy/neuraltalk2/blob/master/eval.lua |
3fa09fcbce4efc9a21040d70101e12d5325043c1 | features/groups/templates/groups/group_filter.html | features/groups/templates/groups/group_filter.html | {% extends 'stadt/list.html' %}
{% load crispy_forms_tags rules %}
{% block heading_toolbar %}
{% has_perm 'groups.create_group' user as can_create_group %}
{% if can_create_group %}
<a href="{% url 'group-create' %}" class="btn btn-default pull-right">Neue Gruppe</a>
{% endif %}
{% endblock %}
{% block list %}
<ol class="groups">
{% for group in object_list %}
<li>
{% include 'entities/_group_preview.html' with group=group link=True %}
</li>
{% endfor %}
</ol>
{% endblock %}
{% block list_header %}
{% crispy filter.form %}
{% endblock %}
| {% extends 'stadt/list.html' %}
{% load crispy_forms_tags rules %}
{% block heading_toolbar %}
{% has_perm 'groups.create_group' user as can_create_group %}
{% if can_create_group %}
<a href="{% url 'group-create' %}" class="btn btn-default pull-right">Neue Gruppe</a>
{% endif %}
{% endblock %}
{% block list %}
<ol class="groups">
{% for group in object_list %}
<li>
{% include 'entities/_group_preview.html' with group=group link=True %}
</li>
{% endfor %}
</ol>
{% endblock %}
{% block list_header %}
<div class="disclaimer content-block">
<p>Aktive Gruppen mit vielen Mitgliedern oder Abonnentinnen werden in Auflistungen zuerst angezeigt.</p>
</div>
{% crispy filter.form %}
{% endblock %}
| Add groups sort order hint | Add groups sort order hint
| HTML | agpl-3.0 | stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten | html | ## Code Before:
{% extends 'stadt/list.html' %}
{% load crispy_forms_tags rules %}
{% block heading_toolbar %}
{% has_perm 'groups.create_group' user as can_create_group %}
{% if can_create_group %}
<a href="{% url 'group-create' %}" class="btn btn-default pull-right">Neue Gruppe</a>
{% endif %}
{% endblock %}
{% block list %}
<ol class="groups">
{% for group in object_list %}
<li>
{% include 'entities/_group_preview.html' with group=group link=True %}
</li>
{% endfor %}
</ol>
{% endblock %}
{% block list_header %}
{% crispy filter.form %}
{% endblock %}
## Instruction:
Add groups sort order hint
## Code After:
{% extends 'stadt/list.html' %}
{% load crispy_forms_tags rules %}
{% block heading_toolbar %}
{% has_perm 'groups.create_group' user as can_create_group %}
{% if can_create_group %}
<a href="{% url 'group-create' %}" class="btn btn-default pull-right">Neue Gruppe</a>
{% endif %}
{% endblock %}
{% block list %}
<ol class="groups">
{% for group in object_list %}
<li>
{% include 'entities/_group_preview.html' with group=group link=True %}
</li>
{% endfor %}
</ol>
{% endblock %}
{% block list_header %}
<div class="disclaimer content-block">
<p>Aktive Gruppen mit vielen Mitgliedern oder Abonnentinnen werden in Auflistungen zuerst angezeigt.</p>
</div>
{% crispy filter.form %}
{% endblock %}
|
4cc9368ed686ec9f8bf265aac755c87c52d65bdb | indico/modules/events/agreements/templates/events/agreements/emails/new_signature_email_to_manager.txt | indico/modules/events/agreements/templates/events/agreements/emails/new_signature_email_to_manager.txt | {% extends 'emails/base.txt' %}
{% set state = 'accepted' if agreement.accepted else 'rejected' %}
{% block subject %}Agreement {{ state }}{% endblock %}
{% block footer_title %}Agreements{% endblock %}
{% block header_recipient -%}
event manager
{%- endblock %}
{% block body -%}
A new agreement has been {{ state }} for the event:
{{ agreement.event.getTitle() }}
Person Info:
------------
Name: {{ agreement.person_name }}
Email: {{ agreement.person_email }}
{%- if agreement.reason %}
Reason:
-------
{{ agreement.reason }}
{%- endif %}
{%- endblock %}
| {% extends 'emails/base.txt' %}
{% set state = 'accepted' if agreement.accepted else 'rejected' %}
{% block subject %}Agreement {{ state }}{% endblock %}
{% block footer_title %}Agreements{% endblock %}
{% block header_recipient -%}
event managers
{%- endblock %}
{% block body -%}
A new agreement has been {{ state }} for the event:
{{ agreement.event.getTitle() }}
{% filter underline %}Person Info{% endfilter %}
Name: {{ agreement.person_name }}
Email: {{ agreement.person_email }}
{%- if agreement.reason %}
{% filter underline %}Reason{% endfilter %}
{{ agreement.reason }}
{%- endif %}
{%- endblock %}
| Improve formatting of agreement signature email | Improve formatting of agreement signature email
| Text | mit | indico/indico,mic4ael/indico,DirkHoffmann/indico,OmeGak/indico,mvidalgarcia/indico,ThiefMaster/indico,DirkHoffmann/indico,mvidalgarcia/indico,OmeGak/indico,DirkHoffmann/indico,pferreir/indico,mic4ael/indico,mvidalgarcia/indico,pferreir/indico,ThiefMaster/indico,OmeGak/indico,ThiefMaster/indico,ThiefMaster/indico,indico/indico,OmeGak/indico,DirkHoffmann/indico,pferreir/indico,indico/indico,indico/indico,mic4ael/indico,mvidalgarcia/indico,pferreir/indico,mic4ael/indico | text | ## Code Before:
{% extends 'emails/base.txt' %}
{% set state = 'accepted' if agreement.accepted else 'rejected' %}
{% block subject %}Agreement {{ state }}{% endblock %}
{% block footer_title %}Agreements{% endblock %}
{% block header_recipient -%}
event manager
{%- endblock %}
{% block body -%}
A new agreement has been {{ state }} for the event:
{{ agreement.event.getTitle() }}
Person Info:
------------
Name: {{ agreement.person_name }}
Email: {{ agreement.person_email }}
{%- if agreement.reason %}
Reason:
-------
{{ agreement.reason }}
{%- endif %}
{%- endblock %}
## Instruction:
Improve formatting of agreement signature email
## Code After:
{% extends 'emails/base.txt' %}
{% set state = 'accepted' if agreement.accepted else 'rejected' %}
{% block subject %}Agreement {{ state }}{% endblock %}
{% block footer_title %}Agreements{% endblock %}
{% block header_recipient -%}
event managers
{%- endblock %}
{% block body -%}
A new agreement has been {{ state }} for the event:
{{ agreement.event.getTitle() }}
{% filter underline %}Person Info{% endfilter %}
Name: {{ agreement.person_name }}
Email: {{ agreement.person_email }}
{%- if agreement.reason %}
{% filter underline %}Reason{% endfilter %}
{{ agreement.reason }}
{%- endif %}
{%- endblock %}
|
f0f3dfff69adf75bcc006d6112a00ce4a4ef780d | .github/workflows/main.yml | .github/workflows/main.yml | name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly -c rust-docs
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.5/mdbook-v0.3.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "##[add-path]$(pwd)/bin"
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run tests
run: mdbook test
- name: Style checks
run: (cd style-check && cargo run -- ../src)
- name: Check for broken links
run: |
curl -sSLo linkcheck.sh \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all reference
| name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly -c rust-docs
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.5/mdbook-v0.3.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run tests
run: mdbook test
- name: Style checks
run: (cd style-check && cargo run -- ../src)
- name: Check for broken links
run: |
curl -sSLo linkcheck.sh \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all reference
| Update deprecated GitHub Actions commands. | Update deprecated GitHub Actions commands.
| YAML | apache-2.0 | rust-lang/reference,rust-lang/reference | yaml | ## Code Before:
name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly -c rust-docs
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.5/mdbook-v0.3.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "##[add-path]$(pwd)/bin"
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run tests
run: mdbook test
- name: Style checks
run: (cd style-check && cargo run -- ../src)
- name: Check for broken links
run: |
curl -sSLo linkcheck.sh \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all reference
## Instruction:
Update deprecated GitHub Actions commands.
## Code After:
name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly -c rust-docs
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.3.5/mdbook-v0.3.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run tests
run: mdbook test
- name: Style checks
run: (cd style-check && cargo run -- ../src)
- name: Check for broken links
run: |
curl -sSLo linkcheck.sh \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all reference
|
cffed7b1efa8e318dc134160bf99cf1211824f80 | .travis.yml | .travis.yml | language: php
php:
- 7.0
sudo: false
before_install:
- composer self-update
- rm -rf build
- mkdir build
install:
- travis_retry composer install --no-interaction --prefer-source
script:
- phpunit --configuration test/phpunit.xml.dist --coverage-clover build/clover.xml
after_success:
- travis_retry php vendor/bin/coveralls | language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
sudo: false
before_install:
- composer self-update
- rm -rf build
- mkdir build
install:
- travis_retry composer install --no-interaction --prefer-source
script:
- phpunit --configuration test/phpunit.xml.dist --coverage-clover build/clover.xml
after_success:
- travis_retry php vendor/bin/coveralls | Extend versions of PHP cared about | Extend versions of PHP cared about
| YAML | bsd-3-clause | allansun/docker-cloud-php-api | yaml | ## Code Before:
language: php
php:
- 7.0
sudo: false
before_install:
- composer self-update
- rm -rf build
- mkdir build
install:
- travis_retry composer install --no-interaction --prefer-source
script:
- phpunit --configuration test/phpunit.xml.dist --coverage-clover build/clover.xml
after_success:
- travis_retry php vendor/bin/coveralls
## Instruction:
Extend versions of PHP cared about
## Code After:
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
sudo: false
before_install:
- composer self-update
- rm -rf build
- mkdir build
install:
- travis_retry composer install --no-interaction --prefer-source
script:
- phpunit --configuration test/phpunit.xml.dist --coverage-clover build/clover.xml
after_success:
- travis_retry php vendor/bin/coveralls |
5766a53fbec9c717c93923a8d291cb0978e7354e | Ants/src/com/ibm/sk/MenuMain.java | Ants/src/com/ibm/sk/MenuMain.java | package com.ibm.sk;
import java.util.Arrays;
import java.util.stream.Collectors;
import com.ibm.sk.ant.AntLoader;
import com.ibm.sk.ant.facade.AntFactory;
import com.ibm.sk.ff.gui.common.objects.operations.InitMenuData;
import com.ibm.sk.handlers.GameMenuHandler;
public class MenuMain extends AbstractMain {
public MenuMain() {
super();
}
public static void main(final String args[]) {
final AntFactory[] implementations = AntLoader.getImplementations();
final InitMenuData initData = new InitMenuData();
initData.setCompetitors(Arrays.asList(implementations).stream().map(AntFactory::getTeamName)
.collect(Collectors.toList()).stream().toArray(String[]::new));
showMainWindow(initData);
}
public static void showMainWindow(final InitMenuData initData) {
FACADE.showInitMenu(initData);
FACADE.addGuiEventListener(new GameMenuHandler(FACADE, initData));
}
}
| package com.ibm.sk;
import java.util.Arrays;
import java.util.stream.Collectors;
import com.ibm.sk.ant.AntLoader;
import com.ibm.sk.ant.facade.AntFactory;
import com.ibm.sk.ff.gui.client.ReplayFileHelper;
import com.ibm.sk.ff.gui.common.objects.operations.InitMenuData;
import com.ibm.sk.handlers.GameMenuHandler;
public class MenuMain extends AbstractMain {
public MenuMain() {
super();
}
public static void main(final String args[]) {
final AntFactory[] implementations = AntLoader.getImplementations();
final InitMenuData initData = new InitMenuData();
initData.setCompetitors(Arrays.asList(implementations).stream().map(AntFactory::getTeamName).collect(Collectors.toList()).stream().toArray(String[]::new));
initData.setReplay(ReplayFileHelper.getAvailableReplays());
showMainWindow(initData);
}
public static void showMainWindow(final InitMenuData initData) {
FACADE.showInitMenu(initData);
FACADE.addGuiEventListener(new GameMenuHandler(FACADE, initData));
}
}
| Send replay data to menu | Send replay data to menu | Java | epl-1.0 | gamefest2017/ants | java | ## Code Before:
package com.ibm.sk;
import java.util.Arrays;
import java.util.stream.Collectors;
import com.ibm.sk.ant.AntLoader;
import com.ibm.sk.ant.facade.AntFactory;
import com.ibm.sk.ff.gui.common.objects.operations.InitMenuData;
import com.ibm.sk.handlers.GameMenuHandler;
public class MenuMain extends AbstractMain {
public MenuMain() {
super();
}
public static void main(final String args[]) {
final AntFactory[] implementations = AntLoader.getImplementations();
final InitMenuData initData = new InitMenuData();
initData.setCompetitors(Arrays.asList(implementations).stream().map(AntFactory::getTeamName)
.collect(Collectors.toList()).stream().toArray(String[]::new));
showMainWindow(initData);
}
public static void showMainWindow(final InitMenuData initData) {
FACADE.showInitMenu(initData);
FACADE.addGuiEventListener(new GameMenuHandler(FACADE, initData));
}
}
## Instruction:
Send replay data to menu
## Code After:
package com.ibm.sk;
import java.util.Arrays;
import java.util.stream.Collectors;
import com.ibm.sk.ant.AntLoader;
import com.ibm.sk.ant.facade.AntFactory;
import com.ibm.sk.ff.gui.client.ReplayFileHelper;
import com.ibm.sk.ff.gui.common.objects.operations.InitMenuData;
import com.ibm.sk.handlers.GameMenuHandler;
public class MenuMain extends AbstractMain {
public MenuMain() {
super();
}
public static void main(final String args[]) {
final AntFactory[] implementations = AntLoader.getImplementations();
final InitMenuData initData = new InitMenuData();
initData.setCompetitors(Arrays.asList(implementations).stream().map(AntFactory::getTeamName).collect(Collectors.toList()).stream().toArray(String[]::new));
initData.setReplay(ReplayFileHelper.getAvailableReplays());
showMainWindow(initData);
}
public static void showMainWindow(final InitMenuData initData) {
FACADE.showInitMenu(initData);
FACADE.addGuiEventListener(new GameMenuHandler(FACADE, initData));
}
}
|
e101bb152a3239b2a7f8040c5ee8d81e7b080870 | release-notes.txt | release-notes.txt | New in v.0.1.4:
* Default Java version increased to 7.
* Update Apache Storm recipes for 1.0.1 release.
| New in v.0.1.5:
* Added a DICE-H2020 cookbook and included recipes for installing
BO4CO.
* Added a recipe to the DICE-H2020 cookbook for installing client
programs for DICE deployment service.
* Added support for Apache Cassandra in the technology library.
* Added support for Spark in technology library. At this time we support
the stand-alone version only.
* Added support for installing DICE Deployment Service - the server side.
* Added dependency cookbooks:
* seven_zip
* poise
* poise-language
* poise-service
* poise-archive
* poise-python
New in v.0.1.4:
* Default Java version increased to 7.
* Update Apache Storm recipes for 1.0.1 release.
| Add release notes for v.0.1.5 | Add release notes for v.0.1.5
| Text | apache-2.0 | dice-project/DICE-Chef-Repository,dice-project/DICE-Chef-Repository,dice-project/DICE-Chef-Repository,dice-project/DICE-Chef-Repository | text | ## Code Before:
New in v.0.1.4:
* Default Java version increased to 7.
* Update Apache Storm recipes for 1.0.1 release.
## Instruction:
Add release notes for v.0.1.5
## Code After:
New in v.0.1.5:
* Added a DICE-H2020 cookbook and included recipes for installing
BO4CO.
* Added a recipe to the DICE-H2020 cookbook for installing client
programs for DICE deployment service.
* Added support for Apache Cassandra in the technology library.
* Added support for Spark in technology library. At this time we support
the stand-alone version only.
* Added support for installing DICE Deployment Service - the server side.
* Added dependency cookbooks:
* seven_zip
* poise
* poise-language
* poise-service
* poise-archive
* poise-python
New in v.0.1.4:
* Default Java version increased to 7.
* Update Apache Storm recipes for 1.0.1 release.
|
a4ce089d3a4300dcc5b620f1eee8ace2d6681787 | configure.sh | configure.sh | mkdir deps
cd deps
svn checkout http://or-tools.googlecode.com/svn/trunk/ or-tools-read-only
cd or-tools-read-only
make third_party
make cplibs
| mkdir -p deps
cd deps
svn checkout http://or-tools.googlecode.com/svn/trunk/ or-tools-read-only
cd or-tools-read-only
make third_party
make cplibs
# remove shared objects to enforce static linking
rm -v lib/*.so lib/*.so.*
cd dependencies/install/lib
rm -v *.so *.so.*
| Configure script won't warn if deps directory already exist | Configure script won't warn if deps directory already exist
| Shell | lgpl-2.1 | Stoeoef/ddt,Stoeoef/ddt,Stoeoef/ddt,Stoeoef/ddt | shell | ## Code Before:
mkdir deps
cd deps
svn checkout http://or-tools.googlecode.com/svn/trunk/ or-tools-read-only
cd or-tools-read-only
make third_party
make cplibs
## Instruction:
Configure script won't warn if deps directory already exist
## Code After:
mkdir -p deps
cd deps
svn checkout http://or-tools.googlecode.com/svn/trunk/ or-tools-read-only
cd or-tools-read-only
make third_party
make cplibs
# remove shared objects to enforce static linking
rm -v lib/*.so lib/*.so.*
cd dependencies/install/lib
rm -v *.so *.so.*
|
dc5bb6c79b03720af5eca903593869c9f7bf2c14 | .travis.yml | .travis.yml | language: c++
sudo: required
os: linux
dist: trusty
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-dev
- g++-7
before_install:
- eval "CC=gcc-7 && CXX=g++-7"
script:
- sudo mkdir -p /usr/lib/cmake/SDL2/
- sudo cp sdl2-config.cmake /usr/lib/cmake/SDL2/sdl2-config.cmake
- mkdir build
- cd build
- cmake .. -DCMAKE_CXX_FLAGS='-Wall' -DSDL_DIR=/usr/
- make -j8
- mkdir ../install
- mkdir ../install/bin
- cp zxtk ../install/bin
- mkdir ../install/lib
- cp libload.a libmemory.a ../install/lib
- cd ..
- mkdir zxtk
- cd zxtk
- tar cjvf zxtk_amd64.tar.gz ../install
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
repo: icecream95/icecream95.github.io
target_branch: master
on:
branch: master
| language: c++
sudo: required
os: linux
dist: trusty
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-dev
- g++-7
before_install:
- eval "CC=gcc-7 && CXX=g++-7"
script:
- sudo mkdir -p /usr/lib/cmake/SDL2/
- sudo cp sdl2-config.cmake /usr/lib/cmake/SDL2/sdl2-config.cmake
- mkdir build
- cd build
- cmake .. -DCMAKE_CXX_FLAGS='-Wall' -DSDL_DIR=/usr/
- make -j8
- mkdir ../install
- mkdir ../install/bin
- cp zxtk ../install/bin
- mkdir ../install/lib
- cp libload.a libmemory.a ../install/lib
- cd ..
- git clone https://github.com/icecream95/icecream95.github.io.git zxtk
- cd zxtk
- tar cjvf zxtk_amd64.tar.gz ../install
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
repo: icecream95/icecream95.github.io
target_branch: master
on:
branch: master
| Use hacky fix for Travis force pushing | Use hacky fix for Travis force pushing
| YAML | mit | icecream95/zxtk,icecream95/zxtk | yaml | ## Code Before:
language: c++
sudo: required
os: linux
dist: trusty
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-dev
- g++-7
before_install:
- eval "CC=gcc-7 && CXX=g++-7"
script:
- sudo mkdir -p /usr/lib/cmake/SDL2/
- sudo cp sdl2-config.cmake /usr/lib/cmake/SDL2/sdl2-config.cmake
- mkdir build
- cd build
- cmake .. -DCMAKE_CXX_FLAGS='-Wall' -DSDL_DIR=/usr/
- make -j8
- mkdir ../install
- mkdir ../install/bin
- cp zxtk ../install/bin
- mkdir ../install/lib
- cp libload.a libmemory.a ../install/lib
- cd ..
- mkdir zxtk
- cd zxtk
- tar cjvf zxtk_amd64.tar.gz ../install
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
repo: icecream95/icecream95.github.io
target_branch: master
on:
branch: master
## Instruction:
Use hacky fix for Travis force pushing
## Code After:
language: c++
sudo: required
os: linux
dist: trusty
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsdl2-dev
- g++-7
before_install:
- eval "CC=gcc-7 && CXX=g++-7"
script:
- sudo mkdir -p /usr/lib/cmake/SDL2/
- sudo cp sdl2-config.cmake /usr/lib/cmake/SDL2/sdl2-config.cmake
- mkdir build
- cd build
- cmake .. -DCMAKE_CXX_FLAGS='-Wall' -DSDL_DIR=/usr/
- make -j8
- mkdir ../install
- mkdir ../install/bin
- cp zxtk ../install/bin
- mkdir ../install/lib
- cp libload.a libmemory.a ../install/lib
- cd ..
- git clone https://github.com/icecream95/icecream95.github.io.git zxtk
- cd zxtk
- tar cjvf zxtk_amd64.tar.gz ../install
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
repo: icecream95/icecream95.github.io
target_branch: master
on:
branch: master
|
a2900571e7272fad812106fb7430dd6f4b1b19bc | CONTRIBUTING.rst | CONTRIBUTING.rst | D-Wave welcomes contributions to Ocean projects.
See how to contribute at `Ocean Contributors <https://github.com/dwavesystems/docs/blob/master/contributing.rst>`_.
| D-Wave welcomes contributions to Ocean projects.
See how to contribute at `Ocean Contributors <http://dw-docs.readthedocs.io/en/latest/CONTRIBUTING.html>`_.
| Fix link to main contributing page | Fix link to main contributing page
| reStructuredText | apache-2.0 | dwavesystems/dimod,dwavesystems/dimod | restructuredtext | ## Code Before:
D-Wave welcomes contributions to Ocean projects.
See how to contribute at `Ocean Contributors <https://github.com/dwavesystems/docs/blob/master/contributing.rst>`_.
## Instruction:
Fix link to main contributing page
## Code After:
D-Wave welcomes contributions to Ocean projects.
See how to contribute at `Ocean Contributors <http://dw-docs.readthedocs.io/en/latest/CONTRIBUTING.html>`_.
|
e5d67ab9691938cf248547dc48741109843c4efb | .travis.yml | .travis.yml | sudo: required
language: ruby
services:
- docker
script:
- ls -lah
- docker build -f Dockerfile -t apsl/puput .
- docker-compose -f docker-compose-demo.yml up -d
- docker-compose -f docker-compose-demo.yml ps
- sleep 10
- docker exec -ti dockerpuput_web_1 python manage.py migrate
- wget http://localhost:8000/blog/
notifications:
email:
- gshark@gmail.com
env:
global:
- PUPUT_VERSION=0.4.1
after_success:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $PUPUT_VERSION; fi`
- docker tag apsl/puput apsl/puput:$TAG
- docker push apsl/puput:$TAG
| sudo: required
language: ruby
services:
- docker
script:
- ls -lah
- docker build -f Dockerfile -t apsl/puput .
- docker-compose -f docker-compose.yml up -d
- docker-compose -f docker-compose.yml ps
- sleep 10
- docker exec -ti dockerpuput_web_1 python manage.py migrate
- wget http://localhost:8000/blog/
notifications:
email:
- gshark@gmail.com
env:
global:
- PUPUT_VERSION=0.4.1
after_success:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $PUPUT_VERSION; fi`
- docker tag apsl/puput apsl/puput:$TAG
- docker push apsl/puput:$TAG
| Fix docker-compose reference for CI | Fix docker-compose reference for CI
| YAML | mit | APSL/docker-puput,APSL/docker-puput | yaml | ## Code Before:
sudo: required
language: ruby
services:
- docker
script:
- ls -lah
- docker build -f Dockerfile -t apsl/puput .
- docker-compose -f docker-compose-demo.yml up -d
- docker-compose -f docker-compose-demo.yml ps
- sleep 10
- docker exec -ti dockerpuput_web_1 python manage.py migrate
- wget http://localhost:8000/blog/
notifications:
email:
- gshark@gmail.com
env:
global:
- PUPUT_VERSION=0.4.1
after_success:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $PUPUT_VERSION; fi`
- docker tag apsl/puput apsl/puput:$TAG
- docker push apsl/puput:$TAG
## Instruction:
Fix docker-compose reference for CI
## Code After:
sudo: required
language: ruby
services:
- docker
script:
- ls -lah
- docker build -f Dockerfile -t apsl/puput .
- docker-compose -f docker-compose.yml up -d
- docker-compose -f docker-compose.yml ps
- sleep 10
- docker exec -ti dockerpuput_web_1 python manage.py migrate
- wget http://localhost:8000/blog/
notifications:
email:
- gshark@gmail.com
env:
global:
- PUPUT_VERSION=0.4.1
after_success:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $PUPUT_VERSION; fi`
- docker tag apsl/puput apsl/puput:$TAG
- docker push apsl/puput:$TAG
|
a6aa980c268f0fc2c2bef1935eec3892136933de | doc/CONTRIBUTING.md | doc/CONTRIBUTING.md |
Always provide the following information when submitting an issue:
- Output of `bspwm -v`.
- Content of `bspwmrc`.
- Steps to reproduce the problem.
## Pull Requests
### Requirements
You must be comfortable with [C][1], [XCB][2] and [Git][3].
### Coding Style
I follow the [Linux Coding Style][4] with the following variations:
- [Indent with tabs, align with spaces][5].
- Always use braces when using control structures.
[1]: http://cm.bell-labs.com/cm/cs/cbook/
[2]: http://www.x.org/releases/X11R7.5/doc/libxcb/tutorial/
[3]: http://git-scm.com/documentation
[4]: http://www.kernel.org/doc/Documentation/CodingStyle
[5]: http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/
|
Always provide the following information when submitting an issue:
- Output of `bspwm -v`.
- Content of `bspwmrc`.
- Steps to reproduce the problem.
## Pull Requests
### Requirements
You must be comfortable with [C][1], [XCB][2] and [Git][3].
### Coding Style
I follow the [Linux Coding Style][4] with the following variations:
- [Indent with tabs, align with spaces][5].
- Always use braces when using control structures.
[1]: https://www.bell-labs.com/usr/dmr/www/cbook/
[2]: http://www.x.org/releases/X11R7.5/doc/libxcb/tutorial/
[3]: http://git-scm.com/documentation
[4]: http://www.kernel.org/doc/Documentation/CodingStyle
[5]: http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/
| Fix link to the K&R C book | Fix link to the K&R C book
Fixes #512.
| Markdown | bsd-2-clause | nfnty/bspwm,baskerville/bspwm,medisun/bspwm,JBouron/bspwm,JBouron/bspwm,nfnty/bspwm,baskerville/bspwm,nfnty/bspwm,medisun/bspwm,medisun/bspwm,JBouron/bspwm | markdown | ## Code Before:
Always provide the following information when submitting an issue:
- Output of `bspwm -v`.
- Content of `bspwmrc`.
- Steps to reproduce the problem.
## Pull Requests
### Requirements
You must be comfortable with [C][1], [XCB][2] and [Git][3].
### Coding Style
I follow the [Linux Coding Style][4] with the following variations:
- [Indent with tabs, align with spaces][5].
- Always use braces when using control structures.
[1]: http://cm.bell-labs.com/cm/cs/cbook/
[2]: http://www.x.org/releases/X11R7.5/doc/libxcb/tutorial/
[3]: http://git-scm.com/documentation
[4]: http://www.kernel.org/doc/Documentation/CodingStyle
[5]: http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/
## Instruction:
Fix link to the K&R C book
Fixes #512.
## Code After:
Always provide the following information when submitting an issue:
- Output of `bspwm -v`.
- Content of `bspwmrc`.
- Steps to reproduce the problem.
## Pull Requests
### Requirements
You must be comfortable with [C][1], [XCB][2] and [Git][3].
### Coding Style
I follow the [Linux Coding Style][4] with the following variations:
- [Indent with tabs, align with spaces][5].
- Always use braces when using control structures.
[1]: https://www.bell-labs.com/usr/dmr/www/cbook/
[2]: http://www.x.org/releases/X11R7.5/doc/libxcb/tutorial/
[3]: http://git-scm.com/documentation
[4]: http://www.kernel.org/doc/Documentation/CodingStyle
[5]: http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/
|
6cd001d5bef42b119a4695058e683e2d0b4495c1 | README.md | README.md | This repository contains a working example of public Shopify App using Codeigniter and Embedded App SDK
-> Do the following Changes in <strong>config.php</strong>
1-Change API Key<br>
2-Change Secret<br>
3-Change base url <br>
4-Change redirect_url <br>
| This repository contains a working example of public Shopify App using Codeigniter and Embedded App SDK
-> Do the following Changes in <strong>config.php</strong>
1-Change API Key<br>
2-Change Secret<br>
3-Change base url <br>
4-Change redirect_url <br>
5-Go to Controller Auth -> find $shop, remove $this->input->get('shop'); for your store without **https://**<br>
Example: `mystore.myshopify.com/`
| Update Readme for new shopify development 2018 | Update Readme for new shopify development 2018
Its necesary to change this value for your app works with shopify partner account | Markdown | mit | ZoobiDoobi/shopify_codeigniter_working_example,ZoobiDoobi/shopify_codeigniter_working_example | markdown | ## Code Before:
This repository contains a working example of public Shopify App using Codeigniter and Embedded App SDK
-> Do the following Changes in <strong>config.php</strong>
1-Change API Key<br>
2-Change Secret<br>
3-Change base url <br>
4-Change redirect_url <br>
## Instruction:
Update Readme for new shopify development 2018
Its necesary to change this value for your app works with shopify partner account
## Code After:
This repository contains a working example of public Shopify App using Codeigniter and Embedded App SDK
-> Do the following Changes in <strong>config.php</strong>
1-Change API Key<br>
2-Change Secret<br>
3-Change base url <br>
4-Change redirect_url <br>
5-Go to Controller Auth -> find $shop, remove $this->input->get('shop'); for your store without **https://**<br>
Example: `mystore.myshopify.com/`
|
9155d496eb660fbdd38bcc67051120d5bb9ee5e1 | NetBackendWithTableStorage/Readme.md | NetBackendWithTableStorage/Readme.md | The code under this directory was presented in the [blog post about continuation links and table storage in the .NET backend](http://azure.microsoft.com/blog/2014/10/10/better-paging-support-with-table-storage-in-mobile-services-net-backend.aspx).
| The code under this directory was presented in the [blog post about continuation links and table storage in the .NET backend](https://azure.microsoft.com/blog/better-support-for-paging-with-table-storage-in-azure-mobile-services-net-backend/).
| Fix link to Azure blog post | Fix link to Azure blog post | Markdown | apache-2.0 | Azure/mobile-services-samples,Azure/mobile-services-samples,Azure/mobile-services-samples,Azure/mobile-services-samples,Azure/mobile-services-samples,Azure/mobile-services-samples,Azure/mobile-services-samples,Azure/mobile-services-samples | markdown | ## Code Before:
The code under this directory was presented in the [blog post about continuation links and table storage in the .NET backend](http://azure.microsoft.com/blog/2014/10/10/better-paging-support-with-table-storage-in-mobile-services-net-backend.aspx).
## Instruction:
Fix link to Azure blog post
## Code After:
The code under this directory was presented in the [blog post about continuation links and table storage in the .NET backend](https://azure.microsoft.com/blog/better-support-for-paging-with-table-storage-in-azure-mobile-services-net-backend/).
|
a4a312d927429560c18bcf076f9fc3de3fd495df | requirements.txt | requirements.txt | cached-property==1.3.0
coverage==4.3.1
dateutils==0.6.6
requests==2.12.4
| cached-property==1.3.1
coverage==4.4.1
python-dateutil==2.6.1
requests==2.18.4
| Upgrade packages and replace dateutils by python-dateutil | Upgrade packages and replace dateutils by python-dateutil
| Text | mit | indradhanush/dnsimple2-python | text | ## Code Before:
cached-property==1.3.0
coverage==4.3.1
dateutils==0.6.6
requests==2.12.4
## Instruction:
Upgrade packages and replace dateutils by python-dateutil
## Code After:
cached-property==1.3.1
coverage==4.4.1
python-dateutil==2.6.1
requests==2.18.4
|
d22e0b325cca5d28f7f48d01334d43d82e7fcb95 | requirements.txt | requirements.txt | Fabric==1.5.1
Jinja2==2.6
PyYAML==3.10
WebOb==1.2.3
argparse==1.2.1
beautifulsoup4==4.1.3
boto==2.10.0
cloudformation==0.0.0
decorator==3.4.0
distribute==0.6.30
docopt==0.6.1
dogapi==1.2.3
ipython==0.13.1
jenkinsapi==0.1.11
lxml==3.1beta1
newrelic==1.10.2.38
path.py==3.0.1
pingdom==0.2.0
pycrypto==2.6
pyparsing==1.5.6
pyrelic==0.2.0
python-dateutil==2.1
requests==1.1.0
schema==0.1.1
simplejson==3.3.0
simples3==1.0-alpha
six==1.2.0
-e git+https://github.com/bos/statprof.py.git@a17f7923b102c9039763583be9e377e8422e8f5f#egg=statprof-dev
ujson==1.30
wsgiref==0.1.2
Jinja2==2.6
ansible==1.3.1
paramiko==1.10.1
| Fabric==1.5.1
Jinja2==2.6
PyYAML==3.10
WebOb==1.2.3
argparse==1.2.1
beautifulsoup4==4.1.3
boto==2.10.0
cloudformation==0.0.0
decorator==3.4.0
distribute==0.6.30
docopt==0.6.1
dogapi==1.2.3
ipython==0.13.1
jenkinsapi==0.1.11
lxml==3.1beta1
newrelic==1.10.2.38
path.py==3.0.1
pingdom==0.2.0
pycrypto==2.6
pyparsing==1.5.6
pyrelic==0.2.0
python-dateutil==2.1
requests==1.1.0
schema==0.1.1
simplejson==3.3.0
simples3==1.0-alpha
six==1.2.0
-e git+https://github.com/bos/statprof.py.git@a17f7923b102c9039763583be9e377e8422e8f5f#egg=statprof-dev
ujson==1.30
wsgiref==0.1.2
ansible==1.3.1
| Remove dependencies that should come from setup.py because we don't depend on them directly. | Remove dependencies that should come from setup.py because we don't depend on them directly.
| Text | agpl-3.0 | ovnicraft/evex-configuration,Stanford-Online/configuration,chenshuchuan/configuration,usernamenumber/configuration,jorgeomarmh/configuration,hastexo/edx-configuration,edx/configuration,stvstnfrd/configuration,gashac03/ubuntu,louyihua/configuration,kursitet/configuration,appsembler/configuration,lgfa29/configuration,Unow/configuration,arifsetiawan/configuration,EDUlib/configuration,pedrorib/istx,antoviaque/configuration,gsehub/configuration,arifsetiawan/configuration,bugcy013/edx_infra,proversity-org/configuration,chudaol/configuration,nunpa/configuration,glengal/configuration,appsembler/configuration,jp-bpl/configuration,CredoReference/configuration,knehez/configuration,sudheerchintala/LearnEra-Configuration,vasyarv/configuration,pobrejuanito/configuration,4eek/configuration,antoviaque/configuration,nttks/configuration,negritobomb/edxplat,Livit/Livit.Learn.EdX.configuration,xiangjf/configuration,nttks/configuration,Stanford-Online/configuration,cecep-edu/configuration,antshin72/configuration,hastexo/edx-configuration-old,cyanna/configuration,beacloudgenius/configuration,alu042/configuration,stvstnfrd/configuration,nunpa/configuration,antshin72/configuration,hastexo/edx-configuration,leansoft/configuration,hmcmooc/ec2-edx-configuration,antshin72/configuration,stvstnfrd/configuration,IONISx/edx-configuration,proversity-org/configuration,EDUlib/configuration,hks-epod/configuration,lgfa29/configuration,Pieros/configuration,openfun/configuration,jp-bpl/configuration,louyihua/configuration,vasyarv/configuration,kencung/configuration,hks-epod/configuration,gashac03/ubuntu,pedrorib/istx,bugcy013/edx_infra,B-MOOC/configuration,armaan/edx-configuration,nunpa/configuration,michaelsteiner19/open-edx-configuration,fghaas/edx-configuration,bugcy013/edx_infra,gashac03/ubuntu,mitodl/configuration,apigee/edx-configuration,Softmotions/configuration,antoviaque/configuration,beacloudgenius/configuration,hmcmooc/ec2-edx-configuration,hks-epod/configuration,Pieros/configuration,kencung/configuration,chudaol/configuration,kencung/configuration,omarkhan/configuration,marcore/configuration,antshin72/configuration,kursitet/configuration,nttks/configuration,nikolas/configuration,leansoft/configuration,xiangjf/configuration,IndonesiaX/configuration,openfun/configuration,openfun/configuration,Stanford-Online/configuration,arbrandes/edx-configuration,arbrandes/edx-configuration,arbrandes/edx-configuration,nunpa/configuration,EDUlib/configuration,glengal/configuration,negritobomb/edxplat,kencung/configuration,michaelsteiner19/open-edx-configuration,cecep-edu/configuration,rue89-tech/configuration,apigee/edx-configuration,Livit/Livit.Learn.EdX.configuration,Stanford-Online/configuration,joshhu/configuration,AlfiyaZi/configuration,fghaas/edx-configuration,knehez/configuration,jorgeomarmh/configuration,Pieros/configuration,nikolas/configuration,kmoocdev/configuration,zhengjunwei/configuration,hastexo/edx-configuration-old,marcore/configuration,pedrorib/istx,LearnEra/LearnEra-Configuration,rue89-tech/configuration,mitodl/configuration,EDUlib/configuration,bugcy013/edx_infra,eduStack/configuration,glengal/configuration,jorgeomarmh/configuration,cyanna/configuration,IndonesiaX/configuration,beacloudgenius/configuration,jorgeomarmh/configuration,IndonesiaX/configuration,proversity-org/configuration,edx/configuration,sudheerchintala/LearnEra-Configuration,B-MOOC/configuration,chudaol/configuration,Unow/configuration,apigee/edx-configuration,cecep-edu/configuration,AlfiyaZi/configuration,Carlos2005/configuration,armaan/edx-configuration,jp-bpl/configuration,Carlos2005/configuration,leansoft/configuration,alu042/configuration,gsehub/configuration,negritobomb/edxplat,nikolas/configuration,nikolas/configuration,jp-bpl/configuration,hastexo/edx-configuration,proversity-org/configuration,edx/configuration,negritobomb/edxplat,Stanford-Online/configuration,chudaol/configuration,pobrejuanito/configuration,omarkhan/configuration,joshhu/configuration,open-craft/configuration,zhengjunwei/configuration,zhengjunwei/configuration,arifsetiawan/configuration,leansoft/configuration,alu042/configuration,vasyarv/configuration,hastexo/edx-configuration-old,arbrandes/edx-configuration,hks-epod/configuration,AlfiyaZi/configuration,rue89-tech/configuration,kursitet/configuration,gsehub/configuration,kmoocdev/configuration,open-craft/configuration,Livit/Livit.Learn.EdX.configuration,lgfa29/configuration,appsembler/configuration,chenshuchuan/configuration,michaelsteiner19/open-edx-configuration,ovnicraft/evex-configuration,lgfa29/configuration,hmcmooc/ec2-edx-configuration,armaan/edx-configuration,CredoReference/configuration,IndonesiaX/configuration,michaelsteiner19/open-edx-configuration,IONISx/edx-configuration,hks-epod/configuration,xiangjf/configuration,usernamenumber/configuration,IONISx/edx-configuration,hastexo/edx-configuration,appsembler/configuration,glengal/configuration,UXE/edx-configuration,marcore/configuration,4eek/configuration,joshhu/configuration,louyihua/configuration,Pieros/configuration,vasyarv/configuration,Unow/configuration,joshhu/configuration,UXE/edx-configuration,Softmotions/configuration,AlfiyaZi/configuration,pobrejuanito/configuration,zhengjunwei/configuration,EDUlib/configuration,rue89-tech/configuration,ovnicraft/evex-configuration,cyanna/configuration,pedrorib/istx,Softmotions/configuration,yrchen/configuration,4eek/configuration,gashac03/ubuntu,hastexo/edx-configuration,mitodl/configuration,stvstnfrd/configuration,sudheerchintala/LearnEra-Configuration,Livit/Livit.Learn.EdX.configuration,open-craft/configuration,beacloudgenius/configuration,knehez/configuration,eduStack/configuration,UXE/edx-configuration,armaan/edx-configuration,nttks/configuration,stvstnfrd/configuration,fghaas/edx-configuration,cyanna/configuration,open-craft/configuration,kursitet/configuration,knehez/configuration,chenshuchuan/configuration,eduStack/configuration,LearnEra/LearnEra-Configuration,4eek/configuration,omarkhan/configuration,marcore/configuration,openfun/configuration,Carlos2005/configuration,UXE/edx-configuration,pobrejuanito/configuration,hastexo/edx-configuration-old,gsehub/configuration,omarkhan/configuration,alu042/configuration,arifsetiawan/configuration,proversity-org/configuration,usernamenumber/configuration,yrchen/configuration,fghaas/edx-configuration,louyihua/configuration,rue89-tech/configuration,usernamenumber/configuration,kmoocdev/configuration,CredoReference/configuration,antoviaque/configuration,edx/configuration,gsehub/configuration,kmoocdev/configuration,Softmotions/configuration,xiangjf/configuration,arbrandes/edx-configuration,jp-bpl/configuration,B-MOOC/configuration,IONISx/edx-configuration,yrchen/configuration,mitodl/configuration,CredoReference/configuration,LearnEra/LearnEra-Configuration,Carlos2005/configuration,yrchen/configuration | text | ## Code Before:
Fabric==1.5.1
Jinja2==2.6
PyYAML==3.10
WebOb==1.2.3
argparse==1.2.1
beautifulsoup4==4.1.3
boto==2.10.0
cloudformation==0.0.0
decorator==3.4.0
distribute==0.6.30
docopt==0.6.1
dogapi==1.2.3
ipython==0.13.1
jenkinsapi==0.1.11
lxml==3.1beta1
newrelic==1.10.2.38
path.py==3.0.1
pingdom==0.2.0
pycrypto==2.6
pyparsing==1.5.6
pyrelic==0.2.0
python-dateutil==2.1
requests==1.1.0
schema==0.1.1
simplejson==3.3.0
simples3==1.0-alpha
six==1.2.0
-e git+https://github.com/bos/statprof.py.git@a17f7923b102c9039763583be9e377e8422e8f5f#egg=statprof-dev
ujson==1.30
wsgiref==0.1.2
Jinja2==2.6
ansible==1.3.1
paramiko==1.10.1
## Instruction:
Remove dependencies that should come from setup.py because we don't depend on them directly.
## Code After:
Fabric==1.5.1
Jinja2==2.6
PyYAML==3.10
WebOb==1.2.3
argparse==1.2.1
beautifulsoup4==4.1.3
boto==2.10.0
cloudformation==0.0.0
decorator==3.4.0
distribute==0.6.30
docopt==0.6.1
dogapi==1.2.3
ipython==0.13.1
jenkinsapi==0.1.11
lxml==3.1beta1
newrelic==1.10.2.38
path.py==3.0.1
pingdom==0.2.0
pycrypto==2.6
pyparsing==1.5.6
pyrelic==0.2.0
python-dateutil==2.1
requests==1.1.0
schema==0.1.1
simplejson==3.3.0
simples3==1.0-alpha
six==1.2.0
-e git+https://github.com/bos/statprof.py.git@a17f7923b102c9039763583be9e377e8422e8f5f#egg=statprof-dev
ujson==1.30
wsgiref==0.1.2
ansible==1.3.1
|
b9a673a20e70b5c949d72f4a963641e8868c75f1 | README.md | README.md |
_* WARNING: This is an experimental Gem and should not be used in production codebases *_
## Introduction
In an effort to follow [Single Responsibility Principle](http://www.oodesign.com/single-responsibility-principle.html) and combat [Fat Models](http://en.oreilly.com/rails2011/public/schedule/detail/18514), this Gem will throw an `ActiveModel::ForbiddenMethods` exception when instance methods are added to any of your ActiveRecord models.
class Person < ActiveRecord::Base
# This will raise an ActiveModel::ForbiddenMethods exception because it's an
# instance method on your ActiveRecord class
def full_name
end
end
## Installation
Add to Gemfile and run `bundle`
# Gemfile
gem 'mugatu'
Create an initializer to include mugatu module in all Active Record objects
# config/initializers/mugatu.rb
ActiveRecord::Base.send :include, ActiveModel::ForbiddenMethodsProtection |
_Experimental Gem used to keep your models skinny. Don't use it in anything you care about._

## Introduction
In an effort to follow [Single Responsibility Principle](http://www.oodesign.com/single-responsibility-principle.html) and combat [Fat Models](http://en.oreilly.com/rails2011/public/schedule/detail/18514), Mugatu will throw an `ActiveModel::ForbiddenMethods` hissy-fit (exception) when instance methods are added to any of your ActiveRecord models.
class Person < ActiveRecord::Base
# This will raise an ActiveModel::ForbiddenMethods exception because it's an
# instance method on your ActiveRecord class
def full_name
end
end
## Installation
Add to Gemfile and run `bundle`
# Gemfile
gem 'mugatu'
Create an initializer to include mugatu module in all Active Record objects
# config/initializers/mugatu.rb
ActiveRecord::Base.send :include, ActiveModel::ForbiddenMethodsProtection
| Update with pic of mugatu | Update with pic of mugatu | Markdown | mit | harlow/mugatu | markdown | ## Code Before:
_* WARNING: This is an experimental Gem and should not be used in production codebases *_
## Introduction
In an effort to follow [Single Responsibility Principle](http://www.oodesign.com/single-responsibility-principle.html) and combat [Fat Models](http://en.oreilly.com/rails2011/public/schedule/detail/18514), this Gem will throw an `ActiveModel::ForbiddenMethods` exception when instance methods are added to any of your ActiveRecord models.
class Person < ActiveRecord::Base
# This will raise an ActiveModel::ForbiddenMethods exception because it's an
# instance method on your ActiveRecord class
def full_name
end
end
## Installation
Add to Gemfile and run `bundle`
# Gemfile
gem 'mugatu'
Create an initializer to include mugatu module in all Active Record objects
# config/initializers/mugatu.rb
ActiveRecord::Base.send :include, ActiveModel::ForbiddenMethodsProtection
## Instruction:
Update with pic of mugatu
## Code After:
_Experimental Gem used to keep your models skinny. Don't use it in anything you care about._

## Introduction
In an effort to follow [Single Responsibility Principle](http://www.oodesign.com/single-responsibility-principle.html) and combat [Fat Models](http://en.oreilly.com/rails2011/public/schedule/detail/18514), Mugatu will throw an `ActiveModel::ForbiddenMethods` hissy-fit (exception) when instance methods are added to any of your ActiveRecord models.
class Person < ActiveRecord::Base
# This will raise an ActiveModel::ForbiddenMethods exception because it's an
# instance method on your ActiveRecord class
def full_name
end
end
## Installation
Add to Gemfile and run `bundle`
# Gemfile
gem 'mugatu'
Create an initializer to include mugatu module in all Active Record objects
# config/initializers/mugatu.rb
ActiveRecord::Base.send :include, ActiveModel::ForbiddenMethodsProtection
|
9347b445475c99958c0ca5c4ced58532f4d639b1 | AppTests/MASErrorTestCase.swift | AppTests/MASErrorTestCase.swift | //
// MASErrorTestCase.swift
// mas-tests
//
// Created by Ben Chatelain on 2/11/18.
// Copyright © 2018 Andrew Naylor. All rights reserved.
//
//@testable import mas
import XCTest
import Foundation
class MASErrorTestCase: XCTestCase {
var error: MASError!
override func setUp() {
super.setUp()
}
override func tearDown() {
super.tearDown()
}
func testNotSignedIn() {
error = .notSignedIn
XCTAssertEqual(error.description, "Not signed in")
}
}
| //
// MASErrorTestCase.swift
// mas-tests
//
// Created by Ben Chatelain on 2/11/18.
// Copyright © 2018 Andrew Naylor. All rights reserved.
//
//@testable import mas
import XCTest
import Foundation
class MASErrorTestCase: XCTestCase {
private let errorDomain = "MAS"
var error: MASError!
var nserror: NSError!
/// Convenience property for setting the value which will be use for the localized description
/// value of the next NSError created. Only used when the NSError does not have a user info
/// entry for localized description.
var localizedDescription: String {
get { return "dummy value" }
set {
NSError.setUserInfoValueProvider(forDomain: errorDomain) { (error: Error, userInfoKey: String) -> Any? in
return newValue
}
}
}
override func setUp() {
super.setUp()
nserror = NSError(domain: errorDomain, code: 999) //, userInfo: ["NSLocalizedDescriptionKey": "foo"])
}
override func tearDown() {
nserror = nil
error = nil
super.tearDown()
}
func testNotSignedIn() {
error = .notSignedIn
XCTAssertEqual(error.description, "Not signed in")
}
func testSignInFailed() {
error = .signInFailed(error: nil)
XCTAssertEqual(error.description, "Sign in failed")
}
func testSignInFailedError() {
localizedDescription = "foo"
error = .signInFailed(error: nserror)
XCTAssertEqual("Sign in failed: foo", error.description)
}
}
| Add sign in failed tests | Add sign in failed tests
| Swift | mit | mas-cli/mas,mas-cli/mas,mas-cli/mas,argon/mas,argon/mas,mas-cli/mas,argon/mas,argon/mas,argon/mas | swift | ## Code Before:
//
// MASErrorTestCase.swift
// mas-tests
//
// Created by Ben Chatelain on 2/11/18.
// Copyright © 2018 Andrew Naylor. All rights reserved.
//
//@testable import mas
import XCTest
import Foundation
class MASErrorTestCase: XCTestCase {
var error: MASError!
override func setUp() {
super.setUp()
}
override func tearDown() {
super.tearDown()
}
func testNotSignedIn() {
error = .notSignedIn
XCTAssertEqual(error.description, "Not signed in")
}
}
## Instruction:
Add sign in failed tests
## Code After:
//
// MASErrorTestCase.swift
// mas-tests
//
// Created by Ben Chatelain on 2/11/18.
// Copyright © 2018 Andrew Naylor. All rights reserved.
//
//@testable import mas
import XCTest
import Foundation
class MASErrorTestCase: XCTestCase {
private let errorDomain = "MAS"
var error: MASError!
var nserror: NSError!
/// Convenience property for setting the value which will be use for the localized description
/// value of the next NSError created. Only used when the NSError does not have a user info
/// entry for localized description.
var localizedDescription: String {
get { return "dummy value" }
set {
NSError.setUserInfoValueProvider(forDomain: errorDomain) { (error: Error, userInfoKey: String) -> Any? in
return newValue
}
}
}
override func setUp() {
super.setUp()
nserror = NSError(domain: errorDomain, code: 999) //, userInfo: ["NSLocalizedDescriptionKey": "foo"])
}
override func tearDown() {
nserror = nil
error = nil
super.tearDown()
}
func testNotSignedIn() {
error = .notSignedIn
XCTAssertEqual(error.description, "Not signed in")
}
func testSignInFailed() {
error = .signInFailed(error: nil)
XCTAssertEqual(error.description, "Sign in failed")
}
func testSignInFailedError() {
localizedDescription = "foo"
error = .signInFailed(error: nserror)
XCTAssertEqual("Sign in failed: foo", error.description)
}
}
|
4fa18f7ac77b99cdf53a45b5494497f2ca3ef36f | rkerberos.gemspec | rkerberos.gemspec | require 'rubygems'
Gem::Specification.new do |spec|
spec.name = 'rkerberos'
spec.version = '0.1.2'
spec.authors = ['Daniel Berger', 'Dominic Cleal']
spec.license = 'Artistic 2.0'
spec.email = ['djberg96@gmail.com', 'dcleal@redhat.com']
spec.homepage = 'http://github.com/domcleal/rkerberos'
spec.summary = 'A Ruby interface for the the Kerberos library'
spec.test_files = Dir['test/test*']
spec.extensions = ['ext/rkerberos/extconf.rb']
spec.files = Dir['**/*'].reject{ |f| f.include?('git') || f.include?('tmp') }
spec.extra_rdoc_files = ['README.md', 'CHANGES', 'MANIFEST'] + Dir['ext/rkerberos/*.c']
spec.add_dependency('rake-compiler')
spec.add_development_dependency('test-unit', '>= 2.1.0')
spec.add_development_dependency('dbi-dbrc', '>= 1.1.6')
spec.description = <<-EOF
The rkerberos library is an interface for the Kerberos 5 network
authentication protocol. It wraps the Kerberos C API.
EOF
end
| require 'rubygems'
Gem::Specification.new do |spec|
spec.name = 'rkerberos'
spec.version = '0.1.2'
spec.authors = ['Daniel Berger', 'Dominic Cleal']
spec.license = 'Artistic 2.0'
spec.email = ['djberg96@gmail.com', 'dcleal@redhat.com']
spec.homepage = 'http://github.com/domcleal/rkerberos'
spec.summary = 'A Ruby interface for the the Kerberos library'
spec.test_files = Dir['test/test*']
spec.extensions = ['ext/rkerberos/extconf.rb']
spec.files = `git ls-files`.split("\n").reject { |f| f.include?('git') }
spec.extra_rdoc_files = ['README.md', 'CHANGES', 'MANIFEST'] + Dir['ext/rkerberos/*.c']
spec.add_dependency('rake-compiler')
spec.add_development_dependency('test-unit', '>= 2.1.0')
spec.add_development_dependency('dbi-dbrc', '>= 1.1.6')
spec.description = <<-EOF
The rkerberos library is an interface for the Kerberos 5 network
authentication protocol. It wraps the Kerberos C API.
EOF
end
| Improve gem file content list to exclude Gemfile.lock | Improve gem file content list to exclude Gemfile.lock
| Ruby | artistic-2.0 | sonOfRa/rkerberos,domcleal/rkerberos,sonOfRa/rkerberos,domcleal/rkerberos | ruby | ## Code Before:
require 'rubygems'
Gem::Specification.new do |spec|
spec.name = 'rkerberos'
spec.version = '0.1.2'
spec.authors = ['Daniel Berger', 'Dominic Cleal']
spec.license = 'Artistic 2.0'
spec.email = ['djberg96@gmail.com', 'dcleal@redhat.com']
spec.homepage = 'http://github.com/domcleal/rkerberos'
spec.summary = 'A Ruby interface for the the Kerberos library'
spec.test_files = Dir['test/test*']
spec.extensions = ['ext/rkerberos/extconf.rb']
spec.files = Dir['**/*'].reject{ |f| f.include?('git') || f.include?('tmp') }
spec.extra_rdoc_files = ['README.md', 'CHANGES', 'MANIFEST'] + Dir['ext/rkerberos/*.c']
spec.add_dependency('rake-compiler')
spec.add_development_dependency('test-unit', '>= 2.1.0')
spec.add_development_dependency('dbi-dbrc', '>= 1.1.6')
spec.description = <<-EOF
The rkerberos library is an interface for the Kerberos 5 network
authentication protocol. It wraps the Kerberos C API.
EOF
end
## Instruction:
Improve gem file content list to exclude Gemfile.lock
## Code After:
require 'rubygems'
Gem::Specification.new do |spec|
spec.name = 'rkerberos'
spec.version = '0.1.2'
spec.authors = ['Daniel Berger', 'Dominic Cleal']
spec.license = 'Artistic 2.0'
spec.email = ['djberg96@gmail.com', 'dcleal@redhat.com']
spec.homepage = 'http://github.com/domcleal/rkerberos'
spec.summary = 'A Ruby interface for the the Kerberos library'
spec.test_files = Dir['test/test*']
spec.extensions = ['ext/rkerberos/extconf.rb']
spec.files = `git ls-files`.split("\n").reject { |f| f.include?('git') }
spec.extra_rdoc_files = ['README.md', 'CHANGES', 'MANIFEST'] + Dir['ext/rkerberos/*.c']
spec.add_dependency('rake-compiler')
spec.add_development_dependency('test-unit', '>= 2.1.0')
spec.add_development_dependency('dbi-dbrc', '>= 1.1.6')
spec.description = <<-EOF
The rkerberos library is an interface for the Kerberos 5 network
authentication protocol. It wraps the Kerberos C API.
EOF
end
|
70b1a8e864bc0a27926b29d5d9b033c576883438 | cmd/chasmd/README.md | cmd/chasmd/README.md |
`chasmd` is a "black hole" InfluxDB imitation using the `chasm` package.
Currently, it only supports HTTP writes.
`chasmd` is useful to get a sense of how much load an InfluxDB client can generate when there is minimal request processing overhead.
When you start `chasmd`, it will log out the number of HTTP requests, lines, and bytes accepted.
|
`chasmd` is a "black hole" InfluxDB imitation using the `chasm` package.
It's an HTTP server with a `/write` endpoint, that _acts like_ an InfluxDB server, but actually just discards the data.
Currently, it only supports HTTP writes.
`chasmd` is useful to get a sense of the theoretical maximum throughput
an InfluxDB client can generate when there is minimal request processing overhead.
When you start `chasmd`, it will log out the number of HTTP requests, lines, and bytes accepted.
| Add some clarification to the readme. | Add some clarification to the readme. | Markdown | mit | mark-rushakoff/mountainflux | markdown | ## Code Before:
`chasmd` is a "black hole" InfluxDB imitation using the `chasm` package.
Currently, it only supports HTTP writes.
`chasmd` is useful to get a sense of how much load an InfluxDB client can generate when there is minimal request processing overhead.
When you start `chasmd`, it will log out the number of HTTP requests, lines, and bytes accepted.
## Instruction:
Add some clarification to the readme.
## Code After:
`chasmd` is a "black hole" InfluxDB imitation using the `chasm` package.
It's an HTTP server with a `/write` endpoint, that _acts like_ an InfluxDB server, but actually just discards the data.
Currently, it only supports HTTP writes.
`chasmd` is useful to get a sense of the theoretical maximum throughput
an InfluxDB client can generate when there is minimal request processing overhead.
When you start `chasmd`, it will log out the number of HTTP requests, lines, and bytes accepted.
|
ccb5da9c2f40fb3bcfd7b7811305de21561ba3c9 | commands/receiveMessage.js | commands/receiveMessage.js | 'use strict';
const db = require('../services/db');
const moment = require('moment');
module.exports = {
db_required: true,
events: ['message', 'join', 'action'],
allow: ({isAuthenticated}) => isAuthenticated,
response ({bot, author_match: [nick], channel, eventType}) {
return db.conn.query(
'SELECT * FROM Message M JOIN User U ON M.TargetID = U.UserID JOIN Nick N ON U.UserID = N.UserID WHERE N.Nickname LIKE ? GROUP BY M.MessageID',
[`%${nick}%`]
).filter(message => (channel === message.Location || eventType !== 'join') && (!message.Location.startsWith('#') || {}.hasOwnProperty.call(bot.chans[message.Location].users, nick)))
.each(message => db.conn.query(`DELETE FROM Message WHERE MessageID = ${message.MessageID}`))
.map(message => ({
response_type: 'text',
target: message.Location.startsWith('#') ? message.Location : nick,
message: `${nick}: ${message.MessageText} (from ${message.SenderName}, ${moment(message.MessageDate).utcOffset(message.Timezone).format('YYYY-MM-DD HH:mm:ss UTCZZ')})`
}));
}
};
| 'use strict';
const db = require('../services/db');
const moment = require('moment');
module.exports = {
db_required: true,
events: ['message', 'join', 'action'],
allow: ({isAuthenticated}) => isAuthenticated,
response ({author_match: [nick], channel, eventType}) {
return db.conn.query(
'SELECT * FROM Message M JOIN User U ON M.TargetID = U.UserID JOIN Nick N ON U.UserID = N.UserID WHERE N.Nickname LIKE ? GROUP BY M.MessageID',
[`%${nick}%`]
).map(message => {
if (channel === message.Location || !message.Location.startsWith('#')) {
return db.conn.query(`DELETE FROM Message WHERE MessageID = ${message.MessageID}`).return({
response_type: 'text',
target: message.Location.startsWith('#') ? message.Location : nick,
message: `${nick}: ${message.MessageText} (from ${message.SenderName}, ${formatTimestamp(message)})`
});
}
if (eventType !== 'join' && !message.UserNotified) {
return db.conn.query('UPDATE Message SET UserNotified = TRUE WHERE MessageID = ?', [message.MessageID]).return({
response_type: 'text',
target: nick,
message: `You have a message from ${message.SenderName} in ${message.Location} (sent at ${formatTimestamp(message)}).`
});
}
});
}
};
function formatTimestamp (message) {
return moment(message.MessageDate).utcOffset(message.Timezone).format('YYYY-MM-DD HH:mm:ss UTCZZ');
}
| Add PM notifications for messages in another channel | Add PM notifications for messages in another channel
Fixes #42
| JavaScript | apache-2.0 | pokemontrades/porygon-bot | javascript | ## Code Before:
'use strict';
const db = require('../services/db');
const moment = require('moment');
module.exports = {
db_required: true,
events: ['message', 'join', 'action'],
allow: ({isAuthenticated}) => isAuthenticated,
response ({bot, author_match: [nick], channel, eventType}) {
return db.conn.query(
'SELECT * FROM Message M JOIN User U ON M.TargetID = U.UserID JOIN Nick N ON U.UserID = N.UserID WHERE N.Nickname LIKE ? GROUP BY M.MessageID',
[`%${nick}%`]
).filter(message => (channel === message.Location || eventType !== 'join') && (!message.Location.startsWith('#') || {}.hasOwnProperty.call(bot.chans[message.Location].users, nick)))
.each(message => db.conn.query(`DELETE FROM Message WHERE MessageID = ${message.MessageID}`))
.map(message => ({
response_type: 'text',
target: message.Location.startsWith('#') ? message.Location : nick,
message: `${nick}: ${message.MessageText} (from ${message.SenderName}, ${moment(message.MessageDate).utcOffset(message.Timezone).format('YYYY-MM-DD HH:mm:ss UTCZZ')})`
}));
}
};
## Instruction:
Add PM notifications for messages in another channel
Fixes #42
## Code After:
'use strict';
const db = require('../services/db');
const moment = require('moment');
module.exports = {
db_required: true,
events: ['message', 'join', 'action'],
allow: ({isAuthenticated}) => isAuthenticated,
response ({author_match: [nick], channel, eventType}) {
return db.conn.query(
'SELECT * FROM Message M JOIN User U ON M.TargetID = U.UserID JOIN Nick N ON U.UserID = N.UserID WHERE N.Nickname LIKE ? GROUP BY M.MessageID',
[`%${nick}%`]
).map(message => {
if (channel === message.Location || !message.Location.startsWith('#')) {
return db.conn.query(`DELETE FROM Message WHERE MessageID = ${message.MessageID}`).return({
response_type: 'text',
target: message.Location.startsWith('#') ? message.Location : nick,
message: `${nick}: ${message.MessageText} (from ${message.SenderName}, ${formatTimestamp(message)})`
});
}
if (eventType !== 'join' && !message.UserNotified) {
return db.conn.query('UPDATE Message SET UserNotified = TRUE WHERE MessageID = ?', [message.MessageID]).return({
response_type: 'text',
target: nick,
message: `You have a message from ${message.SenderName} in ${message.Location} (sent at ${formatTimestamp(message)}).`
});
}
});
}
};
function formatTimestamp (message) {
return moment(message.MessageDate).utcOffset(message.Timezone).format('YYYY-MM-DD HH:mm:ss UTCZZ');
}
|
5c88f210644cbe59cf3b3a71345a3fc64dfc542a | spiff/api/plugins.py | spiff/api/plugins.py | from django.conf import settings
import importlib
import inspect
def find_api_classes(module, superclass, test=lambda x: True):
for app in map(lambda x:'%s.%s'%(x, module), settings.INSTALLED_APPS):
try:
appAPI = importlib.import_module(app)
except ImportError, e:
continue
for name, cls in inspect.getmembers(appAPI):
if inspect.isclass(cls) and issubclass(cls, superclass) and not cls is superclass and test(cls):
yield cls
| from django.conf import settings
import importlib
import inspect
def find_api_classes(*args, **kwargs):
for app, cls in find_api_implementations(*args, **kwargs):
yield cls
def find_api_implementations(module, superclass, test=lambda x: True):
for app in map(lambda x:'%s.%s'%(x, module), settings.INSTALLED_APPS):
try:
appAPI = importlib.import_module(app)
except ImportError, e:
continue
for name, cls in inspect.getmembers(appAPI):
if inspect.isclass(cls) and issubclass(cls, superclass) and not cls is superclass and test(cls):
yield (app, cls)
| Add a method to also easily find what app an api object was found in | Add a method to also easily find what app an api object was found in
| Python | agpl-3.0 | SYNHAK/spiff,SYNHAK/spiff,SYNHAK/spiff | python | ## Code Before:
from django.conf import settings
import importlib
import inspect
def find_api_classes(module, superclass, test=lambda x: True):
for app in map(lambda x:'%s.%s'%(x, module), settings.INSTALLED_APPS):
try:
appAPI = importlib.import_module(app)
except ImportError, e:
continue
for name, cls in inspect.getmembers(appAPI):
if inspect.isclass(cls) and issubclass(cls, superclass) and not cls is superclass and test(cls):
yield cls
## Instruction:
Add a method to also easily find what app an api object was found in
## Code After:
from django.conf import settings
import importlib
import inspect
def find_api_classes(*args, **kwargs):
for app, cls in find_api_implementations(*args, **kwargs):
yield cls
def find_api_implementations(module, superclass, test=lambda x: True):
for app in map(lambda x:'%s.%s'%(x, module), settings.INSTALLED_APPS):
try:
appAPI = importlib.import_module(app)
except ImportError, e:
continue
for name, cls in inspect.getmembers(appAPI):
if inspect.isclass(cls) and issubclass(cls, superclass) and not cls is superclass and test(cls):
yield (app, cls)
|
2d023ef1dc622af086abf3ca52816f29496ab3a2 | Examples/MendeleySDKDemoOSX/RunTests.sh | Examples/MendeleySDKDemoOSX/RunTests.sh | cd Examples/MendeleySDKDemoOSX/
xcodebuild -workspace MendeleySDKDemoOSX.xcworkspace/ -scheme MendeleySDKDemoOSX TEST_AFTER_BUILD=YES
| cd Examples/MendeleySDKDemoOSX/
xcodebuild -workspace MendeleySDKDemoOSX.xcworkspace/ -scheme MendeleySDKDemoOSX test
| Update Run Test script with new action | Update Run Test script with new action
| Shell | mit | shazino/MendeleySDK | shell | ## Code Before:
cd Examples/MendeleySDKDemoOSX/
xcodebuild -workspace MendeleySDKDemoOSX.xcworkspace/ -scheme MendeleySDKDemoOSX TEST_AFTER_BUILD=YES
## Instruction:
Update Run Test script with new action
## Code After:
cd Examples/MendeleySDKDemoOSX/
xcodebuild -workspace MendeleySDKDemoOSX.xcworkspace/ -scheme MendeleySDKDemoOSX test
|
ef72ce81c2d51cf99e44041a871a82c512badb8c | people/serializers.py | people/serializers.py | from rest_framework import serializers
from people.models import Customer
from people.models import InternalUser
class CustomerSerializer(serializers.ModelSerializer):
class Meta:
model = Customer
fields = '__all__'
class InternalUserSerializer(serializers.ModelSerializer):
class Meta:
model = InternalUser
fields = '__all__'
| from rest_framework import serializers
from people.models import Customer
from people.models import InternalUser
class CustomerSerializer(serializers.ModelSerializer):
phone_number = serializers.IntegerField(validators=[lambda x: len(str(x)) == 10])
class Meta:
model = Customer
fields = '__all__'
class InternalUserSerializer(serializers.ModelSerializer):
class Meta:
model = InternalUser
fields = '__all__'
| Make the phone number an int | Make the phone number an int
| Python | apache-2.0 | rameshgopalakrishnan/v_excel_inventory,rameshgopalakrishnan/v_excel_inventory,rameshgopalakrishnan/v_excel_inventory | python | ## Code Before:
from rest_framework import serializers
from people.models import Customer
from people.models import InternalUser
class CustomerSerializer(serializers.ModelSerializer):
class Meta:
model = Customer
fields = '__all__'
class InternalUserSerializer(serializers.ModelSerializer):
class Meta:
model = InternalUser
fields = '__all__'
## Instruction:
Make the phone number an int
## Code After:
from rest_framework import serializers
from people.models import Customer
from people.models import InternalUser
class CustomerSerializer(serializers.ModelSerializer):
phone_number = serializers.IntegerField(validators=[lambda x: len(str(x)) == 10])
class Meta:
model = Customer
fields = '__all__'
class InternalUserSerializer(serializers.ModelSerializer):
class Meta:
model = InternalUser
fields = '__all__'
|
dbccda0ed0c07252b95a3672cbdbe7425d70bdcc | spec/end_to_end_spec.rb | spec/end_to_end_spec.rb | require 'spec_helper'
module FFSplitter
describe "End to end" do
before { Dir.mkdir("tmp") unless Dir.exist?("tmp") }
describe "split" do
before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -o tmp 2>&1` }
let(:file_list) { Dir.glob("tmp/*") }
it "creates files" do
expect(file_list).to include("tmp/01 Chapter 1.mp4")
expect(file_list).to include("tmp/02 - Chapter 2.mp4")
expect(file_list).to include("tmp/03 Chapter 3.mp4")
end
end
after { FileUtils.rm(file_list) }
end
end | require 'spec_helper'
module FFSplitter
describe "End to end" do
before { Dir.mkdir("tmp") unless Dir.exist?("tmp") }
describe "split" do
context "with audio and video" do
before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -o tmp 2>&1` }
let(:file_list) { Dir.glob("tmp/*") }
it "creates files" do
expect(file_list).to include("tmp/01 Chapter 1.mp4")
expect(file_list).to include("tmp/02 - Chapter 2.mp4")
expect(file_list).to include("tmp/03 Chapter 3.mp4")
end
end
context "with audio only" do
before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -e .aac -o tmp 2>&1` }
let(:file_list) { Dir.glob("tmp/*") }
it "creates files" do
expect(file_list).to include("tmp/01 Chapter 1.aac")
expect(file_list).to include("tmp/02 - Chapter 2.aac")
expect(file_list).to include("tmp/03 Chapter 3.aac")
end
end
after { FileUtils.rm(file_list) }
end
end
end
| Write end-to-end spec for audio only | Write end-to-end spec for audio only | Ruby | mit | rockwood/ffsplitter | ruby | ## Code Before:
require 'spec_helper'
module FFSplitter
describe "End to end" do
before { Dir.mkdir("tmp") unless Dir.exist?("tmp") }
describe "split" do
before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -o tmp 2>&1` }
let(:file_list) { Dir.glob("tmp/*") }
it "creates files" do
expect(file_list).to include("tmp/01 Chapter 1.mp4")
expect(file_list).to include("tmp/02 - Chapter 2.mp4")
expect(file_list).to include("tmp/03 Chapter 3.mp4")
end
end
after { FileUtils.rm(file_list) }
end
end
## Instruction:
Write end-to-end spec for audio only
## Code After:
require 'spec_helper'
module FFSplitter
describe "End to end" do
before { Dir.mkdir("tmp") unless Dir.exist?("tmp") }
describe "split" do
context "with audio and video" do
before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -o tmp 2>&1` }
let(:file_list) { Dir.glob("tmp/*") }
it "creates files" do
expect(file_list).to include("tmp/01 Chapter 1.mp4")
expect(file_list).to include("tmp/02 - Chapter 2.mp4")
expect(file_list).to include("tmp/03 Chapter 3.mp4")
end
end
context "with audio only" do
before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -e .aac -o tmp 2>&1` }
let(:file_list) { Dir.glob("tmp/*") }
it "creates files" do
expect(file_list).to include("tmp/01 Chapter 1.aac")
expect(file_list).to include("tmp/02 - Chapter 2.aac")
expect(file_list).to include("tmp/03 Chapter 3.aac")
end
end
after { FileUtils.rm(file_list) }
end
end
end
|
0683fd48b4b243a2a3f91b95b0412249f816df14 | src/Index.swift | src/Index.swift | import Foundation
class Index {
func packPackages(packages: [Package]) {
return
}
}
| import Foundation
class Index {
private let formatter: NSDateFormatter = NSDateFormatter()
init() {
formatter.dateFormat = "yyyy-mm-dd'T'HH-mm-ss'Z'"
}
func packPackages(packages: [Package]) {
let path = getOutputName()
if !fileManager.createFileAtPath(path, contents: nil, attributes: nil) {
printAndExit("Failed to create index file '\(path)'")
}
let file = NSFileHandle(forWritingAtPath: getOutputName())!
let header = "Roost Index Version 1\n"
file.writeData(header.dataUsingEncoding(NSUTF8StringEncoding)!)
}
func getOutputName() -> String {
let date = formatter.stringFromDate(NSDate())
return "Index-\(date).bin"
}
}
| Set up basic writing of index file | Set up basic writing of index file
| Swift | mit | Roosting/Index | swift | ## Code Before:
import Foundation
class Index {
func packPackages(packages: [Package]) {
return
}
}
## Instruction:
Set up basic writing of index file
## Code After:
import Foundation
class Index {
private let formatter: NSDateFormatter = NSDateFormatter()
init() {
formatter.dateFormat = "yyyy-mm-dd'T'HH-mm-ss'Z'"
}
func packPackages(packages: [Package]) {
let path = getOutputName()
if !fileManager.createFileAtPath(path, contents: nil, attributes: nil) {
printAndExit("Failed to create index file '\(path)'")
}
let file = NSFileHandle(forWritingAtPath: getOutputName())!
let header = "Roost Index Version 1\n"
file.writeData(header.dataUsingEncoding(NSUTF8StringEncoding)!)
}
func getOutputName() -> String {
let date = formatter.stringFromDate(NSDate())
return "Index-\(date).bin"
}
}
|
4ed6c20a9e6f1ec5fca9c40b4393d17b726a9723 | vim/.aliases.sh | vim/.aliases.sh |
_vim () {
param_count="${#}"
if [ "${param_count}" -ge 1 ]; then
for param in "$@"; do
if [ ! -d "${param}" ]; then
file="${param}"
if [ ! -e "${file}" ]; then
read -p "File \"${file}\" doesn't exist. Create file? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
touch "${file}"
fi
fi
fi
done
fi
if which "mvim" &> /dev/null; then
open -a MacVim "$@"
elif which "gvim" &> /dev/null; then
gvim -c "call remote_foreground('$VIMSERVER')" -c quit
gvim -p --remote-tab-silent "$@"
else
\vim -p "$@"
fi
}
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
if which "mvim" &> /dev/null; then
alias mvim="open -a MacVim"
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
fi
alias vimrc="_vim ~/.vimrc"
|
_vim () {
param_count="${#}"
if [ "${param_count}" -ge 1 ]; then
for param in "$@"; do
if [ ! -d "${param}" ]; then
file="${param}"
if [ ! -e "${file}" ]; then
read -p "File \"${file}\" doesn't exist. Create file? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
touch "${file}"
fi
fi
fi
done
fi
if which "mvim" &> /dev/null; then
open -a MacVim "$@"
elif which "gvim" &> /dev/null; then
gvim -p --remote-tab-silent "$@"
gvim -c "call remote_foreground('$VIMSERVER')" -c quit
else
\vim -p "$@"
fi
}
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
if which "mvim" &> /dev/null; then
alias mvim="open -a MacVim"
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
fi
alias vimrc="_vim ~/.vimrc"
| Fix gvim closing open file | Fix gvim closing open file
| Shell | unlicense | zborboa-g/dot-star,dot-star/dot-star | shell | ## Code Before:
_vim () {
param_count="${#}"
if [ "${param_count}" -ge 1 ]; then
for param in "$@"; do
if [ ! -d "${param}" ]; then
file="${param}"
if [ ! -e "${file}" ]; then
read -p "File \"${file}\" doesn't exist. Create file? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
touch "${file}"
fi
fi
fi
done
fi
if which "mvim" &> /dev/null; then
open -a MacVim "$@"
elif which "gvim" &> /dev/null; then
gvim -c "call remote_foreground('$VIMSERVER')" -c quit
gvim -p --remote-tab-silent "$@"
else
\vim -p "$@"
fi
}
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
if which "mvim" &> /dev/null; then
alias mvim="open -a MacVim"
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
fi
alias vimrc="_vim ~/.vimrc"
## Instruction:
Fix gvim closing open file
## Code After:
_vim () {
param_count="${#}"
if [ "${param_count}" -ge 1 ]; then
for param in "$@"; do
if [ ! -d "${param}" ]; then
file="${param}"
if [ ! -e "${file}" ]; then
read -p "File \"${file}\" doesn't exist. Create file? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
touch "${file}"
fi
fi
fi
done
fi
if which "mvim" &> /dev/null; then
open -a MacVim "$@"
elif which "gvim" &> /dev/null; then
gvim -p --remote-tab-silent "$@"
gvim -c "call remote_foreground('$VIMSERVER')" -c quit
else
\vim -p "$@"
fi
}
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
if which "mvim" &> /dev/null; then
alias mvim="open -a MacVim"
alias v="_vim"
alias vi="_vim"
alias vim="_vim"
fi
alias vimrc="_vim ~/.vimrc"
|
b7e657134c21b62e78453b11f0745e0048e346bf | examples/simple_distribution.py | examples/simple_distribution.py | import sys
import time
from random import shuffle
from vania.fair_distributor import FairDistributor
def main():
# User input for the number of targets and objects.
users = ['user1', 'user2']
tasks = ['task1', 'task2']
preferences = [
[1, 2],
[2, 1],
]
# Run solver
start_time = time.time()
distributor = FairDistributor(users, tasks, preferences)
output = distributor.distribute(output='problem.lp')
elapsed_time = time.time() - start_time
# Output
print(output)
if __name__ == '__main__':
main()
| import sys
import time
from random import shuffle
from vania.fair_distributor import FairDistributor
def main():
# User input for the number of targets and objects.
users = ['user1', 'user2']
tasks = ['task1', 'task2']
preferences = [
[1, 2],
[2, 1],
]
# Run solver
distributor = FairDistributor(users, tasks, preferences)
output = distributor.distribute(output='problem.lp')
# Output
print(output)
if __name__ == '__main__':
main()
| Remove time metrics from the simple example | Remove time metrics from the simple example
| Python | mit | Hackathonners/vania | python | ## Code Before:
import sys
import time
from random import shuffle
from vania.fair_distributor import FairDistributor
def main():
# User input for the number of targets and objects.
users = ['user1', 'user2']
tasks = ['task1', 'task2']
preferences = [
[1, 2],
[2, 1],
]
# Run solver
start_time = time.time()
distributor = FairDistributor(users, tasks, preferences)
output = distributor.distribute(output='problem.lp')
elapsed_time = time.time() - start_time
# Output
print(output)
if __name__ == '__main__':
main()
## Instruction:
Remove time metrics from the simple example
## Code After:
import sys
import time
from random import shuffle
from vania.fair_distributor import FairDistributor
def main():
# User input for the number of targets and objects.
users = ['user1', 'user2']
tasks = ['task1', 'task2']
preferences = [
[1, 2],
[2, 1],
]
# Run solver
distributor = FairDistributor(users, tasks, preferences)
output = distributor.distribute(output='problem.lp')
# Output
print(output)
if __name__ == '__main__':
main()
|
ed293268372d82e91cf0022e9a2eca4cf2645b02 | tests/unit/utils/group-by-test.js | tests/unit/utils/group-by-test.js | import groupBy from 'dummy/utils/group-by';
import { module, test } from 'qunit';
module('Unit | Utility | group by');
// Replace this with your real tests.
test('it works', function(assert) {
let result = groupBy();
assert.ok(result);
});
| import { A as emberA } from '@ember/array';
import groupBy from 'dummy/utils/group-by';
import { module, test } from 'qunit';
module('Unit | Utility | group by');
test('It returns an empty object if array is empty', function (assert) {
let group = groupBy(emberA(), '');
assert.equal(typeof group, 'object');
});
test('It returns a promise proxy', function (assert) {
let group = groupBy(emberA(), '');
return group.then(function () {
assert.ok(group.get('isFulfilled'));
});
});
| Add unit tests for groupBy util function | Add unit tests for groupBy util function
| JavaScript | mit | scottwernervt/ember-cli-group-by,scottwernervt/ember-cli-group-by | javascript | ## Code Before:
import groupBy from 'dummy/utils/group-by';
import { module, test } from 'qunit';
module('Unit | Utility | group by');
// Replace this with your real tests.
test('it works', function(assert) {
let result = groupBy();
assert.ok(result);
});
## Instruction:
Add unit tests for groupBy util function
## Code After:
import { A as emberA } from '@ember/array';
import groupBy from 'dummy/utils/group-by';
import { module, test } from 'qunit';
module('Unit | Utility | group by');
test('It returns an empty object if array is empty', function (assert) {
let group = groupBy(emberA(), '');
assert.equal(typeof group, 'object');
});
test('It returns a promise proxy', function (assert) {
let group = groupBy(emberA(), '');
return group.then(function () {
assert.ok(group.get('isFulfilled'));
});
});
|
a4693f89cf93784678c91908403f7ec15865a39c | .travis.yml | .travis.yml | language: objective-c
osx_image: xcode7.1
install:
- brew install carthage
- gem install xcpretty
script: rake test build:all
| language: objective-c
osx_image: xcode7.1
install:
- brew install carthage
- gem install xcpretty
before_script: rake setup
script: rake test build:all
| Add before_script step to setup dependencies | Add before_script step to setup dependencies
| YAML | mit | sharplet/Regex,sharplet/Regex,sharplet/Regex,sclukey/Regex,sclukey/Regex | yaml | ## Code Before:
language: objective-c
osx_image: xcode7.1
install:
- brew install carthage
- gem install xcpretty
script: rake test build:all
## Instruction:
Add before_script step to setup dependencies
## Code After:
language: objective-c
osx_image: xcode7.1
install:
- brew install carthage
- gem install xcpretty
before_script: rake setup
script: rake test build:all
|
9ebed06f1f501a9885700c0e4288b47a98f8508b | src/styles/androidstudio.css | src/styles/androidstudio.css | /*
Date: 24 Fev 2015
Author: Pedro Oliveira <kanytu@gmail . com>
*/
.hljs
{
color: #A9B7C6;
background: #282b2e;
display: block;
overflow-x: auto;
padding: 0.5em;
webkit-text-size-adjust: none;
}
.hljs-number
{
color: #6897BB;
}
.hljs-keyword, .hljs-deletion
{
color: #CC7832;
}
.hljs-javadoc
{
color: #629755;
}
.hljs-comment
{
color: #808080;
}
.hljs-annotation
{
color: #BBB529;
}
.hljs-string, .hljs-addition
{
color: #6A8759;
}
.hljs-function .hljs-title, .hljs-change
{
color: #FFC66D;
}
.hljs-tag .hljs-title, .hljs-doctype
{
color: #E8BF6A;
}
.hljs-tag .hljs-attribute
{
color: #BABABA;
}
.hljs-tag .hljs-value
{
color: #A5C261;
}
| /*
Date: 24 Fev 2015
Author: Pedro Oliveira <kanytu@gmail . com>
*/
.hljs
{
color: #A9B7C6;
background: #282b2e;
display: block;
overflow-x: auto;
padding: 0.5em;
webkit-text-size-adjust: none;
}
.hljs-number
{
color: #6897BB;
}
.hljs-keyword, .hljs-deletion
{
color: #CC7832;
}
.hljs-javadoc
{
color: #629755;
}
.hljs-comment
{
color: #808080;
}
.hljs-annotation
{
color: #BBB529;
}
.hljs-string, .hljs-addition
{
color: #6A8759;
}
.hljs-function .hljs-title, .hljs-change
{
color: #FFC66D;
}
.hljs-tag .hljs-title, .hljs-doctype
{
color: #E8BF6A;
}
.hljs-tag .hljs-attribute
{
color: #BABABA;
}
.hljs-tag .hljs-value
{
color: #A5C261;
}
| Use two spaces for indention | Use two spaces for indention
| CSS | bsd-3-clause | MakeNowJust/highlight.js,adjohnson916/highlight.js,robconery/highlight.js,yxxme/highlight.js,VoldemarLeGrand/highlight.js,tenbits/highlight.js,taoger/highlight.js,highlightjs/highlight.js,cicorias/highlight.js,0x7fffffff/highlight.js,palmin/highlight.js,isagalaev/highlight.js,ehornbostel/highlight.js,christoffer/highlight.js,Delermando/highlight.js,snegovick/highlight.js,tenbits/highlight.js,kayyyy/highlight.js,STRML/highlight.js,1st1/highlight.js,J2TeaM/highlight.js,teambition/highlight.js,devmario/highlight.js,kayyyy/highlight.js,bluepichu/highlight.js,ilovezy/highlight.js,kba/highlight.js,Ankirama/highlight.js,xing-zhi/highlight.js,ponylang/highlight.js,lizhil/highlight.js,Amrit01/highlight.js,axter/highlight.js,VoldemarLeGrand/highlight.js,CausalityLtd/highlight.js,1st1/highlight.js,weiyibin/highlight.js,CausalityLtd/highlight.js,delebash/highlight.js,dublebuble/highlight.js,devmario/highlight.js,dx285/highlight.js,carlokok/highlight.js,Delermando/highlight.js,krig/highlight.js,krig/highlight.js,liang42hao/highlight.js,palmin/highlight.js,lead-auth/highlight.js,robconery/highlight.js,robconery/highlight.js,dbkaplun/highlight.js,axter/highlight.js,tenbits/highlight.js,StanislawSwierc/highlight.js,dbkaplun/highlight.js,ysbaddaden/highlight.js,martijnrusschen/highlight.js,sourrust/highlight.js,dublebuble/highlight.js,zachaysan/highlight.js,kba/highlight.js,krig/highlight.js,daimor/highlight.js,alex-zhang/highlight.js,CausalityLtd/highlight.js,kevinrodbe/highlight.js,Ajunboys/highlight.js,kayyyy/highlight.js,highlightjs/highlight.js,SibuStephen/highlight.js,kevinrodbe/highlight.js,ponylang/highlight.js,Sannis/highlight.js,alex-zhang/highlight.js,alex-zhang/highlight.js,jean/highlight.js,J2TeaM/highlight.js,ehornbostel/highlight.js,xing-zhi/highlight.js,Sannis/highlight.js,ilovezy/highlight.js,ehornbostel/highlight.js,adam-lynch/highlight.js,ilovezy/highlight.js,dublebuble/highlight.js,bluepichu/highlight.js,adjohnson916/highlight.js,liang42hao/highlight.js,J2TeaM/highlight.js,aristidesstaffieri/highlight.js,0x7fffffff/highlight.js,SibuStephen/highlight.js,jean/highlight.js,delebash/highlight.js,sourrust/highlight.js,teambition/highlight.js,aurusov/highlight.js,christoffer/highlight.js,brennced/highlight.js,bogachev-pa/highlight.js,zachaysan/highlight.js,highlightjs/highlight.js,Ajunboys/highlight.js,daimor/highlight.js,1st1/highlight.js,lizhil/highlight.js,brennced/highlight.js,Amrit01/highlight.js,dx285/highlight.js,yxxme/highlight.js,kba/highlight.js,snegovick/highlight.js,aristidesstaffieri/highlight.js,martijnrusschen/highlight.js,taoger/highlight.js,liang42hao/highlight.js,MakeNowJust/highlight.js,cicorias/highlight.js,jean/highlight.js,aristidesstaffieri/highlight.js,dYale/highlight.js,bluepichu/highlight.js,delebash/highlight.js,bogachev-pa/highlight.js,carlokok/highlight.js,devmario/highlight.js,SibuStephen/highlight.js,dYale/highlight.js,kevinrodbe/highlight.js,carlokok/highlight.js,ysbaddaden/highlight.js,Amrit01/highlight.js,carlokok/highlight.js,weiyibin/highlight.js,ponylang/highlight.js,dx285/highlight.js,daimor/highlight.js,aurusov/highlight.js,Ankirama/highlight.js,axter/highlight.js,Ankirama/highlight.js,teambition/highlight.js,Delermando/highlight.js,lizhil/highlight.js,sourrust/highlight.js,dbkaplun/highlight.js,yxxme/highlight.js,adam-lynch/highlight.js,StanislawSwierc/highlight.js,abhishekgahlot/highlight.js,VoldemarLeGrand/highlight.js,palmin/highlight.js,adjohnson916/highlight.js,xing-zhi/highlight.js,martijnrusschen/highlight.js,taoger/highlight.js,weiyibin/highlight.js,abhishekgahlot/highlight.js,brennced/highlight.js,highlightjs/highlight.js,adam-lynch/highlight.js,isagalaev/highlight.js,ysbaddaden/highlight.js,Ajunboys/highlight.js,zachaysan/highlight.js,cicorias/highlight.js,snegovick/highlight.js,bogachev-pa/highlight.js,MakeNowJust/highlight.js,abhishekgahlot/highlight.js,0x7fffffff/highlight.js,dYale/highlight.js,STRML/highlight.js,STRML/highlight.js,christoffer/highlight.js,Sannis/highlight.js,aurusov/highlight.js | css | ## Code Before:
/*
Date: 24 Fev 2015
Author: Pedro Oliveira <kanytu@gmail . com>
*/
.hljs
{
color: #A9B7C6;
background: #282b2e;
display: block;
overflow-x: auto;
padding: 0.5em;
webkit-text-size-adjust: none;
}
.hljs-number
{
color: #6897BB;
}
.hljs-keyword, .hljs-deletion
{
color: #CC7832;
}
.hljs-javadoc
{
color: #629755;
}
.hljs-comment
{
color: #808080;
}
.hljs-annotation
{
color: #BBB529;
}
.hljs-string, .hljs-addition
{
color: #6A8759;
}
.hljs-function .hljs-title, .hljs-change
{
color: #FFC66D;
}
.hljs-tag .hljs-title, .hljs-doctype
{
color: #E8BF6A;
}
.hljs-tag .hljs-attribute
{
color: #BABABA;
}
.hljs-tag .hljs-value
{
color: #A5C261;
}
## Instruction:
Use two spaces for indention
## Code After:
/*
Date: 24 Fev 2015
Author: Pedro Oliveira <kanytu@gmail . com>
*/
.hljs
{
color: #A9B7C6;
background: #282b2e;
display: block;
overflow-x: auto;
padding: 0.5em;
webkit-text-size-adjust: none;
}
.hljs-number
{
color: #6897BB;
}
.hljs-keyword, .hljs-deletion
{
color: #CC7832;
}
.hljs-javadoc
{
color: #629755;
}
.hljs-comment
{
color: #808080;
}
.hljs-annotation
{
color: #BBB529;
}
.hljs-string, .hljs-addition
{
color: #6A8759;
}
.hljs-function .hljs-title, .hljs-change
{
color: #FFC66D;
}
.hljs-tag .hljs-title, .hljs-doctype
{
color: #E8BF6A;
}
.hljs-tag .hljs-attribute
{
color: #BABABA;
}
.hljs-tag .hljs-value
{
color: #A5C261;
}
|
65248ef36bcff9b1e3a3f56eeaadcd148263a07f | client/js/app.jsx | client/js/app.jsx | "use strict";
import React from 'react';
import ReactDOM from 'react-dom';
import Router from 'react-router';
import Routes from './routes';
import SettingsAction from './actions/settings';
import history from './history';
//Needed for onTouchTap
//Can go away when react 1.0 release
//Check this repo:
//https://github.com/zilverline/react-tap-event-plugin
import injectTapEventPlugin from "react-tap-event-plugin";
injectTapEventPlugin();
// Set a device type based on window width, so that we can write media queries in javascript
// by calling if (this.props.deviceType === "mobile")
var deviceType;
if (window.matchMedia("(max-width: 639px)").matches){
deviceType = "mobile";
} else if (window.matchMedia("(max-width: 768px)").matches){
deviceType = "tablet";
} else {
deviceType = "desktop";
}
// Initialize store singletons
SettingsAction.load(window.DEFAULT_SETTINGS);
ReactDOM.render((<Router history={history}>{Routes}</Router>), document.getElementById("main")); | "use strict";
import React from 'react';
import ReactDOM from 'react-dom';
import Router from 'react-router';
import Routes from './routes';
import SettingsAction from './actions/settings';
import history from './history';
// Initialize store singletons
SettingsAction.load(window.DEFAULT_SETTINGS);
ReactDOM.render((<Router history={history}>{Routes}</Router>), document.getElementById("main")); | Remove the rest of material ui | Remove the rest of material ui
| JSX | mit | atomicjolt/adhesion,atomicjolt/react_starter_app,atomicjolt/react_rails_starter_app,atomicjolt/react_rails_starter_app,atomicjolt/adhesion,atomicjolt/react_rails_starter_app,atomicjolt/adhesion,atomicjolt/lti_starter_app,atomicjolt/react_starter_app,atomicjolt/lti_starter_app,atomicjolt/lti_starter_app,atomicjolt/react_starter_app,atomicjolt/lti_starter_app,atomicjolt/adhesion,atomicjolt/react_rails_starter_app,atomicjolt/react_starter_app | jsx | ## Code Before:
"use strict";
import React from 'react';
import ReactDOM from 'react-dom';
import Router from 'react-router';
import Routes from './routes';
import SettingsAction from './actions/settings';
import history from './history';
//Needed for onTouchTap
//Can go away when react 1.0 release
//Check this repo:
//https://github.com/zilverline/react-tap-event-plugin
import injectTapEventPlugin from "react-tap-event-plugin";
injectTapEventPlugin();
// Set a device type based on window width, so that we can write media queries in javascript
// by calling if (this.props.deviceType === "mobile")
var deviceType;
if (window.matchMedia("(max-width: 639px)").matches){
deviceType = "mobile";
} else if (window.matchMedia("(max-width: 768px)").matches){
deviceType = "tablet";
} else {
deviceType = "desktop";
}
// Initialize store singletons
SettingsAction.load(window.DEFAULT_SETTINGS);
ReactDOM.render((<Router history={history}>{Routes}</Router>), document.getElementById("main"));
## Instruction:
Remove the rest of material ui
## Code After:
"use strict";
import React from 'react';
import ReactDOM from 'react-dom';
import Router from 'react-router';
import Routes from './routes';
import SettingsAction from './actions/settings';
import history from './history';
// Initialize store singletons
SettingsAction.load(window.DEFAULT_SETTINGS);
ReactDOM.render((<Router history={history}>{Routes}</Router>), document.getElementById("main")); |
56c9615530443deb569cb3ca9af79e481f95d578 | cvrminer/app/templates/branch_base.html | cvrminer/app/templates/branch_base.html | {% extends "base.html" %}
{% block navbar %}
<div class="navbar navbar-static-top">
<ul class="nav nav-pills">
<li role="presentation"><a href="..">cvrminer</a></li>
<li role="presentation" class="active"><a href="./">Branch</a></li>
<li role="presentation"><a href="../exchange/">Exchange</a></li>
</ul>
</div>
{% endblock %}
| {% extends "base.html" %}
{% block navbar %}
<div class="navbar navbar-static-top">
<ul class="nav nav-pills">
<li role="presentation"><a href="..">cvrminer</a></li>
<li role="presentation"><a href="../company/">Company</a></li>
<li role="presentation" class="active"><a href="./">Branch</a></li>
<li role="presentation"><a href="../exchange/">Exchange</a></li>
</ul>
</div>
{% endblock %}
| Add menu item for company | Add menu item for company
| HTML | apache-2.0 | fnielsen/cvrminer,fnielsen/cvrminer,fnielsen/cvrminer | html | ## Code Before:
{% extends "base.html" %}
{% block navbar %}
<div class="navbar navbar-static-top">
<ul class="nav nav-pills">
<li role="presentation"><a href="..">cvrminer</a></li>
<li role="presentation" class="active"><a href="./">Branch</a></li>
<li role="presentation"><a href="../exchange/">Exchange</a></li>
</ul>
</div>
{% endblock %}
## Instruction:
Add menu item for company
## Code After:
{% extends "base.html" %}
{% block navbar %}
<div class="navbar navbar-static-top">
<ul class="nav nav-pills">
<li role="presentation"><a href="..">cvrminer</a></li>
<li role="presentation"><a href="../company/">Company</a></li>
<li role="presentation" class="active"><a href="./">Branch</a></li>
<li role="presentation"><a href="../exchange/">Exchange</a></li>
</ul>
</div>
{% endblock %}
|
8f4c5b6a4c609e5154dfee432c567e382f69ee88 | src/geoserver/layer.py | src/geoserver/layer.py | from urllib2 import HTTPError
from geoserver.support import atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer:
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def update(self):
try:
layer = get_xml(self.href)
self.name = layer.find("name").text
self.attribution = layer.find("attribution").text
self.enabled = layer.find("enabled").text == "true"
self.default_style = Style(layer.find("defaultStyle"))
resource = layer.find("resource")
if resource and "class" in resource.attrib:
if resource.attrib["class"] == "featureType":
self.resource = FeatureType(resource)
elif resource.attrib["class"] == "coverage":
self.resource = Coverage(resource)
except HTTPError, e:
print e.geturl()
def __repr__(self):
return "Layer[%s]" % self.name
| from urllib2 import HTTPError
from geoserver.support import ResourceInfo, atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer(ResourceInfo):
resource_type = "layers"
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def update(self):
ResourceInfo.update(self)
name = self.metadata.find("name")
attribution = self.metadata.find("attribution")
enabled = self.metadata.find("enabled")
default_style = self.metadata.find("defaultStyle")
if name is not None:
self.name = name.text
else:
self.name = None
if attribution is not None:
self.attribution = attribution.text
else:
self.attribution = None
if enabled is not None and enabled.text == "true":
self.enabled = True
else:
self.enabled = False
if default_style is not None:
self.default_style = Style(default_style)
else:
self.default_style = None
resource = self.metadata.find("resource")
if resource and "class" in resource.attrib:
if resource.attrib["class"] == "featureType":
self.resource = FeatureType(resource)
elif resource.attrib["class"] == "coverage":
self.resource = Coverage(resource)
def __repr__(self):
return "Layer[%s]" % self.name
| Update Layer to use ResourceInfo support class | Update Layer to use ResourceInfo support class
| Python | mit | boundlessgeo/gsconfig,garnertb/gsconfig.py,Geode/gsconfig,cristianzamar/gsconfig,scottp-dpaw/gsconfig,afabiani/gsconfig | python | ## Code Before:
from urllib2 import HTTPError
from geoserver.support import atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer:
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def update(self):
try:
layer = get_xml(self.href)
self.name = layer.find("name").text
self.attribution = layer.find("attribution").text
self.enabled = layer.find("enabled").text == "true"
self.default_style = Style(layer.find("defaultStyle"))
resource = layer.find("resource")
if resource and "class" in resource.attrib:
if resource.attrib["class"] == "featureType":
self.resource = FeatureType(resource)
elif resource.attrib["class"] == "coverage":
self.resource = Coverage(resource)
except HTTPError, e:
print e.geturl()
def __repr__(self):
return "Layer[%s]" % self.name
## Instruction:
Update Layer to use ResourceInfo support class
## Code After:
from urllib2 import HTTPError
from geoserver.support import ResourceInfo, atom_link, get_xml
from geoserver.style import Style
from geoserver.resource import FeatureType, Coverage
class Layer(ResourceInfo):
resource_type = "layers"
def __init__(self, node):
self.name = node.find("name").text
self.href = atom_link(node)
self.update()
def update(self):
ResourceInfo.update(self)
name = self.metadata.find("name")
attribution = self.metadata.find("attribution")
enabled = self.metadata.find("enabled")
default_style = self.metadata.find("defaultStyle")
if name is not None:
self.name = name.text
else:
self.name = None
if attribution is not None:
self.attribution = attribution.text
else:
self.attribution = None
if enabled is not None and enabled.text == "true":
self.enabled = True
else:
self.enabled = False
if default_style is not None:
self.default_style = Style(default_style)
else:
self.default_style = None
resource = self.metadata.find("resource")
if resource and "class" in resource.attrib:
if resource.attrib["class"] == "featureType":
self.resource = FeatureType(resource)
elif resource.attrib["class"] == "coverage":
self.resource = Coverage(resource)
def __repr__(self):
return "Layer[%s]" % self.name
|
7c02f7f48104c4cccda0c98a31882dc42f32cd1e | lib/ruby-os/hash.rb | lib/ruby-os/hash.rb |
class Hash
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 52
def symbolize_keys
transform_keys{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 57
def symbolize_keys!
transform_keys!{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 8
def transform_keys
return enum_for(:transform_keys) unless block_given?
result = self.class.new
each_key do |key|
result[yield(key)] = self[key]
end
result
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 19
def transform_keys!
return enum_for(:transform_keys!) unless block_given?
keys.each do |key|
self[yield(key)] = delete(key)
end
self
end
end
|
class Hash
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 52
def symbolize_keys
transform_keys{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 57
def symbolize_keys!
transform_keys!{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 8
def transform_keys
return enum_for(:transform_keys) unless block_given?
result = self.class.new
each_key do |key|
result[yield(key)] = self[key]
end
result
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 19
def transform_keys!
return enum_for(:transform_keys!) unless block_given?
keys.each do |key|
self[yield(key)] = delete(key)
end
self
end
# File activesupport/lib/active_support/core_ext/hash/transform_values.rb, line 7
def transform_values
return enum_for(:transform_values) unless block_given?
result = self.class.new
each do |key, value|
result[key] = yield(value)
end
result
end
# File activesupport/lib/active_support/core_ext/hash/transform_values.rb, line 17
def transform_values!
return enum_for(:transform_values!) unless block_given?
each do |key, value|
self[key] = yield(value)
end
end
end
| Add transform_values extension from active support | Add transform_values extension from active support
| Ruby | mit | wspurgin/ruby-os,wspurgin/ruby-os | ruby | ## Code Before:
class Hash
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 52
def symbolize_keys
transform_keys{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 57
def symbolize_keys!
transform_keys!{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 8
def transform_keys
return enum_for(:transform_keys) unless block_given?
result = self.class.new
each_key do |key|
result[yield(key)] = self[key]
end
result
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 19
def transform_keys!
return enum_for(:transform_keys!) unless block_given?
keys.each do |key|
self[yield(key)] = delete(key)
end
self
end
end
## Instruction:
Add transform_values extension from active support
## Code After:
class Hash
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 52
def symbolize_keys
transform_keys{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 57
def symbolize_keys!
transform_keys!{ |key| key.to_sym rescue key }
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 8
def transform_keys
return enum_for(:transform_keys) unless block_given?
result = self.class.new
each_key do |key|
result[yield(key)] = self[key]
end
result
end
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 19
def transform_keys!
return enum_for(:transform_keys!) unless block_given?
keys.each do |key|
self[yield(key)] = delete(key)
end
self
end
# File activesupport/lib/active_support/core_ext/hash/transform_values.rb, line 7
def transform_values
return enum_for(:transform_values) unless block_given?
result = self.class.new
each do |key, value|
result[key] = yield(value)
end
result
end
# File activesupport/lib/active_support/core_ext/hash/transform_values.rb, line 17
def transform_values!
return enum_for(:transform_values!) unless block_given?
each do |key, value|
self[key] = yield(value)
end
end
end
|
bf1783695eb4708f129f9c15ebb9c08ebc64885e | tests/JsonApiTest.php | tests/JsonApiTest.php | <?php
namespace Tapestry\Tests;
class JsonApiTest extends CommandTestBase
{
public function testJsonBuildFlag()
{
$this->copyDirectory('assets/build_test_1/src', '_tmp');
$output = $this->runCommand('build', ['--quiet', '--json']);
$this->assertEquals(0, $output->getStatusCode());
}
}
| <?php
namespace Tapestry\Tests;
class JsonApiTest extends CommandTestBase
{
public function testJsonBuildFlag()
{
// $this->copyDirectory('assets/build_test_1/src', '_tmp');
// $output = $this->runCommand('build', '--quiet --json');
// $this->assertEquals(0, $output->getStatusCode());
}
}
| Disable test for the time being | :construction: Disable test for the time being
| PHP | mit | carbontwelve/tapestry,tapestry-cloud/tapestry,tapestry-cloud/tapestry,tapestry-cloud/tapestry,carbontwelve/tapestry,carbontwelve/tapestry,carbontwelve/tapestry,tapestry-cloud/tapestry | php | ## Code Before:
<?php
namespace Tapestry\Tests;
class JsonApiTest extends CommandTestBase
{
public function testJsonBuildFlag()
{
$this->copyDirectory('assets/build_test_1/src', '_tmp');
$output = $this->runCommand('build', ['--quiet', '--json']);
$this->assertEquals(0, $output->getStatusCode());
}
}
## Instruction:
:construction: Disable test for the time being
## Code After:
<?php
namespace Tapestry\Tests;
class JsonApiTest extends CommandTestBase
{
public function testJsonBuildFlag()
{
// $this->copyDirectory('assets/build_test_1/src', '_tmp');
// $output = $this->runCommand('build', '--quiet --json');
// $this->assertEquals(0, $output->getStatusCode());
}
}
|
d9ee51a1ce04dfe0db1f89c34aa21ebc408ad869 | input.c | input.c |
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
|
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
"bye",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
| Add bye to exit words | Add bye to exit words
| C | mit | Roadagain/Calculator,Roadagain/Calculator | c | ## Code Before:
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
## Instruction:
Add bye to exit words
## Code After:
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
"bye",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
|
377a21b948090a1248432b00af7f1b130e42b311 | zsh/custom/git.zsh | zsh/custom/git.zsh | alias glg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
alias gc="git commit -e -v"
| alias glg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
alias gc="git commit -e -v"
function gcd {
if [[ ! -z $(git branch | grep development) ]]; then
git checkout development
elif [[ ! -z $(git branch | grep develop) ]]; then
git checkout develop
else
echo "Could not find a \`development\` or \`develop\` branch"
fi
}
| Add a gcd alias that switches to either development or develop branches if they are available | Add a gcd alias that switches to either development or develop branches if they are available
| Shell | mit | marcaddeo/dotfiles,marcaddeo/dotfiles,marcaddeo/dotfiles,marcaddeo/dotfiles,marcaddeo/dotfiles | shell | ## Code Before:
alias glg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
alias gc="git commit -e -v"
## Instruction:
Add a gcd alias that switches to either development or develop branches if they are available
## Code After:
alias glg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
alias gc="git commit -e -v"
function gcd {
if [[ ! -z $(git branch | grep development) ]]; then
git checkout development
elif [[ ! -z $(git branch | grep develop) ]]; then
git checkout develop
else
echo "Could not find a \`development\` or \`develop\` branch"
fi
}
|
f2faad239b0a0d969436807436378cbfbaa34327 | lib/js/core/bootstrap.js | lib/js/core/bootstrap.js | (function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style = 'height: 0; width: 0; position: absolute; visibility: hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
| (function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style.height = 0;
element.style.width = 0;
element.style.position = 'absolute';
element.style.visibility = 'hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
| Fix write on a read-only property | Fix write on a read-only property
| JavaScript | mit | mstevens/darkroomjs,Drooids/darkroomjs,marcelgruber/darkroomjs,Drooids/darkroomjs,shelsonjava/darkroomjs,mstevens/darkroomjs,marcelgruber/darkroomjs,shelsonjava/darkroomjs,MattKetmo/darkroomjs,shelsonjava/darkroomjs,marcelgruber/darkroomjs,MattKetmo/darkroomjs,Drooids/darkroomjs,mstevens/darkroomjs | javascript | ## Code Before:
(function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style = 'height: 0; width: 0; position: absolute; visibility: hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
## Instruction:
Fix write on a read-only property
## Code After:
(function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style.height = 0;
element.style.width = 0;
element.style.position = 'absolute';
element.style.visibility = 'hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
|
5142aab11e8626bdb5059aee5f2ac474e9215206 | .travis.yml | .travis.yml | sudo: false
# Choose a lightweight base image; we provide our own build tools.
language: c
# GHC depends on GMP. You can add other dependencies here as well.
addons:
apt:
packages:
- libgmp-dev
install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
# Get stackage-curator
- wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
- bunzip2 stackage-curator.bz2
- chmod +x stackage-curator
- mv stackage-curator ~/.local/bin
# Install GHC and cabal-install
- stack setup 7.10.3
- stack --resolver ghc-7.10 build stackage-update
# Update the index
- travis_retry stack --resolver ghc-7.10 exec stackage-update
script:
- stack --resolver ghc-7.10 exec stackage-curator check
cache:
directories:
- $HOME/.stack
| sudo: false
# Choose a lightweight base image; we provide our own build tools.
language: c
# GHC depends on GMP. You can add other dependencies here as well.
addons:
apt:
packages:
- libgmp-dev
install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
# Get stackage-curator
- wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
- bunzip2 stackage-curator.bz2
- chmod +x stackage-curator
- mv stackage-curator ~/.local/bin
# Install GHC and cabal-install
- stack setup 7.10.3
- stack --resolver ghc-7.10 build stackage-update
# Update the index
- travis_retry stack --resolver ghc-7.10 exec stackage-update
script:
- stack --resolver ghc-7.10 exec stackage-curator check
cache:
directories:
- $HOME/.stack
- $HOME/.stackage/curator/cache
| Add the Stackage curator cache to the Travis cache | Add the Stackage curator cache to the Travis cache
| YAML | mit | massysett/stackage,Shimuuar/stackage,fpco/stackage,judah/stackage,k0ral/stackage,garetxe/stackage,codedmart/stackage,michalkonecny/stackage,phadej/stackage,stackbuilders/stackage,simonmichael/stackage,marcinmrotek/stackage,lwm/stackage,spencerjanssen/stackage,wereHamster/stackage,clinty/stackage,DanielG/stackage,peti/stackage,ygale/stackage,mgajda/stackage,GregorySchwartz/stackage,phaazon/stackage,alanz/stackage,athanclark/stackage,ethercrow/stackage,bartavelle/stackage,nomeata/stackage,fimad/stackage,mstksg/stackage,l29ah/stackage,mrkkrp/stackage,soenkehahn/stackage,iand675/stackage,Gabriel439/stackage,meteficha/stackage,christiaanb/stackage,asr/stackage,brendanhay/stackage,creichert/stackage,agrafix/stackage,int-index/stackage,jonschoning/stackage,Daniel-Diaz/stackage,jaspervdj/stackage | yaml | ## Code Before:
sudo: false
# Choose a lightweight base image; we provide our own build tools.
language: c
# GHC depends on GMP. You can add other dependencies here as well.
addons:
apt:
packages:
- libgmp-dev
install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
# Get stackage-curator
- wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
- bunzip2 stackage-curator.bz2
- chmod +x stackage-curator
- mv stackage-curator ~/.local/bin
# Install GHC and cabal-install
- stack setup 7.10.3
- stack --resolver ghc-7.10 build stackage-update
# Update the index
- travis_retry stack --resolver ghc-7.10 exec stackage-update
script:
- stack --resolver ghc-7.10 exec stackage-curator check
cache:
directories:
- $HOME/.stack
## Instruction:
Add the Stackage curator cache to the Travis cache
## Code After:
sudo: false
# Choose a lightweight base image; we provide our own build tools.
language: c
# GHC depends on GMP. You can add other dependencies here as well.
addons:
apt:
packages:
- libgmp-dev
install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
# Get stackage-curator
- wget https://s3.amazonaws.com/stackage-travis/stackage-curator/stackage-curator.bz2
- bunzip2 stackage-curator.bz2
- chmod +x stackage-curator
- mv stackage-curator ~/.local/bin
# Install GHC and cabal-install
- stack setup 7.10.3
- stack --resolver ghc-7.10 build stackage-update
# Update the index
- travis_retry stack --resolver ghc-7.10 exec stackage-update
script:
- stack --resolver ghc-7.10 exec stackage-curator check
cache:
directories:
- $HOME/.stack
- $HOME/.stackage/curator/cache
|
c49a4e6be7acc352f4622fd711a6dd4a464b89c3 | src/Database/IEntity.php | src/Database/IEntity.php | <?php
namespace Stirling\Database;
/**
* Interface for Entities.
*
* An Entity is a class created from database data.
*
* @package Stirling\Database
*/
interface IEntity
{
public function getKey();
} | <?php
namespace Stirling\Database;
/**
* Interface for Entities.
*
* An Entity is a class created from database data.
*
* @package Stirling\Database
*/
interface IEntity
{
public function getKey();
public function getProperties();
} | Add getProperty function to return all properties | Add getProperty function to return all properties
| PHP | mit | meandor/stirling-microservice,meandor/stirling-microservice | php | ## Code Before:
<?php
namespace Stirling\Database;
/**
* Interface for Entities.
*
* An Entity is a class created from database data.
*
* @package Stirling\Database
*/
interface IEntity
{
public function getKey();
}
## Instruction:
Add getProperty function to return all properties
## Code After:
<?php
namespace Stirling\Database;
/**
* Interface for Entities.
*
* An Entity is a class created from database data.
*
* @package Stirling\Database
*/
interface IEntity
{
public function getKey();
public function getProperties();
} |
1b61268baa1a210f55238146765f0a4565526883 | .travis.yml | .travis.yml | sudo: required
addons:
chrome: stable
language: node_js
node_js:
- '10'
cache:
directories:
- ~/.npm
- node_modules
before_install:
- sudo apt-get update
- sudo apt-get install alsa-utils
- sudo modprobe snd_bcm2835
- sudo apt-get install avahi-utils
install:
- npm install
script: npm start && npm run cy:run
| sudo: required
addons:
chrome: stable
language: node_js
node_js:
- '10'
cache:
directories:
- ~/.npm
- node_modules
before_install:
- sudo apt-get update
- sudo apt-get install alsa-utils
- sudo apt-get install avahi-utils
install:
- npm install
script: npm start && npm run cy:run
| Remove modules that do not exist | Remove modules that do not exist
| YAML | mit | omahajs/omahajs.github.io,omahajs/omahajs.github.io | yaml | ## Code Before:
sudo: required
addons:
chrome: stable
language: node_js
node_js:
- '10'
cache:
directories:
- ~/.npm
- node_modules
before_install:
- sudo apt-get update
- sudo apt-get install alsa-utils
- sudo modprobe snd_bcm2835
- sudo apt-get install avahi-utils
install:
- npm install
script: npm start && npm run cy:run
## Instruction:
Remove modules that do not exist
## Code After:
sudo: required
addons:
chrome: stable
language: node_js
node_js:
- '10'
cache:
directories:
- ~/.npm
- node_modules
before_install:
- sudo apt-get update
- sudo apt-get install alsa-utils
- sudo apt-get install avahi-utils
install:
- npm install
script: npm start && npm run cy:run
|
7fd60f4bb9b99409ababdaf4955b331f20919b55 | readthedocs/templates/core/project_list_featured.html | readthedocs/templates/core/project_list_featured.html | {% load i18n %}
{% for project in featured_list %}
<li class="module-item">
<a class="module-item-title" href="{{ project.get_absolute_url }}">{{ project.name }}</a>
{% for user in project.users.all %}
<a href="{{ user.get_absolute_url }}" class="quiet">({{ user }})</a>
{% endfor %}
{% if project.has_good_build %}
<span class="dropdown" style="position:absolute; right:0px; top:0px;">
<span>
<a href="{{ project.get_docs_url }}">{% trans "View Docs" %}</a>
<a href="#">▼</a>
</span>
<ul>
{% with project.get_stable_version as version %}
{% if version %}
<li><a href="{{ version.get_absolute_url }}">{{ version.slug }}</a></li>
{% endif %}
{% endwith %}
</ul>
</span>
{% else %}
<ul class="module-item-menu">
<li><a href="{{ project.get_builds_url }}">{% trans "No Docs" %}</a></li>
</ul>
{% endif %}
</li>
{% empty %}
<li class="module-item quiet">{% trans "No projects found" %}</li>
{% endfor %}
| {% load i18n %}
{% for project in featured_list %}
<li class="module-item">
<a class="module-item-title" href="{{ project.get_absolute_url }}">{{ project.name }}</a>
{% for user in project.users.all %}
<a href="{{ user.get_absolute_url }}" class="quiet">({{ user }})</a>
{% endfor %}
{% if project.has_good_build %}
<span class="dropdown" style="position:absolute; right:0px; top:0px;">
<span>
<a href="{{ project.get_docs_url }}">{% trans "View Docs" %}</a>
<a href="#">▼</a>
</span>
<ul>
{% with project.get_stable_version as version %}
{% if version %}
<li><a href="{{ version.get_absolute_url }}">{{ version.slug }}</a></li>
{% else %}
<li>No stable version</li>
{% endif %}
{% endwith %}
</ul>
</span>
{% else %}
<ul class="module-item-menu">
<li><a href="{{ project.get_builds_url }}">{% trans "No Docs" %}</a></li>
</ul>
{% endif %}
</li>
{% empty %}
<li class="module-item quiet">{% trans "No projects found" %}</li>
{% endfor %}
| Handle case with no stable | Handle case with no stable
| HTML | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | html | ## Code Before:
{% load i18n %}
{% for project in featured_list %}
<li class="module-item">
<a class="module-item-title" href="{{ project.get_absolute_url }}">{{ project.name }}</a>
{% for user in project.users.all %}
<a href="{{ user.get_absolute_url }}" class="quiet">({{ user }})</a>
{% endfor %}
{% if project.has_good_build %}
<span class="dropdown" style="position:absolute; right:0px; top:0px;">
<span>
<a href="{{ project.get_docs_url }}">{% trans "View Docs" %}</a>
<a href="#">▼</a>
</span>
<ul>
{% with project.get_stable_version as version %}
{% if version %}
<li><a href="{{ version.get_absolute_url }}">{{ version.slug }}</a></li>
{% endif %}
{% endwith %}
</ul>
</span>
{% else %}
<ul class="module-item-menu">
<li><a href="{{ project.get_builds_url }}">{% trans "No Docs" %}</a></li>
</ul>
{% endif %}
</li>
{% empty %}
<li class="module-item quiet">{% trans "No projects found" %}</li>
{% endfor %}
## Instruction:
Handle case with no stable
## Code After:
{% load i18n %}
{% for project in featured_list %}
<li class="module-item">
<a class="module-item-title" href="{{ project.get_absolute_url }}">{{ project.name }}</a>
{% for user in project.users.all %}
<a href="{{ user.get_absolute_url }}" class="quiet">({{ user }})</a>
{% endfor %}
{% if project.has_good_build %}
<span class="dropdown" style="position:absolute; right:0px; top:0px;">
<span>
<a href="{{ project.get_docs_url }}">{% trans "View Docs" %}</a>
<a href="#">▼</a>
</span>
<ul>
{% with project.get_stable_version as version %}
{% if version %}
<li><a href="{{ version.get_absolute_url }}">{{ version.slug }}</a></li>
{% else %}
<li>No stable version</li>
{% endif %}
{% endwith %}
</ul>
</span>
{% else %}
<ul class="module-item-menu">
<li><a href="{{ project.get_builds_url }}">{% trans "No Docs" %}</a></li>
</ul>
{% endif %}
</li>
{% empty %}
<li class="module-item quiet">{% trans "No projects found" %}</li>
{% endfor %}
|
a54980e5e442256981a88bc9cfb5e9125e6782f8 | slam.jl | slam.jl | VERSION >= v"0.4.0" && __precompile__(true)
module SLAM
export
# Types
Scene,
SlamState,
EKFSlamState,
PFSlamState,
Vehicle,
# Functions
initial_pose,
mpi_to_pi,
frame_transform,
step_vehicle!,
steer!,
predict,
update,
add_features,
associate,
compute_association,
predict_observation
include("common.jl")
include("vehicle.jl")
include("ekf.jl")
include("data-association.jl")
end # SLAM | __precompile__(true)
module SLAM
export
# Types
Scene,
SlamState,
EKFSlamState,
PFSlamState,
Vehicle,
# Functions
get_waypoints,
initial_pose,
mpi_to_pi,
frame_transform,
step_vehicle!,
steer!,
predict,
update,
add_features,
associate,
compute_association,
predict_observation
include("common.jl")
include("vehicle.jl")
include("ekf.jl")
include("data-association.jl")
end # SLAM | Generalize messages containing 2D points | Generalize messages containing 2D points
| Julia | mit | andrewadare/SLAM.jl,andrewadare/SLAM.jl | julia | ## Code Before:
VERSION >= v"0.4.0" && __precompile__(true)
module SLAM
export
# Types
Scene,
SlamState,
EKFSlamState,
PFSlamState,
Vehicle,
# Functions
initial_pose,
mpi_to_pi,
frame_transform,
step_vehicle!,
steer!,
predict,
update,
add_features,
associate,
compute_association,
predict_observation
include("common.jl")
include("vehicle.jl")
include("ekf.jl")
include("data-association.jl")
end # SLAM
## Instruction:
Generalize messages containing 2D points
## Code After:
__precompile__(true)
module SLAM
export
# Types
Scene,
SlamState,
EKFSlamState,
PFSlamState,
Vehicle,
# Functions
get_waypoints,
initial_pose,
mpi_to_pi,
frame_transform,
step_vehicle!,
steer!,
predict,
update,
add_features,
associate,
compute_association,
predict_observation
include("common.jl")
include("vehicle.jl")
include("ekf.jl")
include("data-association.jl")
end # SLAM |
a9a121d5fe595f54ed482ec162dc7a9703a65c13 | tp/__init__.py | tp/__init__.py | __import__('pkg_resources').declare_namespace(__name__)
try:
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
| try:
__import__('pkg_resources').declare_namespace(__name__)
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
| Fix for people without setuptools. | Fix for people without setuptools.
| Python | lgpl-2.1 | thousandparsec/libtpproto-py,thousandparsec/libtpproto-py | python | ## Code Before:
__import__('pkg_resources').declare_namespace(__name__)
try:
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
## Instruction:
Fix for people without setuptools.
## Code After:
try:
__import__('pkg_resources').declare_namespace(__name__)
import modulefinder
for p in __path__:
modulefinder.AddPackagePath(__name__, p)
except Exception, e:
import warnings
warnings.warn(e, RuntimeWarning)
|
013b300883eb4001e079b5772668e8957182c27d | tests/TestCase.php | tests/TestCase.php | <?php
namespace Projek\Slim\Tests;
use Projek\Slim\Monolog;
use PHPUnit_Framework_TestCase;
use DateTimeZone;
abstract class TestCase extends PHPUnit_Framework_TestCase
{
/**
* @var Projek\Slim\Monolog
*/
protected $logger;
/**
* Slim Application settings
*
* @var array
*/
protected $settings = [
'basename' => 'slim-monolog-app',
'logger' => [
'directory' => __DIR__.'/logs',
'filename' => 'app',
'level' => '',
'handlers' => [],
],
];
public function setUp()
{
$this->logger = new Monolog($this->settings['basename'], $this->settings['logger']);
}
}
| <?php
namespace Projek\Slim\Tests;
use Projek\Slim\Monolog;
use PHPUnit_Framework_TestCase;
use DateTimeZone;
abstract class TestCase extends PHPUnit_Framework_TestCase
{
/**
* @var Projek\Slim\Monolog
*/
protected $logger;
/**
* Slim Application settings
*
* @var array
*/
protected $settings = [
'basename' => 'slim-monolog-app',
'logger' => [
'directory' => '',
'filename' => 'app',
'level' => '',
'handlers' => [],
],
];
public function setUp()
{
$this->settings['logger']['directory'] = __DIR__.'/logs';
$this->logger = new Monolog($this->settings['basename'], $this->settings['logger']);
}
}
| Fix broken test in php 5.5 | Fix broken test in php 5.5
Signed-off-by: Fery Wardiyanto <bd7846e81d12676baffd10ffe6daf3939680ab52@gmail.com>
| PHP | mit | projek-xyz/slim-monolog | php | ## Code Before:
<?php
namespace Projek\Slim\Tests;
use Projek\Slim\Monolog;
use PHPUnit_Framework_TestCase;
use DateTimeZone;
abstract class TestCase extends PHPUnit_Framework_TestCase
{
/**
* @var Projek\Slim\Monolog
*/
protected $logger;
/**
* Slim Application settings
*
* @var array
*/
protected $settings = [
'basename' => 'slim-monolog-app',
'logger' => [
'directory' => __DIR__.'/logs',
'filename' => 'app',
'level' => '',
'handlers' => [],
],
];
public function setUp()
{
$this->logger = new Monolog($this->settings['basename'], $this->settings['logger']);
}
}
## Instruction:
Fix broken test in php 5.5
Signed-off-by: Fery Wardiyanto <bd7846e81d12676baffd10ffe6daf3939680ab52@gmail.com>
## Code After:
<?php
namespace Projek\Slim\Tests;
use Projek\Slim\Monolog;
use PHPUnit_Framework_TestCase;
use DateTimeZone;
abstract class TestCase extends PHPUnit_Framework_TestCase
{
/**
* @var Projek\Slim\Monolog
*/
protected $logger;
/**
* Slim Application settings
*
* @var array
*/
protected $settings = [
'basename' => 'slim-monolog-app',
'logger' => [
'directory' => '',
'filename' => 'app',
'level' => '',
'handlers' => [],
],
];
public function setUp()
{
$this->settings['logger']['directory'] = __DIR__.'/logs';
$this->logger = new Monolog($this->settings['basename'], $this->settings['logger']);
}
}
|
5931c9fa6cca60c58b9a96a128626148dc343d16 | tests/vdom_jsx.spec.tsx | tests/vdom_jsx.spec.tsx | import { } from 'jasmine';
import app from '../index-jsx';
const model = 'x';
const view = _ => <div>{_}</div>;
const update = {
hi: (_, val) => val
}
describe('vdom-jsx', () => {
let element;
beforeEach(()=>{
element = document.createElement('div');
document.body.appendChild(element);
app.start(element, model, view, update);
});
it('should create first child element', () => {
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('x');
});
it('should re-create child element', () => {
element.removeChild(element.firstChild);
app.run('hi', 'xx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xx');
});
it('should update child element', () => {
app.run('hi', 'xxx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xxx');
});
});
| import { } from 'jasmine';
import app from '../index-jsx';
const model = 'x';
const view = _ => <div>{_}</div>;
const update = {
hi: (_, val) => val
}
describe('vdom-jsx', () => {
let element;
beforeEach(()=>{
element = document.createElement('div');
document.body.appendChild(element);
app.start(element, model, view, update);
});
it('should create first child element', () => {
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('x');
});
it('should re-create child element', () => {
element.removeChild(element.firstChild);
app.run('hi', 'xx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xx');
});
it('should update child element', () => {
app.run('hi', 'xxx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xxx');
});
it('should render custom element', () => {
const CustomElement = ({val}) => <div>{val}</div>;
const view = _ => <CustomElement val= {_} />;
const element = document.createElement('div');
document.body.appendChild(element);
app.start(element, model, view, update);
app.run('hi', 'xxxxx');
expect(element.firstChild.textContent).toEqual('xxxxx');
});
});
| Add unit test for custom element | Add unit test for custom element
| TypeScript | mit | yysun/apprun,yysun/apprun,yysun/apprun | typescript | ## Code Before:
import { } from 'jasmine';
import app from '../index-jsx';
const model = 'x';
const view = _ => <div>{_}</div>;
const update = {
hi: (_, val) => val
}
describe('vdom-jsx', () => {
let element;
beforeEach(()=>{
element = document.createElement('div');
document.body.appendChild(element);
app.start(element, model, view, update);
});
it('should create first child element', () => {
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('x');
});
it('should re-create child element', () => {
element.removeChild(element.firstChild);
app.run('hi', 'xx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xx');
});
it('should update child element', () => {
app.run('hi', 'xxx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xxx');
});
});
## Instruction:
Add unit test for custom element
## Code After:
import { } from 'jasmine';
import app from '../index-jsx';
const model = 'x';
const view = _ => <div>{_}</div>;
const update = {
hi: (_, val) => val
}
describe('vdom-jsx', () => {
let element;
beforeEach(()=>{
element = document.createElement('div');
document.body.appendChild(element);
app.start(element, model, view, update);
});
it('should create first child element', () => {
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('x');
});
it('should re-create child element', () => {
element.removeChild(element.firstChild);
app.run('hi', 'xx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xx');
});
it('should update child element', () => {
app.run('hi', 'xxx');
expect(element.firstChild.nodeName).toEqual('DIV');
expect(element.firstChild.textContent).toEqual('xxx');
});
it('should render custom element', () => {
const CustomElement = ({val}) => <div>{val}</div>;
const view = _ => <CustomElement val= {_} />;
const element = document.createElement('div');
document.body.appendChild(element);
app.start(element, model, view, update);
app.run('hi', 'xxxxx');
expect(element.firstChild.textContent).toEqual('xxxxx');
});
});
|
55c72a5297244ba51fba5ebc5b71efc3001e0dd4 | otz/__init__.py | otz/__init__.py | from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
| from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
from otz.Beam import Beam, Bead
| Add Beam, Bead to main module | Add Beam, Bead to main module
| Python | unlicense | ghallsimpsons/optical_tweezers | python | ## Code Before:
from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
## Instruction:
Add Beam, Bead to main module
## Code After:
from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
from otz.Beam import Beam, Bead
|
98ffe628a82d459fe7def07f82f524a70d020864 | src/Development/Shake/Rule.hs | src/Development/Shake/Rule.hs |
-- | This module is used for defining new types of rules for Shake build systems.
-- Most users will find the built-in set of rules sufficient.
module Development.Shake.Rule(
-- * Builtin rules
-- ** Defining
BuiltinLint, noLint, BuiltinRun, RunChanged(..), RunResult(..), addBuiltinRule,
-- ** Running
apply, apply1,
-- * User rules
UserRule(..), addUserRule, getUserRules, userRuleMatch,
-- * Lint integration
trackUse, trackChange, trackAllow
) where
import Development.Shake.Internal.Core.Types
import Development.Shake.Internal.Core.Action
import Development.Shake.Internal.Core.Run
import Development.Shake.Internal.Core.Rules
|
-- | This module is used for defining new types of rules for Shake build systems.
-- Most users will find the built-in set of rules sufficient.
module Development.Shake.Rule(
-- * Defining builtin rules
BuiltinLint, noLint, BuiltinRun, RunChanged(..), RunResult(..), addBuiltinRule,
-- * Calling builtin rules
apply, apply1,
-- * User rules
UserRule(..), addUserRule, getUserRules, userRuleMatch,
-- * Lint integration
trackUse, trackChange, trackAllow
) where
import Development.Shake.Internal.Core.Types
import Development.Shake.Internal.Core.Action
import Development.Shake.Internal.Core.Run
import Development.Shake.Internal.Core.Rules
| Tweak the module doc headers | Tweak the module doc headers
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake | haskell | ## Code Before:
-- | This module is used for defining new types of rules for Shake build systems.
-- Most users will find the built-in set of rules sufficient.
module Development.Shake.Rule(
-- * Builtin rules
-- ** Defining
BuiltinLint, noLint, BuiltinRun, RunChanged(..), RunResult(..), addBuiltinRule,
-- ** Running
apply, apply1,
-- * User rules
UserRule(..), addUserRule, getUserRules, userRuleMatch,
-- * Lint integration
trackUse, trackChange, trackAllow
) where
import Development.Shake.Internal.Core.Types
import Development.Shake.Internal.Core.Action
import Development.Shake.Internal.Core.Run
import Development.Shake.Internal.Core.Rules
## Instruction:
Tweak the module doc headers
## Code After:
-- | This module is used for defining new types of rules for Shake build systems.
-- Most users will find the built-in set of rules sufficient.
module Development.Shake.Rule(
-- * Defining builtin rules
BuiltinLint, noLint, BuiltinRun, RunChanged(..), RunResult(..), addBuiltinRule,
-- * Calling builtin rules
apply, apply1,
-- * User rules
UserRule(..), addUserRule, getUserRules, userRuleMatch,
-- * Lint integration
trackUse, trackChange, trackAllow
) where
import Development.Shake.Internal.Core.Types
import Development.Shake.Internal.Core.Action
import Development.Shake.Internal.Core.Run
import Development.Shake.Internal.Core.Rules
|
467b6c2127851e43aa61bfa51242a1696f45d531 | release.nix | release.nix | { nixpkgs ? (fetchTarball "channel:nixos-20.03")
}:
with nixpkgs;
let
# Create an sdist given a derivation.
# Should add an sdist and wheel output to buildPythonPackage
create-sdist = drv:
drv.overridePythonAttrs(oldAttrs: with oldAttrs; rec {
name = "${pname}-${version}-sdist";
postBuild = ''
rm -rf dist
${drv.pythonModule.interpreter} nix_run_setup sdist
'';
installPhase = ''
mkdir -p $out
mv dist/*.tar.gz $out/
'';
fixupPhase = "true";
doCheck = false;
propagatedBuildInputs = [];
});
overrides = self: super: {
acoustics = super.callPackage ./default.nix {
development = true;
};
};
overlay = self: super: {
python36 = super.python36.override{packageOverrides=overrides;};
python37 = super.python37.override{packageOverrides=overrides;};
};
in import nixpkgs {
overlays = [ overlay ];
}
| { nixpkgs ? (fetchTarball "channel:nixos-20.03")
}:
with nixpkgs;
let
# Create an sdist given a derivation.
# Should add an sdist and wheel output to buildPythonPackage
create-sdist = drv:
drv.overridePythonAttrs(oldAttrs: with oldAttrs; rec {
name = "${pname}-${version}-sdist";
postBuild = ''
rm -rf dist
${drv.pythonModule.interpreter} nix_run_setup sdist
'';
installPhase = ''
mkdir -p $out
mv dist/*.tar.gz $out/
'';
fixupPhase = "true";
doCheck = false;
propagatedBuildInputs = [];
});
overrides = self: super: {
acoustics = super.callPackage ./default.nix {
development = true;
};
};
overlay = self: super: {
python36 = super.python36.override{packageOverrides=overrides;};
python37 = super.python37.override{packageOverrides=overrides;};
python38 = super.python38.override{packageOverrides=overrides;};
};
in import nixpkgs {
overlays = [ overlay ];
}
| Allow building with python 3.8 using nix | Allow building with python 3.8 using nix
| Nix | bsd-3-clause | python-acoustics/python-acoustics | nix | ## Code Before:
{ nixpkgs ? (fetchTarball "channel:nixos-20.03")
}:
with nixpkgs;
let
# Create an sdist given a derivation.
# Should add an sdist and wheel output to buildPythonPackage
create-sdist = drv:
drv.overridePythonAttrs(oldAttrs: with oldAttrs; rec {
name = "${pname}-${version}-sdist";
postBuild = ''
rm -rf dist
${drv.pythonModule.interpreter} nix_run_setup sdist
'';
installPhase = ''
mkdir -p $out
mv dist/*.tar.gz $out/
'';
fixupPhase = "true";
doCheck = false;
propagatedBuildInputs = [];
});
overrides = self: super: {
acoustics = super.callPackage ./default.nix {
development = true;
};
};
overlay = self: super: {
python36 = super.python36.override{packageOverrides=overrides;};
python37 = super.python37.override{packageOverrides=overrides;};
};
in import nixpkgs {
overlays = [ overlay ];
}
## Instruction:
Allow building with python 3.8 using nix
## Code After:
{ nixpkgs ? (fetchTarball "channel:nixos-20.03")
}:
with nixpkgs;
let
# Create an sdist given a derivation.
# Should add an sdist and wheel output to buildPythonPackage
create-sdist = drv:
drv.overridePythonAttrs(oldAttrs: with oldAttrs; rec {
name = "${pname}-${version}-sdist";
postBuild = ''
rm -rf dist
${drv.pythonModule.interpreter} nix_run_setup sdist
'';
installPhase = ''
mkdir -p $out
mv dist/*.tar.gz $out/
'';
fixupPhase = "true";
doCheck = false;
propagatedBuildInputs = [];
});
overrides = self: super: {
acoustics = super.callPackage ./default.nix {
development = true;
};
};
overlay = self: super: {
python36 = super.python36.override{packageOverrides=overrides;};
python37 = super.python37.override{packageOverrides=overrides;};
python38 = super.python38.override{packageOverrides=overrides;};
};
in import nixpkgs {
overlays = [ overlay ];
}
|
8830b0e726a671fa2b0bbafd1487148ae23fc1d4 | admin/forms.py | admin/forms.py | import riak
from wtforms.fields import TextField, TextAreaField, SelectField
from wtforms.validators import Required
from wtforms_tornado import Form
class ConnectionForm(Form):
name = TextField(validators=[Required()])
conection = TextField(validators=[Required()])
class CubeForm(Form):
myClient = riak.RiakClient(protocol='http',
http_port=8098,
host='127.0.0.1')
myBucket = myClient.bucket('openmining-admin')
bconnection = myBucket.get('connection').data
try:
CONNECTION = tuple([(c['slug'], c['name']) for c in bconnection])
except:
CONNECTION = tuple()
name = TextField(validators=[Required()])
conection = SelectField(choices=CONNECTION, validators=[Required()])
sql = TextAreaField(validators=[Required()])
| import riak
from wtforms.fields import TextField, TextAreaField, SelectField
from wtforms.validators import Required
from wtforms_tornado import Form
def ObjGenerate(bucket, key, value=None, _type=tuple):
myClient = riak.RiakClient(protocol='http',
http_port=8098,
host='127.0.0.1')
myBucket = myClient.bucket('openmining-admin')
bconnection = myBucket.get(bucket).data
try:
if _type is tuple:
return _type([(c[key], c[value]) for c in bconnection])
return _type(c[key] for c in bconnection)
except:
return _type()
class ConnectionForm(Form):
name = TextField(validators=[Required()])
conection = TextField(validators=[Required()])
class CubeForm(Form):
name = TextField(validators=[Required()])
conection = SelectField(choices=ObjGenerate('connection', 'slug', 'name'),
validators=[Required()])
sql = TextAreaField(validators=[Required()])
| Create new method object generate get riak bucket and generate tuple or list | Create new method object generate
get riak bucket and generate tuple or list
| Python | mit | chrisdamba/mining,seagoat/mining,avelino/mining,jgabriellima/mining,AndrzejR/mining,jgabriellima/mining,mining/mining,mlgruby/mining,chrisdamba/mining,mlgruby/mining,mlgruby/mining,seagoat/mining,AndrzejR/mining,avelino/mining,mining/mining | python | ## Code Before:
import riak
from wtforms.fields import TextField, TextAreaField, SelectField
from wtforms.validators import Required
from wtforms_tornado import Form
class ConnectionForm(Form):
name = TextField(validators=[Required()])
conection = TextField(validators=[Required()])
class CubeForm(Form):
myClient = riak.RiakClient(protocol='http',
http_port=8098,
host='127.0.0.1')
myBucket = myClient.bucket('openmining-admin')
bconnection = myBucket.get('connection').data
try:
CONNECTION = tuple([(c['slug'], c['name']) for c in bconnection])
except:
CONNECTION = tuple()
name = TextField(validators=[Required()])
conection = SelectField(choices=CONNECTION, validators=[Required()])
sql = TextAreaField(validators=[Required()])
## Instruction:
Create new method object generate
get riak bucket and generate tuple or list
## Code After:
import riak
from wtforms.fields import TextField, TextAreaField, SelectField
from wtforms.validators import Required
from wtforms_tornado import Form
def ObjGenerate(bucket, key, value=None, _type=tuple):
myClient = riak.RiakClient(protocol='http',
http_port=8098,
host='127.0.0.1')
myBucket = myClient.bucket('openmining-admin')
bconnection = myBucket.get(bucket).data
try:
if _type is tuple:
return _type([(c[key], c[value]) for c in bconnection])
return _type(c[key] for c in bconnection)
except:
return _type()
class ConnectionForm(Form):
name = TextField(validators=[Required()])
conection = TextField(validators=[Required()])
class CubeForm(Form):
name = TextField(validators=[Required()])
conection = SelectField(choices=ObjGenerate('connection', 'slug', 'name'),
validators=[Required()])
sql = TextAreaField(validators=[Required()])
|
1e7b0b9a85bbddc5632738755b57dc2e5ba7bdf3 | st2tests/st2tests/fixtures/history_views/filters.yaml | st2tests/st2tests/fixtures/history_views/filters.yaml | ---
default:
action:
- executions.local
- executions.chain
rule:
- st2.person.joe
runner:
- run-local
- action-chain
status:
- succeeded
trigger:
- 46f67652-20cd-4bab-94e2-4615baa846d0
trigger_type:
- st2.webhook
user:
- system
specific:
action:
- executions.local
- executions.chain
user:
- system
| ---
default:
action:
- executions.local
- executions.chain
- None
rule:
- st2.person.joe
runner:
- run-local
- action-chain
status:
- succeeded
trigger:
- 46f67652-20cd-4bab-94e2-4615baa846d0
trigger_type:
- st2.webhook
- None
user:
- system
specific:
action:
- executions.local
- executions.chain
user:
- system
| Update fixture to include None data. | Update fixture to include None data.
| YAML | apache-2.0 | Plexxi/st2,tonybaloney/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,StackStorm/st2,tonybaloney/st2,Plexxi/st2,tonybaloney/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,nzlosh/st2 | yaml | ## Code Before:
---
default:
action:
- executions.local
- executions.chain
rule:
- st2.person.joe
runner:
- run-local
- action-chain
status:
- succeeded
trigger:
- 46f67652-20cd-4bab-94e2-4615baa846d0
trigger_type:
- st2.webhook
user:
- system
specific:
action:
- executions.local
- executions.chain
user:
- system
## Instruction:
Update fixture to include None data.
## Code After:
---
default:
action:
- executions.local
- executions.chain
- None
rule:
- st2.person.joe
runner:
- run-local
- action-chain
status:
- succeeded
trigger:
- 46f67652-20cd-4bab-94e2-4615baa846d0
trigger_type:
- st2.webhook
- None
user:
- system
specific:
action:
- executions.local
- executions.chain
user:
- system
|
860ed996b976794ff6ecf5748875b9bac66933a9 | lib/features/settings/presentation/widgets/server_setup_instructions.dart | lib/features/settings/presentation/widgets/server_setup_instructions.dart | import 'package:flutter/material.dart';
class ServerSetupInstructions extends StatelessWidget {
const ServerSetupInstructions({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Text(
'This app is not registered to a Tautulli server.',
style: TextStyle(fontWeight: FontWeight.bold),
),
),
Text('To register this app do the following:'),
BulletItem('Open the Tautulli web interface on another device'),
BulletItem('Navigate to Settings > Tautulli Remote App'),
BulletItem('Select \'Register a new device\''),
BulletItem('Use the button below to add a new server'),
],
);
}
}
class BulletItem extends StatelessWidget {
final String text;
const BulletItem(this.text, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(
left: 10,
),
child: Text('• $text'),
);
}
}
| import 'package:flutter/material.dart';
class ServerSetupInstructions extends StatelessWidget {
const ServerSetupInstructions({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Text(
'This app is not registered to a Tautulli server.',
style: TextStyle(fontWeight: FontWeight.bold),
),
),
Text('To register with a Tautulli server:'),
BulletItem('Open the Tautulli web interface on another device'),
BulletItem('Navigate to Settings > Tautulli Remote App'),
BulletItem('Select \'Register a new device\''),
BulletItem('Use the button below to add a new server'),
],
);
}
}
class BulletItem extends StatelessWidget {
final String text;
const BulletItem(this.text, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(
left: 10,
),
child: Text('• $text'),
);
}
}
| Tweak wording for server setup instructions. | Tweak wording for server setup instructions.
| Dart | mit | wcomartin/PlexPy-Remote | dart | ## Code Before:
import 'package:flutter/material.dart';
class ServerSetupInstructions extends StatelessWidget {
const ServerSetupInstructions({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Text(
'This app is not registered to a Tautulli server.',
style: TextStyle(fontWeight: FontWeight.bold),
),
),
Text('To register this app do the following:'),
BulletItem('Open the Tautulli web interface on another device'),
BulletItem('Navigate to Settings > Tautulli Remote App'),
BulletItem('Select \'Register a new device\''),
BulletItem('Use the button below to add a new server'),
],
);
}
}
class BulletItem extends StatelessWidget {
final String text;
const BulletItem(this.text, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(
left: 10,
),
child: Text('• $text'),
);
}
}
## Instruction:
Tweak wording for server setup instructions.
## Code After:
import 'package:flutter/material.dart';
class ServerSetupInstructions extends StatelessWidget {
const ServerSetupInstructions({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Text(
'This app is not registered to a Tautulli server.',
style: TextStyle(fontWeight: FontWeight.bold),
),
),
Text('To register with a Tautulli server:'),
BulletItem('Open the Tautulli web interface on another device'),
BulletItem('Navigate to Settings > Tautulli Remote App'),
BulletItem('Select \'Register a new device\''),
BulletItem('Use the button below to add a new server'),
],
);
}
}
class BulletItem extends StatelessWidget {
final String text;
const BulletItem(this.text, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(
left: 10,
),
child: Text('• $text'),
);
}
}
|
b21e815425e4e295ff03136e1613c2c0c4707af3 | frontend/app/views/spree/products/_description.html.erb | frontend/app/views/spree/products/_description.html.erb | <h3 class="pt-4 font-weight-bold text-uppercase product-details-subtitle"><%= Spree.t(:description) %></h3>
<div id="product-description-short" class="m-0 text-break product-description" data-hook="description">
<%= sanitize product_description(@product).truncate(450) %>
</div>
<div id="product-description-long" class="m-0 text-break product-description d-none" data-hook="description">
<%= sanitize product_description(@product) %>
</div>
<% if product_description(@product).length > 450 %>
<span id="product-description-arrow" class="d-flex justify-content-center align-items-center mt-3 mx-auto product-description-arrow" aria-hidden="true">
<%= icon(name: 'arrow-right',
classes: 'spree-icon-arrow spree-icon-arrow-down',
width: 20,
height: 20) %>
</span>
<% end %>
| <h3 class="pt-4 font-weight-bold text-uppercase product-details-subtitle"><%= Spree.t(:description) %></h3>
<div id="product-description-short" class="m-0 text-break product-description" data-hook="description">
<% if Spree::Config[:show_raw_product_description] %>
<%= raw product_description(@product).truncate(450) %>
<% else %>
<%= sanitize product_description(@product).truncate(450) %>
<% end %>
</div>
<div id="product-description-long" class="m-0 text-break product-description d-none" data-hook="description">
<% if Spree::Config[:show_raw_product_description] %>
<%= raw product_description(@product) %>
<% else %>
<%= sanitize product_description(@product) %>
<% end %>
</div>
<% if product_description(@product).length > 450 %>
<span id="product-description-arrow" class="d-flex justify-content-center align-items-center mt-3 mx-auto product-description-arrow" aria-hidden="true">
<%= icon(name: 'arrow-right',
classes: 'spree-icon-arrow spree-icon-arrow-down',
width: 20,
height: 20) %>
</span>
<% end %>
| Make config :show raw product_description usable in new storefront. | Make config :show raw product_description usable in new storefront.
| HTML+ERB | bsd-3-clause | imella/spree,imella/spree,imella/spree | html+erb | ## Code Before:
<h3 class="pt-4 font-weight-bold text-uppercase product-details-subtitle"><%= Spree.t(:description) %></h3>
<div id="product-description-short" class="m-0 text-break product-description" data-hook="description">
<%= sanitize product_description(@product).truncate(450) %>
</div>
<div id="product-description-long" class="m-0 text-break product-description d-none" data-hook="description">
<%= sanitize product_description(@product) %>
</div>
<% if product_description(@product).length > 450 %>
<span id="product-description-arrow" class="d-flex justify-content-center align-items-center mt-3 mx-auto product-description-arrow" aria-hidden="true">
<%= icon(name: 'arrow-right',
classes: 'spree-icon-arrow spree-icon-arrow-down',
width: 20,
height: 20) %>
</span>
<% end %>
## Instruction:
Make config :show raw product_description usable in new storefront.
## Code After:
<h3 class="pt-4 font-weight-bold text-uppercase product-details-subtitle"><%= Spree.t(:description) %></h3>
<div id="product-description-short" class="m-0 text-break product-description" data-hook="description">
<% if Spree::Config[:show_raw_product_description] %>
<%= raw product_description(@product).truncate(450) %>
<% else %>
<%= sanitize product_description(@product).truncate(450) %>
<% end %>
</div>
<div id="product-description-long" class="m-0 text-break product-description d-none" data-hook="description">
<% if Spree::Config[:show_raw_product_description] %>
<%= raw product_description(@product) %>
<% else %>
<%= sanitize product_description(@product) %>
<% end %>
</div>
<% if product_description(@product).length > 450 %>
<span id="product-description-arrow" class="d-flex justify-content-center align-items-center mt-3 mx-auto product-description-arrow" aria-hidden="true">
<%= icon(name: 'arrow-right',
classes: 'spree-icon-arrow spree-icon-arrow-down',
width: 20,
height: 20) %>
</span>
<% end %>
|
45806b19b76fdc5e78b56c9e67a5d4c2fb5c7dcc | static/panels.less | static/panels.less | @import "ui-variables";
// Atom panels
atom-panel-container.left,
atom-panel-container.right {
display: flex;
}
.tool-panel, // deprecated: .tool-panel
atom-panel {
display: block;
position: relative;
}
atom-panel-container > atom-panel.left,
atom-panel-container > atom-panel.right {
display: flex;
}
// Some packages use `height: 100%` which doesn't play nice with flexbox
atom-panel-container > atom-panel.left > *,
atom-panel-container > atom-panel.right > * {
height: initial;
}
| @import "ui-variables";
// Atom panels
atom-panel-container.left,
atom-panel-container.right {
display: flex;
}
atom-panel-container.left {
// Align panels to the right of the panel container. The effect of this is
// that the left dock's toggle button will appear on the right side of the
// empty space when the panel container has a min width in the theme.
justify-content: flex-end;
}
.tool-panel, // deprecated: .tool-panel
atom-panel {
display: block;
position: relative;
}
atom-panel-container > atom-panel.left,
atom-panel-container > atom-panel.right {
display: flex;
}
// Some packages use `height: 100%` which doesn't play nice with flexbox
atom-panel-container > atom-panel.left > *,
atom-panel-container > atom-panel.right > * {
height: initial;
}
| Fix positioning of left dock toggle button when panel container has min-width | Fix positioning of left dock toggle button when panel container has min-width
| Less | mit | PKRoma/atom,brettle/atom,stinsonga/atom,andrewleverette/atom,AlexxNica/atom,stinsonga/atom,stinsonga/atom,liuderchi/atom,decaffeinate-examples/atom,liuderchi/atom,ardeshirj/atom,FIT-CSE2410-A-Bombs/atom,xream/atom,liuderchi/atom,PKRoma/atom,andrewleverette/atom,xream/atom,AlexxNica/atom,atom/atom,t9md/atom,brettle/atom,kevinrenaers/atom,t9md/atom,Mokolea/atom,FIT-CSE2410-A-Bombs/atom,kevinrenaers/atom,decaffeinate-examples/atom,stinsonga/atom,CraZySacX/atom,PKRoma/atom,Arcanemagus/atom,liuderchi/atom,decaffeinate-examples/atom,kevinrenaers/atom,ardeshirj/atom,ardeshirj/atom,sotayamashita/atom,FIT-CSE2410-A-Bombs/atom,Arcanemagus/atom,xream/atom,Mokolea/atom,brettle/atom,sotayamashita/atom,Mokolea/atom,andrewleverette/atom,sotayamashita/atom,atom/atom,t9md/atom,atom/atom,CraZySacX/atom,AlexxNica/atom,Arcanemagus/atom,decaffeinate-examples/atom,CraZySacX/atom | less | ## Code Before:
@import "ui-variables";
// Atom panels
atom-panel-container.left,
atom-panel-container.right {
display: flex;
}
.tool-panel, // deprecated: .tool-panel
atom-panel {
display: block;
position: relative;
}
atom-panel-container > atom-panel.left,
atom-panel-container > atom-panel.right {
display: flex;
}
// Some packages use `height: 100%` which doesn't play nice with flexbox
atom-panel-container > atom-panel.left > *,
atom-panel-container > atom-panel.right > * {
height: initial;
}
## Instruction:
Fix positioning of left dock toggle button when panel container has min-width
## Code After:
@import "ui-variables";
// Atom panels
atom-panel-container.left,
atom-panel-container.right {
display: flex;
}
atom-panel-container.left {
// Align panels to the right of the panel container. The effect of this is
// that the left dock's toggle button will appear on the right side of the
// empty space when the panel container has a min width in the theme.
justify-content: flex-end;
}
.tool-panel, // deprecated: .tool-panel
atom-panel {
display: block;
position: relative;
}
atom-panel-container > atom-panel.left,
atom-panel-container > atom-panel.right {
display: flex;
}
// Some packages use `height: 100%` which doesn't play nice with flexbox
atom-panel-container > atom-panel.left > *,
atom-panel-container > atom-panel.right > * {
height: initial;
}
|
990bdf667f172f42c751464cf31911720961a7b3 | index.html | index.html | <!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="HandheldFriendly" content="True">
<title>Crossword Nexus Solver</title>
<link href="css/crosswordnexus.css" rel="stylesheet">
<script src="js/crosswords.js"></script>
<script src="js/puz.js"></script>
<script src="lib/jquery.js"></script>
<script src="lib/zip/zip.js"></script>
<script src="lib/jspdf.min.js"></script>
<style>
html, body {
/* height: 100%; */
margin: 0;
}
div.crossword { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
</style>
</head>
<body>
<div class="crossword"></div>
<script>
(function(){
// Grab puzzle from query string if available
var url = new URL(window.location.href);
var puzzle = url.searchParams.get("puzzle");
var params = {};
if (puzzle) {
params = {
puzzle_file: {
url: puzzle,
type: puzzle.slice(puzzle.lastIndexOf('.') + 1)
}
};
}
CrosswordNexus.createCrossword($('div.crossword'), params);
})();
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="HandheldFriendly" content="True">
<title>Crossword Nexus Solver</title>
<link href="css/crosswordnexus.css" rel="stylesheet">
<script src="js/crosswords.js"></script>
<script src="js/puz.js"></script>
<script src="lib/jquery.js"></script>
<script src="lib/zip/zip.js"></script>
<script src="lib/jspdf.min.js"></script>
<style>
html, body {
/* height: 100%; */
margin: 0;
}
div.crossword { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
</style>
</head>
<body>
<div class="crossword"></div>
<script>
(function(){
// Grab puzzle from query string if available
var url = new URL(window.location.href);
var puzzle = url.searchParams.get("puzzle");
if (!puzzle) puzzle = url.searchParams.get("file");
var params = {};
if (puzzle) {
params = {
puzzle_file: {
url: puzzle,
type: puzzle.slice(puzzle.lastIndexOf('.') + 1)
}
};
}
CrosswordNexus.createCrossword($('div.crossword'), params);
})();
</script>
</body>
</html>
| Allow URL param to be | Allow URL param to be
| HTML | bsd-3-clause | boisvert42/html5-crossword-solver,crosswordnexus/html5-crossword-solver,crosswordnexus/html5-crossword-solver,boisvert42/html5-crossword-solver | html | ## Code Before:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="HandheldFriendly" content="True">
<title>Crossword Nexus Solver</title>
<link href="css/crosswordnexus.css" rel="stylesheet">
<script src="js/crosswords.js"></script>
<script src="js/puz.js"></script>
<script src="lib/jquery.js"></script>
<script src="lib/zip/zip.js"></script>
<script src="lib/jspdf.min.js"></script>
<style>
html, body {
/* height: 100%; */
margin: 0;
}
div.crossword { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
</style>
</head>
<body>
<div class="crossword"></div>
<script>
(function(){
// Grab puzzle from query string if available
var url = new URL(window.location.href);
var puzzle = url.searchParams.get("puzzle");
var params = {};
if (puzzle) {
params = {
puzzle_file: {
url: puzzle,
type: puzzle.slice(puzzle.lastIndexOf('.') + 1)
}
};
}
CrosswordNexus.createCrossword($('div.crossword'), params);
})();
</script>
</body>
</html>
## Instruction:
Allow URL param to be
## Code After:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="HandheldFriendly" content="True">
<title>Crossword Nexus Solver</title>
<link href="css/crosswordnexus.css" rel="stylesheet">
<script src="js/crosswords.js"></script>
<script src="js/puz.js"></script>
<script src="lib/jquery.js"></script>
<script src="lib/zip/zip.js"></script>
<script src="lib/jspdf.min.js"></script>
<style>
html, body {
/* height: 100%; */
margin: 0;
}
div.crossword { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
</style>
</head>
<body>
<div class="crossword"></div>
<script>
(function(){
// Grab puzzle from query string if available
var url = new URL(window.location.href);
var puzzle = url.searchParams.get("puzzle");
if (!puzzle) puzzle = url.searchParams.get("file");
var params = {};
if (puzzle) {
params = {
puzzle_file: {
url: puzzle,
type: puzzle.slice(puzzle.lastIndexOf('.') + 1)
}
};
}
CrosswordNexus.createCrossword($('div.crossword'), params);
})();
</script>
</body>
</html>
|
f165467b5d16dea30e43724bbb65e505bc1d9013 | transpiler/javatests/com/google/j2cl/transpiler/integration/selfreferencingnativetype/Foo.java | transpiler/javatests/com/google/j2cl/transpiler/integration/selfreferencingnativetype/Foo.java | /*
* Copyright 2017 Google Inc.
*
* 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
*
* https://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.google.j2cl.transpiler.integration.selfreferencingnativetype;
import jsinterop.annotations.JsType;
@JsType(namespace = "zoo")
public class Foo {
public static String getMe() {
return "me";
}
@JsType(isNative = true, name = "Foo", namespace = "zoo")
public static class ZooFoo {
public static native String getMe();
}
public static String getMeViaNative() {
return ZooFoo.getMe();
}
}
| /*
* Copyright 2017 Google Inc.
*
* 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
*
* https://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.google.j2cl.transpiler.integration.selfreferencingnativetype;
import jsinterop.annotations.JsType;
@JsType(namespace = "zoo")
public class Foo {
public static String getMe() {
return "me";
}
// Refer to the implementation "zoo.Foo$impl" instead to avoid creating an "invalid" circular
// reference.
@JsType(isNative = true, name = "Foo$impl", namespace = "zoo")
public static class ZooFoo {
public static native String getMe();
}
public static String getMeViaNative() {
return ZooFoo.getMe();
}
}
| Fix native reference so that it does not violate circularity rules between $impl and header files. | Fix native reference so that it does not violate circularity rules between $impl and header files.
PiperOrigin-RevId: 168731186
| Java | apache-2.0 | google/j2cl,google/j2cl,google/j2cl,google/j2cl,google/j2cl | java | ## Code Before:
/*
* Copyright 2017 Google Inc.
*
* 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
*
* https://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.google.j2cl.transpiler.integration.selfreferencingnativetype;
import jsinterop.annotations.JsType;
@JsType(namespace = "zoo")
public class Foo {
public static String getMe() {
return "me";
}
@JsType(isNative = true, name = "Foo", namespace = "zoo")
public static class ZooFoo {
public static native String getMe();
}
public static String getMeViaNative() {
return ZooFoo.getMe();
}
}
## Instruction:
Fix native reference so that it does not violate circularity rules between $impl and header files.
PiperOrigin-RevId: 168731186
## Code After:
/*
* Copyright 2017 Google Inc.
*
* 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
*
* https://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.google.j2cl.transpiler.integration.selfreferencingnativetype;
import jsinterop.annotations.JsType;
@JsType(namespace = "zoo")
public class Foo {
public static String getMe() {
return "me";
}
// Refer to the implementation "zoo.Foo$impl" instead to avoid creating an "invalid" circular
// reference.
@JsType(isNative = true, name = "Foo$impl", namespace = "zoo")
public static class ZooFoo {
public static native String getMe();
}
public static String getMeViaNative() {
return ZooFoo.getMe();
}
}
|
ca850ead789d642b985187a65df506700bb60a6f | faq.php | faq.php | <?php
# Grab the Slack post variables
$token = ($_POST['token'] === 'CxPDeOTKKscdX6nkTi3lOn1d' ? $_POST['token'] : false); # Replace with the token from your slash command config
$channel = $_POST['channel_name'];
$text = $_POST['text'];
# Check pre-requisites for the script to run
if(!$token){
$msg = "This token doesn't match the slack command set up.";
die($msg);
}
# Set up Frequently Asked Question (FAQ) array
$faq = [
"company information" => "Here is some information about our company...",
"contact" => "Here are the contact details for our company...",
];
# Check if the user's text has partially matched any of the FAQ keys
foreach ($faq as $key => $value) {
if (strpos(strtolower($key), strtolower($text)) !== false) {
$results[] = "*" . $key . "*\n\n" . $value . "\n\n";
}
}
# Output each of the matched key values
if (sizeof($results) > 0) {
foreach ($results as $key => $value) {
echo $value;
}
# or inform the user nothing was matched
} else if ((sizeof($results) === 0)) {
echo "We couldn't find a part of the guide related to this search :disappointed:";
} | <?php
# Grab the Slack post variables
$token = ($_POST['token'] === 'CxPDeOTKKscdX6nkTi3lOn1d' ? $_POST['token'] : false); # Replace with the token from your slash command config
$channel = $_POST['channel_name'];
$text = $_POST['text'];
# Check pre-requisites for the script to run
if(!$token){
$msg = "This token doesn't match the slack command set up.";
die($msg);
}
# Set up Frequently Asked Question (FAQ) array
$faq = [
"company information" => "Here is some information about our company...",
"contact" => "Here are the contact details for our company...",
];
# Check if the user's text has partially matched any of the FAQ keys
foreach ($faq as $key => $value) {
if (strpos(strtolower($key), strtolower($text)) !== false) {
$results[] = "*" . $key . "*\n\n" . $value . "\n\n";
}
}
# Output each of the matched key values
if (sizeof($results) > 0) {
foreach ($results as $key => $value) {
echo $value;
}
# or inform the user nothing was matched
} else if ((sizeof($results) === 0)) {
echo "We couldn't find a part of the guide related to the search *" . $text . "* :disappointed:";
} | Add search text to if not found message | Add search text to if not found message
| PHP | mit | mledwards/slackbot-faq-slash-command | php | ## Code Before:
<?php
# Grab the Slack post variables
$token = ($_POST['token'] === 'CxPDeOTKKscdX6nkTi3lOn1d' ? $_POST['token'] : false); # Replace with the token from your slash command config
$channel = $_POST['channel_name'];
$text = $_POST['text'];
# Check pre-requisites for the script to run
if(!$token){
$msg = "This token doesn't match the slack command set up.";
die($msg);
}
# Set up Frequently Asked Question (FAQ) array
$faq = [
"company information" => "Here is some information about our company...",
"contact" => "Here are the contact details for our company...",
];
# Check if the user's text has partially matched any of the FAQ keys
foreach ($faq as $key => $value) {
if (strpos(strtolower($key), strtolower($text)) !== false) {
$results[] = "*" . $key . "*\n\n" . $value . "\n\n";
}
}
# Output each of the matched key values
if (sizeof($results) > 0) {
foreach ($results as $key => $value) {
echo $value;
}
# or inform the user nothing was matched
} else if ((sizeof($results) === 0)) {
echo "We couldn't find a part of the guide related to this search :disappointed:";
}
## Instruction:
Add search text to if not found message
## Code After:
<?php
# Grab the Slack post variables
$token = ($_POST['token'] === 'CxPDeOTKKscdX6nkTi3lOn1d' ? $_POST['token'] : false); # Replace with the token from your slash command config
$channel = $_POST['channel_name'];
$text = $_POST['text'];
# Check pre-requisites for the script to run
if(!$token){
$msg = "This token doesn't match the slack command set up.";
die($msg);
}
# Set up Frequently Asked Question (FAQ) array
$faq = [
"company information" => "Here is some information about our company...",
"contact" => "Here are the contact details for our company...",
];
# Check if the user's text has partially matched any of the FAQ keys
foreach ($faq as $key => $value) {
if (strpos(strtolower($key), strtolower($text)) !== false) {
$results[] = "*" . $key . "*\n\n" . $value . "\n\n";
}
}
# Output each of the matched key values
if (sizeof($results) > 0) {
foreach ($results as $key => $value) {
echo $value;
}
# or inform the user nothing was matched
} else if ((sizeof($results) === 0)) {
echo "We couldn't find a part of the guide related to the search *" . $text . "* :disappointed:";
} |
f1c45567d1767bf5a3d04b750a91f5b72c093057 | RNCryptor/String.swift | RNCryptor/String.swift | //
// String.swift
// RNCryptor
//
// Created by Rob Napier on 7/1/15.
// Copyright © 2015 Rob Napier. All rights reserved.
//
import Foundation
extension String {
init?(UTF8String: UnsafePointer<UInt8>) {
self.init(UnsafePointer<Int8>(UTF8String))
}
} | //
// String.swift
// RNCryptor
//
// Created by Rob Napier on 7/1/15.
// Copyright © 2015 Rob Napier. All rights reserved.
//
import Foundation
extension String {
init?(UTF8String: UnsafePointer<UInt8>) {
self.init(UTF8String: UnsafePointer<Int8>(UTF8String))
}
} | Add experimental string bridge (may not be a good idea) | Add experimental string bridge (may not be a good idea)
| Swift | mit | RNCryptor/RNCryptor,RNCryptor/RNCryptor | swift | ## Code Before:
//
// String.swift
// RNCryptor
//
// Created by Rob Napier on 7/1/15.
// Copyright © 2015 Rob Napier. All rights reserved.
//
import Foundation
extension String {
init?(UTF8String: UnsafePointer<UInt8>) {
self.init(UnsafePointer<Int8>(UTF8String))
}
}
## Instruction:
Add experimental string bridge (may not be a good idea)
## Code After:
//
// String.swift
// RNCryptor
//
// Created by Rob Napier on 7/1/15.
// Copyright © 2015 Rob Napier. All rights reserved.
//
import Foundation
extension String {
init?(UTF8String: UnsafePointer<UInt8>) {
self.init(UTF8String: UnsafePointer<Int8>(UTF8String))
}
} |
d076fe6fead38c72a6e0d5b897aba1c82495def6 | nixpkgs/emacs/site-lisp/init-avy.el | nixpkgs/emacs/site-lisp/init-avy.el | ;;; init-avy.el --- init file for avy
;;; Commentary:
;; Use `C-:` to jump to any position by entering 1 character and
;; use `C-'` to jump to any position by entering 2 characters.
;;; Code:
(use-package avy
:bind
("C-\"" . avy-goto-char)
("C-'" . avy-goto-char-2)
("M-g f" . avy-goto-line))
(provide 'init-avy)
;;; init-avy.el ends here
| ;;; init-avy.el --- init file for avy
;;; Commentary:
;; Use `C-c SPC` to jump to any position by entering 1 character and
;; use `C-c C-SPC` to jump to any position by entering 2 characters.
;;; Code:
(use-package avy
:bind
("C-c SPC" . avy-goto-char)
("C-c C-SPC" . avy-goto-char-2)
("M-g f" . avy-goto-line))
(provide 'init-avy)
;;; init-avy.el ends here
| Update key bindings for avo | Update key bindings for avo
| Emacs Lisp | mit | hongchangwu/dotfiles,hongchangwu/dotfiles | emacs-lisp | ## Code Before:
;;; init-avy.el --- init file for avy
;;; Commentary:
;; Use `C-:` to jump to any position by entering 1 character and
;; use `C-'` to jump to any position by entering 2 characters.
;;; Code:
(use-package avy
:bind
("C-\"" . avy-goto-char)
("C-'" . avy-goto-char-2)
("M-g f" . avy-goto-line))
(provide 'init-avy)
;;; init-avy.el ends here
## Instruction:
Update key bindings for avo
## Code After:
;;; init-avy.el --- init file for avy
;;; Commentary:
;; Use `C-c SPC` to jump to any position by entering 1 character and
;; use `C-c C-SPC` to jump to any position by entering 2 characters.
;;; Code:
(use-package avy
:bind
("C-c SPC" . avy-goto-char)
("C-c C-SPC" . avy-goto-char-2)
("M-g f" . avy-goto-line))
(provide 'init-avy)
;;; init-avy.el ends here
|
e1cff04080a30ffa369b159930ecf381a7261cfd | modules/atom/settings/config.cson | modules/atom/settings/config.cson | "*":
"atom-beautify":
css:
indent_size: 2
general:
_analyticsUserId: "8bfc3dc2-e55f-4b45-93b6-8b516d108dab"
html:
indent_size: 2
js:
indent_size: 2
"atom-package-deps":
ignored: []
core:
disabledPackages: [
"metrics"
"welcome"
"language-javascript"
"markdown-preview"
]
telemetryConsent: "no"
editor:
fontSize: 13
showIndentGuide: true
"exception-reporting":
userId: "e2c17e7a-6562-482a-b326-cd43e0f43b75"
linter:
disabledProviders: [
"ESLint"
]
"linter-eslint":
disableWhenNoEslintConfig: true
globalNodePath: "/usr/local"
useGlobalEslint: false
"linter-ui-default":
panelHeight: 69
"markdown-preview":
useGitHubStyle: true
"spell-check":
locales: [
"es-ES"
]
tabs:
enableVcsColoring: true
"tree-view":
hideVcsIgnoredFiles: true
welcome:
showOnStartup: false
| "*":
"atom-beautify":
css:
indent_size: 2
general:
_analyticsUserId: "8bfc3dc2-e55f-4b45-93b6-8b516d108dab"
html:
indent_size: 2
js:
indent_size: 2
"atom-package-deps":
ignored: []
core:
disabledPackages: [
"metrics"
"welcome"
"language-javascript"
"markdown-preview"
]
telemetryConsent: "no"
editor:
showIndentGuide: true
"exception-reporting":
userId: "e2c17e7a-6562-482a-b326-cd43e0f43b75"
linter:
disabledProviders: [
"ESLint"
]
"linter-eslint":
disableWhenNoEslintConfig: true
globalNodePath: "/usr/local"
useGlobalEslint: false
"linter-ui-default":
panelHeight: 69
"markdown-preview":
useGitHubStyle: true
"spell-check":
locales: [
"es-ES"
]
tabs:
enableVcsColoring: true
"tree-view":
hideVcsIgnoredFiles: true
welcome:
showOnStartup: false
| Increase font size in Atom | Increase font size in Atom
| CoffeeScript | unlicense | guerrero/dotfiles | coffeescript | ## Code Before:
"*":
"atom-beautify":
css:
indent_size: 2
general:
_analyticsUserId: "8bfc3dc2-e55f-4b45-93b6-8b516d108dab"
html:
indent_size: 2
js:
indent_size: 2
"atom-package-deps":
ignored: []
core:
disabledPackages: [
"metrics"
"welcome"
"language-javascript"
"markdown-preview"
]
telemetryConsent: "no"
editor:
fontSize: 13
showIndentGuide: true
"exception-reporting":
userId: "e2c17e7a-6562-482a-b326-cd43e0f43b75"
linter:
disabledProviders: [
"ESLint"
]
"linter-eslint":
disableWhenNoEslintConfig: true
globalNodePath: "/usr/local"
useGlobalEslint: false
"linter-ui-default":
panelHeight: 69
"markdown-preview":
useGitHubStyle: true
"spell-check":
locales: [
"es-ES"
]
tabs:
enableVcsColoring: true
"tree-view":
hideVcsIgnoredFiles: true
welcome:
showOnStartup: false
## Instruction:
Increase font size in Atom
## Code After:
"*":
"atom-beautify":
css:
indent_size: 2
general:
_analyticsUserId: "8bfc3dc2-e55f-4b45-93b6-8b516d108dab"
html:
indent_size: 2
js:
indent_size: 2
"atom-package-deps":
ignored: []
core:
disabledPackages: [
"metrics"
"welcome"
"language-javascript"
"markdown-preview"
]
telemetryConsent: "no"
editor:
showIndentGuide: true
"exception-reporting":
userId: "e2c17e7a-6562-482a-b326-cd43e0f43b75"
linter:
disabledProviders: [
"ESLint"
]
"linter-eslint":
disableWhenNoEslintConfig: true
globalNodePath: "/usr/local"
useGlobalEslint: false
"linter-ui-default":
panelHeight: 69
"markdown-preview":
useGitHubStyle: true
"spell-check":
locales: [
"es-ES"
]
tabs:
enableVcsColoring: true
"tree-view":
hideVcsIgnoredFiles: true
welcome:
showOnStartup: false
|
edeb7a25dc1dd46d8e0bb951970c22b62644960c | _sass/_style.scss | _sass/_style.scss | body {
color: black;
background-color: white;
font-family: monospace;
font-size: 1.3rem;
line-height: 1.3rem;
}
.wrapper {
width: fit-content;
max-width: 640px;
margin: 4rem auto;
padding: 0 1rem;
}
h1 { line-height: 2rem; }
hr {
text-align: center;
border: 0;
&:before { content: '/////' }
&:after { content: attr(data-content) '/////' }
} | body {
color: black;
background-color: white;
font-family: monospace;
font-size: 1.3rem;
line-height: 1.3rem;
}
.wrapper {
width: fit-content;
max-width: 640px;
margin: 4rem auto;
padding: 0 1rem;
}
h1 { line-height: 2rem; }
hr {
text-align: center;
border: 0;
&:before { content: '/////' }
&:after { content: attr(data-content) '/////' }
}
table, th, td {
border: thin solid black;
border-collapse: collapse;
} | Add style for table element | Add style for table element
| SCSS | mit | jashilko/jashilko.github.io,Furkanzmc/furkanzmc.github.io,jashilko/jashilko.github.io,Furkanzmc/furkanzmc.github.io,Furkanzmc/furkanzmc.github.io | scss | ## Code Before:
body {
color: black;
background-color: white;
font-family: monospace;
font-size: 1.3rem;
line-height: 1.3rem;
}
.wrapper {
width: fit-content;
max-width: 640px;
margin: 4rem auto;
padding: 0 1rem;
}
h1 { line-height: 2rem; }
hr {
text-align: center;
border: 0;
&:before { content: '/////' }
&:after { content: attr(data-content) '/////' }
}
## Instruction:
Add style for table element
## Code After:
body {
color: black;
background-color: white;
font-family: monospace;
font-size: 1.3rem;
line-height: 1.3rem;
}
.wrapper {
width: fit-content;
max-width: 640px;
margin: 4rem auto;
padding: 0 1rem;
}
h1 { line-height: 2rem; }
hr {
text-align: center;
border: 0;
&:before { content: '/////' }
&:after { content: attr(data-content) '/////' }
}
table, th, td {
border: thin solid black;
border-collapse: collapse;
} |
85fcc1e8f0f605fe8db43dfb117ec1ec25d788bd | CMakeLists.txt | CMakeLists.txt | project (ndhcp)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
include_directories("${PROJECT_SOURCE_DIR}/ncmlib")
add_subdirectory(ncmlib)
add_subdirectory(ndhc)
| project (ndhcp)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wcast-qual -Wmissing-prototypes -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wcast-qual -Wmissing-prototypes -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
include_directories("${PROJECT_SOURCE_DIR}/ncmlib")
add_subdirectory(ncmlib)
add_subdirectory(ndhc)
| Use stricter gcc warning flags by default. | Use stricter gcc warning flags by default.
| Text | mit | niklata/ndhc | text | ## Code Before:
project (ndhcp)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
include_directories("${PROJECT_SOURCE_DIR}/ncmlib")
add_subdirectory(ncmlib)
add_subdirectory(ndhc)
## Instruction:
Use stricter gcc warning flags by default.
## Code After:
project (ndhcp)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wcast-qual -Wmissing-prototypes -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -s -std=gnu99 -pedantic -Wall -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wcast-qual -Wmissing-prototypes -lrt -lcap -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX")
include_directories("${PROJECT_SOURCE_DIR}/ncmlib")
add_subdirectory(ncmlib)
add_subdirectory(ndhc)
|
1c736a5f48b2deb9732c65a5dec7ea47e542f6f4 | thinc/neural/_classes/resnet.py | thinc/neural/_classes/resnet.py | from .model import Model
from ...api import layerize
from .affine import Affine
class Residual(Model):
def __init__(self, layer):
Model.__init__(self)
self._layers.append(layer)
self.on_data_hooks.append(on_data)
def __call__(self, X):
return X + self._layers[0](X)
def begin_update(self, X, drop=0.):
y, bp_y = self._layers[0].begin_update(X, drop=drop)
output = X+y
def residual_bwd(d_output, sgd=None):
return d_output + bp_y(d_output, sgd)
return output, residual_bwd
def on_data(self, X, y=None):
for layer in self._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
if hasattr(layer, 'W'):
layer.W.fill(0)
| from .model import Model
from ...api import layerize
from .affine import Affine
class Residual(Model):
def __init__(self, layer):
Model.__init__(self)
self._layers.append(layer)
self.on_data_hooks.append(on_data)
def __call__(self, X):
Y = self._layers[0](X)
if isinstance(X, list) or isinstance(X, tuple):
return [X[i]+Y[i] for i in range(len(X))]
else:
return X + Y
def begin_update(self, X, drop=0.):
y, bp_y = self._layers[0].begin_update(X, drop=drop)
if isinstance(X, list) or isinstance(X, tuple):
output = [X[i]+y[i] for i in range(len(X))]
else:
output = X+y
def residual_bwd(d_output, sgd=None):
dX = bp_y(d_output, sgd)
if isinstance(d_output, list) or isinstance(d_output, tuple):
return [d_output[i]+dX[i] for i in range(len(d_output))]
else:
return d_output + dX
return output, residual_bwd
def on_data(self, X, y=None):
for layer in self._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
if hasattr(layer, 'W'):
layer.W.fill(0)
| Make residual connections work for list-valued inputs | Make residual connections work for list-valued inputs
| Python | mit | spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc | python | ## Code Before:
from .model import Model
from ...api import layerize
from .affine import Affine
class Residual(Model):
def __init__(self, layer):
Model.__init__(self)
self._layers.append(layer)
self.on_data_hooks.append(on_data)
def __call__(self, X):
return X + self._layers[0](X)
def begin_update(self, X, drop=0.):
y, bp_y = self._layers[0].begin_update(X, drop=drop)
output = X+y
def residual_bwd(d_output, sgd=None):
return d_output + bp_y(d_output, sgd)
return output, residual_bwd
def on_data(self, X, y=None):
for layer in self._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
if hasattr(layer, 'W'):
layer.W.fill(0)
## Instruction:
Make residual connections work for list-valued inputs
## Code After:
from .model import Model
from ...api import layerize
from .affine import Affine
class Residual(Model):
def __init__(self, layer):
Model.__init__(self)
self._layers.append(layer)
self.on_data_hooks.append(on_data)
def __call__(self, X):
Y = self._layers[0](X)
if isinstance(X, list) or isinstance(X, tuple):
return [X[i]+Y[i] for i in range(len(X))]
else:
return X + Y
def begin_update(self, X, drop=0.):
y, bp_y = self._layers[0].begin_update(X, drop=drop)
if isinstance(X, list) or isinstance(X, tuple):
output = [X[i]+y[i] for i in range(len(X))]
else:
output = X+y
def residual_bwd(d_output, sgd=None):
dX = bp_y(d_output, sgd)
if isinstance(d_output, list) or isinstance(d_output, tuple):
return [d_output[i]+dX[i] for i in range(len(d_output))]
else:
return d_output + dX
return output, residual_bwd
def on_data(self, X, y=None):
for layer in self._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
if hasattr(layer, 'W'):
layer.W.fill(0)
|
215d0dbac3991e52cdadd9db88efd9606b3234cc | src/SoliantConsulting/Apigility/Server/Hydrator/Strategy/Collection.php | src/SoliantConsulting/Apigility/Server/Hydrator/Strategy/Collection.php | <?php
namespace SoliantConsulting\Apigility\Server\Hydrator\Strategy;
use Zend\Stdlib\Hydrator\Strategy\StrategyInterface;
use DoctrineModule\Persistence\ObjectManagerAwareInterface;
use DoctrineModule\Persistence\ProvidesObjectManager;
use DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy;
use ZF\Hal\Collection as HalCollection;
use ZF\Hal\Link\Link;
class Collection extends AbstractCollectionStrategy
implements StrategyInterface, ObjectManagerAwareInterface
{
use ProvidesObjectManager;
public function extract($value)
{
$link = new Link($this->getCollectionName());
return $link;
# $self->setRoute($route);
# $self->setRouteParams($routeParams);
# $resource->getLinks()->add($self, true);
# print_r(get_class_methods($value));
# print_r(($value->count() . ' count'));
#die();
die($this->getCollectionName());
return new HalCollection($this->getObject());
return array(
'_links' => array(
'asdf' => 'fdas',
'asdfasdf' => 'fdasfdas',
),
);
// extract
print_r(get_class($value));
die('extract apigility collection');
}
public function hydrate($value)
{
// hydrate
die('hydrate apigility collection');
}
} | <?php
namespace SoliantConsulting\Apigility\Server\Hydrator\Strategy;
use Zend\Stdlib\Hydrator\Strategy\StrategyInterface;
use DoctrineModule\Persistence\ObjectManagerAwareInterface;
use DoctrineModule\Persistence\ProvidesObjectManager;
use DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy;
use ZF\Hal\Collection as HalCollection;
use ZF\Hal\Link\Link;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
class Collection extends AbstractCollectionStrategy
implements StrategyInterface, ServiceManagerAwareInterface //, ObjectManagerAwareInterface
{
use ProvidesObjectManager;
protected $serviceManager;
public function setServiceManager(ServiceManager $serviceManager)
{
$this->serviceManager = $serviceManager;
return $this;
}
public function getServiceManager()
{
return $this->serviceManager;
}
public function extract($value)
{
$config = $this->getServiceManager()->get('Config');
$config = $config['zf-hal']['metadata_map'][$value->getTypeClass()->name];
$link = new Link($this->getCollectionName());
$link->setRoute($config['route_name']);
$link->setRouteParams(array('id' => null));
$mapping = $value->getMapping();
$link->setRouteOptions(array(
'query' => array(
'query' => array(
array('field' =>$mapping['mappedBy'], 'type'=>'eq', 'value' => $value->getOwner()->getId()),
),
),
));
return $link;
}
public function hydrate($value)
{
// hydrate
die('hydrate apigility collection');
}
} | Return a Link for collection fields | Return a Link for collection fields
| PHP | bsd-3-clause | TomHAnderson/zf-doctrine-querybuilder,kusmierz/zf-apigility-doctrine,kusmierz/zf-apigility-doctrine,TomHAnderson/zf-doctrine-querybuilder | php | ## Code Before:
<?php
namespace SoliantConsulting\Apigility\Server\Hydrator\Strategy;
use Zend\Stdlib\Hydrator\Strategy\StrategyInterface;
use DoctrineModule\Persistence\ObjectManagerAwareInterface;
use DoctrineModule\Persistence\ProvidesObjectManager;
use DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy;
use ZF\Hal\Collection as HalCollection;
use ZF\Hal\Link\Link;
class Collection extends AbstractCollectionStrategy
implements StrategyInterface, ObjectManagerAwareInterface
{
use ProvidesObjectManager;
public function extract($value)
{
$link = new Link($this->getCollectionName());
return $link;
# $self->setRoute($route);
# $self->setRouteParams($routeParams);
# $resource->getLinks()->add($self, true);
# print_r(get_class_methods($value));
# print_r(($value->count() . ' count'));
#die();
die($this->getCollectionName());
return new HalCollection($this->getObject());
return array(
'_links' => array(
'asdf' => 'fdas',
'asdfasdf' => 'fdasfdas',
),
);
// extract
print_r(get_class($value));
die('extract apigility collection');
}
public function hydrate($value)
{
// hydrate
die('hydrate apigility collection');
}
}
## Instruction:
Return a Link for collection fields
## Code After:
<?php
namespace SoliantConsulting\Apigility\Server\Hydrator\Strategy;
use Zend\Stdlib\Hydrator\Strategy\StrategyInterface;
use DoctrineModule\Persistence\ObjectManagerAwareInterface;
use DoctrineModule\Persistence\ProvidesObjectManager;
use DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy;
use ZF\Hal\Collection as HalCollection;
use ZF\Hal\Link\Link;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
class Collection extends AbstractCollectionStrategy
implements StrategyInterface, ServiceManagerAwareInterface //, ObjectManagerAwareInterface
{
use ProvidesObjectManager;
protected $serviceManager;
public function setServiceManager(ServiceManager $serviceManager)
{
$this->serviceManager = $serviceManager;
return $this;
}
public function getServiceManager()
{
return $this->serviceManager;
}
public function extract($value)
{
$config = $this->getServiceManager()->get('Config');
$config = $config['zf-hal']['metadata_map'][$value->getTypeClass()->name];
$link = new Link($this->getCollectionName());
$link->setRoute($config['route_name']);
$link->setRouteParams(array('id' => null));
$mapping = $value->getMapping();
$link->setRouteOptions(array(
'query' => array(
'query' => array(
array('field' =>$mapping['mappedBy'], 'type'=>'eq', 'value' => $value->getOwner()->getId()),
),
),
));
return $link;
}
public function hydrate($value)
{
// hydrate
die('hydrate apigility collection');
}
} |
c66b64b5d01381c7ca24a8eaaa958915def5067a | pytest.ini | pytest.ini | [pytest]
addopts = --ignore docs/apply_geometry.ipynb --ignore docs/xpd_examples.ipynb --ignore "docs/agipd_geometry.ipynb" --ignore docs/xgm_two_runs.ipynb
| [pytest]
addopts = --ignore docs/apply_geometry.ipynb --ignore docs/xpd_examples.ipynb --ignore "docs/agipd_geometry.ipynb" --ignore docs/xgm_two_runs.ipynb --ignore docs/parallel_example.ipynb
| Add parallel_example notebook to ignore list for nbval | Add parallel_example notebook to ignore list for nbval
| INI | bsd-3-clause | European-XFEL/h5tools-py | ini | ## Code Before:
[pytest]
addopts = --ignore docs/apply_geometry.ipynb --ignore docs/xpd_examples.ipynb --ignore "docs/agipd_geometry.ipynb" --ignore docs/xgm_two_runs.ipynb
## Instruction:
Add parallel_example notebook to ignore list for nbval
## Code After:
[pytest]
addopts = --ignore docs/apply_geometry.ipynb --ignore docs/xpd_examples.ipynb --ignore "docs/agipd_geometry.ipynb" --ignore docs/xgm_two_runs.ipynb --ignore docs/parallel_example.ipynb
|
942ab52d0d1dd31a3c240c48154f185dca50ee20 | app/models/channel_observer.rb | app/models/channel_observer.rb | class ChannelObserver < ActiveRecord::Observer
def after_destroy(channel)
broadcast_data = {
:event => "channel#delete",
:entity => channel.attributes,
:extra => {}
}
Kandan::Config.broadcaster.broadcast("/app/activities", broadcast_data)
end
end
| class ChannelObserver < ActiveRecord::Observer
def after_destroy(channel)
broadcast('delete', channel)
end
def after_create(channel)
broadcast('create', channel)
end
private
def broadcast(event, channel)
data = {
:event => "channel#" << event,
:entity => channel.attributes,
:extra => {}
}
Kandan::Config.broadcaster.broadcast("/app/activities", data)
end
end
| Send application activity for channel creation as well as deletion. | Send application activity for channel creation as well as deletion.
| Ruby | agpl-3.0 | ivanoats/uw-ruby-chat,leohmoraes/kandan,sai43/kandan,yfix/kandan,ivanoats/kandan,moss-zc/kandan,cloudstead/kandan,kandanapp/kandan,yfix/kandan,ipmobiletech/kandan,codefellows/kandan,sai43/kandan,codefellows/kandan,ipmobiletech/kandan,codefellows/kandan,leohmoraes/kandan,moss-zc/kandan,yfix/kandan,ych06/kandan,miurahr/kandan,miurahr/kandan,miurahr/kandan,kandanapp/kandan,ivanoats/kandan,ych06/kandan,sai43/kandan,Stackato-Apps/kandan,ych06/kandan,dz0ny/kandan,Stackato-Apps/kandan,leohmoraes/kandan,moss-zc/kandan,yfix/kandan,sai43/kandan,cloudstead/kandan,Stackato-Apps/kandan,ivanoats/uw-ruby-chat,ipmobiletech/kandan,ivanoats/kandan,moss-zc/kandan,kandanapp/kandan,ych06/kandan,miurahr/kandan,dz0ny/kandan,kandanapp/kandan,dz0ny/kandan,cloudstead/kandan,ipmobiletech/kandan,Stackato-Apps/kandan,leohmoraes/kandan,cloudstead/kandan | ruby | ## Code Before:
class ChannelObserver < ActiveRecord::Observer
def after_destroy(channel)
broadcast_data = {
:event => "channel#delete",
:entity => channel.attributes,
:extra => {}
}
Kandan::Config.broadcaster.broadcast("/app/activities", broadcast_data)
end
end
## Instruction:
Send application activity for channel creation as well as deletion.
## Code After:
class ChannelObserver < ActiveRecord::Observer
def after_destroy(channel)
broadcast('delete', channel)
end
def after_create(channel)
broadcast('create', channel)
end
private
def broadcast(event, channel)
data = {
:event => "channel#" << event,
:entity => channel.attributes,
:extra => {}
}
Kandan::Config.broadcaster.broadcast("/app/activities", data)
end
end
|
dc6e9feda519e614df26c294686d61ce7448a7f0 | extension/background-fetch.js | extension/background-fetch.js | // /////////////////////////////////////////////////////// //
// Load content via window.fetch in a background script, //
// from a content script //
// /////////////////////////////////////////////////////// //
// Load this file as background and content scripts
// Use in content_script as:
// backgroundFetch(url).then(doSomething)
if (location.protocol === 'chrome-extension:' || location.protocol === 'moz-extension:') {
// setup in background page
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === 'fetch') {
fetch(...message.arguments)
.then(response => response.json())
.then(sendResponse)
.catch(err => sendResponse(String(err)));
}
return true; // tell browser to await response
});
} else {
// setup in content script
window.backgroundFetch = function () {
const args = [...arguments];
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({
action: 'fetch',
arguments: args
}, response => {
if (/^Error/.test(response)) {
reject(new Error(response.replace(/Error:? ?/, '')));
} else {
resolve(response);
}
});
});
};
}
| // /////////////////////////////////////////////////////// //
// Load content via window.fetch in a background script, //
// from a content script //
// /////////////////////////////////////////////////////// //
// Load this file as background and content scripts
// Use in content_script as:
// backgroundFetch(url).then(doSomething)
if (location.protocol === 'chrome-extension:' || location.protocol === 'moz-extension:') {
// setup in background page
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === 'fetch') {
fetch(...message.arguments)
.then(response => response.json())
.then(sendResponse)
.catch(err => sendResponse(String(err)));
}
return true; // tell browser to await response
});
} else {
// setup in content script
window.backgroundFetch = function (...args) {
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({
action: 'fetch',
arguments: args
}, response => {
if (/^Error/.test(response)) {
reject(new Error(response.replace(/Error:? ?/, '')));
} else {
resolve(response);
}
});
});
};
}
| Remove a redundant line in background page | Remove a redundant line in background page | JavaScript | mit | npmhub/npmhub,npmhub/npmhub,npmhub/npmhub | javascript | ## Code Before:
// /////////////////////////////////////////////////////// //
// Load content via window.fetch in a background script, //
// from a content script //
// /////////////////////////////////////////////////////// //
// Load this file as background and content scripts
// Use in content_script as:
// backgroundFetch(url).then(doSomething)
if (location.protocol === 'chrome-extension:' || location.protocol === 'moz-extension:') {
// setup in background page
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === 'fetch') {
fetch(...message.arguments)
.then(response => response.json())
.then(sendResponse)
.catch(err => sendResponse(String(err)));
}
return true; // tell browser to await response
});
} else {
// setup in content script
window.backgroundFetch = function () {
const args = [...arguments];
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({
action: 'fetch',
arguments: args
}, response => {
if (/^Error/.test(response)) {
reject(new Error(response.replace(/Error:? ?/, '')));
} else {
resolve(response);
}
});
});
};
}
## Instruction:
Remove a redundant line in background page
## Code After:
// /////////////////////////////////////////////////////// //
// Load content via window.fetch in a background script, //
// from a content script //
// /////////////////////////////////////////////////////// //
// Load this file as background and content scripts
// Use in content_script as:
// backgroundFetch(url).then(doSomething)
if (location.protocol === 'chrome-extension:' || location.protocol === 'moz-extension:') {
// setup in background page
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === 'fetch') {
fetch(...message.arguments)
.then(response => response.json())
.then(sendResponse)
.catch(err => sendResponse(String(err)));
}
return true; // tell browser to await response
});
} else {
// setup in content script
window.backgroundFetch = function (...args) {
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({
action: 'fetch',
arguments: args
}, response => {
if (/^Error/.test(response)) {
reject(new Error(response.replace(/Error:? ?/, '')));
} else {
resolve(response);
}
});
});
};
}
|
8c94ecea3865bfd129ae3e5cf5dc929b40caa493 | web/src/js/ads/mockDisplayAd.js | web/src/js/ads/mockDisplayAd.js |
export default function (adId) {
var mockNetworkDelayMs = 0
const useMockDelay = false
if (useMockDelay) {
mockNetworkDelayMs = Math.random() * (1500 - 900) + 900
}
// Mock returning an ad.
setTimeout(() => {
const elem = document.getElementById(adId)
if (!elem) {
return
}
elem.setAttribute('style', `
color: white;
background: repeating-linear-gradient(
-55deg,
#222,
#222 20px,
#333 20px,
#333 40px
);
width: 100%;
height: 100%;
`)
}, mockNetworkDelayMs)
}
|
import {
VERTICAL_AD_SLOT_DOM_ID,
SECOND_VERTICAL_AD_SLOT_DOM_ID,
HORIZONTAL_AD_SLOT_DOM_ID
} from 'js/ads/adSettings'
export default function (adId) {
var mockNetworkDelayMs = 0
const useMockDelay = false
if (useMockDelay) {
mockNetworkDelayMs = Math.random() * (1500 - 900) + 900
}
const mapDOMIdToHeight = {
[VERTICAL_AD_SLOT_DOM_ID]: 250,
[SECOND_VERTICAL_AD_SLOT_DOM_ID]: 250,
[HORIZONTAL_AD_SLOT_DOM_ID]: 90
}
const height = mapDOMIdToHeight[adId]
// Mock returning an ad.
setTimeout(() => {
const elem = document.getElementById(adId)
if (!elem) {
return
}
elem.setAttribute('style', `
color: white;
background: repeating-linear-gradient(
-55deg,
#222,
#222 20px,
#333 20px,
#333 40px
);
width: 100%;
height: ${height}px;
`)
}, mockNetworkDelayMs)
}
| Fix mock ads for development | Fix mock ads for development
| JavaScript | mpl-2.0 | gladly-team/tab,gladly-team/tab,gladly-team/tab | javascript | ## Code Before:
export default function (adId) {
var mockNetworkDelayMs = 0
const useMockDelay = false
if (useMockDelay) {
mockNetworkDelayMs = Math.random() * (1500 - 900) + 900
}
// Mock returning an ad.
setTimeout(() => {
const elem = document.getElementById(adId)
if (!elem) {
return
}
elem.setAttribute('style', `
color: white;
background: repeating-linear-gradient(
-55deg,
#222,
#222 20px,
#333 20px,
#333 40px
);
width: 100%;
height: 100%;
`)
}, mockNetworkDelayMs)
}
## Instruction:
Fix mock ads for development
## Code After:
import {
VERTICAL_AD_SLOT_DOM_ID,
SECOND_VERTICAL_AD_SLOT_DOM_ID,
HORIZONTAL_AD_SLOT_DOM_ID
} from 'js/ads/adSettings'
export default function (adId) {
var mockNetworkDelayMs = 0
const useMockDelay = false
if (useMockDelay) {
mockNetworkDelayMs = Math.random() * (1500 - 900) + 900
}
const mapDOMIdToHeight = {
[VERTICAL_AD_SLOT_DOM_ID]: 250,
[SECOND_VERTICAL_AD_SLOT_DOM_ID]: 250,
[HORIZONTAL_AD_SLOT_DOM_ID]: 90
}
const height = mapDOMIdToHeight[adId]
// Mock returning an ad.
setTimeout(() => {
const elem = document.getElementById(adId)
if (!elem) {
return
}
elem.setAttribute('style', `
color: white;
background: repeating-linear-gradient(
-55deg,
#222,
#222 20px,
#333 20px,
#333 40px
);
width: 100%;
height: ${height}px;
`)
}, mockNetworkDelayMs)
}
|
19aefc5c30c24b5b9d0008be767cab910fb249cf | src/components/posts/regions/ImageRegion.js | src/components/posts/regions/ImageRegion.js | import React from 'react'
class ImageRegion extends React.Component {
renderAttachment() {
const { content } = this.props
let size = 'optimized'
if (!this.attachment[size].metadata.type.match('gif')) {
size = window.innerWidth > 375 ? 'hdpi' : 'mdpi'
}
return (
<img className="ImageRegion"
alt={content.alt}
height={this.attachment[size].metadata.height}
src={this.attachment[size].url}
width={this.attachment[size].metadata.width} />
)
}
renderContent() {
const { content } = this.props
return (
<img className="ImageRegion"
alt={content.alt}
src={content.url} />
)
}
render() {
const { assets, links } = this.props
if (links && links.assets && assets[links.assets] && assets[links.assets].attachment) {
this.attachment = assets[links.assets].attachment
return this.renderAttachment()
}
return this.renderContent()
}
}
ImageRegion.propTypes = {
assets: React.PropTypes.object.isRequired,
content: React.PropTypes.object.isRequired,
links: React.PropTypes.object,
}
export default ImageRegion
| import React from 'react'
class ImageRegion extends React.Component {
isGif() {
const optimized = this.attachment.optimized
if (optimized && optimized.metadata) {
return optimized.metadata.type === 'image/gif'
}
return false
}
renderAttachment() {
const { content } = this.props
let size = 'optimized'
if (!this.isGif()) {
size = window.innerWidth > 375 ? 'hdpi' : 'mdpi'
}
return (
<img className="ImageRegion"
alt={content.alt}
height={this.attachment[size].metadata.height}
src={this.attachment[size].url}
width={this.attachment[size].metadata.width} />
)
}
renderContent() {
const { content } = this.props
return (
<img className="ImageRegion"
alt={content.alt}
src={content.url} />
)
}
render() {
const { assets, links } = this.props
if (links && links.assets && assets[links.assets] && assets[links.assets].attachment) {
this.attachment = assets[links.assets].attachment
return this.renderAttachment()
}
return this.renderContent()
}
}
ImageRegion.propTypes = {
assets: React.PropTypes.object.isRequired,
content: React.PropTypes.object.isRequired,
links: React.PropTypes.object,
}
export default ImageRegion
| Change how we detect gifs for production data. | Change how we detect gifs for production data. | JavaScript | mit | ello/webapp,ello/webapp,ello/webapp | javascript | ## Code Before:
import React from 'react'
class ImageRegion extends React.Component {
renderAttachment() {
const { content } = this.props
let size = 'optimized'
if (!this.attachment[size].metadata.type.match('gif')) {
size = window.innerWidth > 375 ? 'hdpi' : 'mdpi'
}
return (
<img className="ImageRegion"
alt={content.alt}
height={this.attachment[size].metadata.height}
src={this.attachment[size].url}
width={this.attachment[size].metadata.width} />
)
}
renderContent() {
const { content } = this.props
return (
<img className="ImageRegion"
alt={content.alt}
src={content.url} />
)
}
render() {
const { assets, links } = this.props
if (links && links.assets && assets[links.assets] && assets[links.assets].attachment) {
this.attachment = assets[links.assets].attachment
return this.renderAttachment()
}
return this.renderContent()
}
}
ImageRegion.propTypes = {
assets: React.PropTypes.object.isRequired,
content: React.PropTypes.object.isRequired,
links: React.PropTypes.object,
}
export default ImageRegion
## Instruction:
Change how we detect gifs for production data.
## Code After:
import React from 'react'
class ImageRegion extends React.Component {
isGif() {
const optimized = this.attachment.optimized
if (optimized && optimized.metadata) {
return optimized.metadata.type === 'image/gif'
}
return false
}
renderAttachment() {
const { content } = this.props
let size = 'optimized'
if (!this.isGif()) {
size = window.innerWidth > 375 ? 'hdpi' : 'mdpi'
}
return (
<img className="ImageRegion"
alt={content.alt}
height={this.attachment[size].metadata.height}
src={this.attachment[size].url}
width={this.attachment[size].metadata.width} />
)
}
renderContent() {
const { content } = this.props
return (
<img className="ImageRegion"
alt={content.alt}
src={content.url} />
)
}
render() {
const { assets, links } = this.props
if (links && links.assets && assets[links.assets] && assets[links.assets].attachment) {
this.attachment = assets[links.assets].attachment
return this.renderAttachment()
}
return this.renderContent()
}
}
ImageRegion.propTypes = {
assets: React.PropTypes.object.isRequired,
content: React.PropTypes.object.isRequired,
links: React.PropTypes.object,
}
export default ImageRegion
|
8ec1e6c6df8a8f2c2ba53545f7ce5e3cbecfbf01 | src/app/units/states/tasks/inbox/inbox.tpl.html | src/app/units/states/tasks/inbox/inbox.tpl.html | <div class="inbox-panel-full-screen">
<staff-task-list
ng-if="taskData"
[show-search-options]="showSearchOptions"
[filters]="filters"
[task-data]="taskData"
[unit]="unit"
[unit-role]="unitRole"
>
</staff-task-list>
<task-dashboard
style="flex-grow: 3; margin-right: 10px; margin-left: 10px"
task="taskData.selectedTask"
show-footer="true"
show-submission="true"
>
</task-dashboard>
<task-comments-viewer
style="min-width: 300px; flex-grow: 1"
[task]="taskData.selectedTask"
[project]="taskData.selectedTask.project()"
>
</task-comments-viewer>
</div>
| <div class="inbox-panel-full-screen">
<staff-task-list
ng-if="taskData"
[show-search-options]="showSearchOptions"
[filters]="filters"
[task-data]="taskData"
[unit]="unit"
[unit-role]="unitRole"
>
</staff-task-list>
<task-dashboard
style="flex-grow: 3; margin-right: 10px; margin-left: 10px"
task="taskData.selectedTask"
show-footer="true"
show-submission="true"
>
</task-dashboard>
<task-comments-viewer
style="min-width: 300px; flex-grow: 1; max-width: 400px"
[task]="taskData.selectedTask"
[project]="taskData.selectedTask.project()"
>
</task-comments-viewer>
</div>
| Set max-width of inbox task comment viewer | LOOKS: Set max-width of inbox task comment viewer
| HTML | agpl-3.0 | doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web | html | ## Code Before:
<div class="inbox-panel-full-screen">
<staff-task-list
ng-if="taskData"
[show-search-options]="showSearchOptions"
[filters]="filters"
[task-data]="taskData"
[unit]="unit"
[unit-role]="unitRole"
>
</staff-task-list>
<task-dashboard
style="flex-grow: 3; margin-right: 10px; margin-left: 10px"
task="taskData.selectedTask"
show-footer="true"
show-submission="true"
>
</task-dashboard>
<task-comments-viewer
style="min-width: 300px; flex-grow: 1"
[task]="taskData.selectedTask"
[project]="taskData.selectedTask.project()"
>
</task-comments-viewer>
</div>
## Instruction:
LOOKS: Set max-width of inbox task comment viewer
## Code After:
<div class="inbox-panel-full-screen">
<staff-task-list
ng-if="taskData"
[show-search-options]="showSearchOptions"
[filters]="filters"
[task-data]="taskData"
[unit]="unit"
[unit-role]="unitRole"
>
</staff-task-list>
<task-dashboard
style="flex-grow: 3; margin-right: 10px; margin-left: 10px"
task="taskData.selectedTask"
show-footer="true"
show-submission="true"
>
</task-dashboard>
<task-comments-viewer
style="min-width: 300px; flex-grow: 1; max-width: 400px"
[task]="taskData.selectedTask"
[project]="taskData.selectedTask.project()"
>
</task-comments-viewer>
</div>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.