commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c101f7583fdc041f8c88892ee57935d63906ebe | _snippets/splice-amd-crud-into-mainline.sh | _snippets/splice-amd-crud-into-mainline.sh |
branch=alex/amd-staging-drm-next
delta=(drivers/gpu/drm include/drm include/uapi/drm/amdgpu_drm.h)
affect_change=false
echo "Operating in: $PWD"
for i in ${delta[*]}; do
if $affect_change; then
rm -rf $i
git checkout $branch -- $i
git add $i
else
echo "Would be removing, checking out and then adding: $i"
fi
done
|
branch=alex/amd-staging-drm-next
delta=(include/uapi/drm/drm_fourcc.h include/uapi/drm/drm_mode.h drivers/dma-buf/reservation.c include/linux/reservation.h drivers/gpu/drm include/drm include/uapi/drm/amdgpu_drm.h)
affect_change=false
echo "Operating in: $PWD"
for i in ${delta[*]}; do
if $affect_change; then
rm -rf $i
git checkout $branch -- $i
git add $i
else
echo "Would be removing, checking out and then adding: $i"
fi
done
| Improve script to include additional changed files | Improve script to include additional changed files
| Shell | mit | sirspudd/sirspudd.github.io | shell | ## Code Before:
branch=alex/amd-staging-drm-next
delta=(drivers/gpu/drm include/drm include/uapi/drm/amdgpu_drm.h)
affect_change=false
echo "Operating in: $PWD"
for i in ${delta[*]}; do
if $affect_change; then
rm -rf $i
git checkout $branch -- $i
git add $i
else
echo "Would be removing, checking out and then adding: $i"
fi
done
## Instruction:
Improve script to include additional changed files
## Code After:
branch=alex/amd-staging-drm-next
delta=(include/uapi/drm/drm_fourcc.h include/uapi/drm/drm_mode.h drivers/dma-buf/reservation.c include/linux/reservation.h drivers/gpu/drm include/drm include/uapi/drm/amdgpu_drm.h)
affect_change=false
echo "Operating in: $PWD"
for i in ${delta[*]}; do
if $affect_change; then
rm -rf $i
git checkout $branch -- $i
git add $i
else
echo "Would be removing, checking out and then adding: $i"
fi
done
|
branch=alex/amd-staging-drm-next
- delta=(drivers/gpu/drm include/drm include/uapi/drm/amdgpu_drm.h)
+ delta=(include/uapi/drm/drm_fourcc.h include/uapi/drm/drm_mode.h drivers/dma-buf/reservation.c include/linux/reservation.h drivers/gpu/drm include/drm include/uapi/drm/amdgpu_drm.h)
affect_change=false
echo "Operating in: $PWD"
for i in ${delta[*]}; do
if $affect_change; then
rm -rf $i
git checkout $branch -- $i
git add $i
else
echo "Would be removing, checking out and then adding: $i"
fi
done | 2 | 0.133333 | 1 | 1 |
dbabf4b7e4fd4765bf3d75e05f9e2725dd87bab9 | src/resources-packaged/xbl/orbeon/tinymce/tinymce-config.js | src/resources-packaged/xbl/orbeon/tinymce/tinymce-config.js | YAHOO.xbl.fr.Tinymce.DefaultConfig = {
mode: "exact",
language: "en",
theme: "advanced",
skin: "thebigreason",
plugins: "spellchecker,style,table,save,iespell,preview,media,searchreplace,print,contextmenu,paste,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "formatselect,bold,italic,|,bullist,numlist,|,outdent,indent,|,undo,redo",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
gecko_spellcheck: true,
doctype: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
encoding: "xml",
entity_encoding: "raw",
forced_root_block: 'div',
remove_redundant_brs: true,
verify_html: true
}; | YAHOO.xbl.fr.Tinymce.DefaultConfig = {
mode: "exact",
language: "en",
theme: "advanced",
skin: "thebigreason",
plugins: "spellchecker,style,table,save,iespell,preview,media,searchreplace,print,paste,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "formatselect,bold,italic,|,bullist,numlist,|,outdent,indent,|,undo,redo",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
gecko_spellcheck: true,
doctype: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
encoding: "xml",
entity_encoding: "raw",
forced_root_block: 'div',
remove_redundant_brs: true,
verify_html: true
}; | Disable contextual menu (not very useful, exposes features we don't want to expose) | Disable contextual menu (not very useful, exposes features we don't want to expose)
| JavaScript | lgpl-2.1 | brunobuzzi/orbeon-forms,evlist/orbeon-forms,martinluther/orbeon-forms,evlist/orbeon-forms,orbeon/orbeon-forms,orbeon/orbeon-forms,tanbo800/orbeon-forms,joansmith/orbeon-forms,ajw625/orbeon-forms,evlist/orbeon-forms,orbeon/orbeon-forms,ajw625/orbeon-forms,evlist/orbeon-forms,joansmith/orbeon-forms,brunobuzzi/orbeon-forms,tanbo800/orbeon-forms,wesley1001/orbeon-forms,tanbo800/orbeon-forms,wesley1001/orbeon-forms,joansmith/orbeon-forms,joansmith/orbeon-forms,wesley1001/orbeon-forms,ajw625/orbeon-forms,martinluther/orbeon-forms,wesley1001/orbeon-forms,martinluther/orbeon-forms,ajw625/orbeon-forms,brunobuzzi/orbeon-forms,evlist/orbeon-forms,tanbo800/orbeon-forms,martinluther/orbeon-forms,brunobuzzi/orbeon-forms,orbeon/orbeon-forms | javascript | ## Code Before:
YAHOO.xbl.fr.Tinymce.DefaultConfig = {
mode: "exact",
language: "en",
theme: "advanced",
skin: "thebigreason",
plugins: "spellchecker,style,table,save,iespell,preview,media,searchreplace,print,contextmenu,paste,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "formatselect,bold,italic,|,bullist,numlist,|,outdent,indent,|,undo,redo",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
gecko_spellcheck: true,
doctype: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
encoding: "xml",
entity_encoding: "raw",
forced_root_block: 'div',
remove_redundant_brs: true,
verify_html: true
};
## Instruction:
Disable contextual menu (not very useful, exposes features we don't want to expose)
## Code After:
YAHOO.xbl.fr.Tinymce.DefaultConfig = {
mode: "exact",
language: "en",
theme: "advanced",
skin: "thebigreason",
plugins: "spellchecker,style,table,save,iespell,preview,media,searchreplace,print,paste,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "formatselect,bold,italic,|,bullist,numlist,|,outdent,indent,|,undo,redo",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
gecko_spellcheck: true,
doctype: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
encoding: "xml",
entity_encoding: "raw",
forced_root_block: 'div',
remove_redundant_brs: true,
verify_html: true
}; | YAHOO.xbl.fr.Tinymce.DefaultConfig = {
mode: "exact",
language: "en",
theme: "advanced",
skin: "thebigreason",
- plugins: "spellchecker,style,table,save,iespell,preview,media,searchreplace,print,contextmenu,paste,visualchars,nonbreaking,xhtmlxtras,template",
? ------------
+ plugins: "spellchecker,style,table,save,iespell,preview,media,searchreplace,print,paste,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "formatselect,bold,italic,|,bullist,numlist,|,outdent,indent,|,undo,redo",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
gecko_spellcheck: true,
doctype: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
encoding: "xml",
entity_encoding: "raw",
forced_root_block: 'div',
remove_redundant_brs: true,
verify_html: true
}; | 2 | 0.090909 | 1 | 1 |
be6478a1a94eebe865af0cef96a46a803a76ea0e | .travis.yml | .travis.yml | language: ruby
rvm:
- "2.2.6"
- "2.3.3"
- "2.4.0"
before_install: gem update --system
script:
- bundle exec rake
- bundle exec rubocop
| language: ruby
rvm:
- "2.1.10"
- "2.2.6"
- "2.3.3"
- "2.4.0"
before_install: gem update --system
script:
- bundle exec rake
- bundle exec rubocop
# This is because coveralls doesn't yet support
# Ruby 2.4.0
# https://github.com/lemurheavy/coveralls-ruby/pull/117/files
matrix:
allow_failures:
- rvm: 2.4.0
| Allow build-failures on 2.4.0 for now | [ci] Allow build-failures on 2.4.0 for now
| YAML | mit | razorpay/razorpay-ruby | yaml | ## Code Before:
language: ruby
rvm:
- "2.2.6"
- "2.3.3"
- "2.4.0"
before_install: gem update --system
script:
- bundle exec rake
- bundle exec rubocop
## Instruction:
[ci] Allow build-failures on 2.4.0 for now
## Code After:
language: ruby
rvm:
- "2.1.10"
- "2.2.6"
- "2.3.3"
- "2.4.0"
before_install: gem update --system
script:
- bundle exec rake
- bundle exec rubocop
# This is because coveralls doesn't yet support
# Ruby 2.4.0
# https://github.com/lemurheavy/coveralls-ruby/pull/117/files
matrix:
allow_failures:
- rvm: 2.4.0
| language: ruby
rvm:
+ - "2.1.10"
- "2.2.6"
- "2.3.3"
- "2.4.0"
before_install: gem update --system
script:
- bundle exec rake
- bundle exec rubocop
+ # This is because coveralls doesn't yet support
+ # Ruby 2.4.0
+ # https://github.com/lemurheavy/coveralls-ruby/pull/117/files
+ matrix:
+ allow_failures:
+ - rvm: 2.4.0
+ | 8 | 0.888889 | 8 | 0 |
4c835203b2e41aa8b7c61c9e1daaf9a6c4bfb6eb | Mac/mwerks/mwerks_plugin_config.h | Mac/mwerks/mwerks_plugin_config.h | /*
** Config file for dynamically-loaded ppc/cfm68k plugin modules.
*/
/* #define USE_GUSI1 /* Stdio implemented with GUSI */
#define USE_GUSI2 /* Stdio implemented with GUSI */
#define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */
#define USE_MSL /* Use MSL libraries */
#ifdef USE_MSL
#define MSL_USE_PRECOMPILED_HEADERS 0 /* Don't use precomp headers: we include our own */
#include <ansi_prefix.mac.h>
#endif
| /*
** Config file for dynamically-loaded ppc/cfm68k plugin modules.
*/
/* #define USE_GUSI1 /* Stdio implemented with GUSI */
#define USE_GUSI2 /* Stdio implemented with GUSI */
#if defined(USE_GUSI1) || defined(USE_GUSI2)
#define USE_GUSI
#endif
#define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */
#define USE_MSL /* Use MSL libraries */
#ifdef USE_MSL
#define MSL_USE_PRECOMPILED_HEADERS 0 /* Don't use precomp headers: we include our own */
#include <ansi_prefix.mac.h>
#endif
| Define USE_GUSI if USE_GUSI1 or USE_GUSI2 is defined. | Define USE_GUSI if USE_GUSI1 or USE_GUSI2 is defined.
| C | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | c | ## Code Before:
/*
** Config file for dynamically-loaded ppc/cfm68k plugin modules.
*/
/* #define USE_GUSI1 /* Stdio implemented with GUSI */
#define USE_GUSI2 /* Stdio implemented with GUSI */
#define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */
#define USE_MSL /* Use MSL libraries */
#ifdef USE_MSL
#define MSL_USE_PRECOMPILED_HEADERS 0 /* Don't use precomp headers: we include our own */
#include <ansi_prefix.mac.h>
#endif
## Instruction:
Define USE_GUSI if USE_GUSI1 or USE_GUSI2 is defined.
## Code After:
/*
** Config file for dynamically-loaded ppc/cfm68k plugin modules.
*/
/* #define USE_GUSI1 /* Stdio implemented with GUSI */
#define USE_GUSI2 /* Stdio implemented with GUSI */
#if defined(USE_GUSI1) || defined(USE_GUSI2)
#define USE_GUSI
#endif
#define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */
#define USE_MSL /* Use MSL libraries */
#ifdef USE_MSL
#define MSL_USE_PRECOMPILED_HEADERS 0 /* Don't use precomp headers: we include our own */
#include <ansi_prefix.mac.h>
#endif
| /*
** Config file for dynamically-loaded ppc/cfm68k plugin modules.
*/
/* #define USE_GUSI1 /* Stdio implemented with GUSI */
#define USE_GUSI2 /* Stdio implemented with GUSI */
+ #if defined(USE_GUSI1) || defined(USE_GUSI2)
+ #define USE_GUSI
+ #endif
#define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */
#define USE_MSL /* Use MSL libraries */
#ifdef USE_MSL
#define MSL_USE_PRECOMPILED_HEADERS 0 /* Don't use precomp headers: we include our own */
#include <ansi_prefix.mac.h>
#endif | 3 | 0.25 | 3 | 0 |
aca70ddb6972a27dd52bc9f51d4f864b3d08ad64 | src/ventus/tpl/window.tpl | src/ventus/tpl/window.tpl | <div class="wm-window {{classname}}" >
<div class="wm-window-border top wm-resize"></div>
<div class="wm-container">
<div class="wm-window-border left wm-resize"></div>
<div class="wm-window-box">
<header class="wm-window-title" unselectable="on">
{{#renderImg}}
<img src="{{imgUrl}}" width=16 height=16/>
{{/renderImg}}
<h1 unselectable="on"><span class="wm-window-title-text">{{title}}</span></h1>
<div class="wm-button-group">
{{#minimize}}
<button class="wm-minimize"> </button>
{{/minimize}}
<button class="wm-maximize"> </button>
<button class="wm-close"> </button>
{{#detach}}
<button class="wm-detach"> </button>
{{/detach}}
</div>
</header>
<section class="wm-content"></section>
<button class="wm-resize top-right"> </button>
<button class="wm-resize top-left"> </button>
<button class="wm-resize bottom-left"> </button>
<button class="wm-resize bottom-right"> </button>
</div>
<div class="wm-window-border right wm-resize"></div>
</div>
<div class="wm-window-border bottom wm-resize"></div>
<div class="wm-window-overlay"></div>
</div>
| <div class="wm-window {{classname}}" >
<div class="wm-window-border top wm-resize"></div>
<div class="wm-container">
<div class="wm-window-border left wm-resize"></div>
<div class="wm-window-box">
<header class="wm-window-title" unselectable="on">
{{#renderImg}}
<img src="{{imgUrl}}" width=16 height=16/>
{{/renderImg}}
<h1 unselectable="on"><span class="wm-window-title-text">{{title}}</span></h1>
<div class="wm-button-group">
{{#minimize}}
<button class="wm-minimize"> </button>
{{/minimize}}
<button class="wm-maximize"> </button>
{{#detach}}
<button class="wm-detach"> </button>
{{/detach}}
<button class="wm-close"> </button>
</div>
</header>
<section class="wm-content"></section>
<button class="wm-resize top-right"> </button>
<button class="wm-resize top-left"> </button>
<button class="wm-resize bottom-left"> </button>
<button class="wm-resize bottom-right"> </button>
</div>
<div class="wm-window-border right wm-resize"></div>
</div>
<div class="wm-window-border bottom wm-resize"></div>
<div class="wm-window-overlay"></div>
</div>
| Move detach button between maximize and close. | Move detach button between maximize and close.
[VDI-3230]
| Smarty | mit | eyeos2/Ventus,eyeos2/Ventus | smarty | ## Code Before:
<div class="wm-window {{classname}}" >
<div class="wm-window-border top wm-resize"></div>
<div class="wm-container">
<div class="wm-window-border left wm-resize"></div>
<div class="wm-window-box">
<header class="wm-window-title" unselectable="on">
{{#renderImg}}
<img src="{{imgUrl}}" width=16 height=16/>
{{/renderImg}}
<h1 unselectable="on"><span class="wm-window-title-text">{{title}}</span></h1>
<div class="wm-button-group">
{{#minimize}}
<button class="wm-minimize"> </button>
{{/minimize}}
<button class="wm-maximize"> </button>
<button class="wm-close"> </button>
{{#detach}}
<button class="wm-detach"> </button>
{{/detach}}
</div>
</header>
<section class="wm-content"></section>
<button class="wm-resize top-right"> </button>
<button class="wm-resize top-left"> </button>
<button class="wm-resize bottom-left"> </button>
<button class="wm-resize bottom-right"> </button>
</div>
<div class="wm-window-border right wm-resize"></div>
</div>
<div class="wm-window-border bottom wm-resize"></div>
<div class="wm-window-overlay"></div>
</div>
## Instruction:
Move detach button between maximize and close.
[VDI-3230]
## Code After:
<div class="wm-window {{classname}}" >
<div class="wm-window-border top wm-resize"></div>
<div class="wm-container">
<div class="wm-window-border left wm-resize"></div>
<div class="wm-window-box">
<header class="wm-window-title" unselectable="on">
{{#renderImg}}
<img src="{{imgUrl}}" width=16 height=16/>
{{/renderImg}}
<h1 unselectable="on"><span class="wm-window-title-text">{{title}}</span></h1>
<div class="wm-button-group">
{{#minimize}}
<button class="wm-minimize"> </button>
{{/minimize}}
<button class="wm-maximize"> </button>
{{#detach}}
<button class="wm-detach"> </button>
{{/detach}}
<button class="wm-close"> </button>
</div>
</header>
<section class="wm-content"></section>
<button class="wm-resize top-right"> </button>
<button class="wm-resize top-left"> </button>
<button class="wm-resize bottom-left"> </button>
<button class="wm-resize bottom-right"> </button>
</div>
<div class="wm-window-border right wm-resize"></div>
</div>
<div class="wm-window-border bottom wm-resize"></div>
<div class="wm-window-overlay"></div>
</div>
| <div class="wm-window {{classname}}" >
<div class="wm-window-border top wm-resize"></div>
<div class="wm-container">
<div class="wm-window-border left wm-resize"></div>
<div class="wm-window-box">
<header class="wm-window-title" unselectable="on">
{{#renderImg}}
<img src="{{imgUrl}}" width=16 height=16/>
{{/renderImg}}
<h1 unselectable="on"><span class="wm-window-title-text">{{title}}</span></h1>
<div class="wm-button-group">
{{#minimize}}
<button class="wm-minimize"> </button>
{{/minimize}}
<button class="wm-maximize"> </button>
- <button class="wm-close"> </button>
{{#detach}}
<button class="wm-detach"> </button>
{{/detach}}
+ <button class="wm-close"> </button>
</div>
</header>
<section class="wm-content"></section>
<button class="wm-resize top-right"> </button>
<button class="wm-resize top-left"> </button>
<button class="wm-resize bottom-left"> </button>
<button class="wm-resize bottom-right"> </button>
</div>
<div class="wm-window-border right wm-resize"></div>
</div>
<div class="wm-window-border bottom wm-resize"></div>
<div class="wm-window-overlay"></div>
</div>
| 2 | 0.055556 | 1 | 1 |
27f209a8ec0ca48503358c754b1f2283957f6ac4 | app/controllers/categories_controller.rb | app/controllers/categories_controller.rb | class CategoriesController < ApplicationController
decorates_assigned :category, with: CategoryDecorator
include Navigation
def show
@category = Core::CategoryReader.new(params[:id]).call do |error|
if error.redirect?
return redirect_to error.location, status: error.status
else
not_found
end
end
@breadcrumbs = BreadcrumbTrail.build(@category, category_tree)
assign_active_categories(@category)
end
private
def default_main_content_location?
false
end
end
| class CategoriesController < ApplicationController
decorates_assigned :category, with: CategoryDecorator
include Navigation
def show
@category = Core::CategoryReader.new(params[:id]).call do |error|
if error.redirect?
return redirect_to error.location, status: error.status
else
not_found
end
end
@breadcrumbs = BreadcrumbTrail.build(@category, category_tree)
assign_active_categories(@category)
rescue Core::Repository::Base::RequestError
not_found
end
private
def default_main_content_location?
false
end
end
| Return 404 if a category is not found | Return 404 if a category is not found
| Ruby | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | ruby | ## Code Before:
class CategoriesController < ApplicationController
decorates_assigned :category, with: CategoryDecorator
include Navigation
def show
@category = Core::CategoryReader.new(params[:id]).call do |error|
if error.redirect?
return redirect_to error.location, status: error.status
else
not_found
end
end
@breadcrumbs = BreadcrumbTrail.build(@category, category_tree)
assign_active_categories(@category)
end
private
def default_main_content_location?
false
end
end
## Instruction:
Return 404 if a category is not found
## Code After:
class CategoriesController < ApplicationController
decorates_assigned :category, with: CategoryDecorator
include Navigation
def show
@category = Core::CategoryReader.new(params[:id]).call do |error|
if error.redirect?
return redirect_to error.location, status: error.status
else
not_found
end
end
@breadcrumbs = BreadcrumbTrail.build(@category, category_tree)
assign_active_categories(@category)
rescue Core::Repository::Base::RequestError
not_found
end
private
def default_main_content_location?
false
end
end
| class CategoriesController < ApplicationController
decorates_assigned :category, with: CategoryDecorator
include Navigation
def show
@category = Core::CategoryReader.new(params[:id]).call do |error|
if error.redirect?
return redirect_to error.location, status: error.status
else
not_found
end
end
@breadcrumbs = BreadcrumbTrail.build(@category, category_tree)
assign_active_categories(@category)
+ rescue Core::Repository::Base::RequestError
+ not_found
end
private
def default_main_content_location?
false
end
end | 2 | 0.076923 | 2 | 0 |
e3340dacbbbacabd6c314a5bac742a3edfebe407 | _design/hypothesizer/lists/table.js | _design/hypothesizer/lists/table.js | /**
* List function - use `start()` and `send()` to output headers and content.
* @link http://docs.couchdb.org/en/latest/couchapp/ddocs.html#listfun
*
* @param {object} head - View Head Information. http://docs.couchdb.org/en/latest/json-structure.html#view-head-info-object
* @param {object} req - Request Object. http://docs.couchdb.org/en/latest/json-structure.html#request-object
**/
function(head, req) {
start({
'headers': {
'Content-Type': 'text/html'
}
});
send('<html><body>');
send('<table>');
while (row = getRow()) {
send('<tr>');
if (typeof(row.key) !== 'string') {
for (var i = 0; i < row.key.length; i++) {
send('<td><a href="/' + req.requested_path.join('/')
+ '/' + row.key[i] + '">' + row.key[i] + '</a></td>');
}
send('<td>' + row.value + '</td>');
}
send('</tr>');
}
send('</table>');
send('</body></html>');
}
| /**
* List function - use `start()` and `send()` to output headers and content.
* @link http://docs.couchdb.org/en/latest/couchapp/ddocs.html#listfun
*
* @param {object} head - View Head Information. http://docs.couchdb.org/en/latest/json-structure.html#view-head-info-object
* @param {object} req - Request Object. http://docs.couchdb.org/en/latest/json-structure.html#request-object
**/
function(head, req) {
var ddoc = this;
start({
'headers': {
'Content-Type': 'text/html'
}
});
send(ddoc.templates.header);
send('<div class="ui one column grid"><div class="column">');
send('<table class="ui stripped table">');
while (row = getRow()) {
send('<tr>');
if (typeof(row.key) !== 'string') {
for (var i = 0; i < row.key.length; i++) {
send('<td><a href="/' + req.requested_path.join('/')
+ '/' + row.key[i] + '">' + row.key[i] + '</a></td>');
}
send('<td>' + row.value + '</td>');
}
send('</tr>');
}
send('</table>');
send('</div></div>');
send(ddoc.templates.footer);
}
| Update users list to match new styles & UI | Update users list to match new styles & UI
| JavaScript | bsd-2-clause | hypothesis/hypothesizer,hypothesis/hypothesizer,hypothesis/hypothesizer | javascript | ## Code Before:
/**
* List function - use `start()` and `send()` to output headers and content.
* @link http://docs.couchdb.org/en/latest/couchapp/ddocs.html#listfun
*
* @param {object} head - View Head Information. http://docs.couchdb.org/en/latest/json-structure.html#view-head-info-object
* @param {object} req - Request Object. http://docs.couchdb.org/en/latest/json-structure.html#request-object
**/
function(head, req) {
start({
'headers': {
'Content-Type': 'text/html'
}
});
send('<html><body>');
send('<table>');
while (row = getRow()) {
send('<tr>');
if (typeof(row.key) !== 'string') {
for (var i = 0; i < row.key.length; i++) {
send('<td><a href="/' + req.requested_path.join('/')
+ '/' + row.key[i] + '">' + row.key[i] + '</a></td>');
}
send('<td>' + row.value + '</td>');
}
send('</tr>');
}
send('</table>');
send('</body></html>');
}
## Instruction:
Update users list to match new styles & UI
## Code After:
/**
* List function - use `start()` and `send()` to output headers and content.
* @link http://docs.couchdb.org/en/latest/couchapp/ddocs.html#listfun
*
* @param {object} head - View Head Information. http://docs.couchdb.org/en/latest/json-structure.html#view-head-info-object
* @param {object} req - Request Object. http://docs.couchdb.org/en/latest/json-structure.html#request-object
**/
function(head, req) {
var ddoc = this;
start({
'headers': {
'Content-Type': 'text/html'
}
});
send(ddoc.templates.header);
send('<div class="ui one column grid"><div class="column">');
send('<table class="ui stripped table">');
while (row = getRow()) {
send('<tr>');
if (typeof(row.key) !== 'string') {
for (var i = 0; i < row.key.length; i++) {
send('<td><a href="/' + req.requested_path.join('/')
+ '/' + row.key[i] + '">' + row.key[i] + '</a></td>');
}
send('<td>' + row.value + '</td>');
}
send('</tr>');
}
send('</table>');
send('</div></div>');
send(ddoc.templates.footer);
}
| /**
* List function - use `start()` and `send()` to output headers and content.
* @link http://docs.couchdb.org/en/latest/couchapp/ddocs.html#listfun
*
* @param {object} head - View Head Information. http://docs.couchdb.org/en/latest/json-structure.html#view-head-info-object
* @param {object} req - Request Object. http://docs.couchdb.org/en/latest/json-structure.html#request-object
**/
function(head, req) {
+ var ddoc = this;
start({
'headers': {
'Content-Type': 'text/html'
}
});
- send('<html><body>');
- send('<table>');
+ send(ddoc.templates.header);
+ send('<div class="ui one column grid"><div class="column">');
+ send('<table class="ui stripped table">');
while (row = getRow()) {
send('<tr>');
if (typeof(row.key) !== 'string') {
for (var i = 0; i < row.key.length; i++) {
send('<td><a href="/' + req.requested_path.join('/')
+ '/' + row.key[i] + '">' + row.key[i] + '</a></td>');
}
send('<td>' + row.value + '</td>');
}
send('</tr>');
}
send('</table>');
- send('</body></html>');
? -- ^ ^^^^
+ send('</div></div>');
? ^^ ^^^
+ send(ddoc.templates.footer);
} | 9 | 0.310345 | 6 | 3 |
c09f44c763b69b86ec323bc0c7fb7506d47e9e34 | lib/io.js | lib/io.js | (function() {
'use strict';
this.IO = {
load: function(url, async) {
if (async) {
return this.loadAsync(url);
}
return this.loadSync(url);
},
loadAsync: function(url) {
var deferred = when.defer();
var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.addEventListener('load', function() {
if (xhr.status == 200) {
deferred.resolve(xhr.responseText);
} else {
deferred.reject();
}
});
xhr.addEventListener('abort', function(e) {
return when.reject(e);
});
xhr.open('GET', url, true);
xhr.send('');
return deferred.promise;
},
loadSync: function(url) {
var deferred = when.defer();
var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.open('GET', url, false);
xhr.send('');
if (xhr.status == 200) {
defer.resolve(xhr.responseText);
} else {
defer.reject();
}
return defer.promise;
}
}
}).call(L20n);
| (function() {
'use strict';
this.IO = {
load: function(url, async) {
var deferred = when.defer();
var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.addEventListener('load', function() {
if (xhr.status == 200) {
deferred.resolve(xhr.responseText);
} else {
deferred.reject();
}
});
xhr.addEventListener('abort', function(e) {
return deferred.reject(e);
});
xhr.open('GET', url, async);
xhr.send('');
return deferred.promise;
},
}
}).call(L20n);
| Simplify IO and fix the s/defer/deferred/ typo | Simplify IO and fix the s/defer/deferred/ typo
| JavaScript | apache-2.0 | zbraniecki/fluent.js,zbraniecki/fluent.js,projectfluent/fluent.js,mail-apps/l20n.js,projectfluent/fluent.js,Pike/l20n.js,l20n/l20n.js,mail-apps/l20n.js,projectfluent/fluent.js,stasm/l20n.js,Swaven/l20n.js,Pike/l20n.js,zbraniecki/l20n.js | javascript | ## Code Before:
(function() {
'use strict';
this.IO = {
load: function(url, async) {
if (async) {
return this.loadAsync(url);
}
return this.loadSync(url);
},
loadAsync: function(url) {
var deferred = when.defer();
var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.addEventListener('load', function() {
if (xhr.status == 200) {
deferred.resolve(xhr.responseText);
} else {
deferred.reject();
}
});
xhr.addEventListener('abort', function(e) {
return when.reject(e);
});
xhr.open('GET', url, true);
xhr.send('');
return deferred.promise;
},
loadSync: function(url) {
var deferred = when.defer();
var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.open('GET', url, false);
xhr.send('');
if (xhr.status == 200) {
defer.resolve(xhr.responseText);
} else {
defer.reject();
}
return defer.promise;
}
}
}).call(L20n);
## Instruction:
Simplify IO and fix the s/defer/deferred/ typo
## Code After:
(function() {
'use strict';
this.IO = {
load: function(url, async) {
var deferred = when.defer();
var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.addEventListener('load', function() {
if (xhr.status == 200) {
deferred.resolve(xhr.responseText);
} else {
deferred.reject();
}
});
xhr.addEventListener('abort', function(e) {
return deferred.reject(e);
});
xhr.open('GET', url, async);
xhr.send('');
return deferred.promise;
},
}
}).call(L20n);
| (function() {
'use strict';
this.IO = {
load: function(url, async) {
- if (async) {
- return this.loadAsync(url);
- }
- return this.loadSync(url);
- },
- loadAsync: function(url) {
var deferred = when.defer();
var xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.addEventListener('load', function() {
if (xhr.status == 200) {
deferred.resolve(xhr.responseText);
} else {
deferred.reject();
}
});
xhr.addEventListener('abort', function(e) {
- return when.reject(e);
? ^^ ^
+ return deferred.reject(e);
? ^ ^^^^^^
});
- xhr.open('GET', url, true);
? ^^^^
+ xhr.open('GET', url, async);
? ^^^^^
xhr.send('');
return deferred.promise;
},
-
- loadSync: function(url) {
- var deferred = when.defer();
- var xhr = new XMLHttpRequest();
- xhr.overrideMimeType('text/plain');
- xhr.open('GET', url, false);
- xhr.send('');
- if (xhr.status == 200) {
- defer.resolve(xhr.responseText);
- } else {
- defer.reject();
- }
- return defer.promise;
- }
}
}).call(L20n); | 24 | 0.533333 | 2 | 22 |
3fdaea4f734a45673f376581ca31ffa989872817 | includes/templates/frontend/single-web-story.php | includes/templates/frontend/single-web-story.php | <?php
/**
* Template for web-story post type.
*
* @package Google\Web_Stories
* @copyright 2020 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://github.com/google/web-stories-wp
*/
use Google\Web_Stories\Story_Renderer;
/**
* Copyright 2020 Google LLC
*
* 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.
*/
the_post();
$current_post = get_post();
if ( $current_post instanceof WP_Post ) {
echo '<!DOCTYPE html>';
$renderer = new Story_Renderer( $current_post );
$rendered = $renderer->render();
$rendered = str_replace( ' standalone="standalone"', ' standalone', $rendered ); // @todo Remove! Temporary workaround for AMP plugin validation issue.
echo $rendered; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
| <?php
/**
* Template for web-story post type.
*
* @package Google\Web_Stories
* @copyright 2020 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://github.com/google/web-stories-wp
*/
use Google\Web_Stories\Story_Renderer;
/**
* Copyright 2020 Google LLC
*
* 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.
*/
the_post();
$current_post = get_post();
if ( $current_post instanceof WP_Post ) {
echo '<!DOCTYPE html>';
$renderer = new Story_Renderer( $current_post );
echo $renderer->render(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
| Undo temp change for standalone attr replacement | Undo temp change for standalone attr replacement
| PHP | apache-2.0 | GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp | php | ## Code Before:
<?php
/**
* Template for web-story post type.
*
* @package Google\Web_Stories
* @copyright 2020 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://github.com/google/web-stories-wp
*/
use Google\Web_Stories\Story_Renderer;
/**
* Copyright 2020 Google LLC
*
* 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.
*/
the_post();
$current_post = get_post();
if ( $current_post instanceof WP_Post ) {
echo '<!DOCTYPE html>';
$renderer = new Story_Renderer( $current_post );
$rendered = $renderer->render();
$rendered = str_replace( ' standalone="standalone"', ' standalone', $rendered ); // @todo Remove! Temporary workaround for AMP plugin validation issue.
echo $rendered; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
## Instruction:
Undo temp change for standalone attr replacement
## Code After:
<?php
/**
* Template for web-story post type.
*
* @package Google\Web_Stories
* @copyright 2020 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://github.com/google/web-stories-wp
*/
use Google\Web_Stories\Story_Renderer;
/**
* Copyright 2020 Google LLC
*
* 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.
*/
the_post();
$current_post = get_post();
if ( $current_post instanceof WP_Post ) {
echo '<!DOCTYPE html>';
$renderer = new Story_Renderer( $current_post );
echo $renderer->render(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
| <?php
/**
* Template for web-story post type.
*
* @package Google\Web_Stories
* @copyright 2020 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://github.com/google/web-stories-wp
*/
use Google\Web_Stories\Story_Renderer;
/**
* Copyright 2020 Google LLC
*
* 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.
*/
the_post();
$current_post = get_post();
if ( $current_post instanceof WP_Post ) {
echo '<!DOCTYPE html>';
$renderer = new Story_Renderer( $current_post );
- $rendered = $renderer->render();
- $rendered = str_replace( ' standalone="standalone"', ' standalone', $rendered ); // @todo Remove! Temporary workaround for AMP plugin validation issue.
- echo $rendered; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+ echo $renderer->render(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
? ++++++ ++++
} | 4 | 0.102564 | 1 | 3 |
c01b00c14ed0bf9db40b094617559dc6e644cbd1 | database/seeds/ClientTableSeeder.php | database/seeds/ClientTableSeeder.php | <?php
use Illuminate\Database\Seeder;
use Northstar\Models\Client;
use Northstar\Auth\Scope;
class ClientTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->delete();
// For easy testing, we'll seed one client for web authentication:
factory(Client::class, 'authorization_code')->create([
'title' => 'Local Development',
'description' => 'This is an example web OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'authorization_code',
'client_id' => 'oauth-test-client',
'client_secret' => 'secret1',
'scope' => collect(Scope::all())->except('admin')->keys()->toArray(),
// @NOTE: We're omitting 'redirect_uri' here for easy local dev.
'redirect_uri' => null,
]);
// ..and one for machine authentication:
factory(Client::class, 'client_credentials')->create([
'title' => 'Local Development (Machine)',
'description' => 'This is an example machine OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'client_credentials',
'client_id' => 'machine-test-client',
'client_secret' => 'secret2',
'scope' => collect(Scope::all())->keys()->toArray(),
]);
}
}
| <?php
use Illuminate\Database\Seeder;
use Northstar\Models\Client;
use Northstar\Auth\Scope;
class ClientTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->delete();
// For easy testing, we'll seed one client for web authentication:
factory(Client::class, 'authorization_code')->create([
'title' => 'Local Development',
'description' => 'This is an example web OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'authorization_code',
'client_id' => 'dev-oauth',
'client_secret' => 'secret1',
'scope' => collect(Scope::all())->except('admin')->keys()->toArray(),
// @NOTE: We're omitting 'redirect_uri' here for easy local dev.
'redirect_uri' => null,
]);
// ..and one for machine authentication:
factory(Client::class, 'client_credentials')->create([
'title' => 'Local Development (Machine)',
'description' => 'This is an example machine OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'client_credentials',
'client_id' => 'dev-machine',
'client_secret' => 'secret2',
'scope' => collect(Scope::all())->keys()->toArray(),
]);
}
}
| Rename seed clients for consistency. | Rename seed clients for consistency.
| PHP | mit | DoSomething/northstar,DoSomething/northstar,DoSomething/northstar | php | ## Code Before:
<?php
use Illuminate\Database\Seeder;
use Northstar\Models\Client;
use Northstar\Auth\Scope;
class ClientTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->delete();
// For easy testing, we'll seed one client for web authentication:
factory(Client::class, 'authorization_code')->create([
'title' => 'Local Development',
'description' => 'This is an example web OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'authorization_code',
'client_id' => 'oauth-test-client',
'client_secret' => 'secret1',
'scope' => collect(Scope::all())->except('admin')->keys()->toArray(),
// @NOTE: We're omitting 'redirect_uri' here for easy local dev.
'redirect_uri' => null,
]);
// ..and one for machine authentication:
factory(Client::class, 'client_credentials')->create([
'title' => 'Local Development (Machine)',
'description' => 'This is an example machine OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'client_credentials',
'client_id' => 'machine-test-client',
'client_secret' => 'secret2',
'scope' => collect(Scope::all())->keys()->toArray(),
]);
}
}
## Instruction:
Rename seed clients for consistency.
## Code After:
<?php
use Illuminate\Database\Seeder;
use Northstar\Models\Client;
use Northstar\Auth\Scope;
class ClientTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->delete();
// For easy testing, we'll seed one client for web authentication:
factory(Client::class, 'authorization_code')->create([
'title' => 'Local Development',
'description' => 'This is an example web OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'authorization_code',
'client_id' => 'dev-oauth',
'client_secret' => 'secret1',
'scope' => collect(Scope::all())->except('admin')->keys()->toArray(),
// @NOTE: We're omitting 'redirect_uri' here for easy local dev.
'redirect_uri' => null,
]);
// ..and one for machine authentication:
factory(Client::class, 'client_credentials')->create([
'title' => 'Local Development (Machine)',
'description' => 'This is an example machine OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'client_credentials',
'client_id' => 'dev-machine',
'client_secret' => 'secret2',
'scope' => collect(Scope::all())->keys()->toArray(),
]);
}
}
| <?php
use Illuminate\Database\Seeder;
use Northstar\Models\Client;
use Northstar\Auth\Scope;
class ClientTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->delete();
// For easy testing, we'll seed one client for web authentication:
factory(Client::class, 'authorization_code')->create([
'title' => 'Local Development',
'description' => 'This is an example web OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'authorization_code',
- 'client_id' => 'oauth-test-client',
? ------------
+ 'client_id' => 'dev-oauth',
? ++++
'client_secret' => 'secret1',
'scope' => collect(Scope::all())->except('admin')->keys()->toArray(),
// @NOTE: We're omitting 'redirect_uri' here for easy local dev.
'redirect_uri' => null,
]);
// ..and one for machine authentication:
factory(Client::class, 'client_credentials')->create([
'title' => 'Local Development (Machine)',
'description' => 'This is an example machine OAuth client seeded with your local Northstar installation.',
'allowed_grant' => 'client_credentials',
- 'client_id' => 'machine-test-client',
? ------------
+ 'client_id' => 'dev-machine',
? ++++
'client_secret' => 'secret2',
'scope' => collect(Scope::all())->keys()->toArray(),
]);
}
} | 4 | 0.1 | 2 | 2 |
53322633cbb4f30cdbd6165aa4743ed4dcf265cb | .travis.yml | .travis.yml | language: java
install: mvn install -DskipTests=true -Dgpg.skip=true
jdk:
- oraclejdk8 | language: java
install: mvn install -DskipTests=true -Dgpg.skip=true
jdk:
- oraclejdk8
- oraclejdk7 | Test with JDK 7 and 8 | Test with JDK 7 and 8
| YAML | mit | digitalheir/java-rechtspraak-library,digitalheir/java-rechtspraak-library,digitalheir/java-rechtspraak-library,digitalheir/java-rechtspraak-library | yaml | ## Code Before:
language: java
install: mvn install -DskipTests=true -Dgpg.skip=true
jdk:
- oraclejdk8
## Instruction:
Test with JDK 7 and 8
## Code After:
language: java
install: mvn install -DskipTests=true -Dgpg.skip=true
jdk:
- oraclejdk8
- oraclejdk7 | language: java
install: mvn install -DskipTests=true -Dgpg.skip=true
jdk:
- oraclejdk8
+ - oraclejdk7 | 1 | 0.2 | 1 | 0 |
069a400069a59a5d5db5082b7fe22397c622cac6 | README.md | README.md | Simplify.js is a high-performance JavaScript 2D/3D polyline simplification library by Vladimir Agafonkin, extracted from [Leaflet](http://leaflet.cloudmade.com/).
Docs and demo: http://mourner.github.com/simplify-js/ | Simplify.js is a high-performance JavaScript 2D/3D polyline simplification library by Vladimir Agafonkin, extracted from [Leaflet](http://leaflet.cloudmade.com/).
Docs and demo: http://mourner.github.com/simplify-js/
Python port: https://github.com/omarestrella/simplify.py/ (by Omar Estrella) | Add link to Python port | Add link to Python port | Markdown | bsd-2-clause | syedhali/simplify-js,mourner/simplify-js,calvinmetcalf/simplify-rs,Turbo87/simplify-js,imshz/simplify-js,npmcomponent/component-simplify,neogis-de/simplify-js,gronke/simplify-js | markdown | ## Code Before:
Simplify.js is a high-performance JavaScript 2D/3D polyline simplification library by Vladimir Agafonkin, extracted from [Leaflet](http://leaflet.cloudmade.com/).
Docs and demo: http://mourner.github.com/simplify-js/
## Instruction:
Add link to Python port
## Code After:
Simplify.js is a high-performance JavaScript 2D/3D polyline simplification library by Vladimir Agafonkin, extracted from [Leaflet](http://leaflet.cloudmade.com/).
Docs and demo: http://mourner.github.com/simplify-js/
Python port: https://github.com/omarestrella/simplify.py/ (by Omar Estrella) | Simplify.js is a high-performance JavaScript 2D/3D polyline simplification library by Vladimir Agafonkin, extracted from [Leaflet](http://leaflet.cloudmade.com/).
Docs and demo: http://mourner.github.com/simplify-js/
+
+ Python port: https://github.com/omarestrella/simplify.py/ (by Omar Estrella) | 2 | 0.666667 | 2 | 0 |
58e248e564303de5f49cbde1b9b844b9b36d7bf7 | .travis.yml | .travis.yml | language: node_js
sudo: false
node_js:
- "6"
before_install:
- if [[ `npm -v` != 5* ]]; then npm i -g npm@5; fi
install:
- npm install -g codecov
- npm run bootstrap
script:
- npm run style
- npm run coverage
after_success:
- codecov
| language: node_js
sudo: false
node_js:
- "6"
- "8"
- "10"
before_install:
- if [[ `npm -v` != 5* ]]; then npm i -g npm@5; fi
install:
- npm install -g codecov
- npm run bootstrap
script:
- npm run style
- npm run coverage
after_success:
- codecov
| Add CI Node runtimes v8 and v10 | test: Add CI Node runtimes v8 and v10
| YAML | apache-2.0 | yvele/azure-function-express | yaml | ## Code Before:
language: node_js
sudo: false
node_js:
- "6"
before_install:
- if [[ `npm -v` != 5* ]]; then npm i -g npm@5; fi
install:
- npm install -g codecov
- npm run bootstrap
script:
- npm run style
- npm run coverage
after_success:
- codecov
## Instruction:
test: Add CI Node runtimes v8 and v10
## Code After:
language: node_js
sudo: false
node_js:
- "6"
- "8"
- "10"
before_install:
- if [[ `npm -v` != 5* ]]; then npm i -g npm@5; fi
install:
- npm install -g codecov
- npm run bootstrap
script:
- npm run style
- npm run coverage
after_success:
- codecov
| language: node_js
sudo: false
node_js:
- "6"
+ - "8"
+ - "10"
before_install:
- if [[ `npm -v` != 5* ]]; then npm i -g npm@5; fi
install:
- npm install -g codecov
- npm run bootstrap
script:
- npm run style
- npm run coverage
after_success:
- codecov | 2 | 0.105263 | 2 | 0 |
dc5337cc5830d3e6c200ed08269549ab111319a1 | src/Pillar-Tests-ExporterHTML.package/PRHTMLWriterTest.class/instance/testHeaderOne.st | src/Pillar-Tests-ExporterHTML.package/PRHTMLWriterTest.class/instance/testHeaderOne.st | tests
testHeaderOne
| aNode aContents |
aNode := PRHeader new
level: 1;
add: (PRText new text: 'Header One').
aContents := (FileReference newTempFilePrefix: 'a' suffix: 'b')
writeStreamDo: [ :writeStream |
PRHTMLWriter new write: aNode to: writeStream ];
contents.
self assert: aContents equals: '<h1>Header One</h1>
' | tests
testHeaderOne
| aNode aContents |
aNode := PRHeader new
level: 1;
add: (PRText new text: 'Header One').
aContents := (FileReference newTempFilePrefix: 'a' suffix: 'b')
writeStreamDo: [ :writeStream |
PRHTMLWriter new write: aNode to: writeStream ];
contents.
self assert: aContents trimBoth equals: '<h1>Header One</h1>' trimBoth | Make tests more robust to changes in newlines | Make tests more robust to changes in newlines | Smalltalk | mit | pillar-markup/pillar,pillar-markup/pillar,pillar-markup/pillar | smalltalk | ## Code Before:
tests
testHeaderOne
| aNode aContents |
aNode := PRHeader new
level: 1;
add: (PRText new text: 'Header One').
aContents := (FileReference newTempFilePrefix: 'a' suffix: 'b')
writeStreamDo: [ :writeStream |
PRHTMLWriter new write: aNode to: writeStream ];
contents.
self assert: aContents equals: '<h1>Header One</h1>
'
## Instruction:
Make tests more robust to changes in newlines
## Code After:
tests
testHeaderOne
| aNode aContents |
aNode := PRHeader new
level: 1;
add: (PRText new text: 'Header One').
aContents := (FileReference newTempFilePrefix: 'a' suffix: 'b')
writeStreamDo: [ :writeStream |
PRHTMLWriter new write: aNode to: writeStream ];
contents.
self assert: aContents trimBoth equals: '<h1>Header One</h1>' trimBoth | tests
testHeaderOne
| aNode aContents |
aNode := PRHeader new
level: 1;
add: (PRText new text: 'Header One').
aContents := (FileReference newTempFilePrefix: 'a' suffix: 'b')
writeStreamDo: [ :writeStream |
PRHTMLWriter new write: aNode to: writeStream ];
contents.
- self assert: aContents equals: '<h1>Header One</h1>
+ self assert: aContents trimBoth equals: '<h1>Header One</h1>' trimBoth
? +++++++++ ++++++++++
- ' | 3 | 0.2 | 1 | 2 |
1a8c2178b43adce7e4b64461042c2c91854347b7 | package.json | package.json | {
"name": "negative",
"private": true,
"version": "0.5.0",
"description": "",
"main": "lib/main.js",
"scripts": {
"start": "electron ."
},
"author": "Adam Drago",
"dependencies": {
"datauri": "^0.7.1",
"electron-window": "^0.6.0",
"simple-undo": "^1.0.1"
},
"devDependencies": {
"browser-sync": "^2.10.0",
"electron-prebuilt": "^0.35.0",
"grunt": "^0.4.5",
"grunt-electron": "^2.0.0",
"gulp": "^3.9.0",
"gulp-changed": "^1.2.1",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.1",
"gulp-sass": "^2.0.4",
"gulp-watch": "^4.3.3",
"gulp-wrap": "^0.11.0",
"load-grunt-tasks": "^3.2.0"
}
}
| {
"name": "Negative",
"version": "0.5.0",
"description": "",
"main": "lib/main.js",
"scripts": {
"start": "electron ."
},
"author": "Adam Drago",
"dependencies": {
"datauri": "^0.7.1",
"electron-window": "^0.6.0",
"simple-undo": "^1.0.1"
},
"devDependencies": {
"electron-prebuilt": "^0.35.0",
"grunt": "^0.4.5",
"grunt-electron": "^2.0.0",
"gulp": "^3.9.0",
"gulp-changed": "^1.2.1",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.1",
"gulp-sass": "^2.0.4",
"gulp-watch": "^4.3.3",
"gulp-wrap": "^0.11.0",
"load-grunt-tasks": "^3.2.0"
}
}
| Remove "private" and capitalize "Negative" | Remove "private" and capitalize "Negative"
| JSON | mit | atdrago/negative,atdrago/negative,atdrago/negative | json | ## Code Before:
{
"name": "negative",
"private": true,
"version": "0.5.0",
"description": "",
"main": "lib/main.js",
"scripts": {
"start": "electron ."
},
"author": "Adam Drago",
"dependencies": {
"datauri": "^0.7.1",
"electron-window": "^0.6.0",
"simple-undo": "^1.0.1"
},
"devDependencies": {
"browser-sync": "^2.10.0",
"electron-prebuilt": "^0.35.0",
"grunt": "^0.4.5",
"grunt-electron": "^2.0.0",
"gulp": "^3.9.0",
"gulp-changed": "^1.2.1",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.1",
"gulp-sass": "^2.0.4",
"gulp-watch": "^4.3.3",
"gulp-wrap": "^0.11.0",
"load-grunt-tasks": "^3.2.0"
}
}
## Instruction:
Remove "private" and capitalize "Negative"
## Code After:
{
"name": "Negative",
"version": "0.5.0",
"description": "",
"main": "lib/main.js",
"scripts": {
"start": "electron ."
},
"author": "Adam Drago",
"dependencies": {
"datauri": "^0.7.1",
"electron-window": "^0.6.0",
"simple-undo": "^1.0.1"
},
"devDependencies": {
"electron-prebuilt": "^0.35.0",
"grunt": "^0.4.5",
"grunt-electron": "^2.0.0",
"gulp": "^3.9.0",
"gulp-changed": "^1.2.1",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.1",
"gulp-sass": "^2.0.4",
"gulp-watch": "^4.3.3",
"gulp-wrap": "^0.11.0",
"load-grunt-tasks": "^3.2.0"
}
}
| {
- "name": "negative",
? ^
+ "name": "Negative",
? ^
- "private": true,
"version": "0.5.0",
"description": "",
"main": "lib/main.js",
"scripts": {
"start": "electron ."
},
"author": "Adam Drago",
"dependencies": {
"datauri": "^0.7.1",
"electron-window": "^0.6.0",
"simple-undo": "^1.0.1"
},
"devDependencies": {
- "browser-sync": "^2.10.0",
"electron-prebuilt": "^0.35.0",
"grunt": "^0.4.5",
"grunt-electron": "^2.0.0",
"gulp": "^3.9.0",
"gulp-changed": "^1.2.1",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.1",
"gulp-sass": "^2.0.4",
"gulp-watch": "^4.3.3",
"gulp-wrap": "^0.11.0",
"load-grunt-tasks": "^3.2.0"
}
} | 4 | 0.133333 | 1 | 3 |
3321cc95a521445a1ad1a2f70c057acb583ac71e | solutions.digamma.damas.ui/src/components/layouts/app-page.js | solutions.digamma.damas.ui/src/components/layouts/app-page.js | import Vue from "vue"
export default {
name: 'AppPage',
props: {
layout: {
type: String,
required: true,
validator: [].includes.bind(["standard", "empty"])
}
},
created() {
let component = components[this.layout]
if (!Vue.options.components[component.name]) {
Vue.component(
component.name,
component,
);
}
this.$parent.$emit('update:layout', component);
},
render(h) {
return this.$slots.default ? this.$slots.default[0] : h();
},
}
const components = {
"standard": () => import("./layout-standard"),
"empty": () => import("./layout-empty")
} | import Vue from "vue"
export default {
name: 'AppPage',
props: {
layout: {
type: String,
required: true,
validator: [].includes.bind(["standard", "empty"])
}
},
created() {
let component = components[this.layout]
if (!Vue.options.components[component.name]) {
Vue.component(
component.name,
component,
);
}
if (this.$parent.layout !== component) {
this.$parent.$emit('update:layout', component);
}
},
render(h) {
return this.$slots.default ? this.$slots.default[0] : h();
},
}
const components = {
"standard": () => import("./layout-standard"),
"empty": () => import("./layout-empty")
}
| Add identity gard before firing layout change | Add identity gard before firing layout change
| JavaScript | mit | digammas/damas,digammas/damas,digammas/damas,digammas/damas | javascript | ## Code Before:
import Vue from "vue"
export default {
name: 'AppPage',
props: {
layout: {
type: String,
required: true,
validator: [].includes.bind(["standard", "empty"])
}
},
created() {
let component = components[this.layout]
if (!Vue.options.components[component.name]) {
Vue.component(
component.name,
component,
);
}
this.$parent.$emit('update:layout', component);
},
render(h) {
return this.$slots.default ? this.$slots.default[0] : h();
},
}
const components = {
"standard": () => import("./layout-standard"),
"empty": () => import("./layout-empty")
}
## Instruction:
Add identity gard before firing layout change
## Code After:
import Vue from "vue"
export default {
name: 'AppPage',
props: {
layout: {
type: String,
required: true,
validator: [].includes.bind(["standard", "empty"])
}
},
created() {
let component = components[this.layout]
if (!Vue.options.components[component.name]) {
Vue.component(
component.name,
component,
);
}
if (this.$parent.layout !== component) {
this.$parent.$emit('update:layout', component);
}
},
render(h) {
return this.$slots.default ? this.$slots.default[0] : h();
},
}
const components = {
"standard": () => import("./layout-standard"),
"empty": () => import("./layout-empty")
}
| import Vue from "vue"
export default {
name: 'AppPage',
props: {
layout: {
type: String,
required: true,
validator: [].includes.bind(["standard", "empty"])
}
},
created() {
let component = components[this.layout]
if (!Vue.options.components[component.name]) {
Vue.component(
component.name,
component,
);
}
+ if (this.$parent.layout !== component) {
- this.$parent.$emit('update:layout', component);
+ this.$parent.$emit('update:layout', component);
? ++++
+ }
},
render(h) {
return this.$slots.default ? this.$slots.default[0] : h();
},
}
const components = {
"standard": () => import("./layout-standard"),
"empty": () => import("./layout-empty")
} | 4 | 0.133333 | 3 | 1 |
4c4e9c2c624fdaf7671165fb5b6c73c118cfc7b0 | jeve/src/main/java/de/skuzzle/jeve/builder/ConfiguratorImpl.java | jeve/src/main/java/de/skuzzle/jeve/builder/ConfiguratorImpl.java | package de.skuzzle.jeve.builder;
import java.util.function.Supplier;
import de.skuzzle.jeve.ListenerStore;
import de.skuzzle.jeve.providers.SynchronousEventProvider;
import de.skuzzle.jeve.stores.DefaultListenerStore;
/**
* Default implementation of jeve's fluent builder API.
*
* @author Simon Taddiken
*/
public class ConfiguratorImpl implements EventProviderConfigurator {
@Override
public SynchronousEventProvider<DefaultListenerStore> createInstantly() {
return new SynchronousEventProvider<DefaultListenerStore>(
new DefaultListenerStore());
}
@Override
public ProviderChooser<DefaultListenerStore> defaultStore() {
final Supplier<DefaultListenerStore> supplier = DefaultListenerStore::new;
return new ProviderChooserImpl<DefaultListenerStore>(supplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(
Supplier<S> storeSupplier) {
if (storeSupplier == null) {
throw new IllegalArgumentException("storeSupplier is null");
}
return new ProviderChooserImpl<S>(storeSupplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(S store) {
if (store == null) {
throw new IllegalArgumentException("store is null");
}
final Supplier<S> supplier = () -> store;
return store(supplier);
}
}
| package de.skuzzle.jeve.builder;
import java.util.function.Supplier;
import de.skuzzle.jeve.ListenerStore;
import de.skuzzle.jeve.providers.SynchronousEventProvider;
import de.skuzzle.jeve.stores.DefaultListenerStore;
/**
* Default implementation of jeve's fluent builder API.
*
* @author Simon Taddiken
* @since 2.0.0
*/
public class ConfiguratorImpl implements EventProviderConfigurator {
@Override
public SynchronousEventProvider<DefaultListenerStore> createInstantly() {
return new SynchronousEventProvider<DefaultListenerStore>(
new DefaultListenerStore());
}
@Override
public ProviderChooser<DefaultListenerStore> defaultStore() {
final Supplier<DefaultListenerStore> supplier = DefaultListenerStore::new;
return new ProviderChooserImpl<DefaultListenerStore>(supplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(
Supplier<S> storeSupplier) {
if (storeSupplier == null) {
throw new IllegalArgumentException("storeSupplier is null");
}
return new ProviderChooserImpl<S>(storeSupplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(S store) {
if (store == null) {
throw new IllegalArgumentException("store is null");
}
final Supplier<S> supplier = () -> store;
return store(supplier);
}
}
| Add since tag to javadoc | Add since tag to javadoc
| Java | mit | skuzzle/jeve | java | ## Code Before:
package de.skuzzle.jeve.builder;
import java.util.function.Supplier;
import de.skuzzle.jeve.ListenerStore;
import de.skuzzle.jeve.providers.SynchronousEventProvider;
import de.skuzzle.jeve.stores.DefaultListenerStore;
/**
* Default implementation of jeve's fluent builder API.
*
* @author Simon Taddiken
*/
public class ConfiguratorImpl implements EventProviderConfigurator {
@Override
public SynchronousEventProvider<DefaultListenerStore> createInstantly() {
return new SynchronousEventProvider<DefaultListenerStore>(
new DefaultListenerStore());
}
@Override
public ProviderChooser<DefaultListenerStore> defaultStore() {
final Supplier<DefaultListenerStore> supplier = DefaultListenerStore::new;
return new ProviderChooserImpl<DefaultListenerStore>(supplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(
Supplier<S> storeSupplier) {
if (storeSupplier == null) {
throw new IllegalArgumentException("storeSupplier is null");
}
return new ProviderChooserImpl<S>(storeSupplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(S store) {
if (store == null) {
throw new IllegalArgumentException("store is null");
}
final Supplier<S> supplier = () -> store;
return store(supplier);
}
}
## Instruction:
Add since tag to javadoc
## Code After:
package de.skuzzle.jeve.builder;
import java.util.function.Supplier;
import de.skuzzle.jeve.ListenerStore;
import de.skuzzle.jeve.providers.SynchronousEventProvider;
import de.skuzzle.jeve.stores.DefaultListenerStore;
/**
* Default implementation of jeve's fluent builder API.
*
* @author Simon Taddiken
* @since 2.0.0
*/
public class ConfiguratorImpl implements EventProviderConfigurator {
@Override
public SynchronousEventProvider<DefaultListenerStore> createInstantly() {
return new SynchronousEventProvider<DefaultListenerStore>(
new DefaultListenerStore());
}
@Override
public ProviderChooser<DefaultListenerStore> defaultStore() {
final Supplier<DefaultListenerStore> supplier = DefaultListenerStore::new;
return new ProviderChooserImpl<DefaultListenerStore>(supplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(
Supplier<S> storeSupplier) {
if (storeSupplier == null) {
throw new IllegalArgumentException("storeSupplier is null");
}
return new ProviderChooserImpl<S>(storeSupplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(S store) {
if (store == null) {
throw new IllegalArgumentException("store is null");
}
final Supplier<S> supplier = () -> store;
return store(supplier);
}
}
| package de.skuzzle.jeve.builder;
import java.util.function.Supplier;
import de.skuzzle.jeve.ListenerStore;
import de.skuzzle.jeve.providers.SynchronousEventProvider;
import de.skuzzle.jeve.stores.DefaultListenerStore;
/**
* Default implementation of jeve's fluent builder API.
*
* @author Simon Taddiken
+ * @since 2.0.0
*/
public class ConfiguratorImpl implements EventProviderConfigurator {
@Override
public SynchronousEventProvider<DefaultListenerStore> createInstantly() {
return new SynchronousEventProvider<DefaultListenerStore>(
new DefaultListenerStore());
}
@Override
public ProviderChooser<DefaultListenerStore> defaultStore() {
final Supplier<DefaultListenerStore> supplier = DefaultListenerStore::new;
return new ProviderChooserImpl<DefaultListenerStore>(supplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(
Supplier<S> storeSupplier) {
if (storeSupplier == null) {
throw new IllegalArgumentException("storeSupplier is null");
}
return new ProviderChooserImpl<S>(storeSupplier);
}
@Override
public <S extends ListenerStore> ProviderChooser<S> store(S store) {
if (store == null) {
throw new IllegalArgumentException("store is null");
}
final Supplier<S> supplier = () -> store;
return store(supplier);
}
} | 1 | 0.021739 | 1 | 0 |
747c061fffe8ad43796db64aed7cd01db062c98e | git_checkout.sh | git_checkout.sh |
if [ $# -ne 1 ]; then
echo "[ERROR] branch not specified"
echo "Usage: ./git_checkout.sh BRANCH"
exit 1
fi
for dir in `find deps/leo_* -maxdepth 0` deps/savannah_mq
do
cd $dir
echo $dir
git checkout $1
cd ../../
done
|
if [ $# -ne 1 ]; then
echo "[ERROR] branch not specified"
echo "Usage: ./git_checkout.sh BRANCH"
exit 1
fi
for dir in `find deps/leo_* -maxdepth 0`
do
cd $dir
echo $dir
git checkout $1
cd ../../
done
| Remove an unnecessary lib in the target | Remove an unnecessary lib in the target
| Shell | apache-2.0 | yosukehara/leofs,bsmr-erlang/leofs,vstax/leofs,DavidAlphaFox/leofs,project-fifo/leofs,leo-project/leofs,windkit/leofs,leo-project/leofs,vstax/leofs,yosukehara/leofs,project-fifo/leofs,windkit/leofs | shell | ## Code Before:
if [ $# -ne 1 ]; then
echo "[ERROR] branch not specified"
echo "Usage: ./git_checkout.sh BRANCH"
exit 1
fi
for dir in `find deps/leo_* -maxdepth 0` deps/savannah_mq
do
cd $dir
echo $dir
git checkout $1
cd ../../
done
## Instruction:
Remove an unnecessary lib in the target
## Code After:
if [ $# -ne 1 ]; then
echo "[ERROR] branch not specified"
echo "Usage: ./git_checkout.sh BRANCH"
exit 1
fi
for dir in `find deps/leo_* -maxdepth 0`
do
cd $dir
echo $dir
git checkout $1
cd ../../
done
|
if [ $# -ne 1 ]; then
echo "[ERROR] branch not specified"
echo "Usage: ./git_checkout.sh BRANCH"
exit 1
fi
- for dir in `find deps/leo_* -maxdepth 0` deps/savannah_mq
? -----------------
+ for dir in `find deps/leo_* -maxdepth 0`
do
cd $dir
echo $dir
git checkout $1
cd ../../
done | 2 | 0.142857 | 1 | 1 |
0d25ad1ea397fd849a421e48d5eef1a1b9228bf2 | src/main/java/net/tridentsdk/world/gen/PropGenerator.java | src/main/java/net/tridentsdk/world/gen/PropGenerator.java | /*
* Trident - A Multithreaded Server Alternative
* Copyright 2016 The TridentSDK Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.tridentsdk.world.gen;
/**
* This class generates props in the world such as trees,
* flowers, tall grass, etc...
*
* @author TridentSDK
* @since 0.5-alpha
*/
public interface PropGenerator {
/**
* A prop generator is implemented by overriding this
* method and writing the generated blocks to the
* context.
*
* <p>This method is called for each of the horizontal
* 16 blocks in a chunk, with the height representing
* the highest block at the relative X/Z coordinates.
* </p>
*
* @param relX the relative x
* @param relZ the relative z
* @param height the highest block at the X/Z
* @param context the context
*/
void generate(int relX, int relZ, int height, GeneratorContext context);
} | /*
* Trident - A Multithreaded Server Alternative
* Copyright 2016 The TridentSDK Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.tridentsdk.world.gen;
/**
* This class generates props in the world such as trees,
* flowers, tall grass, etc...
*
* @author TridentSDK
* @since 0.5-alpha
*/
public interface PropGenerator {
/**
* A prop generator is implemented by overriding this
* method and writing the generated blocks to the
* context.
*
* @param chunkX the chunk x
* @param chunkZ the chunk z
* @param height the highest block at the X/Z
* @param context the context
*/
void generate(int chunkX, int chunkZ, int height, GeneratorContext context);
} | Modify prop generation to encompass the whole chunk instead of each of the 16x16 blocks. | Modify prop generation to encompass the whole chunk instead of each of the 16x16 blocks.
| Java | apache-2.0 | nickrobson/TridentSDK,TridentSDK/TridentSDK,TridentSDK/TridentSDK,nickrobson/TridentSDK,TridentSDK/TridentSDK | java | ## Code Before:
/*
* Trident - A Multithreaded Server Alternative
* Copyright 2016 The TridentSDK Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.tridentsdk.world.gen;
/**
* This class generates props in the world such as trees,
* flowers, tall grass, etc...
*
* @author TridentSDK
* @since 0.5-alpha
*/
public interface PropGenerator {
/**
* A prop generator is implemented by overriding this
* method and writing the generated blocks to the
* context.
*
* <p>This method is called for each of the horizontal
* 16 blocks in a chunk, with the height representing
* the highest block at the relative X/Z coordinates.
* </p>
*
* @param relX the relative x
* @param relZ the relative z
* @param height the highest block at the X/Z
* @param context the context
*/
void generate(int relX, int relZ, int height, GeneratorContext context);
}
## Instruction:
Modify prop generation to encompass the whole chunk instead of each of the 16x16 blocks.
## Code After:
/*
* Trident - A Multithreaded Server Alternative
* Copyright 2016 The TridentSDK Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.tridentsdk.world.gen;
/**
* This class generates props in the world such as trees,
* flowers, tall grass, etc...
*
* @author TridentSDK
* @since 0.5-alpha
*/
public interface PropGenerator {
/**
* A prop generator is implemented by overriding this
* method and writing the generated blocks to the
* context.
*
* @param chunkX the chunk x
* @param chunkZ the chunk z
* @param height the highest block at the X/Z
* @param context the context
*/
void generate(int chunkX, int chunkZ, int height, GeneratorContext context);
} | /*
* Trident - A Multithreaded Server Alternative
* Copyright 2016 The TridentSDK Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.tridentsdk.world.gen;
/**
* This class generates props in the world such as trees,
* flowers, tall grass, etc...
*
* @author TridentSDK
* @since 0.5-alpha
*/
public interface PropGenerator {
/**
* A prop generator is implemented by overriding this
* method and writing the generated blocks to the
* context.
*
+ * @param chunkX the chunk x
+ * @param chunkZ the chunk z
- * <p>This method is called for each of the horizontal
- * 16 blocks in a chunk, with the height representing
- * the highest block at the relative X/Z coordinates.
- * </p>
- *
- * @param relX the relative x
- * @param relZ the relative z
* @param height the highest block at the X/Z
* @param context the context
*/
- void generate(int relX, int relZ, int height, GeneratorContext context);
? ^^^ ^^^
+ void generate(int chunkX, int chunkZ, int height, GeneratorContext context);
? ^^^^^ ^^^^^
} | 11 | 0.255814 | 3 | 8 |
c95979010990753a1c360916f89a076dca7dd88d | src/html/templates/slides/operators-and-operations.html | src/html/templates/slides/operators-and-operations.html | <section>
<h1>JavaScript:</h1>
<h2>Operators and Operations</h2>
</section>
<section>
<div class="definition compact">
<p class="term">op·er·a·tor</p>
<div>
<p>/ˈäpəˌrādər/</p>
<div class="content">
<p class="family">noun</p>
<p class="body">
Reserved syntax consisting of punctuation or alphanumeric characters
and carrying out built-in functionality. For example, "+" indicates
the addition <i>operator</i> and "!" indicates the "not"
<i>operator</i>.
</p>
</div>
</div>
</div>
<ul class="unstyled margin-top-md font-size-md">
<li>
<a
href="https://developer.mozilla.org/en-US/docs/Glossary/Operator"
target="_blank"
>MDN Glossary - Operator</a>
</li>
<li>
<a
href="https://msdn.microsoft.com/en-us/library/6hsc0eak(v=vs.94).aspx"
target="_blank"
>
MSDN - Operators in JavaScript
</a>
</li>
</ul>
</section>
| <section>
<h1>JavaScript:</h1>
<h2>Operators and Operations</h2>
</section>
<section>
<h2>JavaScript: Operators</h2>
<div class="definition compact">
<p class="term">op·er·a·tor</p>
<div>
<p>/ˈäpəˌrādər/</p>
<div class="content">
<p class="family">noun</p>
<p class="body">
Reserved syntax consisting of punctuation or alphanumeric characters
and carrying out built-in functionality. For example, "+" indicates
the addition <i>operator</i> and "!" indicates the "not"
<i>operator</i>.
</p>
</div>
</div>
</div>
<ul class="unstyled margin-top-md font-size-md">
<li>
<a
href="https://developer.mozilla.org/en-US/docs/Glossary/Operator"
target="_blank"
>MDN Glossary - Operator</a>
</li>
<li>
<a
href="https://msdn.microsoft.com/en-us/library/6hsc0eak(v=vs.94).aspx"
target="_blank"
>
MSDN - Operators in JavaScript
</a>
</li>
</ul>
</section>
| Add missing header to operators slide | Add missing header to operators slide
| HTML | mit | tdg5/js4pm,tdg5/front-end-skills-for-pms,tdg5/front-end-skills-for-pms,tdg5/js4pm | html | ## Code Before:
<section>
<h1>JavaScript:</h1>
<h2>Operators and Operations</h2>
</section>
<section>
<div class="definition compact">
<p class="term">op·er·a·tor</p>
<div>
<p>/ˈäpəˌrādər/</p>
<div class="content">
<p class="family">noun</p>
<p class="body">
Reserved syntax consisting of punctuation or alphanumeric characters
and carrying out built-in functionality. For example, "+" indicates
the addition <i>operator</i> and "!" indicates the "not"
<i>operator</i>.
</p>
</div>
</div>
</div>
<ul class="unstyled margin-top-md font-size-md">
<li>
<a
href="https://developer.mozilla.org/en-US/docs/Glossary/Operator"
target="_blank"
>MDN Glossary - Operator</a>
</li>
<li>
<a
href="https://msdn.microsoft.com/en-us/library/6hsc0eak(v=vs.94).aspx"
target="_blank"
>
MSDN - Operators in JavaScript
</a>
</li>
</ul>
</section>
## Instruction:
Add missing header to operators slide
## Code After:
<section>
<h1>JavaScript:</h1>
<h2>Operators and Operations</h2>
</section>
<section>
<h2>JavaScript: Operators</h2>
<div class="definition compact">
<p class="term">op·er·a·tor</p>
<div>
<p>/ˈäpəˌrādər/</p>
<div class="content">
<p class="family">noun</p>
<p class="body">
Reserved syntax consisting of punctuation or alphanumeric characters
and carrying out built-in functionality. For example, "+" indicates
the addition <i>operator</i> and "!" indicates the "not"
<i>operator</i>.
</p>
</div>
</div>
</div>
<ul class="unstyled margin-top-md font-size-md">
<li>
<a
href="https://developer.mozilla.org/en-US/docs/Glossary/Operator"
target="_blank"
>MDN Glossary - Operator</a>
</li>
<li>
<a
href="https://msdn.microsoft.com/en-us/library/6hsc0eak(v=vs.94).aspx"
target="_blank"
>
MSDN - Operators in JavaScript
</a>
</li>
</ul>
</section>
| <section>
<h1>JavaScript:</h1>
<h2>Operators and Operations</h2>
</section>
<section>
+ <h2>JavaScript: Operators</h2>
<div class="definition compact">
<p class="term">op·er·a·tor</p>
<div>
<p>/ˈäpəˌrādər/</p>
<div class="content">
<p class="family">noun</p>
<p class="body">
Reserved syntax consisting of punctuation or alphanumeric characters
and carrying out built-in functionality. For example, "+" indicates
the addition <i>operator</i> and "!" indicates the "not"
<i>operator</i>.
</p>
</div>
</div>
</div>
<ul class="unstyled margin-top-md font-size-md">
<li>
<a
href="https://developer.mozilla.org/en-US/docs/Glossary/Operator"
target="_blank"
>MDN Glossary - Operator</a>
</li>
<li>
<a
href="https://msdn.microsoft.com/en-us/library/6hsc0eak(v=vs.94).aspx"
target="_blank"
>
MSDN - Operators in JavaScript
</a>
</li>
</ul>
</section>
| 1 | 0.026316 | 1 | 0 |
5910f78fe6795310f817c02ecea36a22bc12167b | .github/workflows/build-and-test.yaml | .github/workflows/build-and-test.yaml | name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
java: ['8', '11', '16' ]
env:
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Build with Maven
run: mvn jacoco:prepare-agent test verify jacoco:report coveralls:report -B -Pintegration-test -DrepoToken=$COVERALLS_SECRET
| name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 1
matrix:
java: ['8', '11', '16' ]
env:
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Build with Maven
run: mvn jacoco:prepare-agent test verify jacoco:report coveralls:report -B -Pintegration-test -DrepoToken=$COVERALLS_SECRET
| Fix build errors due to parallel builds | Fix build errors due to parallel builds | YAML | mit | daniel-sc/rocketchat-modern-client | yaml | ## Code Before:
name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
java: ['8', '11', '16' ]
env:
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Build with Maven
run: mvn jacoco:prepare-agent test verify jacoco:report coveralls:report -B -Pintegration-test -DrepoToken=$COVERALLS_SECRET
## Instruction:
Fix build errors due to parallel builds
## Code After:
name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 1
matrix:
java: ['8', '11', '16' ]
env:
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Build with Maven
run: mvn jacoco:prepare-agent test verify jacoco:report coveralls:report -B -Pintegration-test -DrepoToken=$COVERALLS_SECRET
| name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
+ max-parallel: 1
matrix:
java: ['8', '11', '16' ]
env:
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Build with Maven
run: mvn jacoco:prepare-agent test verify jacoco:report coveralls:report -B -Pintegration-test -DrepoToken=$COVERALLS_SECRET | 1 | 0.03125 | 1 | 0 |
a82e22578a86227a1dedb15f10307d2c945b9274 | README.org | README.org | * Overview
/python-gpopup/ is a notification system using Gtk3.
It has a client/server mode as well as a standalone mode.
The executable notification tools included are
- gpopup-send :: standalone notification tool
- gpopup-client :: create notifications displayed by server
- gpopup-server :: the server which creates clients for gpopup-client
/gpopup/ can also be used for creating notifications in python code.
* Example python usage
#+BEGIN_SRC python
import gpopup.notifier as notifier
import gpopup.message_types as message_types
client = notifier.NotifierClient()
client.start_server_maybe()
pre_msg = message_types.Simple(
summary='Some summary',
body='And some body',
)
table_msg = message_types.Table(
body=range(100),
columns=('Col 1', 'Col 2', 'Col 3', 'Col 4'),
)
notification_id = client.new_window(pre_msg, table_msg, pre_msg,
position='northeast')
client.timeout(timeout=10.0, notification_id=notification_id)
# from time import sleep
# sleep(20.0)
# client.destroy(window_id)
# client.kill_server()
#+END_SRC
[[file:examples/output_images/readme_python_example.png]]
| * Overview
/python-gpopup/ is a notification system using Gtk3.
It has a client/server mode as well as a standalone mode.
The executable notification tools included are
- gpopup-send :: standalone notification tool
- gpopup-client :: create notifications displayed by server
- gpopup-server :: the server which creates clients for gpopup-client
/gpopup/ can also be used for creating notifications in python code.
* Example python usage
#+BEGIN_SRC python
import gpopup.notifier as notifier
import gpopup.message_types as message_types
client = notifier.NotifierClient()
client.start_server_maybe()
pre_msg = message_types.Simple(
summary='Some summary',
body='And some body',
)
table_msg = message_types.Table(
body=range(100),
columns=('Col 1', 'Col 2', 'Col 3', 'Col 4'),
)
notification_id = client.new_window(pre_msg, table_msg, pre_msg,
position='northeast')
client.timeout(timeout=10.0, notification_id=notification_id)
# from time import sleep
# sleep(20.0)
# client.destroy(window_id)
# client.kill_server()
#+END_SRC
[[file:examples/output_images/readme_python_example.png]]
* Installation
#+BEGIN_SRC sh
git clone https://github.com/frostidaho/python-gpopup.git
pip install --user ./python-gpopup
#+END_SRC
* Testing
** Running just unit tests
#+BEGIN_SRC sh
make test
#+END_SRC
** Running unit tests and example scripts
#+BEGIN_SRC sh
make test-all
#+END_SRC
| Update readme.org with installation and testing section | Update readme.org with installation and testing section
| Org | bsd-2-clause | frostidaho/python-gpopup,frostidaho/python-gpopup | org | ## Code Before:
* Overview
/python-gpopup/ is a notification system using Gtk3.
It has a client/server mode as well as a standalone mode.
The executable notification tools included are
- gpopup-send :: standalone notification tool
- gpopup-client :: create notifications displayed by server
- gpopup-server :: the server which creates clients for gpopup-client
/gpopup/ can also be used for creating notifications in python code.
* Example python usage
#+BEGIN_SRC python
import gpopup.notifier as notifier
import gpopup.message_types as message_types
client = notifier.NotifierClient()
client.start_server_maybe()
pre_msg = message_types.Simple(
summary='Some summary',
body='And some body',
)
table_msg = message_types.Table(
body=range(100),
columns=('Col 1', 'Col 2', 'Col 3', 'Col 4'),
)
notification_id = client.new_window(pre_msg, table_msg, pre_msg,
position='northeast')
client.timeout(timeout=10.0, notification_id=notification_id)
# from time import sleep
# sleep(20.0)
# client.destroy(window_id)
# client.kill_server()
#+END_SRC
[[file:examples/output_images/readme_python_example.png]]
## Instruction:
Update readme.org with installation and testing section
## Code After:
* Overview
/python-gpopup/ is a notification system using Gtk3.
It has a client/server mode as well as a standalone mode.
The executable notification tools included are
- gpopup-send :: standalone notification tool
- gpopup-client :: create notifications displayed by server
- gpopup-server :: the server which creates clients for gpopup-client
/gpopup/ can also be used for creating notifications in python code.
* Example python usage
#+BEGIN_SRC python
import gpopup.notifier as notifier
import gpopup.message_types as message_types
client = notifier.NotifierClient()
client.start_server_maybe()
pre_msg = message_types.Simple(
summary='Some summary',
body='And some body',
)
table_msg = message_types.Table(
body=range(100),
columns=('Col 1', 'Col 2', 'Col 3', 'Col 4'),
)
notification_id = client.new_window(pre_msg, table_msg, pre_msg,
position='northeast')
client.timeout(timeout=10.0, notification_id=notification_id)
# from time import sleep
# sleep(20.0)
# client.destroy(window_id)
# client.kill_server()
#+END_SRC
[[file:examples/output_images/readme_python_example.png]]
* Installation
#+BEGIN_SRC sh
git clone https://github.com/frostidaho/python-gpopup.git
pip install --user ./python-gpopup
#+END_SRC
* Testing
** Running just unit tests
#+BEGIN_SRC sh
make test
#+END_SRC
** Running unit tests and example scripts
#+BEGIN_SRC sh
make test-all
#+END_SRC
| * Overview
/python-gpopup/ is a notification system using Gtk3.
It has a client/server mode as well as a standalone mode.
The executable notification tools included are
- gpopup-send :: standalone notification tool
- gpopup-client :: create notifications displayed by server
- gpopup-server :: the server which creates clients for gpopup-client
/gpopup/ can also be used for creating notifications in python code.
* Example python usage
#+BEGIN_SRC python
import gpopup.notifier as notifier
import gpopup.message_types as message_types
client = notifier.NotifierClient()
client.start_server_maybe()
pre_msg = message_types.Simple(
summary='Some summary',
body='And some body',
)
table_msg = message_types.Table(
body=range(100),
columns=('Col 1', 'Col 2', 'Col 3', 'Col 4'),
)
notification_id = client.new_window(pre_msg, table_msg, pre_msg,
position='northeast')
client.timeout(timeout=10.0, notification_id=notification_id)
# from time import sleep
# sleep(20.0)
# client.destroy(window_id)
# client.kill_server()
#+END_SRC
[[file:examples/output_images/readme_python_example.png]]
+
+ * Installation
+
+ #+BEGIN_SRC sh
+ git clone https://github.com/frostidaho/python-gpopup.git
+ pip install --user ./python-gpopup
+ #+END_SRC
+
+ * Testing
+ ** Running just unit tests
+ #+BEGIN_SRC sh
+ make test
+ #+END_SRC
+
+ ** Running unit tests and example scripts
+ #+BEGIN_SRC sh
+ make test-all
+ #+END_SRC | 18 | 0.439024 | 18 | 0 |
0979adf96f6f0f8dfa90beb579c19eda17acd582 | tag/index.js | tag/index.js | var onHeaders = require('on-headers');
module.exports = cacheTagMw;
function cacheTagMw(req, res, next) {
onHeaders(res, function() {
if (res.statusCode >= 200 && res.statusCode < 300) {
var tags = req.get('X-Cache-Tag');
tags = tags && tags.split(',') || [];
if (req.method != "GET") tags = tags.map(function(tag) {
return '+' + tag;
});
if (tags.length) res.set('X-Cache-Tag', tags);
}
});
next();
}
| var onHeaders = require('on-headers');
module.exports = cacheTagMw;
function cacheTagMw(req, res, next) {
onHeaders(res, function() {
if (res.statusCode >= 200 && res.statusCode < 300) {
var tags = req.get('X-Cache-Tag');
tags = tags && tags.split(',') || [];
var rtags = res._headers['x-cache-tag'];
(rtags && rtags.split(',') || []).forEach(function(tag) {
if (!~tags.indexOf(tag)) tags.push(tag);
});
if (req.method != "GET") tags = tags.map(function(tag) {
return '+' + tag;
});
if (tags.length) res.set('X-Cache-Tag', tags);
}
});
next();
}
| Check response headers for tags | Check response headers for tags
| JavaScript | mit | kapouer/upcache,kapouer/cache-protocols | javascript | ## Code Before:
var onHeaders = require('on-headers');
module.exports = cacheTagMw;
function cacheTagMw(req, res, next) {
onHeaders(res, function() {
if (res.statusCode >= 200 && res.statusCode < 300) {
var tags = req.get('X-Cache-Tag');
tags = tags && tags.split(',') || [];
if (req.method != "GET") tags = tags.map(function(tag) {
return '+' + tag;
});
if (tags.length) res.set('X-Cache-Tag', tags);
}
});
next();
}
## Instruction:
Check response headers for tags
## Code After:
var onHeaders = require('on-headers');
module.exports = cacheTagMw;
function cacheTagMw(req, res, next) {
onHeaders(res, function() {
if (res.statusCode >= 200 && res.statusCode < 300) {
var tags = req.get('X-Cache-Tag');
tags = tags && tags.split(',') || [];
var rtags = res._headers['x-cache-tag'];
(rtags && rtags.split(',') || []).forEach(function(tag) {
if (!~tags.indexOf(tag)) tags.push(tag);
});
if (req.method != "GET") tags = tags.map(function(tag) {
return '+' + tag;
});
if (tags.length) res.set('X-Cache-Tag', tags);
}
});
next();
}
| var onHeaders = require('on-headers');
module.exports = cacheTagMw;
function cacheTagMw(req, res, next) {
onHeaders(res, function() {
if (res.statusCode >= 200 && res.statusCode < 300) {
var tags = req.get('X-Cache-Tag');
tags = tags && tags.split(',') || [];
+ var rtags = res._headers['x-cache-tag'];
+ (rtags && rtags.split(',') || []).forEach(function(tag) {
+ if (!~tags.indexOf(tag)) tags.push(tag);
+ });
+
if (req.method != "GET") tags = tags.map(function(tag) {
return '+' + tag;
});
if (tags.length) res.set('X-Cache-Tag', tags);
}
});
next();
}
| 5 | 0.277778 | 5 | 0 |
0aade94dee4d84fc0473781f44e3b745ef397787 | src/sql/nodes/TableLocation.js | src/sql/nodes/TableLocation.js | 'use strict';
const Node = require('../Node');
class TableLocation extends Node
{
constructor(complexIdent)
{
super();
const source = complexIdent.fragments.shift();
if (source !== '@') {
throw new Error('Invalid table location');
}
this.fragments = complexIdent.fragments;
}
getFragments()
{
return this.fragments;
}
}
module.exports = TableLocation;
| 'use strict';
const ComplexIdent = require('./ComplexIdent');
class TableLocation extends ComplexIdent
{
constructor(complexIdent)
{
super([]);
const fragments = complexIdent.fragments.slice();
const source = fragments.shift();
if (source !== '@') {
throw new Error('Invalid table location');
}
this.fragments = fragments;
}
}
module.exports = TableLocation;
| Make binding working in table location (JOIN) | Make binding working in table location (JOIN) | JavaScript | mit | avz/node-jl-sql-api | javascript | ## Code Before:
'use strict';
const Node = require('../Node');
class TableLocation extends Node
{
constructor(complexIdent)
{
super();
const source = complexIdent.fragments.shift();
if (source !== '@') {
throw new Error('Invalid table location');
}
this.fragments = complexIdent.fragments;
}
getFragments()
{
return this.fragments;
}
}
module.exports = TableLocation;
## Instruction:
Make binding working in table location (JOIN)
## Code After:
'use strict';
const ComplexIdent = require('./ComplexIdent');
class TableLocation extends ComplexIdent
{
constructor(complexIdent)
{
super([]);
const fragments = complexIdent.fragments.slice();
const source = fragments.shift();
if (source !== '@') {
throw new Error('Invalid table location');
}
this.fragments = fragments;
}
}
module.exports = TableLocation;
| 'use strict';
- const Node = require('../Node');
+ const ComplexIdent = require('./ComplexIdent');
- class TableLocation extends Node
? ^
+ class TableLocation extends ComplexIdent
? ^ ++++++ ++
{
constructor(complexIdent)
{
- super();
+ super([]);
? ++
+ const fragments = complexIdent.fragments.slice();
- const source = complexIdent.fragments.shift();
? -------------
+ const source = fragments.shift();
if (source !== '@') {
throw new Error('Invalid table location');
}
- this.fragments = complexIdent.fragments;
? -------------
+ this.fragments = fragments;
- }
-
- getFragments()
- {
- return this.fragments;
}
}
module.exports = TableLocation; | 16 | 0.615385 | 6 | 10 |
a6112d333e6a76d68259b920af01caeeceb0679d | entrypoint.sh | entrypoint.sh |
touch /var/log/cron.log
function die {
echo >&2 "$@"
exit 1
}
# Check mandatory environment variables
if [ -z "${GIT_USER_NAME}" ]; then
die "GIT_USER_NAME must be specified!"
fi
if [ -z "${GIT_USER_EMAIL}" ]; then
die "GIT_USER_EMAIL must be specified!"
fi
if [ -z "${GIT_REPO_URL}" ]; then
die "GIT_REPO_URL must be specified!"
fi
# Set git author info
git config --global user.name "${GIT_USER_NAME}"
git config --global user.email "${GIT_USER_EMAIL}"
echo "GIT_USER_NAME=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_USER_EMAIL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_REPO_URL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
if [ "$1" = "--overwrite-local" ]; then
echo OVERWRITE_LOCAL="true" >> /etc/sync_env
fi
cron && tail -f /var/log/cron.log
|
touch /var/log/cron.log
function die {
echo >&2 "$@"
exit 1
}
# Check mandatory environment variables
if [ -z "${GIT_USER_NAME}" ]; then
die "GIT_USER_NAME must be specified!"
fi
if [ -z "${GIT_USER_EMAIL}" ]; then
die "GIT_USER_EMAIL must be specified!"
fi
if [ -z "${GIT_REPO_URL}" ]; then
die "GIT_REPO_URL must be specified!"
fi
# Set git author info
git config --global user.name "${GIT_USER_NAME}"
git config --global user.email "${GIT_USER_EMAIL}"
# Use default push behavior of Git 2.0
git config --global push.default simple
echo "GIT_USER_NAME=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_USER_EMAIL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_REPO_URL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
if [ "$1" = "--overwrite-local" ]; then
echo OVERWRITE_LOCAL="true" >> /etc/sync_env
fi
cron && tail -f /var/log/cron.log
| Use default push behavior of Git 2.0 | Use default push behavior of Git 2.0
| Shell | agpl-3.0 | bringnow/docker-git-sync | shell | ## Code Before:
touch /var/log/cron.log
function die {
echo >&2 "$@"
exit 1
}
# Check mandatory environment variables
if [ -z "${GIT_USER_NAME}" ]; then
die "GIT_USER_NAME must be specified!"
fi
if [ -z "${GIT_USER_EMAIL}" ]; then
die "GIT_USER_EMAIL must be specified!"
fi
if [ -z "${GIT_REPO_URL}" ]; then
die "GIT_REPO_URL must be specified!"
fi
# Set git author info
git config --global user.name "${GIT_USER_NAME}"
git config --global user.email "${GIT_USER_EMAIL}"
echo "GIT_USER_NAME=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_USER_EMAIL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_REPO_URL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
if [ "$1" = "--overwrite-local" ]; then
echo OVERWRITE_LOCAL="true" >> /etc/sync_env
fi
cron && tail -f /var/log/cron.log
## Instruction:
Use default push behavior of Git 2.0
## Code After:
touch /var/log/cron.log
function die {
echo >&2 "$@"
exit 1
}
# Check mandatory environment variables
if [ -z "${GIT_USER_NAME}" ]; then
die "GIT_USER_NAME must be specified!"
fi
if [ -z "${GIT_USER_EMAIL}" ]; then
die "GIT_USER_EMAIL must be specified!"
fi
if [ -z "${GIT_REPO_URL}" ]; then
die "GIT_REPO_URL must be specified!"
fi
# Set git author info
git config --global user.name "${GIT_USER_NAME}"
git config --global user.email "${GIT_USER_EMAIL}"
# Use default push behavior of Git 2.0
git config --global push.default simple
echo "GIT_USER_NAME=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_USER_EMAIL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_REPO_URL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
if [ "$1" = "--overwrite-local" ]; then
echo OVERWRITE_LOCAL="true" >> /etc/sync_env
fi
cron && tail -f /var/log/cron.log
|
touch /var/log/cron.log
function die {
echo >&2 "$@"
exit 1
}
# Check mandatory environment variables
if [ -z "${GIT_USER_NAME}" ]; then
die "GIT_USER_NAME must be specified!"
fi
if [ -z "${GIT_USER_EMAIL}" ]; then
die "GIT_USER_EMAIL must be specified!"
fi
if [ -z "${GIT_REPO_URL}" ]; then
die "GIT_REPO_URL must be specified!"
fi
# Set git author info
git config --global user.name "${GIT_USER_NAME}"
git config --global user.email "${GIT_USER_EMAIL}"
+ # Use default push behavior of Git 2.0
+ git config --global push.default simple
+
echo "GIT_USER_NAME=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_USER_EMAIL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
echo "GIT_REPO_URL=\"${GIT_REPO_URL}\"" >> /etc/sync_env
if [ "$1" = "--overwrite-local" ]; then
echo OVERWRITE_LOCAL="true" >> /etc/sync_env
fi
cron && tail -f /var/log/cron.log | 3 | 0.09375 | 3 | 0 |
d7e58494e1b35c315ede2b3019a18af0dd1744b4 | stuff/urls.py | stuff/urls.py | import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^publication/', include('stuff.publications.urls')),
(r'^file/', include('stuff.files.urls')),
(r'^photo/', include('stuff.picasaweb.urls')),
(r'^bookmark/', include('stuff.delicious.urls')),
(r'^project/', include('stuff.projects.urls')),
(r'^multimedia/', include('stuff.multimedia.urls')),
(r'^git/', include('stuff.dit.urls')),
# (r'^db/(.*)', databrowse.site.root),
(r'^$', 'stuff.views.index'),
# Media serving
(r'^%smedia/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT,
'show_indexes': True}
),
)
| import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^publication/', include('stuff.publications.urls')),
(r'^file/', include('stuff.files.urls')),
(r'^photo/', include('stuff.picasaweb.urls')),
(r'^bookmark/', include('stuff.delicious.urls')),
(r'^project/', include('stuff.projects.urls')),
(r'^multimedia/', include('stuff.multimedia.urls')),
# (r'^db/(.*)', databrowse.site.root),
(r'^$', 'stuff.views.index'),
# Media serving
(r'^media/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT,
'show_indexes': True}
),
)
| Remove extra %s from media path | Remove extra %s from media path
| Python | bsd-2-clause | anjos/website,anjos/website | python | ## Code Before:
import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^publication/', include('stuff.publications.urls')),
(r'^file/', include('stuff.files.urls')),
(r'^photo/', include('stuff.picasaweb.urls')),
(r'^bookmark/', include('stuff.delicious.urls')),
(r'^project/', include('stuff.projects.urls')),
(r'^multimedia/', include('stuff.multimedia.urls')),
(r'^git/', include('stuff.dit.urls')),
# (r'^db/(.*)', databrowse.site.root),
(r'^$', 'stuff.views.index'),
# Media serving
(r'^%smedia/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT,
'show_indexes': True}
),
)
## Instruction:
Remove extra %s from media path
## Code After:
import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^publication/', include('stuff.publications.urls')),
(r'^file/', include('stuff.files.urls')),
(r'^photo/', include('stuff.picasaweb.urls')),
(r'^bookmark/', include('stuff.delicious.urls')),
(r'^project/', include('stuff.projects.urls')),
(r'^multimedia/', include('stuff.multimedia.urls')),
# (r'^db/(.*)', databrowse.site.root),
(r'^$', 'stuff.views.index'),
# Media serving
(r'^media/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT,
'show_indexes': True}
),
)
| import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^publication/', include('stuff.publications.urls')),
(r'^file/', include('stuff.files.urls')),
(r'^photo/', include('stuff.picasaweb.urls')),
(r'^bookmark/', include('stuff.delicious.urls')),
(r'^project/', include('stuff.projects.urls')),
(r'^multimedia/', include('stuff.multimedia.urls')),
- (r'^git/', include('stuff.dit.urls')),
# (r'^db/(.*)', databrowse.site.root),
(r'^$', 'stuff.views.index'),
# Media serving
- (r'^%smedia/(?P<path>.*)$',
? --
+ (r'^media/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT,
'show_indexes': True}
),
)
| 3 | 0.115385 | 1 | 2 |
862323069678e414aa18d189df95781cd3862052 | e2e.sh | e2e.sh | if [[ ! -e zap ]]; then
echo "no zap binary present"
exit 1
fi
# start zap, fork.
./zap --port 16000 1>/dev/null 2>/dev/null &
ZAP_PID=$!
# pull results.
RESP="$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: g' localhost:16000/z)"
# Check response
expected="302 https://github.com/issmirnov/zap"
if [[ $RESP != $expected ]];then
echo "Status code or location don't match expectations"
echo "expected: $expected"
echo "got: $RESP"
kill -9 $ZAP_PID
exit 2
fi
# cleanup
kill -9 $ZAP_PID
echo "End to end test passed."
| PORT=16000
# sanity check for build env
if [[ ! -e zap ]]; then
echo "no zap binary present"
exit 1
fi
# start zap, fork.
./zap --port $PORT 1>/dev/null 2>/dev/null &
ZAP_PID=$!
# wait for port to open
while ! nc -z localhost $PORT </dev/null 2>/dev/null; do sleep 1; done
# pull results.
RESP="$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: g' localhost:$PORT/z)"
# Check response
expected="302 https://github.com/issmirnov/zap"
if [[ $RESP != $expected ]];then
echo "Status code or location don't match expectations"
echo "expected: $expected"
echo "got: $RESP"
kill -9 $ZAP_PID
exit 2
fi
# cleanup
kill -9 $ZAP_PID
echo "End to end test passed."
| Fix race condition in test | Fix race condition in test
On OSX systems, zap takes longer to start, and as a result the curl command hits a closed port. Added a busy loop that will wait for the port to be open and accepting connections before we hit it with the test. | Shell | mit | issmirnov/zap,issmirnov/zap | shell | ## Code Before:
if [[ ! -e zap ]]; then
echo "no zap binary present"
exit 1
fi
# start zap, fork.
./zap --port 16000 1>/dev/null 2>/dev/null &
ZAP_PID=$!
# pull results.
RESP="$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: g' localhost:16000/z)"
# Check response
expected="302 https://github.com/issmirnov/zap"
if [[ $RESP != $expected ]];then
echo "Status code or location don't match expectations"
echo "expected: $expected"
echo "got: $RESP"
kill -9 $ZAP_PID
exit 2
fi
# cleanup
kill -9 $ZAP_PID
echo "End to end test passed."
## Instruction:
Fix race condition in test
On OSX systems, zap takes longer to start, and as a result the curl command hits a closed port. Added a busy loop that will wait for the port to be open and accepting connections before we hit it with the test.
## Code After:
PORT=16000
# sanity check for build env
if [[ ! -e zap ]]; then
echo "no zap binary present"
exit 1
fi
# start zap, fork.
./zap --port $PORT 1>/dev/null 2>/dev/null &
ZAP_PID=$!
# wait for port to open
while ! nc -z localhost $PORT </dev/null 2>/dev/null; do sleep 1; done
# pull results.
RESP="$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: g' localhost:$PORT/z)"
# Check response
expected="302 https://github.com/issmirnov/zap"
if [[ $RESP != $expected ]];then
echo "Status code or location don't match expectations"
echo "expected: $expected"
echo "got: $RESP"
kill -9 $ZAP_PID
exit 2
fi
# cleanup
kill -9 $ZAP_PID
echo "End to end test passed."
| + PORT=16000
+ # sanity check for build env
if [[ ! -e zap ]]; then
echo "no zap binary present"
exit 1
fi
# start zap, fork.
- ./zap --port 16000 1>/dev/null 2>/dev/null &
? ^^^^^
+ ./zap --port $PORT 1>/dev/null 2>/dev/null &
? ^^^^^
ZAP_PID=$!
+ # wait for port to open
+ while ! nc -z localhost $PORT </dev/null 2>/dev/null; do sleep 1; done
+
# pull results.
- RESP="$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: g' localhost:16000/z)"
? ^^^^^
+ RESP="$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: g' localhost:$PORT/z)"
? ^^^^^
# Check response
expected="302 https://github.com/issmirnov/zap"
if [[ $RESP != $expected ]];then
echo "Status code or location don't match expectations"
echo "expected: $expected"
echo "got: $RESP"
kill -9 $ZAP_PID
exit 2
fi
# cleanup
kill -9 $ZAP_PID
echo "End to end test passed." | 9 | 0.36 | 7 | 2 |
4e4112b548cc263da2a455c2db9a2c82a3f84e45 | ecommerce/theming/models.py | ecommerce/theming/models.py | import logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models
logger = logging.getLogger(__name__)
class SiteTheme(models.Model):
"""
This is where the information about the site's theme gets stored to the db.
Fields:
site (ForeignKey): Foreign Key field pointing to django Site model
theme_dir_name (CharField): Contains directory name for any site's theme (e.g. 'red-theme')
"""
site = models.ForeignKey(Site, related_name='themes', on_delete=models.CASCADE)
theme_dir_name = models.CharField(max_length=255)
@staticmethod
def get_theme(site):
"""
Get SiteTheme object for given site, returns default site theme if it can not
find a theme for the given site and `DEFAULT_SITE_THEME` setting has a proper value.
Args:
site (django.contrib.sites.models.Site): site object related to the current site.
Returns:
SiteTheme object for given site or a default site set by `DEFAULT_SITE_THEME`
"""
if not site:
logger.warning('A site must be specified when retrieving a theme.')
return None
logger.info('Retrieving theme for site [%d]...', site.id)
theme = site.themes.first()
if theme:
logger.info(
'Setting theme for site [%d] to theme [%d] with assets in [%s]',
site.id, theme.id, theme.theme_dir_name
)
else:
default_theme_dir = settings.DEFAULT_SITE_THEME
if default_theme_dir:
logger.info('No theme found for site [%d]. Using default assets in [%s]', site.id, default_theme_dir)
theme = SiteTheme(site=site, theme_dir_name=settings.DEFAULT_SITE_THEME)
else:
logger.error('No default theme has been defined!')
return theme
| from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models
class SiteTheme(models.Model):
"""
This is where the information about the site's theme gets stored to the db.
Fields:
site (ForeignKey): Foreign Key field pointing to django Site model
theme_dir_name (CharField): Contains directory name for any site's theme (e.g. 'red-theme')
"""
site = models.ForeignKey(Site, related_name='themes', on_delete=models.CASCADE)
theme_dir_name = models.CharField(max_length=255)
@staticmethod
def get_theme(site):
"""
Get SiteTheme object for given site, returns default site theme if it can not
find a theme for the given site and `DEFAULT_SITE_THEME` setting has a proper value.
Args:
site (django.contrib.sites.models.Site): site object related to the current site.
Returns:
SiteTheme object for given site or a default site set by `DEFAULT_SITE_THEME`
"""
if not site:
return None
theme = site.themes.first()
if (not theme) and settings.DEFAULT_SITE_THEME:
theme = SiteTheme(site=site, theme_dir_name=settings.DEFAULT_SITE_THEME)
return theme
| Revert "Added logging to SiteTheme.get_theme" | Revert "Added logging to SiteTheme.get_theme"
This reverts commit f1436a255bb22ecd7b9ddca803240262bf484981.
| Python | agpl-3.0 | edx/ecommerce,eduNEXT/edunext-ecommerce,eduNEXT/edunext-ecommerce,edx/ecommerce,edx/ecommerce,edx/ecommerce,eduNEXT/edunext-ecommerce,eduNEXT/edunext-ecommerce | python | ## Code Before:
import logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models
logger = logging.getLogger(__name__)
class SiteTheme(models.Model):
"""
This is where the information about the site's theme gets stored to the db.
Fields:
site (ForeignKey): Foreign Key field pointing to django Site model
theme_dir_name (CharField): Contains directory name for any site's theme (e.g. 'red-theme')
"""
site = models.ForeignKey(Site, related_name='themes', on_delete=models.CASCADE)
theme_dir_name = models.CharField(max_length=255)
@staticmethod
def get_theme(site):
"""
Get SiteTheme object for given site, returns default site theme if it can not
find a theme for the given site and `DEFAULT_SITE_THEME` setting has a proper value.
Args:
site (django.contrib.sites.models.Site): site object related to the current site.
Returns:
SiteTheme object for given site or a default site set by `DEFAULT_SITE_THEME`
"""
if not site:
logger.warning('A site must be specified when retrieving a theme.')
return None
logger.info('Retrieving theme for site [%d]...', site.id)
theme = site.themes.first()
if theme:
logger.info(
'Setting theme for site [%d] to theme [%d] with assets in [%s]',
site.id, theme.id, theme.theme_dir_name
)
else:
default_theme_dir = settings.DEFAULT_SITE_THEME
if default_theme_dir:
logger.info('No theme found for site [%d]. Using default assets in [%s]', site.id, default_theme_dir)
theme = SiteTheme(site=site, theme_dir_name=settings.DEFAULT_SITE_THEME)
else:
logger.error('No default theme has been defined!')
return theme
## Instruction:
Revert "Added logging to SiteTheme.get_theme"
This reverts commit f1436a255bb22ecd7b9ddca803240262bf484981.
## Code After:
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models
class SiteTheme(models.Model):
"""
This is where the information about the site's theme gets stored to the db.
Fields:
site (ForeignKey): Foreign Key field pointing to django Site model
theme_dir_name (CharField): Contains directory name for any site's theme (e.g. 'red-theme')
"""
site = models.ForeignKey(Site, related_name='themes', on_delete=models.CASCADE)
theme_dir_name = models.CharField(max_length=255)
@staticmethod
def get_theme(site):
"""
Get SiteTheme object for given site, returns default site theme if it can not
find a theme for the given site and `DEFAULT_SITE_THEME` setting has a proper value.
Args:
site (django.contrib.sites.models.Site): site object related to the current site.
Returns:
SiteTheme object for given site or a default site set by `DEFAULT_SITE_THEME`
"""
if not site:
return None
theme = site.themes.first()
if (not theme) and settings.DEFAULT_SITE_THEME:
theme = SiteTheme(site=site, theme_dir_name=settings.DEFAULT_SITE_THEME)
return theme
| - import logging
-
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models
-
- logger = logging.getLogger(__name__)
class SiteTheme(models.Model):
"""
This is where the information about the site's theme gets stored to the db.
Fields:
site (ForeignKey): Foreign Key field pointing to django Site model
theme_dir_name (CharField): Contains directory name for any site's theme (e.g. 'red-theme')
"""
site = models.ForeignKey(Site, related_name='themes', on_delete=models.CASCADE)
theme_dir_name = models.CharField(max_length=255)
@staticmethod
def get_theme(site):
"""
Get SiteTheme object for given site, returns default site theme if it can not
find a theme for the given site and `DEFAULT_SITE_THEME` setting has a proper value.
Args:
site (django.contrib.sites.models.Site): site object related to the current site.
Returns:
SiteTheme object for given site or a default site set by `DEFAULT_SITE_THEME`
"""
if not site:
- logger.warning('A site must be specified when retrieving a theme.')
return None
- logger.info('Retrieving theme for site [%d]...', site.id)
theme = site.themes.first()
- if theme:
- logger.info(
- 'Setting theme for site [%d] to theme [%d] with assets in [%s]',
- site.id, theme.id, theme.theme_dir_name
- )
-
- else:
- default_theme_dir = settings.DEFAULT_SITE_THEME
? ---------- ^ ----
+ if (not theme) and settings.DEFAULT_SITE_THEME:
? ++ ++++ ^^^^ +
- if default_theme_dir:
- logger.info('No theme found for site [%d]. Using default assets in [%s]', site.id, default_theme_dir)
- theme = SiteTheme(site=site, theme_dir_name=settings.DEFAULT_SITE_THEME)
? ----
+ theme = SiteTheme(site=site, theme_dir_name=settings.DEFAULT_SITE_THEME)
- else:
- logger.error('No default theme has been defined!')
return theme | 21 | 0.388889 | 2 | 19 |
01a3e9afd47cef7924024e7c56eba732f49cf972 | source/common/typedefs.h | source/common/typedefs.h | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_TYPEDEFS_H
#define COMMON_TYPEDEFS_H
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
typedef signed short int16;
typedef unsigned int uint32;
typedef signed int int32;
typedef unsigned int uint;
typedef __int64 int64;
typedef unsigned __int64 uint64;
#endif
| /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_TYPEDEFS_H
#define COMMON_TYPEDEFS_H
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
typedef signed short int16;
typedef unsigned int uint32;
typedef signed int int32;
typedef unsigned int uint;
typedef __int64 int64;
typedef unsigned __int64 uint64;
namespace DisposeAfterUse {
enum Flag { NO, YES };
}
#endif
| Add namespace and enum for signaling auto-disposing | COMMON: Add namespace and enum for signaling auto-disposing
| C | apache-2.0 | RichieSams/thehalflingproject,RichieSams/thehalflingproject,RichieSams/thehalflingproject | c | ## Code Before:
/* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_TYPEDEFS_H
#define COMMON_TYPEDEFS_H
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
typedef signed short int16;
typedef unsigned int uint32;
typedef signed int int32;
typedef unsigned int uint;
typedef __int64 int64;
typedef unsigned __int64 uint64;
#endif
## Instruction:
COMMON: Add namespace and enum for signaling auto-disposing
## Code After:
/* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_TYPEDEFS_H
#define COMMON_TYPEDEFS_H
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
typedef signed short int16;
typedef unsigned int uint32;
typedef signed int int32;
typedef unsigned int uint;
typedef __int64 int64;
typedef unsigned __int64 uint64;
namespace DisposeAfterUse {
enum Flag { NO, YES };
}
#endif
| /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_TYPEDEFS_H
#define COMMON_TYPEDEFS_H
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
typedef signed short int16;
typedef unsigned int uint32;
typedef signed int int32;
typedef unsigned int uint;
typedef __int64 int64;
typedef unsigned __int64 uint64;
+ namespace DisposeAfterUse {
+ enum Flag { NO, YES };
+ }
+
#endif | 4 | 0.166667 | 4 | 0 |
65e72a7688d6382bd07896cc8c86914277fca422 | setup.py | setup.py | import setuptools
setuptools.setup(
name='mailcap-fix',
version='0.1.1',
description='A patched mailcap module that conforms to RFC 1524',
long_description=open('README.rst', encoding='utf-8').read(),
url='https://github.com/michael-lazar/mailcap_fix',
author='Michael Lazar',
author_email='lazar.michael22@gmail.com',
license='UNLICENSE',
keywords='mailcap 1524',
packages=['mailcap_fix'],
)
| import setuptools
from io import open
setuptools.setup(
name='mailcap-fix',
version='0.1.1',
description='A patched mailcap module that conforms to RFC 1524',
long_description=open('README.rst', encoding='utf-8').read(),
url='https://github.com/michael-lazar/mailcap_fix',
author='Michael Lazar',
author_email='lazar.michael22@gmail.com',
license='UNLICENSE',
keywords='mailcap 1524',
packages=['mailcap_fix'],
)
| Use io framework from python 3.0 to fix build on python 2.7 | Use io framework from python 3.0 to fix build on python 2.7
| Python | unlicense | michael-lazar/mailcap_fix | python | ## Code Before:
import setuptools
setuptools.setup(
name='mailcap-fix',
version='0.1.1',
description='A patched mailcap module that conforms to RFC 1524',
long_description=open('README.rst', encoding='utf-8').read(),
url='https://github.com/michael-lazar/mailcap_fix',
author='Michael Lazar',
author_email='lazar.michael22@gmail.com',
license='UNLICENSE',
keywords='mailcap 1524',
packages=['mailcap_fix'],
)
## Instruction:
Use io framework from python 3.0 to fix build on python 2.7
## Code After:
import setuptools
from io import open
setuptools.setup(
name='mailcap-fix',
version='0.1.1',
description='A patched mailcap module that conforms to RFC 1524',
long_description=open('README.rst', encoding='utf-8').read(),
url='https://github.com/michael-lazar/mailcap_fix',
author='Michael Lazar',
author_email='lazar.michael22@gmail.com',
license='UNLICENSE',
keywords='mailcap 1524',
packages=['mailcap_fix'],
)
| import setuptools
+ from io import open
setuptools.setup(
name='mailcap-fix',
version='0.1.1',
description='A patched mailcap module that conforms to RFC 1524',
long_description=open('README.rst', encoding='utf-8').read(),
url='https://github.com/michael-lazar/mailcap_fix',
author='Michael Lazar',
author_email='lazar.michael22@gmail.com',
license='UNLICENSE',
keywords='mailcap 1524',
packages=['mailcap_fix'],
) | 1 | 0.071429 | 1 | 0 |
bcc57b3653e3bace346c93732248480768bfac95 | build.sh | build.sh |
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX="/usr/local"
fi
# Ensure you have write permissions to PREFIX
mkdir -p $PREFIX
chown -R `whoami` $PREFIX
PATH=$PREFIX/bin:$PATH
wget https://github.com/mono/mono/archive/mono-4.8.0.478.tar.gz
tar --checkpoint -zxf mono-4.8.0.478.tar.gz
mv mono* mono
cd mono
./autogen.sh --prefix=$PREFIX
make
make install
|
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX="/usr/local"
fi
# Ensure you have write permissions to PREFIX
mkdir -p $PREFIX
chown -R `whoami` $PREFIX
PATH=$PREFIX/bin:$PATH
wget https://github.com/mono/mono/archive/mono-4.8.0.478.tar.gz
tar -zxf mono-4.8.0.478.tar.gz
rm mono-4.8.0.478.tar.gz
cd mono-mono-4.8.0.478
./autogen.sh --prefix=$PREFIX
make
make install
| Fix for incorrect folder renaming command | Fix for incorrect folder renaming command
| Shell | mit | MelvinLoos/rpi-mono | shell | ## Code Before:
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX="/usr/local"
fi
# Ensure you have write permissions to PREFIX
mkdir -p $PREFIX
chown -R `whoami` $PREFIX
PATH=$PREFIX/bin:$PATH
wget https://github.com/mono/mono/archive/mono-4.8.0.478.tar.gz
tar --checkpoint -zxf mono-4.8.0.478.tar.gz
mv mono* mono
cd mono
./autogen.sh --prefix=$PREFIX
make
make install
## Instruction:
Fix for incorrect folder renaming command
## Code After:
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX="/usr/local"
fi
# Ensure you have write permissions to PREFIX
mkdir -p $PREFIX
chown -R `whoami` $PREFIX
PATH=$PREFIX/bin:$PATH
wget https://github.com/mono/mono/archive/mono-4.8.0.478.tar.gz
tar -zxf mono-4.8.0.478.tar.gz
rm mono-4.8.0.478.tar.gz
cd mono-mono-4.8.0.478
./autogen.sh --prefix=$PREFIX
make
make install
|
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX="/usr/local"
fi
# Ensure you have write permissions to PREFIX
mkdir -p $PREFIX
chown -R `whoami` $PREFIX
PATH=$PREFIX/bin:$PATH
wget https://github.com/mono/mono/archive/mono-4.8.0.478.tar.gz
- tar --checkpoint -zxf mono-4.8.0.478.tar.gz
? -------------
+ tar -zxf mono-4.8.0.478.tar.gz
- mv mono* mono
- cd mono
+ rm mono-4.8.0.478.tar.gz
+ cd mono-mono-4.8.0.478
./autogen.sh --prefix=$PREFIX
make
make install | 6 | 0.333333 | 3 | 3 |
7060f26ddd3b944fa2d5a9d8c096c4d8284eeecd | create_mysql_admin_user.sh | create_mysql_admin_user.sh |
/usr/bin/mysqld_safe > /dev/null 2>&1 &
RET=1
while [[ RET -ne 0 ]]; do
echo "=> Waiting for confirmation of MySQL service startup"
sleep 5
mysql -uroot -e "status" > /dev/null 2>&1
RET=$?
done
PASS=${MYSQL_PASS:-$(pwgen -s 12 1)}
_word=$( [ ${MYSQL_PASS} ] && echo "preset" || echo "random" )
echo "=> Creating MySQL admin user with ${_word} password"
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
echo "=> Done!"
echo "========================================================================"
echo "You can now connect to this MySQL Server using:"
echo ""
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
echo ""
echo "Please remember to change the above password as soon as possible!"
echo "MySQL user 'root' has no password but only allows local connections"
echo "========================================================================"
mysqladmin -uroot shutdown
|
/usr/bin/mysqld_safe > /dev/null 2>&1 &
RET=1
while [[ RET -ne 0 ]]; do
echo "=> Waiting for confirmation of MySQL service startup"
sleep 5
mysql -uroot -e "status" > /dev/null 2>&1
RET=$?
done
PASS=${MYSQL_PASS:-$(pwgen -s 12 1)}
_word=$( [ ${MYSQL_PASS} ] && echo "preset" || echo "random" )
echo "=> Creating MySQL admin user with ${_word} password"
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
# You can create a /mysql-setup.sh file to intialized the DB
if [ -f /mysql-setup.sh ] ; then
. /mysql-setup.sh
fi
echo "=> Done!"
echo "========================================================================"
echo "You can now connect to this MySQL Server using:"
echo ""
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
echo ""
echo "Please remember to change the above password as soon as possible!"
echo "MySQL user 'root' has no password but only allows local connections"
echo "========================================================================"
mysqladmin -uroot shutdown
| Support setting up the mysql DB with some initial data. | Support setting up the mysql DB with some initial data. | Shell | apache-2.0 | qzsnitz/lamp,CodeBuffet/lamp-with-php5,dincaus/test_repo_2,qzsnitz/tenxcloud,tutumcloud/lamp | shell | ## Code Before:
/usr/bin/mysqld_safe > /dev/null 2>&1 &
RET=1
while [[ RET -ne 0 ]]; do
echo "=> Waiting for confirmation of MySQL service startup"
sleep 5
mysql -uroot -e "status" > /dev/null 2>&1
RET=$?
done
PASS=${MYSQL_PASS:-$(pwgen -s 12 1)}
_word=$( [ ${MYSQL_PASS} ] && echo "preset" || echo "random" )
echo "=> Creating MySQL admin user with ${_word} password"
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
echo "=> Done!"
echo "========================================================================"
echo "You can now connect to this MySQL Server using:"
echo ""
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
echo ""
echo "Please remember to change the above password as soon as possible!"
echo "MySQL user 'root' has no password but only allows local connections"
echo "========================================================================"
mysqladmin -uroot shutdown
## Instruction:
Support setting up the mysql DB with some initial data.
## Code After:
/usr/bin/mysqld_safe > /dev/null 2>&1 &
RET=1
while [[ RET -ne 0 ]]; do
echo "=> Waiting for confirmation of MySQL service startup"
sleep 5
mysql -uroot -e "status" > /dev/null 2>&1
RET=$?
done
PASS=${MYSQL_PASS:-$(pwgen -s 12 1)}
_word=$( [ ${MYSQL_PASS} ] && echo "preset" || echo "random" )
echo "=> Creating MySQL admin user with ${_word} password"
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
# You can create a /mysql-setup.sh file to intialized the DB
if [ -f /mysql-setup.sh ] ; then
. /mysql-setup.sh
fi
echo "=> Done!"
echo "========================================================================"
echo "You can now connect to this MySQL Server using:"
echo ""
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
echo ""
echo "Please remember to change the above password as soon as possible!"
echo "MySQL user 'root' has no password but only allows local connections"
echo "========================================================================"
mysqladmin -uroot shutdown
|
/usr/bin/mysqld_safe > /dev/null 2>&1 &
RET=1
while [[ RET -ne 0 ]]; do
echo "=> Waiting for confirmation of MySQL service startup"
sleep 5
mysql -uroot -e "status" > /dev/null 2>&1
RET=$?
done
PASS=${MYSQL_PASS:-$(pwgen -s 12 1)}
_word=$( [ ${MYSQL_PASS} ] && echo "preset" || echo "random" )
echo "=> Creating MySQL admin user with ${_word} password"
mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
+ # You can create a /mysql-setup.sh file to intialized the DB
+ if [ -f /mysql-setup.sh ] ; then
+ . /mysql-setup.sh
+ fi
echo "=> Done!"
echo "========================================================================"
echo "You can now connect to this MySQL Server using:"
echo ""
echo " mysql -uadmin -p$PASS -h<host> -P<port>"
echo ""
echo "Please remember to change the above password as soon as possible!"
echo "MySQL user 'root' has no password but only allows local connections"
echo "========================================================================"
mysqladmin -uroot shutdown | 4 | 0.129032 | 4 | 0 |
d806075e5c218d76365318cab552a6577eea7ba9 | app/main.js | app/main.js | exports = module.exports = function(registry) {
var api = {};
api.resolve = function(type, domain, rrtype, cb) {
registry.resolve(type, domain, rrtype, function(err, records) {
cb(err, records);
});
};
api.resolveSrv = function(type, domain, cb) {
registry.resolveSrv(type, domain, function(err, records) {
cb(err, records);
});
};
return api;
};
exports['@implements'] = 'http://i.bixbyjs.org/sd';
exports['@singleton'] = true;
exports['@require'] = [
'./registry',
];
| exports = module.exports = function(registry) {
var api = {};
api.resolve = function(type, domain, rrtype, cb) {
registry.resolve.apply(registry, arguments);
};
api.resolveSrv = function(type, domain, cb) {
registry.resolveSrv.apply(registry, arguments);
};
return api;
};
exports['@implements'] = 'http://i.bixbyjs.org/sd';
exports['@singleton'] = true;
exports['@require'] = [
'./registry',
];
| Use apply to forward call to registry. | Use apply to forward call to registry.
| JavaScript | mit | bixbyjs/bixby-sd | javascript | ## Code Before:
exports = module.exports = function(registry) {
var api = {};
api.resolve = function(type, domain, rrtype, cb) {
registry.resolve(type, domain, rrtype, function(err, records) {
cb(err, records);
});
};
api.resolveSrv = function(type, domain, cb) {
registry.resolveSrv(type, domain, function(err, records) {
cb(err, records);
});
};
return api;
};
exports['@implements'] = 'http://i.bixbyjs.org/sd';
exports['@singleton'] = true;
exports['@require'] = [
'./registry',
];
## Instruction:
Use apply to forward call to registry.
## Code After:
exports = module.exports = function(registry) {
var api = {};
api.resolve = function(type, domain, rrtype, cb) {
registry.resolve.apply(registry, arguments);
};
api.resolveSrv = function(type, domain, cb) {
registry.resolveSrv.apply(registry, arguments);
};
return api;
};
exports['@implements'] = 'http://i.bixbyjs.org/sd';
exports['@singleton'] = true;
exports['@require'] = [
'./registry',
];
| exports = module.exports = function(registry) {
var api = {};
api.resolve = function(type, domain, rrtype, cb) {
+ registry.resolve.apply(registry, arguments);
- registry.resolve(type, domain, rrtype, function(err, records) {
- cb(err, records);
- });
};
api.resolveSrv = function(type, domain, cb) {
+ registry.resolveSrv.apply(registry, arguments);
- registry.resolveSrv(type, domain, function(err, records) {
- cb(err, records);
- });
};
return api;
};
exports['@implements'] = 'http://i.bixbyjs.org/sd';
exports['@singleton'] = true;
exports['@require'] = [
'./registry',
]; | 8 | 0.347826 | 2 | 6 |
187caea5c6b7848d4d0b5547f107e6c3f53e5898 | README.md | README.md |
[](https://travis-ci.org/toaarnio/imgio)
Easy image file reading & writing for Python. Tested on Python 3.6+.
Supports PGM / PPM / PNM / PFM / PNG / JPG / INSP / TIFF, plus EXR and Bayer RAW in read-only mode.
**Installing on Linux:**
```
pip install imgio
```
**Installing on Windows:**
```
pip install pipwin
pipwin install imread
pip install imgio
```
**Building & installing from source:**
```
rm -rf build/ dist/
python setup.py build sdist test
pip uninstall imgio
pip install --user dist/*.tar.gz
```
**Releasing to PyPI:**
```
pip install --user --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*
```
|
[](https://travis-ci.com/github/toaarnio/imgio)
Easy image file reading & writing for Python. Tested on Python 3.6+.
Supports PGM / PPM / PNM / PFM / PNG / JPG / INSP / TIFF, plus EXR and Bayer RAW in read-only mode.
**Installing on Linux:**
```
pip install imgio
```
**Installing on Windows:**
```
pip install pipwin
pipwin install imread
pip install imgio
```
**Building & installing from source:**
```
rm -rf build/ dist/
python setup.py build sdist test
pip uninstall imgio
pip install --user dist/*.tar.gz
```
**Releasing to PyPI:**
```
pip install --user --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*
```
| Update build status banner in Readme from travis-ci.org to .com | Update build status banner in Readme from travis-ci.org to .com
| Markdown | mit | toaarnio/imgio | markdown | ## Code Before:
[](https://travis-ci.org/toaarnio/imgio)
Easy image file reading & writing for Python. Tested on Python 3.6+.
Supports PGM / PPM / PNM / PFM / PNG / JPG / INSP / TIFF, plus EXR and Bayer RAW in read-only mode.
**Installing on Linux:**
```
pip install imgio
```
**Installing on Windows:**
```
pip install pipwin
pipwin install imread
pip install imgio
```
**Building & installing from source:**
```
rm -rf build/ dist/
python setup.py build sdist test
pip uninstall imgio
pip install --user dist/*.tar.gz
```
**Releasing to PyPI:**
```
pip install --user --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*
```
## Instruction:
Update build status banner in Readme from travis-ci.org to .com
## Code After:
[](https://travis-ci.com/github/toaarnio/imgio)
Easy image file reading & writing for Python. Tested on Python 3.6+.
Supports PGM / PPM / PNM / PFM / PNG / JPG / INSP / TIFF, plus EXR and Bayer RAW in read-only mode.
**Installing on Linux:**
```
pip install imgio
```
**Installing on Windows:**
```
pip install pipwin
pipwin install imread
pip install imgio
```
**Building & installing from source:**
```
rm -rf build/ dist/
python setup.py build sdist test
pip uninstall imgio
pip install --user dist/*.tar.gz
```
**Releasing to PyPI:**
```
pip install --user --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*
```
|
- [](https://travis-ci.org/toaarnio/imgio)
? ^^ ^
+ [](https://travis-ci.com/github/toaarnio/imgio)
? + ^ + ^^ +++++
Easy image file reading & writing for Python. Tested on Python 3.6+.
Supports PGM / PPM / PNM / PFM / PNG / JPG / INSP / TIFF, plus EXR and Bayer RAW in read-only mode.
**Installing on Linux:**
```
pip install imgio
```
**Installing on Windows:**
```
pip install pipwin
pipwin install imread
pip install imgio
```
**Building & installing from source:**
```
rm -rf build/ dist/
python setup.py build sdist test
pip uninstall imgio
pip install --user dist/*.tar.gz
```
**Releasing to PyPI:**
```
pip install --user --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*
``` | 2 | 0.060606 | 1 | 1 |
7a56f92fc8cb0c45818f9bbd54d555c3998ea7cb | occ/CMakeLists.txt | occ/CMakeLists.txt | cmake_minimum_required(VERSION 3.2)
project(occ)
add_compile_options(-Wall -Wextra -Wpedantic -Weffc++)
# sdl_wrapper
add_subdirectory("sdl_wrapper")
target_include_directories(sdl_wrapper PUBLIC
"utils/export"
)
target_include_directories(sdl_wrapper SYSTEM PUBLIC
"/usr/include/SDL2"
)
# game
add_subdirectory("game")
target_include_directories(game PUBLIC
"utils/export"
)
target_include_directories(game SYSTEM PUBLIC
"external/json/src"
)
# utils
add_subdirectory("utils")
# occ
add_subdirectory("occ")
target_include_directories(occ PUBLIC
"sdl_wrapper/export"
"game/export"
"utils/export"
)
# tests
enable_testing()
add_test(game game/game_test)
add_test(occ occ/occ_test)
add_test(sdl_wrapper sdl_wrapper/sdl_wrapper_test)
add_test(utils utils/utils_test)
| cmake_minimum_required(VERSION 3.2)
project(occ)
# sdl_wrapper
add_subdirectory("sdl_wrapper")
target_compile_options(sdl_wrapper PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(sdl_wrapper PUBLIC
"utils/export"
)
target_include_directories(sdl_wrapper SYSTEM PUBLIC
"/usr/include/SDL2"
)
# game
add_subdirectory("game")
target_compile_options(game PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(game PUBLIC
"utils/export"
)
target_include_directories(game SYSTEM PUBLIC
"external/json/src"
)
# utils
add_subdirectory("utils")
target_compile_options(utils PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
# occ
add_subdirectory("occ")
target_compile_options(occ PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(occ PUBLIC
"sdl_wrapper/export"
"game/export"
"utils/export"
)
# tests
enable_testing()
add_subdirectory(external/googletest)
add_test(game game/game_test)
add_test(occ occ/occ_test)
add_test(sdl_wrapper sdl_wrapper/sdl_wrapper_test)
add_test(utils utils/utils_test)
| Build google test and google mock | Build google test and google mock
| Text | mit | gurka/OpenCrystalCaves,gurka/OpenCrystalCaves | text | ## Code Before:
cmake_minimum_required(VERSION 3.2)
project(occ)
add_compile_options(-Wall -Wextra -Wpedantic -Weffc++)
# sdl_wrapper
add_subdirectory("sdl_wrapper")
target_include_directories(sdl_wrapper PUBLIC
"utils/export"
)
target_include_directories(sdl_wrapper SYSTEM PUBLIC
"/usr/include/SDL2"
)
# game
add_subdirectory("game")
target_include_directories(game PUBLIC
"utils/export"
)
target_include_directories(game SYSTEM PUBLIC
"external/json/src"
)
# utils
add_subdirectory("utils")
# occ
add_subdirectory("occ")
target_include_directories(occ PUBLIC
"sdl_wrapper/export"
"game/export"
"utils/export"
)
# tests
enable_testing()
add_test(game game/game_test)
add_test(occ occ/occ_test)
add_test(sdl_wrapper sdl_wrapper/sdl_wrapper_test)
add_test(utils utils/utils_test)
## Instruction:
Build google test and google mock
## Code After:
cmake_minimum_required(VERSION 3.2)
project(occ)
# sdl_wrapper
add_subdirectory("sdl_wrapper")
target_compile_options(sdl_wrapper PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(sdl_wrapper PUBLIC
"utils/export"
)
target_include_directories(sdl_wrapper SYSTEM PUBLIC
"/usr/include/SDL2"
)
# game
add_subdirectory("game")
target_compile_options(game PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(game PUBLIC
"utils/export"
)
target_include_directories(game SYSTEM PUBLIC
"external/json/src"
)
# utils
add_subdirectory("utils")
target_compile_options(utils PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
# occ
add_subdirectory("occ")
target_compile_options(occ PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(occ PUBLIC
"sdl_wrapper/export"
"game/export"
"utils/export"
)
# tests
enable_testing()
add_subdirectory(external/googletest)
add_test(game game/game_test)
add_test(occ occ/occ_test)
add_test(sdl_wrapper sdl_wrapper/sdl_wrapper_test)
add_test(utils utils/utils_test)
| cmake_minimum_required(VERSION 3.2)
project(occ)
- add_compile_options(-Wall -Wextra -Wpedantic -Weffc++)
-
# sdl_wrapper
add_subdirectory("sdl_wrapper")
+ target_compile_options(sdl_wrapper PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(sdl_wrapper PUBLIC
"utils/export"
)
target_include_directories(sdl_wrapper SYSTEM PUBLIC
"/usr/include/SDL2"
)
# game
add_subdirectory("game")
+ target_compile_options(game PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(game PUBLIC
"utils/export"
)
target_include_directories(game SYSTEM PUBLIC
"external/json/src"
)
# utils
add_subdirectory("utils")
+ target_compile_options(utils PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
# occ
add_subdirectory("occ")
+ target_compile_options(occ PRIVATE -Wall -Wextra -Wpedantic -Weffc++)
target_include_directories(occ PUBLIC
"sdl_wrapper/export"
"game/export"
"utils/export"
)
# tests
enable_testing()
+ add_subdirectory(external/googletest)
add_test(game game/game_test)
add_test(occ occ/occ_test)
add_test(sdl_wrapper sdl_wrapper/sdl_wrapper_test)
add_test(utils utils/utils_test) | 7 | 0.170732 | 5 | 2 |
035a4ca558280f9afb2a1db56692136308cc86f8 | lib/mixins/core.js | lib/mixins/core.js | var Element = require('../Element')
var mapValues = require('../utils/mapValues')
var mixin = {
componentWillMount: function () {
this.connectedFauxDOM = {}
this.animateFauxDOMUntil = 0
},
connectFauxDOM: function (node, name) {
this.connectedFauxDOM[name] = typeof node !== 'string' ? node : new Element(node)
setTimeout(this.drawFauxDOM)
return this.connectedFauxDOM[name]
},
drawFauxDOM: function () {
var virtualDOM = mapValues(this.connectedFauxDOM, function (n) {
return n.toReact()
})
this.setState(virtualDOM)
}
}
module.exports = mixin
| var Element = require('../Element')
var mapValues = require('../utils/mapValues')
var mixin = {
componentWillMount: function () {
this.connectedFauxDOM = {}
this.animateFauxDOMUntil = 0
},
connectFauxDOM: function (node, name) {
if (!this.connectedFauxDOM[name]) {
this.connectedFauxDOM[name] = typeof node !== 'string' ? node : new Element(node)
setTimeout(this.drawFauxDOM)
}
return this.connectedFauxDOM[name]
},
drawFauxDOM: function () {
var virtualDOM = mapValues(this.connectedFauxDOM, function (n) {
return n.toReact()
})
this.setState(virtualDOM)
}
}
module.exports = mixin
| Make fauxDOM reusable for updates | Make fauxDOM reusable for updates
| JavaScript | unlicense | Olical/react-faux-dom | javascript | ## Code Before:
var Element = require('../Element')
var mapValues = require('../utils/mapValues')
var mixin = {
componentWillMount: function () {
this.connectedFauxDOM = {}
this.animateFauxDOMUntil = 0
},
connectFauxDOM: function (node, name) {
this.connectedFauxDOM[name] = typeof node !== 'string' ? node : new Element(node)
setTimeout(this.drawFauxDOM)
return this.connectedFauxDOM[name]
},
drawFauxDOM: function () {
var virtualDOM = mapValues(this.connectedFauxDOM, function (n) {
return n.toReact()
})
this.setState(virtualDOM)
}
}
module.exports = mixin
## Instruction:
Make fauxDOM reusable for updates
## Code After:
var Element = require('../Element')
var mapValues = require('../utils/mapValues')
var mixin = {
componentWillMount: function () {
this.connectedFauxDOM = {}
this.animateFauxDOMUntil = 0
},
connectFauxDOM: function (node, name) {
if (!this.connectedFauxDOM[name]) {
this.connectedFauxDOM[name] = typeof node !== 'string' ? node : new Element(node)
setTimeout(this.drawFauxDOM)
}
return this.connectedFauxDOM[name]
},
drawFauxDOM: function () {
var virtualDOM = mapValues(this.connectedFauxDOM, function (n) {
return n.toReact()
})
this.setState(virtualDOM)
}
}
module.exports = mixin
| var Element = require('../Element')
var mapValues = require('../utils/mapValues')
var mixin = {
componentWillMount: function () {
this.connectedFauxDOM = {}
this.animateFauxDOMUntil = 0
},
connectFauxDOM: function (node, name) {
+ if (!this.connectedFauxDOM[name]) {
- this.connectedFauxDOM[name] = typeof node !== 'string' ? node : new Element(node)
+ this.connectedFauxDOM[name] = typeof node !== 'string' ? node : new Element(node)
? ++
- setTimeout(this.drawFauxDOM)
+ setTimeout(this.drawFauxDOM)
? ++
+ }
return this.connectedFauxDOM[name]
},
drawFauxDOM: function () {
var virtualDOM = mapValues(this.connectedFauxDOM, function (n) {
return n.toReact()
})
this.setState(virtualDOM)
}
}
module.exports = mixin | 6 | 0.272727 | 4 | 2 |
761b2675471dfee97943e4123e45fc058d8f8153 | qsdl/simulator/defaultCostCallbacks.py | qsdl/simulator/defaultCostCallbacks.py | '''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| '''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| Change default query cost calculation interaction type to "basic" | Change default query cost calculation interaction type to "basic"
| Python | mit | fire-uta/ir-simulation,fire-uta/ir-simulation | python | ## Code Before:
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
## Instruction:
Change default query cost calculation interaction type to "basic"
## Code After:
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| '''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
- def get_current_query_cost( simulation, key_cost, interaction_type ):
+ def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
? ++++++++++
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost } | 2 | 0.117647 | 1 | 1 |
58f1e45fdef2f13ab9bb47983e23879e9c3b838d | lib/sham.rb | lib/sham.rb | module Sham
@@values = {}
@@offsets = {}
@@generators = {}
# Over-ride module's built-in name method, so we can re-use it for
# generating names. This is a bit of a no-no, but we get away with
# it in this context.
def self.name(*args, &block)
method_missing(:name, *args, &block)
end
def self.method_missing(symbol, *args, &block)
if block_given?
@@generators[symbol] = block
@@values[symbol] = generate_values(12, &block)
else
fetch_value(symbol)
end
end
def self.reset
@@offsets = {}
end
private
def self.fetch_value(symbol)
raise "No sham defined for #{symbol}" if @@values[symbol].nil?
offset = @@offsets[symbol] || 0
@@offsets[symbol] = offset + 1
if offset >= @@values[symbol].length
@@values[symbol] = generate_values(2 * @@values[symbol].length, &@@generators[symbol])
raise "Can't generate more unique values for Sham.#{symbol}" if offset >= @@values[symbol].length
end
@@values[symbol][offset]
end
def self.generate_values(count, &block)
seeded { (1..count).map(&block).uniq }
end
def self.seeded
old_seed = srand(1)
result = yield
srand(old_seed)
result
end
end
| module Sham
@@values = {}
@@offsets = {}
@@generators = {}
# Over-ride module's built-in name method, so we can re-use it for
# generating names. This is a bit of a no-no, but we get away with
# it in this context.
def self.name(*args, &block)
method_missing(:name, *args, &block)
end
def self.method_missing(symbol, *args, &block)
if block_given?
@@generators[symbol] = block
@@values[symbol] = generate_values(12, &block)
else
fetch_value(symbol)
end
end
def self.reset
@@offsets = {}
end
private
def self.fetch_value(symbol)
raise "No sham defined for #{symbol}" if @@values[symbol].nil?
offset = @@offsets[symbol] || 0
@@offsets[symbol] = offset + 1
if offset >= @@values[symbol].length
@@values[symbol] = generate_values(2 * @@values[symbol].length, &@@generators[symbol])
raise "Can't generate more unique values for Sham.#{symbol}" if offset >= @@values[symbol].length
end
@@values[symbol][offset]
end
def self.generate_values(count, &block)
seeded { (1..count).map(&block).uniq }
end
def self.seeded
srand(1)
result = yield
srand
result
end
end
| Make sure we don't reset the sequence returned by rand outside Sham. | Make sure we don't reset the sequence returned by rand outside Sham.
Turns out Ruby's srand doesn't work the way you'd think. The seed value it returns is the initial value used to see the generator, not the current seed value. That means you can't use it to save and restore your spot in the sequence.
| Ruby | mit | emmanuel/machinist,ianwhite/machinist,dominicsayers/machinist,amiel/machinist,notahat/machinist,rubyhead/machinist,rubyhead/machinist,dominicsayers/machinist,leereilly/machinist | ruby | ## Code Before:
module Sham
@@values = {}
@@offsets = {}
@@generators = {}
# Over-ride module's built-in name method, so we can re-use it for
# generating names. This is a bit of a no-no, but we get away with
# it in this context.
def self.name(*args, &block)
method_missing(:name, *args, &block)
end
def self.method_missing(symbol, *args, &block)
if block_given?
@@generators[symbol] = block
@@values[symbol] = generate_values(12, &block)
else
fetch_value(symbol)
end
end
def self.reset
@@offsets = {}
end
private
def self.fetch_value(symbol)
raise "No sham defined for #{symbol}" if @@values[symbol].nil?
offset = @@offsets[symbol] || 0
@@offsets[symbol] = offset + 1
if offset >= @@values[symbol].length
@@values[symbol] = generate_values(2 * @@values[symbol].length, &@@generators[symbol])
raise "Can't generate more unique values for Sham.#{symbol}" if offset >= @@values[symbol].length
end
@@values[symbol][offset]
end
def self.generate_values(count, &block)
seeded { (1..count).map(&block).uniq }
end
def self.seeded
old_seed = srand(1)
result = yield
srand(old_seed)
result
end
end
## Instruction:
Make sure we don't reset the sequence returned by rand outside Sham.
Turns out Ruby's srand doesn't work the way you'd think. The seed value it returns is the initial value used to see the generator, not the current seed value. That means you can't use it to save and restore your spot in the sequence.
## Code After:
module Sham
@@values = {}
@@offsets = {}
@@generators = {}
# Over-ride module's built-in name method, so we can re-use it for
# generating names. This is a bit of a no-no, but we get away with
# it in this context.
def self.name(*args, &block)
method_missing(:name, *args, &block)
end
def self.method_missing(symbol, *args, &block)
if block_given?
@@generators[symbol] = block
@@values[symbol] = generate_values(12, &block)
else
fetch_value(symbol)
end
end
def self.reset
@@offsets = {}
end
private
def self.fetch_value(symbol)
raise "No sham defined for #{symbol}" if @@values[symbol].nil?
offset = @@offsets[symbol] || 0
@@offsets[symbol] = offset + 1
if offset >= @@values[symbol].length
@@values[symbol] = generate_values(2 * @@values[symbol].length, &@@generators[symbol])
raise "Can't generate more unique values for Sham.#{symbol}" if offset >= @@values[symbol].length
end
@@values[symbol][offset]
end
def self.generate_values(count, &block)
seeded { (1..count).map(&block).uniq }
end
def self.seeded
srand(1)
result = yield
srand
result
end
end
| module Sham
@@values = {}
@@offsets = {}
@@generators = {}
# Over-ride module's built-in name method, so we can re-use it for
# generating names. This is a bit of a no-no, but we get away with
# it in this context.
def self.name(*args, &block)
method_missing(:name, *args, &block)
end
def self.method_missing(symbol, *args, &block)
if block_given?
@@generators[symbol] = block
@@values[symbol] = generate_values(12, &block)
else
fetch_value(symbol)
end
end
def self.reset
@@offsets = {}
end
private
def self.fetch_value(symbol)
raise "No sham defined for #{symbol}" if @@values[symbol].nil?
offset = @@offsets[symbol] || 0
@@offsets[symbol] = offset + 1
if offset >= @@values[symbol].length
@@values[symbol] = generate_values(2 * @@values[symbol].length, &@@generators[symbol])
raise "Can't generate more unique values for Sham.#{symbol}" if offset >= @@values[symbol].length
end
@@values[symbol][offset]
end
def self.generate_values(count, &block)
seeded { (1..count).map(&block).uniq }
end
def self.seeded
- old_seed = srand(1)
+ srand(1)
result = yield
- srand(old_seed)
+ srand
result
end
end | 4 | 0.081633 | 2 | 2 |
cb53758fac9dc551cf81103343270b8f6c28630b | README.md | README.md |
[](https://travis-ci.org/Zev Eisenberg/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
BonMot is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "BonMot"
```
## Author
Zev Eisenberg, zev.eisenberg@raizlabs.com
## License
BonMot is available under the MIT license. See the LICENSE file for more info.
|
[](https://travis-ci.org/Zev Eisenberg/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
## Usage
To run the example project, run `pod try BonMot`, or clone the repo and open `Example/BonMot.xcworkspace`.
## Requirements
## Installation
BonMot is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "BonMot"
```
## Author
Zev Eisenberg, zev.eisenberg@raizlabs.com
## License
BonMot is available under the MIT license. See the LICENSE file for more info.
| Update readme instructions for running the sample project. | Update readme instructions for running the sample project.
| Markdown | mit | Raizlabs/BonMot,Raizlabs/BonMot,Raizlabs/BonMot | markdown | ## Code Before:
[](https://travis-ci.org/Zev Eisenberg/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
BonMot is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "BonMot"
```
## Author
Zev Eisenberg, zev.eisenberg@raizlabs.com
## License
BonMot is available under the MIT license. See the LICENSE file for more info.
## Instruction:
Update readme instructions for running the sample project.
## Code After:
[](https://travis-ci.org/Zev Eisenberg/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
## Usage
To run the example project, run `pod try BonMot`, or clone the repo and open `Example/BonMot.xcworkspace`.
## Requirements
## Installation
BonMot is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "BonMot"
```
## Author
Zev Eisenberg, zev.eisenberg@raizlabs.com
## License
BonMot is available under the MIT license. See the LICENSE file for more info.
|
[](https://travis-ci.org/Zev Eisenberg/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
[](http://cocoapods.org/pods/BonMot)
## Usage
- To run the example project, clone the repo, and run `pod install` from the Example directory first.
+ To run the example project, run `pod try BonMot`, or clone the repo and open `Example/BonMot.xcworkspace`.
## Requirements
## Installation
BonMot is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "BonMot"
```
## Author
Zev Eisenberg, zev.eisenberg@raizlabs.com
## License
BonMot is available under the MIT license. See the LICENSE file for more info. | 2 | 0.071429 | 1 | 1 |
2770d499cc3d3e47bc7c5d30a272e860c18cff73 | test/validate-config.js | test/validate-config.js | var test = require('tape')
test('load config in eslint to validate all rule syntax is correct', function (t) {
var CLIEngine = require('eslint').CLIEngine
var cli = new CLIEngine({
useEslintrc: false,
configFile: 'eslintrc.json'
})
t.ok(cli.executeOnText('var foo\n'))
t.end()
})
| var test = require('tape')
test('load config in eslint to validate all rule syntax is correct', function (t) {
var CLIEngine = require('eslint').CLIEngine
var cli = new CLIEngine({
useEslintrc: false,
configFile: 'eslintrc.json'
})
var code = 'var foo = 1\nvar bar = function () {}\nbar(foo)\n'
t.ok(cli.executeOnText(code).errorCount === 0)
t.end()
})
| Make test check for errorCount of 0 | Make test check for errorCount of 0
| JavaScript | mit | valedaemon/eslint-config-postmodern,feross/eslint-config-standard | javascript | ## Code Before:
var test = require('tape')
test('load config in eslint to validate all rule syntax is correct', function (t) {
var CLIEngine = require('eslint').CLIEngine
var cli = new CLIEngine({
useEslintrc: false,
configFile: 'eslintrc.json'
})
t.ok(cli.executeOnText('var foo\n'))
t.end()
})
## Instruction:
Make test check for errorCount of 0
## Code After:
var test = require('tape')
test('load config in eslint to validate all rule syntax is correct', function (t) {
var CLIEngine = require('eslint').CLIEngine
var cli = new CLIEngine({
useEslintrc: false,
configFile: 'eslintrc.json'
})
var code = 'var foo = 1\nvar bar = function () {}\nbar(foo)\n'
t.ok(cli.executeOnText(code).errorCount === 0)
t.end()
})
| var test = require('tape')
test('load config in eslint to validate all rule syntax is correct', function (t) {
var CLIEngine = require('eslint').CLIEngine
var cli = new CLIEngine({
useEslintrc: false,
configFile: 'eslintrc.json'
})
- t.ok(cli.executeOnText('var foo\n'))
+ var code = 'var foo = 1\nvar bar = function () {}\nbar(foo)\n'
+
+ t.ok(cli.executeOnText(code).errorCount === 0)
t.end()
}) | 4 | 0.307692 | 3 | 1 |
6ff6042437b707b34bc9c97698e86a1792dee60e | bin/afternoon_seal.sh | bin/afternoon_seal.sh |
teams=(
data-informed-content
modelling-services
reliability-engineering
)
for team in ${teams[*]} ; do
./bin/seal.rb $team quotes
done
|
teams=(
data-informed-content
modelling-services
reliability-engineering
gov-uk-licensing-support
)
for team in ${teams[*]} ; do
./bin/seal.rb $team quotes
done
| Add licensing team to schedule | Add licensing team to schedule | Shell | mit | binaryberry/seal,binaryberry/seal | shell | ## Code Before:
teams=(
data-informed-content
modelling-services
reliability-engineering
)
for team in ${teams[*]} ; do
./bin/seal.rb $team quotes
done
## Instruction:
Add licensing team to schedule
## Code After:
teams=(
data-informed-content
modelling-services
reliability-engineering
gov-uk-licensing-support
)
for team in ${teams[*]} ; do
./bin/seal.rb $team quotes
done
|
teams=(
data-informed-content
modelling-services
reliability-engineering
+ gov-uk-licensing-support
)
for team in ${teams[*]} ; do
./bin/seal.rb $team quotes
done | 1 | 0.1 | 1 | 0 |
ee4a667d1b8379e80b913dacb1257e2fe958a009 | CREDITS.md | CREDITS.md |
- [vscode-icons](https://github.com/vscode-icons/vscode-icons) for providing beautiful icons and their definitions
- [refined-github](https://github.com/sindresorhus/refined-github/blob/master/src/libs/page-detect.js) for github page detect functions
- [hide-files-on-github](https://github.com/sindresorhus/hide-files-on-github) for `pjax:end` event listener + observerFragment
|
- [dderevjanik](https://github.com/dderevjanik)
- [s-weigand](https://github.com/s-weigand)
- [kidonng](https://github.com/kidonng)
- [antoinerousseau](https://github.com/antoinerousseau)
## Projects
- [vscode-icons](https://github.com/vscode-icons/vscode-icons) for providing beautiful icons and their definitions
- [refined-github](https://github.com/sindresorhus/refined-github/blob/master/src/libs/page-detect.js) for github page detect functions
- [hide-files-on-github](https://github.com/sindresorhus/hide-files-on-github) for `pjax:end` event listener + observerFragment
| Add contributors section to README | Add contributors section to README
| Markdown | mit | dderevjanik/github-vscode-icons,dderevjanik/github-vscode-icons,dderevjanik/github-vscode-icons | markdown | ## Code Before:
- [vscode-icons](https://github.com/vscode-icons/vscode-icons) for providing beautiful icons and their definitions
- [refined-github](https://github.com/sindresorhus/refined-github/blob/master/src/libs/page-detect.js) for github page detect functions
- [hide-files-on-github](https://github.com/sindresorhus/hide-files-on-github) for `pjax:end` event listener + observerFragment
## Instruction:
Add contributors section to README
## Code After:
- [dderevjanik](https://github.com/dderevjanik)
- [s-weigand](https://github.com/s-weigand)
- [kidonng](https://github.com/kidonng)
- [antoinerousseau](https://github.com/antoinerousseau)
## Projects
- [vscode-icons](https://github.com/vscode-icons/vscode-icons) for providing beautiful icons and their definitions
- [refined-github](https://github.com/sindresorhus/refined-github/blob/master/src/libs/page-detect.js) for github page detect functions
- [hide-files-on-github](https://github.com/sindresorhus/hide-files-on-github) for `pjax:end` event listener + observerFragment
| +
+ - [dderevjanik](https://github.com/dderevjanik)
+ - [s-weigand](https://github.com/s-weigand)
+ - [kidonng](https://github.com/kidonng)
+ - [antoinerousseau](https://github.com/antoinerousseau)
+
+ ## Projects
- [vscode-icons](https://github.com/vscode-icons/vscode-icons) for providing beautiful icons and their definitions
- [refined-github](https://github.com/sindresorhus/refined-github/blob/master/src/libs/page-detect.js) for github page detect functions
- [hide-files-on-github](https://github.com/sindresorhus/hide-files-on-github) for `pjax:end` event listener + observerFragment | 7 | 1.75 | 7 | 0 |
8ac5aa685edbdf745b1ad371b8da4eabff98ba34 | data/sql/updates/pending_db_world/rev_1527682153565076000.sql | data/sql/updates/pending_db_world/rev_1527682153565076000.sql | INSERT INTO version_db_world (`sql_rev`) VALUES ('1527682153565076000');
DELETE FROM `smart_scripts` WHERE `entryorguid` = 177385;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(177385,1,0,1,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,43178,175610,0,0,0,0,0,'Torch - On Gossip Hello - Set Gameobject State'),
(177385,1,1,0,61,0,100,0,0,0,0,0,106,16,0,0,0,0,0,20,176944,200,0,0,0,0,0,'Torch - On Gossip Hello - Remove Gameobject Flag');
| INSERT INTO version_db_world (`sql_rev`) VALUES ('1527682153565076000');
UPDATE `smart_scripts` SET
`event_type` = 70,
`event_param1` = 2,
`action_type` = 9,
`action_param1` = 0,
`target_type` = 14,
`target_param1` = 43178,
`target_param2` = 175610
WHERE `entryorguid` = 177385 AND `id` = 0;
| Change to UPDATE command to be compliant with AC's guidelines | Change to UPDATE command to be compliant with AC's guidelines | SQL | agpl-3.0 | Helias/azerothcore-wotlk,Helias/azerothcore-wotlk,Nefertumm/azerothcore-wotlk,ShinDarth/azerothcore-wotlk,Nefertumm/azerothcore-wotlk,jokerlfm/azerothcore-wotlk,jokerlfm/azerothcore-wotlk,jokerlfm/azerothcore-wotlk,azerothcore/azerothcore-wotlk,Helias/azerothcore-wotlk,azerothcore/azerothcore-wotlk,azerothcore/azerothcore-wotlk,Nefertumm/azerothcore-wotlk,azerothcore/azerothcore-wotlk,Nefertumm/azerothcore-wotlk,ShinDarth/azerothcore-wotlk,azerothcore/azerothcore-wotlk,mygithome002/azerothcore-wotlk,ShinDarth/azerothcore-wotlk,mygithome002/azerothcore-wotlk,jokerlfm/azerothcore-wotlk,mygithome002/azerothcore-wotlk,mygithome002/azerothcore-wotlk,mygithome002/azerothcore-wotlk,Helias/azerothcore-wotlk,Helias/azerothcore-wotlk,mygithome002/azerothcore-wotlk,Nefertumm/azerothcore-wotlk,ShinDarth/azerothcore-wotlk,jokerlfm/azerothcore-wotlk,Nefertumm/azerothcore-wotlk,azerothcore/azerothcore-wotlk,Helias/azerothcore-wotlk,jokerlfm/azerothcore-wotlk | sql | ## Code Before:
INSERT INTO version_db_world (`sql_rev`) VALUES ('1527682153565076000');
DELETE FROM `smart_scripts` WHERE `entryorguid` = 177385;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(177385,1,0,1,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,43178,175610,0,0,0,0,0,'Torch - On Gossip Hello - Set Gameobject State'),
(177385,1,1,0,61,0,100,0,0,0,0,0,106,16,0,0,0,0,0,20,176944,200,0,0,0,0,0,'Torch - On Gossip Hello - Remove Gameobject Flag');
## Instruction:
Change to UPDATE command to be compliant with AC's guidelines
## Code After:
INSERT INTO version_db_world (`sql_rev`) VALUES ('1527682153565076000');
UPDATE `smart_scripts` SET
`event_type` = 70,
`event_param1` = 2,
`action_type` = 9,
`action_param1` = 0,
`target_type` = 14,
`target_param1` = 43178,
`target_param2` = 175610
WHERE `entryorguid` = 177385 AND `id` = 0;
| INSERT INTO version_db_world (`sql_rev`) VALUES ('1527682153565076000');
- DELETE FROM `smart_scripts` WHERE `entryorguid` = 177385;
- INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
- (177385,1,0,1,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,43178,175610,0,0,0,0,0,'Torch - On Gossip Hello - Set Gameobject State'),
- (177385,1,1,0,61,0,100,0,0,0,0,0,106,16,0,0,0,0,0,20,176944,200,0,0,0,0,0,'Torch - On Gossip Hello - Remove Gameobject Flag');
+ UPDATE `smart_scripts` SET
+ `event_type` = 70,
+ `event_param1` = 2,
+ `action_type` = 9,
+ `action_param1` = 0,
+ `target_type` = 14,
+ `target_param1` = 43178,
+ `target_param2` = 175610
+ WHERE `entryorguid` = 177385 AND `id` = 0; | 13 | 2.166667 | 9 | 4 |
56f40850d67994d4bc56bc15d127459fc6d61773 | scripts/jenkins/cloud/ansible/roles/ssh_keys/tasks/main.yml | scripts/jenkins/cloud/ansible/roles/ssh_keys/tasks/main.yml | ---
- name: Copy SSH keys
blockinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
block: |
{% for dict_item in ssh_pub_keys %}
{% for key in dict_item['keys'] %}
{{ key }}
{% endfor %}
{% endfor %}
- block:
- name: Create local SSH key on deployer
shell: ssh-keygen -t rsa -f "{{ ansible_env.HOME }}/.ssh/id_rsa" -N ""
delegate_to: localhost
args:
creates: "{{ ansible_env.HOME }}/.ssh/id_rsa"
- name: Copy local SSH key to deployer
lineinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
line: "{{ lookup('file', ansible_env.HOME + '/.ssh/id_rsa.pub') }}"
when: local_ssh_key
| ---
- name: Copy SSH keys
blockinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
block: |
{% for dict_item in ssh_pub_keys %}
{% for key in dict_item['keys'] %}
{{ key }}
{% endfor %}
{% endfor %}
- block:
- name: Create local SSH key
shell: ssh-keygen -t rsa -f "{{ lookup('env', 'HOME') }}/.ssh/id_rsa" -N ""
delegate_to: localhost
args:
creates: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa"
- name: Copy local SSH key to deployer
lineinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
line: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/id_rsa.pub') }}"
when: local_ssh_key
| Create the local ssh key in the right directory | Create the local ssh key in the right directory
The local ssh key needs to be added to the home directory of the user
running the Ansible playbook.
Signed-off-by: Nicolas Bock <4ad6fd604400c7892c7a2cb53bf674987bcaa405@suse.com>
| YAML | apache-2.0 | SUSE-Cloud/automation,gosipyan/automation,gosipyan/automation,SUSE-Cloud/automation,aspiers/automation,aspiers/automation,gosipyan/automation,gosipyan/automation,SUSE-Cloud/automation,SUSE-Cloud/automation,aspiers/automation,aspiers/automation | yaml | ## Code Before:
---
- name: Copy SSH keys
blockinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
block: |
{% for dict_item in ssh_pub_keys %}
{% for key in dict_item['keys'] %}
{{ key }}
{% endfor %}
{% endfor %}
- block:
- name: Create local SSH key on deployer
shell: ssh-keygen -t rsa -f "{{ ansible_env.HOME }}/.ssh/id_rsa" -N ""
delegate_to: localhost
args:
creates: "{{ ansible_env.HOME }}/.ssh/id_rsa"
- name: Copy local SSH key to deployer
lineinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
line: "{{ lookup('file', ansible_env.HOME + '/.ssh/id_rsa.pub') }}"
when: local_ssh_key
## Instruction:
Create the local ssh key in the right directory
The local ssh key needs to be added to the home directory of the user
running the Ansible playbook.
Signed-off-by: Nicolas Bock <4ad6fd604400c7892c7a2cb53bf674987bcaa405@suse.com>
## Code After:
---
- name: Copy SSH keys
blockinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
block: |
{% for dict_item in ssh_pub_keys %}
{% for key in dict_item['keys'] %}
{{ key }}
{% endfor %}
{% endfor %}
- block:
- name: Create local SSH key
shell: ssh-keygen -t rsa -f "{{ lookup('env', 'HOME') }}/.ssh/id_rsa" -N ""
delegate_to: localhost
args:
creates: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa"
- name: Copy local SSH key to deployer
lineinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
line: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/id_rsa.pub') }}"
when: local_ssh_key
| ---
- name: Copy SSH keys
blockinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
block: |
{% for dict_item in ssh_pub_keys %}
{% for key in dict_item['keys'] %}
{{ key }}
{% endfor %}
{% endfor %}
- block:
- - name: Create local SSH key on deployer
? ------------
+ - name: Create local SSH key
- shell: ssh-keygen -t rsa -f "{{ ansible_env.HOME }}/.ssh/id_rsa" -N ""
? ----- ^^ ^
+ shell: ssh-keygen -t rsa -f "{{ lookup('env', 'HOME') }}/.ssh/id_rsa" -N ""
? ^^^^^^^ ^^^^ ++
delegate_to: localhost
args:
- creates: "{{ ansible_env.HOME }}/.ssh/id_rsa"
? ----- ^^ ^
+ creates: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa"
? ^^^^^^^ ^^^^ ++
- name: Copy local SSH key to deployer
lineinfile:
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
create: yes
- line: "{{ lookup('file', ansible_env.HOME + '/.ssh/id_rsa.pub') }}"
? ----- ^^ ^
+ line: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/id_rsa.pub') }}"
? ^^^^^^^ ^^^^ ++
when: local_ssh_key | 8 | 0.307692 | 4 | 4 |
f40adaed196ef7d79d0dc356ab70c81289a3bb5f | models/History.php | models/History.php | <?php
namespace app\models;
use Yii;
/**
* This is the model class for table "History".
*
* @property integer $counterId
* @property string $startDate
* @property string $endDate
*
* @property Counters $counter
*/
class History extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'History';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['counterId', 'startDate', 'endDate'], 'required'],
[['startDate', 'endDate'], 'string'],
[['counterId'], 'integer'],
[['counterId', 'startDate', 'endDate'], 'unique', 'targetAttribute' => ['counterId', 'startDate', 'endDate'], 'message' => 'The combination of Counter ID, Start Date and End Date has already been taken.']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'counterId' => 'Counter ID',
'startDate' => 'Start Date',
'endDate' => 'End Date',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getCounter()
{
return $this->hasOne(Counter::className(), ['counterId' => 'counterId']);
}
}
| <?php
namespace app\models;
use Yii;
/**
* This is the model class for table "History".
*
* @property integer $counterId
* @property string $startDate
* @property string $endDate
*
* @property Counters $counter
*/
class History extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'History';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['counterId', 'startDate'], 'required'],
[['startDate', 'endDate'], 'string'],
[['counterId'], 'integer'],
[['counterId', 'startDate', 'endDate'], 'unique', 'targetAttribute' => ['counterId', 'startDate', 'endDate'], 'message' => 'The combination of Counter ID, Start Date and End Date has already been taken.']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'counterId' => 'Counter ID',
'startDate' => 'Start Date',
'endDate' => 'End Date',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getCounter()
{
return $this->hasOne(Counter::className(), ['counterId' => 'counterId']);
}
}
| Make end date not required. | Make end date not required.
| PHP | bsd-3-clause | wangchj/countup,wangchj/countup | php | ## Code Before:
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "History".
*
* @property integer $counterId
* @property string $startDate
* @property string $endDate
*
* @property Counters $counter
*/
class History extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'History';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['counterId', 'startDate', 'endDate'], 'required'],
[['startDate', 'endDate'], 'string'],
[['counterId'], 'integer'],
[['counterId', 'startDate', 'endDate'], 'unique', 'targetAttribute' => ['counterId', 'startDate', 'endDate'], 'message' => 'The combination of Counter ID, Start Date and End Date has already been taken.']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'counterId' => 'Counter ID',
'startDate' => 'Start Date',
'endDate' => 'End Date',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getCounter()
{
return $this->hasOne(Counter::className(), ['counterId' => 'counterId']);
}
}
## Instruction:
Make end date not required.
## Code After:
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "History".
*
* @property integer $counterId
* @property string $startDate
* @property string $endDate
*
* @property Counters $counter
*/
class History extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'History';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['counterId', 'startDate'], 'required'],
[['startDate', 'endDate'], 'string'],
[['counterId'], 'integer'],
[['counterId', 'startDate', 'endDate'], 'unique', 'targetAttribute' => ['counterId', 'startDate', 'endDate'], 'message' => 'The combination of Counter ID, Start Date and End Date has already been taken.']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'counterId' => 'Counter ID',
'startDate' => 'Start Date',
'endDate' => 'End Date',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getCounter()
{
return $this->hasOne(Counter::className(), ['counterId' => 'counterId']);
}
}
| <?php
namespace app\models;
use Yii;
/**
* This is the model class for table "History".
*
* @property integer $counterId
* @property string $startDate
* @property string $endDate
*
* @property Counters $counter
*/
class History extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'History';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
- [['counterId', 'startDate', 'endDate'], 'required'],
? -----------
+ [['counterId', 'startDate'], 'required'],
[['startDate', 'endDate'], 'string'],
[['counterId'], 'integer'],
[['counterId', 'startDate', 'endDate'], 'unique', 'targetAttribute' => ['counterId', 'startDate', 'endDate'], 'message' => 'The combination of Counter ID, Start Date and End Date has already been taken.']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'counterId' => 'Counter ID',
'startDate' => 'Start Date',
'endDate' => 'End Date',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getCounter()
{
return $this->hasOne(Counter::className(), ['counterId' => 'counterId']);
}
} | 2 | 0.034483 | 1 | 1 |
731f2d38e479e71a782e73a0445f346e3340e54d | genetic/seeds/default_constraints.yaml | genetic/seeds/default_constraints.yaml | data:
constraint_list:
name: defaults
course_constraints:
-
code: CSC 111
before_after: before
time: "12:20"
priority: Low
-
code: CSC 450
before_after: after
time: "11:15"
priority: Medium
instructor_constraints:
time_pref:
-
instr_name: Smith
before_after: before
time: "13:25"
priority: Medium
day_pref:
-
instr_name: Shade
day_code: TR
priority: Low
computer_pref:
-
instr_name: Scroggins
prefers_computers: True
priority: Mandatory
max_courses:
-
instr_name: Liu
max_courses: 2
priority: Low
instructor_break:
-
instr_name: Vollmar
break_start: "08:15"
break_end: "11:00"
priority: High | data:
constraint_list:
name: defaults
course_constraints:
-
code: CSC 111
before_after: before
time: "12:20"
priority: Low
-
code: CSC 450
before_after: after
time: "11:15"
priority: Medium
instructor_constraints:
time_pref:
-
instr_name: Smith
before_after: before
time: "13:25"
priority: Medium
day_pref:
-
instr_name: Shade
day_code: TR
priority: Low
computer_pref:
-
instr_name: Scroggins
prefers_computers: True
priority: Mandatory
max_courses:
-
instr_name: Liu
max_courses: 2
priority: Low
instructor_break:
-
instr_name: Vollmar
break_start: "08:15"
break_end: "11:00"
priority: High
| Fix indentation in default constraints file | Fix indentation in default constraints file
| YAML | mit | donnell74/CSC-450-Scheduler | yaml | ## Code Before:
data:
constraint_list:
name: defaults
course_constraints:
-
code: CSC 111
before_after: before
time: "12:20"
priority: Low
-
code: CSC 450
before_after: after
time: "11:15"
priority: Medium
instructor_constraints:
time_pref:
-
instr_name: Smith
before_after: before
time: "13:25"
priority: Medium
day_pref:
-
instr_name: Shade
day_code: TR
priority: Low
computer_pref:
-
instr_name: Scroggins
prefers_computers: True
priority: Mandatory
max_courses:
-
instr_name: Liu
max_courses: 2
priority: Low
instructor_break:
-
instr_name: Vollmar
break_start: "08:15"
break_end: "11:00"
priority: High
## Instruction:
Fix indentation in default constraints file
## Code After:
data:
constraint_list:
name: defaults
course_constraints:
-
code: CSC 111
before_after: before
time: "12:20"
priority: Low
-
code: CSC 450
before_after: after
time: "11:15"
priority: Medium
instructor_constraints:
time_pref:
-
instr_name: Smith
before_after: before
time: "13:25"
priority: Medium
day_pref:
-
instr_name: Shade
day_code: TR
priority: Low
computer_pref:
-
instr_name: Scroggins
prefers_computers: True
priority: Mandatory
max_courses:
-
instr_name: Liu
max_courses: 2
priority: Low
instructor_break:
-
instr_name: Vollmar
break_start: "08:15"
break_end: "11:00"
priority: High
| data:
constraint_list:
name: defaults
course_constraints:
-
code: CSC 111
before_after: before
time: "12:20"
priority: Low
-
code: CSC 450
before_after: after
time: "11:15"
priority: Medium
instructor_constraints:
- time_pref:
? --
+ time_pref:
- -
? --
+ -
- instr_name: Smith
? --
+ instr_name: Smith
- before_after: before
? --
+ before_after: before
- time: "13:25"
? --
+ time: "13:25"
- priority: Medium
? --
+ priority: Medium
- day_pref:
? --
+ day_pref:
- -
? --
+ -
- instr_name: Shade
? --
+ instr_name: Shade
- day_code: TR
? --
+ day_code: TR
- priority: Low
? --
+ priority: Low
- computer_pref:
? --
+ computer_pref:
- -
? --
+ -
- instr_name: Scroggins
? --
+ instr_name: Scroggins
- prefers_computers: True
? --
+ prefers_computers: True
- priority: Mandatory
? --
+ priority: Mandatory
- max_courses:
? --
+ max_courses:
- -
? --
+ -
- instr_name: Liu
? --
+ instr_name: Liu
- max_courses: 2
? --
+ max_courses: 2
- priority: Low
? --
+ priority: Low
- instructor_break:
? --
+ instructor_break:
- -
? --
+ -
- instr_name: Vollmar
? --
+ instr_name: Vollmar
- break_start: "08:15"
? --
+ break_start: "08:15"
- break_end: "11:00"
? --
+ break_end: "11:00"
- priority: High
? --
+ priority: High | 54 | 1.285714 | 27 | 27 |
35e821f8eeb9a158f41d35a933392bd019b4ef2b | cla_public/assets-src/stylesheets/design-patterns/_notice.scss | cla_public/assets-src/stylesheets/design-patterns/_notice.scss | .Notice {
border-left: 3px solid $orange;
background-color: lighten($orange-25, 6%);
padding: 12px 40px;
margin: 15px 0 40px;
} | .Notice {
border-left: 3px solid $orange;
background-color: lighten($orange-25, 6%);
padding: 12px 40px;
margin: 15px 0 40px;
p {
@include core-16;
padding: {
top: 5px;
bottom: 5px;
};
}
} | Update paragraph styles within notice | Update paragraph styles within notice
| SCSS | mit | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public | scss | ## Code Before:
.Notice {
border-left: 3px solid $orange;
background-color: lighten($orange-25, 6%);
padding: 12px 40px;
margin: 15px 0 40px;
}
## Instruction:
Update paragraph styles within notice
## Code After:
.Notice {
border-left: 3px solid $orange;
background-color: lighten($orange-25, 6%);
padding: 12px 40px;
margin: 15px 0 40px;
p {
@include core-16;
padding: {
top: 5px;
bottom: 5px;
};
}
} | .Notice {
border-left: 3px solid $orange;
background-color: lighten($orange-25, 6%);
padding: 12px 40px;
margin: 15px 0 40px;
+
+ p {
+ @include core-16;
+ padding: {
+ top: 5px;
+ bottom: 5px;
+ };
+ }
} | 8 | 1.333333 | 8 | 0 |
66a7c035208845a979fc6da85b5aa0943308952b | src/nih_wayfinding/app/scripts/views/profile/profiles-controller.js | src/nih_wayfinding/app/scripts/views/profile/profiles-controller.js | (function () {
'use strict';
/* ngInject */
function ProfilesController(NavbarConfig, ProfileService) {
var ctl = this;
initialize();
function initialize() {
ProfileService.createProfile('Donald');
ProfileService.createProfile('Mickey');
ProfileService.createProfile('Minnie');
ctl.usernames = ProfileService.getProfileNames();
var title = ctl.usernames.length ? ctl.usernames[0] : 'Profile';
NavbarConfig.set({ title: ctl.usernames[0]});
}
}
angular.module('nih.views.profile')
.controller('ProfilesController', ProfilesController);
})();
| (function () {
'use strict';
/* ngInject */
function ProfilesController(NavbarConfig, ProfileService) {
var ctl = this;
initialize();
function initialize() {
ProfileService.createProfile('Donald');
ProfileService.createProfile('Mickey');
ProfileService.createProfile('Minnie');
ctl.usernames = ProfileService.getProfileNames();
var title = ctl.usernames.length ? ctl.usernames[0] : 'Profile';
NavbarConfig.set({ title: title});
}
}
angular.module('nih.views.profile')
.controller('ProfilesController', ProfilesController);
})();
| Fix unused title in profiles controller | Fix unused title in profiles controller
| JavaScript | apache-2.0 | azavea/nih-wayfinding,azavea/nih-wayfinding | javascript | ## Code Before:
(function () {
'use strict';
/* ngInject */
function ProfilesController(NavbarConfig, ProfileService) {
var ctl = this;
initialize();
function initialize() {
ProfileService.createProfile('Donald');
ProfileService.createProfile('Mickey');
ProfileService.createProfile('Minnie');
ctl.usernames = ProfileService.getProfileNames();
var title = ctl.usernames.length ? ctl.usernames[0] : 'Profile';
NavbarConfig.set({ title: ctl.usernames[0]});
}
}
angular.module('nih.views.profile')
.controller('ProfilesController', ProfilesController);
})();
## Instruction:
Fix unused title in profiles controller
## Code After:
(function () {
'use strict';
/* ngInject */
function ProfilesController(NavbarConfig, ProfileService) {
var ctl = this;
initialize();
function initialize() {
ProfileService.createProfile('Donald');
ProfileService.createProfile('Mickey');
ProfileService.createProfile('Minnie');
ctl.usernames = ProfileService.getProfileNames();
var title = ctl.usernames.length ? ctl.usernames[0] : 'Profile';
NavbarConfig.set({ title: title});
}
}
angular.module('nih.views.profile')
.controller('ProfilesController', ProfilesController);
})();
| (function () {
'use strict';
/* ngInject */
function ProfilesController(NavbarConfig, ProfileService) {
var ctl = this;
initialize();
function initialize() {
ProfileService.createProfile('Donald');
ProfileService.createProfile('Mickey');
ProfileService.createProfile('Minnie');
ctl.usernames = ProfileService.getProfileNames();
var title = ctl.usernames.length ? ctl.usernames[0] : 'Profile';
- NavbarConfig.set({ title: ctl.usernames[0]});
? ^ --- ---------
+ NavbarConfig.set({ title: title});
? ^^
}
}
angular.module('nih.views.profile')
.controller('ProfilesController', ProfilesController);
})(); | 2 | 0.086957 | 1 | 1 |
fdb466a586fc14da8ddbe5354a3e761d68a1d4a1 | copyright.js | copyright.js | function hideBox() {
$("#copyright-campaign-box").hide();
if(typeof(Storage)!=="undefined") {
localStorage.boxClosed = true;
}
}
$(document).ready(function (e) {
if(typeof(Storage)!=="undefined" && localStorage.boxClosed) {
hideBox();
}
$("#close-copyright-campaign-box").click(function(e) {
hideBox();
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
hideBox();
}
});
});
| function hideBox() {
$("#copyright-campaign-box").hide();
if(typeof(Storage)!=="undefined") {
//localStorage.boxClosed = true; // removed for testing
}
}
$(document).ready(function (e) {
if(typeof(Storage)!=="undefined" && localStorage.boxClosed) {
hideBox();
}
$("#close-copyright-campaign-box").click(function(e) {
hideBox();
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
hideBox();
}
});
});
| Remove localStorage boxClosed for testing | Remove localStorage boxClosed for testing
| JavaScript | mit | SC5/copyright-campaign | javascript | ## Code Before:
function hideBox() {
$("#copyright-campaign-box").hide();
if(typeof(Storage)!=="undefined") {
localStorage.boxClosed = true;
}
}
$(document).ready(function (e) {
if(typeof(Storage)!=="undefined" && localStorage.boxClosed) {
hideBox();
}
$("#close-copyright-campaign-box").click(function(e) {
hideBox();
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
hideBox();
}
});
});
## Instruction:
Remove localStorage boxClosed for testing
## Code After:
function hideBox() {
$("#copyright-campaign-box").hide();
if(typeof(Storage)!=="undefined") {
//localStorage.boxClosed = true; // removed for testing
}
}
$(document).ready(function (e) {
if(typeof(Storage)!=="undefined" && localStorage.boxClosed) {
hideBox();
}
$("#close-copyright-campaign-box").click(function(e) {
hideBox();
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
hideBox();
}
});
});
| function hideBox() {
$("#copyright-campaign-box").hide();
if(typeof(Storage)!=="undefined") {
- localStorage.boxClosed = true;
+ //localStorage.boxClosed = true; // removed for testing
? ++ +++++++++++++++++++++++
}
}
$(document).ready(function (e) {
if(typeof(Storage)!=="undefined" && localStorage.boxClosed) {
hideBox();
}
$("#close-copyright-campaign-box").click(function(e) {
hideBox();
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
hideBox();
}
});
}); | 2 | 0.090909 | 1 | 1 |
19a8a0e2f85b7ab01cbd3e2dd283e8e1e9b97373 | example/example/tasksapp/run_tasks.py | example/example/tasksapp/run_tasks.py | import time
from dj_experiment.tasks.tasks import longtime_add
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds to ensure the task has been finished
time.sleep(10)
# now the task should be finished and ready method will return True
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
| import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds to ensure the task has been finished
time.sleep(10)
# now the task should be finished and ready method will return True
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
result1 = netcdf_save.delay(14, '')
print 'Task netcdf finished? ', result1.ready()
print 'Task result1: ', result1.result
time.sleep(10)
print 'Task netcdf finished? ', result1.ready()
print 'Task result1: ', result1.result
| Add the use of task to the example app | Add the use of task to the example app
| Python | mit | francbartoli/dj-experiment,francbartoli/dj-experiment | python | ## Code Before:
import time
from dj_experiment.tasks.tasks import longtime_add
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds to ensure the task has been finished
time.sleep(10)
# now the task should be finished and ready method will return True
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
## Instruction:
Add the use of task to the example app
## Code After:
import time
from dj_experiment.tasks.tasks import longtime_add, netcdf_save
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds to ensure the task has been finished
time.sleep(10)
# now the task should be finished and ready method will return True
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
result1 = netcdf_save.delay(14, '')
print 'Task netcdf finished? ', result1.ready()
print 'Task result1: ', result1.result
time.sleep(10)
print 'Task netcdf finished? ', result1.ready()
print 'Task result1: ', result1.result
| import time
- from dj_experiment.tasks.tasks import longtime_add
+ from dj_experiment.tasks.tasks import longtime_add, netcdf_save
? +++++++++++++
if __name__ == '__main__':
result = longtime_add.delay(1, 2)
# at this time, our task is not finished, so it will return False
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
# sleep 10 seconds to ensure the task has been finished
time.sleep(10)
# now the task should be finished and ready method will return True
print 'Task finished? ', result.ready()
print 'Task result: ', result.result
+
+ result1 = netcdf_save.delay(14, '')
+ print 'Task netcdf finished? ', result1.ready()
+ print 'Task result1: ', result1.result
+ time.sleep(10)
+ print 'Task netcdf finished? ', result1.ready()
+ print 'Task result1: ', result1.result | 9 | 0.642857 | 8 | 1 |
065c9262062fbc7fca0f7e98f1423c13a4b557b1 | config.yml | config.yml | development:
repository_names:
- dkubb/adamantium
- dkubb/ice_nine
- dkubb/equalizer
- dkubb/descendants_tracker
- dkubb/abstract_class
- dkubb/veritas
- dkubb/veritas-sql-generator
- dkubb/veritas-optimizer
- dkubb/veritas-do-adapter
- datamapper/dm-session
- datamapper/dm-mapper
- datamapper/dm-relationship-graph
- datamapper/devtools
- solnic/coercible
- solnic/virtus
- mbj/veritas-mongo-adapter
- mbj/veritas-elasticsearch-adapter
- mbj/anima
- mbj/mutant
- mbj/aequitas
- mbj/inflecto
| development:
repository_names:
- dkubb/adamantium
- dkubb/ice_nine
- dkubb/equalizer
- dkubb/descendants_tracker
- dkubb/abstract_class
- dkubb/veritas
- dkubb/veritas-sql-generator
- dkubb/veritas-optimizer
- dkubb/veritas-do-adapter
- datamapper/dm-session
- datamapper/dm-mapper
- datamapper/dm-relationship-graph
- datamapper/devtools
- solnic/coercible
- solnic/virtus
- mbj/veritas-mongo-adapter
- mbj/veritas-elasticsearch-adapter
- mbj/veritas-arango-adapter
- mbj/aql
- mbj/anima
- mbj/mutant
- mbj/to_source
- mbj/aequitas
- mbj/inflecto
| Add to_source and arango stuff | Add to_source and arango stuff
| YAML | mit | zaidan/rom-status | yaml | ## Code Before:
development:
repository_names:
- dkubb/adamantium
- dkubb/ice_nine
- dkubb/equalizer
- dkubb/descendants_tracker
- dkubb/abstract_class
- dkubb/veritas
- dkubb/veritas-sql-generator
- dkubb/veritas-optimizer
- dkubb/veritas-do-adapter
- datamapper/dm-session
- datamapper/dm-mapper
- datamapper/dm-relationship-graph
- datamapper/devtools
- solnic/coercible
- solnic/virtus
- mbj/veritas-mongo-adapter
- mbj/veritas-elasticsearch-adapter
- mbj/anima
- mbj/mutant
- mbj/aequitas
- mbj/inflecto
## Instruction:
Add to_source and arango stuff
## Code After:
development:
repository_names:
- dkubb/adamantium
- dkubb/ice_nine
- dkubb/equalizer
- dkubb/descendants_tracker
- dkubb/abstract_class
- dkubb/veritas
- dkubb/veritas-sql-generator
- dkubb/veritas-optimizer
- dkubb/veritas-do-adapter
- datamapper/dm-session
- datamapper/dm-mapper
- datamapper/dm-relationship-graph
- datamapper/devtools
- solnic/coercible
- solnic/virtus
- mbj/veritas-mongo-adapter
- mbj/veritas-elasticsearch-adapter
- mbj/veritas-arango-adapter
- mbj/aql
- mbj/anima
- mbj/mutant
- mbj/to_source
- mbj/aequitas
- mbj/inflecto
| development:
repository_names:
- dkubb/adamantium
- dkubb/ice_nine
- dkubb/equalizer
- dkubb/descendants_tracker
- dkubb/abstract_class
- dkubb/veritas
- dkubb/veritas-sql-generator
- dkubb/veritas-optimizer
- dkubb/veritas-do-adapter
- datamapper/dm-session
- datamapper/dm-mapper
- datamapper/dm-relationship-graph
- datamapper/devtools
- solnic/coercible
- solnic/virtus
- mbj/veritas-mongo-adapter
- mbj/veritas-elasticsearch-adapter
+ - mbj/veritas-arango-adapter
+ - mbj/aql
- mbj/anima
- mbj/mutant
+ - mbj/to_source
- mbj/aequitas
- mbj/inflecto | 3 | 0.130435 | 3 | 0 |
e67ef1a70ef9f61fb9ee19c48d8c044879c75c15 | conf/standalone.wbmd.yaml | conf/standalone.wbmd.yaml | feature groups:
- group: Next Lattice Unigram
features:
- L0|a,L0|a
- group: Idle
idle: true
features:
- L0|i,n/a
# - group: Next Lattice Previous Path Bigram
# idle: true
# features:
# - L0|a+L0|i,L0|t
| feature groups:
- group: Next Lattice Unigram
features:
- L0|a,L0|a
- L0|t,L0|t
- group: Next Lattice Bigram
features:
- L0|t+L1|t,L0|a
- L0|t+L1|a,L0|a
- L0|a+L1|t,L0|a
- L0|a+L1|a,L0|a
- group: Next Lattice Trigram
features:
- L0|t+L1|t+L2|t,L0|a
- L0|t+L1|a+L2|t,L0|a
- L0|a+L1|t+L2|t,L0|a
- L0|a+L1|a+L2|t,L0|a
- L0|t+L1|t+L2|a,L0|a
- L0|t+L1|a+L2|a,L0|a
- L0|a+L1|t+L2|a,L0|a
- L0|a+L1|a+L2|a,L0|a
- group: Idle
idle: true
features:
- L0|i,n/a
# - group: Next Lattice Previous Path Bigram
# idle: true
# features:
# - L0|a+L0|i,L0|t
| Add Unigram and Trigram features to word based MD | Add Unigram and Trigram features to word based MD
| YAML | apache-2.0 | habeanf/yap,habeanf/yap | yaml | ## Code Before:
feature groups:
- group: Next Lattice Unigram
features:
- L0|a,L0|a
- group: Idle
idle: true
features:
- L0|i,n/a
# - group: Next Lattice Previous Path Bigram
# idle: true
# features:
# - L0|a+L0|i,L0|t
## Instruction:
Add Unigram and Trigram features to word based MD
## Code After:
feature groups:
- group: Next Lattice Unigram
features:
- L0|a,L0|a
- L0|t,L0|t
- group: Next Lattice Bigram
features:
- L0|t+L1|t,L0|a
- L0|t+L1|a,L0|a
- L0|a+L1|t,L0|a
- L0|a+L1|a,L0|a
- group: Next Lattice Trigram
features:
- L0|t+L1|t+L2|t,L0|a
- L0|t+L1|a+L2|t,L0|a
- L0|a+L1|t+L2|t,L0|a
- L0|a+L1|a+L2|t,L0|a
- L0|t+L1|t+L2|a,L0|a
- L0|t+L1|a+L2|a,L0|a
- L0|a+L1|t+L2|a,L0|a
- L0|a+L1|a+L2|a,L0|a
- group: Idle
idle: true
features:
- L0|i,n/a
# - group: Next Lattice Previous Path Bigram
# idle: true
# features:
# - L0|a+L0|i,L0|t
| feature groups:
- group: Next Lattice Unigram
features:
- L0|a,L0|a
+ - L0|t,L0|t
+
+ - group: Next Lattice Bigram
+ features:
+ - L0|t+L1|t,L0|a
+ - L0|t+L1|a,L0|a
+ - L0|a+L1|t,L0|a
+ - L0|a+L1|a,L0|a
+
+ - group: Next Lattice Trigram
+ features:
+ - L0|t+L1|t+L2|t,L0|a
+ - L0|t+L1|a+L2|t,L0|a
+ - L0|a+L1|t+L2|t,L0|a
+ - L0|a+L1|a+L2|t,L0|a
+ - L0|t+L1|t+L2|a,L0|a
+ - L0|t+L1|a+L2|a,L0|a
+ - L0|a+L1|t+L2|a,L0|a
+ - L0|a+L1|a+L2|a,L0|a
- group: Idle
idle: true
features:
- L0|i,n/a
# - group: Next Lattice Previous Path Bigram
# idle: true
# features:
# - L0|a+L0|i,L0|t | 19 | 1.357143 | 19 | 0 |
d8525fdc146c260be292ea0330400eb72efa938a | KeyboardKitDemoKeyboard_SwiftUI/Keyboards/ImageKeyboard.swift | KeyboardKitDemoKeyboard_SwiftUI/Keyboards/ImageKeyboard.swift | //
// ImageKeyboard.swift
// KeyboardKit
//
// Created by Daniel Saidi on 2020-09-13.
// Copyright © 2021 Daniel Saidi. All rights reserved.
//
import KeyboardKit
import KeyboardKitSwiftUI
import SwiftUI
/**
This keyboard is a custom view that is implemented for this
project alone. It implements the shared `DemoImageKeyboard`
and lists its images in a grid, where the number of columns
depend on if the grid is presented in portrait or landscape.
*/
struct ImageKeyboard: View, DemoImageKeyboard {
@EnvironmentObject var context: ObservableKeyboardContext
var body: some View {
KeyboardGrid(
actions: actions,
columns: isLandscape ? 8 : 6,
spacing: 20,
buttonBuilder: button)
}
}
private extension ImageKeyboard {
var isLandscape: Bool { context.controller.deviceOrientation.isLandscape }
func button(for action: KeyboardAction) -> some View {
KeyboardImageButton(action: action)
.keyboardAction(action, context: context)
}
}
| //
// ImageKeyboard.swift
// KeyboardKit
//
// Created by Daniel Saidi on 2020-09-13.
// Copyright © 2021 Daniel Saidi. All rights reserved.
//
import KeyboardKit
import KeyboardKitSwiftUI
import SwiftUI
/**
This keyboard is a custom view that is implemented for this
project alone. It implements the shared `DemoImageKeyboard`
and lists its images in a grid, where the number of columns
depend on if the grid is presented in portrait or landscape.
*/
struct ImageKeyboard: View, DemoImageKeyboard {
@EnvironmentObject var context: ObservableKeyboardContext
var body: some View {
VStack(spacing: 30) {
KeyboardGrid(
actions: actions,
columns: columns,
spacing: 20,
buttonBuilder: imageButton)
bottomRow.frame(height: 40)
}.frame(height: 300)
}
}
private extension ImageKeyboard {
var columns: Int { isLandscape ? 8 : 6 }
var isLandscape: Bool { context.controller.deviceOrientation.isLandscape }
var bottomRow: some View {
button(for: .nextKeyboard)
}
func button(for action: KeyboardAction) -> some View {
SystemKeyboardButton(action: action)
}
func imageButton(for action: KeyboardAction) -> some View {
KeyboardImageButton(action: action)
.keyboardAction(action, context: context)
}
}
| Add globe button to image keyboard | Add globe button to image keyboard
| Swift | mit | danielsaidi/KeyboardKit,danielsaidi/KeyboardKit | swift | ## Code Before:
//
// ImageKeyboard.swift
// KeyboardKit
//
// Created by Daniel Saidi on 2020-09-13.
// Copyright © 2021 Daniel Saidi. All rights reserved.
//
import KeyboardKit
import KeyboardKitSwiftUI
import SwiftUI
/**
This keyboard is a custom view that is implemented for this
project alone. It implements the shared `DemoImageKeyboard`
and lists its images in a grid, where the number of columns
depend on if the grid is presented in portrait or landscape.
*/
struct ImageKeyboard: View, DemoImageKeyboard {
@EnvironmentObject var context: ObservableKeyboardContext
var body: some View {
KeyboardGrid(
actions: actions,
columns: isLandscape ? 8 : 6,
spacing: 20,
buttonBuilder: button)
}
}
private extension ImageKeyboard {
var isLandscape: Bool { context.controller.deviceOrientation.isLandscape }
func button(for action: KeyboardAction) -> some View {
KeyboardImageButton(action: action)
.keyboardAction(action, context: context)
}
}
## Instruction:
Add globe button to image keyboard
## Code After:
//
// ImageKeyboard.swift
// KeyboardKit
//
// Created by Daniel Saidi on 2020-09-13.
// Copyright © 2021 Daniel Saidi. All rights reserved.
//
import KeyboardKit
import KeyboardKitSwiftUI
import SwiftUI
/**
This keyboard is a custom view that is implemented for this
project alone. It implements the shared `DemoImageKeyboard`
and lists its images in a grid, where the number of columns
depend on if the grid is presented in portrait or landscape.
*/
struct ImageKeyboard: View, DemoImageKeyboard {
@EnvironmentObject var context: ObservableKeyboardContext
var body: some View {
VStack(spacing: 30) {
KeyboardGrid(
actions: actions,
columns: columns,
spacing: 20,
buttonBuilder: imageButton)
bottomRow.frame(height: 40)
}.frame(height: 300)
}
}
private extension ImageKeyboard {
var columns: Int { isLandscape ? 8 : 6 }
var isLandscape: Bool { context.controller.deviceOrientation.isLandscape }
var bottomRow: some View {
button(for: .nextKeyboard)
}
func button(for action: KeyboardAction) -> some View {
SystemKeyboardButton(action: action)
}
func imageButton(for action: KeyboardAction) -> some View {
KeyboardImageButton(action: action)
.keyboardAction(action, context: context)
}
}
| //
// ImageKeyboard.swift
// KeyboardKit
//
// Created by Daniel Saidi on 2020-09-13.
// Copyright © 2021 Daniel Saidi. All rights reserved.
//
import KeyboardKit
import KeyboardKitSwiftUI
import SwiftUI
/**
This keyboard is a custom view that is implemented for this
project alone. It implements the shared `DemoImageKeyboard`
and lists its images in a grid, where the number of columns
depend on if the grid is presented in portrait or landscape.
*/
struct ImageKeyboard: View, DemoImageKeyboard {
@EnvironmentObject var context: ObservableKeyboardContext
var body: some View {
+ VStack(spacing: 30) {
- KeyboardGrid(
+ KeyboardGrid(
? ++++
- actions: actions,
+ actions: actions,
? ++++
- columns: isLandscape ? 8 : 6,
+ columns: columns,
- spacing: 20,
+ spacing: 20,
? ++++
- buttonBuilder: button)
? ^
+ buttonBuilder: imageButton)
? ++++ ^^^^^^
+ bottomRow.frame(height: 40)
+ }.frame(height: 300)
}
}
private extension ImageKeyboard {
+ var columns: Int { isLandscape ? 8 : 6 }
+
var isLandscape: Bool { context.controller.deviceOrientation.isLandscape }
+ var bottomRow: some View {
+ button(for: .nextKeyboard)
+ }
+
func button(for action: KeyboardAction) -> some View {
+ SystemKeyboardButton(action: action)
+ }
+
+ func imageButton(for action: KeyboardAction) -> some View {
KeyboardImageButton(action: action)
.keyboardAction(action, context: context)
}
} | 23 | 0.575 | 18 | 5 |
769051dda1c1cef347bc209b237da37911c50ffc | plugin/gso.vim | plugin/gso.vim | function! GSO(question)
let firstarg=a:question
python << EOF
import vim
import os
import pickle as pkl
from io import BytesIO
from lxml import etree
from gso import load_up_answers, load_up_questions
question = vim.eval("firstarg")
vim.current.buffer.append(question)
results = []
i = 0
for result in load_up_questions(str(question)):
results.append(result)
i += 1
if i > 1:
break
question_url = results[0][0]
answers = load_up_answers(question_url)
def wrap_with_root_tag(xml_string):
xml_string = u"<root>"+xml_string+u"</root>"
return xml_string
root = etree.iterparse(BytesIO(wrap_with_root_tag(answers[0][1]).encode('utf-8')))
for action, elem in root:
if elem.tag == u'p' or elem.tag == u'code':
for line in str(elem.text).split('\n'):
vim.current.buffer.append(line)
EOF
endfunction
" command! -nargs=1 GSO call GSO(question)
| function! GSO(question)
let firstarg=a:question
python << EOF
import vim
import os
import pickle as pkl
from io import BytesIO
from lxml import etree
from gso import load_up_answers, load_up_questions
question = vim.eval("firstarg")
vim.current.buffer.append(question)
results = []
i = 0
for result in load_up_questions(str(question)):
results.append(result)
i += 1
if i > 1:
break
question_url = results[0][0]
answers = load_up_answers(question_url)
def wrap_with_root_tag(xml_string):
xml_string = u"<root>"+xml_string+u"</root>"
return xml_string
parser = etree.XMLParser(recover=True)
root = etree.parse(
BytesIO(wrap_with_root_tag(answers[0][1]).encode('utf-8')),
parser=parser)
vim.current.buffer.append('')
for elem in root.iter():
#if elem.tag == u'p' or elem.tag == u'code':
for line in str(elem.text).split('\n'):
if line != "None":
vim.current.buffer[-1] += line
for line in str(elem.tail).split('\n'):
if line != "None":
vim.current.buffer[-1] += (line)
EOF
endfunction
command! -nargs=1 GSO call GSO(question)
| Fix appending of SO answer | Fix appending of SO answer
- Now recovering broken XML
- Fixed problem where a newline would be created for each new tag
| VimL | mit | mdtmc/gso | viml | ## Code Before:
function! GSO(question)
let firstarg=a:question
python << EOF
import vim
import os
import pickle as pkl
from io import BytesIO
from lxml import etree
from gso import load_up_answers, load_up_questions
question = vim.eval("firstarg")
vim.current.buffer.append(question)
results = []
i = 0
for result in load_up_questions(str(question)):
results.append(result)
i += 1
if i > 1:
break
question_url = results[0][0]
answers = load_up_answers(question_url)
def wrap_with_root_tag(xml_string):
xml_string = u"<root>"+xml_string+u"</root>"
return xml_string
root = etree.iterparse(BytesIO(wrap_with_root_tag(answers[0][1]).encode('utf-8')))
for action, elem in root:
if elem.tag == u'p' or elem.tag == u'code':
for line in str(elem.text).split('\n'):
vim.current.buffer.append(line)
EOF
endfunction
" command! -nargs=1 GSO call GSO(question)
## Instruction:
Fix appending of SO answer
- Now recovering broken XML
- Fixed problem where a newline would be created for each new tag
## Code After:
function! GSO(question)
let firstarg=a:question
python << EOF
import vim
import os
import pickle as pkl
from io import BytesIO
from lxml import etree
from gso import load_up_answers, load_up_questions
question = vim.eval("firstarg")
vim.current.buffer.append(question)
results = []
i = 0
for result in load_up_questions(str(question)):
results.append(result)
i += 1
if i > 1:
break
question_url = results[0][0]
answers = load_up_answers(question_url)
def wrap_with_root_tag(xml_string):
xml_string = u"<root>"+xml_string+u"</root>"
return xml_string
parser = etree.XMLParser(recover=True)
root = etree.parse(
BytesIO(wrap_with_root_tag(answers[0][1]).encode('utf-8')),
parser=parser)
vim.current.buffer.append('')
for elem in root.iter():
#if elem.tag == u'p' or elem.tag == u'code':
for line in str(elem.text).split('\n'):
if line != "None":
vim.current.buffer[-1] += line
for line in str(elem.tail).split('\n'):
if line != "None":
vim.current.buffer[-1] += (line)
EOF
endfunction
command! -nargs=1 GSO call GSO(question)
| function! GSO(question)
let firstarg=a:question
python << EOF
import vim
import os
import pickle as pkl
from io import BytesIO
from lxml import etree
from gso import load_up_answers, load_up_questions
question = vim.eval("firstarg")
vim.current.buffer.append(question)
results = []
i = 0
for result in load_up_questions(str(question)):
results.append(result)
i += 1
if i > 1:
break
question_url = results[0][0]
answers = load_up_answers(question_url)
def wrap_with_root_tag(xml_string):
xml_string = u"<root>"+xml_string+u"</root>"
return xml_string
+ parser = etree.XMLParser(recover=True)
+ root = etree.parse(
- root = etree.iterparse(BytesIO(wrap_with_root_tag(answers[0][1]).encode('utf-8')))
? ---- - ^^^^^^^^^^^^^^^^ ^
+ BytesIO(wrap_with_root_tag(answers[0][1]).encode('utf-8')),
? ^^ ^
- for action, elem in root:
+ parser=parser)
+
+ vim.current.buffer.append('')
+ for elem in root.iter():
- if elem.tag == u'p' or elem.tag == u'code':
+ #if elem.tag == u'p' or elem.tag == u'code':
? +
- for line in str(elem.text).split('\n'):
? ----
+ for line in str(elem.text).split('\n'):
+ if line != "None":
+ vim.current.buffer[-1] += line
+ for line in str(elem.tail).split('\n'):
+ if line != "None":
- vim.current.buffer.append(line)
? ^^^^^^^
+ vim.current.buffer[-1] += (line)
? ^^^^^^^^
EOF
endfunction
- " command! -nargs=1 GSO call GSO(question)
? --
+ command! -nargs=1 GSO call GSO(question)
| 21 | 0.477273 | 15 | 6 |
62d7529223511dd6d538098f479caceb902c1f1b | app/views/effective/subscripter/_form.html.haml | app/views/effective/subscripter/_form.html.haml | = javascript_include_tag 'https://checkout.stripe.com/checkout.js'
= effective_form_with(model: subscripter, url: effective_orders.subscripter_path, remote: true, data: { stripe: subscripter_stripe_data(subscripter) }) do |f|
= f.hidden_field :user_id, value: current_user.id
= f.hidden_field :subscribable_global_id
= f.hidden_field :stripe_token, value: nil
= f.error :stripe_token
= f.radios :stripe_plan_id, stripe_plans_collection(f), cards: true, label: false, required: true
= f.submit 'Choose this Plan', center: true, class: ('effective-orders-stripe-token-required' if f.object.token_required?)
| = javascript_include_tag 'https://checkout.stripe.com/checkout.js'
= effective_form_with(model: subscripter, url: effective_orders.subscripter_path, remote: true, data: { stripe: subscripter_stripe_data(subscripter) }) do |f|
= f.hidden_field :user_id, value: current_user.id
= f.hidden_field :subscribable_global_id
= f.hidden_field :stripe_token, value: nil
= f.error :stripe_token
= f.radios :stripe_plan_id, stripe_plans_collection(f), inline: false, cards: false, label: false, required: true
= f.submit 'Choose Plan', center: true, border: false, class: ('effective-orders-stripe-token-required' if f.object.token_required?)
| Change subscriptor form to use radio buttons, change button text to 'Choose Plan' | Change subscriptor form to use radio buttons, change button text to 'Choose Plan'
| Haml | mit | code-and-effect/effective_orders,code-and-effect/effective_orders,code-and-effect/effective_orders | haml | ## Code Before:
= javascript_include_tag 'https://checkout.stripe.com/checkout.js'
= effective_form_with(model: subscripter, url: effective_orders.subscripter_path, remote: true, data: { stripe: subscripter_stripe_data(subscripter) }) do |f|
= f.hidden_field :user_id, value: current_user.id
= f.hidden_field :subscribable_global_id
= f.hidden_field :stripe_token, value: nil
= f.error :stripe_token
= f.radios :stripe_plan_id, stripe_plans_collection(f), cards: true, label: false, required: true
= f.submit 'Choose this Plan', center: true, class: ('effective-orders-stripe-token-required' if f.object.token_required?)
## Instruction:
Change subscriptor form to use radio buttons, change button text to 'Choose Plan'
## Code After:
= javascript_include_tag 'https://checkout.stripe.com/checkout.js'
= effective_form_with(model: subscripter, url: effective_orders.subscripter_path, remote: true, data: { stripe: subscripter_stripe_data(subscripter) }) do |f|
= f.hidden_field :user_id, value: current_user.id
= f.hidden_field :subscribable_global_id
= f.hidden_field :stripe_token, value: nil
= f.error :stripe_token
= f.radios :stripe_plan_id, stripe_plans_collection(f), inline: false, cards: false, label: false, required: true
= f.submit 'Choose Plan', center: true, border: false, class: ('effective-orders-stripe-token-required' if f.object.token_required?)
| = javascript_include_tag 'https://checkout.stripe.com/checkout.js'
= effective_form_with(model: subscripter, url: effective_orders.subscripter_path, remote: true, data: { stripe: subscripter_stripe_data(subscripter) }) do |f|
= f.hidden_field :user_id, value: current_user.id
= f.hidden_field :subscribable_global_id
= f.hidden_field :stripe_token, value: nil
= f.error :stripe_token
- = f.radios :stripe_plan_id, stripe_plans_collection(f), cards: true, label: false, required: true
? ^^^
+ = f.radios :stripe_plan_id, stripe_plans_collection(f), inline: false, cards: false, label: false, required: true
? +++++++++++++++ ^^^^
- = f.submit 'Choose this Plan', center: true, class: ('effective-orders-stripe-token-required' if f.object.token_required?)
? -----
+ = f.submit 'Choose Plan', center: true, border: false, class: ('effective-orders-stripe-token-required' if f.object.token_required?)
? +++++++++++++++
| 4 | 0.363636 | 2 | 2 |
a728eefa5b204fbe82319e919d6b94c92129f447 | .travis.yml | .travis.yml | language: go
go:
- 1.3
- 1.4
- tip
| language: go
go:
- 1.3
- 1.4
- tip
before_install:
- go get github.com/golang/lint/golint
script:
- golint
- go test -v
| Add golint to Travis build | Add golint to Travis build
| YAML | mit | ggilder/bitrot | yaml | ## Code Before:
language: go
go:
- 1.3
- 1.4
- tip
## Instruction:
Add golint to Travis build
## Code After:
language: go
go:
- 1.3
- 1.4
- tip
before_install:
- go get github.com/golang/lint/golint
script:
- golint
- go test -v
| language: go
+
go:
- 1.3
- 1.4
- tip
+ before_install:
+ - go get github.com/golang/lint/golint
+
+ script:
+ - golint
+ - go test -v | 7 | 1.166667 | 7 | 0 |
ff894a8ec1bef2510c60140a4f42856d48f542d5 | app/views/layouts/nav/_explore.html.haml | app/views/layouts/nav/_explore.html.haml | %ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects' do
= icon('bookmark fw')
%span
Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
= link_to explore_groups_path, title: 'Groups' do
= icon('group fw')
%span
Groups
= nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets' do
= icon('clipboard fw')
%span
Snippets
= nav_link(controller: :help) do
= link_to help_path, title: 'Help' do
= icon('question-circle fw')
%span
Help
| %ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects' do
%span
Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
= link_to explore_groups_path, title: 'Groups' do
%span
Groups
= nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets' do
%span
Snippets
= nav_link(controller: :help) do
= link_to help_path, title: 'Help' do
%span
Help
| Remove icons from explore nav | Remove icons from explore nav
| Haml | mit | mr-dxdy/gitlabhq,axilleas/gitlabhq,openwide-java/gitlabhq,LUMC/gitlabhq,mr-dxdy/gitlabhq,LUMC/gitlabhq,htve/GitlabForChinese,dreampet/gitlab,axilleas/gitlabhq,screenpages/gitlabhq,axilleas/gitlabhq,shinexiao/gitlabhq,icedwater/gitlabhq,mmkassem/gitlabhq,darkrasid/gitlabhq,daiyu/gitlab-zh,SVArago/gitlabhq,mr-dxdy/gitlabhq,screenpages/gitlabhq,daiyu/gitlab-zh,daiyu/gitlab-zh,martijnvermaat/gitlabhq,t-zuehlsdorff/gitlabhq,iiet/iiet-git,dplarson/gitlabhq,martijnvermaat/gitlabhq,allysonbarros/gitlabhq,allysonbarros/gitlabhq,icedwater/gitlabhq,dreampet/gitlab,martijnvermaat/gitlabhq,shinexiao/gitlabhq,icedwater/gitlabhq,mmkassem/gitlabhq,openwide-java/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,SVArago/gitlabhq,darkrasid/gitlabhq,stoplightio/gitlabhq,openwide-java/gitlabhq,dplarson/gitlabhq,mmkassem/gitlabhq,jirutka/gitlabhq,dplarson/gitlabhq,iiet/iiet-git,darkrasid/gitlabhq,htve/GitlabForChinese,t-zuehlsdorff/gitlabhq,allysonbarros/gitlabhq,t-zuehlsdorff/gitlabhq,allysonbarros/gitlabhq,htve/GitlabForChinese,LUMC/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,SVArago/gitlabhq,screenpages/gitlabhq,iiet/iiet-git,icedwater/gitlabhq,openwide-java/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,dplarson/gitlabhq,iiet/iiet-git,dreampet/gitlab,dreampet/gitlab,shinexiao/gitlabhq,shinexiao/gitlabhq,LUMC/gitlabhq,daiyu/gitlab-zh,screenpages/gitlabhq,jirutka/gitlabhq,htve/GitlabForChinese,SVArago/gitlabhq,darkrasid/gitlabhq,t-zuehlsdorff/gitlabhq,mr-dxdy/gitlabhq,martijnvermaat/gitlabhq | haml | ## Code Before:
%ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects' do
= icon('bookmark fw')
%span
Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
= link_to explore_groups_path, title: 'Groups' do
= icon('group fw')
%span
Groups
= nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets' do
= icon('clipboard fw')
%span
Snippets
= nav_link(controller: :help) do
= link_to help_path, title: 'Help' do
= icon('question-circle fw')
%span
Help
## Instruction:
Remove icons from explore nav
## Code After:
%ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects' do
%span
Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
= link_to explore_groups_path, title: 'Groups' do
%span
Groups
= nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets' do
%span
Snippets
= nav_link(controller: :help) do
= link_to help_path, title: 'Help' do
%span
Help
| %ul.nav.nav-sidebar
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects' do
- = icon('bookmark fw')
%span
Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
= link_to explore_groups_path, title: 'Groups' do
- = icon('group fw')
%span
Groups
= nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets' do
- = icon('clipboard fw')
%span
Snippets
= nav_link(controller: :help) do
= link_to help_path, title: 'Help' do
- = icon('question-circle fw')
%span
Help | 4 | 0.190476 | 0 | 4 |
ef3756ff1b33cbde63f852e5e9a7c12b5acdc071 | pkgs/development/python-modules/gym/default.nix | pkgs/development/python-modules/gym/default.nix | { lib
, buildPythonPackage, fetchPypi
, numpy, requests, six, pyglet, scipy, cloudpickle
}:
buildPythonPackage rec {
pname = "gym";
version = "0.15.4";
src = fetchPypi {
inherit pname version;
sha256 = "3b930cbe1c76bbd30455b5e82ba723dea94159a5f988e927f443324bf7cc7ddd";
};
postPatch = ''
substituteInPlace setup.py \
--replace "pyglet>=1.2.0,<=1.3.2" "pyglet"
'';
propagatedBuildInputs = [
numpy requests six pyglet scipy cloudpickle
];
# The test needs MuJoCo that is not free library.
doCheck = false;
meta = with lib; {
description = "A toolkit by OpenAI for developing and comparing your reinforcement learning agents";
homepage = https://gym.openai.com/;
license = licenses.mit;
maintainers = with maintainers; [ hyphon81 ];
};
}
| { lib
, buildPythonPackage, fetchPypi
, numpy, requests, six, pyglet, scipy, cloudpickle
}:
buildPythonPackage rec {
pname = "gym";
version = "0.15.3";
src = fetchPypi {
inherit pname version;
sha256 = "18381e13bbd1e2f206a1b88a2af4fb87affd7d06ee7955a6e5e6a79478a9adfc";
};
postPatch = ''
substituteInPlace setup.py \
--replace "pyglet>=1.2.0,<=1.3.2" "pyglet"
'';
propagatedBuildInputs = [
numpy requests six pyglet scipy cloudpickle
];
# The test needs MuJoCo that is not free library.
doCheck = false;
meta = with lib; {
description = "A toolkit by OpenAI for developing and comparing your reinforcement learning agents";
homepage = https://gym.openai.com/;
license = licenses.mit;
maintainers = with maintainers; [ hyphon81 ];
};
}
| Revert "python: gym: 0.15.3 -> 0.15.4" | Revert "python: gym: 0.15.3 -> 0.15.4"
0.15.4 requires python-opencv, which isn't packaged yet,
and is not trival to package
This reverts commit 8ee4062480e78f17f47c0e9893c6e16fdff35b73.
| Nix | mit | NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{ lib
, buildPythonPackage, fetchPypi
, numpy, requests, six, pyglet, scipy, cloudpickle
}:
buildPythonPackage rec {
pname = "gym";
version = "0.15.4";
src = fetchPypi {
inherit pname version;
sha256 = "3b930cbe1c76bbd30455b5e82ba723dea94159a5f988e927f443324bf7cc7ddd";
};
postPatch = ''
substituteInPlace setup.py \
--replace "pyglet>=1.2.0,<=1.3.2" "pyglet"
'';
propagatedBuildInputs = [
numpy requests six pyglet scipy cloudpickle
];
# The test needs MuJoCo that is not free library.
doCheck = false;
meta = with lib; {
description = "A toolkit by OpenAI for developing and comparing your reinforcement learning agents";
homepage = https://gym.openai.com/;
license = licenses.mit;
maintainers = with maintainers; [ hyphon81 ];
};
}
## Instruction:
Revert "python: gym: 0.15.3 -> 0.15.4"
0.15.4 requires python-opencv, which isn't packaged yet,
and is not trival to package
This reverts commit 8ee4062480e78f17f47c0e9893c6e16fdff35b73.
## Code After:
{ lib
, buildPythonPackage, fetchPypi
, numpy, requests, six, pyglet, scipy, cloudpickle
}:
buildPythonPackage rec {
pname = "gym";
version = "0.15.3";
src = fetchPypi {
inherit pname version;
sha256 = "18381e13bbd1e2f206a1b88a2af4fb87affd7d06ee7955a6e5e6a79478a9adfc";
};
postPatch = ''
substituteInPlace setup.py \
--replace "pyglet>=1.2.0,<=1.3.2" "pyglet"
'';
propagatedBuildInputs = [
numpy requests six pyglet scipy cloudpickle
];
# The test needs MuJoCo that is not free library.
doCheck = false;
meta = with lib; {
description = "A toolkit by OpenAI for developing and comparing your reinforcement learning agents";
homepage = https://gym.openai.com/;
license = licenses.mit;
maintainers = with maintainers; [ hyphon81 ];
};
}
| { lib
, buildPythonPackage, fetchPypi
, numpy, requests, six, pyglet, scipy, cloudpickle
}:
buildPythonPackage rec {
pname = "gym";
- version = "0.15.4";
? ^
+ version = "0.15.3";
? ^
src = fetchPypi {
inherit pname version;
- sha256 = "3b930cbe1c76bbd30455b5e82ba723dea94159a5f988e927f443324bf7cc7ddd";
+ sha256 = "18381e13bbd1e2f206a1b88a2af4fb87affd7d06ee7955a6e5e6a79478a9adfc";
};
postPatch = ''
substituteInPlace setup.py \
--replace "pyglet>=1.2.0,<=1.3.2" "pyglet"
'';
propagatedBuildInputs = [
numpy requests six pyglet scipy cloudpickle
];
# The test needs MuJoCo that is not free library.
doCheck = false;
meta = with lib; {
description = "A toolkit by OpenAI for developing and comparing your reinforcement learning agents";
homepage = https://gym.openai.com/;
license = licenses.mit;
maintainers = with maintainers; [ hyphon81 ];
};
} | 4 | 0.121212 | 2 | 2 |
7222b92155e9272c42a67c57ac851ecaad284d6d | src/mocks/have_received_expectation.cr | src/mocks/have_received_expectation.cr | module Mocks
class HaveReceivedExpectation
def initialize(@receive)
end
def match(@target)
method.received?(oid, @receive.args)
end
def failure_message
"expected: #{expected}\n got: #{got}"
end
def negative_failure_message
"expected: receive != #{expected}\n got: #{got}"
end
private def method
Registry
.for(target_class_name(@target))
.fetch_method(@receive.method_name)
end
private def self_method?
@receive.method_name.starts_with?("self.")
end
private def target_class_name(target)
return target.name if self_method? && target.is_a?(Class)
target.class.name
end
private def oid
Registry::ObjectId.build(@target)
end
private def got
if args = last_args
return "#{@receive.method_name}#{args.inspect}"
end
"nil"
end
def expected
"#{@receive.method_name}#{@receive.args.inspect}"
end
private def last_args
method.last_received_args(oid)
end
end
end
| module Mocks
class HaveReceivedExpectation
def initialize(@receive)
end
def match(@target)
method.received?(oid, @receive.args)
end
def failure_message
"expected: #{expected}\n got: #{got}"
end
def failure_message(_ignored)
failure_message
end
def negative_failure_message
"expected: receive != #{expected}\n got: #{got}"
end
def negative_failure_message(_ignored)
negative_failure_message
end
private def method
Registry
.for(target_class_name(@target))
.fetch_method(@receive.method_name)
end
private def self_method?
@receive.method_name.starts_with?("self.")
end
private def target_class_name(target)
return target.name if self_method? && target.is_a?(Class)
target.class.name
end
private def oid
Registry::ObjectId.build(@target)
end
private def got
if args = last_args
return "#{@receive.method_name}#{args.inspect}"
end
"nil"
end
def expected
"#{@receive.method_name}#{@receive.args.inspect}"
end
private def last_args
method.last_received_args(oid)
end
end
end
| Upgrade to a newer version of matcher protocol | Upgrade to a newer version of matcher protocol
| Crystal | mit | waterlink/mocks.cr | crystal | ## Code Before:
module Mocks
class HaveReceivedExpectation
def initialize(@receive)
end
def match(@target)
method.received?(oid, @receive.args)
end
def failure_message
"expected: #{expected}\n got: #{got}"
end
def negative_failure_message
"expected: receive != #{expected}\n got: #{got}"
end
private def method
Registry
.for(target_class_name(@target))
.fetch_method(@receive.method_name)
end
private def self_method?
@receive.method_name.starts_with?("self.")
end
private def target_class_name(target)
return target.name if self_method? && target.is_a?(Class)
target.class.name
end
private def oid
Registry::ObjectId.build(@target)
end
private def got
if args = last_args
return "#{@receive.method_name}#{args.inspect}"
end
"nil"
end
def expected
"#{@receive.method_name}#{@receive.args.inspect}"
end
private def last_args
method.last_received_args(oid)
end
end
end
## Instruction:
Upgrade to a newer version of matcher protocol
## Code After:
module Mocks
class HaveReceivedExpectation
def initialize(@receive)
end
def match(@target)
method.received?(oid, @receive.args)
end
def failure_message
"expected: #{expected}\n got: #{got}"
end
def failure_message(_ignored)
failure_message
end
def negative_failure_message
"expected: receive != #{expected}\n got: #{got}"
end
def negative_failure_message(_ignored)
negative_failure_message
end
private def method
Registry
.for(target_class_name(@target))
.fetch_method(@receive.method_name)
end
private def self_method?
@receive.method_name.starts_with?("self.")
end
private def target_class_name(target)
return target.name if self_method? && target.is_a?(Class)
target.class.name
end
private def oid
Registry::ObjectId.build(@target)
end
private def got
if args = last_args
return "#{@receive.method_name}#{args.inspect}"
end
"nil"
end
def expected
"#{@receive.method_name}#{@receive.args.inspect}"
end
private def last_args
method.last_received_args(oid)
end
end
end
| module Mocks
class HaveReceivedExpectation
def initialize(@receive)
end
def match(@target)
method.received?(oid, @receive.args)
end
def failure_message
"expected: #{expected}\n got: #{got}"
end
+ def failure_message(_ignored)
+ failure_message
+ end
+
def negative_failure_message
"expected: receive != #{expected}\n got: #{got}"
+ end
+
+ def negative_failure_message(_ignored)
+ negative_failure_message
end
private def method
Registry
.for(target_class_name(@target))
.fetch_method(@receive.method_name)
end
private def self_method?
@receive.method_name.starts_with?("self.")
end
private def target_class_name(target)
return target.name if self_method? && target.is_a?(Class)
target.class.name
end
private def oid
Registry::ObjectId.build(@target)
end
private def got
if args = last_args
return "#{@receive.method_name}#{args.inspect}"
end
"nil"
end
def expected
"#{@receive.method_name}#{@receive.args.inspect}"
end
private def last_args
method.last_received_args(oid)
end
end
end | 8 | 0.150943 | 8 | 0 |
e2f73c8685cc73066553adc25013b4125cccc849 | doc/integration/slash_commands.md | doc/integration/slash_commands.md |
Slash commands in Mattermost and Slack allow you to control GitLab and view GitLab content right inside your chat client, without having to leave it. For Slack, this requires a [project service configuration](../user/project/integrations/slack_slash_commands.md). Simply type the command as a message in your chat client to activate it.
Commands are scoped to a project, with a trigger term that is specified during configuration. (We suggest you use the project name as the trigger term for simplicty and clarity.) Taking the trigger term as `project-name`, the commands are:
| Command | Effect |
| ------- | ------ |
| `/project-name help` | Shows all available slash commands |
| `/project-name issue new <title> <shift+return> <description>` | Creates a new issue with title `<title>` and description `<description>` |
| `/project-name issue show <id>` | Shows the issue with id `<id>` |
| `/project-name issue search <query>` | Shows up to 5 issues matching `<query>` |
| `/project-name deploy <from> to <to>` | Deploy from the `<from>` environment to the `<to>` environment |
|
Slash commands in Mattermost and Slack allow you to control GitLab and view GitLab content right inside your chat client, without having to leave it. For Slack, this requires a [project service configuration](../user/project/integrations/slack_slash_commands.md). Simply type the command as a message in your chat client to activate it.
Commands are scoped to a project, with a trigger term that is specified during configuration.
We suggest you use the project name as the trigger term for simplicity and clarity.
Taking the trigger term as `project-name`, the commands are:
| Command | Effect |
| ------- | ------ |
| `/project-name help` | Shows all available slash commands |
| `/project-name issue new <title> <shift+return> <description>` | Creates a new issue with title `<title>` and description `<description>` |
| `/project-name issue show <id>` | Shows the issue with id `<id>` |
| `/project-name issue search <query>` | Shows up to 5 issues matching `<query>` |
| `/project-name deploy <from> to <to>` | Deploy from the `<from>` environment to the `<to>` environment |
## Issue commands
It is possible to create new issue, display issue details and search up to 5 issues.
## Deploy command
In order to deploy to an environment, GitLab will try to find a deployment
action in the pipeline.
If there is only one action for a given environment, it is going to be triggered.
If there is more than one action defined, GitLab will try to find an action
which name equals the environment name we want to deploy to.
Command will return an error when no matching action has been found.
| Update docs regarding deploy chatops slash command | Update docs regarding deploy chatops slash command
| Markdown | mit | iiet/iiet-git,t-zuehlsdorff/gitlabhq,stoplightio/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,mmkassem/gitlabhq,jirutka/gitlabhq,jirutka/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,axilleas/gitlabhq,t-zuehlsdorff/gitlabhq,t-zuehlsdorff/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,axilleas/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,dreampet/gitlab,iiet/iiet-git,jirutka/gitlabhq,dreampet/gitlab | markdown | ## Code Before:
Slash commands in Mattermost and Slack allow you to control GitLab and view GitLab content right inside your chat client, without having to leave it. For Slack, this requires a [project service configuration](../user/project/integrations/slack_slash_commands.md). Simply type the command as a message in your chat client to activate it.
Commands are scoped to a project, with a trigger term that is specified during configuration. (We suggest you use the project name as the trigger term for simplicty and clarity.) Taking the trigger term as `project-name`, the commands are:
| Command | Effect |
| ------- | ------ |
| `/project-name help` | Shows all available slash commands |
| `/project-name issue new <title> <shift+return> <description>` | Creates a new issue with title `<title>` and description `<description>` |
| `/project-name issue show <id>` | Shows the issue with id `<id>` |
| `/project-name issue search <query>` | Shows up to 5 issues matching `<query>` |
| `/project-name deploy <from> to <to>` | Deploy from the `<from>` environment to the `<to>` environment |
## Instruction:
Update docs regarding deploy chatops slash command
## Code After:
Slash commands in Mattermost and Slack allow you to control GitLab and view GitLab content right inside your chat client, without having to leave it. For Slack, this requires a [project service configuration](../user/project/integrations/slack_slash_commands.md). Simply type the command as a message in your chat client to activate it.
Commands are scoped to a project, with a trigger term that is specified during configuration.
We suggest you use the project name as the trigger term for simplicity and clarity.
Taking the trigger term as `project-name`, the commands are:
| Command | Effect |
| ------- | ------ |
| `/project-name help` | Shows all available slash commands |
| `/project-name issue new <title> <shift+return> <description>` | Creates a new issue with title `<title>` and description `<description>` |
| `/project-name issue show <id>` | Shows the issue with id `<id>` |
| `/project-name issue search <query>` | Shows up to 5 issues matching `<query>` |
| `/project-name deploy <from> to <to>` | Deploy from the `<from>` environment to the `<to>` environment |
## Issue commands
It is possible to create new issue, display issue details and search up to 5 issues.
## Deploy command
In order to deploy to an environment, GitLab will try to find a deployment
action in the pipeline.
If there is only one action for a given environment, it is going to be triggered.
If there is more than one action defined, GitLab will try to find an action
which name equals the environment name we want to deploy to.
Command will return an error when no matching action has been found.
|
Slash commands in Mattermost and Slack allow you to control GitLab and view GitLab content right inside your chat client, without having to leave it. For Slack, this requires a [project service configuration](../user/project/integrations/slack_slash_commands.md). Simply type the command as a message in your chat client to activate it.
- Commands are scoped to a project, with a trigger term that is specified during configuration. (We suggest you use the project name as the trigger term for simplicty and clarity.) Taking the trigger term as `project-name`, the commands are:
+ Commands are scoped to a project, with a trigger term that is specified during configuration.
+
+ We suggest you use the project name as the trigger term for simplicity and clarity.
+
+ Taking the trigger term as `project-name`, the commands are:
| Command | Effect |
| ------- | ------ |
| `/project-name help` | Shows all available slash commands |
| `/project-name issue new <title> <shift+return> <description>` | Creates a new issue with title `<title>` and description `<description>` |
| `/project-name issue show <id>` | Shows the issue with id `<id>` |
| `/project-name issue search <query>` | Shows up to 5 issues matching `<query>` |
| `/project-name deploy <from> to <to>` | Deploy from the `<from>` environment to the `<to>` environment |
+
+ ## Issue commands
+
+ It is possible to create new issue, display issue details and search up to 5 issues.
+
+ ## Deploy command
+
+ In order to deploy to an environment, GitLab will try to find a deployment
+ action in the pipeline.
+
+ If there is only one action for a given environment, it is going to be triggered.
+ If there is more than one action defined, GitLab will try to find an action
+ which name equals the environment name we want to deploy to.
+
+ Command will return an error when no matching action has been found. | 21 | 1.615385 | 20 | 1 |
a04a5a80057e86af2c5df0e87a7d2c3c221123ae | rpc_server/CouchDBViewDefinitions.py | rpc_server/CouchDBViewDefinitions.py | definitions = (
{ "doc": "basicStats", "view": "addCar",
"map": """
function(doc) {
// car creations
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'add') {
emit(id, {'time': doc.time});
}
}
}"""
},
{
"doc": "basicStats", "view": "deleteCar",
"map": """
function(doc) {
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'del') {
emit(id, {'time': doc.time});
}
}
}
"""
}
,)
| definitions = (
{ "doc": "basicStats", "view": "addCar",
"map": """
function(doc) {
// car creations
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'add') {
emit(id, {'time': doc.time});
}
}
}"""
},
{
"doc": "basicStats", "view": "deleteCar",
"map": """
function(doc) {
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'del') {
emit(id, {'time': doc.time});
}
}
}
"""
},
{
"doc": "manage", "view": "jobs",
"map": """
function(doc) {
if (doc.type === 'job'){
emit(doc.name, doc._id);
}
}
"""
}
,)
| Add view to get project jobs. | Add view to get project jobs.
| Python | apache-2.0 | anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46,anthony-kolesov/kts46 | python | ## Code Before:
definitions = (
{ "doc": "basicStats", "view": "addCar",
"map": """
function(doc) {
// car creations
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'add') {
emit(id, {'time': doc.time});
}
}
}"""
},
{
"doc": "basicStats", "view": "deleteCar",
"map": """
function(doc) {
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'del') {
emit(id, {'time': doc.time});
}
}
}
"""
}
,)
## Instruction:
Add view to get project jobs.
## Code After:
definitions = (
{ "doc": "basicStats", "view": "addCar",
"map": """
function(doc) {
// car creations
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'add') {
emit(id, {'time': doc.time});
}
}
}"""
},
{
"doc": "basicStats", "view": "deleteCar",
"map": """
function(doc) {
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'del') {
emit(id, {'time': doc.time});
}
}
}
"""
},
{
"doc": "manage", "view": "jobs",
"map": """
function(doc) {
if (doc.type === 'job'){
emit(doc.name, doc._id);
}
}
"""
}
,)
| definitions = (
{ "doc": "basicStats", "view": "addCar",
"map": """
function(doc) {
// car creations
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'add') {
emit(id, {'time': doc.time});
}
}
}"""
},
{
"doc": "basicStats", "view": "deleteCar",
"map": """
function(doc) {
for (var id in doc.cars){
if (doc.cars[id].state && doc.cars[id].state === 'del') {
emit(id, {'time': doc.time});
}
}
}
"""
+ },
+ {
+ "doc": "manage", "view": "jobs",
+ "map": """
+ function(doc) {
+ if (doc.type === 'job'){
+ emit(doc.name, doc._id);
+ }
+ }
+ """
}
,) | 10 | 0.4 | 10 | 0 |
77a79c9ab04b6d2858f0490ef56e30ef3834889d | pages/app/views/refinery/admin/pages/_locale_picker.html.erb | pages/app/views/refinery/admin/pages/_locale_picker.html.erb | <input type='hidden' name='switch_locale' id='switch_locale' value='<%= local_assigns[:current_locale] %>' />
<% if (locales ||= (Refinery::I18n.frontend_locales if Refinery.i18n_enabled?)).present? && locales.many? %>
<ul id='switch_locale_picker' class='clearfix'>
<% locales.each do |locale| %>
<li<%= " class='selected'" if locale.to_s == local_assigns[:current_locale].to_s %>>
<%= link_to refinery_icon_tag("flags/#{locale}.png", :size => "32x22"),
refinery.url_for(:switch_locale => locale) %>
</li>
<% end %>
</ul>
<% end %>
| <input type='hidden' name='switch_locale' id='switch_locale' value='<%= local_assigns[:current_locale] %>' />
<% if (locales ||= (Refinery::I18n.frontend_locales if Refinery.i18n_enabled?)).present? && locales.many? %>
<ul id='switch_locale_picker' class='clearfix'>
<% locales.each do |locale| %>
<li<%= " class='selected'".html_safe if locale.to_s == local_assigns[:current_locale].to_s %>>
<%= link_to refinery_icon_tag("flags/#{locale}.png", :size => "32x22"),
refinery.url_for(:switch_locale => locale) %>
</li>
<% end %>
</ul>
<% end %>
| Fix selected class for locale picker | Fix selected class for locale picker | HTML+ERB | mit | mabras/refinerycms,refinery/refinerycms,mabras/refinerycms,simi/refinerycms,chrise86/refinerycms,mlinfoot/refinerycms,Eric-Guo/refinerycms,kelkoo-services/refinerycms,hoopla-software/refinerycms,mlinfoot/refinerycms,Eric-Guo/refinerycms,stefanspicer/refinerycms,trevornez/refinerycms,stefanspicer/refinerycms,trevornez/refinerycms,bricesanchez/refinerycms,louim/refinerycms,stefanspicer/refinerycms,Retimont/refinerycms,simi/refinerycms,mobilityhouse/refinerycms,johanb/refinerycms,bryanmtl/g-refinerycms,gwagener/refinerycms,kelkoo-services/refinerycms,aguzubiaga/refinerycms,mkaplan9/refinerycms,mlinfoot/refinerycms,hoopla-software/refinerycms,refinery/refinerycms,mobilityhouse/refinerycms,louim/refinerycms,mkaplan9/refinerycms,mabras/refinerycms,KingLemuel/refinerycms,gwagener/refinerycms,trevornez/refinerycms,anitagraham/refinerycms,LytayTOUCH/refinerycms,Retimont/refinerycms,kappiah/refinerycms,mkaplan9/refinerycms,KingLemuel/refinerycms,anitagraham/refinerycms,kappiah/refinerycms,Retimont/refinerycms,sideci-sample/sideci-sample-refinerycms,refinery/refinerycms,mojarra/myrefinerycms,sideci-sample/sideci-sample-refinerycms,LytayTOUCH/refinerycms,bricesanchez/refinerycms,LytayTOUCH/refinerycms,anitagraham/refinerycms,simi/refinerycms,aguzubiaga/refinerycms,chrise86/refinerycms,johanb/refinerycms,hoopla-software/refinerycms,bryanmtl/g-refinerycms,KingLemuel/refinerycms,simi/refinerycms,aguzubiaga/refinerycms,mojarra/myrefinerycms,chrise86/refinerycms,gwagener/refinerycms,kappiah/refinerycms,Eric-Guo/refinerycms,johanb/refinerycms | html+erb | ## Code Before:
<input type='hidden' name='switch_locale' id='switch_locale' value='<%= local_assigns[:current_locale] %>' />
<% if (locales ||= (Refinery::I18n.frontend_locales if Refinery.i18n_enabled?)).present? && locales.many? %>
<ul id='switch_locale_picker' class='clearfix'>
<% locales.each do |locale| %>
<li<%= " class='selected'" if locale.to_s == local_assigns[:current_locale].to_s %>>
<%= link_to refinery_icon_tag("flags/#{locale}.png", :size => "32x22"),
refinery.url_for(:switch_locale => locale) %>
</li>
<% end %>
</ul>
<% end %>
## Instruction:
Fix selected class for locale picker
## Code After:
<input type='hidden' name='switch_locale' id='switch_locale' value='<%= local_assigns[:current_locale] %>' />
<% if (locales ||= (Refinery::I18n.frontend_locales if Refinery.i18n_enabled?)).present? && locales.many? %>
<ul id='switch_locale_picker' class='clearfix'>
<% locales.each do |locale| %>
<li<%= " class='selected'".html_safe if locale.to_s == local_assigns[:current_locale].to_s %>>
<%= link_to refinery_icon_tag("flags/#{locale}.png", :size => "32x22"),
refinery.url_for(:switch_locale => locale) %>
</li>
<% end %>
</ul>
<% end %>
| <input type='hidden' name='switch_locale' id='switch_locale' value='<%= local_assigns[:current_locale] %>' />
<% if (locales ||= (Refinery::I18n.frontend_locales if Refinery.i18n_enabled?)).present? && locales.many? %>
<ul id='switch_locale_picker' class='clearfix'>
<% locales.each do |locale| %>
- <li<%= " class='selected'" if locale.to_s == local_assigns[:current_locale].to_s %>>
+ <li<%= " class='selected'".html_safe if locale.to_s == local_assigns[:current_locale].to_s %>>
? ++++++++++
<%= link_to refinery_icon_tag("flags/#{locale}.png", :size => "32x22"),
refinery.url_for(:switch_locale => locale) %>
</li>
<% end %>
</ul>
<% end %> | 2 | 0.181818 | 1 | 1 |
109030e6819850be4818f29227a1870b447644f7 | time.php | time.php | <?php
date_default_timezone_set('UTC');
/**
*
*/
class time extends Script
{
protected $helpMessage = 'Returns the actual UTC time';
public function run()
{
return $this->send(date(DATE_RFC822));
}
}
| <?php
date_default_timezone_set('UTC');
class time extends Script
{
protected $helpMessage = "'time'\n";
protected $description = 'Returns the actual UTC-time';
public function run()
{
return $this->send(date(DATE_RFC822));
}
}
| Complete the information for the help-plugin | Complete the information for the help-plugin
| PHP | mit | Detlefff/Detlefff-Time | php | ## Code Before:
<?php
date_default_timezone_set('UTC');
/**
*
*/
class time extends Script
{
protected $helpMessage = 'Returns the actual UTC time';
public function run()
{
return $this->send(date(DATE_RFC822));
}
}
## Instruction:
Complete the information for the help-plugin
## Code After:
<?php
date_default_timezone_set('UTC');
class time extends Script
{
protected $helpMessage = "'time'\n";
protected $description = 'Returns the actual UTC-time';
public function run()
{
return $this->send(date(DATE_RFC822));
}
}
| <?php
date_default_timezone_set('UTC');
+
- /**
- *
- */
class time extends Script
{
+ protected $helpMessage = "'time'\n";
- protected $helpMessage = 'Returns the actual UTC time';
? ^^^^^ ^^^^ ^
+ protected $description = 'Returns the actual UTC-time';
? ^ ^^^^^^^^ ^
public function run()
{
return $this->send(date(DATE_RFC822));
}
} | 7 | 0.5 | 3 | 4 |
85a7b6e39f472ae9465b8fb80e2443da352fee67 | fullcalendar/admin.py | fullcalendar/admin.py | from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin
from fullcalendar.models import *
class EventCategoryAdmin(admin.ModelAdmin):
list_display = ('name',)
class OccurrenceInline(StackedDynamicInlineAdmin):
model = Occurrence
fields = ('start_time', 'end_time', 'description', 'location')
class EventAdmin(DisplayableAdmin):
list_display = ('title', 'status')
list_filter = ('event_category',)
search_fields = ('title', 'description', 'content')
fieldsets = (
(None, {
"fields": [
"title", "status", ("publish_date", "expiry_date"),
"event_category", "content"
]
}),
(_("Meta data"), {
"fields": [
"_meta_title", "slug",
("description", "gen_description"),
"keywords", "in_sitemap"
],
"classes": ("collapse-closed",)
}),
)
inlines = [OccurrenceInline]
admin.site.register(Event, EventAdmin)
admin.site.register(EventCategory, EventCategoryAdmin)
| from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin
from fullcalendar.models import *
class EventCategoryAdmin(admin.ModelAdmin):
list_display = ('name',)
class OccurrenceInline(StackedDynamicInlineAdmin):
model = Occurrence
fields = ('start_time', 'end_time', 'description', 'location')
class EventAdmin(DisplayableAdmin):
list_display = ('title', 'status')
search_fields = ('title', 'description', 'content')
fieldsets = (
(None, {
"fields": [
"title", "status", ("publish_date", "expiry_date"),
"event_category", "content"
]
}),
(_("Meta data"), {
"fields": [
"_meta_title", "slug",
("description", "gen_description"),
"keywords", "in_sitemap"
],
"classes": ("collapse-closed",)
}),
)
inlines = [OccurrenceInline]
admin.site.register(Event, EventAdmin)
admin.site.register(EventCategory, EventCategoryAdmin)
| Remove list filter based on event category | Remove list filter based on event category
| Python | mit | jonge-democraten/mezzanine-fullcalendar | python | ## Code Before:
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin
from fullcalendar.models import *
class EventCategoryAdmin(admin.ModelAdmin):
list_display = ('name',)
class OccurrenceInline(StackedDynamicInlineAdmin):
model = Occurrence
fields = ('start_time', 'end_time', 'description', 'location')
class EventAdmin(DisplayableAdmin):
list_display = ('title', 'status')
list_filter = ('event_category',)
search_fields = ('title', 'description', 'content')
fieldsets = (
(None, {
"fields": [
"title", "status", ("publish_date", "expiry_date"),
"event_category", "content"
]
}),
(_("Meta data"), {
"fields": [
"_meta_title", "slug",
("description", "gen_description"),
"keywords", "in_sitemap"
],
"classes": ("collapse-closed",)
}),
)
inlines = [OccurrenceInline]
admin.site.register(Event, EventAdmin)
admin.site.register(EventCategory, EventCategoryAdmin)
## Instruction:
Remove list filter based on event category
## Code After:
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin
from fullcalendar.models import *
class EventCategoryAdmin(admin.ModelAdmin):
list_display = ('name',)
class OccurrenceInline(StackedDynamicInlineAdmin):
model = Occurrence
fields = ('start_time', 'end_time', 'description', 'location')
class EventAdmin(DisplayableAdmin):
list_display = ('title', 'status')
search_fields = ('title', 'description', 'content')
fieldsets = (
(None, {
"fields": [
"title", "status", ("publish_date", "expiry_date"),
"event_category", "content"
]
}),
(_("Meta data"), {
"fields": [
"_meta_title", "slug",
("description", "gen_description"),
"keywords", "in_sitemap"
],
"classes": ("collapse-closed",)
}),
)
inlines = [OccurrenceInline]
admin.site.register(Event, EventAdmin)
admin.site.register(EventCategory, EventCategoryAdmin)
| from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from mezzanine.core.admin import StackedDynamicInlineAdmin, DisplayableAdmin
from fullcalendar.models import *
class EventCategoryAdmin(admin.ModelAdmin):
list_display = ('name',)
class OccurrenceInline(StackedDynamicInlineAdmin):
model = Occurrence
fields = ('start_time', 'end_time', 'description', 'location')
class EventAdmin(DisplayableAdmin):
list_display = ('title', 'status')
- list_filter = ('event_category',)
search_fields = ('title', 'description', 'content')
fieldsets = (
(None, {
"fields": [
"title", "status", ("publish_date", "expiry_date"),
"event_category", "content"
]
}),
(_("Meta data"), {
"fields": [
"_meta_title", "slug",
("description", "gen_description"),
"keywords", "in_sitemap"
],
"classes": ("collapse-closed",)
}),
)
inlines = [OccurrenceInline]
admin.site.register(Event, EventAdmin)
admin.site.register(EventCategory, EventCategoryAdmin)
| 1 | 0.02439 | 0 | 1 |
8bdfe47cffb13a8b15075ece3d4b5314d7977327 | package.json | package.json | {
"name": "autocomplete-java-minus",
"main": "./lib/index.js",
"version": "0.3.0",
"description": "Autocomplete suggestions for Java",
"scripts": {
"lint": "eslint lib spec"
},
"keywords": [
"java",
"autocomplete",
"productivity"
],
"repository": "https://github.com/noseglid/autocomplete-java-minus",
"license": "MIT",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-package-deps": "^4.0.1",
"bluebird": "^3.3.5",
"glob": "^7.0.3",
"jdjs": "0.0.3"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.9.0",
"eslint-config-atom-build": "^3.0.0"
},
"package-deps": [
"java-classpath-registry"
],
"providedServices": {
"autocomplete.provider": {
"versions": {
"2.0.0": "provide"
}
}
},
"consumedServices": {
"java.import": {
"versions": {
"^1.0.0": "consumeJavaImport"
}
},
"java.classpath-registry": {
"versions": {
"^1.0.0": "consumeJavaClasspathRegistry"
}
}
}
}
| {
"name": "autocomplete-java-minus",
"main": "./lib/index.js",
"version": "0.3.0",
"description": "Autocomplete suggestions for Java",
"scripts": {
"lint": "eslint lib spec"
},
"keywords": [
"java",
"autocomplete",
"productivity"
],
"repository": "https://github.com/noseglid/autocomplete-java-minus",
"license": "MIT",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-package-deps": "^4.0.1",
"bluebird": "^3.3.5"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.9.0",
"eslint-config-atom-build": "^3.0.0"
},
"package-deps": [
"java-classpath-registry"
],
"providedServices": {
"autocomplete.provider": {
"versions": {
"2.0.0": "provide"
}
}
},
"consumedServices": {
"java.import": {
"versions": {
"^1.0.0": "consumeJavaImport"
}
},
"java.classpath-registry": {
"versions": {
"^1.0.0": "consumeJavaClasspathRegistry"
}
}
}
}
| Remove unused dependencies; glob and jdjs | Remove unused dependencies; glob and jdjs
That was part of the collection feature
| JSON | mit | noseglid/autocomplete-java-minus,noseglid/autocomplete-java-minus | json | ## Code Before:
{
"name": "autocomplete-java-minus",
"main": "./lib/index.js",
"version": "0.3.0",
"description": "Autocomplete suggestions for Java",
"scripts": {
"lint": "eslint lib spec"
},
"keywords": [
"java",
"autocomplete",
"productivity"
],
"repository": "https://github.com/noseglid/autocomplete-java-minus",
"license": "MIT",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-package-deps": "^4.0.1",
"bluebird": "^3.3.5",
"glob": "^7.0.3",
"jdjs": "0.0.3"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.9.0",
"eslint-config-atom-build": "^3.0.0"
},
"package-deps": [
"java-classpath-registry"
],
"providedServices": {
"autocomplete.provider": {
"versions": {
"2.0.0": "provide"
}
}
},
"consumedServices": {
"java.import": {
"versions": {
"^1.0.0": "consumeJavaImport"
}
},
"java.classpath-registry": {
"versions": {
"^1.0.0": "consumeJavaClasspathRegistry"
}
}
}
}
## Instruction:
Remove unused dependencies; glob and jdjs
That was part of the collection feature
## Code After:
{
"name": "autocomplete-java-minus",
"main": "./lib/index.js",
"version": "0.3.0",
"description": "Autocomplete suggestions for Java",
"scripts": {
"lint": "eslint lib spec"
},
"keywords": [
"java",
"autocomplete",
"productivity"
],
"repository": "https://github.com/noseglid/autocomplete-java-minus",
"license": "MIT",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-package-deps": "^4.0.1",
"bluebird": "^3.3.5"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.9.0",
"eslint-config-atom-build": "^3.0.0"
},
"package-deps": [
"java-classpath-registry"
],
"providedServices": {
"autocomplete.provider": {
"versions": {
"2.0.0": "provide"
}
}
},
"consumedServices": {
"java.import": {
"versions": {
"^1.0.0": "consumeJavaImport"
}
},
"java.classpath-registry": {
"versions": {
"^1.0.0": "consumeJavaClasspathRegistry"
}
}
}
}
| {
"name": "autocomplete-java-minus",
"main": "./lib/index.js",
"version": "0.3.0",
"description": "Autocomplete suggestions for Java",
"scripts": {
"lint": "eslint lib spec"
},
"keywords": [
"java",
"autocomplete",
"productivity"
],
"repository": "https://github.com/noseglid/autocomplete-java-minus",
"license": "MIT",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-package-deps": "^4.0.1",
- "bluebird": "^3.3.5",
? -
+ "bluebird": "^3.3.5"
- "glob": "^7.0.3",
- "jdjs": "0.0.3"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.9.0",
"eslint-config-atom-build": "^3.0.0"
},
"package-deps": [
"java-classpath-registry"
],
"providedServices": {
"autocomplete.provider": {
"versions": {
"2.0.0": "provide"
}
}
},
"consumedServices": {
"java.import": {
"versions": {
"^1.0.0": "consumeJavaImport"
}
},
"java.classpath-registry": {
"versions": {
"^1.0.0": "consumeJavaClasspathRegistry"
}
}
}
} | 4 | 0.076923 | 1 | 3 |
0ef3023b55fd36cace3db6e95dfa650485e54569 | src/OrbitBase/include/OrbitBase/Result.h | src/OrbitBase/include/OrbitBase/Result.h | // Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_BASE_RESULT_H_
#define ORBIT_BASE_RESULT_H_
#include <string>
#include <type_traits>
#include "outcome.hpp"
class ErrorMessage final {
public:
ErrorMessage() = default;
explicit ErrorMessage(std::string message) : message_(std::move(message)) {}
[[nodiscard]] const std::string& message() const { return message_; }
private:
std::string message_;
};
template <typename T, typename E>
using Result = outcome::result<T, E, outcome::policy::terminate>;
template <typename T>
class ErrorMessageOr : public Result<T, ErrorMessage> {
public:
using Result<T, ErrorMessage>::Result;
operator bool() = delete;
operator bool() const = delete;
};
template <typename T>
struct IsErrorMessageOr : std::false_type {};
template <typename T>
struct IsErrorMessageOr<ErrorMessageOr<T>> : std::true_type {};
#endif // ORBIT_BASE_RESULT_H_
| // Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_BASE_RESULT_H_
#define ORBIT_BASE_RESULT_H_
#include <string>
#include <type_traits>
#include "outcome.hpp"
class [[nodiscard]] ErrorMessage final {
public:
ErrorMessage() = default;
explicit ErrorMessage(std::string message) : message_(std::move(message)) {}
[[nodiscard]] const std::string& message() const { return message_; }
private:
std::string message_;
};
template <typename T, typename E>
using Result = outcome::result<T, E, outcome::policy::terminate>;
template <typename T>
class [[nodiscard]] ErrorMessageOr : public Result<T, ErrorMessage> {
public:
using Result<T, ErrorMessage>::Result;
operator bool() = delete;
operator bool() const = delete;
};
template <typename T>
struct IsErrorMessageOr : std::false_type {};
template <typename T>
struct IsErrorMessageOr<ErrorMessageOr<T>> : std::true_type {};
#endif // ORBIT_BASE_RESULT_H_
| Add nodiscard to ErrorMessage and ErrorMessageOr | Add nodiscard to ErrorMessage and ErrorMessageOr
Test: builds
| C | bsd-2-clause | google/orbit,google/orbit,google/orbit,google/orbit | c | ## Code Before:
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_BASE_RESULT_H_
#define ORBIT_BASE_RESULT_H_
#include <string>
#include <type_traits>
#include "outcome.hpp"
class ErrorMessage final {
public:
ErrorMessage() = default;
explicit ErrorMessage(std::string message) : message_(std::move(message)) {}
[[nodiscard]] const std::string& message() const { return message_; }
private:
std::string message_;
};
template <typename T, typename E>
using Result = outcome::result<T, E, outcome::policy::terminate>;
template <typename T>
class ErrorMessageOr : public Result<T, ErrorMessage> {
public:
using Result<T, ErrorMessage>::Result;
operator bool() = delete;
operator bool() const = delete;
};
template <typename T>
struct IsErrorMessageOr : std::false_type {};
template <typename T>
struct IsErrorMessageOr<ErrorMessageOr<T>> : std::true_type {};
#endif // ORBIT_BASE_RESULT_H_
## Instruction:
Add nodiscard to ErrorMessage and ErrorMessageOr
Test: builds
## Code After:
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_BASE_RESULT_H_
#define ORBIT_BASE_RESULT_H_
#include <string>
#include <type_traits>
#include "outcome.hpp"
class [[nodiscard]] ErrorMessage final {
public:
ErrorMessage() = default;
explicit ErrorMessage(std::string message) : message_(std::move(message)) {}
[[nodiscard]] const std::string& message() const { return message_; }
private:
std::string message_;
};
template <typename T, typename E>
using Result = outcome::result<T, E, outcome::policy::terminate>;
template <typename T>
class [[nodiscard]] ErrorMessageOr : public Result<T, ErrorMessage> {
public:
using Result<T, ErrorMessage>::Result;
operator bool() = delete;
operator bool() const = delete;
};
template <typename T>
struct IsErrorMessageOr : std::false_type {};
template <typename T>
struct IsErrorMessageOr<ErrorMessageOr<T>> : std::true_type {};
#endif // ORBIT_BASE_RESULT_H_
| // Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_BASE_RESULT_H_
#define ORBIT_BASE_RESULT_H_
#include <string>
#include <type_traits>
#include "outcome.hpp"
- class ErrorMessage final {
+ class [[nodiscard]] ErrorMessage final {
? ++++++++++++++
public:
ErrorMessage() = default;
explicit ErrorMessage(std::string message) : message_(std::move(message)) {}
[[nodiscard]] const std::string& message() const { return message_; }
private:
std::string message_;
};
template <typename T, typename E>
using Result = outcome::result<T, E, outcome::policy::terminate>;
template <typename T>
- class ErrorMessageOr : public Result<T, ErrorMessage> {
+ class [[nodiscard]] ErrorMessageOr : public Result<T, ErrorMessage> {
? ++++++++++++++
public:
using Result<T, ErrorMessage>::Result;
operator bool() = delete;
operator bool() const = delete;
};
template <typename T>
struct IsErrorMessageOr : std::false_type {};
template <typename T>
struct IsErrorMessageOr<ErrorMessageOr<T>> : std::true_type {};
#endif // ORBIT_BASE_RESULT_H_ | 4 | 0.095238 | 2 | 2 |
2f4ce7ae4ec634da38b1b92abdc35b468ba41184 | _config.yml | _config.yml | markdown: redcarpet
highlighter: pygments
gems:
- jemoji
# Site settings
title: "Project Management Blog"
description: >
The road to Scrum
baseurl: /project-management-blog
#blog logo
logo: "/assets/images/df_logo.jpg"
# blog cover
cover: "/assets/images/cA4aKEIPQrerBnp1yGHv_IMG_9534-3-2.jpg"
name: 'Ivan Montiel'
author: 'Ivan Montiel'
author_image: "/assets/images/author.jpg"
paginate: 5
| markdown: redcarpet
highlighter: pygments
gems:
- jemoji
# Site settings
title: "Project Management Blog"
description: >
The road to Scrum
url: http://idmontie.github.io/project-management-blog/
baseurl: /project-management-blog
#blog logo
logo: "/assets/images/df_logo.jpg"
# blog cover
cover: "/assets/images/cA4aKEIPQrerBnp1yGHv_IMG_9534-3-2.jpg"
name: 'Ivan Montiel'
author: 'Ivan Montiel'
author_image: "/assets/images/author.jpg"
paginate: 5
| Add back in url config | Add back in url config
| YAML | mit | idmontie/ProjectManagementBlog,idmontie/ProjectManagementBlog,idmontie/project-management-blog,idmontie/project-management-blog,idmontie/project-management-blog,idmontie/ProjectManagementBlog | yaml | ## Code Before:
markdown: redcarpet
highlighter: pygments
gems:
- jemoji
# Site settings
title: "Project Management Blog"
description: >
The road to Scrum
baseurl: /project-management-blog
#blog logo
logo: "/assets/images/df_logo.jpg"
# blog cover
cover: "/assets/images/cA4aKEIPQrerBnp1yGHv_IMG_9534-3-2.jpg"
name: 'Ivan Montiel'
author: 'Ivan Montiel'
author_image: "/assets/images/author.jpg"
paginate: 5
## Instruction:
Add back in url config
## Code After:
markdown: redcarpet
highlighter: pygments
gems:
- jemoji
# Site settings
title: "Project Management Blog"
description: >
The road to Scrum
url: http://idmontie.github.io/project-management-blog/
baseurl: /project-management-blog
#blog logo
logo: "/assets/images/df_logo.jpg"
# blog cover
cover: "/assets/images/cA4aKEIPQrerBnp1yGHv_IMG_9534-3-2.jpg"
name: 'Ivan Montiel'
author: 'Ivan Montiel'
author_image: "/assets/images/author.jpg"
paginate: 5
| markdown: redcarpet
highlighter: pygments
gems:
- jemoji
# Site settings
title: "Project Management Blog"
description: >
The road to Scrum
+ url: http://idmontie.github.io/project-management-blog/
baseurl: /project-management-blog
#blog logo
logo: "/assets/images/df_logo.jpg"
# blog cover
cover: "/assets/images/cA4aKEIPQrerBnp1yGHv_IMG_9534-3-2.jpg"
name: 'Ivan Montiel'
author: 'Ivan Montiel'
author_image: "/assets/images/author.jpg"
paginate: 5
| 1 | 0.043478 | 1 | 0 |
dfceb16aa230271501b139a553cc44f316d9f69e | lib/html/proofer/check_runner.rb | lib/html/proofer/check_runner.rb |
class HTML::Proofer
# Mostly handles issue management and collecting of external URLs.
class CheckRunner
attr_reader :issues, :src, :path, :options, :external_urls, :href_ignores, :alt_ignores
def initialize(src, path, html, opts={})
@src = src
@path = path
@html = remove_ignored(html)
@options = opts
@issues = []
@href_ignores = @options[:href_ignore]
@alt_ignores = @options[:alt_ignore]
@external_urls = {}
end
def run
fail NotImplementedError, 'HTML::Proofer::CheckRunner subclasses must implement #run'
end
def add_issue(desc, line_number = nil, status = -1)
@issues << Issue.new(@path, desc, line_number, status)
end
def add_to_external_urls(href)
if @external_urls[href]
@external_urls[href] << @path
else
@external_urls[href] = [@path]
end
end
def self.checks
classes = []
ObjectSpace.each_object(Class) do |c|
next unless c.superclass == self
classes << c
end
classes
end
private
def remove_ignored(html)
html.css('code, pre').each(&:unlink)
html
end
end
end
|
module HTML
class Proofer
# Mostly handles issue management and collecting of external URLs.
class CheckRunner
attr_reader :issues, :src, :path, :options, :external_urls, :href_ignores, :alt_ignores
def initialize(src, path, html, opts={})
@src = src
@path = path
@html = remove_ignored(html)
@options = opts
@issues = []
@href_ignores = @options[:href_ignore]
@alt_ignores = @options[:alt_ignore]
@external_urls = {}
end
def run
fail NotImplementedError, 'HTML::Proofer::CheckRunner subclasses must implement #run'
end
def add_issue(desc, line_number = nil, status = -1)
@issues << Issue.new(@path, desc, line_number, status)
end
def add_to_external_urls(href)
if @external_urls[href]
@external_urls[href] << @path
else
@external_urls[href] = [@path]
end
end
def self.checks
classes = []
ObjectSpace.each_object(Class) do |c|
next unless c.superclass == self
classes << c
end
classes
end
private
def remove_ignored(html)
html.css('code, pre').each(&:unlink)
html
end
end
end
end
| Fix class definition for CheckRunner | Fix class definition for CheckRunner
Resolves https://github.com/gjtorikian/html-proofer/issues/157
| Ruby | mit | Tiger66639/html-proofer,gjtorikian/html-proofer,gjtorikian/html-proofer,gjtorikian/html-proofer,Tiger66639/html-proofer,Tiger66639/html-proofer,gjtorikian/html-proofer,gjtorikian/html-proofer,Tiger66639/html-proofer,Tiger66639/html-proofer | ruby | ## Code Before:
class HTML::Proofer
# Mostly handles issue management and collecting of external URLs.
class CheckRunner
attr_reader :issues, :src, :path, :options, :external_urls, :href_ignores, :alt_ignores
def initialize(src, path, html, opts={})
@src = src
@path = path
@html = remove_ignored(html)
@options = opts
@issues = []
@href_ignores = @options[:href_ignore]
@alt_ignores = @options[:alt_ignore]
@external_urls = {}
end
def run
fail NotImplementedError, 'HTML::Proofer::CheckRunner subclasses must implement #run'
end
def add_issue(desc, line_number = nil, status = -1)
@issues << Issue.new(@path, desc, line_number, status)
end
def add_to_external_urls(href)
if @external_urls[href]
@external_urls[href] << @path
else
@external_urls[href] = [@path]
end
end
def self.checks
classes = []
ObjectSpace.each_object(Class) do |c|
next unless c.superclass == self
classes << c
end
classes
end
private
def remove_ignored(html)
html.css('code, pre').each(&:unlink)
html
end
end
end
## Instruction:
Fix class definition for CheckRunner
Resolves https://github.com/gjtorikian/html-proofer/issues/157
## Code After:
module HTML
class Proofer
# Mostly handles issue management and collecting of external URLs.
class CheckRunner
attr_reader :issues, :src, :path, :options, :external_urls, :href_ignores, :alt_ignores
def initialize(src, path, html, opts={})
@src = src
@path = path
@html = remove_ignored(html)
@options = opts
@issues = []
@href_ignores = @options[:href_ignore]
@alt_ignores = @options[:alt_ignore]
@external_urls = {}
end
def run
fail NotImplementedError, 'HTML::Proofer::CheckRunner subclasses must implement #run'
end
def add_issue(desc, line_number = nil, status = -1)
@issues << Issue.new(@path, desc, line_number, status)
end
def add_to_external_urls(href)
if @external_urls[href]
@external_urls[href] << @path
else
@external_urls[href] = [@path]
end
end
def self.checks
classes = []
ObjectSpace.each_object(Class) do |c|
next unless c.superclass == self
classes << c
end
classes
end
private
def remove_ignored(html)
html.css('code, pre').each(&:unlink)
html
end
end
end
end
|
+ module HTML
- class HTML::Proofer
? ------
+ class Proofer
? ++
+ # Mostly handles issue management and collecting of external URLs.
+ class CheckRunner
+ attr_reader :issues, :src, :path, :options, :external_urls, :href_ignores, :alt_ignores
- # Mostly handles issue management and collecting of external URLs.
- class CheckRunner
- attr_reader :issues, :src, :path, :options, :external_urls, :href_ignores, :alt_ignores
+ def initialize(src, path, html, opts={})
+ @src = src
+ @path = path
+ @html = remove_ignored(html)
+ @options = opts
+ @issues = []
+ @href_ignores = @options[:href_ignore]
+ @alt_ignores = @options[:alt_ignore]
+ @external_urls = {}
+ end
+ def run
+ fail NotImplementedError, 'HTML::Proofer::CheckRunner subclasses must implement #run'
- def initialize(src, path, html, opts={})
- @src = src
- @path = path
- @html = remove_ignored(html)
- @options = opts
- @issues = []
- @href_ignores = @options[:href_ignore]
- @alt_ignores = @options[:alt_ignore]
- @external_urls = {}
- end
+ end
? ++
- def run
- fail NotImplementedError, 'HTML::Proofer::CheckRunner subclasses must implement #run'
+ def add_issue(desc, line_number = nil, status = -1)
+ @issues << Issue.new(@path, desc, line_number, status)
- end
+ end
? ++
- def add_issue(desc, line_number = nil, status = -1)
- @issues << Issue.new(@path, desc, line_number, status)
+ def add_to_external_urls(href)
+ if @external_urls[href]
+ @external_urls[href] << @path
+ else
+ @external_urls[href] = [@path]
+ end
- end
+ end
? ++
- def add_to_external_urls(href)
- if @external_urls[href]
- @external_urls[href] << @path
- else
- @external_urls[href] = [@path]
+ def self.checks
+ classes = []
+
+ ObjectSpace.each_object(Class) do |c|
+ next unless c.superclass == self
+ classes << c
+ end
+
+ classes
+ end
+
+ private
+
+ def remove_ignored(html)
+ html.css('code, pre').each(&:unlink)
+ html
end
end
-
- def self.checks
- classes = []
-
- ObjectSpace.each_object(Class) do |c|
- next unless c.superclass == self
- classes << c
- end
-
- classes
- end
-
- private
-
- def remove_ignored(html)
- html.css('code, pre').each(&:unlink)
- html
- end
-
end
end | 88 | 1.6 | 44 | 44 |
60103df80bd0b8c098383453ca570ce8595776b6 | src/renderer/stylesheets/blocks/_base.scss | src/renderer/stylesheets/blocks/_base.scss | @import "qiita-coat/scss/variables";
body,
html {
height: 100%;
overflow: hidden;
width: 100%;
}
body {
font-family: $font-family-sans-serif;
height: 100%;
line-height: 1.5;
}
| @import "qiita-coat/scss/variables";
body,
html {
height: 100%;
overflow: hidden;
width: 100%;
}
body {
font-family: $font-family-sans-serif;
height: 100%;
line-height: 1.5;
}
img {
-webkit-user-drag: none;
}
| Disable drag and drop on img element | Disable drag and drop on img element
For desktop app like interface.
| SCSS | mit | r7kamura/retro-twitter-client,r7kamura/retro-twitter-client | scss | ## Code Before:
@import "qiita-coat/scss/variables";
body,
html {
height: 100%;
overflow: hidden;
width: 100%;
}
body {
font-family: $font-family-sans-serif;
height: 100%;
line-height: 1.5;
}
## Instruction:
Disable drag and drop on img element
For desktop app like interface.
## Code After:
@import "qiita-coat/scss/variables";
body,
html {
height: 100%;
overflow: hidden;
width: 100%;
}
body {
font-family: $font-family-sans-serif;
height: 100%;
line-height: 1.5;
}
img {
-webkit-user-drag: none;
}
| @import "qiita-coat/scss/variables";
body,
html {
height: 100%;
overflow: hidden;
width: 100%;
}
body {
font-family: $font-family-sans-serif;
height: 100%;
line-height: 1.5;
}
+
+ img {
+ -webkit-user-drag: none;
+ } | 4 | 0.285714 | 4 | 0 |
fe0867e5499b627e776d132d300d17b40858dcab | line_profiler.py | line_profiler.py | from cProfile import label
import marshal
from _line_profiler import LineProfiler as CLineProfiler
class LineProfiler(CLineProfiler):
""" A subclass of the C version solely to provide a decorator since Cython
does not have closures.
"""
def __call__(self, func):
""" Decorate a function to start the profiler on function entry and stop
it on function exit.
"""
def f(*args, **kwds):
self.add_function(func)
self.enable_by_count()
try:
result = func(*args, **kwds)
finally:
self.disable_by_count()
return result
f.__name__ = func.__name__
f.__doc__ = func.__doc__
f.__dict__.update(func.__dict__)
return f
def dump_stats(self, filename):
""" Dump a representation of the data to a file as a marshalled
dictionary from `get_stats()`.
"""
stats = self.get_stats()
f = open(filename, 'wb')
try:
marshal.dump(stats, f)
finally:
f.close()
| from cProfile import label
import marshal
from _line_profiler import LineProfiler as CLineProfiler
class LineProfiler(CLineProfiler):
""" A subclass of the C version solely to provide a decorator since Cython
does not have closures.
"""
def __call__(self, func):
""" Decorate a function to start the profiler on function entry and stop
it on function exit.
"""
def f(*args, **kwds):
self.add_function(func)
self.enable_by_count()
try:
result = func(*args, **kwds)
finally:
self.disable_by_count()
return result
f.__name__ = func.__name__
f.__doc__ = func.__doc__
f.__dict__.update(func.__dict__)
return f
def dump_stats(self, filename):
""" Dump a representation of the data to a file as a marshalled
dictionary from `get_stats()`.
"""
stats = self.get_stats()
f = open(filename, 'wb')
try:
marshal.dump(stats, f)
finally:
f.close()
def run(self, cmd):
""" Profile a single executable statment in the main namespace.
"""
import __main__
dict = __main__.__dict__
return self.runctx(cmd, dict, dict)
def runctx(self, cmd, globals, locals):
""" Profile a single executable statement in the given namespaces.
"""
self.enable_by_count()
try:
exec cmd in globals, locals
finally:
self.disable_by_count()
return self
def runcall(self, func, *args, **kw):
""" Profile a single function call.
"""
self.enable_by_count()
try:
return func(*args, **kw)
finally:
self.disable_by_count()
| Add the typical run/runctx/runcall methods. | ENH: Add the typical run/runctx/runcall methods.
| Python | bsd-3-clause | amegianeg/line_profiler,jstasiak/line_profiler,dreampuf/lprofiler,dreampuf/lprofiler,eblur/line_profiler,jstasiak/line_profiler,ymero/line_profiler,eblur/line_profiler,certik/line_profiler,certik/line_profiler,amegianeg/line_profiler,Doctorhoenikker/line_profiler,jsalva/line_profiler,Doctorhoenikker/line_profiler,ymero/line_profiler,jsalva/line_profiler,dreampuf/lprofiler | python | ## Code Before:
from cProfile import label
import marshal
from _line_profiler import LineProfiler as CLineProfiler
class LineProfiler(CLineProfiler):
""" A subclass of the C version solely to provide a decorator since Cython
does not have closures.
"""
def __call__(self, func):
""" Decorate a function to start the profiler on function entry and stop
it on function exit.
"""
def f(*args, **kwds):
self.add_function(func)
self.enable_by_count()
try:
result = func(*args, **kwds)
finally:
self.disable_by_count()
return result
f.__name__ = func.__name__
f.__doc__ = func.__doc__
f.__dict__.update(func.__dict__)
return f
def dump_stats(self, filename):
""" Dump a representation of the data to a file as a marshalled
dictionary from `get_stats()`.
"""
stats = self.get_stats()
f = open(filename, 'wb')
try:
marshal.dump(stats, f)
finally:
f.close()
## Instruction:
ENH: Add the typical run/runctx/runcall methods.
## Code After:
from cProfile import label
import marshal
from _line_profiler import LineProfiler as CLineProfiler
class LineProfiler(CLineProfiler):
""" A subclass of the C version solely to provide a decorator since Cython
does not have closures.
"""
def __call__(self, func):
""" Decorate a function to start the profiler on function entry and stop
it on function exit.
"""
def f(*args, **kwds):
self.add_function(func)
self.enable_by_count()
try:
result = func(*args, **kwds)
finally:
self.disable_by_count()
return result
f.__name__ = func.__name__
f.__doc__ = func.__doc__
f.__dict__.update(func.__dict__)
return f
def dump_stats(self, filename):
""" Dump a representation of the data to a file as a marshalled
dictionary from `get_stats()`.
"""
stats = self.get_stats()
f = open(filename, 'wb')
try:
marshal.dump(stats, f)
finally:
f.close()
def run(self, cmd):
""" Profile a single executable statment in the main namespace.
"""
import __main__
dict = __main__.__dict__
return self.runctx(cmd, dict, dict)
def runctx(self, cmd, globals, locals):
""" Profile a single executable statement in the given namespaces.
"""
self.enable_by_count()
try:
exec cmd in globals, locals
finally:
self.disable_by_count()
return self
def runcall(self, func, *args, **kw):
""" Profile a single function call.
"""
self.enable_by_count()
try:
return func(*args, **kw)
finally:
self.disable_by_count()
| from cProfile import label
import marshal
from _line_profiler import LineProfiler as CLineProfiler
class LineProfiler(CLineProfiler):
""" A subclass of the C version solely to provide a decorator since Cython
does not have closures.
"""
def __call__(self, func):
""" Decorate a function to start the profiler on function entry and stop
it on function exit.
"""
def f(*args, **kwds):
self.add_function(func)
self.enable_by_count()
try:
result = func(*args, **kwds)
finally:
self.disable_by_count()
return result
f.__name__ = func.__name__
f.__doc__ = func.__doc__
f.__dict__.update(func.__dict__)
return f
def dump_stats(self, filename):
""" Dump a representation of the data to a file as a marshalled
dictionary from `get_stats()`.
"""
stats = self.get_stats()
f = open(filename, 'wb')
try:
marshal.dump(stats, f)
finally:
f.close()
+ def run(self, cmd):
+ """ Profile a single executable statment in the main namespace.
+ """
+ import __main__
+ dict = __main__.__dict__
+ return self.runctx(cmd, dict, dict)
+
+ def runctx(self, cmd, globals, locals):
+ """ Profile a single executable statement in the given namespaces.
+ """
+ self.enable_by_count()
+ try:
+ exec cmd in globals, locals
+ finally:
+ self.disable_by_count()
+ return self
+
+ def runcall(self, func, *args, **kw):
+ """ Profile a single function call.
+ """
+ self.enable_by_count()
+ try:
+ return func(*args, **kw)
+ finally:
+ self.disable_by_count()
+ | 26 | 0.666667 | 26 | 0 |
8eda1cca306a3419feba2f30ad6c01a32be3630b | app/src/main/res/values/colors.xml | app/src/main/res/values/colors.xml | <?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#c62828</color>
<color name="primary_dark">#b71c1c</color>
<color name="primary_light">#e53935</color>
<color name="accent">#FFB300</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color>
<color name="windowBackground">#FFF</color>
<color name="white">#FFF</color>
</resources> | <?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#0097A7</color>
<color name="primary_dark">#006064</color>
<color name="primary_light">#00BCD4</color>
<color name="accent">#C6FF00</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color>
<color name="windowBackground">#FFF</color>
<color name="white">#FFF</color>
</resources> | Change UI color to teal. | Change UI color to teal.
| XML | mit | vehicle-history/vehicle-history-android,tieusangaka/vehicle-history-android | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#c62828</color>
<color name="primary_dark">#b71c1c</color>
<color name="primary_light">#e53935</color>
<color name="accent">#FFB300</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color>
<color name="windowBackground">#FFF</color>
<color name="white">#FFF</color>
</resources>
## Instruction:
Change UI color to teal.
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#0097A7</color>
<color name="primary_dark">#006064</color>
<color name="primary_light">#00BCD4</color>
<color name="accent">#C6FF00</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color>
<color name="windowBackground">#FFF</color>
<color name="white">#FFF</color>
</resources> | <?xml version="1.0" encoding="utf-8"?>
<resources>
- <color name="primary">#c62828</color>
? ^^^^^^
+ <color name="primary">#0097A7</color>
? ^^^^^^
- <color name="primary_dark">#b71c1c</color>
? ^^^^^^
+ <color name="primary_dark">#006064</color>
? ^^^^^^
- <color name="primary_light">#e53935</color>
? ^^^^^^
+ <color name="primary_light">#00BCD4</color>
? ^^^^^^
- <color name="accent">#FFB300</color>
? --
+ <color name="accent">#C6FF00</color>
? ++
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color>
<color name="windowBackground">#FFF</color>
<color name="white">#FFF</color>
</resources> | 8 | 0.615385 | 4 | 4 |
2071d791238558a8644795d6e8447f5eb3b52938 | README.rst | README.rst | android-asset-resizer
=====================
... ::
This is a code sample
this is not...
Requirements
------------
- PIL (tested with version ``1.1.7``, but may work with earlier versions)
License
-------
See the LICENSE_ file.
.. _LICENSE: https://github.com/twaddington/android-asset-resizer/blob/master/LICENSE
| android-asset-resizer
=====================
... ::
This is a code sample
this is not...
Requirements
------------
- PIL (tested with version ``1.1.7``, but may work with earlier versions)
Publishing
----------
::
# Register with pypi (only done once)
$ python setup.py register
# First create a source distribution
$ python setup.py sdist
# Upload the distribution to pypi
$ python setup.py upload
License
-------
See the LICENSE_ file.
.. _LICENSE: https://github.com/twaddington/android-asset-resizer/blob/master/LICENSE
| Add publishing info to readme. | Add publishing info to readme.
| reStructuredText | apache-2.0 | twaddington/android-asset-resizer | restructuredtext | ## Code Before:
android-asset-resizer
=====================
... ::
This is a code sample
this is not...
Requirements
------------
- PIL (tested with version ``1.1.7``, but may work with earlier versions)
License
-------
See the LICENSE_ file.
.. _LICENSE: https://github.com/twaddington/android-asset-resizer/blob/master/LICENSE
## Instruction:
Add publishing info to readme.
## Code After:
android-asset-resizer
=====================
... ::
This is a code sample
this is not...
Requirements
------------
- PIL (tested with version ``1.1.7``, but may work with earlier versions)
Publishing
----------
::
# Register with pypi (only done once)
$ python setup.py register
# First create a source distribution
$ python setup.py sdist
# Upload the distribution to pypi
$ python setup.py upload
License
-------
See the LICENSE_ file.
.. _LICENSE: https://github.com/twaddington/android-asset-resizer/blob/master/LICENSE
| android-asset-resizer
=====================
... ::
This is a code sample
this is not...
Requirements
------------
- PIL (tested with version ``1.1.7``, but may work with earlier versions)
+ Publishing
+ ----------
+
+ ::
+
+ # Register with pypi (only done once)
+ $ python setup.py register
+
+ # First create a source distribution
+ $ python setup.py sdist
+
+ # Upload the distribution to pypi
+ $ python setup.py upload
+
License
-------
See the LICENSE_ file.
.. _LICENSE: https://github.com/twaddington/android-asset-resizer/blob/master/LICENSE
| 14 | 0.666667 | 14 | 0 |
449d4f06fe7501ed53e3aaaa465a499442285e90 | test/CXX/class/class.union/p2-0x.cpp | test/CXX/class/class.union/p2-0x.cpp | // RUN: %clang_cc1 -verify -std=c++11 %s
// Unlike in C++98, C++11 allows unions to have static data members.
union U1 {
static constexpr int k1 = 0;
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double k4 = k2;
static const double k5 = k4; // expected-warning {{GNU extension}} expected-note {{use 'constexpr'}}
int n[k1 + 3];
};
constexpr int U1::k1;
constexpr int U1::k2;
int U1::k3;
const double U1::k4;
const double U1::k5;
template<typename T>
union U2 {
static const int k1;
static double k2;
T t;
};
template<typename T> constexpr int U2<T>::k1 = sizeof(U2<T>);
template<typename T> double U2<T>::k2 = 5.3;
static_assert(U2<int>::k1 == sizeof(int), "");
static_assert(U2<char>::k1 == sizeof(char), "");
union U3 {
static const int k;
U3() : k(0) {} // expected-error {{does not name a non-static data member}}
};
| // RUN: %clang_cc1 -verify -std=c++11 %s
// Unlike in C++98, C++11 allows unions to have static data members.
union U1 {
static constexpr int k1 = 0;
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double k4 = k2;
static const double k5 = k4; // expected-warning {{GNU extension}} expected-note {{use 'constexpr'}}
int n[k1 + 3];
};
constexpr int U1::k1;
constexpr int U1::k2;
int U1::k3;
const double U1::k4;
const double U1::k5;
template<typename T>
union U2 {
static const int k1;
static double k2;
T t;
};
template<typename T> constexpr int U2<T>::k1 = sizeof(U2<T>);
template<typename T> double U2<T>::k2 = 5.3;
static_assert(U2<int>::k1 == sizeof(int), "");
static_assert(U2<char>::k1 == sizeof(char), "");
union U3 {
static const int k;
U3() : k(0) {} // expected-error {{does not name a non-static data member}}
};
struct S {
union {
static const int n; // expected-error {{static members cannot be declared in an anonymous union}}
int a;
int b;
};
};
static union {
static const int k; // expected-error {{static members cannot be declared in an anonymous union}}
int n;
};
| Make sure we still reject static data members in anonymous unions in C++11. | Make sure we still reject static data members in anonymous unions in C++11.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@150724 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang | c++ | ## Code Before:
// RUN: %clang_cc1 -verify -std=c++11 %s
// Unlike in C++98, C++11 allows unions to have static data members.
union U1 {
static constexpr int k1 = 0;
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double k4 = k2;
static const double k5 = k4; // expected-warning {{GNU extension}} expected-note {{use 'constexpr'}}
int n[k1 + 3];
};
constexpr int U1::k1;
constexpr int U1::k2;
int U1::k3;
const double U1::k4;
const double U1::k5;
template<typename T>
union U2 {
static const int k1;
static double k2;
T t;
};
template<typename T> constexpr int U2<T>::k1 = sizeof(U2<T>);
template<typename T> double U2<T>::k2 = 5.3;
static_assert(U2<int>::k1 == sizeof(int), "");
static_assert(U2<char>::k1 == sizeof(char), "");
union U3 {
static const int k;
U3() : k(0) {} // expected-error {{does not name a non-static data member}}
};
## Instruction:
Make sure we still reject static data members in anonymous unions in C++11.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@150724 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
// RUN: %clang_cc1 -verify -std=c++11 %s
// Unlike in C++98, C++11 allows unions to have static data members.
union U1 {
static constexpr int k1 = 0;
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double k4 = k2;
static const double k5 = k4; // expected-warning {{GNU extension}} expected-note {{use 'constexpr'}}
int n[k1 + 3];
};
constexpr int U1::k1;
constexpr int U1::k2;
int U1::k3;
const double U1::k4;
const double U1::k5;
template<typename T>
union U2 {
static const int k1;
static double k2;
T t;
};
template<typename T> constexpr int U2<T>::k1 = sizeof(U2<T>);
template<typename T> double U2<T>::k2 = 5.3;
static_assert(U2<int>::k1 == sizeof(int), "");
static_assert(U2<char>::k1 == sizeof(char), "");
union U3 {
static const int k;
U3() : k(0) {} // expected-error {{does not name a non-static data member}}
};
struct S {
union {
static const int n; // expected-error {{static members cannot be declared in an anonymous union}}
int a;
int b;
};
};
static union {
static const int k; // expected-error {{static members cannot be declared in an anonymous union}}
int n;
};
| // RUN: %clang_cc1 -verify -std=c++11 %s
// Unlike in C++98, C++11 allows unions to have static data members.
union U1 {
static constexpr int k1 = 0;
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double k4 = k2;
static const double k5 = k4; // expected-warning {{GNU extension}} expected-note {{use 'constexpr'}}
int n[k1 + 3];
};
constexpr int U1::k1;
constexpr int U1::k2;
int U1::k3;
const double U1::k4;
const double U1::k5;
template<typename T>
union U2 {
static const int k1;
static double k2;
T t;
};
template<typename T> constexpr int U2<T>::k1 = sizeof(U2<T>);
template<typename T> double U2<T>::k2 = 5.3;
static_assert(U2<int>::k1 == sizeof(int), "");
static_assert(U2<char>::k1 == sizeof(char), "");
union U3 {
static const int k;
U3() : k(0) {} // expected-error {{does not name a non-static data member}}
};
+
+ struct S {
+ union {
+ static const int n; // expected-error {{static members cannot be declared in an anonymous union}}
+ int a;
+ int b;
+ };
+ };
+ static union {
+ static const int k; // expected-error {{static members cannot be declared in an anonymous union}}
+ int n;
+ }; | 12 | 0.333333 | 12 | 0 |
3e8e2d69780b1fd3169dcb2b4ada04854c32e1a6 | app/controllers/welcome_controller.rb | app/controllers/welcome_controller.rb | class WelcomeController < ApplicationController
def index
if logged_in?
@user = current_user
@invitation = Invitation.new
@active_invitations = @user.received_invitations.where(seen: false).pluck('DISTINCT sender_id').map{|sender_id| Invitation.find_by(recipient_id: @user.id, sender_id: sender_id) }.reverse
@available_users = User.all.includes(:level, :country, :native_language, :study_language)
else
@user = User.new
end
end
end
| class WelcomeController < ApplicationController
def index
if logged_in?
@user = current_user
@invitation = Invitation.new
@active_invitations = @user.received_invitations.where(seen: false).pluck('DISTINCT sender_id').map{|sender_id| Invitation.find_by(recipient_id: @user.id, sender_id: sender_id) }.reverse
# @available_users = User.all.includes(:level, :country, :native_language, :study_language)
@available_users = User.all.includes(:level, :country, :native_language,
:study_language).where("last_seen_at > ? and id != ?", 10.minutes.ago, current_user.id)
else
@user = User.new
end
end
end
| Update available users to show only available users that are not the current user | Update available users to show only available users that are not the current user
| Ruby | artistic-2.0 | tgoldenberg/Speak-It,tgoldenberg/Speak-It,tgoldenberg/Speak-It,nyc-dragonflies-2015/Speak-It,nyc-dragonflies-2015/Speak-It,nyc-dragonflies-2015/Speak-It | ruby | ## Code Before:
class WelcomeController < ApplicationController
def index
if logged_in?
@user = current_user
@invitation = Invitation.new
@active_invitations = @user.received_invitations.where(seen: false).pluck('DISTINCT sender_id').map{|sender_id| Invitation.find_by(recipient_id: @user.id, sender_id: sender_id) }.reverse
@available_users = User.all.includes(:level, :country, :native_language, :study_language)
else
@user = User.new
end
end
end
## Instruction:
Update available users to show only available users that are not the current user
## Code After:
class WelcomeController < ApplicationController
def index
if logged_in?
@user = current_user
@invitation = Invitation.new
@active_invitations = @user.received_invitations.where(seen: false).pluck('DISTINCT sender_id').map{|sender_id| Invitation.find_by(recipient_id: @user.id, sender_id: sender_id) }.reverse
# @available_users = User.all.includes(:level, :country, :native_language, :study_language)
@available_users = User.all.includes(:level, :country, :native_language,
:study_language).where("last_seen_at > ? and id != ?", 10.minutes.ago, current_user.id)
else
@user = User.new
end
end
end
| class WelcomeController < ApplicationController
def index
if logged_in?
@user = current_user
@invitation = Invitation.new
@active_invitations = @user.received_invitations.where(seen: false).pluck('DISTINCT sender_id').map{|sender_id| Invitation.find_by(recipient_id: @user.id, sender_id: sender_id) }.reverse
- @available_users = User.all.includes(:level, :country, :native_language, :study_language)
+ # @available_users = User.all.includes(:level, :country, :native_language, :study_language)
? ++
+ @available_users = User.all.includes(:level, :country, :native_language,
+ :study_language).where("last_seen_at > ? and id != ?", 10.minutes.ago, current_user.id)
else
@user = User.new
end
end
end | 4 | 0.285714 | 3 | 1 |
8d7ab87ef66cc2e483ed5405c77ebdb13ee27eb9 | appveyor.yml | appveyor.yml | version: '{build}'
os: Visual Studio 2015
clone_depth: 1
configuration:
- Release
install:
- choco install -y InnoSetup
before_build:
- cmake -H. -Bvs2013-x64 -G"Visual Studio 12 2013 Win64"
- cmake -H. -Bvs2013-x86 -G"Visual Studio 12 2013"
- cmake -H. -Bvs2015-x64 -G"Visual Studio 14 2015 Win64"
- cmake -H. -Bvs2015-x86 -G"Visual Studio 14 2015"
build_script:
- cmake --build vs2013-x64 --config Release --target installer
- cmake --build vs2013-x86 --config Release --target installer
- cmake --build vs2015-x64 --config Release --target installer
- cmake --build vs2015-x86 --config Release --target installer
artifacts:
- path: LuaVM-vs*.exe
deploy:
provider: GitHub
description: Draft Release
auth_token:
secure: 9u2iMRO2KmnGYYLq9tqm0su2eY3h9FprKV8600vkNsFVCcM0ukfaZuu6SDGb95a6
artifact: /LuaVM.+\.exe/
draft: true
prerelease: true
| version: '{build}'
os: Visual Studio 2015
clone_depth: 1
configuration:
- Release
install:
- choco install -y InnoSetup
before_build:
- cmake -H. -Bvs2013-x64 -G"Visual Studio 12 2013 Win64"
- cmake -H. -Bvs2013-x86 -G"Visual Studio 12 2013"
- cmake -H. -Bvs2015-x64 -G"Visual Studio 14 2015 Win64"
- cmake -H. -Bvs2015-x86 -G"Visual Studio 14 2015"
build_script:
- cmake --build vs2013-x64 --config Release --target installer
- cmake --build vs2013-x86 --config Release --target installer
- cmake --build vs2015-x64 --config Release --target installer
- cmake --build vs2015-x86 --config Release --target installer
artifacts:
- path: LuaVM-vs*.exe
deploy:
provider: GitHub
description: Release of v$(appveyor_build_version)
auth_token:
secure: 9u2iMRO2KmnGYYLq9tqm0su2eY3h9FprKV8600vkNsFVCcM0ukfaZuu6SDGb95a6
artifact: /LuaVM.+\.exe/
draft: true
prerelease: true
on:
branch: master
appveyor_repo_tag: true
| Deploy only on tags only. | Deploy only on tags only.
| YAML | mit | xpol/luainstaller,xpol/luavm,xpol/luavm,xpol/luavm,xpol/luainstaller,xpol/luainstaller,xpol/luavm,xpol/luavm,xpol/luainstaller | yaml | ## Code Before:
version: '{build}'
os: Visual Studio 2015
clone_depth: 1
configuration:
- Release
install:
- choco install -y InnoSetup
before_build:
- cmake -H. -Bvs2013-x64 -G"Visual Studio 12 2013 Win64"
- cmake -H. -Bvs2013-x86 -G"Visual Studio 12 2013"
- cmake -H. -Bvs2015-x64 -G"Visual Studio 14 2015 Win64"
- cmake -H. -Bvs2015-x86 -G"Visual Studio 14 2015"
build_script:
- cmake --build vs2013-x64 --config Release --target installer
- cmake --build vs2013-x86 --config Release --target installer
- cmake --build vs2015-x64 --config Release --target installer
- cmake --build vs2015-x86 --config Release --target installer
artifacts:
- path: LuaVM-vs*.exe
deploy:
provider: GitHub
description: Draft Release
auth_token:
secure: 9u2iMRO2KmnGYYLq9tqm0su2eY3h9FprKV8600vkNsFVCcM0ukfaZuu6SDGb95a6
artifact: /LuaVM.+\.exe/
draft: true
prerelease: true
## Instruction:
Deploy only on tags only.
## Code After:
version: '{build}'
os: Visual Studio 2015
clone_depth: 1
configuration:
- Release
install:
- choco install -y InnoSetup
before_build:
- cmake -H. -Bvs2013-x64 -G"Visual Studio 12 2013 Win64"
- cmake -H. -Bvs2013-x86 -G"Visual Studio 12 2013"
- cmake -H. -Bvs2015-x64 -G"Visual Studio 14 2015 Win64"
- cmake -H. -Bvs2015-x86 -G"Visual Studio 14 2015"
build_script:
- cmake --build vs2013-x64 --config Release --target installer
- cmake --build vs2013-x86 --config Release --target installer
- cmake --build vs2015-x64 --config Release --target installer
- cmake --build vs2015-x86 --config Release --target installer
artifacts:
- path: LuaVM-vs*.exe
deploy:
provider: GitHub
description: Release of v$(appveyor_build_version)
auth_token:
secure: 9u2iMRO2KmnGYYLq9tqm0su2eY3h9FprKV8600vkNsFVCcM0ukfaZuu6SDGb95a6
artifact: /LuaVM.+\.exe/
draft: true
prerelease: true
on:
branch: master
appveyor_repo_tag: true
| version: '{build}'
os: Visual Studio 2015
clone_depth: 1
configuration:
- Release
install:
- choco install -y InnoSetup
before_build:
- cmake -H. -Bvs2013-x64 -G"Visual Studio 12 2013 Win64"
- cmake -H. -Bvs2013-x86 -G"Visual Studio 12 2013"
- cmake -H. -Bvs2015-x64 -G"Visual Studio 14 2015 Win64"
- cmake -H. -Bvs2015-x86 -G"Visual Studio 14 2015"
build_script:
- cmake --build vs2013-x64 --config Release --target installer
- cmake --build vs2013-x86 --config Release --target installer
- cmake --build vs2015-x64 --config Release --target installer
- cmake --build vs2015-x86 --config Release --target installer
artifacts:
- path: LuaVM-vs*.exe
deploy:
provider: GitHub
- description: Draft Release
+ description: Release of v$(appveyor_build_version)
auth_token:
secure: 9u2iMRO2KmnGYYLq9tqm0su2eY3h9FprKV8600vkNsFVCcM0ukfaZuu6SDGb95a6
artifact: /LuaVM.+\.exe/
draft: true
prerelease: true
+ on:
+ branch: master
+ appveyor_repo_tag: true | 5 | 0.142857 | 4 | 1 |
4409823a5611d0f426ca09541d7e9dc982bc8c9f | asyncqlio/utils.py | asyncqlio/utils.py | import collections.abc
class IterToAiter(collections.abc.Iterator, collections.abc.AsyncIterator):
"""
Transforms an `__iter__` method into an `__aiter__` method.
"""
def __init__(self, iterator: collections.abc.Iterator):
self._it = iterator
# magic methods
def __iter__(self):
return self
def __next__(self):
return self._it.__next__()
def __aiter__(self):
return self
async def __anext__(self):
return self.__next__()
def iter_to_aiter(type_):
"""
Transforms a normal iterable type into an async iterable type.
"""
def __aiter__(self):
return IterToAiter(iter(self))
type_.__aiter__ = __aiter__
return type_
| import collections.abc
class IterToAiter(collections.abc.Iterator, collections.abc.AsyncIterator):
"""
Transforms an `__iter__` method into an `__aiter__` method.
"""
def __init__(self, iterator: collections.abc.Iterator):
self._it = iterator
# magic methods
def __iter__(self):
return self
def __next__(self):
return self._it.__next__()
def __aiter__(self):
return self
async def __anext__(self):
try:
return self.__next__()
except StopIteration:
raise StopAsyncIteration
def iter_to_aiter(type_):
"""
Transforms a normal iterable type into an async iterable type.
"""
def __aiter__(self):
return IterToAiter(iter(self))
type_.__aiter__ = __aiter__
return type_
| Raise StopAsyncIteration instead of StopAsyncIteration in aiter wrapper. | Raise StopAsyncIteration instead of StopAsyncIteration in aiter wrapper.
| Python | mit | SunDwarf/asyncqlio | python | ## Code Before:
import collections.abc
class IterToAiter(collections.abc.Iterator, collections.abc.AsyncIterator):
"""
Transforms an `__iter__` method into an `__aiter__` method.
"""
def __init__(self, iterator: collections.abc.Iterator):
self._it = iterator
# magic methods
def __iter__(self):
return self
def __next__(self):
return self._it.__next__()
def __aiter__(self):
return self
async def __anext__(self):
return self.__next__()
def iter_to_aiter(type_):
"""
Transforms a normal iterable type into an async iterable type.
"""
def __aiter__(self):
return IterToAiter(iter(self))
type_.__aiter__ = __aiter__
return type_
## Instruction:
Raise StopAsyncIteration instead of StopAsyncIteration in aiter wrapper.
## Code After:
import collections.abc
class IterToAiter(collections.abc.Iterator, collections.abc.AsyncIterator):
"""
Transforms an `__iter__` method into an `__aiter__` method.
"""
def __init__(self, iterator: collections.abc.Iterator):
self._it = iterator
# magic methods
def __iter__(self):
return self
def __next__(self):
return self._it.__next__()
def __aiter__(self):
return self
async def __anext__(self):
try:
return self.__next__()
except StopIteration:
raise StopAsyncIteration
def iter_to_aiter(type_):
"""
Transforms a normal iterable type into an async iterable type.
"""
def __aiter__(self):
return IterToAiter(iter(self))
type_.__aiter__ = __aiter__
return type_
| import collections.abc
class IterToAiter(collections.abc.Iterator, collections.abc.AsyncIterator):
"""
Transforms an `__iter__` method into an `__aiter__` method.
"""
def __init__(self, iterator: collections.abc.Iterator):
self._it = iterator
# magic methods
def __iter__(self):
return self
def __next__(self):
return self._it.__next__()
def __aiter__(self):
return self
async def __anext__(self):
+ try:
- return self.__next__()
+ return self.__next__()
? ++++
+ except StopIteration:
+ raise StopAsyncIteration
def iter_to_aiter(type_):
"""
Transforms a normal iterable type into an async iterable type.
"""
def __aiter__(self):
return IterToAiter(iter(self))
type_.__aiter__ = __aiter__
return type_ | 5 | 0.142857 | 4 | 1 |
26d03a2367a56b2617fb22db996db2f82c0168dc | app/views/onboarding/inset_days/new.html.erb | app/views/onboarding/inset_days/new.html.erb | <div class="row justify-content-md-center">
<div class="col col-md-10 col-lg-8">
<h1>New inset day</h1>
<%= simple_form_for(@calendar_event, url: onboarding_inset_days_path(@school_onboarding)) do |f| %>
<div class="form-group">
<%= f.label :start_date, 'Date' %>
<div class="input-group date" id="calendar_event_holder" data-target-input="nearest">
<%= f.text_field :start_date, class: 'form-control datetimepicker-input', data: {target: '#calendar_event_holder'} %>
<div class="input-group-append" data-target="#calendar_event_holder" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<%= f.input :title, label: 'Description', as: :string %>
<%= f.input :calendar_event_type_id, collection: @calendar_event_types, label_method: :display_title, label: 'Type', include_blank: false %>
<%= f.button :submit, 'Add inset day' %>
<%= link_to 'Back', new_onboarding_completion_path(@school_onboarding), class: 'btn' %>
<% end %>
</div>
</div>
| <div class="row justify-content-md-center">
<div class="col col-md-10 col-lg-8">
<h1>New inset day</h1>
<%= simple_form_for(@calendar_event, url: onboarding_inset_days_path(@school_onboarding)) do |f| %>
<div class="form-group">
<%= f.label :start_date, 'Date' %>
<div class="input-group date" id="calendar_event_holder" data-target-input="nearest">
<%= f.text_field :start_date, class: 'form-control datetimepicker-input', data: {target: '#calendar_event_holder'} %>
<div class="input-group-append" data-target="#calendar_event_holder" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<%= f.input :calendar_event_type_id, collection: @calendar_event_types, label_method: :display_title, label: 'Type', include_blank: false %>
<%= f.input :title, label: 'Description', as: :string %>
<%= f.button :submit, 'Add inset day' %>
<%= link_to 'Back', new_onboarding_completion_path(@school_onboarding), class: 'btn' %>
<% end %>
</div>
</div>
| Swap type and description for inset days | Swap type and description for inset days
| HTML+ERB | mit | BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks | html+erb | ## Code Before:
<div class="row justify-content-md-center">
<div class="col col-md-10 col-lg-8">
<h1>New inset day</h1>
<%= simple_form_for(@calendar_event, url: onboarding_inset_days_path(@school_onboarding)) do |f| %>
<div class="form-group">
<%= f.label :start_date, 'Date' %>
<div class="input-group date" id="calendar_event_holder" data-target-input="nearest">
<%= f.text_field :start_date, class: 'form-control datetimepicker-input', data: {target: '#calendar_event_holder'} %>
<div class="input-group-append" data-target="#calendar_event_holder" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<%= f.input :title, label: 'Description', as: :string %>
<%= f.input :calendar_event_type_id, collection: @calendar_event_types, label_method: :display_title, label: 'Type', include_blank: false %>
<%= f.button :submit, 'Add inset day' %>
<%= link_to 'Back', new_onboarding_completion_path(@school_onboarding), class: 'btn' %>
<% end %>
</div>
</div>
## Instruction:
Swap type and description for inset days
## Code After:
<div class="row justify-content-md-center">
<div class="col col-md-10 col-lg-8">
<h1>New inset day</h1>
<%= simple_form_for(@calendar_event, url: onboarding_inset_days_path(@school_onboarding)) do |f| %>
<div class="form-group">
<%= f.label :start_date, 'Date' %>
<div class="input-group date" id="calendar_event_holder" data-target-input="nearest">
<%= f.text_field :start_date, class: 'form-control datetimepicker-input', data: {target: '#calendar_event_holder'} %>
<div class="input-group-append" data-target="#calendar_event_holder" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<%= f.input :calendar_event_type_id, collection: @calendar_event_types, label_method: :display_title, label: 'Type', include_blank: false %>
<%= f.input :title, label: 'Description', as: :string %>
<%= f.button :submit, 'Add inset day' %>
<%= link_to 'Back', new_onboarding_completion_path(@school_onboarding), class: 'btn' %>
<% end %>
</div>
</div>
| <div class="row justify-content-md-center">
<div class="col col-md-10 col-lg-8">
<h1>New inset day</h1>
<%= simple_form_for(@calendar_event, url: onboarding_inset_days_path(@school_onboarding)) do |f| %>
<div class="form-group">
<%= f.label :start_date, 'Date' %>
<div class="input-group date" id="calendar_event_holder" data-target-input="nearest">
<%= f.text_field :start_date, class: 'form-control datetimepicker-input', data: {target: '#calendar_event_holder'} %>
<div class="input-group-append" data-target="#calendar_event_holder" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
+ <%= f.input :calendar_event_type_id, collection: @calendar_event_types, label_method: :display_title, label: 'Type', include_blank: false %>
<%= f.input :title, label: 'Description', as: :string %>
- <%= f.input :calendar_event_type_id, collection: @calendar_event_types, label_method: :display_title, label: 'Type', include_blank: false %>
<%= f.button :submit, 'Add inset day' %>
<%= link_to 'Back', new_onboarding_completion_path(@school_onboarding), class: 'btn' %>
<% end %>
</div>
</div> | 2 | 0.083333 | 1 | 1 |
df04444b3932f7481562dde62c7ae1f8ffb8bd7e | webapp/controllers/contact.py | webapp/controllers/contact.py | def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requires
def index():
return dict()
| from opentreewebapputil import (get_opentree_services_method_urls,
fetch_current_TNRS_context_names)
### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requires
default_view_dict = get_opentree_services_method_urls(request)
default_view_dict['taxonSearchContextNames'] = fetch_current_TNRS_context_names(request)
def index():
return default_view_dict
| Fix missing search-context list on Contact page. | Fix missing search-context list on Contact page.
| Python | bsd-2-clause | OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree | python | ## Code Before:
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requires
def index():
return dict()
## Instruction:
Fix missing search-context list on Contact page.
## Code After:
from opentreewebapputil import (get_opentree_services_method_urls,
fetch_current_TNRS_context_names)
### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requires
default_view_dict = get_opentree_services_method_urls(request)
default_view_dict['taxonSearchContextNames'] = fetch_current_TNRS_context_names(request)
def index():
return default_view_dict
| + from opentreewebapputil import (get_opentree_services_method_urls,
+ fetch_current_TNRS_context_names)
+
+ ### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requires
+ default_view_dict = get_opentree_services_method_urls(request)
+ default_view_dict['taxonSearchContextNames'] = fetch_current_TNRS_context_names(request)
+
def index():
- return dict()
+ return default_view_dict
| 9 | 1.125 | 8 | 1 |
d00014d2759c55a892237fa1508e5792f1ecc913 | packages/yx/yx.yaml | packages/yx/yx.yaml | homepage: https://github.com/mtth/yx
changelog-type: ''
hash: 2196994b76bf7e5923c32930adf8695881b3ae791d9c5ddb0b78da4781e086b5
test-bench-deps:
bytestring: ! '>=0.10'
base: ! '>=4.8 && <5'
hspec: ! '>=2.7'
array: ! '>=0.5'
yx: -any
maintainer: mtth@apache.org
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: ! '>=0.10'
base: ! '>=4.8 && <5'
array: ! '>=0.5'
lattices: ! '>=2.0'
all-versions:
- 0.0.1.0
- 0.0.1.1
- 0.0.2.0
- 0.0.3.0
author: Matthieu Monsch
latest: 0.0.3.0
description-type: markdown
description: |
# YX [](https://hackage.haskell.org/package/yx) [](https://travis-ci.org/mtth/yx)
Bitmap-friendly 2D coordinates.
license-name: BSD-3-Clause
| homepage: https://github.com/mtth/yx
changelog-type: ''
hash: f8ee9f82e194785380019e465a5b83dcec69bbcc67054a3e0d549d8e9bac6def
test-bench-deps:
bytestring: -any
base: ! '>=4.8 && <5'
hspec: -any
array: -any
mtl: -any
yx: -any
maintainer: mtth@apache.org
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: -any
base: ! '>=4.8 && <5'
array: ! '>=0.5'
lattices: ! '>=2.0'
mtl: ! '>=2.2'
all-versions:
- 0.0.1.0
- 0.0.1.1
- 0.0.2.0
- 0.0.3.0
- 0.0.4.0
author: Matthieu Monsch
latest: 0.0.4.0
description-type: markdown
description: |
# YX [](https://hackage.haskell.org/package/yx) [](https://travis-ci.org/mtth/yx)
Bitmap-friendly 2D coordinates.
license-name: BSD-3-Clause
| Update from Hackage at 2019-12-18T07:17:44Z | Update from Hackage at 2019-12-18T07:17:44Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/mtth/yx
changelog-type: ''
hash: 2196994b76bf7e5923c32930adf8695881b3ae791d9c5ddb0b78da4781e086b5
test-bench-deps:
bytestring: ! '>=0.10'
base: ! '>=4.8 && <5'
hspec: ! '>=2.7'
array: ! '>=0.5'
yx: -any
maintainer: mtth@apache.org
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: ! '>=0.10'
base: ! '>=4.8 && <5'
array: ! '>=0.5'
lattices: ! '>=2.0'
all-versions:
- 0.0.1.0
- 0.0.1.1
- 0.0.2.0
- 0.0.3.0
author: Matthieu Monsch
latest: 0.0.3.0
description-type: markdown
description: |
# YX [](https://hackage.haskell.org/package/yx) [](https://travis-ci.org/mtth/yx)
Bitmap-friendly 2D coordinates.
license-name: BSD-3-Clause
## Instruction:
Update from Hackage at 2019-12-18T07:17:44Z
## Code After:
homepage: https://github.com/mtth/yx
changelog-type: ''
hash: f8ee9f82e194785380019e465a5b83dcec69bbcc67054a3e0d549d8e9bac6def
test-bench-deps:
bytestring: -any
base: ! '>=4.8 && <5'
hspec: -any
array: -any
mtl: -any
yx: -any
maintainer: mtth@apache.org
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: -any
base: ! '>=4.8 && <5'
array: ! '>=0.5'
lattices: ! '>=2.0'
mtl: ! '>=2.2'
all-versions:
- 0.0.1.0
- 0.0.1.1
- 0.0.2.0
- 0.0.3.0
- 0.0.4.0
author: Matthieu Monsch
latest: 0.0.4.0
description-type: markdown
description: |
# YX [](https://hackage.haskell.org/package/yx) [](https://travis-ci.org/mtth/yx)
Bitmap-friendly 2D coordinates.
license-name: BSD-3-Clause
| homepage: https://github.com/mtth/yx
changelog-type: ''
- hash: 2196994b76bf7e5923c32930adf8695881b3ae791d9c5ddb0b78da4781e086b5
+ hash: f8ee9f82e194785380019e465a5b83dcec69bbcc67054a3e0d549d8e9bac6def
test-bench-deps:
- bytestring: ! '>=0.10'
+ bytestring: -any
base: ! '>=4.8 && <5'
- hspec: ! '>=2.7'
- array: ! '>=0.5'
+ hspec: -any
+ array: -any
+ mtl: -any
yx: -any
maintainer: mtth@apache.org
synopsis: Row-major coordinates
changelog: ''
basic-deps:
- bytestring: ! '>=0.10'
+ bytestring: -any
base: ! '>=4.8 && <5'
array: ! '>=0.5'
lattices: ! '>=2.0'
+ mtl: ! '>=2.2'
all-versions:
- 0.0.1.0
- 0.0.1.1
- 0.0.2.0
- 0.0.3.0
+ - 0.0.4.0
author: Matthieu Monsch
- latest: 0.0.3.0
? ^
+ latest: 0.0.4.0
? ^
description-type: markdown
description: |
# YX [](https://hackage.haskell.org/package/yx) [](https://travis-ci.org/mtth/yx)
Bitmap-friendly 2D coordinates.
license-name: BSD-3-Clause | 15 | 0.5 | 9 | 6 |
3e0331e56771d8be111f3fc719d3565bace23f69 | Form/RequestPasswordType.php | Form/RequestPasswordType.php | <?php
namespace SumoCoders\FrameworkMultiUserBundle\Form;
use SumoCoders\FrameworkMultiUserBundle\DataTransferObject\RequestPasswordDataTransferObject;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class RequestPasswordType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(
'userName',
'text',
[
'label' => 'sumocoders.multiuserbundle.form.user',
'required' => true,
]
)->add(
'submit',
'submit',
[
'label' => 'sumocoders.multiuserbundle.form.request_password',
]
);
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults([
'data_class' => RequestPasswordDataTransferObject::class,
]);
}
/**
* @return string
*/
public function getName()
{
return 'request_password';
}
}
| <?php
namespace SumoCoders\FrameworkMultiUserBundle\Form;
use SumoCoders\FrameworkMultiUserBundle\DataTransferObject\RequestPasswordDataTransferObject;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class RequestPasswordType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(
'userName',
TextType::class,
[
'label' => 'sumocoders.multiuserbundle.form.user',
'required' => true,
]
)->add(
'submit',
SubmitType::class,
[
'label' => 'sumocoders.multiuserbundle.form.request_password',
]
);
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults([
'data_class' => RequestPasswordDataTransferObject::class,
]);
}
/**
* @return string
*/
public function getName()
{
return 'request_password';
}
}
| Use class constants instead of strings | Use class constants instead of strings
| PHP | mit | sumocoders/FrameworkMultiUserBundle,sumocoders/FrameworkMultiUserBundle | php | ## Code Before:
<?php
namespace SumoCoders\FrameworkMultiUserBundle\Form;
use SumoCoders\FrameworkMultiUserBundle\DataTransferObject\RequestPasswordDataTransferObject;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class RequestPasswordType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(
'userName',
'text',
[
'label' => 'sumocoders.multiuserbundle.form.user',
'required' => true,
]
)->add(
'submit',
'submit',
[
'label' => 'sumocoders.multiuserbundle.form.request_password',
]
);
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults([
'data_class' => RequestPasswordDataTransferObject::class,
]);
}
/**
* @return string
*/
public function getName()
{
return 'request_password';
}
}
## Instruction:
Use class constants instead of strings
## Code After:
<?php
namespace SumoCoders\FrameworkMultiUserBundle\Form;
use SumoCoders\FrameworkMultiUserBundle\DataTransferObject\RequestPasswordDataTransferObject;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class RequestPasswordType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(
'userName',
TextType::class,
[
'label' => 'sumocoders.multiuserbundle.form.user',
'required' => true,
]
)->add(
'submit',
SubmitType::class,
[
'label' => 'sumocoders.multiuserbundle.form.request_password',
]
);
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults([
'data_class' => RequestPasswordDataTransferObject::class,
]);
}
/**
* @return string
*/
public function getName()
{
return 'request_password';
}
}
| <?php
namespace SumoCoders\FrameworkMultiUserBundle\Form;
use SumoCoders\FrameworkMultiUserBundle\DataTransferObject\RequestPasswordDataTransferObject;
use Symfony\Component\Form\AbstractType;
+ use Symfony\Component\Form\Extension\Core\Type\TextType;
+ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class RequestPasswordType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(
'userName',
- 'text',
+ TextType::class,
[
'label' => 'sumocoders.multiuserbundle.form.user',
'required' => true,
]
)->add(
'submit',
- 'submit',
+ SubmitType::class,
[
'label' => 'sumocoders.multiuserbundle.form.request_password',
]
);
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults([
'data_class' => RequestPasswordDataTransferObject::class,
]);
}
/**
* @return string
*/
public function getName()
{
return 'request_password';
}
} | 6 | 0.115385 | 4 | 2 |
697e9ad67b0dc748618124141f8dd1d714cf2bdd | .travis.yml | .travis.yml | language: cpp
env:
- NODE_VERSION="0.10"
- NODE_VERSION="0.12"
- NODE_VERSION="4.4"
- NODE_VERSION="5.9"
os:
- osx
matrix:
fast_finish: true
before_install:
- git clone https://github.com/creationix/nvm.git /tmp/.nvm;
- source /tmp/.nvm/nvm.sh;
- nvm install $NODE_VERSION;
- nvm use --delete-prefix $NODE_VERSION;
install:
- npm install
script:
- npm test
| language: cpp
env:
- NODE_VERSION="0.10"
- NODE_VERSION="0.12"
# Disabling versions that fail because of https://github.com/smclab/grunt-titaniumifier/issues/3
# - NODE_VERSION="4.4"
# - NODE_VERSION="5.9"
os:
- osx
matrix:
fast_finish: true
before_install:
- git clone https://github.com/creationix/nvm.git /tmp/.nvm;
- source /tmp/.nvm/nvm.sh;
- nvm install $NODE_VERSION;
- nvm use --delete-prefix $NODE_VERSION;
install:
- npm install
script:
- npm test
| Disable NodeJS 4 and 5 tests | Disable NodeJS 4 and 5 tests | YAML | mit | titanium-forks/FokkeZB.ti-html2as,titanium-forks/FokkeZB.ti-html2as | yaml | ## Code Before:
language: cpp
env:
- NODE_VERSION="0.10"
- NODE_VERSION="0.12"
- NODE_VERSION="4.4"
- NODE_VERSION="5.9"
os:
- osx
matrix:
fast_finish: true
before_install:
- git clone https://github.com/creationix/nvm.git /tmp/.nvm;
- source /tmp/.nvm/nvm.sh;
- nvm install $NODE_VERSION;
- nvm use --delete-prefix $NODE_VERSION;
install:
- npm install
script:
- npm test
## Instruction:
Disable NodeJS 4 and 5 tests
## Code After:
language: cpp
env:
- NODE_VERSION="0.10"
- NODE_VERSION="0.12"
# Disabling versions that fail because of https://github.com/smclab/grunt-titaniumifier/issues/3
# - NODE_VERSION="4.4"
# - NODE_VERSION="5.9"
os:
- osx
matrix:
fast_finish: true
before_install:
- git clone https://github.com/creationix/nvm.git /tmp/.nvm;
- source /tmp/.nvm/nvm.sh;
- nvm install $NODE_VERSION;
- nvm use --delete-prefix $NODE_VERSION;
install:
- npm install
script:
- npm test
| language: cpp
env:
- NODE_VERSION="0.10"
- NODE_VERSION="0.12"
+ # Disabling versions that fail because of https://github.com/smclab/grunt-titaniumifier/issues/3
- - NODE_VERSION="4.4"
+ # - NODE_VERSION="4.4"
? +
- - NODE_VERSION="5.9"
+ # - NODE_VERSION="5.9"
? +
os:
- osx
matrix:
fast_finish: true
before_install:
- git clone https://github.com/creationix/nvm.git /tmp/.nvm;
- source /tmp/.nvm/nvm.sh;
- nvm install $NODE_VERSION;
- nvm use --delete-prefix $NODE_VERSION;
install:
- npm install
script:
- npm test | 5 | 0.263158 | 3 | 2 |
8f5a5b099029d4f5b69a1df66694714e9f2ea8ec | ci/before_deploy.sh | ci/before_deploy.sh |
set -ex
main() {
local src=$(pwd) \
deploy=target/deploy \
revision=$(git describe --tags)
mkdir -p "$deploy/$TARGET/$revision"
test -f Cargo.lock || cargo generate-lockfile
cross build --bin rq --target $TARGET --release
cp target/$TARGET/release/rq $deploy/$TARGET/rq
cp target/$TARGET/release/rq $deploy/$TARGET/$revision/rq
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.png" > "$deploy/$TARGET/badge.png"
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.svg" > "$deploy/$TARGET/badge.svg"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.png" > "$deploy/$TARGET/badge-small.png"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.svg" > "$deploy/$TARGET/badge-small.svg"
cd $deploy
tar czf $CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
}
main
|
set -ex
main() {
local src=$(pwd) \
deploy=target/deploy \
revision=$(git describe --tags)
mkdir -p "$deploy/$TARGET/$revision"
test -f Cargo.lock || cargo generate-lockfile
export V8_LIBS=$PWD/v8-build/lib/libv8uber.a
export V8_SOURCE=$PWD/v8-build
cross build --bin rq --target $TARGET --release
cp target/$TARGET/release/rq $deploy/$TARGET/rq
cp target/$TARGET/release/rq $deploy/$TARGET/$revision/rq
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.png" > "$deploy/$TARGET/badge.png"
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.svg" > "$deploy/$TARGET/badge.svg"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.png" > "$deploy/$TARGET/badge-small.png"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.svg" > "$deploy/$TARGET/badge-small.svg"
cd $deploy
tar czf $CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
}
main
| Create env vars for release build | Create env vars for release build
| Shell | apache-2.0 | dflemstr/rq,dflemstr/rq | shell | ## Code Before:
set -ex
main() {
local src=$(pwd) \
deploy=target/deploy \
revision=$(git describe --tags)
mkdir -p "$deploy/$TARGET/$revision"
test -f Cargo.lock || cargo generate-lockfile
cross build --bin rq --target $TARGET --release
cp target/$TARGET/release/rq $deploy/$TARGET/rq
cp target/$TARGET/release/rq $deploy/$TARGET/$revision/rq
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.png" > "$deploy/$TARGET/badge.png"
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.svg" > "$deploy/$TARGET/badge.svg"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.png" > "$deploy/$TARGET/badge-small.png"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.svg" > "$deploy/$TARGET/badge-small.svg"
cd $deploy
tar czf $CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
}
main
## Instruction:
Create env vars for release build
## Code After:
set -ex
main() {
local src=$(pwd) \
deploy=target/deploy \
revision=$(git describe --tags)
mkdir -p "$deploy/$TARGET/$revision"
test -f Cargo.lock || cargo generate-lockfile
export V8_LIBS=$PWD/v8-build/lib/libv8uber.a
export V8_SOURCE=$PWD/v8-build
cross build --bin rq --target $TARGET --release
cp target/$TARGET/release/rq $deploy/$TARGET/rq
cp target/$TARGET/release/rq $deploy/$TARGET/$revision/rq
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.png" > "$deploy/$TARGET/badge.png"
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.svg" > "$deploy/$TARGET/badge.svg"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.png" > "$deploy/$TARGET/badge-small.png"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.svg" > "$deploy/$TARGET/badge-small.svg"
cd $deploy
tar czf $CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
}
main
|
set -ex
main() {
local src=$(pwd) \
deploy=target/deploy \
revision=$(git describe --tags)
mkdir -p "$deploy/$TARGET/$revision"
test -f Cargo.lock || cargo generate-lockfile
+
+ export V8_LIBS=$PWD/v8-build/lib/libv8uber.a
+ export V8_SOURCE=$PWD/v8-build
cross build --bin rq --target $TARGET --release
cp target/$TARGET/release/rq $deploy/$TARGET/rq
cp target/$TARGET/release/rq $deploy/$TARGET/$revision/rq
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.png" > "$deploy/$TARGET/badge.png"
curl "https://img.shields.io/badge/${TARGET//-/--}-${revision//-/--}-blue.svg" > "$deploy/$TARGET/badge.svg"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.png" > "$deploy/$TARGET/badge-small.png"
curl "https://img.shields.io/badge/v-$(echo $revision | sed 's/-/--/g;s/v//')-blue.svg" > "$deploy/$TARGET/badge-small.svg"
cd $deploy
tar czf $CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
}
main | 3 | 0.115385 | 3 | 0 |
18c962543e1936f51f50ffec620a5225923527bf | web/partials/lights.html | web/partials/lights.html | <div class="admin-menu" ng-include="'partials/includes/admin-menu.html'"></div>
<h2>Lights</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="light in lights" ng-click="showDetail(light.id)" class='selectable'>
<td>{{ light.name }}</td>
<td>{{ light.enabled }}</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 text-right">
<a href="#/lights/new"><span class='glyphicon glyphicon-plus'></span> Create Light</a>
</div>
</div>
| <div class="admin-menu" ng-include="'partials/includes/admin-menu.html'"></div>
<h2>Lights</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="light in lights" ng-click="showDetail(light.id)" class='selectable'>
<td>{{ light.name }}</td>
<td><input type="checkbox" toggle-checkbox data-size="small" data-on="Enabled" data-off="Disabled" data-onstyle="success" data-offstyle="danger" ng-model="light.enabled" ng-true-value="1" ng-false-value="0" disabled></td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 text-right">
<a href="#/lights/new"><span class='glyphicon glyphicon-plus'></span> Create Light</a>
</div>
</div>
| Use the bootstrap-toggle to display light statuses | Use the bootstrap-toggle to display light statuses
| HTML | apache-2.0 | nobbyknox/hal | html | ## Code Before:
<div class="admin-menu" ng-include="'partials/includes/admin-menu.html'"></div>
<h2>Lights</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="light in lights" ng-click="showDetail(light.id)" class='selectable'>
<td>{{ light.name }}</td>
<td>{{ light.enabled }}</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 text-right">
<a href="#/lights/new"><span class='glyphicon glyphicon-plus'></span> Create Light</a>
</div>
</div>
## Instruction:
Use the bootstrap-toggle to display light statuses
## Code After:
<div class="admin-menu" ng-include="'partials/includes/admin-menu.html'"></div>
<h2>Lights</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="light in lights" ng-click="showDetail(light.id)" class='selectable'>
<td>{{ light.name }}</td>
<td><input type="checkbox" toggle-checkbox data-size="small" data-on="Enabled" data-off="Disabled" data-onstyle="success" data-offstyle="danger" ng-model="light.enabled" ng-true-value="1" ng-false-value="0" disabled></td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 text-right">
<a href="#/lights/new"><span class='glyphicon glyphicon-plus'></span> Create Light</a>
</div>
</div>
| <div class="admin-menu" ng-include="'partials/includes/admin-menu.html'"></div>
<h2>Lights</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="light in lights" ng-click="showDetail(light.id)" class='selectable'>
<td>{{ light.name }}</td>
- <td>{{ light.enabled }}</td>
+ <td><input type="checkbox" toggle-checkbox data-size="small" data-on="Enabled" data-off="Disabled" data-onstyle="success" data-offstyle="danger" ng-model="light.enabled" ng-true-value="1" ng-false-value="0" disabled></td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 text-right">
<a href="#/lights/new"><span class='glyphicon glyphicon-plus'></span> Create Light</a>
</div>
</div> | 2 | 0.083333 | 1 | 1 |
ce99ac020a427862e5dfbb1d676d60db0a0c8056 | TCF/j2e/components/catalogue/src/test/java/fr/unice/polytech/isa/tcf/CatalogueTest.java | TCF/j2e/components/catalogue/src/test/java/fr/unice/polytech/isa/tcf/CatalogueTest.java | package fr.unice.polytech.isa.tcf;
import arquillian.AbstractTCFTest;
import fr.unice.polytech.isa.tcf.entities.Cookies;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.ejb.EJB;
import java.util.Set;
import static org.junit.Assert.*;
@RunWith(Arquillian.class)
public class CatalogueTest extends AbstractTCFTest {
@EJB
CatalogueExploration catalogue;
@Test
public void preMadeRecipesAreAVailable() {
Set<Cookies> premade = catalogue.listPreMadeRecipes();
assertEquals(3, premade.size());
}
@Test
public void regexpExploration() {
assertEquals(0, catalogue.exploreCatalogue("unknown").size());
assertEquals(2, catalogue.exploreCatalogue("CHOCO").size());
assertEquals(1, catalogue.exploreCatalogue(Cookies.DARK_TEMPTATION.name()).size());
}
}
| package fr.unice.polytech.isa.tcf;
import arquillian.AbstractTCFTest;
import fr.unice.polytech.isa.tcf.entities.Cookies;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.ejb.EJB;
import java.util.Set;
import static org.junit.Assert.*;
@RunWith(Arquillian.class)
public class CatalogueTest extends AbstractTCFTest {
@EJB
CatalogueExploration catalogue;
@Test
public void preMadeRecipesAreAVailable() {
Set<Cookies> premade = catalogue.listPreMadeRecipes();
assertEquals(3, premade.size());
// Antoine
assertEquals(1,2);
}
@Test
public void regexpExploration() {
assertEquals(0, catalogue.exploreCatalogue("unknown").size());
assertEquals(2, catalogue.exploreCatalogue("CHOCO").size());
assertEquals(1, catalogue.exploreCatalogue(Cookies.DARK_TEMPTATION.name()).size());
}
}
| Add error in test catalogue | [Try] Add error in test catalogue
| Java | mit | Lydwen/Mr.Statacookie,Lydwen/Mr.Statacookie,Lydwen/Mr.Statacookie | java | ## Code Before:
package fr.unice.polytech.isa.tcf;
import arquillian.AbstractTCFTest;
import fr.unice.polytech.isa.tcf.entities.Cookies;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.ejb.EJB;
import java.util.Set;
import static org.junit.Assert.*;
@RunWith(Arquillian.class)
public class CatalogueTest extends AbstractTCFTest {
@EJB
CatalogueExploration catalogue;
@Test
public void preMadeRecipesAreAVailable() {
Set<Cookies> premade = catalogue.listPreMadeRecipes();
assertEquals(3, premade.size());
}
@Test
public void regexpExploration() {
assertEquals(0, catalogue.exploreCatalogue("unknown").size());
assertEquals(2, catalogue.exploreCatalogue("CHOCO").size());
assertEquals(1, catalogue.exploreCatalogue(Cookies.DARK_TEMPTATION.name()).size());
}
}
## Instruction:
[Try] Add error in test catalogue
## Code After:
package fr.unice.polytech.isa.tcf;
import arquillian.AbstractTCFTest;
import fr.unice.polytech.isa.tcf.entities.Cookies;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.ejb.EJB;
import java.util.Set;
import static org.junit.Assert.*;
@RunWith(Arquillian.class)
public class CatalogueTest extends AbstractTCFTest {
@EJB
CatalogueExploration catalogue;
@Test
public void preMadeRecipesAreAVailable() {
Set<Cookies> premade = catalogue.listPreMadeRecipes();
assertEquals(3, premade.size());
// Antoine
assertEquals(1,2);
}
@Test
public void regexpExploration() {
assertEquals(0, catalogue.exploreCatalogue("unknown").size());
assertEquals(2, catalogue.exploreCatalogue("CHOCO").size());
assertEquals(1, catalogue.exploreCatalogue(Cookies.DARK_TEMPTATION.name()).size());
}
}
| package fr.unice.polytech.isa.tcf;
import arquillian.AbstractTCFTest;
import fr.unice.polytech.isa.tcf.entities.Cookies;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.ejb.EJB;
import java.util.Set;
import static org.junit.Assert.*;
@RunWith(Arquillian.class)
public class CatalogueTest extends AbstractTCFTest {
@EJB
CatalogueExploration catalogue;
@Test
public void preMadeRecipesAreAVailable() {
Set<Cookies> premade = catalogue.listPreMadeRecipes();
assertEquals(3, premade.size());
+
+ // Antoine
+ assertEquals(1,2);
}
@Test
public void regexpExploration() {
assertEquals(0, catalogue.exploreCatalogue("unknown").size());
assertEquals(2, catalogue.exploreCatalogue("CHOCO").size());
assertEquals(1, catalogue.exploreCatalogue(Cookies.DARK_TEMPTATION.name()).size());
}
} | 3 | 0.090909 | 3 | 0 |
83efc5236dccf42f394a533caa4984d7866a129a | templates/includes/posts.html | templates/includes/posts.html | {% for post in posts %}
{% with template_name="includes/post.html" %}
{% include template_name %}
{% endwith %}
{% endfor %} | {% for post in posts %}
{% include "includes/post.html" %}
{% endfor %}
| Remove obsolete use of with template-tag | Remove obsolete use of with template-tag
| HTML | mit | mback2k/django-app-comments,mback2k/django-app-comments | html | ## Code Before:
{% for post in posts %}
{% with template_name="includes/post.html" %}
{% include template_name %}
{% endwith %}
{% endfor %}
## Instruction:
Remove obsolete use of with template-tag
## Code After:
{% for post in posts %}
{% include "includes/post.html" %}
{% endfor %}
| {% for post in posts %}
+ {% include "includes/post.html" %}
- {% with template_name="includes/post.html" %}
- {% include template_name %}
- {% endwith %}
{% endfor %} | 4 | 0.8 | 1 | 3 |
85950db648f844a30d0e3a09cd844b4a3b4ffbf8 | app/controllers/catalog_admin/categories_controller.rb | app/controllers/catalog_admin/categories_controller.rb | class CatalogAdmin::CategoriesController < CatalogAdmin::BaseController
layout "catalog_admin/setup/form"
# TODO: Pundit-based authorization
#
def new
build_category
# authorize(@category)
end
def create
build_category
# authorize(@category)
if @category.update(category_params)
redirect_to(after_create_path, :notice => created_message)
else
render("new")
end
end
def edit
find_category
authorize(@category)
end
def update
find_category
authorize(@category)
if @category.update(category_params)
redirect_to(
catalog_admin_category_fields_path(catalog, @category),
:notice => updated_message
)
else
render("edit")
end
end
private
def build_category
@category = catalog.categories.new
end
def find_category
@category = catalog.categories.find(params[:id])
end
def category_params
params.require(:category).permit(:name)
end
def after_create_path
case params[:commit]
when /another/i then new_catalog_admin_category_path
else catalog_admin_category_fields_path(catalog, @category)
end
end
def created_message
"The “#{@category.name}” category has been created."
end
def updated_message
"The “#{@category.name}” category has been updated."
end
end
| class CatalogAdmin::CategoriesController < CatalogAdmin::BaseController
layout "catalog_admin/setup/form"
def new
build_category
authorize(@category)
end
def create
build_category
authorize(@category)
if @category.update(category_params)
redirect_to(after_create_path, :notice => created_message)
else
render("new")
end
end
def edit
find_category
authorize(@category)
end
def update
find_category
authorize(@category)
if @category.update(category_params)
redirect_to(
catalog_admin_category_fields_path(catalog, @category),
:notice => updated_message
)
else
render("edit")
end
end
private
def build_category
@category = catalog.categories.new
end
def find_category
@category = catalog.categories.find(params[:id])
end
def category_params
params.require(:category).permit(:name)
end
def after_create_path
case params[:commit]
when /another/i then new_catalog_admin_category_path
else catalog_admin_category_fields_path(catalog, @category)
end
end
def created_message
"The “#{@category.name}” category has been created."
end
def updated_message
"The “#{@category.name}” category has been updated."
end
end
| Enable authorization for categories actions | Enable authorization for categories actions
| Ruby | apache-2.0 | catima/catima,catima/catima,catima/catima,catima/catima | ruby | ## Code Before:
class CatalogAdmin::CategoriesController < CatalogAdmin::BaseController
layout "catalog_admin/setup/form"
# TODO: Pundit-based authorization
#
def new
build_category
# authorize(@category)
end
def create
build_category
# authorize(@category)
if @category.update(category_params)
redirect_to(after_create_path, :notice => created_message)
else
render("new")
end
end
def edit
find_category
authorize(@category)
end
def update
find_category
authorize(@category)
if @category.update(category_params)
redirect_to(
catalog_admin_category_fields_path(catalog, @category),
:notice => updated_message
)
else
render("edit")
end
end
private
def build_category
@category = catalog.categories.new
end
def find_category
@category = catalog.categories.find(params[:id])
end
def category_params
params.require(:category).permit(:name)
end
def after_create_path
case params[:commit]
when /another/i then new_catalog_admin_category_path
else catalog_admin_category_fields_path(catalog, @category)
end
end
def created_message
"The “#{@category.name}” category has been created."
end
def updated_message
"The “#{@category.name}” category has been updated."
end
end
## Instruction:
Enable authorization for categories actions
## Code After:
class CatalogAdmin::CategoriesController < CatalogAdmin::BaseController
layout "catalog_admin/setup/form"
def new
build_category
authorize(@category)
end
def create
build_category
authorize(@category)
if @category.update(category_params)
redirect_to(after_create_path, :notice => created_message)
else
render("new")
end
end
def edit
find_category
authorize(@category)
end
def update
find_category
authorize(@category)
if @category.update(category_params)
redirect_to(
catalog_admin_category_fields_path(catalog, @category),
:notice => updated_message
)
else
render("edit")
end
end
private
def build_category
@category = catalog.categories.new
end
def find_category
@category = catalog.categories.find(params[:id])
end
def category_params
params.require(:category).permit(:name)
end
def after_create_path
case params[:commit]
when /another/i then new_catalog_admin_category_path
else catalog_admin_category_fields_path(catalog, @category)
end
end
def created_message
"The “#{@category.name}” category has been created."
end
def updated_message
"The “#{@category.name}” category has been updated."
end
end
| class CatalogAdmin::CategoriesController < CatalogAdmin::BaseController
layout "catalog_admin/setup/form"
- # TODO: Pundit-based authorization
- #
def new
build_category
- # authorize(@category)
? --
+ authorize(@category)
end
def create
build_category
- # authorize(@category)
? --
+ authorize(@category)
if @category.update(category_params)
redirect_to(after_create_path, :notice => created_message)
else
render("new")
end
end
def edit
find_category
authorize(@category)
end
def update
find_category
authorize(@category)
if @category.update(category_params)
redirect_to(
catalog_admin_category_fields_path(catalog, @category),
:notice => updated_message
)
else
render("edit")
end
end
private
def build_category
@category = catalog.categories.new
end
def find_category
@category = catalog.categories.find(params[:id])
end
def category_params
params.require(:category).permit(:name)
end
def after_create_path
case params[:commit]
when /another/i then new_catalog_admin_category_path
else catalog_admin_category_fields_path(catalog, @category)
end
end
def created_message
"The “#{@category.name}” category has been created."
end
def updated_message
"The “#{@category.name}” category has been updated."
end
end | 6 | 0.089552 | 2 | 4 |
a0dc2db9c343740fc5fdd648a1090787cf926e59 | lib/ui/collections/projectList.js | lib/ui/collections/projectList.js | var ProjectList,
Project = require("../models/project"),
server = require("../server"),
storage = require("../storage");
ProjectList = Backbone.Collection.extend({
model: Project,
initialize: function () {
var collection = this,
projects = storage.readProjects(),
projectId;
for (projectId in projects) {
if (projects.hasOwnProperty(projectId)) {
this.create(projects[projectId]);
}
}
},
sync: function (method, model, options) {
},
deleteProjectModel: function (modelCid) {
// Remove from collection and destroy model
var modelToDelete = this.get(modelCid);
this.remove(modelToDelete);
modelToDelete.sync("delete", modelToDelete);
},
createProjectOnDisk: function (values, callback) {
var collection = this;
server.create({
args: [
values.location,
values.name
].join(" ")
}, function (response) {
var model = collection.create(values);
callback(response, model);
});
},
deleteProjectFromDisk: function (modelCid, callback) {
var collection = this,
model = this.get(modelCid);
server.delete({
projectPath: model.get("location")
}, function (response) {
collection.deleteProjectModel(modelCid);
callback(response);
});
},
getDefaultProjectPath: function (callback) {
server.defaultProjectPath({}, function (response) {
callback(response);
});
}
});
module.exports = ProjectList;
| var ProjectList,
Project = require("../models/project"),
server = require("../server"),
storage = require("../storage");
ProjectList = Backbone.Collection.extend({
model: Project,
initialize: function () {
var collection = this,
projects = storage.readProjects(),
projectId;
for (projectId in projects) {
if (projects.hasOwnProperty(projectId)) {
this.create(projects[projectId]);
}
}
},
sync: function (method, model, options) {
},
deleteProjectModel: function (modelCid) {
// Remove from collection and destroy model
var modelToDelete = this.get(modelCid);
this.remove(modelToDelete);
modelToDelete.sync("delete", modelToDelete);
},
createProjectOnDisk: function (values, callback) {
var collection = this;
server.create({
args: [
"\"" + values.location + "\"",
values.name
].join(" ")
}, function (response) {
var model = collection.create(values);
callback(response, model);
});
},
deleteProjectFromDisk: function (modelCid, callback) {
var collection = this,
model = this.get(modelCid);
server.delete({
projectPath: model.get("location")
}, function (response) {
collection.deleteProjectModel(modelCid);
callback(response);
});
},
getDefaultProjectPath: function (callback) {
server.defaultProjectPath({}, function (response) {
callback(response);
});
}
});
module.exports = ProjectList;
| Allow spaces in path for project create | Allow spaces in path for project create
| JavaScript | apache-2.0 | blackberry-webworks/webworks-gui,blackberry/webworks-gui,blackberry-webworks/webworks-gui,blackberry/webworks-gui | javascript | ## Code Before:
var ProjectList,
Project = require("../models/project"),
server = require("../server"),
storage = require("../storage");
ProjectList = Backbone.Collection.extend({
model: Project,
initialize: function () {
var collection = this,
projects = storage.readProjects(),
projectId;
for (projectId in projects) {
if (projects.hasOwnProperty(projectId)) {
this.create(projects[projectId]);
}
}
},
sync: function (method, model, options) {
},
deleteProjectModel: function (modelCid) {
// Remove from collection and destroy model
var modelToDelete = this.get(modelCid);
this.remove(modelToDelete);
modelToDelete.sync("delete", modelToDelete);
},
createProjectOnDisk: function (values, callback) {
var collection = this;
server.create({
args: [
values.location,
values.name
].join(" ")
}, function (response) {
var model = collection.create(values);
callback(response, model);
});
},
deleteProjectFromDisk: function (modelCid, callback) {
var collection = this,
model = this.get(modelCid);
server.delete({
projectPath: model.get("location")
}, function (response) {
collection.deleteProjectModel(modelCid);
callback(response);
});
},
getDefaultProjectPath: function (callback) {
server.defaultProjectPath({}, function (response) {
callback(response);
});
}
});
module.exports = ProjectList;
## Instruction:
Allow spaces in path for project create
## Code After:
var ProjectList,
Project = require("../models/project"),
server = require("../server"),
storage = require("../storage");
ProjectList = Backbone.Collection.extend({
model: Project,
initialize: function () {
var collection = this,
projects = storage.readProjects(),
projectId;
for (projectId in projects) {
if (projects.hasOwnProperty(projectId)) {
this.create(projects[projectId]);
}
}
},
sync: function (method, model, options) {
},
deleteProjectModel: function (modelCid) {
// Remove from collection and destroy model
var modelToDelete = this.get(modelCid);
this.remove(modelToDelete);
modelToDelete.sync("delete", modelToDelete);
},
createProjectOnDisk: function (values, callback) {
var collection = this;
server.create({
args: [
"\"" + values.location + "\"",
values.name
].join(" ")
}, function (response) {
var model = collection.create(values);
callback(response, model);
});
},
deleteProjectFromDisk: function (modelCid, callback) {
var collection = this,
model = this.get(modelCid);
server.delete({
projectPath: model.get("location")
}, function (response) {
collection.deleteProjectModel(modelCid);
callback(response);
});
},
getDefaultProjectPath: function (callback) {
server.defaultProjectPath({}, function (response) {
callback(response);
});
}
});
module.exports = ProjectList;
| var ProjectList,
Project = require("../models/project"),
server = require("../server"),
storage = require("../storage");
ProjectList = Backbone.Collection.extend({
model: Project,
initialize: function () {
var collection = this,
projects = storage.readProjects(),
projectId;
for (projectId in projects) {
if (projects.hasOwnProperty(projectId)) {
this.create(projects[projectId]);
}
}
},
sync: function (method, model, options) {
},
deleteProjectModel: function (modelCid) {
// Remove from collection and destroy model
var modelToDelete = this.get(modelCid);
this.remove(modelToDelete);
modelToDelete.sync("delete", modelToDelete);
},
createProjectOnDisk: function (values, callback) {
var collection = this;
server.create({
args: [
- values.location,
+ "\"" + values.location + "\"",
? +++++++ +++++++
values.name
].join(" ")
}, function (response) {
var model = collection.create(values);
callback(response, model);
});
},
deleteProjectFromDisk: function (modelCid, callback) {
var collection = this,
model = this.get(modelCid);
server.delete({
projectPath: model.get("location")
}, function (response) {
collection.deleteProjectModel(modelCid);
callback(response);
});
},
getDefaultProjectPath: function (callback) {
server.defaultProjectPath({}, function (response) {
callback(response);
});
}
});
module.exports = ProjectList; | 2 | 0.034483 | 1 | 1 |
fe7bee6a1aaa14bf3decc5859ce1b22bbcc65060 | README.md | README.md |
[Mailosaur](https://mailosaur.com) allows you to automate tests involving email. Allowing you to perform end-to-end automated and functional email testing.
[](https://travis-ci.org/mailosaurapp/mailosaur-ruby)
## Installation
```
gem install mailosaur
```
## Documentation and usage examples
[Mailosaur's documentation](https://mailosaur.com/docs) includes all the information and usage examples you'll need.
## Running tests
Once you've cloned this repository locally, you can simply run:
```
bundle install
export MAILOSAUR_MAILBOX_ID=yourmailbox
export MAILOSAUR_API_KEY=yourapikey
rake test
```
## Contacting us
You can get us at [support@mailosaur.com](mailto:support@mailosaur.com)
## License
Copyright (c) 2016 Mailosaur Ltd
Distributed under MIT license.
|
[Mailosaur](https://mailosaur.com) allows you to automate tests involving email. Allowing you to perform end-to-end automated and functional email testing.
[](https://travis-ci.org/mailosaurapp/mailosaur-ruby)
## Installation
```
gem install mailosaur
```
## Documentation and usage examples
[Mailosaur's documentation](https://mailosaur.com/docs) includes all the information and usage examples you'll need.
## Running tests
Once you've cloned this repository locally, you can simply run:
```
bundle install
export MAILOSAUR_MAILBOX_ID=yourmailbox
export MAILOSAUR_API_KEY=yourapikey
bundle exec rake
```
## Contacting us
You can get us at [support@mailosaur.com](mailto:support@mailosaur.com)
## License
Copyright (c) 2016 Mailosaur Ltd
Distributed under MIT license.
| Update `rake test` to `bundle exec rake` to match CI | Update `rake test` to `bundle exec rake` to match CI | Markdown | mit | mailosaurapp/mailosaur-ruby | markdown | ## Code Before:
[Mailosaur](https://mailosaur.com) allows you to automate tests involving email. Allowing you to perform end-to-end automated and functional email testing.
[](https://travis-ci.org/mailosaurapp/mailosaur-ruby)
## Installation
```
gem install mailosaur
```
## Documentation and usage examples
[Mailosaur's documentation](https://mailosaur.com/docs) includes all the information and usage examples you'll need.
## Running tests
Once you've cloned this repository locally, you can simply run:
```
bundle install
export MAILOSAUR_MAILBOX_ID=yourmailbox
export MAILOSAUR_API_KEY=yourapikey
rake test
```
## Contacting us
You can get us at [support@mailosaur.com](mailto:support@mailosaur.com)
## License
Copyright (c) 2016 Mailosaur Ltd
Distributed under MIT license.
## Instruction:
Update `rake test` to `bundle exec rake` to match CI
## Code After:
[Mailosaur](https://mailosaur.com) allows you to automate tests involving email. Allowing you to perform end-to-end automated and functional email testing.
[](https://travis-ci.org/mailosaurapp/mailosaur-ruby)
## Installation
```
gem install mailosaur
```
## Documentation and usage examples
[Mailosaur's documentation](https://mailosaur.com/docs) includes all the information and usage examples you'll need.
## Running tests
Once you've cloned this repository locally, you can simply run:
```
bundle install
export MAILOSAUR_MAILBOX_ID=yourmailbox
export MAILOSAUR_API_KEY=yourapikey
bundle exec rake
```
## Contacting us
You can get us at [support@mailosaur.com](mailto:support@mailosaur.com)
## License
Copyright (c) 2016 Mailosaur Ltd
Distributed under MIT license.
|
[Mailosaur](https://mailosaur.com) allows you to automate tests involving email. Allowing you to perform end-to-end automated and functional email testing.
[](https://travis-ci.org/mailosaurapp/mailosaur-ruby)
## Installation
```
gem install mailosaur
```
## Documentation and usage examples
[Mailosaur's documentation](https://mailosaur.com/docs) includes all the information and usage examples you'll need.
## Running tests
Once you've cloned this repository locally, you can simply run:
```
bundle install
export MAILOSAUR_MAILBOX_ID=yourmailbox
export MAILOSAUR_API_KEY=yourapikey
- rake test
+ bundle exec rake
```
## Contacting us
You can get us at [support@mailosaur.com](mailto:support@mailosaur.com)
## License
Copyright (c) 2016 Mailosaur Ltd
Distributed under MIT license. | 2 | 0.055556 | 1 | 1 |
c0217306b2573adf75b950e632cb0e29edf15100 | basic-algorithms/mutations.js | basic-algorithms/mutations.js | /*
Free Code Camp Challenge - Mutations
https://www.freecodecamp.com/challenges/mutations
*/
function mutation(arr) {
var firstElement = arr[0].toLowerCase();
var secondElement = arr[1].toLowerCase();
var contains = 0;
for (var i = 0; i < secondElement.length; i++) {
contains = firstElement.indexOf(secondElement[i]);
if (contains !== - 1) {
return true;
}
}
return false;
}
console.log(mutation(["hello", "hey"]));
| /*
Free Code Camp Challenge - Mutations
https://www.freecodecamp.com/challenges/mutations
*/
function mutation(arr) {
var firstElement = arr[0].toLowerCase();
var secondElement = arr[1].toLowerCase();
var contains = 0;
for (var i = 0; i < secondElement.length; i++) {
contains = firstElement.indexOf(secondElement[i]);
if (contains !== - 1) {
return true;
}
}
return false;
}
mutation(["hello", "hey"]);
| Remove console.log the invocation function | Remove console.log the invocation function
| JavaScript | mit | wgoulart/FreeCodeCamp | javascript | ## Code Before:
/*
Free Code Camp Challenge - Mutations
https://www.freecodecamp.com/challenges/mutations
*/
function mutation(arr) {
var firstElement = arr[0].toLowerCase();
var secondElement = arr[1].toLowerCase();
var contains = 0;
for (var i = 0; i < secondElement.length; i++) {
contains = firstElement.indexOf(secondElement[i]);
if (contains !== - 1) {
return true;
}
}
return false;
}
console.log(mutation(["hello", "hey"]));
## Instruction:
Remove console.log the invocation function
## Code After:
/*
Free Code Camp Challenge - Mutations
https://www.freecodecamp.com/challenges/mutations
*/
function mutation(arr) {
var firstElement = arr[0].toLowerCase();
var secondElement = arr[1].toLowerCase();
var contains = 0;
for (var i = 0; i < secondElement.length; i++) {
contains = firstElement.indexOf(secondElement[i]);
if (contains !== - 1) {
return true;
}
}
return false;
}
mutation(["hello", "hey"]);
| /*
Free Code Camp Challenge - Mutations
https://www.freecodecamp.com/challenges/mutations
*/
function mutation(arr) {
var firstElement = arr[0].toLowerCase();
var secondElement = arr[1].toLowerCase();
var contains = 0;
for (var i = 0; i < secondElement.length; i++) {
contains = firstElement.indexOf(secondElement[i]);
if (contains !== - 1) {
return true;
}
}
return false;
}
- console.log(mutation(["hello", "hey"]));
? ------------ -
+ mutation(["hello", "hey"]); | 2 | 0.090909 | 1 | 1 |
25411817ae0894a88affb1c0a2e8f36cc82e9e8c | zones/wyvernsquare.com | zones/wyvernsquare.com | $TTL 3600
@ IN SOA dns1.wyvernsquare.com. helpdesk.wyvernsquare.com. (
2017040402 ; serial
300 ; refresh
300 ; retry
1209600 ; expire
300 ) ; minimum
IN NS dns1.wyvernsquare.com.
IN NS ns2.wyvernsquare.com.
IN A 133.130.102.210
IN MX 10 MX.ZOHO.COM.
IN MX 20 MX2.ZOHO.COM.
IN TXT "v=spf1 include:zoho.com ~all"
IN TXT "MS=ms47698118"
$ORIGIN wyvernsquare.com.
dns1 172800 IN A 133.130.102.210
ns2 172800 IN A 133.130.102.210
www IN A 133.130.102.210
test IN A 216.58.197.14
* IN CNAME wyvernsquare.com.
| $TTL 3600
@ IN SOA dns1.wyvernsquare.com. helpdesk.wyvernsquare.com. (
2017040402 ; serial
300 ; refresh
300 ; retry
1209600 ; expire
300 ) ; minimum
IN NS dns1.wyvernsquare.com.
IN NS ns2.wyvernsquare.com.
IN A 133.130.102.210
IN MX 10 MX.ZOHO.COM.
IN MX 20 MX2.ZOHO.COM.
IN TXT "v=spf1 include:zoho.com ~all"
IN TXT "MS=ms47698118"
$ORIGIN wyvernsquare.com.
dns1 172800 IN A 133.130.102.210
ns2 172800 IN A 133.130.102.210
www IN A 133.130.102.210
test IN A 216.58.197.14
test IN CNAME google.com.
salesforce IN CNAME wyvernsquare-dev-ed.my.salesforce.com.
| Add a few more test entries | Add a few more test entries
| DIGITAL Command Language | apache-2.0 | Wyvernsquare/dns,Wyvernsquare/dns | digital-command-language | ## Code Before:
$TTL 3600
@ IN SOA dns1.wyvernsquare.com. helpdesk.wyvernsquare.com. (
2017040402 ; serial
300 ; refresh
300 ; retry
1209600 ; expire
300 ) ; minimum
IN NS dns1.wyvernsquare.com.
IN NS ns2.wyvernsquare.com.
IN A 133.130.102.210
IN MX 10 MX.ZOHO.COM.
IN MX 20 MX2.ZOHO.COM.
IN TXT "v=spf1 include:zoho.com ~all"
IN TXT "MS=ms47698118"
$ORIGIN wyvernsquare.com.
dns1 172800 IN A 133.130.102.210
ns2 172800 IN A 133.130.102.210
www IN A 133.130.102.210
test IN A 216.58.197.14
* IN CNAME wyvernsquare.com.
## Instruction:
Add a few more test entries
## Code After:
$TTL 3600
@ IN SOA dns1.wyvernsquare.com. helpdesk.wyvernsquare.com. (
2017040402 ; serial
300 ; refresh
300 ; retry
1209600 ; expire
300 ) ; minimum
IN NS dns1.wyvernsquare.com.
IN NS ns2.wyvernsquare.com.
IN A 133.130.102.210
IN MX 10 MX.ZOHO.COM.
IN MX 20 MX2.ZOHO.COM.
IN TXT "v=spf1 include:zoho.com ~all"
IN TXT "MS=ms47698118"
$ORIGIN wyvernsquare.com.
dns1 172800 IN A 133.130.102.210
ns2 172800 IN A 133.130.102.210
www IN A 133.130.102.210
test IN A 216.58.197.14
test IN CNAME google.com.
salesforce IN CNAME wyvernsquare-dev-ed.my.salesforce.com.
| $TTL 3600
@ IN SOA dns1.wyvernsquare.com. helpdesk.wyvernsquare.com. (
2017040402 ; serial
300 ; refresh
300 ; retry
1209600 ; expire
300 ) ; minimum
IN NS dns1.wyvernsquare.com.
IN NS ns2.wyvernsquare.com.
IN A 133.130.102.210
IN MX 10 MX.ZOHO.COM.
IN MX 20 MX2.ZOHO.COM.
IN TXT "v=spf1 include:zoho.com ~all"
IN TXT "MS=ms47698118"
$ORIGIN wyvernsquare.com.
dns1 172800 IN A 133.130.102.210
ns2 172800 IN A 133.130.102.210
www IN A 133.130.102.210
test IN A 216.58.197.14
- * IN CNAME wyvernsquare.com.
+ test IN CNAME google.com.
+ salesforce IN CNAME wyvernsquare-dev-ed.my.salesforce.com. | 3 | 0.15 | 2 | 1 |
3c379c07b727454480fcc04389dfae1221ab5b40 | db/migrate/20140701194425_move_attachments_to_private_folder.rb | db/migrate/20140701194425_move_attachments_to_private_folder.rb | class MoveAttachmentsToPrivateFolder < ActiveRecord::Migration
def up
source = "#{Rails.root}/public/uploads"
destination = "#{Rails.root}/private/uploads"
Dir.glob(File.join(source, '**/*')).each do |file|
target = file.gsub(source, "")
target = File.join(destination, target)
if File.directory?(file)
if File.exists?(target)
puts "file '#{target}' exists"
else
puts "mkdir #{target}"
Dir.mkdir target
end
else
FileUtils.mv file, target, :force => true, :verbose => true
end
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| class MoveAttachmentsToPrivateFolder < ActiveRecord::Migration
def up
source = "#{Rails.root}/public/uploads/space/attachment"
destination = "#{Rails.root}/private/uploads/space/attachment"
FileUtils.mkdir_p destination, :verbose => true
Dir.glob(File.join(source, '**/*')).each do |file|
target = file.gsub(source, "")
target = File.join(destination, target)
if File.directory?(file)
if File.exists?(target)
puts "file '#{target}' exists"
else
puts "mkdir #{target}"
FileUtils.mkdir_p target, :verbose => true
end
else
FileUtils.mv file, target, :force => true, :verbose => true
end
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| Fix the migration of attachments to a private folder | Fix the migration of attachments to a private folder
Was moving not only the attachments but all the logos from their
folder to the private folder. The logos should be kept there.
refs #987
| Ruby | agpl-3.0 | mconftec/mconf-web-mytruecloud,mconftec/mconf-web-mytruecloud,mconftec/mconf-web-uergs,mconf-rnp/mconf-web,mconftec/mconf-web-santacasa,mconf-ufrgs/mconf-web,amreis/mconf-web,mconftec/mconf-web-mytruecloud,mconftec/mconf-web-uergs,mconftec/mconf-web-ufpe,fbottin/mconf-web,mconftec/mconf-web-uergs,mconftec/mconf-web-ufpe,becueb/MconfWeb,mconf-ufrgs/mconf-web,lfzawacki/mconf-web,mconf/mconf-web,amreis/mconf-web,amreis/mconf-web,mconftec/mconf-web-ufpe,mconftec/mconf-web-cedia,mconf/mconf-web,mconftec/mconf-web-mytruecloud,mconf-ufrgs/mconf-web,lfzawacki/mconf-web,lfzawacki/mconf-web,fbottin/mconf-web,mconftec/mconf-web-cedia,akratech/Akraconference,mconftec/mconf-web-santacasa,becueb/MconfWeb,mconf-rnp/mconf-web,lfzawacki/mconf-web,mconf/mconf-web,mconftec/mconf-web-cedia,becueb/MconfWeb,amreis/mconf-web,fbottin/mconf-web,mconftec/mconf-web-santacasa,mconftec/mconf-web-uergs,fbottin/mconf-web,mconf/mconf-web,mconf-rnp/mconf-web,mconftec/mconf-web-santacasa,mconftec/mconf-web-ufpe,akratech/Akraconference,mconf-ufrgs/mconf-web,akratech/Akraconference,akratech/Akraconference,mconf-rnp/mconf-web,becueb/MconfWeb | ruby | ## Code Before:
class MoveAttachmentsToPrivateFolder < ActiveRecord::Migration
def up
source = "#{Rails.root}/public/uploads"
destination = "#{Rails.root}/private/uploads"
Dir.glob(File.join(source, '**/*')).each do |file|
target = file.gsub(source, "")
target = File.join(destination, target)
if File.directory?(file)
if File.exists?(target)
puts "file '#{target}' exists"
else
puts "mkdir #{target}"
Dir.mkdir target
end
else
FileUtils.mv file, target, :force => true, :verbose => true
end
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
## Instruction:
Fix the migration of attachments to a private folder
Was moving not only the attachments but all the logos from their
folder to the private folder. The logos should be kept there.
refs #987
## Code After:
class MoveAttachmentsToPrivateFolder < ActiveRecord::Migration
def up
source = "#{Rails.root}/public/uploads/space/attachment"
destination = "#{Rails.root}/private/uploads/space/attachment"
FileUtils.mkdir_p destination, :verbose => true
Dir.glob(File.join(source, '**/*')).each do |file|
target = file.gsub(source, "")
target = File.join(destination, target)
if File.directory?(file)
if File.exists?(target)
puts "file '#{target}' exists"
else
puts "mkdir #{target}"
FileUtils.mkdir_p target, :verbose => true
end
else
FileUtils.mv file, target, :force => true, :verbose => true
end
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| class MoveAttachmentsToPrivateFolder < ActiveRecord::Migration
def up
- source = "#{Rails.root}/public/uploads"
+ source = "#{Rails.root}/public/uploads/space/attachment"
? +++++++++++++++++
- destination = "#{Rails.root}/private/uploads"
+ destination = "#{Rails.root}/private/uploads/space/attachment"
? +++++++++++++++++
+ FileUtils.mkdir_p destination, :verbose => true
Dir.glob(File.join(source, '**/*')).each do |file|
target = file.gsub(source, "")
target = File.join(destination, target)
if File.directory?(file)
if File.exists?(target)
puts "file '#{target}' exists"
else
puts "mkdir #{target}"
- Dir.mkdir target
+ FileUtils.mkdir_p target, :verbose => true
end
else
FileUtils.mv file, target, :force => true, :verbose => true
end
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end | 7 | 0.28 | 4 | 3 |
a7110c162f9fda82c42941f5e382cadeb8128ebc | app/views/user/account/partials/_header.html.erb | app/views/user/account/partials/_header.html.erb | <div class="bs-header account-header" id="content">
<div class="container">
<h1>Xerax</h1>
<p>Member Since 18/08/1994</p>
<ul>
<li><span class="label label-success">Developer</span></li>
<li><span class="label label-info">Halo 4</span></li>
<li><span class="label label-info">Halo Reach</span></li>
<li><span class="label label-info">Halo 3</span></li>
</ul>
<div class="actions">
<a class="btn btn-outline-inverse btn-lg">Edit Profile</a>
</div>
<div class="h4-player-posed hidden-xs">
<div class="player" style="background-image: url(https://spartans.svc.halowaypoint.com/players/iBotPeaches%20v5/h4/spartans/posed?target=large)"></div>
</div>
</div>
</div> | <div class="bs-header account-header" id="content">
<div class="container">
<h1>Xerax</h1>
<p>Member Since 18/08/1994</p>
<ul>
<li><span class="label label-success">Developer</span></li>
<li><span class="label label-info">Halo 4</span></li>
<li><span class="label label-info">Halo Reach</span></li>
<li><span class="label label-info">Halo 3</span></li>
</ul>
<% if !content_for?(:setting_active) %>
<div class="actions">
<a class="btn btn-outline-inverse btn-lg">Edit Profile</a>
</div>
<% end %>
<div class="h4-player-posed hidden-xs">
<div class="player" style="background-image: url(https://spartans.svc.halowaypoint.com/players/iBotPeaches%20v5/h4/spartans/posed?target=large)"></div>
</div>
</div>
</div> | Remove 'edit profile' button on settings pages | Remove 'edit profile' button on settings pages
| HTML+ERB | mit | TheTree/branch,TheTree/branch,TheTree/branch | html+erb | ## Code Before:
<div class="bs-header account-header" id="content">
<div class="container">
<h1>Xerax</h1>
<p>Member Since 18/08/1994</p>
<ul>
<li><span class="label label-success">Developer</span></li>
<li><span class="label label-info">Halo 4</span></li>
<li><span class="label label-info">Halo Reach</span></li>
<li><span class="label label-info">Halo 3</span></li>
</ul>
<div class="actions">
<a class="btn btn-outline-inverse btn-lg">Edit Profile</a>
</div>
<div class="h4-player-posed hidden-xs">
<div class="player" style="background-image: url(https://spartans.svc.halowaypoint.com/players/iBotPeaches%20v5/h4/spartans/posed?target=large)"></div>
</div>
</div>
</div>
## Instruction:
Remove 'edit profile' button on settings pages
## Code After:
<div class="bs-header account-header" id="content">
<div class="container">
<h1>Xerax</h1>
<p>Member Since 18/08/1994</p>
<ul>
<li><span class="label label-success">Developer</span></li>
<li><span class="label label-info">Halo 4</span></li>
<li><span class="label label-info">Halo Reach</span></li>
<li><span class="label label-info">Halo 3</span></li>
</ul>
<% if !content_for?(:setting_active) %>
<div class="actions">
<a class="btn btn-outline-inverse btn-lg">Edit Profile</a>
</div>
<% end %>
<div class="h4-player-posed hidden-xs">
<div class="player" style="background-image: url(https://spartans.svc.halowaypoint.com/players/iBotPeaches%20v5/h4/spartans/posed?target=large)"></div>
</div>
</div>
</div> | <div class="bs-header account-header" id="content">
<div class="container">
<h1>Xerax</h1>
<p>Member Since 18/08/1994</p>
<ul>
<li><span class="label label-success">Developer</span></li>
<li><span class="label label-info">Halo 4</span></li>
<li><span class="label label-info">Halo Reach</span></li>
<li><span class="label label-info">Halo 3</span></li>
</ul>
+ <% if !content_for?(:setting_active) %>
- <div class="actions">
+ <div class="actions">
? +
- <a class="btn btn-outline-inverse btn-lg">Edit Profile</a>
+ <a class="btn btn-outline-inverse btn-lg">Edit Profile</a>
? +
- </div>
+ </div>
? +
+ <% end %>
<div class="h4-player-posed hidden-xs">
<div class="player" style="background-image: url(https://spartans.svc.halowaypoint.com/players/iBotPeaches%20v5/h4/spartans/posed?target=large)"></div>
</div>
</div>
</div> | 8 | 0.421053 | 5 | 3 |
9e2a91132bc1b1005eb86d92f2ae7fc37784bbfa | README.md | README.md |
- A fast, immutable string interning scheme (aka. a way of assigning a unique integer id to each unique string, without collisions)
- Two-way lookup: id => string, string => id
- Each string is stored only once in memory
- Optional inlining of unsigned int strings, into the id, via tagging
- Very low fragmentation via a custom block allocator
- Minimal total overhead per string (currently 48 bytes. Could be lower at the cost of additional fragmentation)
- Fast: intern many millions of strings per second
See [strings.h](https://github.com/chriso/intern.c/blob/master/strings.h) for usage.
|
- A fast, immutable string interning scheme (aka. a way of assigning a unique integer id to each unique string, without collisions)
- Two-way lookup: id => string, string => id
- Each string is stored only once in memory
- Optional inlining of unsigned int strings, into the id, via tagging
- Very low fragmentation via a custom block allocator
- Minimal total overhead per string (currently 48 bytes. Could be lower at the cost of additional fragmentation)
- Fast: intern many millions of strings per second
- String repository optimization based on frequency analysis (improve locality)
See [strings.h](https://github.com/chriso/intern.c/blob/master/strings.h) for usage.
| Make a note about the frequency optimization | Make a note about the frequency optimization
| Markdown | mit | chriso/intern | markdown | ## Code Before:
- A fast, immutable string interning scheme (aka. a way of assigning a unique integer id to each unique string, without collisions)
- Two-way lookup: id => string, string => id
- Each string is stored only once in memory
- Optional inlining of unsigned int strings, into the id, via tagging
- Very low fragmentation via a custom block allocator
- Minimal total overhead per string (currently 48 bytes. Could be lower at the cost of additional fragmentation)
- Fast: intern many millions of strings per second
See [strings.h](https://github.com/chriso/intern.c/blob/master/strings.h) for usage.
## Instruction:
Make a note about the frequency optimization
## Code After:
- A fast, immutable string interning scheme (aka. a way of assigning a unique integer id to each unique string, without collisions)
- Two-way lookup: id => string, string => id
- Each string is stored only once in memory
- Optional inlining of unsigned int strings, into the id, via tagging
- Very low fragmentation via a custom block allocator
- Minimal total overhead per string (currently 48 bytes. Could be lower at the cost of additional fragmentation)
- Fast: intern many millions of strings per second
- String repository optimization based on frequency analysis (improve locality)
See [strings.h](https://github.com/chriso/intern.c/blob/master/strings.h) for usage.
|
- A fast, immutable string interning scheme (aka. a way of assigning a unique integer id to each unique string, without collisions)
- Two-way lookup: id => string, string => id
- Each string is stored only once in memory
- Optional inlining of unsigned int strings, into the id, via tagging
- Very low fragmentation via a custom block allocator
- Minimal total overhead per string (currently 48 bytes. Could be lower at the cost of additional fragmentation)
- Fast: intern many millions of strings per second
+ - String repository optimization based on frequency analysis (improve locality)
See [strings.h](https://github.com/chriso/intern.c/blob/master/strings.h) for usage. | 1 | 0.1 | 1 | 0 |
58142e78f8e181b67439918e6a8006bc7d27a46f | views/_head.haml | views/_head.haml | %title Free Bitcoins
%link(rel='stylesheet' href='//cdn.jsdelivr.net/bootstrap/2.3.0/css/bootstrap.css')
%link(rel='stylesheet' href='/css/style.css')
%script(src='//cdn.jsdelivr.net/jquery/1.9.1/jquery-1.9.1.min.js')
%script(src='//cdn.jsdelivr.net/bootstrap/2.3.0/js/bootstrap.min.js')
%script(src='/js/spin.min.js')
%script(src='/js/jquery.spin.js')
%script(src='/js/jquery.flot.js')
%script(src='/js/jquery.flot.time.js')
%script(src='/js/script.js')
= partial :ga
| %title Free Bitcoins
%link(rel='stylesheet' href='//cdn.jsdelivr.net/bootstrap/2.3.0/css/bootstrap.css')
%link(rel='stylesheet' href='/css/style.css')
%script(src='//cdn.jsdelivr.net/jquery/1.9.1/jquery-1.9.1.min.js')
%script(src='//cdn.jsdelivr.net/bootstrap/2.3.0/js/bootstrap.min.js')
%script(src='/js/spin.min.js')
%script(src='/js/jquery.spin.js')
%script(src='/js/jquery.flot.js')
%script(src='/js/jquery.flot.time.js')
%script(src='/js/script.js')
%script(type="text/javascript" src="/js/ga.js")
| Change to how Google Analytics works | Change to how Google Analytics works
| Haml | mit | PartTimeLegend/freecoins,PartTimeLegend/freecoins,PartTimeLegend/freecoins | haml | ## Code Before:
%title Free Bitcoins
%link(rel='stylesheet' href='//cdn.jsdelivr.net/bootstrap/2.3.0/css/bootstrap.css')
%link(rel='stylesheet' href='/css/style.css')
%script(src='//cdn.jsdelivr.net/jquery/1.9.1/jquery-1.9.1.min.js')
%script(src='//cdn.jsdelivr.net/bootstrap/2.3.0/js/bootstrap.min.js')
%script(src='/js/spin.min.js')
%script(src='/js/jquery.spin.js')
%script(src='/js/jquery.flot.js')
%script(src='/js/jquery.flot.time.js')
%script(src='/js/script.js')
= partial :ga
## Instruction:
Change to how Google Analytics works
## Code After:
%title Free Bitcoins
%link(rel='stylesheet' href='//cdn.jsdelivr.net/bootstrap/2.3.0/css/bootstrap.css')
%link(rel='stylesheet' href='/css/style.css')
%script(src='//cdn.jsdelivr.net/jquery/1.9.1/jquery-1.9.1.min.js')
%script(src='//cdn.jsdelivr.net/bootstrap/2.3.0/js/bootstrap.min.js')
%script(src='/js/spin.min.js')
%script(src='/js/jquery.spin.js')
%script(src='/js/jquery.flot.js')
%script(src='/js/jquery.flot.time.js')
%script(src='/js/script.js')
%script(type="text/javascript" src="/js/ga.js")
| %title Free Bitcoins
%link(rel='stylesheet' href='//cdn.jsdelivr.net/bootstrap/2.3.0/css/bootstrap.css')
%link(rel='stylesheet' href='/css/style.css')
%script(src='//cdn.jsdelivr.net/jquery/1.9.1/jquery-1.9.1.min.js')
%script(src='//cdn.jsdelivr.net/bootstrap/2.3.0/js/bootstrap.min.js')
%script(src='/js/spin.min.js')
%script(src='/js/jquery.spin.js')
%script(src='/js/jquery.flot.js')
%script(src='/js/jquery.flot.time.js')
%script(src='/js/script.js')
- = partial :ga
+ %script(type="text/javascript" src="/js/ga.js") | 2 | 0.181818 | 1 | 1 |
af957a53cc6d18355261f23132e3cf5fe00f90d3 | scripts/NuclearFallout.sh | scripts/NuclearFallout.sh |
always_clean() {
cat <<EOF
/system/app/Provision/Provision.apk
/system/app/QuickSearchBox/QuickSearchBox.apk
/system/app/priv-app/SetupWizard/SetupWizard.apk
/system/app/priv-app/Velvet/Velvet.apk
/system/app/Vending/Vending.apk
/system/app/BrowserProviderProxy/BrowserProviderProxy.apk
/system/app/PartnerBookmarksProver/PartnerBookmarksProvider.apk
/system/app/Calendar/Calendar.apk
EOF
}
always_clean | while read FILE; do
rm -f $FILE
done
. /tmp/NuclearFalloutHelpers.sh
# copy system files into place AND generate 70-gapps.sh while we do
backuptool_header
copy_files /tmp/system /system
backuptool_footer
# copy data files into place (if there are any)
[ -e /tmp/data ] && copy_files /tmp/data /data
|
always_clean() {
cat <<EOF
/system/app/Provision/Provision.apk
/system/app/QuickSearchBox/QuickSearchBox.apk
/system/app/priv-app/SetupWizard/SetupWizard.apk
/system/app/priv-app/Velvet/Velvet.apk
/system/app/Vending/Vending.apk
/system/app/BrowserProviderProxy/BrowserProviderProxy.apk
/system/app/PartnerBookmarksProver/PartnerBookmarksProvider.apk
EOF
}
always_clean | while read FILE; do
rm -f $FILE
done
. /tmp/NuclearFalloutHelpers.sh
# copy system files into place AND generate 70-gapps.sh while we do
backuptool_header
copy_files /tmp/system /system
backuptool_footer
# copy data files into place (if there are any)
[ -e /tmp/data ] && copy_files /tmp/data /data
| Remove aosp calendar from always_remove | Remove aosp calendar from always_remove
| Shell | mit | nuclearmistake/AnyGapps | shell | ## Code Before:
always_clean() {
cat <<EOF
/system/app/Provision/Provision.apk
/system/app/QuickSearchBox/QuickSearchBox.apk
/system/app/priv-app/SetupWizard/SetupWizard.apk
/system/app/priv-app/Velvet/Velvet.apk
/system/app/Vending/Vending.apk
/system/app/BrowserProviderProxy/BrowserProviderProxy.apk
/system/app/PartnerBookmarksProver/PartnerBookmarksProvider.apk
/system/app/Calendar/Calendar.apk
EOF
}
always_clean | while read FILE; do
rm -f $FILE
done
. /tmp/NuclearFalloutHelpers.sh
# copy system files into place AND generate 70-gapps.sh while we do
backuptool_header
copy_files /tmp/system /system
backuptool_footer
# copy data files into place (if there are any)
[ -e /tmp/data ] && copy_files /tmp/data /data
## Instruction:
Remove aosp calendar from always_remove
## Code After:
always_clean() {
cat <<EOF
/system/app/Provision/Provision.apk
/system/app/QuickSearchBox/QuickSearchBox.apk
/system/app/priv-app/SetupWizard/SetupWizard.apk
/system/app/priv-app/Velvet/Velvet.apk
/system/app/Vending/Vending.apk
/system/app/BrowserProviderProxy/BrowserProviderProxy.apk
/system/app/PartnerBookmarksProver/PartnerBookmarksProvider.apk
EOF
}
always_clean | while read FILE; do
rm -f $FILE
done
. /tmp/NuclearFalloutHelpers.sh
# copy system files into place AND generate 70-gapps.sh while we do
backuptool_header
copy_files /tmp/system /system
backuptool_footer
# copy data files into place (if there are any)
[ -e /tmp/data ] && copy_files /tmp/data /data
|
always_clean() {
cat <<EOF
/system/app/Provision/Provision.apk
/system/app/QuickSearchBox/QuickSearchBox.apk
/system/app/priv-app/SetupWizard/SetupWizard.apk
/system/app/priv-app/Velvet/Velvet.apk
/system/app/Vending/Vending.apk
/system/app/BrowserProviderProxy/BrowserProviderProxy.apk
/system/app/PartnerBookmarksProver/PartnerBookmarksProvider.apk
- /system/app/Calendar/Calendar.apk
EOF
}
always_clean | while read FILE; do
rm -f $FILE
done
. /tmp/NuclearFalloutHelpers.sh
# copy system files into place AND generate 70-gapps.sh while we do
backuptool_header
copy_files /tmp/system /system
backuptool_footer
# copy data files into place (if there are any)
[ -e /tmp/data ] && copy_files /tmp/data /data | 1 | 0.037037 | 0 | 1 |
dd94c70867c57149d73494722ed0d848fd2d574e | config/environment.rb | config/environment.rb | require File.expand_path('../application', __FILE__)
# Initialize the rails application
Acubens::Application.initialize!
| require File.expand_path('../application', __FILE__)
# Initialize the rails application
Acubens::Application.initialize!
ENV['RAILS_ASSET_ID'] = `git log -1 --pretty=format:"%h"`
| Set RAILS_ASSET_ID to expire the assets | Set RAILS_ASSET_ID to expire the assets
| Ruby | mit | ShowingCloud/Acubens,ShowingCloud/Acubens,ShowingCloud/Acubens,ShowingCloud/Acubens | ruby | ## Code Before:
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Acubens::Application.initialize!
## Instruction:
Set RAILS_ASSET_ID to expire the assets
## Code After:
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Acubens::Application.initialize!
ENV['RAILS_ASSET_ID'] = `git log -1 --pretty=format:"%h"`
| require File.expand_path('../application', __FILE__)
# Initialize the rails application
Acubens::Application.initialize!
+
+ ENV['RAILS_ASSET_ID'] = `git log -1 --pretty=format:"%h"` | 2 | 0.5 | 2 | 0 |
d68b2d2ec84f9938a46b2c7c4241a09a0dac788b | .travis.yml | .travis.yml | language: cpp
compiler:
- gcc
- clang
before_install:
- sudo apt-get install libboost-all-dev
- sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa
- sudo apt-get update
- sudo apt-get install cmake
- sudo pip install lit
# Initialise our submodules
- git submodule init
- git submodule update
- mkdir build && cd build
- mkdir simple_example
- mkdir stp && cd stp
- cmake -G "Unix Makefiles" -DENABLE_TESTING:BOOL=ON ../..
script:
# Build STP
- make
# - make check # Enable once our tests pass properly
# Build example project. We assume that the build installed itself to the CMake user package registry (~/.cmake/packages/)
- cd ../simple_example
- cmake -G "Unix Makefiles" ../../examples/simple
- make
| language: cpp
compiler:
- gcc
- clang
before_install:
- sudo apt-get install libboost-all-dev
- sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa
- sudo apt-get update
- sudo apt-get install cmake
- sudo pip install lit
# Initialise our submodules
- git submodule init
- git submodule update
- mkdir build && cd build
- mkdir simple_example
- mkdir stp && cd stp
- cmake -G "Unix Makefiles" -DENABLE_TESTING:BOOL=ON ../..
script:
# Build STP
- make
- make check
# Build example project. We assume that the build installed itself to the CMake user package registry (~/.cmake/packages/)
- cd ../simple_example
- cmake -G "Unix Makefiles" ../../examples/simple
- make
| Enable running tests on Travis. | Enable running tests on Travis.
| YAML | mit | kyledewey/stp,kyledewey/stp,kyledewey/stp,kyledewey/stp,kyledewey/stp,kyledewey/stp | yaml | ## Code Before:
language: cpp
compiler:
- gcc
- clang
before_install:
- sudo apt-get install libboost-all-dev
- sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa
- sudo apt-get update
- sudo apt-get install cmake
- sudo pip install lit
# Initialise our submodules
- git submodule init
- git submodule update
- mkdir build && cd build
- mkdir simple_example
- mkdir stp && cd stp
- cmake -G "Unix Makefiles" -DENABLE_TESTING:BOOL=ON ../..
script:
# Build STP
- make
# - make check # Enable once our tests pass properly
# Build example project. We assume that the build installed itself to the CMake user package registry (~/.cmake/packages/)
- cd ../simple_example
- cmake -G "Unix Makefiles" ../../examples/simple
- make
## Instruction:
Enable running tests on Travis.
## Code After:
language: cpp
compiler:
- gcc
- clang
before_install:
- sudo apt-get install libboost-all-dev
- sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa
- sudo apt-get update
- sudo apt-get install cmake
- sudo pip install lit
# Initialise our submodules
- git submodule init
- git submodule update
- mkdir build && cd build
- mkdir simple_example
- mkdir stp && cd stp
- cmake -G "Unix Makefiles" -DENABLE_TESTING:BOOL=ON ../..
script:
# Build STP
- make
- make check
# Build example project. We assume that the build installed itself to the CMake user package registry (~/.cmake/packages/)
- cd ../simple_example
- cmake -G "Unix Makefiles" ../../examples/simple
- make
| language: cpp
compiler:
- gcc
- clang
before_install:
- sudo apt-get install libboost-all-dev
- sudo add-apt-repository -y ppa:ubuntu-sdk-team/ppa
- sudo apt-get update
- sudo apt-get install cmake
- sudo pip install lit
# Initialise our submodules
- git submodule init
- git submodule update
- mkdir build && cd build
- mkdir simple_example
- mkdir stp && cd stp
- cmake -G "Unix Makefiles" -DENABLE_TESTING:BOOL=ON ../..
script:
# Build STP
- make
- # - make check # Enable once our tests pass properly
+ - make check
# Build example project. We assume that the build installed itself to the CMake user package registry (~/.cmake/packages/)
- cd ../simple_example
- cmake -G "Unix Makefiles" ../../examples/simple
- make | 2 | 0.08 | 1 | 1 |
6bf40f6b86c69d2d13369b603fd7542bfe528cc5 | ngDeferredShow.js | ngDeferredShow.js | (function () {
'use strict';
angular.module('ngDeferredShow', [])
.directive('ngDeferredShow', function ($parse, $timeout, $animate) {
var timeoutBatches = {};
return {
restrict: 'A',
transclude: 'element',
multiElement: true,
priority: 600,
terminal: true,
link: function (scope, element, attrs, $ctrl, $transclude) {
var visible, compiled, timeout;
visible = $parse(attrs.ngDeferredShow)(scope);
compiled = false;
if (visible) {
compile();
}
else {
timeout = $parse(attrs.compileTimeout)(scope);
batchTimeout(compile, timeout);
}
scope.$watch(attrs.ngDeferredShow, function (value) {
visible = value;
if (compiled) {
updateVisibility();
}
});
function compile() {
$transclude(function (clone) {
$animate.enter(clone, element.parent(), element);
element = clone;
compiled = true;
updateVisibility();
});
}
function updateVisibility() {
$animate[visible ? 'removeClass' : 'addClass'](element, 'ng-hide');
}
}
};
function batchTimeout(callback, timeout) {
var batch = timeoutBatches[timeout];
if (!batch) {
batch = timeoutBatches[timeout] = [];
$timeout(function () {
delete timeoutBatches[timeout];
angular.forEach(batch, function (callback) {
callback();
});
}, timeout);
}
batch.push(callback);
}
});
}()); | (function () {
'use strict';
angular.module('ngDeferredShow', [])
.directive('ngDeferredShow', function ($parse, $timeout, $animate) {
var timeoutBatches = {};
return {
restrict: 'A',
transclude: 'element',
multiElement: true,
priority: 600,
terminal: true,
link: function (scope, element, attrs, $ctrl, $transclude) {
var visible, deferVisibleCompile, compiled, timeout;
visible = $parse(attrs.ngDeferredShow)(scope);
deferVisibleCompile = $parse(attrs.deferVisibleCompile)(scope);
compiled = false;
if (visible && !deferVisibleCompile) {
compile();
}
else {
timeout = $parse(attrs.compileTimeout)(scope);
batchTimeout(compile, timeout);
}
scope.$watch(attrs.ngDeferredShow, function (value) {
visible = value;
if (compiled) {
updateVisibility();
}
});
function compile() {
$transclude(function (clone) {
$animate.enter(clone, element.parent(), element);
element = clone;
compiled = true;
updateVisibility();
});
}
function updateVisibility() {
$animate[visible ? 'removeClass' : 'addClass'](element, 'ng-hide');
}
}
};
function batchTimeout(callback, timeout) {
var batch = timeoutBatches[timeout];
if (!batch) {
batch = timeoutBatches[timeout] = [];
$timeout(function () {
delete timeoutBatches[timeout];
angular.forEach(batch, function (callback) {
callback();
});
}, timeout);
}
batch.push(callback);
}
});
}());
| Add deferVisibleCompile option (default: false) | Add deferVisibleCompile option (default: false)
This defers compilation of visible elements too. Will be useful for incrementally showing long lists. | JavaScript | mit | nikolay-lesko/ng-deferred-show,nikolay-lesko/ng-deferred-show | javascript | ## Code Before:
(function () {
'use strict';
angular.module('ngDeferredShow', [])
.directive('ngDeferredShow', function ($parse, $timeout, $animate) {
var timeoutBatches = {};
return {
restrict: 'A',
transclude: 'element',
multiElement: true,
priority: 600,
terminal: true,
link: function (scope, element, attrs, $ctrl, $transclude) {
var visible, compiled, timeout;
visible = $parse(attrs.ngDeferredShow)(scope);
compiled = false;
if (visible) {
compile();
}
else {
timeout = $parse(attrs.compileTimeout)(scope);
batchTimeout(compile, timeout);
}
scope.$watch(attrs.ngDeferredShow, function (value) {
visible = value;
if (compiled) {
updateVisibility();
}
});
function compile() {
$transclude(function (clone) {
$animate.enter(clone, element.parent(), element);
element = clone;
compiled = true;
updateVisibility();
});
}
function updateVisibility() {
$animate[visible ? 'removeClass' : 'addClass'](element, 'ng-hide');
}
}
};
function batchTimeout(callback, timeout) {
var batch = timeoutBatches[timeout];
if (!batch) {
batch = timeoutBatches[timeout] = [];
$timeout(function () {
delete timeoutBatches[timeout];
angular.forEach(batch, function (callback) {
callback();
});
}, timeout);
}
batch.push(callback);
}
});
}());
## Instruction:
Add deferVisibleCompile option (default: false)
This defers compilation of visible elements too. Will be useful for incrementally showing long lists.
## Code After:
(function () {
'use strict';
angular.module('ngDeferredShow', [])
.directive('ngDeferredShow', function ($parse, $timeout, $animate) {
var timeoutBatches = {};
return {
restrict: 'A',
transclude: 'element',
multiElement: true,
priority: 600,
terminal: true,
link: function (scope, element, attrs, $ctrl, $transclude) {
var visible, deferVisibleCompile, compiled, timeout;
visible = $parse(attrs.ngDeferredShow)(scope);
deferVisibleCompile = $parse(attrs.deferVisibleCompile)(scope);
compiled = false;
if (visible && !deferVisibleCompile) {
compile();
}
else {
timeout = $parse(attrs.compileTimeout)(scope);
batchTimeout(compile, timeout);
}
scope.$watch(attrs.ngDeferredShow, function (value) {
visible = value;
if (compiled) {
updateVisibility();
}
});
function compile() {
$transclude(function (clone) {
$animate.enter(clone, element.parent(), element);
element = clone;
compiled = true;
updateVisibility();
});
}
function updateVisibility() {
$animate[visible ? 'removeClass' : 'addClass'](element, 'ng-hide');
}
}
};
function batchTimeout(callback, timeout) {
var batch = timeoutBatches[timeout];
if (!batch) {
batch = timeoutBatches[timeout] = [];
$timeout(function () {
delete timeoutBatches[timeout];
angular.forEach(batch, function (callback) {
callback();
});
}, timeout);
}
batch.push(callback);
}
});
}());
| (function () {
'use strict';
angular.module('ngDeferredShow', [])
.directive('ngDeferredShow', function ($parse, $timeout, $animate) {
var timeoutBatches = {};
return {
restrict: 'A',
transclude: 'element',
multiElement: true,
priority: 600,
terminal: true,
link: function (scope, element, attrs, $ctrl, $transclude) {
- var visible, compiled, timeout;
+ var visible, deferVisibleCompile, compiled, timeout;
? +++++++++++++++++++++
visible = $parse(attrs.ngDeferredShow)(scope);
+ deferVisibleCompile = $parse(attrs.deferVisibleCompile)(scope);
+
compiled = false;
- if (visible) {
+ if (visible && !deferVisibleCompile) {
compile();
}
else {
timeout = $parse(attrs.compileTimeout)(scope);
batchTimeout(compile, timeout);
}
scope.$watch(attrs.ngDeferredShow, function (value) {
visible = value;
if (compiled) {
updateVisibility();
}
});
function compile() {
$transclude(function (clone) {
$animate.enter(clone, element.parent(), element);
element = clone;
compiled = true;
updateVisibility();
});
}
function updateVisibility() {
$animate[visible ? 'removeClass' : 'addClass'](element, 'ng-hide');
}
}
};
function batchTimeout(callback, timeout) {
var batch = timeoutBatches[timeout];
if (!batch) {
batch = timeoutBatches[timeout] = [];
$timeout(function () {
delete timeoutBatches[timeout];
angular.forEach(batch, function (callback) {
callback();
});
}, timeout);
}
batch.push(callback);
}
});
}()); | 6 | 0.083333 | 4 | 2 |
95e3019ef36969d417961a2ddb9c7bf4b23dca85 | index.html | index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" id="index">
<ul>
{{#each item in model}}
<li>{{item}}</li>
{{/each}}
</ul>
</script>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.5.1.js"></script>
<script src="js/app.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" id="index">
<ul>
{{#each item in model}}
<li>{{item}}</li>
{{/each}}
</ul>
{{#if App.FBUser}}
<div>
<img {{bindAttr src="App.FBUser.picture" alt="App.FBUser.name"}} />
{{App.FBUser.name}}
<a href="#" {{action "logout" target="FB"}}>Logout</a>
</div>
{{else}}
{{#view Em.FacebookView type="login-button" data-size="xlarge"
data-scope="email, offline_access"}}
Connect
{{/view}}
{{/if}}
</script>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.5.1.js"></script>
<script src="js/libs/ember-facebook.js"></script>
<script src="js/app.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
</body>
</html>
| Add html for ember fb js | Add html for ember fb js
| HTML | unlicense | moisesvega/stressless | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" id="index">
<ul>
{{#each item in model}}
<li>{{item}}</li>
{{/each}}
</ul>
</script>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.5.1.js"></script>
<script src="js/app.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
</body>
</html>
## Instruction:
Add html for ember fb js
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" id="index">
<ul>
{{#each item in model}}
<li>{{item}}</li>
{{/each}}
</ul>
{{#if App.FBUser}}
<div>
<img {{bindAttr src="App.FBUser.picture" alt="App.FBUser.name"}} />
{{App.FBUser.name}}
<a href="#" {{action "logout" target="FB"}}>Logout</a>
</div>
{{else}}
{{#view Em.FacebookView type="login-button" data-size="xlarge"
data-scope="email, offline_access"}}
Connect
{{/view}}
{{/if}}
</script>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.5.1.js"></script>
<script src="js/libs/ember-facebook.js"></script>
<script src="js/app.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" id="index">
<ul>
{{#each item in model}}
<li>{{item}}</li>
{{/each}}
</ul>
+
+ {{#if App.FBUser}}
+ <div>
+ <img {{bindAttr src="App.FBUser.picture" alt="App.FBUser.name"}} />
+ {{App.FBUser.name}}
+ <a href="#" {{action "logout" target="FB"}}>Logout</a>
+ </div>
+ {{else}}
+ {{#view Em.FacebookView type="login-button" data-size="xlarge"
+ data-scope="email, offline_access"}}
+ Connect
+ {{/view}}
+ {{/if}}
</script>
<script src="js/libs/jquery-1.10.2.js"></script>
<script src="js/libs/handlebars-1.1.2.js"></script>
<script src="js/libs/ember-1.5.1.js"></script>
+ <script src="js/libs/ember-facebook.js"></script>
<script src="js/app.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
+
+
</body>
</html> | 16 | 0.516129 | 16 | 0 |
16f7e964341b2a0861011b33d3e4aedd937cead5 | usr/examples/14-WiFi-Shield/fw_update.py | usr/examples/14-WiFi-Shield/fw_update.py |
import network
# Init wlan module in Download mode.
wlan = network.WINC(True)
#print("Firmware version:", wlan.fw_version())
# Start the firmware update process.
wlan.fw_update()
#print("Firmware version:", wlan.fw_version())
|
import network
# Init wlan module in Download mode.
wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE)
print("Firmware version:", wlan.fw_version())
# Start the firmware update process.
wlan.fw_update()
print("Firmware version:", wlan.fw_version())
| Fix WINC fw update script. | Fix WINC fw update script.
| Python | mit | iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,openmv/openmv | python | ## Code Before:
import network
# Init wlan module in Download mode.
wlan = network.WINC(True)
#print("Firmware version:", wlan.fw_version())
# Start the firmware update process.
wlan.fw_update()
#print("Firmware version:", wlan.fw_version())
## Instruction:
Fix WINC fw update script.
## Code After:
import network
# Init wlan module in Download mode.
wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE)
print("Firmware version:", wlan.fw_version())
# Start the firmware update process.
wlan.fw_update()
print("Firmware version:", wlan.fw_version())
|
import network
# Init wlan module in Download mode.
- wlan = network.WINC(True)
+ wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE)
- #print("Firmware version:", wlan.fw_version())
? -
+ print("Firmware version:", wlan.fw_version())
# Start the firmware update process.
wlan.fw_update()
- #print("Firmware version:", wlan.fw_version())
? -
+ print("Firmware version:", wlan.fw_version()) | 6 | 0.6 | 3 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.