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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cfa162b83303ed359c04977d602b03c79102f5fc | acg/acg-disp.js | acg/acg-disp.js | var acg = acg || {};
var cc = cc || {};
acg.bootstrap = function (elem, callback) {
'use strict';
cc.game.onStart = function () {
cc.view.adjustViewPort(true);
if (cc.sys.isMobile) {
cc.view.setDesignResolutionSize(480, 320, cc.ResolutionPolicy.FIXED_WIDTH);
} else {
cc.view.setDesignResolutionSize(480, 320, cc.ResolutionPolicy.SHOW_ALL);
}
cc.view.resizeWithBrowserSize(true);
cc.director.setDisplayStats(true);
cc.director.runScene(new cc.Scene());
};
cc.game.run(elem);
// Wait until the director is ready, and then call the function
if (callback) {
var timer = setInterval(function () {
if (cc.director && cc.director.getRunningScene()) {
clearInterval(timer);
callback();
}
}, 300);
}
};
| var acg = acg || {};
var cc = cc || {};
acg.bootstrap = function (elem, aspect_ratio, callback) {
'use strict';
cc.game.onStart = function () {
cc.view.adjustViewPort(true);
cc.view.setDesignResolutionSize(320 * aspect_ratio, 320, cc.ResolutionPolicy.SHOW_ALL);
cc.view.resizeWithBrowserSize(true);
cc.director.setDisplayStats(true);
cc.director.runScene(new cc.Scene());
};
cc.game.run(elem);
// Wait until the director is ready, and then call the function
if (callback) {
var timer = setInterval(function () {
if (cc.director && cc.director.getRunningScene()) {
clearInterval(timer);
callback();
}
}, 300);
}
};
| Fix aspect ratio and add an option to change it | Fix aspect ratio and add an option to change it
Fixed: The canvas fills the whole browser on mobile phones. | JavaScript | mit | hhjvi/acg.js,hhjvi/acg.js | javascript | ## Code Before:
var acg = acg || {};
var cc = cc || {};
acg.bootstrap = function (elem, callback) {
'use strict';
cc.game.onStart = function () {
cc.view.adjustViewPort(true);
if (cc.sys.isMobile) {
cc.view.setDesignResolutionSize(480, 320, cc.ResolutionPolicy.FIXED_WIDTH);
} else {
cc.view.setDesignResolutionSize(480, 320, cc.ResolutionPolicy.SHOW_ALL);
}
cc.view.resizeWithBrowserSize(true);
cc.director.setDisplayStats(true);
cc.director.runScene(new cc.Scene());
};
cc.game.run(elem);
// Wait until the director is ready, and then call the function
if (callback) {
var timer = setInterval(function () {
if (cc.director && cc.director.getRunningScene()) {
clearInterval(timer);
callback();
}
}, 300);
}
};
## Instruction:
Fix aspect ratio and add an option to change it
Fixed: The canvas fills the whole browser on mobile phones.
## Code After:
var acg = acg || {};
var cc = cc || {};
acg.bootstrap = function (elem, aspect_ratio, callback) {
'use strict';
cc.game.onStart = function () {
cc.view.adjustViewPort(true);
cc.view.setDesignResolutionSize(320 * aspect_ratio, 320, cc.ResolutionPolicy.SHOW_ALL);
cc.view.resizeWithBrowserSize(true);
cc.director.setDisplayStats(true);
cc.director.runScene(new cc.Scene());
};
cc.game.run(elem);
// Wait until the director is ready, and then call the function
if (callback) {
var timer = setInterval(function () {
if (cc.director && cc.director.getRunningScene()) {
clearInterval(timer);
callback();
}
}, 300);
}
};
| var acg = acg || {};
var cc = cc || {};
- acg.bootstrap = function (elem, callback) {
+ acg.bootstrap = function (elem, aspect_ratio, callback) {
? ++++++++++++++
'use strict';
cc.game.onStart = function () {
cc.view.adjustViewPort(true);
- if (cc.sys.isMobile) {
- cc.view.setDesignResolutionSize(480, 320, cc.ResolutionPolicy.FIXED_WIDTH);
- } else {
- cc.view.setDesignResolutionSize(480, 320, cc.ResolutionPolicy.SHOW_ALL);
? ---- ^^
+ cc.view.setDesignResolutionSize(320 * aspect_ratio, 320, cc.ResolutionPolicy.SHOW_ALL);
? ^^ +++++++++++++++
- }
cc.view.resizeWithBrowserSize(true);
cc.director.setDisplayStats(true);
cc.director.runScene(new cc.Scene());
};
cc.game.run(elem);
// Wait until the director is ready, and then call the function
if (callback) {
var timer = setInterval(function () {
if (cc.director && cc.director.getRunningScene()) {
clearInterval(timer);
callback();
}
}, 300);
}
}; | 8 | 0.296296 | 2 | 6 |
87152787d3c4d1c3034f86f773bfb4f72330e221 | README.md | README.md | [](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/js/primeicons)
[](https://gitter.im/primefaces/primeicons?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
---

Font Icon Library for Prime UI Libraries: [PrimeNG](https://www.primefaces.org/primeng/#/icons/) | [PrimeReact](https://www.primefaces.org/primereact/#/icons/) | [PrimeFaces](http://primefaces.org/showcase/ui/misc/primeicons.xhtml)
---

| [](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/js/primeicons)
[](https://gitter.im/primefaces/primeicons?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
---

Font Icon Library for Prime UI Libraries: [PrimeNG](https://www.primefaces.org/primeng/#/icons/) | [PrimeReact](https://www.primefaces.org/primereact/#/icons/) | [PrimeFaces](https://primefaces.org/showcase/ui/misc/primeicons.xhtml) | [PrimeVue](https://primefaces.org/primevue/#/icons)
---

| Update icons & Add PrimeVue | Update icons & Add PrimeVue | Markdown | mit | primefaces/primeicons,primefaces/primeicons | markdown | ## Code Before:
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/js/primeicons)
[](https://gitter.im/primefaces/primeicons?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
---

Font Icon Library for Prime UI Libraries: [PrimeNG](https://www.primefaces.org/primeng/#/icons/) | [PrimeReact](https://www.primefaces.org/primereact/#/icons/) | [PrimeFaces](http://primefaces.org/showcase/ui/misc/primeicons.xhtml)
---

## Instruction:
Update icons & Add PrimeVue
## Code After:
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/js/primeicons)
[](https://gitter.im/primefaces/primeicons?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
---

Font Icon Library for Prime UI Libraries: [PrimeNG](https://www.primefaces.org/primeng/#/icons/) | [PrimeReact](https://www.primefaces.org/primereact/#/icons/) | [PrimeFaces](https://primefaces.org/showcase/ui/misc/primeicons.xhtml) | [PrimeVue](https://primefaces.org/primevue/#/icons)
---

| [](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/js/primeicons)
[](https://gitter.im/primefaces/primeicons?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
---
- 
? ^^^ ^^^^
+ 
? ^^^^^^^^^^ ^^^^
- Font Icon Library for Prime UI Libraries: [PrimeNG](https://www.primefaces.org/primeng/#/icons/) | [PrimeReact](https://www.primefaces.org/primereact/#/icons/) | [PrimeFaces](http://primefaces.org/showcase/ui/misc/primeicons.xhtml)
+ Font Icon Library for Prime UI Libraries: [PrimeNG](https://www.primefaces.org/primeng/#/icons/) | [PrimeReact](https://www.primefaces.org/primereact/#/icons/) | [PrimeFaces](https://primefaces.org/showcase/ui/misc/primeicons.xhtml) | [PrimeVue](https://primefaces.org/primevue/#/icons)
? + +++++++++++++++++++++++++++++++++++++++++++++++++++++++
---
- 
? ^^^ ^ ^^ ^ ^ ^
+ 
? ^^^^^ ^^ ^^^^ ^ ^ ^
| 6 | 0.461538 | 3 | 3 |
6e69d42d346df0d7673cadeb430a495935c80984 | himan-tests/precipitation-rate/harmonie.sh | himan-tests/precipitation-rate/harmonie.sh |
set -x
if [ -z "$HIMAN" ]; then
export HIMAN="../../himan-bin/build/release/himan"
fi
#rm -f RHO-KGM3*.grib ABS*.grib
$HIMAN -d 4 -f absolute_humidity_harmonie.json -t grib harmonie_p_source.grib harmonie_t_source.grib harmonie_rain_source.grib harmonie_snow_source.grib harmonie_graupel_source.grib
grib_compare ./ABSH-KGM3_hybrid_60_rll_290_594_0_360.grib harmonie_result.grib
VAR_1=$?
if [ $VAR_1 -eq 0 ];then
echo absolute_humidity/harmonie success on CPU!
else
echo absolute_humidity/harmonie failed on CPU
exit 1
fi
#rm -f RHO-KGM3*.grib RRR*.grib
|
set -x
if [ -z "$HIMAN" ]; then
export HIMAN="../../himan-bin/build/release/himan"
fi
rm -f R*.grib
$HIMAN -d 4 -f precipitation_rate_harmonie.json -t grib harmonie_p_source.grib harmonie_t_source.grib harmonie_rain_source.grib harmonie_snow_source.grib harmonie_graupel_source.grib
grib_compare ./RSI-KGM2_hybrid_60_rll_290_594_0_360.grib result_solidpr_harmonie.grib
VAR_1=$?
grib_compare ./RRI-KGM2_hybrid_60_rll_290_594_0_360.grib result_rain_harmonie.grib
VAR_2=$?
if [ $VAR_1 -eq 0 -a $VAR_2 -eq 0 ];then
echo precipitation-rate/harmonie success on CPU!
else
echo precipitation-rate/harmonie failed on CPU
exit 1
fi
rm -f R*.grib R*.grib
| Test suite contained script for absolute_humidity instead of precipitation rate. File replaced by correct one. | Test suite contained script for absolute_humidity instead of precipitation rate. File replaced by correct one.
| Shell | mit | fmidev/himan,fmidev/himan,fmidev/himan | shell | ## Code Before:
set -x
if [ -z "$HIMAN" ]; then
export HIMAN="../../himan-bin/build/release/himan"
fi
#rm -f RHO-KGM3*.grib ABS*.grib
$HIMAN -d 4 -f absolute_humidity_harmonie.json -t grib harmonie_p_source.grib harmonie_t_source.grib harmonie_rain_source.grib harmonie_snow_source.grib harmonie_graupel_source.grib
grib_compare ./ABSH-KGM3_hybrid_60_rll_290_594_0_360.grib harmonie_result.grib
VAR_1=$?
if [ $VAR_1 -eq 0 ];then
echo absolute_humidity/harmonie success on CPU!
else
echo absolute_humidity/harmonie failed on CPU
exit 1
fi
#rm -f RHO-KGM3*.grib RRR*.grib
## Instruction:
Test suite contained script for absolute_humidity instead of precipitation rate. File replaced by correct one.
## Code After:
set -x
if [ -z "$HIMAN" ]; then
export HIMAN="../../himan-bin/build/release/himan"
fi
rm -f R*.grib
$HIMAN -d 4 -f precipitation_rate_harmonie.json -t grib harmonie_p_source.grib harmonie_t_source.grib harmonie_rain_source.grib harmonie_snow_source.grib harmonie_graupel_source.grib
grib_compare ./RSI-KGM2_hybrid_60_rll_290_594_0_360.grib result_solidpr_harmonie.grib
VAR_1=$?
grib_compare ./RRI-KGM2_hybrid_60_rll_290_594_0_360.grib result_rain_harmonie.grib
VAR_2=$?
if [ $VAR_1 -eq 0 -a $VAR_2 -eq 0 ];then
echo precipitation-rate/harmonie success on CPU!
else
echo precipitation-rate/harmonie failed on CPU
exit 1
fi
rm -f R*.grib R*.grib
|
set -x
if [ -z "$HIMAN" ]; then
export HIMAN="../../himan-bin/build/release/himan"
fi
- #rm -f RHO-KGM3*.grib ABS*.grib
+ rm -f R*.grib
- $HIMAN -d 4 -f absolute_humidity_harmonie.json -t grib harmonie_p_source.grib harmonie_t_source.grib harmonie_rain_source.grib harmonie_snow_source.grib harmonie_graupel_source.grib
? ^^ ^^ ---------
+ $HIMAN -d 4 -f precipitation_rate_harmonie.json -t grib harmonie_p_source.grib harmonie_t_source.grib harmonie_rain_source.grib harmonie_snow_source.grib harmonie_graupel_source.grib
? ++++++++ ^^ ^^^^
- grib_compare ./ABSH-KGM3_hybrid_60_rll_290_594_0_360.grib harmonie_result.grib
? ^^ ^ ^ -------
+ grib_compare ./RSI-KGM2_hybrid_60_rll_290_594_0_360.grib result_solidpr_harmonie.grib
? ^ ^ ^ +++++++++++++++
VAR_1=$?
+ grib_compare ./RRI-KGM2_hybrid_60_rll_290_594_0_360.grib result_rain_harmonie.grib
+ VAR_2=$?
- if [ $VAR_1 -eq 0 ];then
+ if [ $VAR_1 -eq 0 -a $VAR_2 -eq 0 ];then
? ++++++++++++++++
- echo absolute_humidity/harmonie success on CPU!
+ echo precipitation-rate/harmonie success on CPU!
else
- echo absolute_humidity/harmonie failed on CPU
+ echo precipitation-rate/harmonie failed on CPU
exit 1
fi
- #rm -f RHO-KGM3*.grib RRR*.grib
? - ------- --
+ rm -f R*.grib R*.grib | 16 | 0.727273 | 9 | 7 |
54c3e93acdabc9d0d17d920d070a54fb1ea67ffb | .travis.yml | .travis.yml | language: node_js
node_js:
- "0.10.29"
before_install:
- "npm install -g gulp bower"
before_script:
- "npm install"
- "bundle install"
- "bower install"
script:
- "gulp clean"
- "gulp build"
after_success:
- "gulp js:test:report:coveralls"
after_script:
-
notifications:
email: false
| language: node_js
node_js:
- "0.10.29"
before_install:
- "npm install -g gulp bower"
before_script:
- "npm install"
- "bundle install"
- "bower install"
script:
- "gulp clean"
- "gulp build"
after_success:
- "gulp script:test:report"
after_script:
-
notifications:
email: false
| Use correct Coveralls task name. | Use correct Coveralls task name.
| YAML | mit | rishabhsrao/remember,rishabhsrao/remember,rishabhsrao/remember | yaml | ## Code Before:
language: node_js
node_js:
- "0.10.29"
before_install:
- "npm install -g gulp bower"
before_script:
- "npm install"
- "bundle install"
- "bower install"
script:
- "gulp clean"
- "gulp build"
after_success:
- "gulp js:test:report:coveralls"
after_script:
-
notifications:
email: false
## Instruction:
Use correct Coveralls task name.
## Code After:
language: node_js
node_js:
- "0.10.29"
before_install:
- "npm install -g gulp bower"
before_script:
- "npm install"
- "bundle install"
- "bower install"
script:
- "gulp clean"
- "gulp build"
after_success:
- "gulp script:test:report"
after_script:
-
notifications:
email: false
| language: node_js
node_js:
- "0.10.29"
before_install:
- "npm install -g gulp bower"
before_script:
- "npm install"
- "bundle install"
- "bower install"
script:
- "gulp clean"
- "gulp build"
after_success:
- - "gulp js:test:report:coveralls"
? - ----------
+ - "gulp script:test:report"
? +++++
after_script:
-
notifications:
email: false | 2 | 0.111111 | 1 | 1 |
7069cae39e5619276e598b76bdd3b27cc556650b | app/assets/javascripts/components/inline_edit_text.js.coffee | app/assets/javascripts/components/inline_edit_text.js.coffee | ETahi.InlineEditTextComponent = Em.Component.extend
editing: false
hasNoContent: (->
Em.isEmpty(@get('bodyPart.value'))
).property('bodyPart.value')
focusOnEdit: (->
if @get('editing')
Em.run.schedule 'afterRender', @, ->
@$('textarea').focus()
).observes('editing')
actions:
toggleEdit: ->
if @get('isNew')
@set('bodyPart', null)
else
@get('model').rollback()
@toggleProperty 'editing'
save: ->
unless @get('hasNoContent')
if @get('isNew')
@get('model.body').pushObject(@get('bodyPart'))
@set('bodyPart', null)
@get('model').save()
@toggleProperty 'editing'
| ETahi.InlineEditTextComponent = Em.Component.extend
editing: false
isNew: false
hasNoContent: (->
Em.isEmpty(@get('bodyPart.value'))
).property('bodyPart.value')
focusOnEdit: (->
if @get('editing')
Em.run.schedule 'afterRender', @, ->
@$('textarea').focus()
).observes('editing')
actions:
toggleEdit: ->
if @get('isNew')
@set('bodyPart', null)
else
@get('model').rollback()
@toggleProperty 'editing'
save: ->
unless @get('hasNoContent')
if @get('isNew')
@get('model.body').pushObject(@get('bodyPart'))
@set('bodyPart', null)
@get('model').save()
@toggleProperty 'editing'
| Set isNew to illustrate possible attribute assignments | Set isNew to illustrate possible attribute assignments | CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi | coffeescript | ## Code Before:
ETahi.InlineEditTextComponent = Em.Component.extend
editing: false
hasNoContent: (->
Em.isEmpty(@get('bodyPart.value'))
).property('bodyPart.value')
focusOnEdit: (->
if @get('editing')
Em.run.schedule 'afterRender', @, ->
@$('textarea').focus()
).observes('editing')
actions:
toggleEdit: ->
if @get('isNew')
@set('bodyPart', null)
else
@get('model').rollback()
@toggleProperty 'editing'
save: ->
unless @get('hasNoContent')
if @get('isNew')
@get('model.body').pushObject(@get('bodyPart'))
@set('bodyPart', null)
@get('model').save()
@toggleProperty 'editing'
## Instruction:
Set isNew to illustrate possible attribute assignments
## Code After:
ETahi.InlineEditTextComponent = Em.Component.extend
editing: false
isNew: false
hasNoContent: (->
Em.isEmpty(@get('bodyPart.value'))
).property('bodyPart.value')
focusOnEdit: (->
if @get('editing')
Em.run.schedule 'afterRender', @, ->
@$('textarea').focus()
).observes('editing')
actions:
toggleEdit: ->
if @get('isNew')
@set('bodyPart', null)
else
@get('model').rollback()
@toggleProperty 'editing'
save: ->
unless @get('hasNoContent')
if @get('isNew')
@get('model.body').pushObject(@get('bodyPart'))
@set('bodyPart', null)
@get('model').save()
@toggleProperty 'editing'
| ETahi.InlineEditTextComponent = Em.Component.extend
editing: false
+ isNew: false
+
hasNoContent: (->
Em.isEmpty(@get('bodyPart.value'))
).property('bodyPart.value')
focusOnEdit: (->
if @get('editing')
Em.run.schedule 'afterRender', @, ->
@$('textarea').focus()
).observes('editing')
actions:
toggleEdit: ->
if @get('isNew')
@set('bodyPart', null)
else
@get('model').rollback()
@toggleProperty 'editing'
save: ->
unless @get('hasNoContent')
if @get('isNew')
@get('model.body').pushObject(@get('bodyPart'))
@set('bodyPart', null)
@get('model').save()
@toggleProperty 'editing' | 2 | 0.074074 | 2 | 0 |
2bfcd96325b8f0a677658a13440c7ac0066915e2 | include/stm8_gpio.h | include/stm8_gpio.h |
typedef enum {
PORT_A = PA_ODR,
PORT_B = PB_ODR,
PORT_C = PB_,
PORT_D,
PORT_E,
PORT_F
} port_t;
void toggle_port_a_pin(uint8_t pin);
void set_high_port_a_pin(uint8_t pin);
void set_low_port_a_pin(uint8_t pin);
void set
|
struct input_pin_config
{
bool pull_up_enable;
bool interrupt_enable;
};
struct output_pin_config
{
bool open_drain_enable;
bool fast_mode_enable;
};
inline void set_port_a(uint8_t value)
{
PA_ODR = value;
}
inline void toggle_port_a_pin(uint8_t pin)
{
set_port_a((*(uart16_t *) PA_ODR) ^ ~(1 << pin));
}
inline void set_high_port_a_pin(uint8_t pin)
{
set_port_a((*(uint16_t *) PA_ODR) | (1 << pin));
}
inline void set_low_port_a_pin(uint8_t pin)
{
set_port_a((*(uart16_t *) PA_ODR) & ~(1 << pin));
}
inline void read_port_a(uint8_t * value)
{
&value = (uint16_t *) PA_IDR;
}
inline bool read_port_a_pin(uint8_t pin)
{
uint8_t value;
read_port_a_pin(value);
return value >> pin;
}
inline void configure_port_a_input_pin(struct input_pin_config * config);
inline void configure_port_a_output_pin(struct output_pin_config * config);
| Add some inline functions for configuring gpio. | Add some inline functions for configuring gpio.
| C | mit | tderensis/stm8_lib,tderensis/stm8_lib | c | ## Code Before:
typedef enum {
PORT_A = PA_ODR,
PORT_B = PB_ODR,
PORT_C = PB_,
PORT_D,
PORT_E,
PORT_F
} port_t;
void toggle_port_a_pin(uint8_t pin);
void set_high_port_a_pin(uint8_t pin);
void set_low_port_a_pin(uint8_t pin);
void set
## Instruction:
Add some inline functions for configuring gpio.
## Code After:
struct input_pin_config
{
bool pull_up_enable;
bool interrupt_enable;
};
struct output_pin_config
{
bool open_drain_enable;
bool fast_mode_enable;
};
inline void set_port_a(uint8_t value)
{
PA_ODR = value;
}
inline void toggle_port_a_pin(uint8_t pin)
{
set_port_a((*(uart16_t *) PA_ODR) ^ ~(1 << pin));
}
inline void set_high_port_a_pin(uint8_t pin)
{
set_port_a((*(uint16_t *) PA_ODR) | (1 << pin));
}
inline void set_low_port_a_pin(uint8_t pin)
{
set_port_a((*(uart16_t *) PA_ODR) & ~(1 << pin));
}
inline void read_port_a(uint8_t * value)
{
&value = (uint16_t *) PA_IDR;
}
inline bool read_port_a_pin(uint8_t pin)
{
uint8_t value;
read_port_a_pin(value);
return value >> pin;
}
inline void configure_port_a_input_pin(struct input_pin_config * config);
inline void configure_port_a_output_pin(struct output_pin_config * config);
|
+ struct input_pin_config
+ {
+ bool pull_up_enable;
+ bool interrupt_enable;
+ };
- typedef enum {
- PORT_A = PA_ODR,
- PORT_B = PB_ODR,
- PORT_C = PB_,
- PORT_D,
- PORT_E,
- PORT_F
- } port_t;
+ struct output_pin_config
+ {
+ bool open_drain_enable;
+ bool fast_mode_enable;
+ };
+
+ inline void set_port_a(uint8_t value)
+ {
+ PA_ODR = value;
+ }
+
- void toggle_port_a_pin(uint8_t pin);
? -
+ inline void toggle_port_a_pin(uint8_t pin)
? +++++++
+ {
+ set_port_a((*(uart16_t *) PA_ODR) ^ ~(1 << pin));
+ }
+
- void set_high_port_a_pin(uint8_t pin);
? -
+ inline void set_high_port_a_pin(uint8_t pin)
? +++++++
+ {
+ set_port_a((*(uint16_t *) PA_ODR) | (1 << pin));
+ }
+
- void set_low_port_a_pin(uint8_t pin);
? -
+ inline void set_low_port_a_pin(uint8_t pin)
? +++++++
- void set
+ {
+ set_port_a((*(uart16_t *) PA_ODR) & ~(1 << pin));
+ }
+
+ inline void read_port_a(uint8_t * value)
+ {
+ &value = (uint16_t *) PA_IDR;
+ }
+
+ inline bool read_port_a_pin(uint8_t pin)
+ {
+ uint8_t value;
+ read_port_a_pin(value);
+ return value >> pin;
+ }
+
+ inline void configure_port_a_input_pin(struct input_pin_config * config);
+ inline void configure_port_a_output_pin(struct output_pin_config * config); | 57 | 4.071429 | 45 | 12 |
fb982d8b58f9857403ed0e73056a384c5b9a7351 | app/stylesheets/components/_conditional_release.scss | app/stylesheets/components/_conditional_release.scss | .conditional-release-editor {
padding-top: 12px;
}
.conditional-release-editor-layout {
width: 90% !important;
height: 90% !important;
display: flex;
flex-direction: column;
}
.conditional-release-editor-body {
flex: 1 1 auto;
display: flex;
}
.conditional-release-editor-frame {
border: none;
flex: 1 1 auto;
}
.conditional-release-save-data {
padding: 12px 0px;
}
| .conditional-release-editor {
padding-top: 12px;
}
.conditional-release-editor-layout {
width: 90% !important;
height: 90% !important;
display: flex;
flex-direction: column;
}
.conditional-release-editor-body {
flex: 1 1 auto;
display: flex;
}
.conditional-release-editor-frame {
border: none;
flex: 1 1 auto;
min-height: 100%;
}
.conditional-release-save-data {
padding: 12px 0px;
}
| Fix frame size bug in IE and EDGE Browser | Fix frame size bug in IE and EDGE Browser
refs: CYOE-192
Test Plan:
* Check to see if CYOE Modal deploys correctly on all browsers
Change-Id: Iae385ea0a275af9706ff417bbfb3e6bd3d72552d
Reviewed-on: https://gerrit.instructure.com/82032
Tested-by: Jenkins
Reviewed-by: Michael Brewer-Davis <785693f4c81267e5b88c0f98d39b56a39a2b6910@instructure.com>
Reviewed-by: Dan Minkevitch <2591e5f46f28d303f9dc027d475a5c60d8dea17a@instructure.com>
QA-Review: Jahnavi Yetukuri <ed2b2672ccc2e59e56c0615df7f01b579202e014@instructure.com>
Product-Review: Dan Minkevitch <2591e5f46f28d303f9dc027d475a5c60d8dea17a@instructure.com>
| SCSS | agpl-3.0 | instructure/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,matematikk-mooc/canvas-lms,sfu/canvas-lms,djbender/canvas-lms,matematikk-mooc/canvas-lms,SwinburneOnline/canvas-lms,instructure/canvas-lms,instructure/canvas-lms,SwinburneOnline/canvas-lms,sfu/canvas-lms,grahamb/canvas-lms,HotChalk/canvas-lms,grahamb/canvas-lms,dgynn/canvas-lms,sfu/canvas-lms,grahamb/canvas-lms,instructure/canvas-lms,venturehive/canvas-lms,sfu/canvas-lms,grahamb/canvas-lms,HotChalk/canvas-lms,djbender/canvas-lms,fronteerio/canvas-lms,dgynn/canvas-lms,grahamb/canvas-lms,fronteerio/canvas-lms,venturehive/canvas-lms,dgynn/canvas-lms,matematikk-mooc/canvas-lms,venturehive/canvas-lms,dgynn/canvas-lms,sfu/canvas-lms,djbender/canvas-lms,HotChalk/canvas-lms,fronteerio/canvas-lms,instructure/canvas-lms,SwinburneOnline/canvas-lms,fronteerio/canvas-lms,HotChalk/canvas-lms,sfu/canvas-lms,SwinburneOnline/canvas-lms,venturehive/canvas-lms,instructure/canvas-lms,matematikk-mooc/canvas-lms,djbender/canvas-lms | scss | ## Code Before:
.conditional-release-editor {
padding-top: 12px;
}
.conditional-release-editor-layout {
width: 90% !important;
height: 90% !important;
display: flex;
flex-direction: column;
}
.conditional-release-editor-body {
flex: 1 1 auto;
display: flex;
}
.conditional-release-editor-frame {
border: none;
flex: 1 1 auto;
}
.conditional-release-save-data {
padding: 12px 0px;
}
## Instruction:
Fix frame size bug in IE and EDGE Browser
refs: CYOE-192
Test Plan:
* Check to see if CYOE Modal deploys correctly on all browsers
Change-Id: Iae385ea0a275af9706ff417bbfb3e6bd3d72552d
Reviewed-on: https://gerrit.instructure.com/82032
Tested-by: Jenkins
Reviewed-by: Michael Brewer-Davis <785693f4c81267e5b88c0f98d39b56a39a2b6910@instructure.com>
Reviewed-by: Dan Minkevitch <2591e5f46f28d303f9dc027d475a5c60d8dea17a@instructure.com>
QA-Review: Jahnavi Yetukuri <ed2b2672ccc2e59e56c0615df7f01b579202e014@instructure.com>
Product-Review: Dan Minkevitch <2591e5f46f28d303f9dc027d475a5c60d8dea17a@instructure.com>
## Code After:
.conditional-release-editor {
padding-top: 12px;
}
.conditional-release-editor-layout {
width: 90% !important;
height: 90% !important;
display: flex;
flex-direction: column;
}
.conditional-release-editor-body {
flex: 1 1 auto;
display: flex;
}
.conditional-release-editor-frame {
border: none;
flex: 1 1 auto;
min-height: 100%;
}
.conditional-release-save-data {
padding: 12px 0px;
}
| .conditional-release-editor {
padding-top: 12px;
}
.conditional-release-editor-layout {
width: 90% !important;
height: 90% !important;
display: flex;
flex-direction: column;
}
.conditional-release-editor-body {
flex: 1 1 auto;
display: flex;
}
.conditional-release-editor-frame {
border: none;
flex: 1 1 auto;
+ min-height: 100%;
}
.conditional-release-save-data {
padding: 12px 0px;
} | 1 | 0.041667 | 1 | 0 |
06ec1637a3f955764d3bcd0cea46fc0bb6a7793b | metadata.rb | metadata.rb | maintainer "Peter Donald"
maintainer_email "peter@realityforge.org"
license "Apache 2.0"
description "Installs/Configures logstash in agent mode"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.1"
depends "java"
depends 'authbind'
| maintainer 'Peter Donald'
maintainer_email 'peter@realityforge.org'
license 'Apache 2.0'
description 'Installs/Configures logstash in agent mode'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.0.1'
depends 'java'
depends 'authbind'
| Use string literals where possible | Use string literals where possible
| Ruby | apache-2.0 | realityforge/chef-logstash | ruby | ## Code Before:
maintainer "Peter Donald"
maintainer_email "peter@realityforge.org"
license "Apache 2.0"
description "Installs/Configures logstash in agent mode"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.1"
depends "java"
depends 'authbind'
## Instruction:
Use string literals where possible
## Code After:
maintainer 'Peter Donald'
maintainer_email 'peter@realityforge.org'
license 'Apache 2.0'
description 'Installs/Configures logstash in agent mode'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.0.1'
depends 'java'
depends 'authbind'
| - maintainer "Peter Donald"
? ^ ^
+ maintainer 'Peter Donald'
? ^ ^
- maintainer_email "peter@realityforge.org"
? ^ ^
+ maintainer_email 'peter@realityforge.org'
? ^ ^
- license "Apache 2.0"
? ^ ^
+ license 'Apache 2.0'
? ^ ^
- description "Installs/Configures logstash in agent mode"
? ^ ^
+ description 'Installs/Configures logstash in agent mode'
? ^ ^
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
- version "0.0.1"
? ^ ^
+ version '0.0.1'
? ^ ^
- depends "java"
? ^ ^
+ depends 'java'
? ^ ^
depends 'authbind' | 12 | 1.333333 | 6 | 6 |
2c7b58bea8d49075710f9abed5331c5586576fec | core/app/models/global_feed.rb | core/app/models/global_feed.rb | require 'singleton'
class GlobalFeed
include Singleton
def initialize
@key = Nest.new(:global_feed)
end
def first
self
end
def self.where(ignored_id)
# to support listeners created in create_listeners this class must behave as if it were a
# non-singleton because Listener.process always looks up the instance by "id"
instance
end
def all_activities
key = @key[:all_activities]
TimestampedSet.new(key, Activity)
end
def all_discussions
key = @key[:all_discussions]
Ohm::Model::TimestampedSet.new(key, Ohm::Model::Wrapper.wrap(Activity))
end
end
| require 'singleton'
class GlobalFeed
include Singleton
def initialize
@key = Nest.new(:global_feed)
end
def first
self
end
def self.where(ignored_id)
# to support listeners created in create_listeners this class must behave as if it were a
# non-singleton because Listener.process always looks up the instance by "id"
instance
end
def all_activities
key = @key[:all_activities]
TimestampedSet.new(key, Activity)
end
def all_discussions
key = @key[:all_discussions]
TimestampedSet.new(key, Activity)
end
end
| Fix semantic merge conflict: no more our ohm | Fix semantic merge conflict: no more our ohm
| Ruby | mit | Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core | ruby | ## Code Before:
require 'singleton'
class GlobalFeed
include Singleton
def initialize
@key = Nest.new(:global_feed)
end
def first
self
end
def self.where(ignored_id)
# to support listeners created in create_listeners this class must behave as if it were a
# non-singleton because Listener.process always looks up the instance by "id"
instance
end
def all_activities
key = @key[:all_activities]
TimestampedSet.new(key, Activity)
end
def all_discussions
key = @key[:all_discussions]
Ohm::Model::TimestampedSet.new(key, Ohm::Model::Wrapper.wrap(Activity))
end
end
## Instruction:
Fix semantic merge conflict: no more our ohm
## Code After:
require 'singleton'
class GlobalFeed
include Singleton
def initialize
@key = Nest.new(:global_feed)
end
def first
self
end
def self.where(ignored_id)
# to support listeners created in create_listeners this class must behave as if it were a
# non-singleton because Listener.process always looks up the instance by "id"
instance
end
def all_activities
key = @key[:all_activities]
TimestampedSet.new(key, Activity)
end
def all_discussions
key = @key[:all_discussions]
TimestampedSet.new(key, Activity)
end
end
| require 'singleton'
class GlobalFeed
include Singleton
def initialize
@key = Nest.new(:global_feed)
end
def first
self
end
def self.where(ignored_id)
# to support listeners created in create_listeners this class must behave as if it were a
# non-singleton because Listener.process always looks up the instance by "id"
instance
end
def all_activities
key = @key[:all_activities]
TimestampedSet.new(key, Activity)
end
def all_discussions
key = @key[:all_discussions]
- Ohm::Model::TimestampedSet.new(key, Ohm::Model::Wrapper.wrap(Activity))
+ TimestampedSet.new(key, Activity)
end
end | 2 | 0.066667 | 1 | 1 |
3f4f278362cd45fc248a0bc573800fc311b1ee03 | tests/phpunit/unit/Storage/FieldSetTest.php | tests/phpunit/unit/Storage/FieldSetTest.php | <?php
namespace Bolt\Tests\Storage;
use Bolt\Legacy\Storage;
use Bolt\Tests\BoltUnitTest;
/**
* Class to test src/Storage/Repository and field transforms for load and hydrate
*
* @author Ross Riley <riley.ross@gmail.com>
*/
class FieldSetTest extends BoltUnitTest
{
public function testSetWithNormalValues()
{
$app = $this->getApp();
$this->addSomeContent($app);
$em = $app['storage'];
$repo = $em->getRepository('showcases');
$entity = $repo->create(['title' => 'This is a title']);
$this->assertEquals('This is a title', $entity->getTitle());
}
public function testSetWithUpdatedValues()
{
$app = $this->getApp();
$em = $app['storage'];
$repo = $em->getRepository('pages');
$entity = $repo->find(1);
$entity->setTemplate('extrafields.twig');
$entity->setTemplateFields([
'section_1' => 'val1',
'image' => ['file' => 'path-to-image.jpg', 'title' => 'An awesome image']
]);
$repo->save($entity);
$entity2 = $repo->find(1);
$this->assertEquals('An awesome image', $entity2->templatefields->image['title']);
}
}
| <?php
namespace Bolt\Tests\Storage;
use Bolt\Legacy\Storage;
use Bolt\Tests\BoltUnitTest;
/**
* Class to test src/Storage/Repository and field transforms for load and hydrate
*
* @author Ross Riley <riley.ross@gmail.com>
*/
class FieldSetTest extends BoltUnitTest
{
public function testSetWithNormalValues()
{
$app = $this->getApp();
$this->addSomeContent($app);
$em = $app['storage'];
$repo = $em->getRepository('showcases');
$entity = $repo->create(['title' => 'This is a title']);
$this->assertEquals('This is a title', $entity->getTitle());
}
public function testSetWithUpdatedValues()
{
$this->markTestIncomplete('Test dying with: Invalid argument supplied for foreach()');
$app = $this->getApp();
$em = $app['storage'];
$repo = $em->getRepository('pages');
$entity = $repo->find(1);
$entity->setTemplate('extrafields.twig');
$entity->setTemplateFields([
'section_1' => 'val1',
'image' => ['file' => 'path-to-image.jpg', 'title' => 'An awesome image']
]);
$repo->save($entity);
$entity2 = $repo->find(1);
$this->assertEquals('An awesome image', $entity2->templatefields->image['title']);
}
}
| Disable template field test for now | [Tests] Disable template field test for now | PHP | mit | rossriley/bolt,bolt/bolt,electrolinux/bolt,joshuan/bolt,rarila/bolt,CarsonF/bolt,nantunes/bolt,Raistlfiren/bolt,bolt/bolt,one988/cm,nantunes/bolt,CarsonF/bolt,rarila/bolt,Raistlfiren/bolt,richardhinkamp/bolt,lenvanessen/bolt,Raistlfiren/bolt,cdowdy/bolt,joshuan/bolt,Intendit/bolt,one988/cm,GawainLynch/bolt,rarila/bolt,joshuan/bolt,rossriley/bolt,nikgo/bolt,nantunes/bolt,cdowdy/bolt,CarsonF/bolt,one988/cm,bolt/bolt,rossriley/bolt,GawainLynch/bolt,nikgo/bolt,Intendit/bolt,HonzaMikula/masivnipostele,HonzaMikula/masivnipostele,rossriley/bolt,cdowdy/bolt,richardhinkamp/bolt,richardhinkamp/bolt,lenvanessen/bolt,cdowdy/bolt,GawainLynch/bolt,electrolinux/bolt,rarila/bolt,bolt/bolt,romulo1984/bolt,joshuan/bolt,Intendit/bolt,romulo1984/bolt,CarsonF/bolt,HonzaMikula/masivnipostele,romulo1984/bolt,nantunes/bolt,one988/cm,Raistlfiren/bolt,GawainLynch/bolt,richardhinkamp/bolt,romulo1984/bolt,nikgo/bolt,lenvanessen/bolt,HonzaMikula/masivnipostele,electrolinux/bolt,nikgo/bolt,Intendit/bolt,electrolinux/bolt,lenvanessen/bolt | php | ## Code Before:
<?php
namespace Bolt\Tests\Storage;
use Bolt\Legacy\Storage;
use Bolt\Tests\BoltUnitTest;
/**
* Class to test src/Storage/Repository and field transforms for load and hydrate
*
* @author Ross Riley <riley.ross@gmail.com>
*/
class FieldSetTest extends BoltUnitTest
{
public function testSetWithNormalValues()
{
$app = $this->getApp();
$this->addSomeContent($app);
$em = $app['storage'];
$repo = $em->getRepository('showcases');
$entity = $repo->create(['title' => 'This is a title']);
$this->assertEquals('This is a title', $entity->getTitle());
}
public function testSetWithUpdatedValues()
{
$app = $this->getApp();
$em = $app['storage'];
$repo = $em->getRepository('pages');
$entity = $repo->find(1);
$entity->setTemplate('extrafields.twig');
$entity->setTemplateFields([
'section_1' => 'val1',
'image' => ['file' => 'path-to-image.jpg', 'title' => 'An awesome image']
]);
$repo->save($entity);
$entity2 = $repo->find(1);
$this->assertEquals('An awesome image', $entity2->templatefields->image['title']);
}
}
## Instruction:
[Tests] Disable template field test for now
## Code After:
<?php
namespace Bolt\Tests\Storage;
use Bolt\Legacy\Storage;
use Bolt\Tests\BoltUnitTest;
/**
* Class to test src/Storage/Repository and field transforms for load and hydrate
*
* @author Ross Riley <riley.ross@gmail.com>
*/
class FieldSetTest extends BoltUnitTest
{
public function testSetWithNormalValues()
{
$app = $this->getApp();
$this->addSomeContent($app);
$em = $app['storage'];
$repo = $em->getRepository('showcases');
$entity = $repo->create(['title' => 'This is a title']);
$this->assertEquals('This is a title', $entity->getTitle());
}
public function testSetWithUpdatedValues()
{
$this->markTestIncomplete('Test dying with: Invalid argument supplied for foreach()');
$app = $this->getApp();
$em = $app['storage'];
$repo = $em->getRepository('pages');
$entity = $repo->find(1);
$entity->setTemplate('extrafields.twig');
$entity->setTemplateFields([
'section_1' => 'val1',
'image' => ['file' => 'path-to-image.jpg', 'title' => 'An awesome image']
]);
$repo->save($entity);
$entity2 = $repo->find(1);
$this->assertEquals('An awesome image', $entity2->templatefields->image['title']);
}
}
| <?php
namespace Bolt\Tests\Storage;
use Bolt\Legacy\Storage;
use Bolt\Tests\BoltUnitTest;
/**
* Class to test src/Storage/Repository and field transforms for load and hydrate
*
* @author Ross Riley <riley.ross@gmail.com>
*/
class FieldSetTest extends BoltUnitTest
{
public function testSetWithNormalValues()
{
$app = $this->getApp();
$this->addSomeContent($app);
$em = $app['storage'];
$repo = $em->getRepository('showcases');
$entity = $repo->create(['title' => 'This is a title']);
$this->assertEquals('This is a title', $entity->getTitle());
}
public function testSetWithUpdatedValues()
{
+ $this->markTestIncomplete('Test dying with: Invalid argument supplied for foreach()');
+
$app = $this->getApp();
$em = $app['storage'];
$repo = $em->getRepository('pages');
$entity = $repo->find(1);
$entity->setTemplate('extrafields.twig');
$entity->setTemplateFields([
'section_1' => 'val1',
'image' => ['file' => 'path-to-image.jpg', 'title' => 'An awesome image']
]);
$repo->save($entity);
$entity2 = $repo->find(1);
$this->assertEquals('An awesome image', $entity2->templatefields->image['title']);
}
} | 2 | 0.04878 | 2 | 0 |
58c6e5c751d61bad6c3fd47c210764c21369988b | build.sbt | build.sbt | name := "constraints"
organization := "fr.laas.fape"
version := "0.8-SNAPSHOT"
scalacOptions ++= Seq("-deprecation", "-feature")
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5" % "test"
libraryDependencies ++= Seq(
"fr.laas.fape" %% "graphs" % "0.8-SNAPSHOT",
"fr.laas.fape" %% "anml-parser" % "0.8-SNAPSHOT",
"net.openhft" % "koloboke-api-jdk6-7" % "0.6.7",
"net.openhft" % "koloboke-impl-jdk6-7" % "0.6.7" % "runtime"
// "com.github.scala-blitz" %% "scala-blitz" % "1.1"
)
crossPaths := true | name := "constraints"
organization := "fr.laas.fape"
version := "0.8-SNAPSHOT"
resolvers += "FAPE Nightly Maven Repo" at "http://www.laas.fr/~abitmonn/maven/"
scalacOptions ++= Seq("-deprecation", "-feature")
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5" % "test"
libraryDependencies ++= Seq(
"fr.laas.fape" %% "graphs" % "0.8-SNAPSHOT",
"fr.laas.fape" %% "anml-parser" % "0.8-SNAPSHOT",
"net.openhft" % "koloboke-api-jdk6-7" % "0.6.7",
"net.openhft" % "koloboke-impl-jdk6-7" % "0.6.7" % "runtime"
// "com.github.scala-blitz" %% "scala-blitz" % "1.1"
)
crossPaths := true | Add fape nightly repository as dependency resolver | Add fape nightly repository as dependency resolver
| Scala | bsd-2-clause | athy/fape,athy/fape,athy/fape,athy/fape | scala | ## Code Before:
name := "constraints"
organization := "fr.laas.fape"
version := "0.8-SNAPSHOT"
scalacOptions ++= Seq("-deprecation", "-feature")
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5" % "test"
libraryDependencies ++= Seq(
"fr.laas.fape" %% "graphs" % "0.8-SNAPSHOT",
"fr.laas.fape" %% "anml-parser" % "0.8-SNAPSHOT",
"net.openhft" % "koloboke-api-jdk6-7" % "0.6.7",
"net.openhft" % "koloboke-impl-jdk6-7" % "0.6.7" % "runtime"
// "com.github.scala-blitz" %% "scala-blitz" % "1.1"
)
crossPaths := true
## Instruction:
Add fape nightly repository as dependency resolver
## Code After:
name := "constraints"
organization := "fr.laas.fape"
version := "0.8-SNAPSHOT"
resolvers += "FAPE Nightly Maven Repo" at "http://www.laas.fr/~abitmonn/maven/"
scalacOptions ++= Seq("-deprecation", "-feature")
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5" % "test"
libraryDependencies ++= Seq(
"fr.laas.fape" %% "graphs" % "0.8-SNAPSHOT",
"fr.laas.fape" %% "anml-parser" % "0.8-SNAPSHOT",
"net.openhft" % "koloboke-api-jdk6-7" % "0.6.7",
"net.openhft" % "koloboke-impl-jdk6-7" % "0.6.7" % "runtime"
// "com.github.scala-blitz" %% "scala-blitz" % "1.1"
)
crossPaths := true | name := "constraints"
organization := "fr.laas.fape"
version := "0.8-SNAPSHOT"
+
+ resolvers += "FAPE Nightly Maven Repo" at "http://www.laas.fr/~abitmonn/maven/"
scalacOptions ++= Seq("-deprecation", "-feature")
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5" % "test"
libraryDependencies ++= Seq(
"fr.laas.fape" %% "graphs" % "0.8-SNAPSHOT",
"fr.laas.fape" %% "anml-parser" % "0.8-SNAPSHOT",
"net.openhft" % "koloboke-api-jdk6-7" % "0.6.7",
"net.openhft" % "koloboke-impl-jdk6-7" % "0.6.7" % "runtime"
// "com.github.scala-blitz" %% "scala-blitz" % "1.1"
)
crossPaths := true | 2 | 0.105263 | 2 | 0 |
b854abad2a7f7bc49290360d369f761a53988213 | src/Modules/Content/Dnn.PersonaBar.Pages/Pages.Web/src/components/dnn-persona-bar-page-treeview/src/_PersonaBarPageIcon.jsx | src/Modules/Content/Dnn.PersonaBar.Pages/Pages.Web/src/components/dnn-persona-bar-page-treeview/src/_PersonaBarPageIcon.jsx | import React, {Component} from "react";
import { PropTypes } from "prop-types";
import "./styles.less";
import {PagesIcon, FolderIcon, TreeLinkIcon, TreeDraftIcon, TreePaperClip} from "dnn-svg-icons";
export default class PersonaBarPageIcon extends Component {
/* eslint-disable react/no-danger */
selectIcon(number) {
/*eslint-disable react/no-danger*/
switch(number) {
case "normal":
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }} />);
case "file":
return (<div dangerouslySetInnerHTML={{ __html: FolderIcon }} />);
case "tab":
case "url":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
case "existing":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
default:
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }}/>);
}
}
render() {
return (
<div className={(this.props.selected ) ? "dnn-persona-bar-treeview-icon selected-item " : "dnn-persona-bar-treeview-icon"}>
{this.selectIcon(this.props.iconType)}
</div>
);
}
}
PersonaBarPageIcon.propTypes = {
iconType: PropTypes.number.isRequired,
selected: PropTypes.bool.isRequired
}; | import React, {Component} from "react";
import { PropTypes } from "prop-types";
import "./styles.less";
import {PagesIcon, TreeLinkIcon, TreePaperClip} from "dnn-svg-icons";
export default class PersonaBarPageIcon extends Component {
/* eslint-disable react/no-danger */
selectIcon(number) {
/*eslint-disable react/no-danger*/
switch(number) {
case "normal":
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }} />);
case "file":
return (<div dangerouslySetInnerHTML={{ __html: TreePaperClip }} />);
case "tab":
case "url":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
case "existing":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
default:
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }}/>);
}
}
render() {
return (
<div className={(this.props.selected ) ? "dnn-persona-bar-treeview-icon selected-item " : "dnn-persona-bar-treeview-icon"}>
{this.selectIcon(this.props.iconType)}
</div>
);
}
}
PersonaBarPageIcon.propTypes = {
iconType: PropTypes.number.isRequired,
selected: PropTypes.bool.isRequired
}; | Change file icon from folder to clip | Change file icon from folder to clip
| JSX | mit | bdukes/Dnn.Platform,robsiera/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Extensions,nvisionative/Dnn.Platform,bdukes/Dnn.Platform,dnnsoftware/Dnn.Platform,RichardHowells/Dnn.Platform,valadas/Dnn.Platform,valadas/Dnn.Platform,valadas/Dnn.Platform,nvisionative/Dnn.Platform,RichardHowells/Dnn.Platform,RichardHowells/Dnn.Platform,valadas/Dnn.Platform,robsiera/Dnn.Platform,mitchelsellers/Dnn.Platform,bdukes/Dnn.Platform,mitchelsellers/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Extensions,robsiera/Dnn.Platform,dnnsoftware/Dnn.Platform,bdukes/Dnn.Platform,valadas/Dnn.Platform,mitchelsellers/Dnn.Platform,dnnsoftware/Dnn.Platform,mitchelsellers/Dnn.Platform,dnnsoftware/Dnn.Platform,RichardHowells/Dnn.Platform,EPTamminga/Dnn.Platform,EPTamminga/Dnn.Platform,EPTamminga/Dnn.Platform,dnnsoftware/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Extensions,mitchelsellers/Dnn.Platform,nvisionative/Dnn.Platform | jsx | ## Code Before:
import React, {Component} from "react";
import { PropTypes } from "prop-types";
import "./styles.less";
import {PagesIcon, FolderIcon, TreeLinkIcon, TreeDraftIcon, TreePaperClip} from "dnn-svg-icons";
export default class PersonaBarPageIcon extends Component {
/* eslint-disable react/no-danger */
selectIcon(number) {
/*eslint-disable react/no-danger*/
switch(number) {
case "normal":
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }} />);
case "file":
return (<div dangerouslySetInnerHTML={{ __html: FolderIcon }} />);
case "tab":
case "url":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
case "existing":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
default:
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }}/>);
}
}
render() {
return (
<div className={(this.props.selected ) ? "dnn-persona-bar-treeview-icon selected-item " : "dnn-persona-bar-treeview-icon"}>
{this.selectIcon(this.props.iconType)}
</div>
);
}
}
PersonaBarPageIcon.propTypes = {
iconType: PropTypes.number.isRequired,
selected: PropTypes.bool.isRequired
};
## Instruction:
Change file icon from folder to clip
## Code After:
import React, {Component} from "react";
import { PropTypes } from "prop-types";
import "./styles.less";
import {PagesIcon, TreeLinkIcon, TreePaperClip} from "dnn-svg-icons";
export default class PersonaBarPageIcon extends Component {
/* eslint-disable react/no-danger */
selectIcon(number) {
/*eslint-disable react/no-danger*/
switch(number) {
case "normal":
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }} />);
case "file":
return (<div dangerouslySetInnerHTML={{ __html: TreePaperClip }} />);
case "tab":
case "url":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
case "existing":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
default:
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }}/>);
}
}
render() {
return (
<div className={(this.props.selected ) ? "dnn-persona-bar-treeview-icon selected-item " : "dnn-persona-bar-treeview-icon"}>
{this.selectIcon(this.props.iconType)}
</div>
);
}
}
PersonaBarPageIcon.propTypes = {
iconType: PropTypes.number.isRequired,
selected: PropTypes.bool.isRequired
}; | import React, {Component} from "react";
import { PropTypes } from "prop-types";
import "./styles.less";
- import {PagesIcon, FolderIcon, TreeLinkIcon, TreeDraftIcon, TreePaperClip} from "dnn-svg-icons";
? ------------ ---------------
+ import {PagesIcon, TreeLinkIcon, TreePaperClip} from "dnn-svg-icons";
export default class PersonaBarPageIcon extends Component {
/* eslint-disable react/no-danger */
selectIcon(number) {
/*eslint-disable react/no-danger*/
switch(number) {
case "normal":
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }} />);
case "file":
- return (<div dangerouslySetInnerHTML={{ __html: FolderIcon }} />);
? ^^^^ ^^^^
+ return (<div dangerouslySetInnerHTML={{ __html: TreePaperClip }} />);
? ^^^^^^^ ^^^^
case "tab":
case "url":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
case "existing":
return ( <div dangerouslySetInnerHTML={{ __html: TreeLinkIcon }} /> );
default:
return (<div dangerouslySetInnerHTML={{ __html: PagesIcon }}/>);
}
}
render() {
return (
<div className={(this.props.selected ) ? "dnn-persona-bar-treeview-icon selected-item " : "dnn-persona-bar-treeview-icon"}>
{this.selectIcon(this.props.iconType)}
</div>
);
}
}
PersonaBarPageIcon.propTypes = {
iconType: PropTypes.number.isRequired,
selected: PropTypes.bool.isRequired
}; | 4 | 0.093023 | 2 | 2 |
74779335d568057dfc068fe7a5dc60beb26b5985 | _index.md | _index.md | +++
title = "Docs"
template = "sections/docs.html"
+++
Welcome to the documentation for the Urbit project, including the Azimuth identity layer, the Arvo operating system, and the Hoon programming language. This documentation is maintained by [Tlon](https://tlon.io) in a public [Github repository](https://github.com/urbit/docs). Issues and contributions are welcome.
Please make your way to the [Introduction](/docs/getting-started/) for an overview of the docs.
| +++
title = "Docs"
template = "sections/docs.html"
+++
Welcome to the documentation for the Urbit project, including the Azimuth identity layer, the Arvo operating system, and the Hoon programming language. This documentation is maintained by [Tlon](https://tlon.io) in a public [Github repository](https://github.com/urbit/docs). Issues and contributions are welcome.
| Remove reference to Introduction in unused index page | Remove reference to Introduction in unused index page | Markdown | mit | urbit/urbit.org | markdown | ## Code Before:
+++
title = "Docs"
template = "sections/docs.html"
+++
Welcome to the documentation for the Urbit project, including the Azimuth identity layer, the Arvo operating system, and the Hoon programming language. This documentation is maintained by [Tlon](https://tlon.io) in a public [Github repository](https://github.com/urbit/docs). Issues and contributions are welcome.
Please make your way to the [Introduction](/docs/getting-started/) for an overview of the docs.
## Instruction:
Remove reference to Introduction in unused index page
## Code After:
+++
title = "Docs"
template = "sections/docs.html"
+++
Welcome to the documentation for the Urbit project, including the Azimuth identity layer, the Arvo operating system, and the Hoon programming language. This documentation is maintained by [Tlon](https://tlon.io) in a public [Github repository](https://github.com/urbit/docs). Issues and contributions are welcome.
| +++
title = "Docs"
template = "sections/docs.html"
+++
Welcome to the documentation for the Urbit project, including the Azimuth identity layer, the Arvo operating system, and the Hoon programming language. This documentation is maintained by [Tlon](https://tlon.io) in a public [Github repository](https://github.com/urbit/docs). Issues and contributions are welcome.
-
- Please make your way to the [Introduction](/docs/getting-started/) for an overview of the docs. | 2 | 0.285714 | 0 | 2 |
1539240c07a88a7dfef417d4bb806f23b71fde32 | test/models/repository_test.rb | test/models/repository_test.rb | require 'test_helper'
class RepositoryTest < ActiveSupport::TestCase
setup do
@repository = create(:repository)
end
test 'must have a unique github_id' do
repository = build(:repository, github_id: @repository.github_id)
refute repository.valid?
end
test 'must have an full_name' do
@repository.full_name = nil
refute @repository.valid?
end
test 'must have a unique full_name' do
repository = build(:repository, full_name: @repository.full_name)
refute repository.valid?
end
test 'github_app_installed if app_installation_id present' do
@repository.app_installation_id = 1
assert @repository.github_app_installed?
end
test 'github_app_installed if app_installation_id missing' do
@repository.app_installation_id = nil
refute @repository.github_app_installed?
end
test 'finds subjects by full_name' do
subject = create(:subject, url: "https://api.github.com/repos/#{@repository.full_name}/issues/1")
subject2 = create(:subject, url: "https://api.github.com/repos/foo/bar/issues/1")
assert_equal @repository.subjects.length, 1
assert_equal @repository.subjects.first, subject
end
end
| require 'test_helper'
class RepositoryTest < ActiveSupport::TestCase
setup do
@repository = create(:repository)
end
test 'must have a unique github_id' do
repository = build(:repository, github_id: @repository.github_id)
refute repository.valid?
end
test 'must have an full_name' do
@repository.full_name = nil
refute @repository.valid?
end
test 'must have a unique full_name' do
repository = build(:repository, full_name: @repository.full_name)
refute repository.valid?
end
test 'finds subjects by full_name' do
subject = create(:subject, url: "https://api.github.com/repos/#{@repository.full_name}/issues/1")
subject2 = create(:subject, url: "https://api.github.com/repos/foo/bar/issues/1")
assert_equal @repository.subjects.length, 1
assert_equal @repository.subjects.first, subject
end
end
| Remove tests of a branch that hasn't been merged yet | Remove tests of a branch that hasn't been merged yet
| Ruby | agpl-3.0 | octobox/octobox,octobox/octobox,octobox/octobox,octobox/octobox | ruby | ## Code Before:
require 'test_helper'
class RepositoryTest < ActiveSupport::TestCase
setup do
@repository = create(:repository)
end
test 'must have a unique github_id' do
repository = build(:repository, github_id: @repository.github_id)
refute repository.valid?
end
test 'must have an full_name' do
@repository.full_name = nil
refute @repository.valid?
end
test 'must have a unique full_name' do
repository = build(:repository, full_name: @repository.full_name)
refute repository.valid?
end
test 'github_app_installed if app_installation_id present' do
@repository.app_installation_id = 1
assert @repository.github_app_installed?
end
test 'github_app_installed if app_installation_id missing' do
@repository.app_installation_id = nil
refute @repository.github_app_installed?
end
test 'finds subjects by full_name' do
subject = create(:subject, url: "https://api.github.com/repos/#{@repository.full_name}/issues/1")
subject2 = create(:subject, url: "https://api.github.com/repos/foo/bar/issues/1")
assert_equal @repository.subjects.length, 1
assert_equal @repository.subjects.first, subject
end
end
## Instruction:
Remove tests of a branch that hasn't been merged yet
## Code After:
require 'test_helper'
class RepositoryTest < ActiveSupport::TestCase
setup do
@repository = create(:repository)
end
test 'must have a unique github_id' do
repository = build(:repository, github_id: @repository.github_id)
refute repository.valid?
end
test 'must have an full_name' do
@repository.full_name = nil
refute @repository.valid?
end
test 'must have a unique full_name' do
repository = build(:repository, full_name: @repository.full_name)
refute repository.valid?
end
test 'finds subjects by full_name' do
subject = create(:subject, url: "https://api.github.com/repos/#{@repository.full_name}/issues/1")
subject2 = create(:subject, url: "https://api.github.com/repos/foo/bar/issues/1")
assert_equal @repository.subjects.length, 1
assert_equal @repository.subjects.first, subject
end
end
| require 'test_helper'
class RepositoryTest < ActiveSupport::TestCase
setup do
@repository = create(:repository)
end
test 'must have a unique github_id' do
repository = build(:repository, github_id: @repository.github_id)
refute repository.valid?
end
test 'must have an full_name' do
@repository.full_name = nil
refute @repository.valid?
end
test 'must have a unique full_name' do
repository = build(:repository, full_name: @repository.full_name)
refute repository.valid?
end
- test 'github_app_installed if app_installation_id present' do
- @repository.app_installation_id = 1
- assert @repository.github_app_installed?
- end
-
- test 'github_app_installed if app_installation_id missing' do
- @repository.app_installation_id = nil
- refute @repository.github_app_installed?
- end
-
test 'finds subjects by full_name' do
subject = create(:subject, url: "https://api.github.com/repos/#{@repository.full_name}/issues/1")
subject2 = create(:subject, url: "https://api.github.com/repos/foo/bar/issues/1")
assert_equal @repository.subjects.length, 1
assert_equal @repository.subjects.first, subject
end
end | 10 | 0.25641 | 0 | 10 |
c76401e54fccb47450d077dfde0c0d2434257230 | app/assets/javascripts/les/topology_load_charts/d3_load_chart/transformators/heat_transformator.js | app/assets/javascripts/les/topology_load_charts/d3_load_chart/transformators/heat_transformator.js | var HeatTransformator = (function () {
'use strict';
function fetchChart(data, totals) {
var chart,
subChart,
totals = (totals || []);
for (chart in data) {
subChart = data[chart];
if (subChart.length) {
totals.push({
type: chart,
name: I18n.t("charts." + chart),
area: true,
values: { total: LoadSlicer.slice(subChart, 0) }
});
} else {
fetchChart(subChart, totals);
}
};
return totals;
}
return {
transform: function (data, week) {
return fetchChart(data);
}
}
}());
| var HeatTransformator = (function () {
'use strict';
function fetchChart(data, totals) {
var chart,
subChart,
totals = (totals || []);
for (chart in data) {
if (data.hasOwnProperty(chart)) {
subChart = data[chart];
if (subChart.length && subChart.length > 0) {
totals.push({
type: chart,
name: I18n.t("charts." + chart),
area: true,
values: { total: LoadSlicer.slice(subChart, 0) }
});
} else {
fetchChart(subChart, totals);
}
}
};
return totals;
}
return {
transform: function (data, week) {
return fetchChart(data);
}
}
}());
| Fix heat transformator for IE11 | Fix heat transformator for IE11
Fixes: #1165
| JavaScript | mit | quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses | javascript | ## Code Before:
var HeatTransformator = (function () {
'use strict';
function fetchChart(data, totals) {
var chart,
subChart,
totals = (totals || []);
for (chart in data) {
subChart = data[chart];
if (subChart.length) {
totals.push({
type: chart,
name: I18n.t("charts." + chart),
area: true,
values: { total: LoadSlicer.slice(subChart, 0) }
});
} else {
fetchChart(subChart, totals);
}
};
return totals;
}
return {
transform: function (data, week) {
return fetchChart(data);
}
}
}());
## Instruction:
Fix heat transformator for IE11
Fixes: #1165
## Code After:
var HeatTransformator = (function () {
'use strict';
function fetchChart(data, totals) {
var chart,
subChart,
totals = (totals || []);
for (chart in data) {
if (data.hasOwnProperty(chart)) {
subChart = data[chart];
if (subChart.length && subChart.length > 0) {
totals.push({
type: chart,
name: I18n.t("charts." + chart),
area: true,
values: { total: LoadSlicer.slice(subChart, 0) }
});
} else {
fetchChart(subChart, totals);
}
}
};
return totals;
}
return {
transform: function (data, week) {
return fetchChart(data);
}
}
}());
| var HeatTransformator = (function () {
'use strict';
function fetchChart(data, totals) {
var chart,
subChart,
totals = (totals || []);
for (chart in data) {
+ if (data.hasOwnProperty(chart)) {
- subChart = data[chart];
+ subChart = data[chart];
? ++++
- if (subChart.length) {
+ if (subChart.length && subChart.length > 0) {
- totals.push({
+ totals.push({
? ++++
- type: chart,
+ type: chart,
? ++++
- name: I18n.t("charts." + chart),
+ name: I18n.t("charts." + chart),
? ++++
- area: true,
+ area: true,
? ++++
- values: { total: LoadSlicer.slice(subChart, 0) }
+ values: { total: LoadSlicer.slice(subChart, 0) }
? ++++
- });
+ });
? ++++
- } else {
+ } else {
? ++++
- fetchChart(subChart, totals);
+ fetchChart(subChart, totals);
? ++++
+ }
}
};
return totals;
}
return {
transform: function (data, week) {
return fetchChart(data);
}
}
}()); | 22 | 0.6875 | 12 | 10 |
031407c4ceaaf9f9fbe940f7e92887df52afee12 | README.md | README.md | Server-sent stream to update game info in real-time
| Server-sent stream to update game info in real-time
## Configure RabbitMQ
Install rabbitmq and the rabbitmqadmin (both available on AUR for Arch Linux) and enable the management plugin:
[sudo] rabbitmq-plugins enable rabbitmq_management
then (re)start the rabbitmq daemon. Declare the host and exchange for the eventsource:
rabbitmqadmin declare vhost name=eventsource
rabbitmqadmin declare permission vhost=eventsource user=guest configure=".*" write=".*" read=".*"
rabbitmqadmin -V eventsource declare exchange name=es_ex type=fanout durable=true
| Update readme with amqp instructions | Update readme with amqp instructions
| Markdown | mit | replaygaming/go-eventsource,replaygaming/go-eventsource,replaygaming/go-eventsource | markdown | ## Code Before:
Server-sent stream to update game info in real-time
## Instruction:
Update readme with amqp instructions
## Code After:
Server-sent stream to update game info in real-time
## Configure RabbitMQ
Install rabbitmq and the rabbitmqadmin (both available on AUR for Arch Linux) and enable the management plugin:
[sudo] rabbitmq-plugins enable rabbitmq_management
then (re)start the rabbitmq daemon. Declare the host and exchange for the eventsource:
rabbitmqadmin declare vhost name=eventsource
rabbitmqadmin declare permission vhost=eventsource user=guest configure=".*" write=".*" read=".*"
rabbitmqadmin -V eventsource declare exchange name=es_ex type=fanout durable=true
| Server-sent stream to update game info in real-time
+
+ ## Configure RabbitMQ
+
+ Install rabbitmq and the rabbitmqadmin (both available on AUR for Arch Linux) and enable the management plugin:
+
+ [sudo] rabbitmq-plugins enable rabbitmq_management
+
+ then (re)start the rabbitmq daemon. Declare the host and exchange for the eventsource:
+
+ rabbitmqadmin declare vhost name=eventsource
+
+ rabbitmqadmin declare permission vhost=eventsource user=guest configure=".*" write=".*" read=".*"
+
+ rabbitmqadmin -V eventsource declare exchange name=es_ex type=fanout durable=true | 14 | 14 | 14 | 0 |
4d9ed1521f3970fab3df3363cbbf9cfb2aa29583 | .travis.yml | .travis.yml | language: objective-c
osx_image: xcode7.3
before_script:
- pod lib lint
language: objective-c
xcode_workspace: Example/YXTUnsatisfiableConstraintsDetector.xcworkspace
xcode_scheme: YXTUnsatisfiableConstraintsDetector-Example
xcode_sdk: iphonesimulator
# Command: xctool test -scheme YXTUnsatisfiableConstraintsDetector-Example -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -sdk iphonesimulator
| language: objective-c
osx_image: xcode7.3
before_script:
- pod lib lint
language: objective-c
xcode_workspace: Example/YXTUnsatisfiableConstraintsDetector.xcworkspace
xcode_scheme: YXTUnsatisfiableConstraintsDetector-Example
xcode_sdk: iphonesimulator
script: set -o pipefail && xcodebuild test -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -scheme YXTUnsatisfiableConstraintsDetector-Example -sdk iphonesimulator9.3 | xcpretty
# Command: xctool test -scheme YXTUnsatisfiableConstraintsDetector-Example -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -sdk iphonesimulator
| Use xcodebuild to get around Travis issue with XCode 7.3 | Use xcodebuild to get around Travis issue with XCode 7.3
| YAML | mit | yext/YXTUnsatisfiableConstraintsDetector,yext/YXTUnsatisfiableConstraintsDetector | yaml | ## Code Before:
language: objective-c
osx_image: xcode7.3
before_script:
- pod lib lint
language: objective-c
xcode_workspace: Example/YXTUnsatisfiableConstraintsDetector.xcworkspace
xcode_scheme: YXTUnsatisfiableConstraintsDetector-Example
xcode_sdk: iphonesimulator
# Command: xctool test -scheme YXTUnsatisfiableConstraintsDetector-Example -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -sdk iphonesimulator
## Instruction:
Use xcodebuild to get around Travis issue with XCode 7.3
## Code After:
language: objective-c
osx_image: xcode7.3
before_script:
- pod lib lint
language: objective-c
xcode_workspace: Example/YXTUnsatisfiableConstraintsDetector.xcworkspace
xcode_scheme: YXTUnsatisfiableConstraintsDetector-Example
xcode_sdk: iphonesimulator
script: set -o pipefail && xcodebuild test -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -scheme YXTUnsatisfiableConstraintsDetector-Example -sdk iphonesimulator9.3 | xcpretty
# Command: xctool test -scheme YXTUnsatisfiableConstraintsDetector-Example -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -sdk iphonesimulator
| language: objective-c
osx_image: xcode7.3
before_script:
- pod lib lint
language: objective-c
xcode_workspace: Example/YXTUnsatisfiableConstraintsDetector.xcworkspace
xcode_scheme: YXTUnsatisfiableConstraintsDetector-Example
xcode_sdk: iphonesimulator
+ script: set -o pipefail && xcodebuild test -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -scheme YXTUnsatisfiableConstraintsDetector-Example -sdk iphonesimulator9.3 | xcpretty
# Command: xctool test -scheme YXTUnsatisfiableConstraintsDetector-Example -workspace Example/YXTUnsatisfiableConstraintsDetector.xcworkspace -sdk iphonesimulator | 1 | 0.111111 | 1 | 0 |
1ae537b291674d864c661298ddcbdd5d0c39a0ab | server/src/test/java/io/crate/testing/Asserts.java | server/src/test/java/io/crate/testing/Asserts.java | /*
* Licensed to Crate under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership. Crate licenses this file
* to you 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.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial
* agreement.
*/
package io.crate.testing;
import org.hamcrest.Matcher;
import org.junit.jupiter.api.function.Executable;
import org.opentest4j.AssertionFailedError;
public class Asserts {
private Asserts() {}
public static <T extends Throwable> void assertThrows(Executable executable, Matcher<T> matcher) {
try {
executable.execute();
} catch (Throwable t) {
if (matcher.matches(t)) {
return;
}
throw new AssertionFailedError(
String.format("Unmatched %s type thrown with message '%s'",
t.getClass().getCanonicalName(),
t.getMessage()), t);
}
throw new AssertionFailedError("Expected exception to be thrown, but nothing was thrown.");
}
}
| /*
* Licensed to Crate under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership. Crate licenses this file
* to you 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.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial
* agreement.
*/
package io.crate.testing;
import static org.hamcrest.MatcherAssert.assertThat;
import org.hamcrest.Matcher;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.function.Executable;
public class Asserts {
private Asserts() {}
public static void assertThrows(Executable executable, Matcher<? super Throwable> matcher) {
try {
executable.execute();
Assertions.fail("Expected exception to be thrown, but nothing was thrown.");
} catch (Throwable t) {
assertThat(t, matcher);
}
}
}
| Use junit assertions in assertThrows | Use junit assertions in assertThrows
I was wondering where a opentest4j error came from.
This changes the newly introduced assertThrows to use the same
verification mechanism we use everywhere else.
| Java | apache-2.0 | crate/crate,EvilMcJerkface/crate,EvilMcJerkface/crate,crate/crate,EvilMcJerkface/crate,crate/crate | java | ## Code Before:
/*
* Licensed to Crate under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership. Crate licenses this file
* to you 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.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial
* agreement.
*/
package io.crate.testing;
import org.hamcrest.Matcher;
import org.junit.jupiter.api.function.Executable;
import org.opentest4j.AssertionFailedError;
public class Asserts {
private Asserts() {}
public static <T extends Throwable> void assertThrows(Executable executable, Matcher<T> matcher) {
try {
executable.execute();
} catch (Throwable t) {
if (matcher.matches(t)) {
return;
}
throw new AssertionFailedError(
String.format("Unmatched %s type thrown with message '%s'",
t.getClass().getCanonicalName(),
t.getMessage()), t);
}
throw new AssertionFailedError("Expected exception to be thrown, but nothing was thrown.");
}
}
## Instruction:
Use junit assertions in assertThrows
I was wondering where a opentest4j error came from.
This changes the newly introduced assertThrows to use the same
verification mechanism we use everywhere else.
## Code After:
/*
* Licensed to Crate under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership. Crate licenses this file
* to you 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.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial
* agreement.
*/
package io.crate.testing;
import static org.hamcrest.MatcherAssert.assertThat;
import org.hamcrest.Matcher;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.function.Executable;
public class Asserts {
private Asserts() {}
public static void assertThrows(Executable executable, Matcher<? super Throwable> matcher) {
try {
executable.execute();
Assertions.fail("Expected exception to be thrown, but nothing was thrown.");
} catch (Throwable t) {
assertThat(t, matcher);
}
}
}
| /*
* Licensed to Crate under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership. Crate licenses this file
* to you 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.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial
* agreement.
*/
package io.crate.testing;
+ import static org.hamcrest.MatcherAssert.assertThat;
+
import org.hamcrest.Matcher;
+ import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.function.Executable;
- import org.opentest4j.AssertionFailedError;
public class Asserts {
private Asserts() {}
- public static <T extends Throwable> void assertThrows(Executable executable, Matcher<T> matcher) {
? ----------------------
+ public static void assertThrows(Executable executable, Matcher<? super Throwable> matcher) {
? ++++++++ ++++++++
try {
executable.execute();
+ Assertions.fail("Expected exception to be thrown, but nothing was thrown.");
} catch (Throwable t) {
+ assertThat(t, matcher);
- if (matcher.matches(t)) {
- return;
- }
- throw new AssertionFailedError(
- String.format("Unmatched %s type thrown with message '%s'",
- t.getClass().getCanonicalName(),
- t.getMessage()), t);
}
- throw new AssertionFailedError("Expected exception to be thrown, but nothing was thrown.");
}
} | 16 | 0.340426 | 6 | 10 |
0d863ed76261589480cbeb4bb0bb31af40f1f29f | .gitlab-ci.yml | .gitlab-ci.yml | image: archimg/base-devel:latest
before_script:
- pacman -Sy --noconfirm --needed emscripten llvm clang cmake ragel make autoconf pkgconfig patch libtool itstool automake python2 zip python2-lxml python2-pip python2-html5lib python2-setuptools python2-chardet python2-virtualenv gperf
- source /etc/profile.d/emscripten.sh
- emcc
build:
script:
- git submodule sync --recursive
- git submodule update --init --recursive
- make
artifacts:
paths:
- dist/*.* | image: archimg/base-devel:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- pacman -Sy --noconfirm --needed emscripten llvm clang cmake ragel make autoconf pkgconfig patch libtool itstool automake python2 zip python2-lxml python2-pip python2-html5lib python2-setuptools python2-chardet python2-virtualenv gperf
- source /etc/profile.d/emscripten.sh
- emcc
build:
script:
- make
artifacts:
paths:
- dist/*.* | Set GIT_SUBMODULE_STRATEGY to recursive in Gitlab CI | Set GIT_SUBMODULE_STRATEGY to recursive in Gitlab CI
| YAML | mit | Dador/JavascriptSubtitlesOctopus,Dador/JavascriptSubtitlesOctopus | yaml | ## Code Before:
image: archimg/base-devel:latest
before_script:
- pacman -Sy --noconfirm --needed emscripten llvm clang cmake ragel make autoconf pkgconfig patch libtool itstool automake python2 zip python2-lxml python2-pip python2-html5lib python2-setuptools python2-chardet python2-virtualenv gperf
- source /etc/profile.d/emscripten.sh
- emcc
build:
script:
- git submodule sync --recursive
- git submodule update --init --recursive
- make
artifacts:
paths:
- dist/*.*
## Instruction:
Set GIT_SUBMODULE_STRATEGY to recursive in Gitlab CI
## Code After:
image: archimg/base-devel:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- pacman -Sy --noconfirm --needed emscripten llvm clang cmake ragel make autoconf pkgconfig patch libtool itstool automake python2 zip python2-lxml python2-pip python2-html5lib python2-setuptools python2-chardet python2-virtualenv gperf
- source /etc/profile.d/emscripten.sh
- emcc
build:
script:
- make
artifacts:
paths:
- dist/*.* | image: archimg/base-devel:latest
+
+ variables:
+ GIT_SUBMODULE_STRATEGY: recursive
before_script:
- pacman -Sy --noconfirm --needed emscripten llvm clang cmake ragel make autoconf pkgconfig patch libtool itstool automake python2 zip python2-lxml python2-pip python2-html5lib python2-setuptools python2-chardet python2-virtualenv gperf
- source /etc/profile.d/emscripten.sh
- emcc
build:
script:
- - git submodule sync --recursive
- - git submodule update --init --recursive
- make
artifacts:
paths:
- dist/*.* | 5 | 0.357143 | 3 | 2 |
d859dfa3afe2c38ff5a64e45c1e410d364618c73 | roles/keystone/templates/etc/shibboleth/attribute-map.xml | roles/keystone/templates/etc/shibboleth/attribute-map.xml | <Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
{% for attribute in keystone.federation.sp.saml.providers[0].attributes -%}
<Attribute name="{{ attribute.name }}" id="{{ attribute.id }}"/>
{% endfor -%}
</Attributes>
| <Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
{% for attribute in keystone.federation.sp.saml.providers[0].attributes -%}
<Attribute name="{{ attribute.name }}" id="{{ attribute.id }}" {% if attribute.format is defined -%}nameFormat="{{ attribute.format }}"{%- endif-%}/>
{% endfor %}
</Attributes>
| Add name format for SAML mapping attributes | Add name format for SAML mapping attributes
| XML | mit | channus/ursula,rongzhus/ursula,channus/ursula,lihkin213/ursula,pgraziano/ursula,wupeiran/ursula,edtubillara/ursula,blueboxgroup/ursula,rongzhus/ursula,wupeiran/ursula,knandya/ursula,nirajdp76/ursula,edtubillara/ursula,wupeiran/ursula,nirajdp76/ursula,blueboxgroup/ursula,rongzhus/ursula,fancyhe/ursula,fancyhe/ursula,knandya/ursula,lihkin213/ursula,pgraziano/ursula,wupeiran/ursula,edtubillara/ursula,knandya/ursula,fancyhe/ursula,knandya/ursula,nirajdp76/ursula,edtubillara/ursula,lihkin213/ursula,lihkin213/ursula,blueboxgroup/ursula,nirajdp76/ursula,blueboxgroup/ursula,channus/ursula,fancyhe/ursula,pgraziano/ursula,rongzhus/ursula,pgraziano/ursula,channus/ursula | xml | ## Code Before:
<Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
{% for attribute in keystone.federation.sp.saml.providers[0].attributes -%}
<Attribute name="{{ attribute.name }}" id="{{ attribute.id }}"/>
{% endfor -%}
</Attributes>
## Instruction:
Add name format for SAML mapping attributes
## Code After:
<Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
{% for attribute in keystone.federation.sp.saml.providers[0].attributes -%}
<Attribute name="{{ attribute.name }}" id="{{ attribute.id }}" {% if attribute.format is defined -%}nameFormat="{{ attribute.format }}"{%- endif-%}/>
{% endfor %}
</Attributes>
| <Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
{% for attribute in keystone.federation.sp.saml.providers[0].attributes -%}
- <Attribute name="{{ attribute.name }}" id="{{ attribute.id }}"/>
+ <Attribute name="{{ attribute.name }}" id="{{ attribute.id }}" {% if attribute.format is defined -%}nameFormat="{{ attribute.format }}"{%- endif-%}/>
- {% endfor -%}
? -
+ {% endfor %}
</Attributes> | 4 | 0.8 | 2 | 2 |
08ee8084dd566a1c5aee60356225a174b18e5c7b | .github/dependabot.yml | .github/dependabot.yml |
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Check for npm updates on Sundays
day: "sunday"
target-branch: "develop"
# Labels on pull requests for security and version updates
labels:
- "dependencies"
|
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Check for npm updates on Sundays
day: "sunday"
target-branch: "develop"
# Disable version updates (this option should have no impact on security updates)
open-pull-requests-limit: 0
# Labels on pull requests for security and version updates
labels:
- "dependencies"
| Disable version updates but keep security updates | Disable version updates but keep security updates | YAML | mit | bitshares/bitshares-ui,bitshares/bitshares-ui,bitshares/bitshares-ui,bitshares/bitshares-ui | yaml | ## Code Before:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Check for npm updates on Sundays
day: "sunday"
target-branch: "develop"
# Labels on pull requests for security and version updates
labels:
- "dependencies"
## Instruction:
Disable version updates but keep security updates
## Code After:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Check for npm updates on Sundays
day: "sunday"
target-branch: "develop"
# Disable version updates (this option should have no impact on security updates)
open-pull-requests-limit: 0
# Labels on pull requests for security and version updates
labels:
- "dependencies"
|
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Check for npm updates on Sundays
day: "sunday"
target-branch: "develop"
+ # Disable version updates (this option should have no impact on security updates)
+ open-pull-requests-limit: 0
# Labels on pull requests for security and version updates
labels:
- "dependencies" | 2 | 0.153846 | 2 | 0 |
5f1803a6c99b6f122663c08b82370411cd088dde | README.md | README.md | RSS feeds for YouTube
Google recently discontinued YouTube RSS feeds for individual user uploads. This will act as a replacement.
To run it, specify your YouTube API key as `API_KEY` in your environment.
Feeds can be found at:
* `/user/{username}.xml`
* `/user/{username}/atom.xml`
* `/channel/{channelid}.xml`
* `/channel/{channelid}/atom.xml`
Feeds will be cached for `CACHE_TIME` (default is one hour).
|
RSS feeds for YouTube
Google recently discontinued YouTube RSS feeds for individual user uploads. This will act as a replacement.
To run it, specify your YouTube API key as `API_KEY` in your environment (or use an environment file like `env.conf.default`). Then visit the landing page, create a user, and submit feeds.
For legacy (v1) compatility, you can directly turn a YouTube user into a feed with:
* `/user/{username}.xml`
* `/user/{username}/atom.xml`
* `/channel/{channelid}.xml`
* `/channel/{channelid}/atom.xml`
Feeds will be cached for `CACHE_TIME` (default is one hour).
| Update readme with legacy information | Update readme with legacy information
| Markdown | bsd-3-clause | jpverkamp/yrss | markdown | ## Code Before:
RSS feeds for YouTube
Google recently discontinued YouTube RSS feeds for individual user uploads. This will act as a replacement.
To run it, specify your YouTube API key as `API_KEY` in your environment.
Feeds can be found at:
* `/user/{username}.xml`
* `/user/{username}/atom.xml`
* `/channel/{channelid}.xml`
* `/channel/{channelid}/atom.xml`
Feeds will be cached for `CACHE_TIME` (default is one hour).
## Instruction:
Update readme with legacy information
## Code After:
RSS feeds for YouTube
Google recently discontinued YouTube RSS feeds for individual user uploads. This will act as a replacement.
To run it, specify your YouTube API key as `API_KEY` in your environment (or use an environment file like `env.conf.default`). Then visit the landing page, create a user, and submit feeds.
For legacy (v1) compatility, you can directly turn a YouTube user into a feed with:
* `/user/{username}.xml`
* `/user/{username}/atom.xml`
* `/channel/{channelid}.xml`
* `/channel/{channelid}/atom.xml`
Feeds will be cached for `CACHE_TIME` (default is one hour).
| +
RSS feeds for YouTube
Google recently discontinued YouTube RSS feeds for individual user uploads. This will act as a replacement.
- To run it, specify your YouTube API key as `API_KEY` in your environment.
+ To run it, specify your YouTube API key as `API_KEY` in your environment (or use an environment file like `env.conf.default`). Then visit the landing page, create a user, and submit feeds.
- Feeds can be found at:
+ For legacy (v1) compatility, you can directly turn a YouTube user into a feed with:
* `/user/{username}.xml`
* `/user/{username}/atom.xml`
* `/channel/{channelid}.xml`
* `/channel/{channelid}/atom.xml`
Feeds will be cached for `CACHE_TIME` (default is one hour). | 5 | 0.357143 | 3 | 2 |
19537c1cc41c0e1852c060d1672ae771935823ce | c/README.md | c/README.md | [](https://travis-ci.org/cucumber/gherkin-c)
[The docs are here](http://docs.cucumber.io/gherkin/).
| [](https://travis-ci.org/cucumber/gherkin-c)
[The docs are here](https://docs.cucumber.io/docs/gherkin.html).
| Fix broken link to Gherkin docs | Fix broken link to Gherkin docs
Fixes #266 | Markdown | mit | cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin,cucumber/gherkin | markdown | ## Code Before:
[](https://travis-ci.org/cucumber/gherkin-c)
[The docs are here](http://docs.cucumber.io/gherkin/).
## Instruction:
Fix broken link to Gherkin docs
Fixes #266
## Code After:
[](https://travis-ci.org/cucumber/gherkin-c)
[The docs are here](https://docs.cucumber.io/docs/gherkin.html).
| [](https://travis-ci.org/cucumber/gherkin-c)
- [The docs are here](http://docs.cucumber.io/gherkin/).
? ^
+ [The docs are here](https://docs.cucumber.io/docs/gherkin.html).
? + +++++ ^^^^^
| 2 | 0.666667 | 1 | 1 |
b9a1582bbab5c19a3e6a47d9ab189d8633b71af7 | index.html | index.html | <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Coordinates</title>
<meta name="author" content="Olivier Dolbeau" />
<meta name="description" content="A tool to help Raph & Claire to spam the world! \o/" />
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
<script src="main.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<a href="http://github.com/odolbeau/coordinates"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 1" src="github.png" alt="Fork me on GitHub" /></a>
<input id="pac-input" class="controls" type="text" placeholder="Search Box">
<div id="coordinates-div">
<input id="coordinates-input" class="controls" type="text" placeholder="Coordinates box">
<button id="coordinates-button">Draw!</button>
</div>
<div id="map-canvas"></div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Coordinates</title>
<meta name="author" content="Olivier Dolbeau" />
<meta name="description" content="A tool to help Raph & Claire to spam the world! \o/" />
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC3gI_WoPXSmlgq7xDXbP0zCU1TKWi-EWE&v=3.exp&signed_in=true&libraries=places"></script>
<script src="main.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<a href="http://github.com/odolbeau/coordinates"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 1" src="github.png" alt="Fork me on GitHub" /></a>
<input id="pac-input" class="controls" type="text" placeholder="Search Box">
<div id="coordinates-div">
<input id="coordinates-input" class="controls" type="text" placeholder="Coordinates box">
<button id="coordinates-button">Draw!</button>
</div>
<div id="map-canvas"></div>
</body>
</html>
| Use a Google API key | Use a Google API key
| HTML | mit | odolbeau/coordinates,odolbeau/coordinates | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Coordinates</title>
<meta name="author" content="Olivier Dolbeau" />
<meta name="description" content="A tool to help Raph & Claire to spam the world! \o/" />
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
<script src="main.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<a href="http://github.com/odolbeau/coordinates"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 1" src="github.png" alt="Fork me on GitHub" /></a>
<input id="pac-input" class="controls" type="text" placeholder="Search Box">
<div id="coordinates-div">
<input id="coordinates-input" class="controls" type="text" placeholder="Coordinates box">
<button id="coordinates-button">Draw!</button>
</div>
<div id="map-canvas"></div>
</body>
</html>
## Instruction:
Use a Google API key
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Coordinates</title>
<meta name="author" content="Olivier Dolbeau" />
<meta name="description" content="A tool to help Raph & Claire to spam the world! \o/" />
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC3gI_WoPXSmlgq7xDXbP0zCU1TKWi-EWE&v=3.exp&signed_in=true&libraries=places"></script>
<script src="main.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<a href="http://github.com/odolbeau/coordinates"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 1" src="github.png" alt="Fork me on GitHub" /></a>
<input id="pac-input" class="controls" type="text" placeholder="Search Box">
<div id="coordinates-div">
<input id="coordinates-input" class="controls" type="text" placeholder="Coordinates box">
<button id="coordinates-button">Draw!</button>
</div>
<div id="map-canvas"></div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Coordinates</title>
<meta name="author" content="Olivier Dolbeau" />
<meta name="description" content="A tool to help Raph & Claire to spam the world! \o/" />
- <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
+ <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC3gI_WoPXSmlgq7xDXbP0zCU1TKWi-EWE&v=3.exp&signed_in=true&libraries=places"></script>
? ++++++++++++++++++++++++++++++++++++++++++++
<script src="main.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<a href="http://github.com/odolbeau/coordinates"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 1" src="github.png" alt="Fork me on GitHub" /></a>
<input id="pac-input" class="controls" type="text" placeholder="Search Box">
<div id="coordinates-div">
<input id="coordinates-input" class="controls" type="text" placeholder="Coordinates box">
<button id="coordinates-button">Draw!</button>
</div>
<div id="map-canvas"></div>
</body>
</html> | 2 | 0.090909 | 1 | 1 |
5bc67f5a2e1a3b20033522e45d1368d126343648 | lib/motion/project/gradle.erb | lib/motion/project/gradle.erb | apply plugin: 'java'
apply plugin: 'eclipse'
task generateDependencies(type: Jar) {
baseName = 'dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
repositories {
def androidHome = System.getenv("ANDROID_HOME")
maven {
url "$androidHome/extras/android/m2repository/"
}
<% @repositories.each do |url| %>
maven {
url "<%= url %>"
}
<% end %>
mavenCentral()
}
dependencies {
<% @dependencies.each do |dependency| %>
compile '<%= dependency[:name] %>:<%= dependency[:artifact] %>:<%= dependency[:version] %>'
<% end %>
}
| apply plugin: 'java'
apply plugin: 'eclipse'
task generateDependencies(type: Jar) {
baseName = 'dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
repositories {
def androidHome = System.getenv("RUBYMOTION_ANDROID_SDK")
maven {
url "$androidHome/extras/android/m2repository/"
}
<% @repositories.each do |url| %>
maven {
url "<%= url %>"
}
<% end %>
mavenCentral()
}
dependencies {
<% @dependencies.each do |dependency| %>
compile '<%= dependency[:name] %>:<%= dependency[:artifact] %>:<%= dependency[:version] %>'
<% end %>
}
| Change root directory of support files to $RUBYMOTION_ANDROID_SDK | Change root directory of support files to $RUBYMOTION_ANDROID_SDK
| HTML+ERB | mit | HipByte/motion-gradle,HipByte/motion-gradle | html+erb | ## Code Before:
apply plugin: 'java'
apply plugin: 'eclipse'
task generateDependencies(type: Jar) {
baseName = 'dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
repositories {
def androidHome = System.getenv("ANDROID_HOME")
maven {
url "$androidHome/extras/android/m2repository/"
}
<% @repositories.each do |url| %>
maven {
url "<%= url %>"
}
<% end %>
mavenCentral()
}
dependencies {
<% @dependencies.each do |dependency| %>
compile '<%= dependency[:name] %>:<%= dependency[:artifact] %>:<%= dependency[:version] %>'
<% end %>
}
## Instruction:
Change root directory of support files to $RUBYMOTION_ANDROID_SDK
## Code After:
apply plugin: 'java'
apply plugin: 'eclipse'
task generateDependencies(type: Jar) {
baseName = 'dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
repositories {
def androidHome = System.getenv("RUBYMOTION_ANDROID_SDK")
maven {
url "$androidHome/extras/android/m2repository/"
}
<% @repositories.each do |url| %>
maven {
url "<%= url %>"
}
<% end %>
mavenCentral()
}
dependencies {
<% @dependencies.each do |dependency| %>
compile '<%= dependency[:name] %>:<%= dependency[:artifact] %>:<%= dependency[:version] %>'
<% end %>
}
| apply plugin: 'java'
apply plugin: 'eclipse'
task generateDependencies(type: Jar) {
baseName = 'dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
repositories {
- def androidHome = System.getenv("ANDROID_HOME")
? ^^^^
+ def androidHome = System.getenv("RUBYMOTION_ANDROID_SDK")
? +++++++++++ ^^^
maven {
url "$androidHome/extras/android/m2repository/"
}
<% @repositories.each do |url| %>
maven {
url "<%= url %>"
}
<% end %>
mavenCentral()
}
dependencies {
<% @dependencies.each do |dependency| %>
compile '<%= dependency[:name] %>:<%= dependency[:artifact] %>:<%= dependency[:version] %>'
<% end %>
} | 2 | 0.074074 | 1 | 1 |
321dce2143c128fa65c32978dcb26a5f198c18df | shell/export.sh | shell/export.sh | export PATH=$PATH:$DOTFILES_HOME/shell/powerline/scripts
export TERM=screen-256color
| if [ -d "$HOME/bin" ]; then
export PATH=$HOME/bin:$PATH
fi
export PATH=$PATH:$DOTFILES_HOME/shell/powerline/scripts
export TERM=screen-256color
| Add bin folder in user home to $PATH | Add bin folder in user home to $PATH
| Shell | mit | ahaasler/dotfiles,ahaasler/dotfiles,ahaasler/dotfiles | shell | ## Code Before:
export PATH=$PATH:$DOTFILES_HOME/shell/powerline/scripts
export TERM=screen-256color
## Instruction:
Add bin folder in user home to $PATH
## Code After:
if [ -d "$HOME/bin" ]; then
export PATH=$HOME/bin:$PATH
fi
export PATH=$PATH:$DOTFILES_HOME/shell/powerline/scripts
export TERM=screen-256color
| + if [ -d "$HOME/bin" ]; then
+ export PATH=$HOME/bin:$PATH
+ fi
export PATH=$PATH:$DOTFILES_HOME/shell/powerline/scripts
export TERM=screen-256color | 3 | 1.5 | 3 | 0 |
5ae8a55a75bef8a0af6d330842000152e2830c0e | lib/text.js | lib/text.js | exports._regExpRegExp = /^\/(.+)\/([im]?)$/;
exports._lineRegExp = /\r\n|\r|\n/;
exports.splitLines = function (text) {
var lines = [];
var match, line;
while (match = exports._lineRegExp.exec(text)) {
line = text.slice(0, match.index) + match[0];
text = text.slice(line.length);
lines.push(line);
}
lines.push(text);
return lines;
};
exports.escapeRegExp = function (text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};
exports.regExpIndexOf = function(str, regex, index) {
index = index || 0;
var offset = str.slice(index).search(regex);
return (offset >= 0) ? (index + offset) : offset;
};
exports.regExpLastIndexOf = function (str, regex, index) {
if (index === 0 || index) str = str.slice(0, Math.max(0, index));
var i;
var offset = -1;
while ((i = str.search(regex)) !== -1) {
offset += i + 1;
str = str.slice(i + 1);
}
return offset;
};
| exports._regExpRegExp = /^\/(.+)\/([im]?)$/;
exports._lineRegExp = /\r\n|\r|\n/;
exports.splitLines = function (text) {
var lines = [];
var match, line;
while (match = exports._lineRegExp.exec(text)) {
line = text.slice(0, match.index) + match[0];
text = text.slice(line.length);
lines.push(line);
}
lines.push(text);
return lines;
};
exports.regExpIndexOf = function(str, regex, index) {
index = index || 0;
var offset = str.slice(index).search(regex);
return (offset >= 0) ? (index + offset) : offset;
};
exports.regExpLastIndexOf = function (str, regex, index) {
if (index === 0 || index) str = str.slice(0, Math.max(0, index));
var i;
var offset = -1;
while ((i = str.search(regex)) !== -1) {
offset += i + 1;
str = str.slice(i + 1);
}
return offset;
};
| Remove escapeRegExp in favor of lodash.escapeRegExp | Remove escapeRegExp in favor of lodash.escapeRegExp | JavaScript | mit | slap-editor/slap-util | javascript | ## Code Before:
exports._regExpRegExp = /^\/(.+)\/([im]?)$/;
exports._lineRegExp = /\r\n|\r|\n/;
exports.splitLines = function (text) {
var lines = [];
var match, line;
while (match = exports._lineRegExp.exec(text)) {
line = text.slice(0, match.index) + match[0];
text = text.slice(line.length);
lines.push(line);
}
lines.push(text);
return lines;
};
exports.escapeRegExp = function (text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};
exports.regExpIndexOf = function(str, regex, index) {
index = index || 0;
var offset = str.slice(index).search(regex);
return (offset >= 0) ? (index + offset) : offset;
};
exports.regExpLastIndexOf = function (str, regex, index) {
if (index === 0 || index) str = str.slice(0, Math.max(0, index));
var i;
var offset = -1;
while ((i = str.search(regex)) !== -1) {
offset += i + 1;
str = str.slice(i + 1);
}
return offset;
};
## Instruction:
Remove escapeRegExp in favor of lodash.escapeRegExp
## Code After:
exports._regExpRegExp = /^\/(.+)\/([im]?)$/;
exports._lineRegExp = /\r\n|\r|\n/;
exports.splitLines = function (text) {
var lines = [];
var match, line;
while (match = exports._lineRegExp.exec(text)) {
line = text.slice(0, match.index) + match[0];
text = text.slice(line.length);
lines.push(line);
}
lines.push(text);
return lines;
};
exports.regExpIndexOf = function(str, regex, index) {
index = index || 0;
var offset = str.slice(index).search(regex);
return (offset >= 0) ? (index + offset) : offset;
};
exports.regExpLastIndexOf = function (str, regex, index) {
if (index === 0 || index) str = str.slice(0, Math.max(0, index));
var i;
var offset = -1;
while ((i = str.search(regex)) !== -1) {
offset += i + 1;
str = str.slice(i + 1);
}
return offset;
};
| exports._regExpRegExp = /^\/(.+)\/([im]?)$/;
exports._lineRegExp = /\r\n|\r|\n/;
exports.splitLines = function (text) {
var lines = [];
var match, line;
while (match = exports._lineRegExp.exec(text)) {
line = text.slice(0, match.index) + match[0];
text = text.slice(line.length);
lines.push(line);
}
lines.push(text);
return lines;
- };
- exports.escapeRegExp = function (text) {
- return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};
exports.regExpIndexOf = function(str, regex, index) {
index = index || 0;
var offset = str.slice(index).search(regex);
return (offset >= 0) ? (index + offset) : offset;
};
exports.regExpLastIndexOf = function (str, regex, index) {
if (index === 0 || index) str = str.slice(0, Math.max(0, index));
var i;
var offset = -1;
while ((i = str.search(regex)) !== -1) {
offset += i + 1;
str = str.slice(i + 1);
}
return offset;
}; | 3 | 0.09375 | 0 | 3 |
52c88fc6a02618829203a12ba69da47bbc89a31d | junit-commons/src/main/java/org/junit/gen5/commons/util/CollectionUtils.java | junit-commons/src/main/java/org/junit/gen5/commons/util/CollectionUtils.java | /*
* Copyright 2015-2016 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.junit.gen5.commons.util;
import java.util.Collection;
/**
* Collection of utilities for working with {@link Collection Collections}.
*
* @since 5.0
*/
public class CollectionUtils {
/**
* Read the only element of a collection of size 1.
*
* @param collection the collection to read the element from
* @return the only element of the collection
* @throws IllegalArgumentException if the collection is empty or contains
* more than one element
*/
public static <T> T getOnlyElement(Collection<T> collection) {
Preconditions.condition(collection.size() == 1,
() -> "collection must contain exactly one element: " + collection);
return collection.iterator().next();
}
}
| /*
* Copyright 2015-2016 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.junit.gen5.commons.util;
import java.util.Collection;
/**
* Collection of utilities for working with {@link Collection Collections}.
*
* @since 5.0
*/
public class CollectionUtils {
private CollectionUtils() {
/* no-op */
}
/**
* Read the only element of a collection of size 1.
*
* @param collection the collection to read the element from
* @return the only element of the collection
* @throws IllegalArgumentException if the collection is empty or contains
* more than one element
*/
public static <T> T getOnlyElement(Collection<T> collection) {
Preconditions.condition(collection.size() == 1,
() -> "collection must contain exactly one element: " + collection);
return collection.iterator().next();
}
}
| Add private constructor to prevent instantiation | Add private constructor to prevent instantiation
------------------------------------------------------------------------
On behalf of the community, the JUnit Lambda Team thanks
msg systems ag (http://www.msg-systems.com) for supporting
the JUnit crowdfunding campaign!
------------------------------------------------------------------------
| Java | epl-1.0 | junit-team/junit-lambda,marcphilipp/junit5,sbrannen/junit-lambda,marcphilipp/junit-lambda | java | ## Code Before:
/*
* Copyright 2015-2016 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.junit.gen5.commons.util;
import java.util.Collection;
/**
* Collection of utilities for working with {@link Collection Collections}.
*
* @since 5.0
*/
public class CollectionUtils {
/**
* Read the only element of a collection of size 1.
*
* @param collection the collection to read the element from
* @return the only element of the collection
* @throws IllegalArgumentException if the collection is empty or contains
* more than one element
*/
public static <T> T getOnlyElement(Collection<T> collection) {
Preconditions.condition(collection.size() == 1,
() -> "collection must contain exactly one element: " + collection);
return collection.iterator().next();
}
}
## Instruction:
Add private constructor to prevent instantiation
------------------------------------------------------------------------
On behalf of the community, the JUnit Lambda Team thanks
msg systems ag (http://www.msg-systems.com) for supporting
the JUnit crowdfunding campaign!
------------------------------------------------------------------------
## Code After:
/*
* Copyright 2015-2016 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.junit.gen5.commons.util;
import java.util.Collection;
/**
* Collection of utilities for working with {@link Collection Collections}.
*
* @since 5.0
*/
public class CollectionUtils {
private CollectionUtils() {
/* no-op */
}
/**
* Read the only element of a collection of size 1.
*
* @param collection the collection to read the element from
* @return the only element of the collection
* @throws IllegalArgumentException if the collection is empty or contains
* more than one element
*/
public static <T> T getOnlyElement(Collection<T> collection) {
Preconditions.condition(collection.size() == 1,
() -> "collection must contain exactly one element: " + collection);
return collection.iterator().next();
}
}
| /*
* Copyright 2015-2016 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.junit.gen5.commons.util;
import java.util.Collection;
/**
* Collection of utilities for working with {@link Collection Collections}.
*
* @since 5.0
*/
public class CollectionUtils {
+ private CollectionUtils() {
+ /* no-op */
+ }
+
/**
* Read the only element of a collection of size 1.
*
* @param collection the collection to read the element from
* @return the only element of the collection
* @throws IllegalArgumentException if the collection is empty or contains
* more than one element
*/
public static <T> T getOnlyElement(Collection<T> collection) {
Preconditions.condition(collection.size() == 1,
() -> "collection must contain exactly one element: " + collection);
return collection.iterator().next();
}
} | 4 | 0.111111 | 4 | 0 |
13462424df180defc299e2b00c3d1d0c88faf4cf | provisioner/celos_test.yaml | provisioner/celos_test.yaml | ---
# Playbook to perform integration testing on Celos
#
# Uploads sample workflows to the Celos master node and verifies that
# the result of the /celos/workflow-list servlet lists the workflows.
- hosts: hadoop_masters
gather_facts: no
vars:
local_celos: ..
celos_port: 8080
celos_workflows_dir: /etc/celos/workflows
celos_db_dir: /var/lib/celos/db
tasks:
- name: Remove old files, if any
shell: sudo rm -rf {{celos_workflows_dir}}/* {{celos_db_dir}}/*
&& sudo mkdir -p {{celos_workflows_dir}}
&& sudo mkdir -p {{celos_db_dir}}
- name: Testing servlet /celos/workflow-list
local_action: shell curl {{inventory_hostname}}:8080/celos/workflow-list | diff - test_files/empty_workflow_list.json
| ---
# Playbook to perform integration testing on Celos
#
# Uploads sample workflows to the Celos master node and verifies that
# the result of the /celos/workflow-list servlet lists the workflows.
- hosts: hadoop_masters
gather_facts: no
vars:
local_celos: ..
celos_port: 8080
celos_workflows_dir: /etc/celos/workflows
celos_db_dir: /var/lib/celos/db
celos_user: ubuntu
tasks:
- name: Prepare configuration dir
shell: sudo rm -rf {{celos_workflows_dir}}/* && sudo mkdir -p {{celos_workflows_dir}}
&& sudo chown {{celos_user}}:{{celos_user}} {{celos_workflows_dir}}
- name: Prepare database dir
shell: sudo rm -rf {{celos_db_dir}}/* && sudo mkdir -p {{celos_db_dir}}
&& sudo chown {{celos_user}}:{{celos_user}} {{celos_db_dir}}
- name: Testing servlet /celos/workflow-list
local_action: shell curl {{inventory_hostname}}:8080/celos/workflow-list | diff - test_files/empty_workflow_list.json
| Make /etc/celos/workflows/ and /var/lib/celos/db writable by Celos user (currently ubuntu). | Make /etc/celos/workflows/ and /var/lib/celos/db writable by Celos user (currently ubuntu).
| YAML | apache-2.0 | collectivemedia/celos,collectivemedia/celos,collectivemedia/celos | yaml | ## Code Before:
---
# Playbook to perform integration testing on Celos
#
# Uploads sample workflows to the Celos master node and verifies that
# the result of the /celos/workflow-list servlet lists the workflows.
- hosts: hadoop_masters
gather_facts: no
vars:
local_celos: ..
celos_port: 8080
celos_workflows_dir: /etc/celos/workflows
celos_db_dir: /var/lib/celos/db
tasks:
- name: Remove old files, if any
shell: sudo rm -rf {{celos_workflows_dir}}/* {{celos_db_dir}}/*
&& sudo mkdir -p {{celos_workflows_dir}}
&& sudo mkdir -p {{celos_db_dir}}
- name: Testing servlet /celos/workflow-list
local_action: shell curl {{inventory_hostname}}:8080/celos/workflow-list | diff - test_files/empty_workflow_list.json
## Instruction:
Make /etc/celos/workflows/ and /var/lib/celos/db writable by Celos user (currently ubuntu).
## Code After:
---
# Playbook to perform integration testing on Celos
#
# Uploads sample workflows to the Celos master node and verifies that
# the result of the /celos/workflow-list servlet lists the workflows.
- hosts: hadoop_masters
gather_facts: no
vars:
local_celos: ..
celos_port: 8080
celos_workflows_dir: /etc/celos/workflows
celos_db_dir: /var/lib/celos/db
celos_user: ubuntu
tasks:
- name: Prepare configuration dir
shell: sudo rm -rf {{celos_workflows_dir}}/* && sudo mkdir -p {{celos_workflows_dir}}
&& sudo chown {{celos_user}}:{{celos_user}} {{celos_workflows_dir}}
- name: Prepare database dir
shell: sudo rm -rf {{celos_db_dir}}/* && sudo mkdir -p {{celos_db_dir}}
&& sudo chown {{celos_user}}:{{celos_user}} {{celos_db_dir}}
- name: Testing servlet /celos/workflow-list
local_action: shell curl {{inventory_hostname}}:8080/celos/workflow-list | diff - test_files/empty_workflow_list.json
| ---
# Playbook to perform integration testing on Celos
#
# Uploads sample workflows to the Celos master node and verifies that
# the result of the /celos/workflow-list servlet lists the workflows.
- hosts: hadoop_masters
gather_facts: no
vars:
local_celos: ..
celos_port: 8080
celos_workflows_dir: /etc/celos/workflows
celos_db_dir: /var/lib/celos/db
+ celos_user: ubuntu
tasks:
- - name: Remove old files, if any
+ - name: Prepare configuration dir
- shell: sudo rm -rf {{celos_workflows_dir}}/* {{celos_db_dir}}/*
? ^^ --
+ shell: sudo rm -rf {{celos_workflows_dir}}/* && sudo mkdir -p {{celos_workflows_dir}}
? +++++++++++++++++ ^^^^^^^^^
- && sudo mkdir -p {{celos_workflows_dir}}
- && sudo mkdir -p {{celos_db_dir}}
+ && sudo chown {{celos_user}}:{{celos_user}} {{celos_workflows_dir}}
+
+ - name: Prepare database dir
+ shell: sudo rm -rf {{celos_db_dir}}/* && sudo mkdir -p {{celos_db_dir}}
+ && sudo chown {{celos_user}}:{{celos_user}} {{celos_db_dir}}
- name: Testing servlet /celos/workflow-list
local_action: shell curl {{inventory_hostname}}:8080/celos/workflow-list | diff - test_files/empty_workflow_list.json | 12 | 0.521739 | 8 | 4 |
bf2cc97b98f876e1564877186a0171054787f27c | RequestKit/JSONPostRouter.swift | RequestKit/JSONPostRouter.swift | import Foundation
public protocol JSONPostRouter: Router {
func postJSON<T>(session: RequestKitURLSession, expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol?
}
public extension JSONPostRouter {
public func postJSON<T>(session: RequestKitURLSession = NSURLSession.sharedSession(), expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol? {
guard let request = request() else {
return nil
}
let data: NSData
do {
data = try NSJSONSerialization.dataWithJSONObject(params, options: NSJSONWritingOptions())
} catch {
completion(json: nil, error: error)
return nil
}
let task = session.uploadTaskWithRequest(request, fromData: data) { data, response, error in
if let response = response as? NSHTTPURLResponse {
if response.statusCode != 201 {
let error = NSError(domain: errorDomain, code: response.statusCode, userInfo: nil)
completion(json: nil, error: error)
return
}
}
if let error = error {
completion(json: nil, error: error)
} else {
if let data = data {
do {
let JSON = try NSJSONSerialization.JSONObjectWithData(data, options: .MutableContainers) as? T
completion(json: JSON, error: nil)
} catch {
completion(json: nil, error: error)
}
}
}
}
task.resume()
return task
}
}
| import Foundation
public protocol JSONPostRouter: Router {
func postJSON<T>(session: RequestKitURLSession, expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol?
}
public extension JSONPostRouter {
public func postJSON<T>(session: RequestKitURLSession = NSURLSession.sharedSession(), expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol? {
guard let request = request() else {
return nil
}
let data: NSData
do {
data = try NSJSONSerialization.dataWithJSONObject(params, options: NSJSONWritingOptions())
} catch {
completion(json: nil, error: error)
return nil
}
let task = session.uploadTaskWithRequest(request, fromData: data) { data, response, error in
if let response = response as? NSHTTPURLResponse {
if !response.wasSuccessful {
let error = NSError(domain: errorDomain, code: response.statusCode, userInfo: nil)
completion(json: nil, error: error)
return
}
}
if let error = error {
completion(json: nil, error: error)
} else {
if let data = data {
do {
let JSON = try NSJSONSerialization.JSONObjectWithData(data, options: .MutableContainers) as? T
completion(json: JSON, error: nil)
} catch {
completion(json: nil, error: error)
}
}
}
}
task.resume()
return task
}
}
| Check if response was succesfull | Check if response was succesfull
https://github.com/nerdishbynature/RequestKit/pull/14#discussion_r64321258
| Swift | mit | nerdishbynature/RequestKit,nerdishbynature/RequestKit,nerdishbynature/RequestKit | swift | ## Code Before:
import Foundation
public protocol JSONPostRouter: Router {
func postJSON<T>(session: RequestKitURLSession, expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol?
}
public extension JSONPostRouter {
public func postJSON<T>(session: RequestKitURLSession = NSURLSession.sharedSession(), expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol? {
guard let request = request() else {
return nil
}
let data: NSData
do {
data = try NSJSONSerialization.dataWithJSONObject(params, options: NSJSONWritingOptions())
} catch {
completion(json: nil, error: error)
return nil
}
let task = session.uploadTaskWithRequest(request, fromData: data) { data, response, error in
if let response = response as? NSHTTPURLResponse {
if response.statusCode != 201 {
let error = NSError(domain: errorDomain, code: response.statusCode, userInfo: nil)
completion(json: nil, error: error)
return
}
}
if let error = error {
completion(json: nil, error: error)
} else {
if let data = data {
do {
let JSON = try NSJSONSerialization.JSONObjectWithData(data, options: .MutableContainers) as? T
completion(json: JSON, error: nil)
} catch {
completion(json: nil, error: error)
}
}
}
}
task.resume()
return task
}
}
## Instruction:
Check if response was succesfull
https://github.com/nerdishbynature/RequestKit/pull/14#discussion_r64321258
## Code After:
import Foundation
public protocol JSONPostRouter: Router {
func postJSON<T>(session: RequestKitURLSession, expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol?
}
public extension JSONPostRouter {
public func postJSON<T>(session: RequestKitURLSession = NSURLSession.sharedSession(), expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol? {
guard let request = request() else {
return nil
}
let data: NSData
do {
data = try NSJSONSerialization.dataWithJSONObject(params, options: NSJSONWritingOptions())
} catch {
completion(json: nil, error: error)
return nil
}
let task = session.uploadTaskWithRequest(request, fromData: data) { data, response, error in
if let response = response as? NSHTTPURLResponse {
if !response.wasSuccessful {
let error = NSError(domain: errorDomain, code: response.statusCode, userInfo: nil)
completion(json: nil, error: error)
return
}
}
if let error = error {
completion(json: nil, error: error)
} else {
if let data = data {
do {
let JSON = try NSJSONSerialization.JSONObjectWithData(data, options: .MutableContainers) as? T
completion(json: JSON, error: nil)
} catch {
completion(json: nil, error: error)
}
}
}
}
task.resume()
return task
}
}
| import Foundation
public protocol JSONPostRouter: Router {
func postJSON<T>(session: RequestKitURLSession, expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol?
}
public extension JSONPostRouter {
public func postJSON<T>(session: RequestKitURLSession = NSURLSession.sharedSession(), expectedResultType: T.Type, completion: (json: T?, error: ErrorType?) -> Void) -> URLSessionDataTaskProtocol? {
guard let request = request() else {
return nil
}
let data: NSData
do {
data = try NSJSONSerialization.dataWithJSONObject(params, options: NSJSONWritingOptions())
} catch {
completion(json: nil, error: error)
return nil
}
let task = session.uploadTaskWithRequest(request, fromData: data) { data, response, error in
if let response = response as? NSHTTPURLResponse {
- if response.statusCode != 201 {
+ if !response.wasSuccessful {
let error = NSError(domain: errorDomain, code: response.statusCode, userInfo: nil)
completion(json: nil, error: error)
return
}
}
if let error = error {
completion(json: nil, error: error)
} else {
if let data = data {
do {
let JSON = try NSJSONSerialization.JSONObjectWithData(data, options: .MutableContainers) as? T
completion(json: JSON, error: nil)
} catch {
completion(json: nil, error: error)
}
}
}
}
task.resume()
return task
}
} | 2 | 0.043478 | 1 | 1 |
d822f8d3518797435eedfaf82bf38fc6992a8d56 | README.md | README.md | The goal of this repository is to try out GraphQL to become familiar with the technology to possibly apply it toward future projects
## Setup
### Server
The server will be a [Spark](http://sparkjava.com/) server because it is supposed to be simple to setup. I will then use [graphql-java](https://github.com/graphql-java) for the server side GraphQL implementation.
### Client
The client will be done in [Angular](https://angular.io/) and use the [Apollo Client](http://dev.apollodata.com/). I've chosen [Angular](https://angular.io/) because it is the most likely client side framework that I'd use in the near future for a new project.
## Goals
- [x] Get a basic GraphQL server running
- [x] Call a basic GraphQL endpoint from within an Angular application
- [ ] Query for nested data
- [ ] Push updates to a query from the server and have the Angular application update
- [ ] Explore paging and filtering
- [ ] Figure out how strong typing of TypeScript works since GraphQL allows for partial object data
- [ ] Integrate with [@ngrx/store](https://github.com/ngrx/store)
| The goal of this repository is to try out GraphQL to become familiar with the technology to possibly apply it toward future projects
## Setup
### Server
The server will be a [Spark](http://sparkjava.com/) server because it is supposed to be simple to setup. I will then use [graphql-java](https://github.com/graphql-java) for the server side GraphQL implementation.
### Client
The client will be done in [Angular](https://angular.io/) and use the [Apollo Client](http://dev.apollodata.com/). I've chosen [Angular](https://angular.io/) because it is the most likely client side framework that I'd use in the near future for a new project.
## Goals
- [x] Get a basic GraphQL server running
- [x] Call a basic GraphQL endpoint from within an Angular application
- [ ] Query for nested data
- [ ] Update data from client to server
- [ ] Push updates to a query from the server and have the Angular application update
- [ ] Explore paging and filtering
- [ ] Figure out how strong typing of TypeScript works since GraphQL allows for partial object data
- [ ] Integrate with [@ngrx/store](https://github.com/ngrx/store)
| Add goal about sending updates | Add goal about sending updates | Markdown | mit | justindoherty/helloworld-graphql,justindoherty/helloworld-graphql,justindoherty/helloworld-graphql,justindoherty/helloworld-graphql | markdown | ## Code Before:
The goal of this repository is to try out GraphQL to become familiar with the technology to possibly apply it toward future projects
## Setup
### Server
The server will be a [Spark](http://sparkjava.com/) server because it is supposed to be simple to setup. I will then use [graphql-java](https://github.com/graphql-java) for the server side GraphQL implementation.
### Client
The client will be done in [Angular](https://angular.io/) and use the [Apollo Client](http://dev.apollodata.com/). I've chosen [Angular](https://angular.io/) because it is the most likely client side framework that I'd use in the near future for a new project.
## Goals
- [x] Get a basic GraphQL server running
- [x] Call a basic GraphQL endpoint from within an Angular application
- [ ] Query for nested data
- [ ] Push updates to a query from the server and have the Angular application update
- [ ] Explore paging and filtering
- [ ] Figure out how strong typing of TypeScript works since GraphQL allows for partial object data
- [ ] Integrate with [@ngrx/store](https://github.com/ngrx/store)
## Instruction:
Add goal about sending updates
## Code After:
The goal of this repository is to try out GraphQL to become familiar with the technology to possibly apply it toward future projects
## Setup
### Server
The server will be a [Spark](http://sparkjava.com/) server because it is supposed to be simple to setup. I will then use [graphql-java](https://github.com/graphql-java) for the server side GraphQL implementation.
### Client
The client will be done in [Angular](https://angular.io/) and use the [Apollo Client](http://dev.apollodata.com/). I've chosen [Angular](https://angular.io/) because it is the most likely client side framework that I'd use in the near future for a new project.
## Goals
- [x] Get a basic GraphQL server running
- [x] Call a basic GraphQL endpoint from within an Angular application
- [ ] Query for nested data
- [ ] Update data from client to server
- [ ] Push updates to a query from the server and have the Angular application update
- [ ] Explore paging and filtering
- [ ] Figure out how strong typing of TypeScript works since GraphQL allows for partial object data
- [ ] Integrate with [@ngrx/store](https://github.com/ngrx/store)
| The goal of this repository is to try out GraphQL to become familiar with the technology to possibly apply it toward future projects
## Setup
### Server
The server will be a [Spark](http://sparkjava.com/) server because it is supposed to be simple to setup. I will then use [graphql-java](https://github.com/graphql-java) for the server side GraphQL implementation.
### Client
The client will be done in [Angular](https://angular.io/) and use the [Apollo Client](http://dev.apollodata.com/). I've chosen [Angular](https://angular.io/) because it is the most likely client side framework that I'd use in the near future for a new project.
## Goals
- [x] Get a basic GraphQL server running
- [x] Call a basic GraphQL endpoint from within an Angular application
- [ ] Query for nested data
+ - [ ] Update data from client to server
- [ ] Push updates to a query from the server and have the Angular application update
- [ ] Explore paging and filtering
- [ ] Figure out how strong typing of TypeScript works since GraphQL allows for partial object data
- [ ] Integrate with [@ngrx/store](https://github.com/ngrx/store) | 1 | 0.058824 | 1 | 0 |
9e22b6ba129bb5074af7ddb9902b94fac9e288ab | sc/src/main/webapp/WEB-INF/jsp/layouts/home-body.jsp | sc/src/main/webapp/WEB-INF/jsp/layouts/home-body.jsp | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<section>
<tiles:insertAttribute name="home-hero"/>
</section>
<section class="margin-top-large">
<tiles:insertAttribute name="home-search"/>
</section>
<section class="margin-top-large">
<div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
<div class="columns">
<tiles:insertAttribute name="first-box"/>
</div>
<div class="columns">
<tiles:insertAttribute name="second-box"/>
</div>
</div>
</section>
<section class="margin-top-large">
<div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
<div class="columns">
<tiles:insertAttribute name="third-box"/>
</div>
<div class="columns">
<tiles:insertAttribute name="fourth-box"/>
</div>
</div>
</section>
| <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<section>
<tiles:insertAttribute name="home-hero"/>
</section>
<section class="margin-top-large">
<div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
<div class="columns">
<tiles:insertAttribute name="second-box"/>
</div>
<div class="columns">
<tiles:insertAttribute name="fourth-box"/>
</div>
</div>
</section>
| Put only Latest Experiments and Publications in section | Put only Latest Experiments and Publications in section
| Java Server Pages | apache-2.0 | gxa/atlas,gxa/atlas,gxa/atlas,gxa/atlas,gxa/atlas | java-server-pages | ## Code Before:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<section>
<tiles:insertAttribute name="home-hero"/>
</section>
<section class="margin-top-large">
<tiles:insertAttribute name="home-search"/>
</section>
<section class="margin-top-large">
<div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
<div class="columns">
<tiles:insertAttribute name="first-box"/>
</div>
<div class="columns">
<tiles:insertAttribute name="second-box"/>
</div>
</div>
</section>
<section class="margin-top-large">
<div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
<div class="columns">
<tiles:insertAttribute name="third-box"/>
</div>
<div class="columns">
<tiles:insertAttribute name="fourth-box"/>
</div>
</div>
</section>
## Instruction:
Put only Latest Experiments and Publications in section
## Code After:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<section>
<tiles:insertAttribute name="home-hero"/>
</section>
<section class="margin-top-large">
<div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
<div class="columns">
<tiles:insertAttribute name="second-box"/>
</div>
<div class="columns">
<tiles:insertAttribute name="fourth-box"/>
</div>
</div>
</section>
| <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<section>
<tiles:insertAttribute name="home-hero"/>
</section>
<section class="margin-top-large">
- <tiles:insertAttribute name="home-search"/>
- </section>
-
- <section class="margin-top-large">
<div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
<div class="columns">
- <tiles:insertAttribute name="first-box"/>
- </div>
- <div class="columns">
<tiles:insertAttribute name="second-box"/>
- </div>
- </div>
- </section>
-
- <section class="margin-top-large">
- <div class="row small-up-1 medium-up-1 large-up-2" data-equalizer>
- <div class="columns">
- <tiles:insertAttribute name="third-box"/>
</div>
<div class="columns">
<tiles:insertAttribute name="fourth-box"/>
</div>
</div>
</section> | 15 | 0.46875 | 0 | 15 |
769edfb173b02147668a83a97f575b50a8287d04 | compare/readme.md | compare/readme.md |
[Results](./results.html)
|
[Results](https://docs.google.com/spreadsheets/d/e/2PACX-1vSK7Li2nS-Bur9arAYF9IfT37MP-ohAe1v19lZu5fd9MajI1fSveLAQZyEie4Ea9k5-SWHTff7nL2DW/pubhtml?gid=0&single=true)
| Change to point to doc | Change to point to doc
(to avoid github forcing html to render as text) | Markdown | apache-2.0 | tkaitchuck/aHash,tkaitchuck/aHash | markdown | ## Code Before:
[Results](./results.html)
## Instruction:
Change to point to doc
(to avoid github forcing html to render as text)
## Code After:
[Results](https://docs.google.com/spreadsheets/d/e/2PACX-1vSK7Li2nS-Bur9arAYF9IfT37MP-ohAe1v19lZu5fd9MajI1fSveLAQZyEie4Ea9k5-SWHTff7nL2DW/pubhtml?gid=0&single=true)
|
- [Results](./results.html)
+ [Results](https://docs.google.com/spreadsheets/d/e/2PACX-1vSK7Li2nS-Bur9arAYF9IfT37MP-ohAe1v19lZu5fd9MajI1fSveLAQZyEie4Ea9k5-SWHTff7nL2DW/pubhtml?gid=0&single=true)
| 2 | 0.666667 | 1 | 1 |
6439b3999f729c1689889845d879c2cb3b54266c | test/benchmarks/performance_vs_serial/linear_fft_pipeline.py | test/benchmarks/performance_vs_serial/linear_fft_pipeline.py | """ Test a pipeline with repeated FFTs and inverse FFTs """
from timeit import default_timer as timer
import numpy as np
import bifrost as bf
from bifrost import pipeline as bfp
from bifrost import blocks as blocks
from bifrost_benchmarks import PipelineBenchmarker
class GPUFFTBenchmarker(PipelineBenchmarker):
""" Test the sigproc read function """
def run_benchmark(self):
with bf.Pipeline() as pipeline:
datafile = "numpy_data0.bin"
data = blocks.binary_io.BinaryFileReadBlock(
[datafile], gulp_size=32768, gulp_nframe=4, dtype='f32')
#data.on_data = self.timeit(data.on_data)
start = timer()
pipeline.run()
end = timer()
self.total_clock_time = end-start
#sigproc_benchmarker = SigprocBenchmarker()
#print sigproc_benchmarker.average_benchmark(10)
t = np.arange(32768*1024)
w = 0.01
s = np.sin(w * 4 * t, dtype='float32')
with open('numpy_data0.bin', 'wb') as myfile: pass
s.tofile('numpy_data0.bin')
gpufftbenchmarker = GPUFFTBenchmarker()
print gpufftbenchmarker.average_benchmark(10)
| """ Test a pipeline with repeated FFTs and inverse FFTs """
from timeit import default_timer as timer
import numpy as np
import bifrost as bf
from bifrost import pipeline as bfp
from bifrost import blocks as blocks
from bifrost_benchmarks import PipelineBenchmarker
class GPUFFTBenchmarker(PipelineBenchmarker):
""" Test the sigproc read function """
def run_benchmark(self):
with bf.Pipeline() as pipeline:
datafile = "numpy_data0.bin"
bc = bf.BlockChainer()
bc.blocks.binary_io.BinaryFileReadBlock(
[datafile], gulp_size=32768, gulp_nframe=4, dtype='f32')
bc.blocks.copy('cuda')
bc.blocks.print_header()
start = timer()
pipeline.run()
end = timer()
self.total_clock_time = end-start
#sigproc_benchmarker = SigprocBenchmarker()
#print sigproc_benchmarker.average_benchmark(10)
t = np.arange(32768*1024)
w = 0.01
s = np.sin(w * 4 * t, dtype='float32')
with open('numpy_data0.bin', 'wb') as myfile: pass
s.tofile('numpy_data0.bin')
gpufftbenchmarker = GPUFFTBenchmarker()
print gpufftbenchmarker.average_benchmark(4)
| Switch to using block chainer | Switch to using block chainer
| Python | bsd-3-clause | ledatelescope/bifrost,ledatelescope/bifrost,ledatelescope/bifrost,ledatelescope/bifrost | python | ## Code Before:
""" Test a pipeline with repeated FFTs and inverse FFTs """
from timeit import default_timer as timer
import numpy as np
import bifrost as bf
from bifrost import pipeline as bfp
from bifrost import blocks as blocks
from bifrost_benchmarks import PipelineBenchmarker
class GPUFFTBenchmarker(PipelineBenchmarker):
""" Test the sigproc read function """
def run_benchmark(self):
with bf.Pipeline() as pipeline:
datafile = "numpy_data0.bin"
data = blocks.binary_io.BinaryFileReadBlock(
[datafile], gulp_size=32768, gulp_nframe=4, dtype='f32')
#data.on_data = self.timeit(data.on_data)
start = timer()
pipeline.run()
end = timer()
self.total_clock_time = end-start
#sigproc_benchmarker = SigprocBenchmarker()
#print sigproc_benchmarker.average_benchmark(10)
t = np.arange(32768*1024)
w = 0.01
s = np.sin(w * 4 * t, dtype='float32')
with open('numpy_data0.bin', 'wb') as myfile: pass
s.tofile('numpy_data0.bin')
gpufftbenchmarker = GPUFFTBenchmarker()
print gpufftbenchmarker.average_benchmark(10)
## Instruction:
Switch to using block chainer
## Code After:
""" Test a pipeline with repeated FFTs and inverse FFTs """
from timeit import default_timer as timer
import numpy as np
import bifrost as bf
from bifrost import pipeline as bfp
from bifrost import blocks as blocks
from bifrost_benchmarks import PipelineBenchmarker
class GPUFFTBenchmarker(PipelineBenchmarker):
""" Test the sigproc read function """
def run_benchmark(self):
with bf.Pipeline() as pipeline:
datafile = "numpy_data0.bin"
bc = bf.BlockChainer()
bc.blocks.binary_io.BinaryFileReadBlock(
[datafile], gulp_size=32768, gulp_nframe=4, dtype='f32')
bc.blocks.copy('cuda')
bc.blocks.print_header()
start = timer()
pipeline.run()
end = timer()
self.total_clock_time = end-start
#sigproc_benchmarker = SigprocBenchmarker()
#print sigproc_benchmarker.average_benchmark(10)
t = np.arange(32768*1024)
w = 0.01
s = np.sin(w * 4 * t, dtype='float32')
with open('numpy_data0.bin', 'wb') as myfile: pass
s.tofile('numpy_data0.bin')
gpufftbenchmarker = GPUFFTBenchmarker()
print gpufftbenchmarker.average_benchmark(4)
| """ Test a pipeline with repeated FFTs and inverse FFTs """
from timeit import default_timer as timer
import numpy as np
import bifrost as bf
from bifrost import pipeline as bfp
from bifrost import blocks as blocks
from bifrost_benchmarks import PipelineBenchmarker
class GPUFFTBenchmarker(PipelineBenchmarker):
""" Test the sigproc read function """
def run_benchmark(self):
with bf.Pipeline() as pipeline:
datafile = "numpy_data0.bin"
+
+ bc = bf.BlockChainer()
- data = blocks.binary_io.BinaryFileReadBlock(
? ^^^^^^^
+ bc.blocks.binary_io.BinaryFileReadBlock(
? ^^^
[datafile], gulp_size=32768, gulp_nframe=4, dtype='f32')
- #data.on_data = self.timeit(data.on_data)
+ bc.blocks.copy('cuda')
+ bc.blocks.print_header()
start = timer()
pipeline.run()
end = timer()
self.total_clock_time = end-start
#sigproc_benchmarker = SigprocBenchmarker()
#print sigproc_benchmarker.average_benchmark(10)
t = np.arange(32768*1024)
w = 0.01
s = np.sin(w * 4 * t, dtype='float32')
with open('numpy_data0.bin', 'wb') as myfile: pass
s.tofile('numpy_data0.bin')
gpufftbenchmarker = GPUFFTBenchmarker()
- print gpufftbenchmarker.average_benchmark(10)
? ^^
+ print gpufftbenchmarker.average_benchmark(4)
? ^
| 9 | 0.28125 | 6 | 3 |
9d162a2919a1c9b56ded74d40963fa022fc7943b | src/config/settings/testing.py | src/config/settings/testing.py | """Django configuration for testing and CI environments."""
from .common import *
# Use in-memory file storage
DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'
# Speed!
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'TEST': {}
}
}
env = get_secret("ENVIRONMENT")
import sys
if os.path.isdir('/Volumes/RAMDisk') and not env == 'ci' and not 'create-db' in sys.argv:
# and this allows you to use --reuse-db to skip re-creating the db,
# even faster!
#
# To create the RAMDisk, use bash:
# $ hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB))
# /dev/disk2
# $ diskutil eraseVolume HFS+ RAMDisk /dev/disk2
DATABASES['default']['TEST']['NAME'] = '/Volumes/RAMDisk/unkenmathe.test.db.sqlite3'
| """Django configuration for testing and CI environments."""
from .common import *
# Use in-memory file storage
DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'
# Speed!
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'TEST': {}
}
}
# Disable logging
import logging
logging.disable(logging.CRITICAL)
env = get_secret("ENVIRONMENT")
import sys
if os.path.isdir('/Volumes/RAMDisk') and not env == 'ci' and not 'create-db' in sys.argv:
# and this allows you to use --reuse-db to skip re-creating the db,
# even faster!
#
# To create the RAMDisk, use bash:
# $ hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB))
# /dev/disk2
# $ diskutil eraseVolume HFS+ RAMDisk /dev/disk2
DATABASES['default']['TEST']['NAME'] = '/Volumes/RAMDisk/unkenmathe.test.db.sqlite3'
| Disable logging in test runs | Disable logging in test runs
SPEED!
| Python | agpl-3.0 | FlowFX/unkenmathe.de,FlowFX/unkenmathe.de,FlowFX/unkenmathe.de,FlowFX/unkenmathe.de | python | ## Code Before:
"""Django configuration for testing and CI environments."""
from .common import *
# Use in-memory file storage
DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'
# Speed!
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'TEST': {}
}
}
env = get_secret("ENVIRONMENT")
import sys
if os.path.isdir('/Volumes/RAMDisk') and not env == 'ci' and not 'create-db' in sys.argv:
# and this allows you to use --reuse-db to skip re-creating the db,
# even faster!
#
# To create the RAMDisk, use bash:
# $ hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB))
# /dev/disk2
# $ diskutil eraseVolume HFS+ RAMDisk /dev/disk2
DATABASES['default']['TEST']['NAME'] = '/Volumes/RAMDisk/unkenmathe.test.db.sqlite3'
## Instruction:
Disable logging in test runs
SPEED!
## Code After:
"""Django configuration for testing and CI environments."""
from .common import *
# Use in-memory file storage
DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'
# Speed!
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'TEST': {}
}
}
# Disable logging
import logging
logging.disable(logging.CRITICAL)
env = get_secret("ENVIRONMENT")
import sys
if os.path.isdir('/Volumes/RAMDisk') and not env == 'ci' and not 'create-db' in sys.argv:
# and this allows you to use --reuse-db to skip re-creating the db,
# even faster!
#
# To create the RAMDisk, use bash:
# $ hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB))
# /dev/disk2
# $ diskutil eraseVolume HFS+ RAMDisk /dev/disk2
DATABASES['default']['TEST']['NAME'] = '/Volumes/RAMDisk/unkenmathe.test.db.sqlite3'
| """Django configuration for testing and CI environments."""
from .common import *
# Use in-memory file storage
DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'
# Speed!
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'TEST': {}
}
}
+ # Disable logging
+ import logging
+ logging.disable(logging.CRITICAL)
+
env = get_secret("ENVIRONMENT")
import sys
if os.path.isdir('/Volumes/RAMDisk') and not env == 'ci' and not 'create-db' in sys.argv:
# and this allows you to use --reuse-db to skip re-creating the db,
# even faster!
#
# To create the RAMDisk, use bash:
# $ hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB))
# /dev/disk2
# $ diskutil eraseVolume HFS+ RAMDisk /dev/disk2
DATABASES['default']['TEST']['NAME'] = '/Volumes/RAMDisk/unkenmathe.test.db.sqlite3' | 4 | 0.125 | 4 | 0 |
0798ad99e384fb91233ff0ba9c7ab8f439d1cb85 | public/js/report.js | public/js/report.js | /* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name + '-' + mode
var e = document.getElementById(id)
var ej = $(e)
e.style.display = e.style.display == 'table-row' ? 'none' : 'table-row'
$('#' + id + '-btn').toggleClass('active')
if (e.style.display === 'table-row') {
if (ej.hasClass('loaded')) return
$.getJSON('/api/' + slot + '/' + date + '/' + name, null,
function success (data) {
ej.find('code.language-git').html(
decodeURIComponent(escape(atob(data[mode]))))
ej.addClass('loaded')
Prism.highlightAll() // FIXME
})
}
}
function hide (id) {
var e = document.getElementById(id)
e.style.display = 'none'
$('#' + id + '-btn').removeClass('active')
}
function show_diff (name) {
hide(name + '-stderr')
toggle(name, 'diff')
}
function show_err (name) {
hide(name + '-diff')
toggle(name, 'stderr')
}
| /* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name.replace(/\./g, '\\.') + '-' + mode
, e = $('#' + id)
if (e.css('display') === 'none') var activating = 1
else var activating = 0
e.css('display', activating ? 'table-row' : 'none')
$('#' + id + '-btn').toggleClass('active')
if (activating) {
if (e.hasClass('loaded')) return
$.getJSON('/api/' + slot + '/' + date + '/' + name, null,
function success (data) {
var codeElement = e.find('code.language-git')
codeElement.html(decodeURIComponent(escape(atob(data[mode]))))
e.addClass('loaded')
Prism.highlightElement(codeElement[0])
})
}
}
function hide (id) {
var e = document.getElementById(id)
e.style.display = 'none'
$('#' + id.replace(/\./g, '\\.') + '-btn').removeClass('active')
}
function show_diff (name) {
hide(name + '-stderr')
toggle(name, 'diff')
}
function show_err (name) {
hide(name + '-diff')
toggle(name, 'stderr')
}
| Fix dot escaping for jQuery and use $()[0] | Fix dot escaping for jQuery and use $()[0]
| JavaScript | mit | TimothyGu/fateserver-node,TimothyGu/fateserver-node | javascript | ## Code Before:
/* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name + '-' + mode
var e = document.getElementById(id)
var ej = $(e)
e.style.display = e.style.display == 'table-row' ? 'none' : 'table-row'
$('#' + id + '-btn').toggleClass('active')
if (e.style.display === 'table-row') {
if (ej.hasClass('loaded')) return
$.getJSON('/api/' + slot + '/' + date + '/' + name, null,
function success (data) {
ej.find('code.language-git').html(
decodeURIComponent(escape(atob(data[mode]))))
ej.addClass('loaded')
Prism.highlightAll() // FIXME
})
}
}
function hide (id) {
var e = document.getElementById(id)
e.style.display = 'none'
$('#' + id + '-btn').removeClass('active')
}
function show_diff (name) {
hide(name + '-stderr')
toggle(name, 'diff')
}
function show_err (name) {
hide(name + '-diff')
toggle(name, 'stderr')
}
## Instruction:
Fix dot escaping for jQuery and use $()[0]
## Code After:
/* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
var id = name.replace(/\./g, '\\.') + '-' + mode
, e = $('#' + id)
if (e.css('display') === 'none') var activating = 1
else var activating = 0
e.css('display', activating ? 'table-row' : 'none')
$('#' + id + '-btn').toggleClass('active')
if (activating) {
if (e.hasClass('loaded')) return
$.getJSON('/api/' + slot + '/' + date + '/' + name, null,
function success (data) {
var codeElement = e.find('code.language-git')
codeElement.html(decodeURIComponent(escape(atob(data[mode]))))
e.addClass('loaded')
Prism.highlightElement(codeElement[0])
})
}
}
function hide (id) {
var e = document.getElementById(id)
e.style.display = 'none'
$('#' + id.replace(/\./g, '\\.') + '-btn').removeClass('active')
}
function show_diff (name) {
hide(name + '-stderr')
toggle(name, 'diff')
}
function show_err (name) {
hide(name + '-diff')
toggle(name, 'stderr')
}
| /* Can't use $.toggle() as we are using a custom `display` that is `none`
when the page first loads */
function toggle (name, mode) {
- var id = name + '-' + mode
- var e = document.getElementById(id)
- var ej = $(e)
- e.style.display = e.style.display == 'table-row' ? 'none' : 'table-row'
+ var id = name.replace(/\./g, '\\.') + '-' + mode
+ , e = $('#' + id)
+ if (e.css('display') === 'none') var activating = 1
+ else var activating = 0
+ e.css('display', activating ? 'table-row' : 'none')
$('#' + id + '-btn').toggleClass('active')
- if (e.style.display === 'table-row') {
+ if (activating) {
- if (ej.hasClass('loaded')) return
? -
+ if (e.hasClass('loaded')) return
$.getJSON('/api/' + slot + '/' + date + '/' + name, null,
function success (data) {
- ej.find('code.language-git').html(
+ var codeElement = e.find('code.language-git')
- decodeURIComponent(escape(atob(data[mode]))))
? ^^
+ codeElement.html(decodeURIComponent(escape(atob(data[mode]))))
? ^^^^^^^^^^^^^^^^^
- ej.addClass('loaded')
? -
+ e.addClass('loaded')
- Prism.highlightAll() // FIXME
+ Prism.highlightElement(codeElement[0])
})
}
}
function hide (id) {
var e = document.getElementById(id)
e.style.display = 'none'
- $('#' + id + '-btn').removeClass('active')
+ $('#' + id.replace(/\./g, '\\.') + '-btn').removeClass('active')
? ++++++++++++++++++++++
}
function show_diff (name) {
hide(name + '-stderr')
toggle(name, 'diff')
}
function show_err (name) {
hide(name + '-diff')
toggle(name, 'stderr')
} | 23 | 0.71875 | 12 | 11 |
5e132023cf71def9dc61c2e436d01e5a2cbb30b1 | .circleci/export_lib_version.sh | .circleci/export_lib_version.sh |
function match {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -nE $*
else
sed -nr $*
fi
}
LIB_VERSION_MAJOR=`cat CMakeLists.txt | match 's/set\(VERSION_MAJOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_MINOR=`cat CMakeLists.txt | match 's/set\(VERSION_MINOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_PATCH=`cat CMakeLists.txt | match 's/set\(VERSION_PATCH.*([0-9]+).*\)/\1/p'`
LIB_VERSION=$LIB_VERSION_MAJOR.$LIB_VERSION_MINOR.$LIB_VERSION_PATCH
echo "export LIB_VERSION=$LIB_VERSION" >> $BASH_ENV
echo "=====> Libcore version"
echo $LIB_VERSION |
function match {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -nE $*
else
sed -nr $*
fi
}
LIB_VERSION_MAJOR=`cat CMakeLists.txt | match 's/set\(VERSION_MAJOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_MINOR=`cat CMakeLists.txt | match 's/set\(VERSION_MINOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_PATCH=`cat CMakeLists.txt | match 's/set\(VERSION_PATCH.*([0-9]+).*\)/\1/p'`
LIB_VERSION=$LIB_VERSION_MAJOR.$LIB_VERSION_MINOR.$LIB_VERSION_PATCH
if [ -z "$CIRCLE_TAG" ]; then
COMMIT_HASH=`echo $CIRCLE_SHA1 | cut -c 1-6`
LIB_VERSION="$LIB_VERSION-rc-$COMMIT_HASH"
fi
echo "export LIB_VERSION=$LIB_VERSION" >> $BASH_ENV
echo "=====> Libcore version"
echo $LIB_VERSION | Replace Javascript module to get libcore by shell script | Replace Javascript module to get libcore by shell script
| Shell | mit | LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core | shell | ## Code Before:
function match {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -nE $*
else
sed -nr $*
fi
}
LIB_VERSION_MAJOR=`cat CMakeLists.txt | match 's/set\(VERSION_MAJOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_MINOR=`cat CMakeLists.txt | match 's/set\(VERSION_MINOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_PATCH=`cat CMakeLists.txt | match 's/set\(VERSION_PATCH.*([0-9]+).*\)/\1/p'`
LIB_VERSION=$LIB_VERSION_MAJOR.$LIB_VERSION_MINOR.$LIB_VERSION_PATCH
echo "export LIB_VERSION=$LIB_VERSION" >> $BASH_ENV
echo "=====> Libcore version"
echo $LIB_VERSION
## Instruction:
Replace Javascript module to get libcore by shell script
## Code After:
function match {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -nE $*
else
sed -nr $*
fi
}
LIB_VERSION_MAJOR=`cat CMakeLists.txt | match 's/set\(VERSION_MAJOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_MINOR=`cat CMakeLists.txt | match 's/set\(VERSION_MINOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_PATCH=`cat CMakeLists.txt | match 's/set\(VERSION_PATCH.*([0-9]+).*\)/\1/p'`
LIB_VERSION=$LIB_VERSION_MAJOR.$LIB_VERSION_MINOR.$LIB_VERSION_PATCH
if [ -z "$CIRCLE_TAG" ]; then
COMMIT_HASH=`echo $CIRCLE_SHA1 | cut -c 1-6`
LIB_VERSION="$LIB_VERSION-rc-$COMMIT_HASH"
fi
echo "export LIB_VERSION=$LIB_VERSION" >> $BASH_ENV
echo "=====> Libcore version"
echo $LIB_VERSION |
function match {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -nE $*
else
sed -nr $*
fi
}
LIB_VERSION_MAJOR=`cat CMakeLists.txt | match 's/set\(VERSION_MAJOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_MINOR=`cat CMakeLists.txt | match 's/set\(VERSION_MINOR.*([0-9]+).*\)/\1/p'`
LIB_VERSION_PATCH=`cat CMakeLists.txt | match 's/set\(VERSION_PATCH.*([0-9]+).*\)/\1/p'`
LIB_VERSION=$LIB_VERSION_MAJOR.$LIB_VERSION_MINOR.$LIB_VERSION_PATCH
+ if [ -z "$CIRCLE_TAG" ]; then
+ COMMIT_HASH=`echo $CIRCLE_SHA1 | cut -c 1-6`
+ LIB_VERSION="$LIB_VERSION-rc-$COMMIT_HASH"
+ fi
+
echo "export LIB_VERSION=$LIB_VERSION" >> $BASH_ENV
echo "=====> Libcore version"
echo $LIB_VERSION | 5 | 0.277778 | 5 | 0 |
f0327148cc472f706111bc51d5e9e58254a3510a | indico/modules/attachments/templates/create_folder.html | indico/modules/attachments/templates/create_folder.html | {% from 'forms/_form.html' import form_header, form_footer, form_rows %}
{% block content -%}
{{ form_header(form)}}
{{ form_rows(form) }}
{{ protection_message | safe }}
{% call form_footer(attach_form) %}
<input class="i-button big highlight" type="submit" value="{% trans %}Submit{% endtrans %}">
<button class="i-button big" data-button-back>{% trans %}Cancel{% endtrans %}</button>
{% endcall %}
<script>
aclIfProtected($('#protected'), $('#acl'), $('.self-protection-message'), $('.inherited-protection-message'), null,
$('.folder-protection-message'));
</script>
{%- endblock %}
| {% from 'forms/_form.html' import form_header, form_footer, form_rows %}
{% block content -%}
{{ form_header(form)}}
{{ form_rows(form, skip=('protected', 'acl')) }}
{{ form_rows(form, fields=('protected', 'acl')) }}
{{ protection_message | safe }}
{% call form_footer(attach_form) %}
<input class="i-button big highlight" type="submit" value="{% trans %}Submit{% endtrans %}">
<button class="i-button big" data-button-back>{% trans %}Cancel{% endtrans %}</button>
{% endcall %}
<script>
aclIfProtected($('#protected'), $('#acl'), $('.self-protection-message'), $('.inherited-protection-message'), null,
$('.folder-protection-message'));
</script>
{%- endblock %}
| Reorder protected field in folder creation dialog | Reorder protected field in folder creation dialog
| HTML | mit | mvidalgarcia/indico,DirkHoffmann/indico,DirkHoffmann/indico,indico/indico,mic4ael/indico,ThiefMaster/indico,mvidalgarcia/indico,indico/indico,pferreir/indico,OmeGak/indico,ThiefMaster/indico,indico/indico,OmeGak/indico,DirkHoffmann/indico,DirkHoffmann/indico,mic4ael/indico,pferreir/indico,indico/indico,ThiefMaster/indico,OmeGak/indico,mvidalgarcia/indico,OmeGak/indico,mic4ael/indico,pferreir/indico,mvidalgarcia/indico,ThiefMaster/indico,pferreir/indico,mic4ael/indico | html | ## Code Before:
{% from 'forms/_form.html' import form_header, form_footer, form_rows %}
{% block content -%}
{{ form_header(form)}}
{{ form_rows(form) }}
{{ protection_message | safe }}
{% call form_footer(attach_form) %}
<input class="i-button big highlight" type="submit" value="{% trans %}Submit{% endtrans %}">
<button class="i-button big" data-button-back>{% trans %}Cancel{% endtrans %}</button>
{% endcall %}
<script>
aclIfProtected($('#protected'), $('#acl'), $('.self-protection-message'), $('.inherited-protection-message'), null,
$('.folder-protection-message'));
</script>
{%- endblock %}
## Instruction:
Reorder protected field in folder creation dialog
## Code After:
{% from 'forms/_form.html' import form_header, form_footer, form_rows %}
{% block content -%}
{{ form_header(form)}}
{{ form_rows(form, skip=('protected', 'acl')) }}
{{ form_rows(form, fields=('protected', 'acl')) }}
{{ protection_message | safe }}
{% call form_footer(attach_form) %}
<input class="i-button big highlight" type="submit" value="{% trans %}Submit{% endtrans %}">
<button class="i-button big" data-button-back>{% trans %}Cancel{% endtrans %}</button>
{% endcall %}
<script>
aclIfProtected($('#protected'), $('#acl'), $('.self-protection-message'), $('.inherited-protection-message'), null,
$('.folder-protection-message'));
</script>
{%- endblock %}
| {% from 'forms/_form.html' import form_header, form_footer, form_rows %}
{% block content -%}
{{ form_header(form)}}
- {{ form_rows(form) }}
+ {{ form_rows(form, skip=('protected', 'acl')) }}
+ {{ form_rows(form, fields=('protected', 'acl')) }}
{{ protection_message | safe }}
{% call form_footer(attach_form) %}
<input class="i-button big highlight" type="submit" value="{% trans %}Submit{% endtrans %}">
<button class="i-button big" data-button-back>{% trans %}Cancel{% endtrans %}</button>
{% endcall %}
<script>
aclIfProtected($('#protected'), $('#acl'), $('.self-protection-message'), $('.inherited-protection-message'), null,
$('.folder-protection-message'));
</script>
{%- endblock %} | 3 | 0.2 | 2 | 1 |
863b2970580cb1ced7d051158b5087612143dbdd | scripts/vagrant-env.sh | scripts/vagrant-env.sh | export VAGRANT_SSH_CONFIG=$(mktemp)
vagrant ssh-config > "$VAGRANT_SSH_CONFIG"
function get_jenkins_home() {
ssh -F "${VAGRANT_SSH_CONFIG}" default /bin/bash <<'EOF'
CONFIG_FILE=""
if sudo test -f /etc/sysconfig/jenkins && sudo grep '^JENKINS_HOME' /etc/sysconfig/jenkins &> /dev/null; then
CONFIG_FILE='/etc/sysconfig/jenkins'
elif sudo test -f /etc/default/jenkins && sudo grep '^JENKINS_HOME' /etc/default/jenkins &> /dev/null; then
CONFIG_FILE='/etc/default/jenkins'
fi
if test -n "${CONFIG_FILE}"; then
eval "$(sudo grep '^JENKINS_HOME' "${CONFIG_FILE}")"
fi
echo "${JENKINS_HOME:-/var/lib/jenkins}"
EOF
}
VAGRANT_JENKINS_HOME="$(get_jenkins_home)"
if [ -z "${JENKINS_PASSWORD}" ]; then
while ! ssh -nF "${VAGRANT_SSH_CONFIG}" default "sudo test -f \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword"; do
echo '/var/lib/jenkins/secrets/initialAdminPassword not available, yet...'
sleep 5
done
export JENKINS_PASSWORD=$(ssh -F "${VAGRANT_SSH_CONFIG}" default "sudo cat \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword")
fi
| export VAGRANT_SSH_CONFIG=$(mktemp)
vagrant ssh-config > "$VAGRANT_SSH_CONFIG"
function get_jenkins_home() {
ssh -F "${VAGRANT_SSH_CONFIG}" default /bin/bash <<'EOF'
CONFIG_FILE=""
if sudo test -f /etc/sysconfig/jenkins && sudo grep '^JENKINS_HOME' /etc/sysconfig/jenkins &> /dev/null; then
CONFIG_FILE='/etc/sysconfig/jenkins'
elif sudo test -f /etc/default/jenkins && sudo grep '^JENKINS_HOME' /etc/default/jenkins &> /dev/null; then
CONFIG_FILE='/etc/default/jenkins'
fi
if test -n "${CONFIG_FILE}"; then
eval "$(sudo grep '^JENKINS_HOME' "${CONFIG_FILE}")"
fi
echo "${JENKINS_HOME:-/var/lib/jenkins}"
EOF
}
VAGRANT_JENKINS_HOME="$(get_jenkins_home)"
if [ -z "${JENKINS_PASSWORD}" ]; then
while ! ssh -nF "${VAGRANT_SSH_CONFIG}" default "sudo test -f \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword"; do
echo "${VAGRANT_JENKINS_HOME}/secrets/initialAdminPassword not available, yet..."
sleep 5
done
export JENKINS_PASSWORD=$(ssh -F "${VAGRANT_SSH_CONFIG}" default "sudo cat \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword")
fi
| Fix message waiting for initial Admin secret | Fix message waiting for initial Admin secret
| Shell | apache-2.0 | samrocketman/jenkins-bootstrap-shared,samrocketman/jenkins-bootstrap-shared | shell | ## Code Before:
export VAGRANT_SSH_CONFIG=$(mktemp)
vagrant ssh-config > "$VAGRANT_SSH_CONFIG"
function get_jenkins_home() {
ssh -F "${VAGRANT_SSH_CONFIG}" default /bin/bash <<'EOF'
CONFIG_FILE=""
if sudo test -f /etc/sysconfig/jenkins && sudo grep '^JENKINS_HOME' /etc/sysconfig/jenkins &> /dev/null; then
CONFIG_FILE='/etc/sysconfig/jenkins'
elif sudo test -f /etc/default/jenkins && sudo grep '^JENKINS_HOME' /etc/default/jenkins &> /dev/null; then
CONFIG_FILE='/etc/default/jenkins'
fi
if test -n "${CONFIG_FILE}"; then
eval "$(sudo grep '^JENKINS_HOME' "${CONFIG_FILE}")"
fi
echo "${JENKINS_HOME:-/var/lib/jenkins}"
EOF
}
VAGRANT_JENKINS_HOME="$(get_jenkins_home)"
if [ -z "${JENKINS_PASSWORD}" ]; then
while ! ssh -nF "${VAGRANT_SSH_CONFIG}" default "sudo test -f \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword"; do
echo '/var/lib/jenkins/secrets/initialAdminPassword not available, yet...'
sleep 5
done
export JENKINS_PASSWORD=$(ssh -F "${VAGRANT_SSH_CONFIG}" default "sudo cat \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword")
fi
## Instruction:
Fix message waiting for initial Admin secret
## Code After:
export VAGRANT_SSH_CONFIG=$(mktemp)
vagrant ssh-config > "$VAGRANT_SSH_CONFIG"
function get_jenkins_home() {
ssh -F "${VAGRANT_SSH_CONFIG}" default /bin/bash <<'EOF'
CONFIG_FILE=""
if sudo test -f /etc/sysconfig/jenkins && sudo grep '^JENKINS_HOME' /etc/sysconfig/jenkins &> /dev/null; then
CONFIG_FILE='/etc/sysconfig/jenkins'
elif sudo test -f /etc/default/jenkins && sudo grep '^JENKINS_HOME' /etc/default/jenkins &> /dev/null; then
CONFIG_FILE='/etc/default/jenkins'
fi
if test -n "${CONFIG_FILE}"; then
eval "$(sudo grep '^JENKINS_HOME' "${CONFIG_FILE}")"
fi
echo "${JENKINS_HOME:-/var/lib/jenkins}"
EOF
}
VAGRANT_JENKINS_HOME="$(get_jenkins_home)"
if [ -z "${JENKINS_PASSWORD}" ]; then
while ! ssh -nF "${VAGRANT_SSH_CONFIG}" default "sudo test -f \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword"; do
echo "${VAGRANT_JENKINS_HOME}/secrets/initialAdminPassword not available, yet..."
sleep 5
done
export JENKINS_PASSWORD=$(ssh -F "${VAGRANT_SSH_CONFIG}" default "sudo cat \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword")
fi
| export VAGRANT_SSH_CONFIG=$(mktemp)
vagrant ssh-config > "$VAGRANT_SSH_CONFIG"
function get_jenkins_home() {
ssh -F "${VAGRANT_SSH_CONFIG}" default /bin/bash <<'EOF'
CONFIG_FILE=""
if sudo test -f /etc/sysconfig/jenkins && sudo grep '^JENKINS_HOME' /etc/sysconfig/jenkins &> /dev/null; then
CONFIG_FILE='/etc/sysconfig/jenkins'
elif sudo test -f /etc/default/jenkins && sudo grep '^JENKINS_HOME' /etc/default/jenkins &> /dev/null; then
CONFIG_FILE='/etc/default/jenkins'
fi
if test -n "${CONFIG_FILE}"; then
eval "$(sudo grep '^JENKINS_HOME' "${CONFIG_FILE}")"
fi
echo "${JENKINS_HOME:-/var/lib/jenkins}"
EOF
}
VAGRANT_JENKINS_HOME="$(get_jenkins_home)"
if [ -z "${JENKINS_PASSWORD}" ]; then
while ! ssh -nF "${VAGRANT_SSH_CONFIG}" default "sudo test -f \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword"; do
- echo '/var/lib/jenkins/secrets/initialAdminPassword not available, yet...'
+ echo "${VAGRANT_JENKINS_HOME}/secrets/initialAdminPassword not available, yet..."
sleep 5
done
export JENKINS_PASSWORD=$(ssh -F "${VAGRANT_SSH_CONFIG}" default "sudo cat \"${VAGRANT_JENKINS_HOME}\"/secrets/initialAdminPassword")
fi | 2 | 0.076923 | 1 | 1 |
ad5532e1156b059bdf527179b430993f16f38e77 | publishes/config.php | publishes/config.php | <?php
return [
'providers' => [
#\App\Http\Terranet\Administrator\Navigation\Providers\PagesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\RoutesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\LinksProvider::class,
],
'paths' => [
'provider' => "Http/Terranet/Administrator/Navigation/Providers"
]
]; | <?php
return [
'providers' => [
#\App\Http\Terranet\Administrator\Navigation\Providers\PagesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\RoutesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\LinksProvider::class,
],
'paths' => [
'provider' => "Http/Terranet/Administrator/Navigation/Providers"
],
# Routes under these prefixes will be skipped from navigation module.
'skip' => [
'cms', 'horizon', 'api', 'auth'
],
];
| Add a set of prefixes for routes skipping | Add a set of prefixes for routes skipping | PHP | mit | adminarchitect/navigation,adminarchitect/navigation,adminarchitect/navigation | php | ## Code Before:
<?php
return [
'providers' => [
#\App\Http\Terranet\Administrator\Navigation\Providers\PagesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\RoutesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\LinksProvider::class,
],
'paths' => [
'provider' => "Http/Terranet/Administrator/Navigation/Providers"
]
];
## Instruction:
Add a set of prefixes for routes skipping
## Code After:
<?php
return [
'providers' => [
#\App\Http\Terranet\Administrator\Navigation\Providers\PagesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\RoutesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\LinksProvider::class,
],
'paths' => [
'provider' => "Http/Terranet/Administrator/Navigation/Providers"
],
# Routes under these prefixes will be skipped from navigation module.
'skip' => [
'cms', 'horizon', 'api', 'auth'
],
];
| <?php
return [
'providers' => [
#\App\Http\Terranet\Administrator\Navigation\Providers\PagesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\RoutesProvider::class,
\App\Http\Terranet\Administrator\Navigation\Providers\LinksProvider::class,
],
'paths' => [
'provider' => "Http/Terranet/Administrator/Navigation/Providers"
- ]
+ ],
? +
+
+ # Routes under these prefixes will be skipped from navigation module.
+ 'skip' => [
+ 'cms', 'horizon', 'api', 'auth'
+ ],
]; | 7 | 0.538462 | 6 | 1 |
366316b0ea20ae178670581b61c52c481682d2b0 | cosmic_ray/operators/exception_replacer.py | cosmic_ray/operators/exception_replacer.py | import ast
import builtins
from .operator import Operator
class OutOfNoWhereException(Exception):
pass
setattr(builtins, OutOfNoWhereException.__name__, OutOfNoWhereException)
class ExceptionReplacer(Operator):
"""An operator that modifies exception handlers."""
def visit_ExceptHandler(self, node): # noqa
return self.visit_mutation_site(node)
def mutate(self, node, _):
"""Modify the exception handler with another exception type."""
except_id = OutOfNoWhereException.__name__
except_type = ast.Name(id=except_id, ctx=ast.Load())
new_node = ast.ExceptHandler(type=except_type, name=node.name,
body=node.body)
return new_node
| import ast
import builtins
from .operator import Operator
class CosmicRayTestingException(Exception):
pass
setattr(builtins, CosmicRayTestingException.__name__, CosmicRayTestingException)
class ExceptionReplacer(Operator):
"""An operator that modifies exception handlers."""
def visit_ExceptHandler(self, node): # noqa
return self.visit_mutation_site(node)
def mutate(self, node, _):
"""Modify the exception handler with another exception type."""
except_id = CosmicRayTestingException.__name__
except_type = ast.Name(id=except_id, ctx=ast.Load())
new_node = ast.ExceptHandler(type=except_type, name=node.name,
body=node.body)
return new_node
| Change exception name to CosmicRayTestingException | Change exception name to CosmicRayTestingException
| Python | mit | sixty-north/cosmic-ray | python | ## Code Before:
import ast
import builtins
from .operator import Operator
class OutOfNoWhereException(Exception):
pass
setattr(builtins, OutOfNoWhereException.__name__, OutOfNoWhereException)
class ExceptionReplacer(Operator):
"""An operator that modifies exception handlers."""
def visit_ExceptHandler(self, node): # noqa
return self.visit_mutation_site(node)
def mutate(self, node, _):
"""Modify the exception handler with another exception type."""
except_id = OutOfNoWhereException.__name__
except_type = ast.Name(id=except_id, ctx=ast.Load())
new_node = ast.ExceptHandler(type=except_type, name=node.name,
body=node.body)
return new_node
## Instruction:
Change exception name to CosmicRayTestingException
## Code After:
import ast
import builtins
from .operator import Operator
class CosmicRayTestingException(Exception):
pass
setattr(builtins, CosmicRayTestingException.__name__, CosmicRayTestingException)
class ExceptionReplacer(Operator):
"""An operator that modifies exception handlers."""
def visit_ExceptHandler(self, node): # noqa
return self.visit_mutation_site(node)
def mutate(self, node, _):
"""Modify the exception handler with another exception type."""
except_id = CosmicRayTestingException.__name__
except_type = ast.Name(id=except_id, ctx=ast.Load())
new_node = ast.ExceptHandler(type=except_type, name=node.name,
body=node.body)
return new_node
| import ast
import builtins
from .operator import Operator
- class OutOfNoWhereException(Exception):
+ class CosmicRayTestingException(Exception):
pass
- setattr(builtins, OutOfNoWhereException.__name__, OutOfNoWhereException)
+ setattr(builtins, CosmicRayTestingException.__name__, CosmicRayTestingException)
class ExceptionReplacer(Operator):
"""An operator that modifies exception handlers."""
def visit_ExceptHandler(self, node): # noqa
return self.visit_mutation_site(node)
def mutate(self, node, _):
"""Modify the exception handler with another exception type."""
- except_id = OutOfNoWhereException.__name__
? ^^ ^^^^^^^^^
+ except_id = CosmicRayTestingException.__name__
? ^^^^^^^^^^^^ ^^^
except_type = ast.Name(id=except_id, ctx=ast.Load())
new_node = ast.ExceptHandler(type=except_type, name=node.name,
body=node.body)
return new_node | 6 | 0.230769 | 3 | 3 |
0e11b9273b5b2e1d22d8dcd744cebf5de19c147b | lib/template/lib/endpoints/base.rb | lib/template/lib/endpoints/base.rb | module Endpoints
# The base class for all Sinatra-based endpoints. Use sparingly.
class Base < Sinatra::Base
register Pliny::Extensions::Instruments
register Sinatra::Namespace
helpers Pliny::Helpers::Encode
helpers Pliny::Helpers::Params
set :dump_errors, false
set :raise_errors, true
set :root, Config.root
set :show_exceptions, false
configure :development do
register Sinatra::Reloader
also_reload '../**/*.rb'
end
error Sinatra::NotFound do
content_type :json
status 404
"{}"
end
end
end
| module Endpoints
# The base class for all Sinatra-based endpoints. Use sparingly.
class Base < Sinatra::Base
register Pliny::Extensions::Instruments
register Sinatra::Namespace
helpers Pliny::Helpers::Encode
helpers Pliny::Helpers::Params
set :dump_errors, false
set :raise_errors, true
set :root, Config.root
set :show_exceptions, false
configure :development do
register Sinatra::Reloader
also_reload '../**/*.rb'
end
error Sinatra::NotFound do
content_type :json
status 404
{ id: "not_found", message: "Resource not found" }.to_json
end
end
end
| Return an id and message in body when 404 in json. | Return an id and message in body when 404 in json.
All other errors return something with `id` and `message`.
This is just uniformising the behavior there.
| Ruby | mit | fdr/pliny,interagent/pliny,hayduke19us/pliny,interagent/pliny,interagent/pliny,fdr/pliny,hayduke19us/pliny,fdr/pliny,hayduke19us/pliny | ruby | ## Code Before:
module Endpoints
# The base class for all Sinatra-based endpoints. Use sparingly.
class Base < Sinatra::Base
register Pliny::Extensions::Instruments
register Sinatra::Namespace
helpers Pliny::Helpers::Encode
helpers Pliny::Helpers::Params
set :dump_errors, false
set :raise_errors, true
set :root, Config.root
set :show_exceptions, false
configure :development do
register Sinatra::Reloader
also_reload '../**/*.rb'
end
error Sinatra::NotFound do
content_type :json
status 404
"{}"
end
end
end
## Instruction:
Return an id and message in body when 404 in json.
All other errors return something with `id` and `message`.
This is just uniformising the behavior there.
## Code After:
module Endpoints
# The base class for all Sinatra-based endpoints. Use sparingly.
class Base < Sinatra::Base
register Pliny::Extensions::Instruments
register Sinatra::Namespace
helpers Pliny::Helpers::Encode
helpers Pliny::Helpers::Params
set :dump_errors, false
set :raise_errors, true
set :root, Config.root
set :show_exceptions, false
configure :development do
register Sinatra::Reloader
also_reload '../**/*.rb'
end
error Sinatra::NotFound do
content_type :json
status 404
{ id: "not_found", message: "Resource not found" }.to_json
end
end
end
| module Endpoints
# The base class for all Sinatra-based endpoints. Use sparingly.
class Base < Sinatra::Base
register Pliny::Extensions::Instruments
register Sinatra::Namespace
helpers Pliny::Helpers::Encode
helpers Pliny::Helpers::Params
set :dump_errors, false
set :raise_errors, true
set :root, Config.root
set :show_exceptions, false
configure :development do
register Sinatra::Reloader
also_reload '../**/*.rb'
end
error Sinatra::NotFound do
content_type :json
status 404
- "{}"
+ { id: "not_found", message: "Resource not found" }.to_json
end
end
end | 2 | 0.076923 | 1 | 1 |
3af42f80ceeb89ebc9acf01ed4296067e2d53e7b | .travis.yml | .travis.yml | language: java
script:
- javac -version
jdk:
- oraclejdk8
notifications:
email:
on_success: never
on_failure: never
| before_install:
- echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
- sudo add-apt-repository ppa:webupd8team/java
- sudo apt-get update
- sudo apt-get install oracle-java8-installer
script:
- echo $JAVA_HOME
- javac -version
notifications:
email:
on_success: never
on_failure: never
| Use Java 8 from webupd8 team. | Use Java 8 from webupd8 team.
| YAML | apache-2.0 | schleichardt/travis-ci-playground,schleichardt/travis-ci-playground | yaml | ## Code Before:
language: java
script:
- javac -version
jdk:
- oraclejdk8
notifications:
email:
on_success: never
on_failure: never
## Instruction:
Use Java 8 from webupd8 team.
## Code After:
before_install:
- echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
- sudo add-apt-repository ppa:webupd8team/java
- sudo apt-get update
- sudo apt-get install oracle-java8-installer
script:
- echo $JAVA_HOME
- javac -version
notifications:
email:
on_success: never
on_failure: never
| - language: java
+ before_install:
+ - echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
+ - sudo add-apt-repository ppa:webupd8team/java
+ - sudo apt-get update
+ - sudo apt-get install oracle-java8-installer
+
script:
+ - echo $JAVA_HOME
- javac -version
+
- jdk:
- - oraclejdk8
notifications:
email:
on_success: never
on_failure: never | 11 | 1.222222 | 8 | 3 |
bd024bcf60de23c19ee11b8eaf332acb8e04ddb0 | package.json | package.json | {
"name": "ElasticSlider-core",
"main": "dist/elasticslider.min.js",
"version": "0.4.7",
"description": "A carousel for developers.",
"files": [
"dist"
],
"dependencies": {},
"devDependencies": {
"babel-preset-es2015": "^6.1.2",
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.0",
"gulp-concat": "^2.6.0",
"gulp-connect": "^2.2.0",
"gulp-header": "^1.7.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.4.2"
},
"scripts": {
"start": "gulp serve"
},
"author": "Jamy Golden",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/JamyGolden/ElasticSlider-core.git"
}
}
| {
"name": "ElasticSlider-core",
"main": "dist/elasticslider.min.js",
"version": "0.4.7",
"description": "A carousel for developers.",
"files": [
"dist"
],
"dependencies": {},
"devDependencies": {
"babel-preset-es2015": "^6.3.13",
"del": "^2.2.0",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.2",
"gulp-concat": "^2.6.0",
"gulp-connect": "^2.3.1",
"gulp-header": "^1.7.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1"
},
"scripts": {
"start": "gulp serve",
"release": "gulp"
},
"author": "Jamy Golden",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/JamyGolden/ElasticSlider-core.git"
}
}
| Update deps and add release task | Update deps and add release task
| JSON | mit | JamyGolden/ElasticSlider,JamyGolden/ElasticSlider,JamyGolden/ElasticSlider-core,JamyGolden/ElasticSlider-core | json | ## Code Before:
{
"name": "ElasticSlider-core",
"main": "dist/elasticslider.min.js",
"version": "0.4.7",
"description": "A carousel for developers.",
"files": [
"dist"
],
"dependencies": {},
"devDependencies": {
"babel-preset-es2015": "^6.1.2",
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.0",
"gulp-concat": "^2.6.0",
"gulp-connect": "^2.2.0",
"gulp-header": "^1.7.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.4.2"
},
"scripts": {
"start": "gulp serve"
},
"author": "Jamy Golden",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/JamyGolden/ElasticSlider-core.git"
}
}
## Instruction:
Update deps and add release task
## Code After:
{
"name": "ElasticSlider-core",
"main": "dist/elasticslider.min.js",
"version": "0.4.7",
"description": "A carousel for developers.",
"files": [
"dist"
],
"dependencies": {},
"devDependencies": {
"babel-preset-es2015": "^6.3.13",
"del": "^2.2.0",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.2",
"gulp-concat": "^2.6.0",
"gulp-connect": "^2.3.1",
"gulp-header": "^1.7.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1"
},
"scripts": {
"start": "gulp serve",
"release": "gulp"
},
"author": "Jamy Golden",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/JamyGolden/ElasticSlider-core.git"
}
}
| {
"name": "ElasticSlider-core",
"main": "dist/elasticslider.min.js",
"version": "0.4.7",
"description": "A carousel for developers.",
"files": [
"dist"
],
"dependencies": {},
"devDependencies": {
- "babel-preset-es2015": "^6.1.2",
? ^^
+ "babel-preset-es2015": "^6.3.13",
? ++ ^
- "del": "^2.0.2",
? --
+ "del": "^2.2.0",
? ++
"gulp": "^3.9.0",
- "gulp-babel": "^6.1.0",
? ^
+ "gulp-babel": "^6.1.2",
? ^
"gulp-concat": "^2.6.0",
- "gulp-connect": "^2.2.0",
? ^ ^
+ "gulp-connect": "^2.3.1",
? ^ ^
"gulp-header": "^1.7.1",
"gulp-sourcemaps": "^1.6.0",
- "gulp-uglify": "^1.4.2"
? ^ ^
+ "gulp-uglify": "^1.5.1"
? ^ ^
},
"scripts": {
- "start": "gulp serve"
+ "start": "gulp serve",
? +
+ "release": "gulp"
},
"author": "Jamy Golden",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/JamyGolden/ElasticSlider-core.git"
}
} | 13 | 0.433333 | 7 | 6 |
e2208e98a7978600d33ec91ff80814b51615130a | battery/js/main.js | battery/js/main.js | var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;
function log(message){
document.querySelector("#data").innerHTML += message + "<br />";
}
if (battery) {
log("Battery level: " + battery.level);
log("Battery charging: " + battery.charging);
log("Battery discharging time: ", battery.dischargingTime);
battery.addEventListener("chargingchange", function(e) {
log("Battery chargingchange event: " + battery.charging);
}, false);
} else {
log("Shame! The Battery API is not supported on this platform.")
}
| var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;
function log(message){
document.querySelector("#data").innerHTML += message + "<br />";
}
function logBattery(battery) {
log("Battery level: " + battery.level);
log("Battery charging: " + battery.charging);
log("Battery discharging time: ", battery.dischargingTime);
battery.addEventListener("chargingchange", function(e) {
log("Battery chargingchange event: " + battery.charging);
}, false);
}
if(navigator.getBattery) {
navigator.getBattery().then(logBattery, function() {
log("There was an error while getting the battery state.");
});
} else if (battery) {
logBattery(battery);
} else {
log("Shame! The Battery API is not supported on this platform.")
}
| Update the battery example to match the spec | Update the battery example to match the spec
Uses the `navigator.getBattery()` promise when available instead of the deprecated `navigator.battery` | JavaScript | apache-2.0 | mvenkatesh431/simpl,mauricionr/simpl,gtrdotmcs/simpl,gtrdotmcs/simpl,DigitalCoder/simpl,austad/simpl,mportuesisf/simpl,austad/simpl,SarahCheaib/simpl,mvenkatesh431/simpl,mauricionr/simpl,nishartm/simpl,mportuesisf/simpl,staskh/simpl,austad/simpl,nishartm/simpl,bolabola/simpl,calderaro/simpl,SarahCheaib/simpl,DigitalCoder/simpl,ptool/simpl,memezilla/simpl,bolabola/simpl,memezilla/simpl,ptool/simpl,mvenkatesh431/simpl,calderaro/simpl,SarahCheaib/simpl,bolabola/simpl,calderaro/simpl,snake0zero/simpl,staskh/simpl,mauricionr/simpl,samdutton/simpl,snake0zero/simpl,ptool/simpl,DigitalCoder/simpl,nishartm/simpl,gtrdotmcs/simpl,samdutton/simpl,memezilla/simpl,staskh/simpl,snake0zero/simpl | javascript | ## Code Before:
var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;
function log(message){
document.querySelector("#data").innerHTML += message + "<br />";
}
if (battery) {
log("Battery level: " + battery.level);
log("Battery charging: " + battery.charging);
log("Battery discharging time: ", battery.dischargingTime);
battery.addEventListener("chargingchange", function(e) {
log("Battery chargingchange event: " + battery.charging);
}, false);
} else {
log("Shame! The Battery API is not supported on this platform.")
}
## Instruction:
Update the battery example to match the spec
Uses the `navigator.getBattery()` promise when available instead of the deprecated `navigator.battery`
## Code After:
var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;
function log(message){
document.querySelector("#data").innerHTML += message + "<br />";
}
function logBattery(battery) {
log("Battery level: " + battery.level);
log("Battery charging: " + battery.charging);
log("Battery discharging time: ", battery.dischargingTime);
battery.addEventListener("chargingchange", function(e) {
log("Battery chargingchange event: " + battery.charging);
}, false);
}
if(navigator.getBattery) {
navigator.getBattery().then(logBattery, function() {
log("There was an error while getting the battery state.");
});
} else if (battery) {
logBattery(battery);
} else {
log("Shame! The Battery API is not supported on this platform.")
}
| var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;
function log(message){
document.querySelector("#data").innerHTML += message + "<br />";
}
- if (battery) {
+ function logBattery(battery) {
log("Battery level: " + battery.level);
log("Battery charging: " + battery.charging);
log("Battery discharging time: ", battery.dischargingTime);
battery.addEventListener("chargingchange", function(e) {
log("Battery chargingchange event: " + battery.charging);
}, false);
+ }
+
+ if(navigator.getBattery) {
+ navigator.getBattery().then(logBattery, function() {
+ log("There was an error while getting the battery state.");
+ });
+ } else if (battery) {
+ logBattery(battery);
} else {
log("Shame! The Battery API is not supported on this platform.")
} | 10 | 0.625 | 9 | 1 |
6992f843da6a8488cd482cb195469615b72d720b | README.md | README.md | magento2-Profibro_Paystack
======================
Paystack payment gateway Magento2 extension
Install
=======
1. Go to Magento2 root folder
2. Enter following commands to install module:
```bash
composer config repositories.paystackinline git https://github.com/ibrahimlawal/magento2-Profibro_Paystack.git
composer require profibro/paystack:dev-develop
```
Wait while dependencies are updated.
3. Enter following commands to enable module:
```bash
php bin/magento module:enable Profibro_Paystack --clear-static-content
php bin/magento setup:upgrade
```
4. Enable and configure Paystack Inline in Magento Admin under Stores/Configuration/Payment Methods/Paystack
Other Notes
===========
**Paystack works with NGN only!** If NGN is not your base currency, you will not see this module on checkout pages.
| magento2-Profibro_Paystack
======================
Paystack payment gateway Magento2 extension
Install
=======
1. Go to Magento2 root folder
2. Enter following commands to install module:
```bash
composer config repositories.paystackinline git https://github.com/ibrahimlawal/magento2-Profibro_Paystack.git
composer require profibro/paystack:dev-develop
```
Wait while dependencies are updated.
3. Enter following commands to enable module:
```bash
php bin/magento module:enable Profibro_Paystack --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
```
4. Enable and configure Paystack in Magento Admin under Stores/Configuration/Payment Methods
Other Notes
===========
**Paystack works with NGN only!** If NGN is not your base currency, you will not see this module on checkout pages.
| Add command for DI compilation | [plus] Add command for DI compilation
| Markdown | mit | ibrahimlawal/magento2-Profibro_Paystack,ibrahimlawal/magento2-Profibro_Paystack,ibrahimlawal/magento2-Profibro_Paystack | markdown | ## Code Before:
magento2-Profibro_Paystack
======================
Paystack payment gateway Magento2 extension
Install
=======
1. Go to Magento2 root folder
2. Enter following commands to install module:
```bash
composer config repositories.paystackinline git https://github.com/ibrahimlawal/magento2-Profibro_Paystack.git
composer require profibro/paystack:dev-develop
```
Wait while dependencies are updated.
3. Enter following commands to enable module:
```bash
php bin/magento module:enable Profibro_Paystack --clear-static-content
php bin/magento setup:upgrade
```
4. Enable and configure Paystack Inline in Magento Admin under Stores/Configuration/Payment Methods/Paystack
Other Notes
===========
**Paystack works with NGN only!** If NGN is not your base currency, you will not see this module on checkout pages.
## Instruction:
[plus] Add command for DI compilation
## Code After:
magento2-Profibro_Paystack
======================
Paystack payment gateway Magento2 extension
Install
=======
1. Go to Magento2 root folder
2. Enter following commands to install module:
```bash
composer config repositories.paystackinline git https://github.com/ibrahimlawal/magento2-Profibro_Paystack.git
composer require profibro/paystack:dev-develop
```
Wait while dependencies are updated.
3. Enter following commands to enable module:
```bash
php bin/magento module:enable Profibro_Paystack --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
```
4. Enable and configure Paystack in Magento Admin under Stores/Configuration/Payment Methods
Other Notes
===========
**Paystack works with NGN only!** If NGN is not your base currency, you will not see this module on checkout pages.
| magento2-Profibro_Paystack
======================
Paystack payment gateway Magento2 extension
Install
=======
1. Go to Magento2 root folder
2. Enter following commands to install module:
```bash
composer config repositories.paystackinline git https://github.com/ibrahimlawal/magento2-Profibro_Paystack.git
composer require profibro/paystack:dev-develop
```
Wait while dependencies are updated.
3. Enter following commands to enable module:
```bash
php bin/magento module:enable Profibro_Paystack --clear-static-content
php bin/magento setup:upgrade
+ php bin/magento setup:di:compile
```
- 4. Enable and configure Paystack Inline in Magento Admin under Stores/Configuration/Payment Methods/Paystack
? ------- ---------
+ 4. Enable and configure Paystack in Magento Admin under Stores/Configuration/Payment Methods
Other Notes
===========
**Paystack works with NGN only!** If NGN is not your base currency, you will not see this module on checkout pages. | 3 | 0.1 | 2 | 1 |
41392b8055a0813ddc1bf7dc7e8eb3d3cdf5f978 | app/assets/javascripts/voluntary_ranking/app.js | app/assets/javascripts/voluntary_ranking/app.js | //= require ./store
//= require_tree ./mixins
//= require_tree ./models
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router.js.coffee
//= require_tree ./routes
//= require_self
| //= require_tree ./mixins
//= require_tree ./models
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router.js.coffee
//= require_tree ./routes
//= require_self
| Remove voluntary ranking sttore setting. | Remove voluntary ranking sttore setting.
| JavaScript | mit | volontariat/voluntary_ranking,volontariat/voluntary_ranking,volontariat/voluntary_ranking | javascript | ## Code Before:
//= require ./store
//= require_tree ./mixins
//= require_tree ./models
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router.js.coffee
//= require_tree ./routes
//= require_self
## Instruction:
Remove voluntary ranking sttore setting.
## Code After:
//= require_tree ./mixins
//= require_tree ./models
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router.js.coffee
//= require_tree ./routes
//= require_self
| - //= require ./store
//= require_tree ./mixins
//= require_tree ./models
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router.js.coffee
//= require_tree ./routes
//= require_self | 1 | 0.1 | 0 | 1 |
f5b50a158c076cb406ea8d55d613debed9816fb4 | src/components/Heading/index.js | src/components/Heading/index.js | import styled from "@emotion/styled"
import PropTypes from "prop-types"
import React from "react"
const styles = {
"& a": {
background: "none",
textShadow: "none",
},
}
const headings = {
h1: styled.h1(styles),
h2: styled.h2(styles),
h3: styled.h3(styles),
h4: styled.h4(styles),
h5: styled.h5(styles),
h6: styled.h6(styles),
}
const Heading = ({ children, level, ...props }) => {
const H = headings[level]
return <H {...props}>{children}</H>
}
export default Heading
Heading.propTypes = {
children: PropTypes.node,
level: PropTypes.oneOf(Object.keys(headings)),
}
| import PropTypes from "prop-types"
import React from "react"
const styles = {
a: {
background: "none",
textShadow: "none",
},
code: {
fontSize: "inherit",
},
}
export const Heading = ({ children, level, ...props }) => {
const H = level
return (
<H css={styles} {...props}>
{children}
</H>
)
}
export const HeadingFactory = level => ({ children, ...props }) => (
<Heading level={level} {...props}>
{children}
</Heading>
)
export default Heading
Heading.propTypes = {
children: PropTypes.node,
level: PropTypes.oneOf(["h1", "h2", "h3", "h4", "h5", "h6"]),
}
| Fix nested styles on headings | Fix nested styles on headings
| JavaScript | mit | jbhannah/jbhannah.net,jbhannah/jbhannah.net | javascript | ## Code Before:
import styled from "@emotion/styled"
import PropTypes from "prop-types"
import React from "react"
const styles = {
"& a": {
background: "none",
textShadow: "none",
},
}
const headings = {
h1: styled.h1(styles),
h2: styled.h2(styles),
h3: styled.h3(styles),
h4: styled.h4(styles),
h5: styled.h5(styles),
h6: styled.h6(styles),
}
const Heading = ({ children, level, ...props }) => {
const H = headings[level]
return <H {...props}>{children}</H>
}
export default Heading
Heading.propTypes = {
children: PropTypes.node,
level: PropTypes.oneOf(Object.keys(headings)),
}
## Instruction:
Fix nested styles on headings
## Code After:
import PropTypes from "prop-types"
import React from "react"
const styles = {
a: {
background: "none",
textShadow: "none",
},
code: {
fontSize: "inherit",
},
}
export const Heading = ({ children, level, ...props }) => {
const H = level
return (
<H css={styles} {...props}>
{children}
</H>
)
}
export const HeadingFactory = level => ({ children, ...props }) => (
<Heading level={level} {...props}>
{children}
</Heading>
)
export default Heading
Heading.propTypes = {
children: PropTypes.node,
level: PropTypes.oneOf(["h1", "h2", "h3", "h4", "h5", "h6"]),
}
| - import styled from "@emotion/styled"
import PropTypes from "prop-types"
import React from "react"
const styles = {
- "& a": {
? --- -
+ a: {
background: "none",
textShadow: "none",
},
+ code: {
+ fontSize: "inherit",
+ },
}
- const headings = {
- h1: styled.h1(styles),
- h2: styled.h2(styles),
- h3: styled.h3(styles),
- h4: styled.h4(styles),
- h5: styled.h5(styles),
- h6: styled.h6(styles),
+ export const Heading = ({ children, level, ...props }) => {
+ const H = level
+ return (
+ <H css={styles} {...props}>
+ {children}
+ </H>
+ )
}
- const Heading = ({ children, level, ...props }) => {
- const H = headings[level]
- return <H {...props}>{children}</H>
- }
+ export const HeadingFactory = level => ({ children, ...props }) => (
+ <Heading level={level} {...props}>
+ {children}
+ </Heading>
+ )
export default Heading
Heading.propTypes = {
children: PropTypes.node,
- level: PropTypes.oneOf(Object.keys(headings)),
+ level: PropTypes.oneOf(["h1", "h2", "h3", "h4", "h5", "h6"]),
} | 31 | 1 | 17 | 14 |
6b16b82ccde555828fbabffa1b7695c609627d4b | guard-compass.gemspec | guard-compass.gemspec | $:.push File.expand_path('../lib', __FILE__)
require 'guard/compass/version'
Gem::Specification.new do |s|
s.name = 'guard-compass'
s.version = Guard::CompassVersion::VERSION
s.platform = Gem::Platform::RUBY
s.summary = 'Guard gem for Compass'
s.description = 'Guard::Compass automatically rebuilds scss|sass files when a modification occurs taking in account your compass configuration.'
s.authors = ['Olivier Amblet', 'Rémy Coutable']
s.email = ['remy@rymai.me']
s.homepage = 'https://github.com/guard/guard-compass'
s.add_dependency 'guard', '>= 1.8'
s.add_dependency 'compass', '>= 0.10.5'
s.add_development_dependency 'bundler'
s.files = Dir.glob('{lib}/**/*') + %w[CHANGELOG.md LICENSE README.md]
s.require_path = 'lib'
end
| $:.push File.expand_path('../lib', __FILE__)
require 'guard/compass/version'
Gem::Specification.new do |s|
s.name = 'guard-compass'
s.version = Guard::CompassVersion::VERSION
s.platform = Gem::Platform::RUBY
s.license = 'MIT'
s.authors = ['Olivier Amblet', 'Rémy Coutable']
s.email = ['remy@rymai.me']
s.homepage = 'http://rubygems.org/gems/guard-compass'
s.summary = 'Guard plugin for Compass'
s.description = 'Guard::Compass automatically rebuilds scss|sass files when a modification occurs taking in account your compass configuration.'
s.add_runtime_dependency 'guard', '~> 2.0'
s.add_runtime_dependency 'compass', '>= 0.10.5'
s.add_development_dependency 'bundler'
s.files = Dir.glob('{lib}/**/*') + %w[CHANGELOG.md LICENSE README.md]
s.require_path = 'lib'
end
| Update gemspec to depend on Guard ~> 2.0 | Update gemspec to depend on Guard ~> 2.0
| Ruby | mit | guard/guard-compass | ruby | ## Code Before:
$:.push File.expand_path('../lib', __FILE__)
require 'guard/compass/version'
Gem::Specification.new do |s|
s.name = 'guard-compass'
s.version = Guard::CompassVersion::VERSION
s.platform = Gem::Platform::RUBY
s.summary = 'Guard gem for Compass'
s.description = 'Guard::Compass automatically rebuilds scss|sass files when a modification occurs taking in account your compass configuration.'
s.authors = ['Olivier Amblet', 'Rémy Coutable']
s.email = ['remy@rymai.me']
s.homepage = 'https://github.com/guard/guard-compass'
s.add_dependency 'guard', '>= 1.8'
s.add_dependency 'compass', '>= 0.10.5'
s.add_development_dependency 'bundler'
s.files = Dir.glob('{lib}/**/*') + %w[CHANGELOG.md LICENSE README.md]
s.require_path = 'lib'
end
## Instruction:
Update gemspec to depend on Guard ~> 2.0
## Code After:
$:.push File.expand_path('../lib', __FILE__)
require 'guard/compass/version'
Gem::Specification.new do |s|
s.name = 'guard-compass'
s.version = Guard::CompassVersion::VERSION
s.platform = Gem::Platform::RUBY
s.license = 'MIT'
s.authors = ['Olivier Amblet', 'Rémy Coutable']
s.email = ['remy@rymai.me']
s.homepage = 'http://rubygems.org/gems/guard-compass'
s.summary = 'Guard plugin for Compass'
s.description = 'Guard::Compass automatically rebuilds scss|sass files when a modification occurs taking in account your compass configuration.'
s.add_runtime_dependency 'guard', '~> 2.0'
s.add_runtime_dependency 'compass', '>= 0.10.5'
s.add_development_dependency 'bundler'
s.files = Dir.glob('{lib}/**/*') + %w[CHANGELOG.md LICENSE README.md]
s.require_path = 'lib'
end
| $:.push File.expand_path('../lib', __FILE__)
require 'guard/compass/version'
Gem::Specification.new do |s|
s.name = 'guard-compass'
s.version = Guard::CompassVersion::VERSION
s.platform = Gem::Platform::RUBY
+ s.license = 'MIT'
- s.summary = 'Guard gem for Compass'
- s.description = 'Guard::Compass automatically rebuilds scss|sass files when a modification occurs taking in account your compass configuration.'
s.authors = ['Olivier Amblet', 'Rémy Coutable']
s.email = ['remy@rymai.me']
- s.homepage = 'https://github.com/guard/guard-compass'
? - ^^^^ - ^ ^^^^
+ s.homepage = 'http://rubygems.org/gems/guard-compass'
? ^ +++++ ^^ ^^^
+ s.summary = 'Guard plugin for Compass'
+ s.description = 'Guard::Compass automatically rebuilds scss|sass files when a modification occurs taking in account your compass configuration.'
- s.add_dependency 'guard', '>= 1.8'
? - ^ ^
+ s.add_runtime_dependency 'guard', '~> 2.0'
? ++++++++ + ^ ^
- s.add_dependency 'compass', '>= 0.10.5'
+ s.add_runtime_dependency 'compass', '>= 0.10.5'
? ++++++++
s.add_development_dependency 'bundler'
s.files = Dir.glob('{lib}/**/*') + %w[CHANGELOG.md LICENSE README.md]
s.require_path = 'lib'
end | 11 | 0.52381 | 6 | 5 |
811f3beedfd24b19a61ac3538d485cc03130aa6c | kolibri/core/assets/src/content_renderer_module.js | kolibri/core/assets/src/content_renderer_module.js | const KolibriModule = require('kolibri_module');
module.exports = class ContentRenderer extends KolibriModule {
render(contentType) {
if ((Array.isArray(this.contentType) && this.contentType.includes(contentType)) ||
this.contentType === contentType) {
this.broadcastComponent(contentType);
}
}
broadcastComponent(contentType) {
this.emit(`component_render:${contentType}`, this.rendererComponent);
}
get rendererComponent() {
return null;
}
get contentType() {
return null;
}
};
| const KolibriModule = require('kolibri_module');
module.exports = class ContentRenderer extends KolibriModule {
render(contentType) {
const kind = contentType.split('/')[0];
const extension = contentType.split('/')[1];
// Check if it is an object and not null
if ((this.contentType === new Object(this.contentType) &&
// Check if it has kind as a key.
this.contentType[kind] &&
// Check if that kind has the extension in its array
this.contentType[kind].includes(extension)) ||
this.contentType === contentType) {
this.broadcastComponent(contentType);
}
}
broadcastComponent(contentType) {
this.emit(`component_render:${contentType}`, this.rendererComponent);
}
get rendererComponent() {
return null;
}
get contentType() {
return null;
}
};
| Allow content renderer modules to use a kind: [extensions...] object to define the content types they can render. | Allow content renderer modules to use a kind: [extensions...] object to define the content types they can render.
| JavaScript | mit | MingDai/kolibri,DXCanas/kolibri,lyw07/kolibri,benjaoming/kolibri,lyw07/kolibri,indirectlylit/kolibri,lyw07/kolibri,mrpau/kolibri,jonboiser/kolibri,DXCanas/kolibri,aronasorman/kolibri,rtibbles/kolibri,indirectlylit/kolibri,rtibbles/kolibri,rtibbles/kolibri,benjaoming/kolibri,christianmemije/kolibri,mrpau/kolibri,MingDai/kolibri,christianmemije/kolibri,aronasorman/kolibri,learningequality/kolibri,mrpau/kolibri,lyw07/kolibri,indirectlylit/kolibri,jonboiser/kolibri,benjaoming/kolibri,aronasorman/kolibri,jonboiser/kolibri,aronasorman/kolibri,christianmemije/kolibri,mrpau/kolibri,DXCanas/kolibri,DXCanas/kolibri,learningequality/kolibri,jonboiser/kolibri,christianmemije/kolibri,learningequality/kolibri,MingDai/kolibri,MingDai/kolibri,benjaoming/kolibri,learningequality/kolibri,indirectlylit/kolibri,rtibbles/kolibri | javascript | ## Code Before:
const KolibriModule = require('kolibri_module');
module.exports = class ContentRenderer extends KolibriModule {
render(contentType) {
if ((Array.isArray(this.contentType) && this.contentType.includes(contentType)) ||
this.contentType === contentType) {
this.broadcastComponent(contentType);
}
}
broadcastComponent(contentType) {
this.emit(`component_render:${contentType}`, this.rendererComponent);
}
get rendererComponent() {
return null;
}
get contentType() {
return null;
}
};
## Instruction:
Allow content renderer modules to use a kind: [extensions...] object to define the content types they can render.
## Code After:
const KolibriModule = require('kolibri_module');
module.exports = class ContentRenderer extends KolibriModule {
render(contentType) {
const kind = contentType.split('/')[0];
const extension = contentType.split('/')[1];
// Check if it is an object and not null
if ((this.contentType === new Object(this.contentType) &&
// Check if it has kind as a key.
this.contentType[kind] &&
// Check if that kind has the extension in its array
this.contentType[kind].includes(extension)) ||
this.contentType === contentType) {
this.broadcastComponent(contentType);
}
}
broadcastComponent(contentType) {
this.emit(`component_render:${contentType}`, this.rendererComponent);
}
get rendererComponent() {
return null;
}
get contentType() {
return null;
}
};
| const KolibriModule = require('kolibri_module');
module.exports = class ContentRenderer extends KolibriModule {
render(contentType) {
- if ((Array.isArray(this.contentType) && this.contentType.includes(contentType)) ||
+ const kind = contentType.split('/')[0];
+ const extension = contentType.split('/')[1];
+ // Check if it is an object and not null
+ if ((this.contentType === new Object(this.contentType) &&
+ // Check if it has kind as a key.
+ this.contentType[kind] &&
+ // Check if that kind has the extension in its array
+ this.contentType[kind].includes(extension)) ||
this.contentType === contentType) {
this.broadcastComponent(contentType);
}
}
broadcastComponent(contentType) {
this.emit(`component_render:${contentType}`, this.rendererComponent);
}
get rendererComponent() {
return null;
}
get contentType() {
return null;
}
}; | 9 | 0.473684 | 8 | 1 |
762f4e479e147e15cb8bed3fb0113e04279f87ae | lib/packet_queue.h | lib/packet_queue.h |
typedef struct
{
radio_packet_t * head;
radio_packet_t * tail;
radio_packet_t packets[PACKET_QUEUE_SIZE];
} packet_queue_t;
uint32_t packet_queue_init(packet_queue_t * queue);
bool packet_queue_is_empty(packet_queue_t * queue);
bool packet_queue_is_full(packet_queue_t * queue);
uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet);
uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet);
#endif
|
typedef struct
{
uint32_t head;
uint32_t tail;
radio_packet_t packets[PACKET_QUEUE_SIZE];
} packet_queue_t;
uint32_t packet_queue_init(packet_queue_t * queue);
bool packet_queue_is_empty(packet_queue_t * queue);
bool packet_queue_is_full(packet_queue_t * queue);
uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet);
uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet);
#endif
| Fix types of head and tail. | Fix types of head and tail.
| C | bsd-3-clause | hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio | c | ## Code Before:
typedef struct
{
radio_packet_t * head;
radio_packet_t * tail;
radio_packet_t packets[PACKET_QUEUE_SIZE];
} packet_queue_t;
uint32_t packet_queue_init(packet_queue_t * queue);
bool packet_queue_is_empty(packet_queue_t * queue);
bool packet_queue_is_full(packet_queue_t * queue);
uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet);
uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet);
#endif
## Instruction:
Fix types of head and tail.
## Code After:
typedef struct
{
uint32_t head;
uint32_t tail;
radio_packet_t packets[PACKET_QUEUE_SIZE];
} packet_queue_t;
uint32_t packet_queue_init(packet_queue_t * queue);
bool packet_queue_is_empty(packet_queue_t * queue);
bool packet_queue_is_full(packet_queue_t * queue);
uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet);
uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet);
#endif
|
typedef struct
{
- radio_packet_t * head;
- radio_packet_t * tail;
+ uint32_t head;
+ uint32_t tail;
radio_packet_t packets[PACKET_QUEUE_SIZE];
} packet_queue_t;
uint32_t packet_queue_init(packet_queue_t * queue);
bool packet_queue_is_empty(packet_queue_t * queue);
bool packet_queue_is_full(packet_queue_t * queue);
uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet);
uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet);
#endif | 4 | 0.210526 | 2 | 2 |
176488bb2fc4740d3bcd26a8467dba3306e2d536 | templates/default/server.conf.erb | templates/default/server.conf.erb |
<% node['openvpn']['config'].sort.each do |key, value| %>
<% next if value.nil? -%>
<%= key %> <%=
case value
when String
value
when TrueClass
1
when FalseClass
0
else
value
end
%>
<% end %>
|
<%- node['openvpn']['config'].sort.each do |key, values| -%>
<%- [*values].each do |value| -%>
<%- next if value.nil? -%>
<%= key %> <%=
case value
when String
value
when TrueClass
1
when FalseClass
0
else
value
end
%>
<%- end -%>
<%- end -%>
| Support multiple options such as route using arrays | Support multiple options such as route using arrays
| HTML+ERB | apache-2.0 | chrisduong/openvpn,xhost-cookbooks/openvpn,zackp30/openvpn,zackp30/openvpn,POSpulse/openvpn,ai-traders/openvpn,zackp30/openvpn,ForeverOceans/openvpn,POSpulse/openvpn,xhost-cookbooks/openvpn,xhost-cookbooks/openvpn,chrisduong/openvpn,ai-traders/openvpn,chrisduong/openvpn,ForeverOceans/openvpn,ForeverOceans/openvpn,ai-traders/openvpn,POSpulse/openvpn | html+erb | ## Code Before:
<% node['openvpn']['config'].sort.each do |key, value| %>
<% next if value.nil? -%>
<%= key %> <%=
case value
when String
value
when TrueClass
1
when FalseClass
0
else
value
end
%>
<% end %>
## Instruction:
Support multiple options such as route using arrays
## Code After:
<%- node['openvpn']['config'].sort.each do |key, values| -%>
<%- [*values].each do |value| -%>
<%- next if value.nil? -%>
<%= key %> <%=
case value
when String
value
when TrueClass
1
when FalseClass
0
else
value
end
%>
<%- end -%>
<%- end -%>
|
- <% node['openvpn']['config'].sort.each do |key, value| %>
+ <%- node['openvpn']['config'].sort.each do |key, values| -%>
? + + +
+ <%- [*values].each do |value| -%>
- <% next if value.nil? -%>
+ <%- next if value.nil? -%>
? +
<%= key %> <%=
case value
when String
value
when TrueClass
1
when FalseClass
0
else
value
end
%>
- <% end %>
+ <%- end -%>
? + +
+ <%- end -%> | 8 | 0.5 | 5 | 3 |
530a07ec5db9f03cdef90658349e3573c63fac0e | app/views/diaries/index.html.erb | app/views/diaries/index.html.erb | <% provide(:title, 'Your diaries') %>
<div class="page-header">
<h1>Your Diaries</h1>
</div>
<div class="row">
<% if @diaries.any? %>
<div class="col-md-4">
<div class="list-group">
<% @diaries.each do |d| %>
<%= link_to user_diary_url(d.user_id, d.id), class:'list-group-item' do %>
<%= d.title %>
<% if d.entries.any? %>
<span class="badge"><%= d.entries.count %></span>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% else %>
<p>You don't have any diaries</p>
<% end %>
</div>
<div class="row">
<div class="col-md-8">
<%= link_to 'Create a diary', new_user_diary_path, class: 'btn btn-primary' %>
</div>
</div>
| <% provide(:title, 'Your diaries') %>
<div class="page-header">
<h1>Your Diaries</h1>
</div>
<div class="row">
<div class="col-md-4">
<% if @diaries.any? %>
<div class="list-group">
<% @diaries.each do |d| %>
<%= link_to user_diary_url(d.user_id, d.id), class:'list-group-item' do %>
<%= d.title %>
<% if d.entries.any? %>
<span class="badge"><%= d.entries.count %></span>
<% end %>
<% end %>
<% end %>
</div>
<% else %>
<p>You don't have any diaries. Why not
<%= link_to 'make a start', new_user_diary_path(@user) %>?</p>
<% end %>
</div>
</div>
<div class="row">
<div class="col-md-8">
<%= link_to 'Create a diary', new_user_diary_path, class: 'btn btn-primary' %>
</div>
</div>
| Fix styling when no diaries are found | Fix styling when no diaries are found
| HTML+ERB | mit | MasterRoot24/cloudiary,MasterRoot24/cloudiary,MasterRoot24/cloudiary | html+erb | ## Code Before:
<% provide(:title, 'Your diaries') %>
<div class="page-header">
<h1>Your Diaries</h1>
</div>
<div class="row">
<% if @diaries.any? %>
<div class="col-md-4">
<div class="list-group">
<% @diaries.each do |d| %>
<%= link_to user_diary_url(d.user_id, d.id), class:'list-group-item' do %>
<%= d.title %>
<% if d.entries.any? %>
<span class="badge"><%= d.entries.count %></span>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% else %>
<p>You don't have any diaries</p>
<% end %>
</div>
<div class="row">
<div class="col-md-8">
<%= link_to 'Create a diary', new_user_diary_path, class: 'btn btn-primary' %>
</div>
</div>
## Instruction:
Fix styling when no diaries are found
## Code After:
<% provide(:title, 'Your diaries') %>
<div class="page-header">
<h1>Your Diaries</h1>
</div>
<div class="row">
<div class="col-md-4">
<% if @diaries.any? %>
<div class="list-group">
<% @diaries.each do |d| %>
<%= link_to user_diary_url(d.user_id, d.id), class:'list-group-item' do %>
<%= d.title %>
<% if d.entries.any? %>
<span class="badge"><%= d.entries.count %></span>
<% end %>
<% end %>
<% end %>
</div>
<% else %>
<p>You don't have any diaries. Why not
<%= link_to 'make a start', new_user_diary_path(@user) %>?</p>
<% end %>
</div>
</div>
<div class="row">
<div class="col-md-8">
<%= link_to 'Create a diary', new_user_diary_path, class: 'btn btn-primary' %>
</div>
</div>
| <% provide(:title, 'Your diaries') %>
<div class="page-header">
<h1>Your Diaries</h1>
</div>
<div class="row">
- <% if @diaries.any? %>
<div class="col-md-4">
+ <% if @diaries.any? %>
<div class="list-group">
<% @diaries.each do |d| %>
<%= link_to user_diary_url(d.user_id, d.id), class:'list-group-item' do %>
<%= d.title %>
<% if d.entries.any? %>
<span class="badge"><%= d.entries.count %></span>
<% end %>
<% end %>
<% end %>
</div>
+ <% else %>
+ <p>You don't have any diaries. Why not
+ <%= link_to 'make a start', new_user_diary_path(@user) %>?</p>
+ <% end %>
</div>
- <% else %>
- <p>You don't have any diaries</p>
- <% end %>
</div>
<div class="row">
<div class="col-md-8">
<%= link_to 'Create a diary', new_user_diary_path, class: 'btn btn-primary' %>
</div>
</div> | 9 | 0.3 | 5 | 4 |
3b713fb4de872cc4f3f4d88d2f25e473d47afde9 | source/layouts/application.erb | source/layouts/application.erb | <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title><%= current_page.data.title || "Unboxed" %></title>
<%= favicon_tag "favicon.ico" %>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "ie10_fixes" %>
<!--[if IE 9]>
<%= stylesheet_link_tag "ie9_fixes" %>
<![endif]-->
<!--[if lt IE 9]>
<%= javascript_include_tag "html5shiv" %>
<%= stylesheet_link_tag "ie8_fixes" %>
<![endif]-->
</head>
<body class="<%= page_classes %>">
<div class="site-header">
<div class="site-header__brand">
<a class="site-header__link" href="https://www.unboxedconsulting.com/">
Unboxed
</a>
</div>
</div>
<div class="page-content">
<%= yield %>
</div>
</body>
</html>
| <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title><%= current_page.data.title || "Unboxed" %></title>
<%= favicon_tag "favicon.ico" %>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "ie10_fixes" %>
<!--[if IE 9]>
<%= stylesheet_link_tag "ie9_fixes" %>
<![endif]-->
<!--[if lt IE 9]>
<%= javascript_include_tag "html5shiv" %>
<%= stylesheet_link_tag "ie8_fixes" %>
<![endif]-->
</head>
<body>
<div class="site-header">
<div class="site-header__brand">
<a class="site-header__link" href="https://www.unboxedconsulting.com/">
Unboxed
</a>
</div>
</div>
<div class="page-content">
<%= yield %>
</div>
</body>
</html>
| Remove automatic page classes to avoid conflicting CSS names | Remove automatic page classes to avoid conflicting CSS names
| HTML+ERB | mit | unboxed/ubxd_web_refresh,unboxed/ubxd_web_refresh,unboxed/unboxed.co,unboxed/ubxd_web_refresh,unboxed/unboxed.co,unboxed/unboxed.co | html+erb | ## Code Before:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title><%= current_page.data.title || "Unboxed" %></title>
<%= favicon_tag "favicon.ico" %>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "ie10_fixes" %>
<!--[if IE 9]>
<%= stylesheet_link_tag "ie9_fixes" %>
<![endif]-->
<!--[if lt IE 9]>
<%= javascript_include_tag "html5shiv" %>
<%= stylesheet_link_tag "ie8_fixes" %>
<![endif]-->
</head>
<body class="<%= page_classes %>">
<div class="site-header">
<div class="site-header__brand">
<a class="site-header__link" href="https://www.unboxedconsulting.com/">
Unboxed
</a>
</div>
</div>
<div class="page-content">
<%= yield %>
</div>
</body>
</html>
## Instruction:
Remove automatic page classes to avoid conflicting CSS names
## Code After:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title><%= current_page.data.title || "Unboxed" %></title>
<%= favicon_tag "favicon.ico" %>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "ie10_fixes" %>
<!--[if IE 9]>
<%= stylesheet_link_tag "ie9_fixes" %>
<![endif]-->
<!--[if lt IE 9]>
<%= javascript_include_tag "html5shiv" %>
<%= stylesheet_link_tag "ie8_fixes" %>
<![endif]-->
</head>
<body>
<div class="site-header">
<div class="site-header__brand">
<a class="site-header__link" href="https://www.unboxedconsulting.com/">
Unboxed
</a>
</div>
</div>
<div class="page-content">
<%= yield %>
</div>
</body>
</html>
| <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title><%= current_page.data.title || "Unboxed" %></title>
<%= favicon_tag "favicon.ico" %>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "ie10_fixes" %>
<!--[if IE 9]>
<%= stylesheet_link_tag "ie9_fixes" %>
<![endif]-->
<!--[if lt IE 9]>
<%= javascript_include_tag "html5shiv" %>
<%= stylesheet_link_tag "ie8_fixes" %>
<![endif]-->
</head>
- <body class="<%= page_classes %>">
+ <body>
<div class="site-header">
<div class="site-header__brand">
<a class="site-header__link" href="https://www.unboxedconsulting.com/">
Unboxed
</a>
</div>
</div>
<div class="page-content">
<%= yield %>
</div>
</body>
</html> | 2 | 0.057143 | 1 | 1 |
8fb2397df5d8825ac2d0b5a90e8dac79c8aa4440 | src/Humanizer.Tests/project.json | src/Humanizer.Tests/project.json | {
"dependencies": {
"ApiApprover": "3.0.1",
"ApprovalTests": "3.0.10",
"ApprovalUtilities": "3.0.10",
"Mono.Cecil": "0.9.6.1",
"xunit": "2.1.0",
"xunit.runner.visualstudio": "2.1.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {},
"win-": {}
}
}
| {
"dependencies": {
"ApiApprover": "3.0.1",
"ApprovalTests": "3.0.10",
"ApprovalUtilities": "3.0.10",
"Mono.Cecil": "0.9.6.1",
"xunit": "2.1.0",
"xunit.runner.visualstudio": "2.1.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {}
}
}
| Revert "Revert "remove temp workaround"" | Revert "Revert "remove temp workaround""
This reverts commit 3d87c1e0e09f4554e0404cf7907d1e139107c6c8.
| JSON | mit | Flatlineato/Humanizer,MehdiK/Humanizer,Flatlineato/Humanizer,hazzik/Humanizer,aloisdg/Humanizer,jaxx-rep/Humanizer | json | ## Code Before:
{
"dependencies": {
"ApiApprover": "3.0.1",
"ApprovalTests": "3.0.10",
"ApprovalUtilities": "3.0.10",
"Mono.Cecil": "0.9.6.1",
"xunit": "2.1.0",
"xunit.runner.visualstudio": "2.1.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {},
"win-": {}
}
}
## Instruction:
Revert "Revert "remove temp workaround""
This reverts commit 3d87c1e0e09f4554e0404cf7907d1e139107c6c8.
## Code After:
{
"dependencies": {
"ApiApprover": "3.0.1",
"ApprovalTests": "3.0.10",
"ApprovalUtilities": "3.0.10",
"Mono.Cecil": "0.9.6.1",
"xunit": "2.1.0",
"xunit.runner.visualstudio": "2.1.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {}
}
}
| {
"dependencies": {
"ApiApprover": "3.0.1",
"ApprovalTests": "3.0.10",
"ApprovalUtilities": "3.0.10",
"Mono.Cecil": "0.9.6.1",
"xunit": "2.1.0",
"xunit.runner.visualstudio": "2.1.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
- "win": {},
? -
+ "win": {}
- "win-": {}
}
} | 3 | 0.176471 | 1 | 2 |
da10dd621c699fdccac5c4e618f31ea61a2ebb23 | TimerDisplay.h | TimerDisplay.h |
class TimerDisplay : public SevenSegmentExtended
{
public:
TimerDisplay(uint8_t pin_clk, uint8_t pin_dio);
void on();
void off();
void start();
void stop();
void refresh();
private:
unsigned long start_millis;
bool is_running;
static const unsigned long millis_per_second = 1000;
static const unsigned long millis_per_minute = 60 * millis_per_second;
static const unsigned long millis_per_hour = 60 * millis_per_minute;
uint8_t millisToSeconds(unsigned long millis);
uint8_t millisToMinutes(unsigned long millis);
};
#endif
|
class TimerDisplay : public SevenSegmentExtended
{
public:
TimerDisplay(uint8_t pin_clk, uint8_t pin_dio);
void on();
void off();
void start();
void stop();
void refresh();
private:
unsigned long start_millis;
bool is_running;
static const unsigned long millis_per_second = 1000;
static const unsigned long millis_per_minute = 60 * millis_per_second;
static const unsigned long millis_per_hour = 60 * millis_per_minute;
static uint8_t millisToSeconds(unsigned long millis);
static uint8_t millisToMinutes(unsigned long millis);
};
#endif
| Make static some functions that should be static | Make static some functions that should be static
| C | mit | mortenfyhn/coffee-scales | c | ## Code Before:
class TimerDisplay : public SevenSegmentExtended
{
public:
TimerDisplay(uint8_t pin_clk, uint8_t pin_dio);
void on();
void off();
void start();
void stop();
void refresh();
private:
unsigned long start_millis;
bool is_running;
static const unsigned long millis_per_second = 1000;
static const unsigned long millis_per_minute = 60 * millis_per_second;
static const unsigned long millis_per_hour = 60 * millis_per_minute;
uint8_t millisToSeconds(unsigned long millis);
uint8_t millisToMinutes(unsigned long millis);
};
#endif
## Instruction:
Make static some functions that should be static
## Code After:
class TimerDisplay : public SevenSegmentExtended
{
public:
TimerDisplay(uint8_t pin_clk, uint8_t pin_dio);
void on();
void off();
void start();
void stop();
void refresh();
private:
unsigned long start_millis;
bool is_running;
static const unsigned long millis_per_second = 1000;
static const unsigned long millis_per_minute = 60 * millis_per_second;
static const unsigned long millis_per_hour = 60 * millis_per_minute;
static uint8_t millisToSeconds(unsigned long millis);
static uint8_t millisToMinutes(unsigned long millis);
};
#endif
|
class TimerDisplay : public SevenSegmentExtended
{
public:
TimerDisplay(uint8_t pin_clk, uint8_t pin_dio);
void on();
void off();
void start();
void stop();
void refresh();
private:
unsigned long start_millis;
bool is_running;
static const unsigned long millis_per_second = 1000;
static const unsigned long millis_per_minute = 60 * millis_per_second;
static const unsigned long millis_per_hour = 60 * millis_per_minute;
- uint8_t millisToSeconds(unsigned long millis);
+ static uint8_t millisToSeconds(unsigned long millis);
? +++++++
- uint8_t millisToMinutes(unsigned long millis);
+ static uint8_t millisToMinutes(unsigned long millis);
? +++++++
};
#endif | 4 | 0.190476 | 2 | 2 |
3346199ed290530ed08f887c9df9502095303c0f | config/water.yml | config/water.yml | production:
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
development:
markdown_file_extensions: [".md", ".markdown", ".mdown", ".mdwn"]
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4" | production:
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
development:
markdown_file_extensions: [".md", ".markdown", ".mdown", ".mdwn"]
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
test:
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4" | Add test-environment and add salt to it | Add test-environment and add salt to it
| YAML | agpl-3.0 | water/mainline,water/mainline,water/mainline | yaml | ## Code Before:
production:
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
development:
markdown_file_extensions: [".md", ".markdown", ".mdown", ".mdwn"]
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
## Instruction:
Add test-environment and add salt to it
## Code After:
production:
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
development:
markdown_file_extensions: [".md", ".markdown", ".mdown", ".mdwn"]
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
test:
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4" | production:
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
development:
markdown_file_extensions: [".md", ".markdown", ".mdown", ".mdwn"]
salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4"
+ test:
+ salt: "ee8201c790b65bfe26b83482ab2ee1fd9335fff4" | 2 | 0.4 | 2 | 0 |
e2bfeef33f6b07e0252fb56af493ffd492410dd8 | all_tests.sh | all_tests.sh |
python3 --version
echo "Please make sure you are using python 3.6.x"
solc --version
echo "Please make sure you are using solc 0.4.21"
rm -rf ./tests/testdata/outputs_current/
mkdir -p ./tests/testdata/outputs_current/
mkdir -p /tmp/test-reports
pytest --junitxml=/tmp/test-reports/junit.xml
|
echo -n "Checking Python version... "
python -c 'import sys
print(sys.version)
assert sys.version_info[0:2] >= (3,6), \
"""Please make sure you are using Python 3.6.x.
You ran with {}""".format(sys.version)' || exit $?
echo "Checking solc version..."
out=$(solc --version) || {
echo 2>&1 "Please make sure you have solc installed, version 0.4.21 or greater"
}
case $out in
*Version:\ 0.4.2[1-9]* )
echo $out
break ;;
* )
echo $out
echo "Please make sure your solc version is at least 0.4.21"
exit 1
;;
esac
echo "Checking that truffle is installed..."
if ! which truffle ; then
echo "Please make sure you have etherum truffle installed (npm install -g truffle)"
exit 2
fi
rm -rf ./tests/testdata/outputs_current/
mkdir -p ./tests/testdata/outputs_current/
mkdir -p /tmp/test-reports
pytest --junitxml=/tmp/test-reports/junit.xml
| Check and report status of various required packages | Check and report status of various required packages
| Shell | mit | b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril | shell | ## Code Before:
python3 --version
echo "Please make sure you are using python 3.6.x"
solc --version
echo "Please make sure you are using solc 0.4.21"
rm -rf ./tests/testdata/outputs_current/
mkdir -p ./tests/testdata/outputs_current/
mkdir -p /tmp/test-reports
pytest --junitxml=/tmp/test-reports/junit.xml
## Instruction:
Check and report status of various required packages
## Code After:
echo -n "Checking Python version... "
python -c 'import sys
print(sys.version)
assert sys.version_info[0:2] >= (3,6), \
"""Please make sure you are using Python 3.6.x.
You ran with {}""".format(sys.version)' || exit $?
echo "Checking solc version..."
out=$(solc --version) || {
echo 2>&1 "Please make sure you have solc installed, version 0.4.21 or greater"
}
case $out in
*Version:\ 0.4.2[1-9]* )
echo $out
break ;;
* )
echo $out
echo "Please make sure your solc version is at least 0.4.21"
exit 1
;;
esac
echo "Checking that truffle is installed..."
if ! which truffle ; then
echo "Please make sure you have etherum truffle installed (npm install -g truffle)"
exit 2
fi
rm -rf ./tests/testdata/outputs_current/
mkdir -p ./tests/testdata/outputs_current/
mkdir -p /tmp/test-reports
pytest --junitxml=/tmp/test-reports/junit.xml
|
- python3 --version
+ echo -n "Checking Python version... "
+ python -c 'import sys
+ print(sys.version)
+ assert sys.version_info[0:2] >= (3,6), \
- echo "Please make sure you are using python 3.6.x"
? ^^^^^ ^ ^
+ """Please make sure you are using Python 3.6.x.
? ^^ ^ ^
+ You ran with {}""".format(sys.version)' || exit $?
- solc --version
- echo "Please make sure you are using solc 0.4.21"
+ echo "Checking solc version..."
+ out=$(solc --version) || {
+ echo 2>&1 "Please make sure you have solc installed, version 0.4.21 or greater"
+
+ }
+ case $out in
+ *Version:\ 0.4.2[1-9]* )
+ echo $out
+ break ;;
+ * )
+ echo $out
+ echo "Please make sure your solc version is at least 0.4.21"
+ exit 1
+ ;;
+ esac
+
+ echo "Checking that truffle is installed..."
+ if ! which truffle ; then
+ echo "Please make sure you have etherum truffle installed (npm install -g truffle)"
+ exit 2
+ fi
rm -rf ./tests/testdata/outputs_current/
mkdir -p ./tests/testdata/outputs_current/
mkdir -p /tmp/test-reports
pytest --junitxml=/tmp/test-reports/junit.xml | 31 | 2.818182 | 27 | 4 |
28630d9c22c6dfa7ac5e865a4ee725e9abfe95ee | dash-renderer/src/components/core/DocumentTitle.react.js | dash-renderer/src/components/core/DocumentTitle.react.js | import {connect} from 'react-redux';
import {Component} from 'react';
import PropTypes from 'prop-types';
class DocumentTitle extends Component {
constructor(props) {
super(props);
this.state = {
initialTitle: document.title,
};
}
UNSAFE_componentWillReceiveProps(props) {
if (props.pendingCallbacks.length) {
document.title = 'Updating...';
} else {
document.title = this.state.initialTitle;
}
}
shouldComponentUpdate() {
return false;
}
render() {
return null;
}
}
DocumentTitle.propTypes = {
pendingCallbacks: PropTypes.array.isRequired,
};
export default connect(state => ({
pendingCallbacks: state.pendingCallbacks,
}))(DocumentTitle);
| import {connect} from 'react-redux';
import {Component} from 'react';
import PropTypes from 'prop-types';
class DocumentTitle extends Component {
constructor(props) {
super(props);
const {update_title} = props.config;
this.state = {
initialTitle: document.title,
update_title: update_title,
};
}
UNSAFE_componentWillReceiveProps(props) {
if (props.pendingCallbacks.length) {
document.title = this.state.update_title;
} else {
document.title = this.state.initialTitle;
}
}
shouldComponentUpdate() {
return false;
}
render() {
return null;
}
}
DocumentTitle.propTypes = {
pendingCallbacks: PropTypes.array.isRequired,
update_title: PropTypes.string,
};
export default connect(state => ({
config: state.config,
pendingCallbacks: state.pendingCallbacks,
}))(DocumentTitle);
| Use update_title in DocumentTitle component | Use update_title in DocumentTitle component
| JavaScript | mit | plotly/dash,plotly/dash,plotly/dash,plotly/dash,plotly/dash | javascript | ## Code Before:
import {connect} from 'react-redux';
import {Component} from 'react';
import PropTypes from 'prop-types';
class DocumentTitle extends Component {
constructor(props) {
super(props);
this.state = {
initialTitle: document.title,
};
}
UNSAFE_componentWillReceiveProps(props) {
if (props.pendingCallbacks.length) {
document.title = 'Updating...';
} else {
document.title = this.state.initialTitle;
}
}
shouldComponentUpdate() {
return false;
}
render() {
return null;
}
}
DocumentTitle.propTypes = {
pendingCallbacks: PropTypes.array.isRequired,
};
export default connect(state => ({
pendingCallbacks: state.pendingCallbacks,
}))(DocumentTitle);
## Instruction:
Use update_title in DocumentTitle component
## Code After:
import {connect} from 'react-redux';
import {Component} from 'react';
import PropTypes from 'prop-types';
class DocumentTitle extends Component {
constructor(props) {
super(props);
const {update_title} = props.config;
this.state = {
initialTitle: document.title,
update_title: update_title,
};
}
UNSAFE_componentWillReceiveProps(props) {
if (props.pendingCallbacks.length) {
document.title = this.state.update_title;
} else {
document.title = this.state.initialTitle;
}
}
shouldComponentUpdate() {
return false;
}
render() {
return null;
}
}
DocumentTitle.propTypes = {
pendingCallbacks: PropTypes.array.isRequired,
update_title: PropTypes.string,
};
export default connect(state => ({
config: state.config,
pendingCallbacks: state.pendingCallbacks,
}))(DocumentTitle);
| import {connect} from 'react-redux';
import {Component} from 'react';
import PropTypes from 'prop-types';
class DocumentTitle extends Component {
constructor(props) {
super(props);
+ const {update_title} = props.config;
this.state = {
initialTitle: document.title,
+ update_title: update_title,
};
}
UNSAFE_componentWillReceiveProps(props) {
if (props.pendingCallbacks.length) {
- document.title = 'Updating...';
+ document.title = this.state.update_title;
} else {
document.title = this.state.initialTitle;
}
}
shouldComponentUpdate() {
return false;
}
render() {
return null;
}
}
DocumentTitle.propTypes = {
pendingCallbacks: PropTypes.array.isRequired,
+ update_title: PropTypes.string,
};
export default connect(state => ({
+ config: state.config,
pendingCallbacks: state.pendingCallbacks,
}))(DocumentTitle); | 6 | 0.166667 | 5 | 1 |
a50046dcd25c4e5b2704933db21ec979d6273ae8 | examples/sample_config.json | examples/sample_config.json | {
"codeHandler": "./codehandlers/jsCodeHandler.js",
"defaultModuleHeading": "Module",
"includePrivate": "false",
"includeHRBeforeMethod": "true",
"horizontalRuleMarkdown": "\n------------------------------------------------\n",
"methodHeadingMarkdown": "-",
"methodSignatureMarkdown": "###",
"moduleHeadingMarkdown": "=",
"paramsHeading": "Parameters",
"paramsHeadingMarkdown": "####",
"paramsListMarkdown": "*",
"paramTypeMarkdown": "*",
"requiresLabel": "Requires:",
"requiresLabelMarkdown": "*",
"returnHeading": "Returns",
"returnHeadingMarkdown": "####",
"returnTypeMarkdown": "*",
"typeHeadingMarkdown": "-"
} | {
"codeHandler": "./codehandlers/jsCodeHandler.js",
"defaultModuleHeading": "Module",
"dir": "lib",
"includePrivate": "false",
"includeHRBeforeMethod": "true",
"horizontalRuleMarkdown": "\n------------------------------------------------\n",
"methodHeadingMarkdown": "-",
"methodSignatureMarkdown": "###",
"moduleHeadingMarkdown": "=",
"paramsHeading": "Parameters",
"paramsHeadingMarkdown": "####",
"paramsListMarkdown": "*",
"paramTypeMarkdown": "*",
"requiresLabel": "Requires:",
"requiresLabelMarkdown": "*",
"returnHeading": "Returns",
"returnHeadingMarkdown": "####",
"returnTypeMarkdown": "*",
"typeHeadingMarkdown": "-"
} | Update sample config to be in sync with README example. | Update sample config to be in sync with README example.
| JSON | mit | allanmboyd/docit | json | ## Code Before:
{
"codeHandler": "./codehandlers/jsCodeHandler.js",
"defaultModuleHeading": "Module",
"includePrivate": "false",
"includeHRBeforeMethod": "true",
"horizontalRuleMarkdown": "\n------------------------------------------------\n",
"methodHeadingMarkdown": "-",
"methodSignatureMarkdown": "###",
"moduleHeadingMarkdown": "=",
"paramsHeading": "Parameters",
"paramsHeadingMarkdown": "####",
"paramsListMarkdown": "*",
"paramTypeMarkdown": "*",
"requiresLabel": "Requires:",
"requiresLabelMarkdown": "*",
"returnHeading": "Returns",
"returnHeadingMarkdown": "####",
"returnTypeMarkdown": "*",
"typeHeadingMarkdown": "-"
}
## Instruction:
Update sample config to be in sync with README example.
## Code After:
{
"codeHandler": "./codehandlers/jsCodeHandler.js",
"defaultModuleHeading": "Module",
"dir": "lib",
"includePrivate": "false",
"includeHRBeforeMethod": "true",
"horizontalRuleMarkdown": "\n------------------------------------------------\n",
"methodHeadingMarkdown": "-",
"methodSignatureMarkdown": "###",
"moduleHeadingMarkdown": "=",
"paramsHeading": "Parameters",
"paramsHeadingMarkdown": "####",
"paramsListMarkdown": "*",
"paramTypeMarkdown": "*",
"requiresLabel": "Requires:",
"requiresLabelMarkdown": "*",
"returnHeading": "Returns",
"returnHeadingMarkdown": "####",
"returnTypeMarkdown": "*",
"typeHeadingMarkdown": "-"
} | {
"codeHandler": "./codehandlers/jsCodeHandler.js",
"defaultModuleHeading": "Module",
+ "dir": "lib",
"includePrivate": "false",
"includeHRBeforeMethod": "true",
"horizontalRuleMarkdown": "\n------------------------------------------------\n",
"methodHeadingMarkdown": "-",
"methodSignatureMarkdown": "###",
"moduleHeadingMarkdown": "=",
"paramsHeading": "Parameters",
"paramsHeadingMarkdown": "####",
"paramsListMarkdown": "*",
"paramTypeMarkdown": "*",
"requiresLabel": "Requires:",
"requiresLabelMarkdown": "*",
"returnHeading": "Returns",
"returnHeadingMarkdown": "####",
"returnTypeMarkdown": "*",
"typeHeadingMarkdown": "-"
} | 1 | 0.05 | 1 | 0 |
8287c761ff9c16b24b4b14dd612a48360e3f7762 | README.md | README.md | Program for converting between AAMP and XML
| Program for converting between AAMP v2 and XML
Supports Legend of Zelda Breath of the Wild for Wii U, does not support Mario Kart 8.
| Update description to specify BotW | Update description to specify BotW | Markdown | mit | jam1garner/aamp2xml | markdown | ## Code Before:
Program for converting between AAMP and XML
## Instruction:
Update description to specify BotW
## Code After:
Program for converting between AAMP v2 and XML
Supports Legend of Zelda Breath of the Wild for Wii U, does not support Mario Kart 8.
| - Program for converting between AAMP and XML
+ Program for converting between AAMP v2 and XML
? +++
+
+ Supports Legend of Zelda Breath of the Wild for Wii U, does not support Mario Kart 8. | 4 | 4 | 3 | 1 |
6b0167514bb41f877945b408638fab72873f2da8 | postgres_copy/__init__.py | postgres_copy/__init__.py | from django.db import models
from django.db import connection
from .copy_from import CopyMapping
from .copy_to import SQLCopyToCompiler, CopyToQuery
__version__ = '2.0.0'
class CopyQuerySet(models.QuerySet):
"""
Subclass of QuerySet that adds from_csv and to_csv methods.
"""
def from_csv(self, csv_path, mapping, **kwargs):
"""
Copy CSV file from the provided path to the current model using the provided mapping.
"""
mapping = CopyMapping(self.model, csv_path, mapping, **kwargs)
mapping.save(silent=True)
def to_csv(self, csv_path, *fields):
"""
Copy current QuerySet to CSV at provided path.
"""
query = self.query.clone(CopyToQuery)
query.copy_to_fields = fields
compiler = query.get_compiler(self.db, connection=connection)
compiler.execute_sql(csv_path)
CopyManager = models.Manager.from_queryset(CopyQuerySet)
__all__ = (
'CopyMapping',
'SQLCopyToCompiler',
'CopyToQuery',
'CopyManager',
)
| from django.db import models
from django.db import connection
from .copy_from import CopyMapping
from .copy_to import SQLCopyToCompiler, CopyToQuery
__version__ = '2.0.0'
class CopyQuerySet(models.QuerySet):
"""
Subclass of QuerySet that adds from_csv and to_csv methods.
"""
def from_csv(self, csv_path, mapping, **kwargs):
"""
Copy CSV file from the provided path to the current model using the provided mapping.
"""
mapping = CopyMapping(self.model, csv_path, mapping, **kwargs)
mapping.save(silent=True)
def to_csv(self, csv_path, *fields):
"""
Copy current QuerySet to CSV at provided path.
"""
query = self.query.clone(CopyToQuery)
query.copy_to_fields = fields
compiler = query.get_compiler(self.db, connection=connection)
compiler.execute_sql(csv_path)
CopyManager = models.Manager.from_queryset(CopyQuerySet)
__all__ = (
'CopyManager',
'CopyMapping',
'CopyToQuery',
'CopyToQuerySet',
'SQLCopyToCompiler',
)
| Add CopyToQuerySet to available imports | Add CopyToQuerySet to available imports
| Python | mit | california-civic-data-coalition/django-postgres-copy | python | ## Code Before:
from django.db import models
from django.db import connection
from .copy_from import CopyMapping
from .copy_to import SQLCopyToCompiler, CopyToQuery
__version__ = '2.0.0'
class CopyQuerySet(models.QuerySet):
"""
Subclass of QuerySet that adds from_csv and to_csv methods.
"""
def from_csv(self, csv_path, mapping, **kwargs):
"""
Copy CSV file from the provided path to the current model using the provided mapping.
"""
mapping = CopyMapping(self.model, csv_path, mapping, **kwargs)
mapping.save(silent=True)
def to_csv(self, csv_path, *fields):
"""
Copy current QuerySet to CSV at provided path.
"""
query = self.query.clone(CopyToQuery)
query.copy_to_fields = fields
compiler = query.get_compiler(self.db, connection=connection)
compiler.execute_sql(csv_path)
CopyManager = models.Manager.from_queryset(CopyQuerySet)
__all__ = (
'CopyMapping',
'SQLCopyToCompiler',
'CopyToQuery',
'CopyManager',
)
## Instruction:
Add CopyToQuerySet to available imports
## Code After:
from django.db import models
from django.db import connection
from .copy_from import CopyMapping
from .copy_to import SQLCopyToCompiler, CopyToQuery
__version__ = '2.0.0'
class CopyQuerySet(models.QuerySet):
"""
Subclass of QuerySet that adds from_csv and to_csv methods.
"""
def from_csv(self, csv_path, mapping, **kwargs):
"""
Copy CSV file from the provided path to the current model using the provided mapping.
"""
mapping = CopyMapping(self.model, csv_path, mapping, **kwargs)
mapping.save(silent=True)
def to_csv(self, csv_path, *fields):
"""
Copy current QuerySet to CSV at provided path.
"""
query = self.query.clone(CopyToQuery)
query.copy_to_fields = fields
compiler = query.get_compiler(self.db, connection=connection)
compiler.execute_sql(csv_path)
CopyManager = models.Manager.from_queryset(CopyQuerySet)
__all__ = (
'CopyManager',
'CopyMapping',
'CopyToQuery',
'CopyToQuerySet',
'SQLCopyToCompiler',
)
| from django.db import models
from django.db import connection
from .copy_from import CopyMapping
from .copy_to import SQLCopyToCompiler, CopyToQuery
__version__ = '2.0.0'
class CopyQuerySet(models.QuerySet):
"""
Subclass of QuerySet that adds from_csv and to_csv methods.
"""
def from_csv(self, csv_path, mapping, **kwargs):
"""
Copy CSV file from the provided path to the current model using the provided mapping.
"""
mapping = CopyMapping(self.model, csv_path, mapping, **kwargs)
mapping.save(silent=True)
def to_csv(self, csv_path, *fields):
"""
Copy current QuerySet to CSV at provided path.
"""
query = self.query.clone(CopyToQuery)
query.copy_to_fields = fields
compiler = query.get_compiler(self.db, connection=connection)
compiler.execute_sql(csv_path)
CopyManager = models.Manager.from_queryset(CopyQuerySet)
__all__ = (
+ 'CopyManager',
'CopyMapping',
+ 'CopyToQuery',
+ 'CopyToQuerySet',
'SQLCopyToCompiler',
- 'CopyToQuery',
- 'CopyManager',
) | 5 | 0.135135 | 3 | 2 |
02bde45920dcf96fe891830ba484e5c8bc889241 | requirements.txt | requirements.txt | Django==1.5.2
Jinja2==2.7.1
Markdown==2.3.1
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2b1
dj-static==0.0.5
django-filter==0.7
django-social-auth==0.7.25
djangorestframework==2.3.7
docutils==0.11
httplib2==0.8
ipython==1.0.0
mock==1.0.1
oauth2==1.5.211
psycopg2==2.5.1
pyjade==2.0.2
pymongo==2.5.2
python-openid==2.2.5
static==0.4
wsgiref==0.1.2
| Django==1.5.2
Jinja2==2.7.1
Markdown==2.3.1
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2b1
dj-static==0.0.5
django-filter==0.7
django-social-auth==0.7.25
djangorestframework==2.3.7
docutils==0.11
flake8
httplib2==0.8
mock==1.0.1
oauth2==1.5.211
psycopg2==2.5.1
pyjade==2.0.2
pymongo==2.5.2
python-openid==2.2.5
static==0.4
wsgiref==0.1.2
| Make flake8 a requirement, remove ipython | Make flake8 a requirement, remove ipython
| Text | mit | OAButton/OAButton_old,OAButton/OAButton_old,OAButton/OAButton_old | text | ## Code Before:
Django==1.5.2
Jinja2==2.7.1
Markdown==2.3.1
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2b1
dj-static==0.0.5
django-filter==0.7
django-social-auth==0.7.25
djangorestframework==2.3.7
docutils==0.11
httplib2==0.8
ipython==1.0.0
mock==1.0.1
oauth2==1.5.211
psycopg2==2.5.1
pyjade==2.0.2
pymongo==2.5.2
python-openid==2.2.5
static==0.4
wsgiref==0.1.2
## Instruction:
Make flake8 a requirement, remove ipython
## Code After:
Django==1.5.2
Jinja2==2.7.1
Markdown==2.3.1
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2b1
dj-static==0.0.5
django-filter==0.7
django-social-auth==0.7.25
djangorestframework==2.3.7
docutils==0.11
flake8
httplib2==0.8
mock==1.0.1
oauth2==1.5.211
psycopg2==2.5.1
pyjade==2.0.2
pymongo==2.5.2
python-openid==2.2.5
static==0.4
wsgiref==0.1.2
| Django==1.5.2
Jinja2==2.7.1
Markdown==2.3.1
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2b1
dj-static==0.0.5
django-filter==0.7
django-social-auth==0.7.25
djangorestframework==2.3.7
docutils==0.11
+ flake8
httplib2==0.8
- ipython==1.0.0
mock==1.0.1
oauth2==1.5.211
psycopg2==2.5.1
pyjade==2.0.2
pymongo==2.5.2
python-openid==2.2.5
static==0.4
wsgiref==0.1.2 | 2 | 0.095238 | 1 | 1 |
ca7883e86b2fb58ad348d709f5d2adb7dcd494b9 | README.md | README.md |
Install sockstat from source. See https://github.com/bahamas10/illumos-sockstat for more information.
## Supported Platforms
* SmartOS
## Usage
```
include_recipe 'sockstat'
```
|
Install sockstat from source. See https://github.com/bahamas10/illumos-sockstat for more information.
## Supported Platforms
* SmartOS
## Usage
Add to Berksfile:
```
cookbook 'sockstat'
cookbook 'sockstat', git: 'git://github.com/livinginthepast/sockstat-cookbook.git'
```
Add to a runlist:
```
include_recipe 'sockstat'
```
| Add berks info to readme | Add berks info to readme | Markdown | mit | livinginthepast/sockstat-cookbook | markdown | ## Code Before:
Install sockstat from source. See https://github.com/bahamas10/illumos-sockstat for more information.
## Supported Platforms
* SmartOS
## Usage
```
include_recipe 'sockstat'
```
## Instruction:
Add berks info to readme
## Code After:
Install sockstat from source. See https://github.com/bahamas10/illumos-sockstat for more information.
## Supported Platforms
* SmartOS
## Usage
Add to Berksfile:
```
cookbook 'sockstat'
cookbook 'sockstat', git: 'git://github.com/livinginthepast/sockstat-cookbook.git'
```
Add to a runlist:
```
include_recipe 'sockstat'
```
|
Install sockstat from source. See https://github.com/bahamas10/illumos-sockstat for more information.
## Supported Platforms
* SmartOS
## Usage
+ Add to Berksfile:
+
+ ```
+ cookbook 'sockstat'
+ cookbook 'sockstat', git: 'git://github.com/livinginthepast/sockstat-cookbook.git'
+ ```
+
+ Add to a runlist:
+
```
include_recipe 'sockstat'
``` | 9 | 0.75 | 9 | 0 |
c47a263d3dccc8a7eebe64d7baa95a65d276fdc8 | lib/postal_address/address.rb | lib/postal_address/address.rb | module Postal
class Address
Fields = [:recipient, :street, :zip, :state, :city, :country, :country_code]
attr_accessor *Fields
def initialize(attrs={})
attrs.each do |attr, value|
self.public_send("#{attr}=", value) if self.respond_to?("#{attr}=")
end if attrs
end
def country_code=(code)
@country_code = Postal.sanitize(code)
end
def country
@country ||= Postal.country_names[country_code] unless in_home_country?
end
def in_home_country?
Postal.home_country == country_code
end
def to_h
attributes
end
def to_s
AddressFormatter::Text.new(attributes).render
end
def to_html(params={})
AddressFormatter::HTML.new(attributes).render(params)
end
private
def attributes
Fields.each_with_object({}) do |key, hash|
hash[key] = public_send(key)
end
end
end
end | module Postal
class Address
Fields = [:recipient, :street, :zip, :state, :city, :country, :country_code]
attr_accessor *Fields
def initialize(attrs={})
attrs.each do |attr, value|
self.public_send("#{attr}=", value) if self.respond_to?("#{attr}=")
end if attrs
end
def country_code=(code)
@country_code = Postal.sanitize(code)
end
def country
@country ||= Postal.country_names[country_code]
end
def to_h
attributes
end
def to_s
AddressFormatter::Text.new(attributes).render
end
def to_html(params={})
AddressFormatter::HTML.new(attributes).render(params)
end
private
def attributes
Fields.each_with_object({}) do |key, hash|
hash[key] = public_send(key)
end
end
end
end | Address should always have a country name | Address should always have a country name
| Ruby | mit | max-power/postal_address | ruby | ## Code Before:
module Postal
class Address
Fields = [:recipient, :street, :zip, :state, :city, :country, :country_code]
attr_accessor *Fields
def initialize(attrs={})
attrs.each do |attr, value|
self.public_send("#{attr}=", value) if self.respond_to?("#{attr}=")
end if attrs
end
def country_code=(code)
@country_code = Postal.sanitize(code)
end
def country
@country ||= Postal.country_names[country_code] unless in_home_country?
end
def in_home_country?
Postal.home_country == country_code
end
def to_h
attributes
end
def to_s
AddressFormatter::Text.new(attributes).render
end
def to_html(params={})
AddressFormatter::HTML.new(attributes).render(params)
end
private
def attributes
Fields.each_with_object({}) do |key, hash|
hash[key] = public_send(key)
end
end
end
end
## Instruction:
Address should always have a country name
## Code After:
module Postal
class Address
Fields = [:recipient, :street, :zip, :state, :city, :country, :country_code]
attr_accessor *Fields
def initialize(attrs={})
attrs.each do |attr, value|
self.public_send("#{attr}=", value) if self.respond_to?("#{attr}=")
end if attrs
end
def country_code=(code)
@country_code = Postal.sanitize(code)
end
def country
@country ||= Postal.country_names[country_code]
end
def to_h
attributes
end
def to_s
AddressFormatter::Text.new(attributes).render
end
def to_html(params={})
AddressFormatter::HTML.new(attributes).render(params)
end
private
def attributes
Fields.each_with_object({}) do |key, hash|
hash[key] = public_send(key)
end
end
end
end | module Postal
class Address
Fields = [:recipient, :street, :zip, :state, :city, :country, :country_code]
attr_accessor *Fields
def initialize(attrs={})
attrs.each do |attr, value|
self.public_send("#{attr}=", value) if self.respond_to?("#{attr}=")
end if attrs
end
def country_code=(code)
@country_code = Postal.sanitize(code)
end
def country
- @country ||= Postal.country_names[country_code] unless in_home_country?
? ------------------------
+ @country ||= Postal.country_names[country_code]
- end
-
- def in_home_country?
- Postal.home_country == country_code
end
def to_h
attributes
end
def to_s
AddressFormatter::Text.new(attributes).render
end
def to_html(params={})
AddressFormatter::HTML.new(attributes).render(params)
end
private
def attributes
Fields.each_with_object({}) do |key, hash|
hash[key] = public_send(key)
end
end
end
end | 6 | 0.133333 | 1 | 5 |
84562c0e47351abb6a2db7d58e58b5820af15131 | index.js | index.js | /* jshint node: true */
'use strict';
module.exports = {
name: 'emberfire-utils'
};
| /* jshint node: true */
'use strict';
var Funnel = require('broccoli-funnel');
var featuresToExclude = [];
function filterFeatures(addonConfig) {
addonConfig.exclude.forEach((exclude) => {
if (exclude === 'firebase-util') {
featuresToExclude.push('**/firebase-util.js');
featuresToExclude.push('**/has-limited.js');
}
});
}
module.exports = {
name: 'emberfire-utils',
included: function(app) {
this._super.included.apply(this, arguments);
var addonConfig = this.app.options[this.name];
if (addonConfig) {
filterFeatures(addonConfig);
}
},
treeForApp: function() {
var tree = this._super.treeForApp.apply(this, arguments);
return new Funnel(tree, { exclude: featuresToExclude });
},
treeForAddon: function() {
var tree = this._super.treeForAddon.apply(this, arguments);
return new Funnel(tree, { exclude: featuresToExclude });
},
};
| Add base code for tree-shaking | Add base code for tree-shaking
| JavaScript | mit | rmmmp/emberfire-utils,rmmmp/emberfire-utils | javascript | ## Code Before:
/* jshint node: true */
'use strict';
module.exports = {
name: 'emberfire-utils'
};
## Instruction:
Add base code for tree-shaking
## Code After:
/* jshint node: true */
'use strict';
var Funnel = require('broccoli-funnel');
var featuresToExclude = [];
function filterFeatures(addonConfig) {
addonConfig.exclude.forEach((exclude) => {
if (exclude === 'firebase-util') {
featuresToExclude.push('**/firebase-util.js');
featuresToExclude.push('**/has-limited.js');
}
});
}
module.exports = {
name: 'emberfire-utils',
included: function(app) {
this._super.included.apply(this, arguments);
var addonConfig = this.app.options[this.name];
if (addonConfig) {
filterFeatures(addonConfig);
}
},
treeForApp: function() {
var tree = this._super.treeForApp.apply(this, arguments);
return new Funnel(tree, { exclude: featuresToExclude });
},
treeForAddon: function() {
var tree = this._super.treeForAddon.apply(this, arguments);
return new Funnel(tree, { exclude: featuresToExclude });
},
};
| /* jshint node: true */
'use strict';
+ var Funnel = require('broccoli-funnel');
+ var featuresToExclude = [];
+
+ function filterFeatures(addonConfig) {
+ addonConfig.exclude.forEach((exclude) => {
+ if (exclude === 'firebase-util') {
+ featuresToExclude.push('**/firebase-util.js');
+ featuresToExclude.push('**/has-limited.js');
+ }
+ });
+ }
+
module.exports = {
- name: 'emberfire-utils'
+ name: 'emberfire-utils',
? +
+
+ included: function(app) {
+ this._super.included.apply(this, arguments);
+
+ var addonConfig = this.app.options[this.name];
+
+ if (addonConfig) {
+ filterFeatures(addonConfig);
+ }
+ },
+
+ treeForApp: function() {
+ var tree = this._super.treeForApp.apply(this, arguments);
+
+ return new Funnel(tree, { exclude: featuresToExclude });
+ },
+
+ treeForAddon: function() {
+ var tree = this._super.treeForAddon.apply(this, arguments);
+
+ return new Funnel(tree, { exclude: featuresToExclude });
+ },
}; | 36 | 6 | 35 | 1 |
6e2c0b76ead42b1596d137ad26e37e6e11d7f0a3 | views/homepage.twig | views/homepage.twig | {% extends "master.twig" %}
{% block main_content %}
{% include 'homepage/cta.twig' %}
{% if talksNextMonth is not empty %}
{% set colwidth = (talksNextMonth|length) %}
{% if talksNextMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% for key, talk in talksNextMonth %}
{% include 'homepage/upcoming-talk.twig' %}
{% endfor %}
{% if talksNextMonth|length < 2 %}
{% include 'homepage/venue.twig' %}
{% endif %}
{% if talksNextMonth|length > 1 %}
{% include 'homepage/venue-summary.twig' %}
{% endif %}
</div>
</div>
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% set colwidth = (talksThisMonth|length) %}
{% if talksThisMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
{% for key, talk in talksThisMonth %}
{% include 'homepage/recent-talk.twig' %}
{% endfor %}
{% if talksThisMonth|length == 1 %}
{% include 'homepage/speakers-wanted.twig' %}
{% endif %}
</div>
</div>
{% include 'homepage/sponsors.twig' %}
{% endblock %}
| {% extends "master.twig" %}
{% block main_content %}
{% include 'homepage/cta.twig' %}
{% if talksNextMonth is not empty %}
{% set colwidth = (talksNextMonth|length) %}
{% if talksNextMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% for key, talk in talksNextMonth %}
{% include 'homepage/upcoming-talk.twig' %}
{% endfor %}
{% if talksNextMonth|length < 2 %}
{% include 'homepage/venue.twig' %}
{% endif %}
{% if talksNextMonth|length > 1 %}
{% include 'homepage/venue-summary.twig' %}
{% endif %}
</div>
</div>
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% set colwidth = (talksThisMonth|length) %}
{% if talksThisMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
{% for key, talk in talksThisMonth %}
{% include 'homepage/recent-talk.twig' %}
{% endfor %}
{% if talksThisMonth|length == 1 %}
{% include 'homepage/venue.twig' %}
{% endif %}
</div>
</div>
{% include 'homepage/sponsors.twig' %}
{% endblock %}
| Replace speakers wanted with venue on months with one talk | Replace speakers wanted with venue on months with one talk
| Twig | mit | PHPDorset/phpdorset.github.io,PHPDorset/phpdorset.github.io,PHPDorset/phpdorset.github.io,PHPDorset/phpdorset.github.io | twig | ## Code Before:
{% extends "master.twig" %}
{% block main_content %}
{% include 'homepage/cta.twig' %}
{% if talksNextMonth is not empty %}
{% set colwidth = (talksNextMonth|length) %}
{% if talksNextMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% for key, talk in talksNextMonth %}
{% include 'homepage/upcoming-talk.twig' %}
{% endfor %}
{% if talksNextMonth|length < 2 %}
{% include 'homepage/venue.twig' %}
{% endif %}
{% if talksNextMonth|length > 1 %}
{% include 'homepage/venue-summary.twig' %}
{% endif %}
</div>
</div>
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% set colwidth = (talksThisMonth|length) %}
{% if talksThisMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
{% for key, talk in talksThisMonth %}
{% include 'homepage/recent-talk.twig' %}
{% endfor %}
{% if talksThisMonth|length == 1 %}
{% include 'homepage/speakers-wanted.twig' %}
{% endif %}
</div>
</div>
{% include 'homepage/sponsors.twig' %}
{% endblock %}
## Instruction:
Replace speakers wanted with venue on months with one talk
## Code After:
{% extends "master.twig" %}
{% block main_content %}
{% include 'homepage/cta.twig' %}
{% if talksNextMonth is not empty %}
{% set colwidth = (talksNextMonth|length) %}
{% if talksNextMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% for key, talk in talksNextMonth %}
{% include 'homepage/upcoming-talk.twig' %}
{% endfor %}
{% if talksNextMonth|length < 2 %}
{% include 'homepage/venue.twig' %}
{% endif %}
{% if talksNextMonth|length > 1 %}
{% include 'homepage/venue-summary.twig' %}
{% endif %}
</div>
</div>
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% set colwidth = (talksThisMonth|length) %}
{% if talksThisMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
{% for key, talk in talksThisMonth %}
{% include 'homepage/recent-talk.twig' %}
{% endfor %}
{% if talksThisMonth|length == 1 %}
{% include 'homepage/venue.twig' %}
{% endif %}
</div>
</div>
{% include 'homepage/sponsors.twig' %}
{% endblock %}
| {% extends "master.twig" %}
{% block main_content %}
{% include 'homepage/cta.twig' %}
{% if talksNextMonth is not empty %}
{% set colwidth = (talksNextMonth|length) %}
{% if talksNextMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% for key, talk in talksNextMonth %}
{% include 'homepage/upcoming-talk.twig' %}
{% endfor %}
{% if talksNextMonth|length < 2 %}
{% include 'homepage/venue.twig' %}
{% endif %}
{% if talksNextMonth|length > 1 %}
{% include 'homepage/venue-summary.twig' %}
{% endif %}
</div>
</div>
{% endif %}
<div class="banner clearfix">
<div class="wrapper clearfix">
{% set colwidth = (talksThisMonth|length) %}
{% if talksThisMonth|length == 1 %}
{% set colwidth = 2 %}
{% endif %}
{% for key, talk in talksThisMonth %}
{% include 'homepage/recent-talk.twig' %}
{% endfor %}
{% if talksThisMonth|length == 1 %}
- {% include 'homepage/speakers-wanted.twig' %}
? ^^ ^^ ---------
+ {% include 'homepage/venue.twig' %}
? ^ ^^
{% endif %}
</div>
</div>
{% include 'homepage/sponsors.twig' %}
{% endblock %} | 2 | 0.037736 | 1 | 1 |
9df135d08b65a0a30a4c0e3255ed8d786887e533 | fractal/govuk-theme/assets/scss/fractal-govuk-theme.scss | fractal/govuk-theme/assets/scss/fractal-govuk-theme.scss | @charset "utf-8";
$tablet-breakpoint: 768px !default;
$desktop-breakpoint: 992px !default;
@import "utilities/fonts";
@import "utilities/printable";
@import "govuk_frontend_toolkit/colours";
@import "govuk_frontend_toolkit/conditionals";
@import "govuk_frontend_toolkit/css3";
@import "govuk_frontend_toolkit/device-pixels";
@import "govuk_frontend_toolkit/font_stack";
@import "govuk_frontend_toolkit/grid_layout";
@import "govuk_frontend_toolkit/url-helpers";
@import "govuk_frontend_toolkit/measurements";
@import "govuk_frontend_toolkit/typography";
@import "palette/syntax-highlighting";
@import "syntax-highlighting";
@import "modules/anchored-heading";
@import "modules/app-pane";
@import "modules/govuk-logo";
@import "modules/header";
@import "modules/phase-banner";
@import "modules/skip-link";
@import "modules/technical-documentation";
@import "modules/toc";
// Override theme here
@import "theme-settings";
| @charset "utf-8";
$tablet-breakpoint: 768px !default;
$desktop-breakpoint: 992px !default;
$path: '/theme/images/';
@import "utilities/fonts";
@import "utilities/printable";
@import "govuk_frontend_toolkit/colours";
@import "govuk_frontend_toolkit/conditionals";
@import "govuk_frontend_toolkit/css3";
@import "govuk_frontend_toolkit/device-pixels";
@import "govuk_frontend_toolkit/font_stack";
@import "govuk_frontend_toolkit/grid_layout";
@import "govuk_frontend_toolkit/url-helpers";
@import "govuk_frontend_toolkit/measurements";
@import "govuk_frontend_toolkit/typography";
@import "palette/syntax-highlighting";
@import "syntax-highlighting";
@import "modules/anchored-heading";
@import "modules/app-pane";
@import "modules/govuk-logo";
@import "modules/header";
@import "modules/phase-banner";
@import "modules/skip-link";
@import "modules/technical-documentation";
@import "modules/toc";
// Override theme here
@import "theme-settings";
| Add the $path variable for the theme image assets | Add the $path variable for the theme image assets
| SCSS | mit | alphagov/govuk_frontend_alpha,alphagov/govuk_frontend_alpha,alphagov/govuk_frontend_alpha | scss | ## Code Before:
@charset "utf-8";
$tablet-breakpoint: 768px !default;
$desktop-breakpoint: 992px !default;
@import "utilities/fonts";
@import "utilities/printable";
@import "govuk_frontend_toolkit/colours";
@import "govuk_frontend_toolkit/conditionals";
@import "govuk_frontend_toolkit/css3";
@import "govuk_frontend_toolkit/device-pixels";
@import "govuk_frontend_toolkit/font_stack";
@import "govuk_frontend_toolkit/grid_layout";
@import "govuk_frontend_toolkit/url-helpers";
@import "govuk_frontend_toolkit/measurements";
@import "govuk_frontend_toolkit/typography";
@import "palette/syntax-highlighting";
@import "syntax-highlighting";
@import "modules/anchored-heading";
@import "modules/app-pane";
@import "modules/govuk-logo";
@import "modules/header";
@import "modules/phase-banner";
@import "modules/skip-link";
@import "modules/technical-documentation";
@import "modules/toc";
// Override theme here
@import "theme-settings";
## Instruction:
Add the $path variable for the theme image assets
## Code After:
@charset "utf-8";
$tablet-breakpoint: 768px !default;
$desktop-breakpoint: 992px !default;
$path: '/theme/images/';
@import "utilities/fonts";
@import "utilities/printable";
@import "govuk_frontend_toolkit/colours";
@import "govuk_frontend_toolkit/conditionals";
@import "govuk_frontend_toolkit/css3";
@import "govuk_frontend_toolkit/device-pixels";
@import "govuk_frontend_toolkit/font_stack";
@import "govuk_frontend_toolkit/grid_layout";
@import "govuk_frontend_toolkit/url-helpers";
@import "govuk_frontend_toolkit/measurements";
@import "govuk_frontend_toolkit/typography";
@import "palette/syntax-highlighting";
@import "syntax-highlighting";
@import "modules/anchored-heading";
@import "modules/app-pane";
@import "modules/govuk-logo";
@import "modules/header";
@import "modules/phase-banner";
@import "modules/skip-link";
@import "modules/technical-documentation";
@import "modules/toc";
// Override theme here
@import "theme-settings";
| @charset "utf-8";
$tablet-breakpoint: 768px !default;
$desktop-breakpoint: 992px !default;
+
+ $path: '/theme/images/';
@import "utilities/fonts";
@import "utilities/printable";
@import "govuk_frontend_toolkit/colours";
@import "govuk_frontend_toolkit/conditionals";
@import "govuk_frontend_toolkit/css3";
@import "govuk_frontend_toolkit/device-pixels";
@import "govuk_frontend_toolkit/font_stack";
@import "govuk_frontend_toolkit/grid_layout";
@import "govuk_frontend_toolkit/url-helpers";
@import "govuk_frontend_toolkit/measurements";
@import "govuk_frontend_toolkit/typography";
@import "palette/syntax-highlighting";
@import "syntax-highlighting";
@import "modules/anchored-heading";
@import "modules/app-pane";
@import "modules/govuk-logo";
@import "modules/header";
@import "modules/phase-banner";
@import "modules/skip-link";
@import "modules/technical-documentation";
@import "modules/toc";
// Override theme here
@import "theme-settings"; | 2 | 0.0625 | 2 | 0 |
ef7cb5ae4fe6c93ecd0a704bad127806be06b6a4 | trunk/includes/sef_map.php | trunk/includes/sef_map.php | <?php
defined('M2_MICRO') or die('Direct Access to this location is not allowed.');
/**
* Sef map array
* @name $sef_map
* @package M2 Micro Framework
* @subpackage Library
* @author Alexander Chaika
* @since 0.2RC1
*/
return array(
'/\?module\=blog\&action\=show\&id\=(.*)/' => array(
'table' => 'post',
'field' => 'alias',
'prefix' => '/blog/',
'suffix' => $config['sef_suffix']
),
'/\?module\=blog\&action\=category\&id\=(.*)/' => array(
'table' => 'category',
'field' => 'alias',
'prefix' => '/category/',
'suffix' => $config['sef_suffix']
)
); | <?php
defined('M2_MICRO') or die('Direct Access to this location is not allowed.');
/**
* Sef map array
* @name $sef_map
* @package M2 Micro Framework
* @subpackage Library
* @author Alexander Chaika
* @since 0.2RC1
*/
return array(
'/\?module\=blog\&action\=show\&id\=(.*)/' => array(
'table' => 'post',
'field' => 'alias',
'prefix' => '/blog/',
'suffix' => Application::$config['sef_suffix']
),
'/\?module\=blog\&action\=category\&id\=(.*)/' => array(
'table' => 'category',
'field' => 'alias',
'prefix' => '/category/',
'suffix' => Application::$config['sef_suffix']
)
); | Fix sef map config provider | Fix sef map config provider
| PHP | bsd-3-clause | manti-by/m2,manti-by/M2MICRO,manti-by/m2,manti-by/M2-Blog-Engine,manti-by/m2,manti-by/M2-Blog-Engine,manti-by/M2-Blog-Engine,manti-by/M2MICRO,manti-by/M2MICRO,manti-by/M2-Blog-Engine,manti-by/m2,manti-by/M2MICRO | php | ## Code Before:
<?php
defined('M2_MICRO') or die('Direct Access to this location is not allowed.');
/**
* Sef map array
* @name $sef_map
* @package M2 Micro Framework
* @subpackage Library
* @author Alexander Chaika
* @since 0.2RC1
*/
return array(
'/\?module\=blog\&action\=show\&id\=(.*)/' => array(
'table' => 'post',
'field' => 'alias',
'prefix' => '/blog/',
'suffix' => $config['sef_suffix']
),
'/\?module\=blog\&action\=category\&id\=(.*)/' => array(
'table' => 'category',
'field' => 'alias',
'prefix' => '/category/',
'suffix' => $config['sef_suffix']
)
);
## Instruction:
Fix sef map config provider
## Code After:
<?php
defined('M2_MICRO') or die('Direct Access to this location is not allowed.');
/**
* Sef map array
* @name $sef_map
* @package M2 Micro Framework
* @subpackage Library
* @author Alexander Chaika
* @since 0.2RC1
*/
return array(
'/\?module\=blog\&action\=show\&id\=(.*)/' => array(
'table' => 'post',
'field' => 'alias',
'prefix' => '/blog/',
'suffix' => Application::$config['sef_suffix']
),
'/\?module\=blog\&action\=category\&id\=(.*)/' => array(
'table' => 'category',
'field' => 'alias',
'prefix' => '/category/',
'suffix' => Application::$config['sef_suffix']
)
); | <?php
defined('M2_MICRO') or die('Direct Access to this location is not allowed.');
/**
* Sef map array
* @name $sef_map
* @package M2 Micro Framework
* @subpackage Library
* @author Alexander Chaika
* @since 0.2RC1
*/
return array(
'/\?module\=blog\&action\=show\&id\=(.*)/' => array(
'table' => 'post',
'field' => 'alias',
'prefix' => '/blog/',
- 'suffix' => $config['sef_suffix']
+ 'suffix' => Application::$config['sef_suffix']
? +++++++++++++
),
'/\?module\=blog\&action\=category\&id\=(.*)/' => array(
'table' => 'category',
'field' => 'alias',
'prefix' => '/category/',
- 'suffix' => $config['sef_suffix']
+ 'suffix' => Application::$config['sef_suffix']
? +++++++++++++
)
); | 4 | 0.153846 | 2 | 2 |
40138e1dc704a28a0865ad3facb7ed593ad42d94 | jmh-run.sh | jmh-run.sh |
ec() {
echo $* 1>&2
$*
}
# expecting a gh-pages symlink in a root directory
#GH_PAGES_PATH=`readlink gh-pages`
# ensure that git repository exists there
#ec git -C $GH_PAGES_PATH status > /dev/null
ec mvn clean install
ec java -jar scala-string-format-test/target/benchmarks.jar -rf json -rff jmh-result.json > jmh.log
#ec mv jmh-result.json $GH_PAGES_PATH
#echo "Don't forget to push gh-pages!"
|
ec() {
echo $* 1>&2
$*
}
ec mvn clean install
ec java -jar scala-string-format-test/target/benchmarks.jar -rf json -rff jmh-result.json > jmh.log
ec mv jmh-result.json docs/
echo "Don't forget to push docs!"
| Move jmh-result.json to docs folder | Move jmh-result.json to docs folder
| Shell | mit | dkomanov/scala-string-format,dkomanov/scala-string-format | shell | ## Code Before:
ec() {
echo $* 1>&2
$*
}
# expecting a gh-pages symlink in a root directory
#GH_PAGES_PATH=`readlink gh-pages`
# ensure that git repository exists there
#ec git -C $GH_PAGES_PATH status > /dev/null
ec mvn clean install
ec java -jar scala-string-format-test/target/benchmarks.jar -rf json -rff jmh-result.json > jmh.log
#ec mv jmh-result.json $GH_PAGES_PATH
#echo "Don't forget to push gh-pages!"
## Instruction:
Move jmh-result.json to docs folder
## Code After:
ec() {
echo $* 1>&2
$*
}
ec mvn clean install
ec java -jar scala-string-format-test/target/benchmarks.jar -rf json -rff jmh-result.json > jmh.log
ec mv jmh-result.json docs/
echo "Don't forget to push docs!"
|
ec() {
echo $* 1>&2
$*
}
- # expecting a gh-pages symlink in a root directory
- #GH_PAGES_PATH=`readlink gh-pages`
- # ensure that git repository exists there
- #ec git -C $GH_PAGES_PATH status > /dev/null
-
ec mvn clean install
ec java -jar scala-string-format-test/target/benchmarks.jar -rf json -rff jmh-result.json > jmh.log
- #ec mv jmh-result.json $GH_PAGES_PATH
+ ec mv jmh-result.json docs/
+
- #echo "Don't forget to push gh-pages!"
? - ^^^^^^^
+ echo "Don't forget to push docs!"
? ^^^
| 10 | 0.588235 | 3 | 7 |
10a956b6c4727b8276230ee349386c7d908b1184 | Madness/FlatMap.swift | Madness/FlatMap.swift | // Copyright (c) 2015 Rob Rix. All rights reserved.
/// Returns a parser which requires `parser` to parse, passes its parsed trees to a function `f`, and then requires the result of `f` to parse.
///
/// This can be used to conveniently make a parser which depends on earlier parsed input, for example to parse exactly the same number of characters, or to parse structurally significant indentation.
public func >>- <C: CollectionType, T, U> (parser: Parser<C, T>.Function, f: T -> Parser<C, U>.Function) -> Parser<C, U>.Function {
return { input, index in
parser(input, index).map { f($0)(input, $1) } ?? nil
}
}
// MARK: - Operators
/// Flat map operator.
infix operator >>- {
associativity left
precedence 150
}
| // Copyright (c) 2015 Rob Rix. All rights reserved.
/// Returns a parser which requires `parser` to parse, passes its parsed trees to a function `f`, and then requires the result of `f` to parse.
///
/// This can be used to conveniently make a parser which depends on earlier parsed input, for example to parse exactly the same number of characters, or to parse structurally significant indentation.
public func >>- <C: CollectionType, T, U> (parser: Parser<C, T>.Function, f: T -> Parser<C, U>.Function) -> Parser<C, U>.Function {
return { input, index in
parser(input, index).flatMap { f($0)(input, $1) }
}
}
// MARK: - Operators
/// Flat map operator.
infix operator >>- {
associativity left
precedence 150
}
| Define >>- in terms of Optional.flatMap. | Define >>- in terms of Optional.flatMap.
| Swift | mit | robrix/Madness,robrix/Madness,robrix/Madness,DanielAsher/Madness,DanielAsher/Madness | swift | ## Code Before:
// Copyright (c) 2015 Rob Rix. All rights reserved.
/// Returns a parser which requires `parser` to parse, passes its parsed trees to a function `f`, and then requires the result of `f` to parse.
///
/// This can be used to conveniently make a parser which depends on earlier parsed input, for example to parse exactly the same number of characters, or to parse structurally significant indentation.
public func >>- <C: CollectionType, T, U> (parser: Parser<C, T>.Function, f: T -> Parser<C, U>.Function) -> Parser<C, U>.Function {
return { input, index in
parser(input, index).map { f($0)(input, $1) } ?? nil
}
}
// MARK: - Operators
/// Flat map operator.
infix operator >>- {
associativity left
precedence 150
}
## Instruction:
Define >>- in terms of Optional.flatMap.
## Code After:
// Copyright (c) 2015 Rob Rix. All rights reserved.
/// Returns a parser which requires `parser` to parse, passes its parsed trees to a function `f`, and then requires the result of `f` to parse.
///
/// This can be used to conveniently make a parser which depends on earlier parsed input, for example to parse exactly the same number of characters, or to parse structurally significant indentation.
public func >>- <C: CollectionType, T, U> (parser: Parser<C, T>.Function, f: T -> Parser<C, U>.Function) -> Parser<C, U>.Function {
return { input, index in
parser(input, index).flatMap { f($0)(input, $1) }
}
}
// MARK: - Operators
/// Flat map operator.
infix operator >>- {
associativity left
precedence 150
}
| // Copyright (c) 2015 Rob Rix. All rights reserved.
/// Returns a parser which requires `parser` to parse, passes its parsed trees to a function `f`, and then requires the result of `f` to parse.
///
/// This can be used to conveniently make a parser which depends on earlier parsed input, for example to parse exactly the same number of characters, or to parse structurally significant indentation.
public func >>- <C: CollectionType, T, U> (parser: Parser<C, T>.Function, f: T -> Parser<C, U>.Function) -> Parser<C, U>.Function {
return { input, index in
- parser(input, index).map { f($0)(input, $1) } ?? nil
? ^ -------
+ parser(input, index).flatMap { f($0)(input, $1) }
? ^^^^^
}
}
// MARK: - Operators
/// Flat map operator.
infix operator >>- {
associativity left
precedence 150
} | 2 | 0.105263 | 1 | 1 |
ee933e64be915a5838e991e0520b99d34c464f9e | src/Action/SaveAction.php | src/Action/SaveAction.php | <?php
/**
* @author Adegoke Obasa <goke@cottacush.com>
*/
namespace CottaCush\Yii2\Action;
use CottaCush\Yii2\Controller\BaseController;
use CottaCush\Yii2\Model\BaseModel;
use yii\base\Action;
/**
* Class SaveAction
* @package app\actions
* @author Adegoke Obasa <goke@cottacush.com>
*/
class SaveAction extends Action
{
public $returnUrl = '';
public $successMessage = '';
public $model;
/**
* @author Adegoke Obasa <goke@cottacush.com>
* @author Akinwunmi Taiwo <taiwo@cottacush.com>
* @return \yii\web\Response
*/
public function run()
{
/** @var BaseController $controller */
$controller = $this->controller;
$referrerUrl = $controller->getRequest()->referrer;
$controller->isPostCheck($referrerUrl);
$postData = $controller->getRequest()->post();
$model = new $this->model;
/** @var BaseModel $model */
$model->load($postData);
if (!$model->save()) {
$controller->flashError($model->getErrors());
return $controller->redirect($referrerUrl);
}
$controller->flashSuccess($this->successMessage);
return $controller->redirect($this->returnUrl);
}
}
| <?php
/**
* @author Adegoke Obasa <goke@cottacush.com>
*/
namespace CottaCush\Yii2\Action;
use CottaCush\Yii2\Controller\BaseController;
use CottaCush\Yii2\Model\BaseModel;
use yii\base\Action;
/**
* Class SaveAction
* @package app\actions
* @author Adegoke Obasa <goke@cottacush.com>
*/
class SaveAction extends Action
{
public $returnUrl = '';
public $successMessage = '';
public $model;
/**
* @author Adegoke Obasa <goke@cottacush.com>
* @author Akinwunmi Taiwo <taiwo@cottacush.com>
* @return \yii\web\Response
*/
public function run()
{
/** @var BaseController $controller */
$controller = $this->controller;
$referrerUrl = $controller->getRequest()->referrer;
$controller->isPostCheck($referrerUrl);
$postData = $controller->getRequest()->post();
$model = new $this->model;
/** @var BaseModel $model */
$model->load($postData);
if (!$model->save()) {
return $controller->returnError($model->getErrors());
}
return $controller->returnSuccess($this->successMessage);
}
}
| Use base controller methods to simplify code | feat(actions): Use base controller methods to simplify code
| PHP | mit | CottaCush/yii2-utils | php | ## Code Before:
<?php
/**
* @author Adegoke Obasa <goke@cottacush.com>
*/
namespace CottaCush\Yii2\Action;
use CottaCush\Yii2\Controller\BaseController;
use CottaCush\Yii2\Model\BaseModel;
use yii\base\Action;
/**
* Class SaveAction
* @package app\actions
* @author Adegoke Obasa <goke@cottacush.com>
*/
class SaveAction extends Action
{
public $returnUrl = '';
public $successMessage = '';
public $model;
/**
* @author Adegoke Obasa <goke@cottacush.com>
* @author Akinwunmi Taiwo <taiwo@cottacush.com>
* @return \yii\web\Response
*/
public function run()
{
/** @var BaseController $controller */
$controller = $this->controller;
$referrerUrl = $controller->getRequest()->referrer;
$controller->isPostCheck($referrerUrl);
$postData = $controller->getRequest()->post();
$model = new $this->model;
/** @var BaseModel $model */
$model->load($postData);
if (!$model->save()) {
$controller->flashError($model->getErrors());
return $controller->redirect($referrerUrl);
}
$controller->flashSuccess($this->successMessage);
return $controller->redirect($this->returnUrl);
}
}
## Instruction:
feat(actions): Use base controller methods to simplify code
## Code After:
<?php
/**
* @author Adegoke Obasa <goke@cottacush.com>
*/
namespace CottaCush\Yii2\Action;
use CottaCush\Yii2\Controller\BaseController;
use CottaCush\Yii2\Model\BaseModel;
use yii\base\Action;
/**
* Class SaveAction
* @package app\actions
* @author Adegoke Obasa <goke@cottacush.com>
*/
class SaveAction extends Action
{
public $returnUrl = '';
public $successMessage = '';
public $model;
/**
* @author Adegoke Obasa <goke@cottacush.com>
* @author Akinwunmi Taiwo <taiwo@cottacush.com>
* @return \yii\web\Response
*/
public function run()
{
/** @var BaseController $controller */
$controller = $this->controller;
$referrerUrl = $controller->getRequest()->referrer;
$controller->isPostCheck($referrerUrl);
$postData = $controller->getRequest()->post();
$model = new $this->model;
/** @var BaseModel $model */
$model->load($postData);
if (!$model->save()) {
return $controller->returnError($model->getErrors());
}
return $controller->returnSuccess($this->successMessage);
}
}
| <?php
/**
* @author Adegoke Obasa <goke@cottacush.com>
*/
namespace CottaCush\Yii2\Action;
use CottaCush\Yii2\Controller\BaseController;
use CottaCush\Yii2\Model\BaseModel;
use yii\base\Action;
/**
* Class SaveAction
* @package app\actions
* @author Adegoke Obasa <goke@cottacush.com>
*/
class SaveAction extends Action
{
public $returnUrl = '';
public $successMessage = '';
public $model;
/**
* @author Adegoke Obasa <goke@cottacush.com>
* @author Akinwunmi Taiwo <taiwo@cottacush.com>
* @return \yii\web\Response
*/
public function run()
{
/** @var BaseController $controller */
$controller = $this->controller;
$referrerUrl = $controller->getRequest()->referrer;
$controller->isPostCheck($referrerUrl);
$postData = $controller->getRequest()->post();
$model = new $this->model;
/** @var BaseModel $model */
$model->load($postData);
if (!$model->save()) {
- $controller->flashError($model->getErrors());
? ^^^^^
+ return $controller->returnError($model->getErrors());
? +++++++ ^^^^^^
- return $controller->redirect($referrerUrl);
}
-
- $controller->flashSuccess($this->successMessage);
? ^^^^^
+ return $controller->returnSuccess($this->successMessage);
? +++++++ ^^^^^^
- return $controller->redirect($this->returnUrl);
}
} | 7 | 0.14 | 2 | 5 |
64820341e027c36f942759ead02652038ec8af9d | doc/administration/monitoring/performance/performance_bar.md | doc/administration/monitoring/performance/performance_bar.md |
A Performance Bar can be displayed, to dig into the performance of a page. When
activated, it looks as follows:

It allows you to:
- see the current host serving the page
- see the timing of the page (backend, frontend)
- the number of DB queries, the time it took, and the detail of these queries

- the number of calls to Redis, and the time it took
- the number of background jobs created by Sidekiq, and the time it took
- the number of Ruby GC calls, and the time it took
- profile the code used to generate the page, line by line

## Enable the Performance Bar via the Admin panel
GitLab Performance Bar is disabled by default. To enable it for a given group,
navigate to the Admin area in **Settings > Profiling - Performance Bar**
(`/admin/application_settings`).
The only required setting you need to set is the full path of the group that
will be allowed to display the Performance Bar.
Make sure _Enable the Performance Bar_ is checked and hit
**Save** to save the changes.
---

---
|
A Performance Bar can be displayed, to dig into the performance of a page. When
activated, it looks as follows:

It allows you to see (from left to right):
- the current host serving the page
- the timing of the page (backend, frontend)
- time taken and number of DB queries, click through for details of these queries

- time taken and number of calls to Redis
- time taken and number of background jobs created by Sidekiq
- profile of the code used to generate the page, line by line for either _all_, _app & lib_ , or _views_. In the profile view, the numbers in the left panel represent wall time, cpu time, and number of calls (based on [rblineprof](https://github.com/tmm1/rblineprof)).

- time taken and number of Ruby GC calls
## Enable the Performance Bar via the Admin panel
GitLab Performance Bar is disabled by default. To enable it for a given group,
navigate to the Admin area in **Settings > Profiling - Performance Bar**
(`/admin/application_settings`).
The only required setting you need to set is the full path of the group that
will be allowed to display the Performance Bar.
Make sure _Enable the Performance Bar_ is checked and hit
**Save** to save the changes.
---

---
| Clarify documentation about performance bar | Clarify documentation about performance bar
| Markdown | mit | iiet/iiet-git,iiet/iiet-git,jirutka/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,stoplightio/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,dreampet/gitlab,dreampet/gitlab,iiet/iiet-git,axilleas/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,axilleas/gitlabhq,jirutka/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,dreampet/gitlab,stoplightio/gitlabhq | markdown | ## Code Before:
A Performance Bar can be displayed, to dig into the performance of a page. When
activated, it looks as follows:

It allows you to:
- see the current host serving the page
- see the timing of the page (backend, frontend)
- the number of DB queries, the time it took, and the detail of these queries

- the number of calls to Redis, and the time it took
- the number of background jobs created by Sidekiq, and the time it took
- the number of Ruby GC calls, and the time it took
- profile the code used to generate the page, line by line

## Enable the Performance Bar via the Admin panel
GitLab Performance Bar is disabled by default. To enable it for a given group,
navigate to the Admin area in **Settings > Profiling - Performance Bar**
(`/admin/application_settings`).
The only required setting you need to set is the full path of the group that
will be allowed to display the Performance Bar.
Make sure _Enable the Performance Bar_ is checked and hit
**Save** to save the changes.
---

---
## Instruction:
Clarify documentation about performance bar
## Code After:
A Performance Bar can be displayed, to dig into the performance of a page. When
activated, it looks as follows:

It allows you to see (from left to right):
- the current host serving the page
- the timing of the page (backend, frontend)
- time taken and number of DB queries, click through for details of these queries

- time taken and number of calls to Redis
- time taken and number of background jobs created by Sidekiq
- profile of the code used to generate the page, line by line for either _all_, _app & lib_ , or _views_. In the profile view, the numbers in the left panel represent wall time, cpu time, and number of calls (based on [rblineprof](https://github.com/tmm1/rblineprof)).

- time taken and number of Ruby GC calls
## Enable the Performance Bar via the Admin panel
GitLab Performance Bar is disabled by default. To enable it for a given group,
navigate to the Admin area in **Settings > Profiling - Performance Bar**
(`/admin/application_settings`).
The only required setting you need to set is the full path of the group that
will be allowed to display the Performance Bar.
Make sure _Enable the Performance Bar_ is checked and hit
**Save** to save the changes.
---

---
|
A Performance Bar can be displayed, to dig into the performance of a page. When
activated, it looks as follows:

- It allows you to:
+ It allows you to see (from left to right):
- - see the current host serving the page
? ----
+ - the current host serving the page
- - see the timing of the page (backend, frontend)
? ----
+ - the timing of the page (backend, frontend)
- - the number of DB queries, the time it took, and the detail of these queries
+ - time taken and number of DB queries, click through for details of these queries

+ - time taken and number of calls to Redis
+ - time taken and number of background jobs created by Sidekiq
+ - profile of the code used to generate the page, line by line for either _all_, _app & lib_ , or _views_. In the profile view, the numbers in the left panel represent wall time, cpu time, and number of calls (based on [rblineprof](https://github.com/tmm1/rblineprof)).
- - the number of calls to Redis, and the time it took
- - the number of background jobs created by Sidekiq, and the time it took
- - the number of Ruby GC calls, and the time it took
- - profile the code used to generate the page, line by line

+ - time taken and number of Ruby GC calls
## Enable the Performance Bar via the Admin panel
GitLab Performance Bar is disabled by default. To enable it for a given group,
navigate to the Admin area in **Settings > Profiling - Performance Bar**
(`/admin/application_settings`).
The only required setting you need to set is the full path of the group that
will be allowed to display the Performance Bar.
Make sure _Enable the Performance Bar_ is checked and hit
**Save** to save the changes.
---

--- | 16 | 0.470588 | 8 | 8 |
c3965f0ef38976057ac2ac10c5b27b9a4b91b293 | cmake/modules/ada.cmake | cmake/modules/ada.cmake | option(ENABLE_ada "Build Ada interface to PLplot" OFF)
# Eventually configure this.
set(GNATMAKE_EXECUTABLE gnatmake)
# This location can be obtained from last element in object search path
# generated by "gnatls -v" command.
# This works for Debian stable. Eventually configure this.
set(GNAT_DIR /usr/lib/gcc-lib/i486-linux/3.3.5/adalib/)
|
option(ENABLE_ada "Enable Ada bindings" OFF)
if(ENABLE_ada)
find_program(GNATMAKE_EXECUTABLE gnatmake)
if(NOT GNATMAKE_EXECUTABLE)
message(STATUS "WARNING: "
"gnatmake not found. Disabling ada bindings")
set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE)
endif(NOT GNATMAKE_EXECUTABLE)
endif(ENABLE_ada)
if(ENABLE_ada)
find_library(GNAT_LIB gnat)
if(NOT GNAT_LIB)
message(STATUS "WARNING: "
"gnat library not found. Disabling ada bindings")
set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE)
endif(NOT GNAT_LIB)
endif(ENABLE_ada)
if(ENABLE_ada)
enable_language(Ada)
endif(ENABLE_ada)
| Implement configuration of all things Ada. | Implement configuration of all things Ada.
svn path=/trunk/; revision=7385
| CMake | lgpl-2.1 | FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot,FreeScienceCommunity/PLPlot | cmake | ## Code Before:
option(ENABLE_ada "Build Ada interface to PLplot" OFF)
# Eventually configure this.
set(GNATMAKE_EXECUTABLE gnatmake)
# This location can be obtained from last element in object search path
# generated by "gnatls -v" command.
# This works for Debian stable. Eventually configure this.
set(GNAT_DIR /usr/lib/gcc-lib/i486-linux/3.3.5/adalib/)
## Instruction:
Implement configuration of all things Ada.
svn path=/trunk/; revision=7385
## Code After:
option(ENABLE_ada "Enable Ada bindings" OFF)
if(ENABLE_ada)
find_program(GNATMAKE_EXECUTABLE gnatmake)
if(NOT GNATMAKE_EXECUTABLE)
message(STATUS "WARNING: "
"gnatmake not found. Disabling ada bindings")
set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE)
endif(NOT GNATMAKE_EXECUTABLE)
endif(ENABLE_ada)
if(ENABLE_ada)
find_library(GNAT_LIB gnat)
if(NOT GNAT_LIB)
message(STATUS "WARNING: "
"gnat library not found. Disabling ada bindings")
set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE)
endif(NOT GNAT_LIB)
endif(ENABLE_ada)
if(ENABLE_ada)
enable_language(Ada)
endif(ENABLE_ada)
| - option(ENABLE_ada "Build Ada interface to PLplot" OFF)
- # Eventually configure this.
+
+ option(ENABLE_ada "Enable Ada bindings" OFF)
+
+ if(ENABLE_ada)
- set(GNATMAKE_EXECUTABLE gnatmake)
? ^^^
+ find_program(GNATMAKE_EXECUTABLE gnatmake)
? ^^^^^^^^^^^^^^
- # This location can be obtained from last element in object search path
- # generated by "gnatls -v" command.
- # This works for Debian stable. Eventually configure this.
- set(GNAT_DIR /usr/lib/gcc-lib/i486-linux/3.3.5/adalib/)
+ if(NOT GNATMAKE_EXECUTABLE)
+ message(STATUS "WARNING: "
+ "gnatmake not found. Disabling ada bindings")
+ set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE)
+ endif(NOT GNATMAKE_EXECUTABLE)
+ endif(ENABLE_ada)
+
+ if(ENABLE_ada)
+ find_library(GNAT_LIB gnat)
+ if(NOT GNAT_LIB)
+ message(STATUS "WARNING: "
+ "gnat library not found. Disabling ada bindings")
+ set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE)
+ endif(NOT GNAT_LIB)
+ endif(ENABLE_ada)
+
+ if(ENABLE_ada)
+ enable_language(Ada)
+ endif(ENABLE_ada) | 31 | 4.428571 | 24 | 7 |
ceae0f8ed16a306cd2bd4383be3b1ea89b485145 | mwms/monitoring/cadvisor.sls | mwms/monitoring/cadvisor.sls | {% set cadvisor_port = 8080 %}
/usr/local/sbin/cadvisor:
file.managed:
- source: salt://mwms/monitoring/files/cadvisor
- mode: 755
/etc/supervisor/conf.d/cadvisor.conf:
file.managed:
- contents: |
[program:cadvisor]
command=/usr/local/sbin/cadvisor -port {{ cadvisor_port }}
- require:
- file: /usr/local/sbin/cadvisor
- watch_in:
- service: supervisor
/etc/consul/service-cadvisor.json:
file.managed:
- contents: |
{
"service": {
"name": "cadvisor",
"port": {{ cadvisor_port }}
}
}
- require:
- file: /etc/supervisor/conf.d/cadvisor.conf
- watch_in:
- cmd: consul-reload
| {% set cadvisor_port = salt['pillar.get']('cadvisor:port', 8080) %}
/usr/local/sbin/cadvisor:
file.managed:
- source: salt://mwms/monitoring/files/cadvisor
- mode: 755
/etc/supervisor/conf.d/cadvisor.conf:
file.managed:
- contents: |
[program:cadvisor]
command=/usr/local/sbin/cadvisor -port {{ cadvisor_port }}
- require:
- file: /usr/local/sbin/cadvisor
- watch_in:
- service: supervisor
/etc/consul/service-cadvisor.json:
file.managed:
- contents: |
{
"service": {
"name": "cadvisor",
"port": {{ cadvisor_port }}
}
}
- require:
- file: /etc/supervisor/conf.d/cadvisor.conf
- watch_in:
- cmd: consul-reload
| Make cAdvisor port configurable via Pillar | Make cAdvisor port configurable via Pillar
| SaltStack | mit | mittwald/salt-microservices | saltstack | ## Code Before:
{% set cadvisor_port = 8080 %}
/usr/local/sbin/cadvisor:
file.managed:
- source: salt://mwms/monitoring/files/cadvisor
- mode: 755
/etc/supervisor/conf.d/cadvisor.conf:
file.managed:
- contents: |
[program:cadvisor]
command=/usr/local/sbin/cadvisor -port {{ cadvisor_port }}
- require:
- file: /usr/local/sbin/cadvisor
- watch_in:
- service: supervisor
/etc/consul/service-cadvisor.json:
file.managed:
- contents: |
{
"service": {
"name": "cadvisor",
"port": {{ cadvisor_port }}
}
}
- require:
- file: /etc/supervisor/conf.d/cadvisor.conf
- watch_in:
- cmd: consul-reload
## Instruction:
Make cAdvisor port configurable via Pillar
## Code After:
{% set cadvisor_port = salt['pillar.get']('cadvisor:port', 8080) %}
/usr/local/sbin/cadvisor:
file.managed:
- source: salt://mwms/monitoring/files/cadvisor
- mode: 755
/etc/supervisor/conf.d/cadvisor.conf:
file.managed:
- contents: |
[program:cadvisor]
command=/usr/local/sbin/cadvisor -port {{ cadvisor_port }}
- require:
- file: /usr/local/sbin/cadvisor
- watch_in:
- service: supervisor
/etc/consul/service-cadvisor.json:
file.managed:
- contents: |
{
"service": {
"name": "cadvisor",
"port": {{ cadvisor_port }}
}
}
- require:
- file: /etc/supervisor/conf.d/cadvisor.conf
- watch_in:
- cmd: consul-reload
| - {% set cadvisor_port = 8080 %}
+ {% set cadvisor_port = salt['pillar.get']('cadvisor:port', 8080) %}
/usr/local/sbin/cadvisor:
file.managed:
- source: salt://mwms/monitoring/files/cadvisor
- mode: 755
/etc/supervisor/conf.d/cadvisor.conf:
file.managed:
- contents: |
[program:cadvisor]
command=/usr/local/sbin/cadvisor -port {{ cadvisor_port }}
- require:
- file: /usr/local/sbin/cadvisor
- watch_in:
- service: supervisor
/etc/consul/service-cadvisor.json:
file.managed:
- contents: |
{
"service": {
"name": "cadvisor",
"port": {{ cadvisor_port }}
}
}
- require:
- file: /etc/supervisor/conf.d/cadvisor.conf
- watch_in:
- cmd: consul-reload | 2 | 0.066667 | 1 | 1 |
5dca760fbda5badeb9052733b22233ec23d02b75 | lib/codeclimate_ci/report.rb | lib/codeclimate_ci/report.rb | module CodeclimateCi
class Report
def self.result_not_ready(retry_count, branch)
puts "Retry #{retry_count}. #{branch} branch analyze is not ready or branch does not exist"
end
def self.worse_code(gpa_diff)
puts "Code in your branch became worse on #{rounded_diff_value(gpa_diff)} points"
end
def self.good_code(gpa_diff)
puts "Gpa score has improved to #{rounded_diff_value(gpa_diff)} points. Go on..."
end
def self.invalid_credentials
puts 'Given invalid credentials. Please check your codeclimate_api_token and repo_id.'
end
def self.rounded_diff_value(gpa_diff)
gpa_diff.abs.round(2)
end
end
end
| module CodeclimateCi
module Report
module_function
def result_not_ready(retry_count, branch)
puts "Retry #{retry_count}. #{branch} branch analyze is not ready or branch does not exist"
end
def worse_code(gpa_diff)
puts "Code in your branch became worse on #{rounded_diff_value(gpa_diff)} points"
end
def good_code(gpa_diff)
puts "Gpa score has improved to #{rounded_diff_value(gpa_diff)} points. Go on..."
end
def invalid_credentials
puts 'Invalid credentials given. Please check your codeclimate_api_token and repo_id.'
end
def rounded_diff_value(gpa_diff)
gpa_diff.abs.round(2)
end
end
end
| Replace Report class by module | Replace Report class by module
| Ruby | mit | fs/codeclimate_ci,fs/codeclimate_ci | ruby | ## Code Before:
module CodeclimateCi
class Report
def self.result_not_ready(retry_count, branch)
puts "Retry #{retry_count}. #{branch} branch analyze is not ready or branch does not exist"
end
def self.worse_code(gpa_diff)
puts "Code in your branch became worse on #{rounded_diff_value(gpa_diff)} points"
end
def self.good_code(gpa_diff)
puts "Gpa score has improved to #{rounded_diff_value(gpa_diff)} points. Go on..."
end
def self.invalid_credentials
puts 'Given invalid credentials. Please check your codeclimate_api_token and repo_id.'
end
def self.rounded_diff_value(gpa_diff)
gpa_diff.abs.round(2)
end
end
end
## Instruction:
Replace Report class by module
## Code After:
module CodeclimateCi
module Report
module_function
def result_not_ready(retry_count, branch)
puts "Retry #{retry_count}. #{branch} branch analyze is not ready or branch does not exist"
end
def worse_code(gpa_diff)
puts "Code in your branch became worse on #{rounded_diff_value(gpa_diff)} points"
end
def good_code(gpa_diff)
puts "Gpa score has improved to #{rounded_diff_value(gpa_diff)} points. Go on..."
end
def invalid_credentials
puts 'Invalid credentials given. Please check your codeclimate_api_token and repo_id.'
end
def rounded_diff_value(gpa_diff)
gpa_diff.abs.round(2)
end
end
end
| module CodeclimateCi
- class Report
+ module Report
+ module_function
+
- def self.result_not_ready(retry_count, branch)
? -----
+ def result_not_ready(retry_count, branch)
puts "Retry #{retry_count}. #{branch} branch analyze is not ready or branch does not exist"
end
- def self.worse_code(gpa_diff)
? -----
+ def worse_code(gpa_diff)
puts "Code in your branch became worse on #{rounded_diff_value(gpa_diff)} points"
end
- def self.good_code(gpa_diff)
? -----
+ def good_code(gpa_diff)
puts "Gpa score has improved to #{rounded_diff_value(gpa_diff)} points. Go on..."
end
- def self.invalid_credentials
? -----
+ def invalid_credentials
- puts 'Given invalid credentials. Please check your codeclimate_api_token and repo_id.'
? ^^^^^^^
+ puts 'Invalid credentials given. Please check your codeclimate_api_token and repo_id.'
? ^ ++++++
end
- def self.rounded_diff_value(gpa_diff)
? -----
+ def rounded_diff_value(gpa_diff)
gpa_diff.abs.round(2)
end
end
end | 16 | 0.695652 | 9 | 7 |
afafda6293081cded0ea1d7cdfefa6b9cfd9caca | userportal-root/src/main/app/core/views/home.view.html | userportal-root/src/main/app/core/views/home.view.html | <div class="row">
<div class="col-md-12">
<h1>I'm looking for data about...</h1>
<div class="input-group input-group-lg">
<input type="search" ng-value="searchString" ng-keyup="submitSearch($event)" ng-model="searchString" class="form-control">
<span class="input-group-btn">
<a ui-sref="listings({query: searchString})" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></a>
</span>
</div>
<div class="row">
<div class="col-md-6">
<h2>Available Adverts</h2>
<ul class="list-unstyled">
<li ng-repeat="listing in rootListings">
<a ui-sref="listing({listingId: listing.metadataId, metadataPath: listing.metadataPath})">{{listing.name}}</a>
</li>
</ul>
</div>
<div class="col-md-6">
<div id="word-cloud" class="word-cloud" word-cloud trends="trends" style="margin: 40px auto;"></div>
</div>
</div>
</div>
</div>
| <div class="row">
<div class="col-md-12">
<h1>I'm looking for data about...</h1>
<div class="input-group input-group-lg">
<input type="search" ng-value="searchString" ng-keyup="submitSearch($event)" ng-model="searchString" class="form-control">
<span class="input-group-btn">
<a ui-sref="listings({query: searchString})" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></a>
</span>
</div>
<div class="row">
<div class="col-md-6">
<h2>Available Adverts</h2>
<ul class="list-unstyled">
<li ng-repeat="listing in rootListings">
<h4>
<a ui-sref="listing({listingId: listing.metadataId, metadataPath: listing.metadataPath})">{{listing.name}}</a>
</h4>
</li>
</ul>
</div>
<div class="col-md-6">
<div id="word-cloud" class="word-cloud" word-cloud trends="trends" style="margin: 40px auto;"></div>
</div>
</div>
</div>
</div>
| Improve home page listing styles | Improve home page listing styles
| HTML | apache-2.0 | RISBIC/DataBroker,RISBIC/DataBroker,RISBIC/DataBroker | html | ## Code Before:
<div class="row">
<div class="col-md-12">
<h1>I'm looking for data about...</h1>
<div class="input-group input-group-lg">
<input type="search" ng-value="searchString" ng-keyup="submitSearch($event)" ng-model="searchString" class="form-control">
<span class="input-group-btn">
<a ui-sref="listings({query: searchString})" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></a>
</span>
</div>
<div class="row">
<div class="col-md-6">
<h2>Available Adverts</h2>
<ul class="list-unstyled">
<li ng-repeat="listing in rootListings">
<a ui-sref="listing({listingId: listing.metadataId, metadataPath: listing.metadataPath})">{{listing.name}}</a>
</li>
</ul>
</div>
<div class="col-md-6">
<div id="word-cloud" class="word-cloud" word-cloud trends="trends" style="margin: 40px auto;"></div>
</div>
</div>
</div>
</div>
## Instruction:
Improve home page listing styles
## Code After:
<div class="row">
<div class="col-md-12">
<h1>I'm looking for data about...</h1>
<div class="input-group input-group-lg">
<input type="search" ng-value="searchString" ng-keyup="submitSearch($event)" ng-model="searchString" class="form-control">
<span class="input-group-btn">
<a ui-sref="listings({query: searchString})" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></a>
</span>
</div>
<div class="row">
<div class="col-md-6">
<h2>Available Adverts</h2>
<ul class="list-unstyled">
<li ng-repeat="listing in rootListings">
<h4>
<a ui-sref="listing({listingId: listing.metadataId, metadataPath: listing.metadataPath})">{{listing.name}}</a>
</h4>
</li>
</ul>
</div>
<div class="col-md-6">
<div id="word-cloud" class="word-cloud" word-cloud trends="trends" style="margin: 40px auto;"></div>
</div>
</div>
</div>
</div>
| <div class="row">
<div class="col-md-12">
<h1>I'm looking for data about...</h1>
<div class="input-group input-group-lg">
<input type="search" ng-value="searchString" ng-keyup="submitSearch($event)" ng-model="searchString" class="form-control">
<span class="input-group-btn">
<a ui-sref="listings({query: searchString})" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></a>
</span>
</div>
<div class="row">
<div class="col-md-6">
<h2>Available Adverts</h2>
<ul class="list-unstyled">
<li ng-repeat="listing in rootListings">
+ <h4>
- <a ui-sref="listing({listingId: listing.metadataId, metadataPath: listing.metadataPath})">{{listing.name}}</a>
+ <a ui-sref="listing({listingId: listing.metadataId, metadataPath: listing.metadataPath})">{{listing.name}}</a>
? ++
+ </h4>
</li>
</ul>
</div>
<div class="col-md-6">
<div id="word-cloud" class="word-cloud" word-cloud trends="trends" style="margin: 40px auto;"></div>
</div>
</div>
</div>
</div> | 4 | 0.166667 | 3 | 1 |
22c4760a423a0b9284011ebfbca1048029f85051 | message-relay/README.md | message-relay/README.md |
This recipe shows how to communicate between the service worker and a page and also using service worker to relay messages between pages.
## Difficulty
Beginner
## Use case
## Features and usage
-
-
-
|
This recipe shows how to communicate between the service worker and a page and also using service worker to relay messages between pages.
## Difficulty
Beginner
## Use case
The `postMessage` API is brilliant for passing messages between windows and `iframe`s, and now we can use the service worker's `message` event to act as a messenger.
## Features and usage
- postMessage API
- Service worker registration
| Add description for message relay | Add description for message relay
| Markdown | mit | TimAbraldes/serviceworker-cookbook,mozilla/serviceworker-cookbook,mozilla/serviceworker-cookbook,TimAbraldes/serviceworker-cookbook | markdown | ## Code Before:
This recipe shows how to communicate between the service worker and a page and also using service worker to relay messages between pages.
## Difficulty
Beginner
## Use case
## Features and usage
-
-
-
## Instruction:
Add description for message relay
## Code After:
This recipe shows how to communicate between the service worker and a page and also using service worker to relay messages between pages.
## Difficulty
Beginner
## Use case
The `postMessage` API is brilliant for passing messages between windows and `iframe`s, and now we can use the service worker's `message` event to act as a messenger.
## Features and usage
- postMessage API
- Service worker registration
|
This recipe shows how to communicate between the service worker and a page and also using service worker to relay messages between pages.
## Difficulty
Beginner
## Use case
-
+ The `postMessage` API is brilliant for passing messages between windows and `iframe`s, and now we can use the service worker's `message` event to act as a messenger.
## Features and usage
+ - postMessage API
+ - Service worker registration
- -
- -
- - | 7 | 0.5 | 3 | 4 |
93d2e33795e240407ab7e18aec67514124ff6713 | app/__init__.py | app/__init__.py | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from instance.config import app_config
app = Flask(__name__)
def EnvironmentName(environ):
app.config.from_object(app_config[environ])
EnvironmentName('TestingConfig')
databases = SQLAlchemy(app)
from app.v1 import bucketlist
| from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from instance.config import app_config
app = Flask(__name__)
def EnvironmentName(environ):
app.config.from_object(app_config[environ])
EnvironmentName('DevelopmentEnviron')
databases = SQLAlchemy(app)
from app.v1 import bucketlist
| Change postman testing environment to development | Change postman testing environment to development
| Python | mit | paulupendo/CP-2-Bucketlist-Application | python | ## Code Before:
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from instance.config import app_config
app = Flask(__name__)
def EnvironmentName(environ):
app.config.from_object(app_config[environ])
EnvironmentName('TestingConfig')
databases = SQLAlchemy(app)
from app.v1 import bucketlist
## Instruction:
Change postman testing environment to development
## Code After:
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from instance.config import app_config
app = Flask(__name__)
def EnvironmentName(environ):
app.config.from_object(app_config[environ])
EnvironmentName('DevelopmentEnviron')
databases = SQLAlchemy(app)
from app.v1 import bucketlist
| from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from instance.config import app_config
app = Flask(__name__)
def EnvironmentName(environ):
app.config.from_object(app_config[environ])
- EnvironmentName('TestingConfig')
+ EnvironmentName('DevelopmentEnviron')
databases = SQLAlchemy(app)
from app.v1 import bucketlist | 2 | 0.125 | 1 | 1 |
313babcd5e1f5e2106a81fee4ccbc617bfe96ed1 | scripts/test-latest-versions.sh | scripts/test-latest-versions.sh |
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then
echo "Skipping test of the latest version; just doing a build."
exit 0
fi
npm i -g npm-check-updates
npm-check-updates -u |
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then
echo "Skipping test of the latest version; just doing a build."
exit 0
fi
npm i -g npm-check-updates
# Remove all ^ or ~ in the package.json file before update to be sure to keep the latest version
sed -i 's/"^/"/g' package.json
sed -i 's/"~/"/g' package.json
# Update package in the latest version
npm-check-updates -u | Improve test latest version script | Improve test latest version script
| Shell | apache-2.0 | DSI-HUG/dejajs-components,DSI-HUG/dejajs-components,DSI-HUG/dejajs-components,DSI-HUG/dejajs-components | shell | ## Code Before:
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then
echo "Skipping test of the latest version; just doing a build."
exit 0
fi
npm i -g npm-check-updates
npm-check-updates -u
## Instruction:
Improve test latest version script
## Code After:
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then
echo "Skipping test of the latest version; just doing a build."
exit 0
fi
npm i -g npm-check-updates
# Remove all ^ or ~ in the package.json file before update to be sure to keep the latest version
sed -i 's/"^/"/g' package.json
sed -i 's/"~/"/g' package.json
# Update package in the latest version
npm-check-updates -u |
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then
echo "Skipping test of the latest version; just doing a build."
exit 0
fi
npm i -g npm-check-updates
+
+ # Remove all ^ or ~ in the package.json file before update to be sure to keep the latest version
+ sed -i 's/"^/"/g' package.json
+ sed -i 's/"~/"/g' package.json
+
+ # Update package in the latest version
npm-check-updates -u | 6 | 0.75 | 6 | 0 |
d39a5652fcf904abc26ef2d7165df6d9ecfc68d8 | chapter5/Game.h | chapter5/Game.h |
class Game
{
public:
static Game *getInstance()
{
if (!instance) {
instance = new Game();
}
return instance;
}
bool init(const char *title, int xPosition, int yPosition, int height, int width, bool fullScreen);
void render();
void update();
void handleEvents();
void clean();
bool isRunning() { return running; }
SDL_Renderer *getRenderer() const { return renderer; }
private:
static Game *instance;
bool running;
SDL_Window *window;
SDL_Renderer *renderer;
GameStateMachine *gameStateMachine;
std::vector<GameObject*> gameObjects;
Game() {}
~Game() {}
};
typedef Game TheGame;
#endif
|
class Game
{
public:
static Game *getInstance()
{
if (!instance) {
instance = new Game();
}
return instance;
}
bool init(const char *title, int xPosition, int yPosition, int height, int width, bool fullScreen);
void render();
void update();
void handleEvents();
void clean();
bool isRunning() { return running; }
SDL_Renderer *getRenderer() const { return renderer; }
GameStateMachine* getStateMachine() { return gameStateMachine; }
private:
static Game *instance;
bool running;
SDL_Window *window;
SDL_Renderer *renderer;
GameStateMachine *gameStateMachine;
std::vector<GameObject*> gameObjects;
Game() {}
~Game() {}
};
typedef Game TheGame;
#endif
| Include method to return pointer to object gameStateMachine | Include method to return pointer to object gameStateMachine
| C | bsd-2-clause | caiotava/SDLBook | c | ## Code Before:
class Game
{
public:
static Game *getInstance()
{
if (!instance) {
instance = new Game();
}
return instance;
}
bool init(const char *title, int xPosition, int yPosition, int height, int width, bool fullScreen);
void render();
void update();
void handleEvents();
void clean();
bool isRunning() { return running; }
SDL_Renderer *getRenderer() const { return renderer; }
private:
static Game *instance;
bool running;
SDL_Window *window;
SDL_Renderer *renderer;
GameStateMachine *gameStateMachine;
std::vector<GameObject*> gameObjects;
Game() {}
~Game() {}
};
typedef Game TheGame;
#endif
## Instruction:
Include method to return pointer to object gameStateMachine
## Code After:
class Game
{
public:
static Game *getInstance()
{
if (!instance) {
instance = new Game();
}
return instance;
}
bool init(const char *title, int xPosition, int yPosition, int height, int width, bool fullScreen);
void render();
void update();
void handleEvents();
void clean();
bool isRunning() { return running; }
SDL_Renderer *getRenderer() const { return renderer; }
GameStateMachine* getStateMachine() { return gameStateMachine; }
private:
static Game *instance;
bool running;
SDL_Window *window;
SDL_Renderer *renderer;
GameStateMachine *gameStateMachine;
std::vector<GameObject*> gameObjects;
Game() {}
~Game() {}
};
typedef Game TheGame;
#endif
|
class Game
{
public:
static Game *getInstance()
{
if (!instance) {
instance = new Game();
}
return instance;
}
bool init(const char *title, int xPosition, int yPosition, int height, int width, bool fullScreen);
void render();
void update();
void handleEvents();
void clean();
bool isRunning() { return running; }
SDL_Renderer *getRenderer() const { return renderer; }
+ GameStateMachine* getStateMachine() { return gameStateMachine; }
private:
static Game *instance;
bool running;
SDL_Window *window;
SDL_Renderer *renderer;
GameStateMachine *gameStateMachine;
std::vector<GameObject*> gameObjects;
Game() {}
~Game() {}
};
typedef Game TheGame;
#endif | 1 | 0.02439 | 1 | 0 |
f27fb5de03175f760d5f73462991dafe9a39e91a | test/exitcode/test_exitcode.sh | test/exitcode/test_exitcode.sh |
export PEGASUS_BIN_DIR=`pegasus-config --bin`
if [ "x$PEGASUS_BIN_DIR" = "x" ]; then
echo "Please make sure pegasus-config is in your path"
exit 1
fi
function exitcode {
echo "Testing $2..."
result=`$PEGASUS_BIN_DIR/pegasus-exitcode --no-rename $2 2>&1`
rc=$?
if [ $rc -ne $1 ]; then
echo "$result" >&2
echo "ERROR" >&2
exit 1
else
echo "OK"
fi
}
# exitcode expected_result outfile
exitcode 0 ok.out
exitcode 1 failed.out
exitcode 1 walltime.out
exitcode 1 zerolen.out
exitcode 0 zeromem.out
exitcode 0 cluster-none.out
exitcode 0 cluster-ok.out
exitcode 1 cluster-error.out
exitcode 1 nonzero.out
exitcode 1 signalled.out
exitcode 0 seqexec-ok.out
exitcode 1 largecode.out
|
cd `dirname $0`
cwd=`pwd`
tests=`dirname $cwd`
home=`dirname $tests`
bin=$home/bin
function exitcode {
echo "Testing $2..."
result=`$bin/pegasus-exitcode --no-rename $2 2>&1`
rc=$?
if [ $rc -ne $1 ]; then
echo "$result" >&2
echo "ERROR" >&2
exit 1
else
echo "OK"
fi
}
# exitcode expected_result outfile
exitcode 0 ok.out
exitcode 1 failed.out
exitcode 1 walltime.out
exitcode 1 zerolen.out
exitcode 0 zeromem.out
exitcode 0 cluster-none.out
exitcode 0 cluster-ok.out
exitcode 1 cluster-error.out
exitcode 1 nonzero.out
exitcode 1 signalled.out
exitcode 0 seqexec-ok.out
exitcode 1 largecode.out
| Sort out path issues in exitcode test driver | Sort out path issues in exitcode test driver
| Shell | apache-2.0 | pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus | shell | ## Code Before:
export PEGASUS_BIN_DIR=`pegasus-config --bin`
if [ "x$PEGASUS_BIN_DIR" = "x" ]; then
echo "Please make sure pegasus-config is in your path"
exit 1
fi
function exitcode {
echo "Testing $2..."
result=`$PEGASUS_BIN_DIR/pegasus-exitcode --no-rename $2 2>&1`
rc=$?
if [ $rc -ne $1 ]; then
echo "$result" >&2
echo "ERROR" >&2
exit 1
else
echo "OK"
fi
}
# exitcode expected_result outfile
exitcode 0 ok.out
exitcode 1 failed.out
exitcode 1 walltime.out
exitcode 1 zerolen.out
exitcode 0 zeromem.out
exitcode 0 cluster-none.out
exitcode 0 cluster-ok.out
exitcode 1 cluster-error.out
exitcode 1 nonzero.out
exitcode 1 signalled.out
exitcode 0 seqexec-ok.out
exitcode 1 largecode.out
## Instruction:
Sort out path issues in exitcode test driver
## Code After:
cd `dirname $0`
cwd=`pwd`
tests=`dirname $cwd`
home=`dirname $tests`
bin=$home/bin
function exitcode {
echo "Testing $2..."
result=`$bin/pegasus-exitcode --no-rename $2 2>&1`
rc=$?
if [ $rc -ne $1 ]; then
echo "$result" >&2
echo "ERROR" >&2
exit 1
else
echo "OK"
fi
}
# exitcode expected_result outfile
exitcode 0 ok.out
exitcode 1 failed.out
exitcode 1 walltime.out
exitcode 1 zerolen.out
exitcode 0 zeromem.out
exitcode 0 cluster-none.out
exitcode 0 cluster-ok.out
exitcode 1 cluster-error.out
exitcode 1 nonzero.out
exitcode 1 signalled.out
exitcode 0 seqexec-ok.out
exitcode 1 largecode.out
|
- export PEGASUS_BIN_DIR=`pegasus-config --bin`
- if [ "x$PEGASUS_BIN_DIR" = "x" ]; then
- echo "Please make sure pegasus-config is in your path"
- exit 1
- fi
+ cd `dirname $0`
+ cwd=`pwd`
+ tests=`dirname $cwd`
+ home=`dirname $tests`
+ bin=$home/bin
function exitcode {
echo "Testing $2..."
- result=`$PEGASUS_BIN_DIR/pegasus-exitcode --no-rename $2 2>&1`
? ^^^^^^^^^^^^^^^
+ result=`$bin/pegasus-exitcode --no-rename $2 2>&1`
? ^^^
rc=$?
if [ $rc -ne $1 ]; then
echo "$result" >&2
echo "ERROR" >&2
exit 1
else
echo "OK"
fi
}
# exitcode expected_result outfile
exitcode 0 ok.out
exitcode 1 failed.out
exitcode 1 walltime.out
exitcode 1 zerolen.out
exitcode 0 zeromem.out
exitcode 0 cluster-none.out
exitcode 0 cluster-ok.out
exitcode 1 cluster-error.out
exitcode 1 nonzero.out
exitcode 1 signalled.out
exitcode 0 seqexec-ok.out
exitcode 1 largecode.out | 12 | 0.363636 | 6 | 6 |
b7335f5c011d9fad3570a097fb1165cc6fbd3cef | src/python/grpcio_tests/tests/unit/_logging_test.py | src/python/grpcio_tests/tests/unit/_logging_test.py | """Test of gRPC Python's interaction with the python logging module"""
import unittest
import six
import grpc
import logging
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
self.assertEqual(0, len(logging.getLogger().handlers))
if __name__ == '__main__':
unittest.main(verbosity=2)
| """Test of gRPC Python's interaction with the python logging module"""
import unittest
import six
from six.moves import reload_module
import logging
import grpc
import functools
import sys
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
self.assertEqual(0, len(logging.getLogger().handlers))
def test_handler_found(self):
old_stderr = sys.stderr
sys.stderr = six.StringIO()
try:
reload_module(logging)
logging.basicConfig()
reload_module(grpc)
self.assertFalse("No handlers could be found" in sys.stderr.getvalue())
finally:
sys.stderr = old_stderr
reload_module(logging)
if __name__ == '__main__':
unittest.main(verbosity=2)
| Add test for 'No handlers could be found' problem | Add test for 'No handlers could be found' problem
| Python | apache-2.0 | mehrdada/grpc,sreecha/grpc,stanley-cheung/grpc,vjpai/grpc,mehrdada/grpc,muxi/grpc,pszemus/grpc,stanley-cheung/grpc,jtattermusch/grpc,donnadionne/grpc,grpc/grpc,mehrdada/grpc,pszemus/grpc,ctiller/grpc,nicolasnoble/grpc,firebase/grpc,donnadionne/grpc,ctiller/grpc,jtattermusch/grpc,donnadionne/grpc,vjpai/grpc,muxi/grpc,donnadionne/grpc,grpc/grpc,vjpai/grpc,carl-mastrangelo/grpc,carl-mastrangelo/grpc,stanley-cheung/grpc,ctiller/grpc,jboeuf/grpc,donnadionne/grpc,ejona86/grpc,jboeuf/grpc,carl-mastrangelo/grpc,carl-mastrangelo/grpc,ctiller/grpc,nicolasnoble/grpc,grpc/grpc,pszemus/grpc,stanley-cheung/grpc,sreecha/grpc,jtattermusch/grpc,stanley-cheung/grpc,ctiller/grpc,nicolasnoble/grpc,nicolasnoble/grpc,nicolasnoble/grpc,grpc/grpc,pszemus/grpc,carl-mastrangelo/grpc,mehrdada/grpc,nicolasnoble/grpc,grpc/grpc,jtattermusch/grpc,pszemus/grpc,muxi/grpc,carl-mastrangelo/grpc,ctiller/grpc,vjpai/grpc,grpc/grpc,ctiller/grpc,jtattermusch/grpc,sreecha/grpc,vjpai/grpc,firebase/grpc,donnadionne/grpc,sreecha/grpc,donnadionne/grpc,muxi/grpc,grpc/grpc,muxi/grpc,sreecha/grpc,pszemus/grpc,vjpai/grpc,firebase/grpc,grpc/grpc,jboeuf/grpc,jboeuf/grpc,carl-mastrangelo/grpc,firebase/grpc,ejona86/grpc,pszemus/grpc,ejona86/grpc,stanley-cheung/grpc,stanley-cheung/grpc,ejona86/grpc,vjpai/grpc,ejona86/grpc,vjpai/grpc,vjpai/grpc,mehrdada/grpc,pszemus/grpc,muxi/grpc,jtattermusch/grpc,jtattermusch/grpc,stanley-cheung/grpc,ctiller/grpc,mehrdada/grpc,ctiller/grpc,grpc/grpc,ejona86/grpc,pszemus/grpc,jtattermusch/grpc,firebase/grpc,ejona86/grpc,firebase/grpc,nicolasnoble/grpc,firebase/grpc,ejona86/grpc,nicolasnoble/grpc,mehrdada/grpc,firebase/grpc,donnadionne/grpc,stanley-cheung/grpc,pszemus/grpc,jboeuf/grpc,donnadionne/grpc,vjpai/grpc,donnadionne/grpc,mehrdada/grpc,ctiller/grpc,muxi/grpc,vjpai/grpc,pszemus/grpc,stanley-cheung/grpc,jboeuf/grpc,mehrdada/grpc,carl-mastrangelo/grpc,jtattermusch/grpc,carl-mastrangelo/grpc,mehrdada/grpc,muxi/grpc,jboeuf/grpc,ctiller/grpc,mehrdada/grpc,nicolasnoble/grpc,carl-mastrangelo/grpc,ejona86/grpc,ejona86/grpc,mehrdada/grpc,muxi/grpc,muxi/grpc,pszemus/grpc,donnadionne/grpc,nicolasnoble/grpc,sreecha/grpc,jboeuf/grpc,sreecha/grpc,carl-mastrangelo/grpc,jtattermusch/grpc,donnadionne/grpc,ctiller/grpc,firebase/grpc,vjpai/grpc,carl-mastrangelo/grpc,jboeuf/grpc,firebase/grpc,jtattermusch/grpc,jtattermusch/grpc,muxi/grpc,grpc/grpc,sreecha/grpc,sreecha/grpc,ejona86/grpc,grpc/grpc,sreecha/grpc,stanley-cheung/grpc,firebase/grpc,muxi/grpc,stanley-cheung/grpc,jboeuf/grpc,jboeuf/grpc,sreecha/grpc,nicolasnoble/grpc,grpc/grpc,firebase/grpc,sreecha/grpc,ejona86/grpc,nicolasnoble/grpc,jboeuf/grpc | python | ## Code Before:
"""Test of gRPC Python's interaction with the python logging module"""
import unittest
import six
import grpc
import logging
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
self.assertEqual(0, len(logging.getLogger().handlers))
if __name__ == '__main__':
unittest.main(verbosity=2)
## Instruction:
Add test for 'No handlers could be found' problem
## Code After:
"""Test of gRPC Python's interaction with the python logging module"""
import unittest
import six
from six.moves import reload_module
import logging
import grpc
import functools
import sys
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
self.assertEqual(0, len(logging.getLogger().handlers))
def test_handler_found(self):
old_stderr = sys.stderr
sys.stderr = six.StringIO()
try:
reload_module(logging)
logging.basicConfig()
reload_module(grpc)
self.assertFalse("No handlers could be found" in sys.stderr.getvalue())
finally:
sys.stderr = old_stderr
reload_module(logging)
if __name__ == '__main__':
unittest.main(verbosity=2)
| """Test of gRPC Python's interaction with the python logging module"""
import unittest
import six
+ from six.moves import reload_module
+ import logging
import grpc
- import logging
-
+ import functools
+ import sys
class LoggingTest(unittest.TestCase):
def test_logger_not_occupied(self):
self.assertEqual(0, len(logging.getLogger().handlers))
+ def test_handler_found(self):
+ old_stderr = sys.stderr
+ sys.stderr = six.StringIO()
+ try:
+ reload_module(logging)
+ logging.basicConfig()
+ reload_module(grpc)
+ self.assertFalse("No handlers could be found" in sys.stderr.getvalue())
+ finally:
+ sys.stderr = old_stderr
+ reload_module(logging)
if __name__ == '__main__':
unittest.main(verbosity=2) | 17 | 1.0625 | 15 | 2 |
9b7eec8bd3d6cf65ab135ac751a9fa353909ca52 | app/assets/stylesheets/components/_category_detail.scss | app/assets/stylesheets/components/_category_detail.scss | .category-detail {
padding-bottom: $baseline-unit*3;
border-bottom: 1px solid $color-category-border;
}
.category-detail__heading {
a {
color: $color-heading;
}
}
.category-detail__list {
@extend .list--unstyled;
.icon {
margin-left: -32px;
margin-right: 12px;
}
}
.category-detail__list--icons {
padding-left: $baseline-unit*6;
}
| .category-detail {
padding-bottom: $baseline-unit*3;
border-bottom: 1px solid $color-category-border;
}
// cannot use nth-of-type in IE8 so appending an nth-of-type class to stack the sections
.category-detail--3,
.category-detail--5,
.category-detail--7,
.category-detail--9,
.category-detail--11 {
@include respond-to($mq-m) {
clear: both;
}
@include respond-to($mq-l) {
clear: none;
}
}
.category-detail--4,
.category-detail--7,
.category-detail--10 {
@include respond-to($mq-l) {
clear: both;
}
}
.category-detail__heading {
a {
color: $color-heading;
}
}
.category-detail__list {
@extend .list--unstyled;
.icon {
margin-left: -32px;
margin-right: 12px;
}
}
.category-detail__list--icons {
padding-left: $baseline-unit*6;
}
| Move category grid layout to module | Move category grid layout to module
| SCSS | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | scss | ## Code Before:
.category-detail {
padding-bottom: $baseline-unit*3;
border-bottom: 1px solid $color-category-border;
}
.category-detail__heading {
a {
color: $color-heading;
}
}
.category-detail__list {
@extend .list--unstyled;
.icon {
margin-left: -32px;
margin-right: 12px;
}
}
.category-detail__list--icons {
padding-left: $baseline-unit*6;
}
## Instruction:
Move category grid layout to module
## Code After:
.category-detail {
padding-bottom: $baseline-unit*3;
border-bottom: 1px solid $color-category-border;
}
// cannot use nth-of-type in IE8 so appending an nth-of-type class to stack the sections
.category-detail--3,
.category-detail--5,
.category-detail--7,
.category-detail--9,
.category-detail--11 {
@include respond-to($mq-m) {
clear: both;
}
@include respond-to($mq-l) {
clear: none;
}
}
.category-detail--4,
.category-detail--7,
.category-detail--10 {
@include respond-to($mq-l) {
clear: both;
}
}
.category-detail__heading {
a {
color: $color-heading;
}
}
.category-detail__list {
@extend .list--unstyled;
.icon {
margin-left: -32px;
margin-right: 12px;
}
}
.category-detail__list--icons {
padding-left: $baseline-unit*6;
}
| .category-detail {
padding-bottom: $baseline-unit*3;
border-bottom: 1px solid $color-category-border;
+ }
+
+ // cannot use nth-of-type in IE8 so appending an nth-of-type class to stack the sections
+ .category-detail--3,
+ .category-detail--5,
+ .category-detail--7,
+ .category-detail--9,
+ .category-detail--11 {
+
+ @include respond-to($mq-m) {
+ clear: both;
+ }
+
+ @include respond-to($mq-l) {
+ clear: none;
+ }
+ }
+
+ .category-detail--4,
+ .category-detail--7,
+ .category-detail--10 {
+
+ @include respond-to($mq-l) {
+ clear: both;
+ }
}
.category-detail__heading {
a {
color: $color-heading;
}
}
.category-detail__list {
@extend .list--unstyled;
.icon {
margin-left: -32px;
margin-right: 12px;
}
}
.category-detail__list--icons {
padding-left: $baseline-unit*6;
}
+
+ | 27 | 1.173913 | 27 | 0 |
0c9478a88f251fad03446bf1f96854f474710eff | pax/config/Simulation.ini | pax/config/Simulation.ini | [pax]
parent_configuration = "_base"
plugin_group_names = ['input', 'software_zle', 'dsp', 'transform', 'output']
input = 'WaveformSimulator.WaveformSimulatorFromCSV'
software_zle = 'ZLE.SoftwareZLE'
[ZLE]
max_intervals = 32 # See CAEN 1724 manual Rev 31 p. 32. I assume we have firmware version > 0.6)
zle_threshold = 40 # ADC counts # Dan got this from a recent DAX xml file. May have been 30 in earlier (~run10) datasets?
samples_to_store_before = 50 # Observation?? Some config??
samples_to_store_after = 50 # Observation?? Some config??
[WaveformSimulator.WaveformSimulatorFromCSV]
input_name = 'dummy_waveforms.csv'
[WaveformSimulator.WaveformSimulatorFromNEST]
input_name = 'Neutron-4FaX-10k.root'
| [pax]
parent_configuration = "_base"
plugin_group_names = ['input', 'software_zle', 'dsp', 'transform', 'output']
input = 'WaveformSimulator.WaveformSimulatorFromCSV'
software_zle = 'ZLE.SoftwareZLE'
[ZLE]
max_intervals = 32 # See CAEN 1724 manual Rev 31 p. 32. I assume we have firmware version > 0.6)
zle_threshold = 30 # ADC counts # See any XENON100 DAX XML file. Ini file has something else, but is overridden.
samples_to_store_before = 50 # Observation?? Some config??
samples_to_store_after = 50 # Observation?? Some config??
[WaveformSimulator.WaveformSimulatorFromCSV]
input_name = 'dummy_waveforms.csv'
[WaveformSimulator.WaveformSimulatorFromNEST]
input_name = 'Neutron-4FaX-10k.root'
| Fix ZLE Threshold Talked to Dan, he got 40 ADC counts from the INI-file, but the XML has 30 and overrides this. | Fix ZLE Threshold
Talked to Dan, he got 40 ADC counts from the INI-file, but the XML has 30 and overrides this.
| INI | bsd-3-clause | XENON1T/pax,XENON1T/pax | ini | ## Code Before:
[pax]
parent_configuration = "_base"
plugin_group_names = ['input', 'software_zle', 'dsp', 'transform', 'output']
input = 'WaveformSimulator.WaveformSimulatorFromCSV'
software_zle = 'ZLE.SoftwareZLE'
[ZLE]
max_intervals = 32 # See CAEN 1724 manual Rev 31 p. 32. I assume we have firmware version > 0.6)
zle_threshold = 40 # ADC counts # Dan got this from a recent DAX xml file. May have been 30 in earlier (~run10) datasets?
samples_to_store_before = 50 # Observation?? Some config??
samples_to_store_after = 50 # Observation?? Some config??
[WaveformSimulator.WaveformSimulatorFromCSV]
input_name = 'dummy_waveforms.csv'
[WaveformSimulator.WaveformSimulatorFromNEST]
input_name = 'Neutron-4FaX-10k.root'
## Instruction:
Fix ZLE Threshold
Talked to Dan, he got 40 ADC counts from the INI-file, but the XML has 30 and overrides this.
## Code After:
[pax]
parent_configuration = "_base"
plugin_group_names = ['input', 'software_zle', 'dsp', 'transform', 'output']
input = 'WaveformSimulator.WaveformSimulatorFromCSV'
software_zle = 'ZLE.SoftwareZLE'
[ZLE]
max_intervals = 32 # See CAEN 1724 manual Rev 31 p. 32. I assume we have firmware version > 0.6)
zle_threshold = 30 # ADC counts # See any XENON100 DAX XML file. Ini file has something else, but is overridden.
samples_to_store_before = 50 # Observation?? Some config??
samples_to_store_after = 50 # Observation?? Some config??
[WaveformSimulator.WaveformSimulatorFromCSV]
input_name = 'dummy_waveforms.csv'
[WaveformSimulator.WaveformSimulatorFromNEST]
input_name = 'Neutron-4FaX-10k.root'
| [pax]
parent_configuration = "_base"
plugin_group_names = ['input', 'software_zle', 'dsp', 'transform', 'output']
input = 'WaveformSimulator.WaveformSimulatorFromCSV'
software_zle = 'ZLE.SoftwareZLE'
[ZLE]
max_intervals = 32 # See CAEN 1724 manual Rev 31 p. 32. I assume we have firmware version > 0.6)
- zle_threshold = 40 # ADC counts # Dan got this from a recent DAX xml file. May have been 30 in earlier (~run10) datasets?
+ zle_threshold = 30 # ADC counts # See any XENON100 DAX XML file. Ini file has something else, but is overridden.
samples_to_store_before = 50 # Observation?? Some config??
samples_to_store_after = 50 # Observation?? Some config??
[WaveformSimulator.WaveformSimulatorFromCSV]
input_name = 'dummy_waveforms.csv'
[WaveformSimulator.WaveformSimulatorFromNEST]
input_name = 'Neutron-4FaX-10k.root' | 2 | 0.111111 | 1 | 1 |
18f144ae9458e19e559654d9f6083c4179b40a90 | src/styles/index.css | src/styles/index.css | body a {
color: #000;
text-decoration-style: dotted;
}
body a:visited {
color: #000;
}
body {
font-family: 'Roboto', sans-serif;
}
.block-center {
margin: 5px auto;
min-width: 180px;
padding: 0 15px;
width: 30%;
}
.social-icon-group table {
margin: 0 auto;
}
.social-icon-group table td {
margin: 0 15px;
}
.social-icon-group i {
color: #006064;
margin: 0 15px;
text-decoration: none;
}
.footer-text {
text-align: center;
font-size: .75rem;
color: #808080;
} | body a {
color: #000;
text-decoration-style: dotted;
}
body a:visited {
color: #000;
}
body {
font-family: 'Roboto', sans-serif;
}
.block-center {
margin: 5px auto;
min-width: 180px;
padding: 0 15px;
width: 30%;
}
.social-icon-group table {
margin: 0 auto;
}
.social-icon-group table td {
margin: 0 15px;
}
.social-icon-group i {
color: #006064;
margin: 0 15px;
text-decoration: none;
}
.footer-text {
text-align: center;
font-size: .75rem;
color: #808080;
}
#footer { /* Temporary positioning */
position: absolute;
width: 100%;
bottom: 0;
} | Update css to force footer at bottom of page. will udpate later when more content is available. | Update css to force footer at bottom of page. will udpate later when more content is available.
| CSS | mit | 5-gwoap/adopt-a-family,5-gwoap/adopt-a-family | css | ## Code Before:
body a {
color: #000;
text-decoration-style: dotted;
}
body a:visited {
color: #000;
}
body {
font-family: 'Roboto', sans-serif;
}
.block-center {
margin: 5px auto;
min-width: 180px;
padding: 0 15px;
width: 30%;
}
.social-icon-group table {
margin: 0 auto;
}
.social-icon-group table td {
margin: 0 15px;
}
.social-icon-group i {
color: #006064;
margin: 0 15px;
text-decoration: none;
}
.footer-text {
text-align: center;
font-size: .75rem;
color: #808080;
}
## Instruction:
Update css to force footer at bottom of page. will udpate later when more content is available.
## Code After:
body a {
color: #000;
text-decoration-style: dotted;
}
body a:visited {
color: #000;
}
body {
font-family: 'Roboto', sans-serif;
}
.block-center {
margin: 5px auto;
min-width: 180px;
padding: 0 15px;
width: 30%;
}
.social-icon-group table {
margin: 0 auto;
}
.social-icon-group table td {
margin: 0 15px;
}
.social-icon-group i {
color: #006064;
margin: 0 15px;
text-decoration: none;
}
.footer-text {
text-align: center;
font-size: .75rem;
color: #808080;
}
#footer { /* Temporary positioning */
position: absolute;
width: 100%;
bottom: 0;
} | body a {
color: #000;
text-decoration-style: dotted;
}
body a:visited {
color: #000;
}
body {
font-family: 'Roboto', sans-serif;
}
.block-center {
margin: 5px auto;
min-width: 180px;
padding: 0 15px;
width: 30%;
}
.social-icon-group table {
margin: 0 auto;
}
.social-icon-group table td {
margin: 0 15px;
}
.social-icon-group i {
color: #006064;
margin: 0 15px;
text-decoration: none;
}
.footer-text {
text-align: center;
font-size: .75rem;
color: #808080;
}
+
+ #footer { /* Temporary positioning */
+ position: absolute;
+ width: 100%;
+ bottom: 0;
+ } | 6 | 0.153846 | 6 | 0 |
50eb05b9efef951704ef4f19d7134e648b7790b8 | lib/thredded_create_app/tasks/setup_database.rb | lib/thredded_create_app/tasks/setup_database.rb | require 'thredded_create_app/tasks/base'
require 'securerandom'
module ThreddedCreateApp
module Tasks
class SetupDatabase < Base
def summary
'Create the database user, configure database.yml, and run migrations'
end
def after_bundle
log_info 'Creating config/database.yml from template'
copy_template 'setup_database/database.yml.erb', 'config/database.yml'
create_db_user
run 'bundle exec rails db:create db:migrate'
git_commit 'Configure Database'
end
private
def create_db_user
log_info "Creating #{dev_user} local database user"
run 'bash',
File.join(File.dirname(__FILE__), 'setup_database',
'create_postgresql_user.sh'),
dev_user,
dev_user_password,
log: false
end
def dev_user
"#{app_name}_dev"
end
def dev_user_password
@dev_user_password ||= SecureRandom.urlsafe_base64(20)
end
end
end
end
| require 'thredded_create_app/tasks/base'
module ThreddedCreateApp
module Tasks
class SetupDatabase < Base
def summary
'Create the database user, configure database.yml, and run migrations'
end
def after_bundle
log_info 'Creating config/database.yml from template'
copy_template 'setup_database/database.yml.erb', 'config/database.yml'
create_db_user
run 'bundle exec rails db:create db:migrate'
git_commit 'Configure Database'
end
private
def create_db_user
log_info "Creating #{dev_user} local database user"
run 'bash',
File.join(File.dirname(__FILE__), 'setup_database',
'create_postgresql_user.sh'),
dev_user,
dev_user_password,
log: false
end
def dev_user
"#{app_name}_dev"
end
def dev_user_password
# Use a fixed password so that multiple runs of thredded_create_app don't fail.
@dev_user_password ||= app_name
end
end
end
end
| Use fixed DB password so that multiple runs succeed | Use fixed DB password so that multiple runs succeed
| Ruby | mit | thredded/thredded_create_app,thredded/thredded_create_app,thredded/thredded_create_app,thredded/thredded_create_app | ruby | ## Code Before:
require 'thredded_create_app/tasks/base'
require 'securerandom'
module ThreddedCreateApp
module Tasks
class SetupDatabase < Base
def summary
'Create the database user, configure database.yml, and run migrations'
end
def after_bundle
log_info 'Creating config/database.yml from template'
copy_template 'setup_database/database.yml.erb', 'config/database.yml'
create_db_user
run 'bundle exec rails db:create db:migrate'
git_commit 'Configure Database'
end
private
def create_db_user
log_info "Creating #{dev_user} local database user"
run 'bash',
File.join(File.dirname(__FILE__), 'setup_database',
'create_postgresql_user.sh'),
dev_user,
dev_user_password,
log: false
end
def dev_user
"#{app_name}_dev"
end
def dev_user_password
@dev_user_password ||= SecureRandom.urlsafe_base64(20)
end
end
end
end
## Instruction:
Use fixed DB password so that multiple runs succeed
## Code After:
require 'thredded_create_app/tasks/base'
module ThreddedCreateApp
module Tasks
class SetupDatabase < Base
def summary
'Create the database user, configure database.yml, and run migrations'
end
def after_bundle
log_info 'Creating config/database.yml from template'
copy_template 'setup_database/database.yml.erb', 'config/database.yml'
create_db_user
run 'bundle exec rails db:create db:migrate'
git_commit 'Configure Database'
end
private
def create_db_user
log_info "Creating #{dev_user} local database user"
run 'bash',
File.join(File.dirname(__FILE__), 'setup_database',
'create_postgresql_user.sh'),
dev_user,
dev_user_password,
log: false
end
def dev_user
"#{app_name}_dev"
end
def dev_user_password
# Use a fixed password so that multiple runs of thredded_create_app don't fail.
@dev_user_password ||= app_name
end
end
end
end
| require 'thredded_create_app/tasks/base'
- require 'securerandom'
module ThreddedCreateApp
module Tasks
class SetupDatabase < Base
def summary
'Create the database user, configure database.yml, and run migrations'
end
def after_bundle
log_info 'Creating config/database.yml from template'
copy_template 'setup_database/database.yml.erb', 'config/database.yml'
create_db_user
run 'bundle exec rails db:create db:migrate'
git_commit 'Configure Database'
end
private
def create_db_user
log_info "Creating #{dev_user} local database user"
run 'bash',
File.join(File.dirname(__FILE__), 'setup_database',
'create_postgresql_user.sh'),
dev_user,
dev_user_password,
log: false
end
def dev_user
"#{app_name}_dev"
end
def dev_user_password
- @dev_user_password ||= SecureRandom.urlsafe_base64(20)
+ # Use a fixed password so that multiple runs of thredded_create_app don't fail.
+ @dev_user_password ||= app_name
end
end
end
end | 4 | 0.102564 | 2 | 2 |
68bcc74e5e83fa87da71051d7aea7d684f068e01 | test-requirements.txt | test-requirements.txt | coverage==4.5.2
pep8==1.7.1
flake8==3.7.7
flake8-copyright==0.2.2
astroid==1.6.5
pylint==1.9.4
pylint-plugin-utils>=0.4
bandit==1.5.1
ipython<6.0.0
mock==2.0.0
nose>=1.3.7
tabulate
unittest2
sphinx==1.7.9
sphinx-autobuild
# nosetests enhancements
rednose
nose-timer==0.7.5
# splitting tests run on a separate CI machines
nose-parallel==0.3.1
# Required by st2client tests
pyyaml==5.1
RandomWords
gunicorn==19.9.0
psutil==5.6.1
webtest==2.0.25
rstcheck>=3.3.1,<3.4
tox==3.8.6
pyrabbit
# Since StackStorm v2.8.0 we now use cryptography instead of keyczar, but we still have some tests
# which utilize keyczar and ensure new cryptography code is fully compatible with keyczar code
# (those tests only run under Python 2.7 since keyczar doesn't support Python 3.x).
# See https://github.com/StackStorm/st2/pull/4165
python-keyczar
| coverage==4.5.2
pep8==1.7.1
st2flake8==0.1
astroid==1.6.5
pylint==1.9.4
pylint-plugin-utils>=0.4
bandit==1.5.1
ipython<6.0.0
mock==2.0.0
nose>=1.3.7
tabulate
unittest2
sphinx==1.7.9
sphinx-autobuild
# nosetests enhancements
rednose
nose-timer==0.7.5
# splitting tests run on a separate CI machines
nose-parallel==0.3.1
# Required by st2client tests
pyyaml==5.1
RandomWords
gunicorn==19.9.0
psutil==5.6.1
webtest==2.0.25
rstcheck>=3.3.1,<3.4
tox==3.8.6
pyrabbit
# Since StackStorm v2.8.0 we now use cryptography instead of keyczar, but we still have some tests
# which utilize keyczar and ensure new cryptography code is fully compatible with keyczar code
# (those tests only run under Python 2.7 since keyczar doesn't support Python 3.x).
# See https://github.com/StackStorm/st2/pull/4165
python-keyczar
| Replace flake8 related dependencies with st2flake8 | Replace flake8 related dependencies with st2flake8
Moving forward, st2flake8 on pypi will contain the requirements and custom plugins required for flake8 checks of st2 related repos.
| Text | apache-2.0 | nzlosh/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2 | text | ## Code Before:
coverage==4.5.2
pep8==1.7.1
flake8==3.7.7
flake8-copyright==0.2.2
astroid==1.6.5
pylint==1.9.4
pylint-plugin-utils>=0.4
bandit==1.5.1
ipython<6.0.0
mock==2.0.0
nose>=1.3.7
tabulate
unittest2
sphinx==1.7.9
sphinx-autobuild
# nosetests enhancements
rednose
nose-timer==0.7.5
# splitting tests run on a separate CI machines
nose-parallel==0.3.1
# Required by st2client tests
pyyaml==5.1
RandomWords
gunicorn==19.9.0
psutil==5.6.1
webtest==2.0.25
rstcheck>=3.3.1,<3.4
tox==3.8.6
pyrabbit
# Since StackStorm v2.8.0 we now use cryptography instead of keyczar, but we still have some tests
# which utilize keyczar and ensure new cryptography code is fully compatible with keyczar code
# (those tests only run under Python 2.7 since keyczar doesn't support Python 3.x).
# See https://github.com/StackStorm/st2/pull/4165
python-keyczar
## Instruction:
Replace flake8 related dependencies with st2flake8
Moving forward, st2flake8 on pypi will contain the requirements and custom plugins required for flake8 checks of st2 related repos.
## Code After:
coverage==4.5.2
pep8==1.7.1
st2flake8==0.1
astroid==1.6.5
pylint==1.9.4
pylint-plugin-utils>=0.4
bandit==1.5.1
ipython<6.0.0
mock==2.0.0
nose>=1.3.7
tabulate
unittest2
sphinx==1.7.9
sphinx-autobuild
# nosetests enhancements
rednose
nose-timer==0.7.5
# splitting tests run on a separate CI machines
nose-parallel==0.3.1
# Required by st2client tests
pyyaml==5.1
RandomWords
gunicorn==19.9.0
psutil==5.6.1
webtest==2.0.25
rstcheck>=3.3.1,<3.4
tox==3.8.6
pyrabbit
# Since StackStorm v2.8.0 we now use cryptography instead of keyczar, but we still have some tests
# which utilize keyczar and ensure new cryptography code is fully compatible with keyczar code
# (those tests only run under Python 2.7 since keyczar doesn't support Python 3.x).
# See https://github.com/StackStorm/st2/pull/4165
python-keyczar
| coverage==4.5.2
pep8==1.7.1
+ st2flake8==0.1
- flake8==3.7.7
- flake8-copyright==0.2.2
astroid==1.6.5
pylint==1.9.4
pylint-plugin-utils>=0.4
bandit==1.5.1
ipython<6.0.0
mock==2.0.0
nose>=1.3.7
tabulate
unittest2
sphinx==1.7.9
sphinx-autobuild
# nosetests enhancements
rednose
nose-timer==0.7.5
# splitting tests run on a separate CI machines
nose-parallel==0.3.1
# Required by st2client tests
pyyaml==5.1
RandomWords
gunicorn==19.9.0
psutil==5.6.1
webtest==2.0.25
rstcheck>=3.3.1,<3.4
tox==3.8.6
pyrabbit
# Since StackStorm v2.8.0 we now use cryptography instead of keyczar, but we still have some tests
# which utilize keyczar and ensure new cryptography code is fully compatible with keyczar code
# (those tests only run under Python 2.7 since keyczar doesn't support Python 3.x).
# See https://github.com/StackStorm/st2/pull/4165
python-keyczar | 3 | 0.088235 | 1 | 2 |
2b288f29c4e51e6c63d5f42d323cecee310d16e4 | README.md | README.md | Arduino based software for PE1JPD's 23 cm NBFM Transceiver
This project is still in early development. Check back here to see progress, or help me by contributing pull requests to this repository.
Cheers,
Rolf | Arduino based software for [http://www.pe1jpd.nl/index.php/23cm_nbfm/](PE1JPD's 23 cm NBFM Transceiver).
This project is still in early development. Check back here to see progress, or help me by contributing pull requests to this repository.
Cheers,
Rolf | Add link to Bas' site. | Add link to Bas' site.
| Markdown | mit | realrolfje/23CM-TRX,realrolfje/23CM-TRX | markdown | ## Code Before:
Arduino based software for PE1JPD's 23 cm NBFM Transceiver
This project is still in early development. Check back here to see progress, or help me by contributing pull requests to this repository.
Cheers,
Rolf
## Instruction:
Add link to Bas' site.
## Code After:
Arduino based software for [http://www.pe1jpd.nl/index.php/23cm_nbfm/](PE1JPD's 23 cm NBFM Transceiver).
This project is still in early development. Check back here to see progress, or help me by contributing pull requests to this repository.
Cheers,
Rolf | - Arduino based software for PE1JPD's 23 cm NBFM Transceiver
+ Arduino based software for [http://www.pe1jpd.nl/index.php/23cm_nbfm/](PE1JPD's 23 cm NBFM Transceiver).
This project is still in early development. Check back here to see progress, or help me by contributing pull requests to this repository.
Cheers,
Rolf | 2 | 0.333333 | 1 | 1 |
51918651f4e9fc2585db0479d5df470348f31977 | deploy.sh | deploy.sh |
command -v s3cmd >/dev/null 2>&1 || { echo "s3cmd not found. Aborting." >&2; exit 1; }
SOURCE=./public/
TARGET=s3://iiro.fi
s3cmd sync $SOURCE $TARGET \
--delete-removed \
--guess-mime-type \
--no-mime-magic \
--no-preserve \
--server-side-encryption \
--cf-invalidate \
|
SOURCE=./public/
TARGET=s3://iiro.fi
aws s3 sync $SOURCE $TARGET --delete --sse
| Use awscli for syncing to s3 | Use awscli for syncing to s3
| Shell | mit | iiroj/iiro.fi,iiroj/iiro.fi,iiroj/iiro.fi | shell | ## Code Before:
command -v s3cmd >/dev/null 2>&1 || { echo "s3cmd not found. Aborting." >&2; exit 1; }
SOURCE=./public/
TARGET=s3://iiro.fi
s3cmd sync $SOURCE $TARGET \
--delete-removed \
--guess-mime-type \
--no-mime-magic \
--no-preserve \
--server-side-encryption \
--cf-invalidate \
## Instruction:
Use awscli for syncing to s3
## Code After:
SOURCE=./public/
TARGET=s3://iiro.fi
aws s3 sync $SOURCE $TARGET --delete --sse
| -
- command -v s3cmd >/dev/null 2>&1 || { echo "s3cmd not found. Aborting." >&2; exit 1; }
SOURCE=./public/
TARGET=s3://iiro.fi
+ aws s3 sync $SOURCE $TARGET --delete --sse
- s3cmd sync $SOURCE $TARGET \
- --delete-removed \
- --guess-mime-type \
- --no-mime-magic \
- --no-preserve \
- --server-side-encryption \
- --cf-invalidate \ | 10 | 0.769231 | 1 | 9 |
e81226131c58b9c64cd440cd316e599a92df7d6b | .travis.yml | .travis.yml | language: cpp
script: sudo apt-get install libboost1.54-dev ffmpeg zlib1g-dev && make
dist: trusty
sudo: required
cache:
directories:
- .downloads
- libraries
| language: cpp
script: sudo add-apt-repository ppa:mc3man/trusty-media && sudo apt-get install libboost1.54-dev ffmpeg zlib1g-dev && make
dist: trusty
sudo: required
cache:
directories:
- .downloads
- libraries
| Add apt repository for ffmpeg. | Add apt repository for ffmpeg.
| YAML | mit | pichtj/groebner,pichtj/groebner,pichtj/groebner | yaml | ## Code Before:
language: cpp
script: sudo apt-get install libboost1.54-dev ffmpeg zlib1g-dev && make
dist: trusty
sudo: required
cache:
directories:
- .downloads
- libraries
## Instruction:
Add apt repository for ffmpeg.
## Code After:
language: cpp
script: sudo add-apt-repository ppa:mc3man/trusty-media && sudo apt-get install libboost1.54-dev ffmpeg zlib1g-dev && make
dist: trusty
sudo: required
cache:
directories:
- .downloads
- libraries
| language: cpp
- script: sudo apt-get install libboost1.54-dev ffmpeg zlib1g-dev && make
+ script: sudo add-apt-repository ppa:mc3man/trusty-media && sudo apt-get install libboost1.54-dev ffmpeg zlib1g-dev && make
dist: trusty
sudo: required
cache:
directories:
- .downloads
- libraries | 2 | 0.25 | 1 | 1 |
548815d7bcdd5d4190cbf7792cd3261d03740afc | .travis.yml | .travis.yml | language: python
sudo: required
python:
- '2.7'
- '3.4'
- '3.5'
cache:
directories:
- $HOME/.cache/pip
env:
# Current production
- ELASTICSEARCH_VERSION=1.4.4
# Future production point release
- ELASTICSEARCH_VERSION=1.4.5
# Latest in 1.X line (as of 2016-02-10)
- ELASTICSEARCH_VERSION=1.7.5
services:
- postgresql
before_install:
# Use same ES version as in production (also the Travis "elasticsearch" service setting fails to start)
- travis_retry curl -OL https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo dpkg -i --force-confnew elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo service elasticsearch start
install:
- travis_retry pip install -e .
- travis_retry pip install "file://$(pwd)#egg=django-bulbs[dev]"
before_script:
- psql -c 'create database bulbs;' -U postgres
# Wait for ES startup
- until curl http://localhost:9200/; do sleep 1; done
script:
- py.test --cov bulbs --cov-report term-missing
after_success:
- coveralls
| language: python
sudo: required
python:
- '2.7'
- '3.4'
- '3.5'
cache:
directories:
- $HOME/.cache/pip
env:
# Current production
- ELASTICSEARCH_VERSION=1.4.4
# Future production point release. Disabled 2016-04-07 to speed up Travis builds
#- ELASTICSEARCH_VERSION=1.4.5
# Latest in 1.X line (as of 2016-02-10)
- ELASTICSEARCH_VERSION=1.7.5
services:
- postgresql
before_install:
# Use same ES version as in production (also the Travis "elasticsearch" service setting fails to start)
- travis_retry curl -OL https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo dpkg -i --force-confnew elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo service elasticsearch start
install:
- travis_retry pip install -e .
- travis_retry pip install "file://$(pwd)#egg=django-bulbs[dev]"
before_script:
- psql -c 'create database bulbs;' -U postgres
# Wait for ES startup
- until curl http://localhost:9200/; do sleep 1; done
script:
- py.test --cov bulbs --cov-report term-missing
after_success:
- coveralls
| Disable Travis ES 1.4.5 config for faster builds | Disable Travis ES 1.4.5 config for faster builds
| YAML | mit | theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs | yaml | ## Code Before:
language: python
sudo: required
python:
- '2.7'
- '3.4'
- '3.5'
cache:
directories:
- $HOME/.cache/pip
env:
# Current production
- ELASTICSEARCH_VERSION=1.4.4
# Future production point release
- ELASTICSEARCH_VERSION=1.4.5
# Latest in 1.X line (as of 2016-02-10)
- ELASTICSEARCH_VERSION=1.7.5
services:
- postgresql
before_install:
# Use same ES version as in production (also the Travis "elasticsearch" service setting fails to start)
- travis_retry curl -OL https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo dpkg -i --force-confnew elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo service elasticsearch start
install:
- travis_retry pip install -e .
- travis_retry pip install "file://$(pwd)#egg=django-bulbs[dev]"
before_script:
- psql -c 'create database bulbs;' -U postgres
# Wait for ES startup
- until curl http://localhost:9200/; do sleep 1; done
script:
- py.test --cov bulbs --cov-report term-missing
after_success:
- coveralls
## Instruction:
Disable Travis ES 1.4.5 config for faster builds
## Code After:
language: python
sudo: required
python:
- '2.7'
- '3.4'
- '3.5'
cache:
directories:
- $HOME/.cache/pip
env:
# Current production
- ELASTICSEARCH_VERSION=1.4.4
# Future production point release. Disabled 2016-04-07 to speed up Travis builds
#- ELASTICSEARCH_VERSION=1.4.5
# Latest in 1.X line (as of 2016-02-10)
- ELASTICSEARCH_VERSION=1.7.5
services:
- postgresql
before_install:
# Use same ES version as in production (also the Travis "elasticsearch" service setting fails to start)
- travis_retry curl -OL https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo dpkg -i --force-confnew elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo service elasticsearch start
install:
- travis_retry pip install -e .
- travis_retry pip install "file://$(pwd)#egg=django-bulbs[dev]"
before_script:
- psql -c 'create database bulbs;' -U postgres
# Wait for ES startup
- until curl http://localhost:9200/; do sleep 1; done
script:
- py.test --cov bulbs --cov-report term-missing
after_success:
- coveralls
| language: python
sudo: required
python:
- '2.7'
- '3.4'
- '3.5'
cache:
directories:
- $HOME/.cache/pip
env:
# Current production
- ELASTICSEARCH_VERSION=1.4.4
- # Future production point release
+ # Future production point release. Disabled 2016-04-07 to speed up Travis builds
- - ELASTICSEARCH_VERSION=1.4.5
+ #- ELASTICSEARCH_VERSION=1.4.5
? +
# Latest in 1.X line (as of 2016-02-10)
- ELASTICSEARCH_VERSION=1.7.5
services:
- postgresql
before_install:
# Use same ES version as in production (also the Travis "elasticsearch" service setting fails to start)
- travis_retry curl -OL https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo dpkg -i --force-confnew elasticsearch-$ELASTICSEARCH_VERSION.deb
- sudo service elasticsearch start
install:
- travis_retry pip install -e .
- travis_retry pip install "file://$(pwd)#egg=django-bulbs[dev]"
before_script:
- psql -c 'create database bulbs;' -U postgres
# Wait for ES startup
- until curl http://localhost:9200/; do sleep 1; done
script:
- py.test --cov bulbs --cov-report term-missing
after_success:
- coveralls | 4 | 0.111111 | 2 | 2 |
4becb29bb0c46eae7e2acdd1569788f2737fa9af | app/views/admin/markdown/_index.html.haml | app/views/admin/markdown/_index.html.haml | :markdown
- Titles – `#` (biggest), `##` (smaller), `###` (even smaller), ...
- `*italic*` – *italic*
- `**bold**` – **bold**
- `[link](http://example.com)` – [link](http://example.com)
- `<email@example.com>` – <email@example.com>
In order to get paragraphs in texts, an additional empty new line is required between
them.
**Bad**:
This is one paragraph.<br>
This is another paragraph.
**Good**:
This is one paragraph.
This is another paragraph.
| :markdown
- Titles – `#` (biggest), `##` (smaller), `###` (even smaller), ...
- `*italic*` – *italic*
- `**bold**` – **bold**
- `[link](http://example.com)` – [link](http://example.com)
- `` – displays the image
- `<email@example.com>` – <email@example.com>
In order to get paragraphs in texts, an additional empty new line is required between
them.
**Bad**:
This is one paragraph.<br>
This is another paragraph.
**Good**:
This is one paragraph.
This is another paragraph.
| Add reference to embedding images | Add reference to embedding images
| Haml | mit | twin/synergy,twin/synergy | haml | ## Code Before:
:markdown
- Titles – `#` (biggest), `##` (smaller), `###` (even smaller), ...
- `*italic*` – *italic*
- `**bold**` – **bold**
- `[link](http://example.com)` – [link](http://example.com)
- `<email@example.com>` – <email@example.com>
In order to get paragraphs in texts, an additional empty new line is required between
them.
**Bad**:
This is one paragraph.<br>
This is another paragraph.
**Good**:
This is one paragraph.
This is another paragraph.
## Instruction:
Add reference to embedding images
## Code After:
:markdown
- Titles – `#` (biggest), `##` (smaller), `###` (even smaller), ...
- `*italic*` – *italic*
- `**bold**` – **bold**
- `[link](http://example.com)` – [link](http://example.com)
- `` – displays the image
- `<email@example.com>` – <email@example.com>
In order to get paragraphs in texts, an additional empty new line is required between
them.
**Bad**:
This is one paragraph.<br>
This is another paragraph.
**Good**:
This is one paragraph.
This is another paragraph.
| :markdown
- Titles – `#` (biggest), `##` (smaller), `###` (even smaller), ...
- `*italic*` – *italic*
- `**bold**` – **bold**
- `[link](http://example.com)` – [link](http://example.com)
+ - `` – displays the image
- `<email@example.com>` – <email@example.com>
In order to get paragraphs in texts, an additional empty new line is required between
them.
**Bad**:
This is one paragraph.<br>
This is another paragraph.
**Good**:
This is one paragraph.
This is another paragraph. | 1 | 0.05 | 1 | 0 |
fa045daa01f3f4186cc87502075f645069f3eaa8 | .zuul.yaml | .zuul.yaml | - job:
name: oslo.log-src-grenade-devstack
parent: legacy-dsvm-base
voting: false
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
post-run: playbooks/legacy/oslo.log-src-grenade-devstack/post.yaml
required-projects:
- openstack-dev/grenade
- openstack-infra/devstack-gate
- openstack/oslo.log
run: playbooks/legacy/oslo.log-src-grenade-devstack/run.yaml
timeout: 10800
- project:
check:
jobs:
- oslo.log-src-grenade-devstack
- openstack-tox-lower-constraints
gate:
jobs:
- openstack-tox-lower-constraints
| - job:
name: oslo.log-src-grenade-devstack
parent: legacy-dsvm-base
voting: false
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
post-run: playbooks/legacy/oslo.log-src-grenade-devstack/post.yaml
required-projects:
- openstack-dev/grenade
- openstack-infra/devstack-gate
- openstack/oslo.log
run: playbooks/legacy/oslo.log-src-grenade-devstack/run.yaml
timeout: 10800
- job:
name: oslo.log-jsonformatter
parent: devstack-tempest
timeout: 10800
vars:
devstack_local_conf:
post-config:
$NOVA_CONF:
DEFAULT:
use_json: True
$NEUTRON_CONF:
DEFAULT:
use_json: True
$GLANCE_CONF:
DEFAULT:
use_json: True
$CINDER_CONF:
DEFAULT:
use_json: True
$KEYSTONE_CONF:
DEFAULT:
use_json: True
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^releasenotes/.*$
- project:
check:
jobs:
- oslo.log-src-grenade-devstack
- oslo.log-jsonformatter
- openstack-tox-lower-constraints
gate:
jobs:
- oslo.log-jsonformatter
- openstack-tox-lower-constraints
| Add devstack job with JSONFormatter configured | Add devstack job with JSONFormatter configured
We've run into issues in the past where a service passed something
to the logger that broke JSONFormatter. To try to catch those sooner,
add a job that configures the services to use JSONFormatter. This
should provide a more realistic test of the formatter than we can
hope to accomplish in unit tests.
Change-Id: Icfb399cfe3dce89dfd5fb5079295a4947828417a
| YAML | apache-2.0 | openstack/oslo.log | yaml | ## Code Before:
- job:
name: oslo.log-src-grenade-devstack
parent: legacy-dsvm-base
voting: false
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
post-run: playbooks/legacy/oslo.log-src-grenade-devstack/post.yaml
required-projects:
- openstack-dev/grenade
- openstack-infra/devstack-gate
- openstack/oslo.log
run: playbooks/legacy/oslo.log-src-grenade-devstack/run.yaml
timeout: 10800
- project:
check:
jobs:
- oslo.log-src-grenade-devstack
- openstack-tox-lower-constraints
gate:
jobs:
- openstack-tox-lower-constraints
## Instruction:
Add devstack job with JSONFormatter configured
We've run into issues in the past where a service passed something
to the logger that broke JSONFormatter. To try to catch those sooner,
add a job that configures the services to use JSONFormatter. This
should provide a more realistic test of the formatter than we can
hope to accomplish in unit tests.
Change-Id: Icfb399cfe3dce89dfd5fb5079295a4947828417a
## Code After:
- job:
name: oslo.log-src-grenade-devstack
parent: legacy-dsvm-base
voting: false
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
post-run: playbooks/legacy/oslo.log-src-grenade-devstack/post.yaml
required-projects:
- openstack-dev/grenade
- openstack-infra/devstack-gate
- openstack/oslo.log
run: playbooks/legacy/oslo.log-src-grenade-devstack/run.yaml
timeout: 10800
- job:
name: oslo.log-jsonformatter
parent: devstack-tempest
timeout: 10800
vars:
devstack_local_conf:
post-config:
$NOVA_CONF:
DEFAULT:
use_json: True
$NEUTRON_CONF:
DEFAULT:
use_json: True
$GLANCE_CONF:
DEFAULT:
use_json: True
$CINDER_CONF:
DEFAULT:
use_json: True
$KEYSTONE_CONF:
DEFAULT:
use_json: True
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^releasenotes/.*$
- project:
check:
jobs:
- oslo.log-src-grenade-devstack
- oslo.log-jsonformatter
- openstack-tox-lower-constraints
gate:
jobs:
- oslo.log-jsonformatter
- openstack-tox-lower-constraints
| - job:
name: oslo.log-src-grenade-devstack
parent: legacy-dsvm-base
voting: false
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
post-run: playbooks/legacy/oslo.log-src-grenade-devstack/post.yaml
required-projects:
- openstack-dev/grenade
- openstack-infra/devstack-gate
- openstack/oslo.log
run: playbooks/legacy/oslo.log-src-grenade-devstack/run.yaml
timeout: 10800
+ - job:
+ name: oslo.log-jsonformatter
+ parent: devstack-tempest
+ timeout: 10800
+ vars:
+ devstack_local_conf:
+ post-config:
+ $NOVA_CONF:
+ DEFAULT:
+ use_json: True
+ $NEUTRON_CONF:
+ DEFAULT:
+ use_json: True
+ $GLANCE_CONF:
+ DEFAULT:
+ use_json: True
+ $CINDER_CONF:
+ DEFAULT:
+ use_json: True
+ $KEYSTONE_CONF:
+ DEFAULT:
+ use_json: True
+ irrelevant-files:
+ - ^.*\.rst$
+ - ^api-ref/.*$
+ - ^doc/.*$
+ - ^releasenotes/.*$
+
+
- project:
check:
jobs:
- oslo.log-src-grenade-devstack
-
+ - oslo.log-jsonformatter
- openstack-tox-lower-constraints
gate:
jobs:
+ - oslo.log-jsonformatter
- openstack-tox-lower-constraints | 32 | 1.333333 | 31 | 1 |
105111b0ed02a7c698ba79f88a54636ec3d5b2a8 | madrona/common/management/commands/install_cleangeometry.py | madrona/common/management/commands/install_cleangeometry.py | from django.core.management.base import BaseCommand, AppCommand
from django.db import connection, transaction
import os
class Command(BaseCommand):
help = "Installs a cleangeometry function in postgres required for processing incoming geometries."
def handle(self, **options):
path = os.path.abspath(os.path.join(__file__, '../../../cleangeometry.sql'))
sql = open(path,'r').read()
# http://stackoverflow.com/questions/1734814/why-isnt-psycopg2-
# executing-any-of-my-sql-functions-indexerror-tuple-index-o
sql = sql.replace('%','%%')
cursor = connection.cursor()
cursor.execute(sql)
print cursor.statusmessage
| from django.core.management.base import BaseCommand, AppCommand
from django.db import connection, transaction
import os
class Command(BaseCommand):
help = "Installs a cleangeometry function in postgres required for processing incoming geometries."
def handle(self, **options):
path = os.path.abspath(os.path.join(__file__, '../../../cleangeometry.sql'))
sql = open(path,'r').read()
# http://stackoverflow.com/questions/1734814/why-isnt-psycopg2-
# executing-any-of-my-sql-functions-indexerror-tuple-index-o
sql = sql.replace('%','%%')
cursor = connection.cursor()
cursor.db.enter_transaction_management()
cursor.execute(sql)
print cursor.statusmessage
print "TESTING"
cursor.execute("select cleangeometry(st_geomfromewkt('SRID=4326;POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))'))")
assert cursor.fetchall() == [('0103000020E610000001000000050000000000000000003E4000000000000024400000000000002440000000000000344000000000000034400000000000004440000000000000444000000000000044400000000000003E400000000000002440',)]
cursor.db.commit()
cursor.db.leave_transaction_management()
print "CLEANGEOMETRY function installed successfully"
| Use transactions to make sure cleangeometry function sticks | Use transactions to make sure cleangeometry function sticks
| Python | bsd-3-clause | Ecotrust/madrona_addons,Ecotrust/madrona_addons | python | ## Code Before:
from django.core.management.base import BaseCommand, AppCommand
from django.db import connection, transaction
import os
class Command(BaseCommand):
help = "Installs a cleangeometry function in postgres required for processing incoming geometries."
def handle(self, **options):
path = os.path.abspath(os.path.join(__file__, '../../../cleangeometry.sql'))
sql = open(path,'r').read()
# http://stackoverflow.com/questions/1734814/why-isnt-psycopg2-
# executing-any-of-my-sql-functions-indexerror-tuple-index-o
sql = sql.replace('%','%%')
cursor = connection.cursor()
cursor.execute(sql)
print cursor.statusmessage
## Instruction:
Use transactions to make sure cleangeometry function sticks
## Code After:
from django.core.management.base import BaseCommand, AppCommand
from django.db import connection, transaction
import os
class Command(BaseCommand):
help = "Installs a cleangeometry function in postgres required for processing incoming geometries."
def handle(self, **options):
path = os.path.abspath(os.path.join(__file__, '../../../cleangeometry.sql'))
sql = open(path,'r').read()
# http://stackoverflow.com/questions/1734814/why-isnt-psycopg2-
# executing-any-of-my-sql-functions-indexerror-tuple-index-o
sql = sql.replace('%','%%')
cursor = connection.cursor()
cursor.db.enter_transaction_management()
cursor.execute(sql)
print cursor.statusmessage
print "TESTING"
cursor.execute("select cleangeometry(st_geomfromewkt('SRID=4326;POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))'))")
assert cursor.fetchall() == [('0103000020E610000001000000050000000000000000003E4000000000000024400000000000002440000000000000344000000000000034400000000000004440000000000000444000000000000044400000000000003E400000000000002440',)]
cursor.db.commit()
cursor.db.leave_transaction_management()
print "CLEANGEOMETRY function installed successfully"
| from django.core.management.base import BaseCommand, AppCommand
from django.db import connection, transaction
import os
class Command(BaseCommand):
help = "Installs a cleangeometry function in postgres required for processing incoming geometries."
def handle(self, **options):
path = os.path.abspath(os.path.join(__file__, '../../../cleangeometry.sql'))
sql = open(path,'r').read()
# http://stackoverflow.com/questions/1734814/why-isnt-psycopg2-
# executing-any-of-my-sql-functions-indexerror-tuple-index-o
sql = sql.replace('%','%%')
cursor = connection.cursor()
+ cursor.db.enter_transaction_management()
+
cursor.execute(sql)
print cursor.statusmessage
+ print "TESTING"
+
+ cursor.execute("select cleangeometry(st_geomfromewkt('SRID=4326;POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))'))")
+ assert cursor.fetchall() == [('0103000020E610000001000000050000000000000000003E4000000000000024400000000000002440000000000000344000000000000034400000000000004440000000000000444000000000000044400000000000003E400000000000002440',)]
+ cursor.db.commit()
+ cursor.db.leave_transaction_management()
+ print "CLEANGEOMETRY function installed successfully"
+ | 10 | 0.555556 | 10 | 0 |
8ef2c5f752e204c53f6c163794d71e646c287383 | Casks/rubymine-eap.rb | Casks/rubymine-eap.rb | class RubymineEap < Cask
url 'http://download.jetbrains.com/ruby/RubyMine-135.494.dmg'
homepage 'http://confluence.jetbrains.com/display/RUBYDEV/RubyMine+EAP'
version '135.494'
sha256 'b960fcdab00f6dced5a2a28f56b5d5a4ae15f1e6f34ef3c654250a26611c1e55'
link 'RubyMine EAP.app'
end
| class RubymineEap < Cask
url 'http://download.jetbrains.com/ruby/RubyMine-135.550.dmg'
homepage 'http://confluence.jetbrains.com/display/RUBYDEV/RubyMine+EAP'
version '135.550'
sha256 '900859265a190291662c8b103a538754c9a4adf6ca1b4ad49bb64cae2fd14205'
link 'RubyMine EAP.app'
end
| Update RubyMine EAP to build 135.550 | Update RubyMine EAP to build 135.550
| Ruby | bsd-2-clause | coeligena/homebrew-verscustomized,bey2lah/homebrew-versions,danielbayley/homebrew-versions,rogeriopradoj/homebrew-versions,yurikoles/homebrew-versions,FinalDes/homebrew-versions,lukaselmer/homebrew-versions,hugoboos/homebrew-versions,peterjosling/homebrew-versions,peterjosling/homebrew-versions,bondezbond/homebrew-versions,deizel/homebrew-versions,lantrix/homebrew-versions,hubwub/homebrew-versions,pinut/homebrew-versions,ddinchev/homebrew-versions,zsjohny/homebrew-versions,geggo98/homebrew-versions,lukasbestle/homebrew-versions,Felerius/homebrew-versions,mauricerkelly/homebrew-versions,wickedsp1d3r/homebrew-versions,cprecioso/homebrew-versions,bondezbond/homebrew-versions,adjohnson916/homebrew-versions,delphinus35/homebrew-versions,caskroom/homebrew-versions,mauricerkelly/homebrew-versions,404NetworkError/homebrew-versions,3van/homebrew-versions,victorpopkov/homebrew-versions,wickedsp1d3r/homebrew-versions,dictcp/homebrew-versions,pkq/homebrew-versions,FinalDes/homebrew-versions,stigkj/homebrew-caskroom-versions,nicday/homebrew-versions,hugoboos/homebrew-versions,zchee/homebrew-versions,pquentin/homebrew-versions,invl/homebrew-versions,onewheelskyward/homebrew-versions,mahori/homebrew-cask-versions,caskroom/homebrew-versions,1zaman/homebrew-versions,404NetworkError/homebrew-versions,githubutilities/homebrew-versions,RJHsiao/homebrew-versions,kstarsinic/homebrew-versions,yurikoles/homebrew-versions,cprecioso/homebrew-versions,elovelan/homebrew-versions,noamross/homebrew-versions,zerrot/homebrew-versions,rogeriopradoj/homebrew-versions,danielbayley/homebrew-versions,alebcay/homebrew-versions,digital-wonderland/homebrew-versions,bimmlerd/homebrew-versions,rkJun/homebrew-versions,mahori/homebrew-versions,bey2lah/homebrew-versions,lantrix/homebrew-versions,stigkj/homebrew-caskroom-versions,Ngrd/homebrew-versions,tomschlick/homebrew-versions,gcds/homebrew-versions,mAAdhaTTah/homebrew-versions,zorosteven/homebrew-versions,Ngrd/homebrew-versions,victorpopkov/homebrew-versions,n8henrie/homebrew-versions,hubwub/homebrew-versions,pkq/homebrew-versions,chadcatlett/caskroom-homebrew-versions,toonetown/homebrew-cask-versions,a-x-/homebrew-versions,visualphoenix/homebrew-versions,toonetown/homebrew-cask-versions,RJHsiao/homebrew-versions | ruby | ## Code Before:
class RubymineEap < Cask
url 'http://download.jetbrains.com/ruby/RubyMine-135.494.dmg'
homepage 'http://confluence.jetbrains.com/display/RUBYDEV/RubyMine+EAP'
version '135.494'
sha256 'b960fcdab00f6dced5a2a28f56b5d5a4ae15f1e6f34ef3c654250a26611c1e55'
link 'RubyMine EAP.app'
end
## Instruction:
Update RubyMine EAP to build 135.550
## Code After:
class RubymineEap < Cask
url 'http://download.jetbrains.com/ruby/RubyMine-135.550.dmg'
homepage 'http://confluence.jetbrains.com/display/RUBYDEV/RubyMine+EAP'
version '135.550'
sha256 '900859265a190291662c8b103a538754c9a4adf6ca1b4ad49bb64cae2fd14205'
link 'RubyMine EAP.app'
end
| class RubymineEap < Cask
- url 'http://download.jetbrains.com/ruby/RubyMine-135.494.dmg'
? ^^^
+ url 'http://download.jetbrains.com/ruby/RubyMine-135.550.dmg'
? ^^^
homepage 'http://confluence.jetbrains.com/display/RUBYDEV/RubyMine+EAP'
- version '135.494'
? ^^^
+ version '135.550'
? ^^^
- sha256 'b960fcdab00f6dced5a2a28f56b5d5a4ae15f1e6f34ef3c654250a26611c1e55'
+ sha256 '900859265a190291662c8b103a538754c9a4adf6ca1b4ad49bb64cae2fd14205'
link 'RubyMine EAP.app'
end | 6 | 0.857143 | 3 | 3 |
6fb337fc77ca85a1bb3ec24944849aa0ed1f31a7 | builder/gemfile_mergator.rb | builder/gemfile_mergator.rb | def merge_gem_file(master_gem_file, gemfiles_contents)
master = []
master << "# GENERATED GEMFILE. DON'T EDIT THIS FILE, YOUR CHANGES WILL BE LOST\n\n"
master_gem_file.each_line do |line|
master << line
end
gemfiles_contents.each do |content|
content << "\n"
content.each_line do |line|
gem_name = get_gem_name(line)
if gem_name != nil && !(is_gem_exist(master, gem_name))
master << line
end
if line[0, 7] == 'source '
master << line
end
end
end
master.join("")
end
def is_gem_exist(array, name)
array.each do |line|
if line.include? "#{name}"
return true
end
end
return false
end
def get_gem_name(txt)
#p "is_gem_line? of #{txt}"
return nil unless txt[0,4] == 'gem '
sp = txt.split('\'')
p sp
return nil unless sp.size > 2
#p "gives #{sp[1]}"
sp[1]
end | def merge_gem_file(master_gem_file, gemfiles_contents)
master = []
master << "# GENERATED GEMFILE. DON'T EDIT THIS FILE, YOUR CHANGES WILL BE LOST\n\n"
master_gem_file.each_line do |line|
master << line
end
gemfiles_contents.each do |content|
content << "\n"
content.each_line do |line|
gem_name = get_gem_name(line)
if gem_name != nil && !(is_gem_exist(master, gem_name))
master << line
end
if line[0, 7] == 'source ' || line[0, 3] == 'end'
master << line
end
end
end
master.join("")
end
def is_gem_exist(array, name)
array.each do |line|
if line.include? "#{name}"
return true
end
end
return false
end
def get_gem_name(txt)
#p "is_gem_line? of #{txt}"
return nil unless /^\s*gem/.match(txt)
sp = txt.split('\'')
p sp
return nil unless sp.size > 2
#p "gives #{sp[1]}"
sp[1]
end
| Allow source blocks in agent gemfiles | Allow source blocks in agent gemfiles
* make sure to keep any end lines
* allow whitespace in front of gem definitions | Ruby | mit | mobile-devices/ragent_bay,mobile-devices/ragent_bay,mobile-devices/ragent_bay,mobile-devices/ragent_bay | ruby | ## Code Before:
def merge_gem_file(master_gem_file, gemfiles_contents)
master = []
master << "# GENERATED GEMFILE. DON'T EDIT THIS FILE, YOUR CHANGES WILL BE LOST\n\n"
master_gem_file.each_line do |line|
master << line
end
gemfiles_contents.each do |content|
content << "\n"
content.each_line do |line|
gem_name = get_gem_name(line)
if gem_name != nil && !(is_gem_exist(master, gem_name))
master << line
end
if line[0, 7] == 'source '
master << line
end
end
end
master.join("")
end
def is_gem_exist(array, name)
array.each do |line|
if line.include? "#{name}"
return true
end
end
return false
end
def get_gem_name(txt)
#p "is_gem_line? of #{txt}"
return nil unless txt[0,4] == 'gem '
sp = txt.split('\'')
p sp
return nil unless sp.size > 2
#p "gives #{sp[1]}"
sp[1]
end
## Instruction:
Allow source blocks in agent gemfiles
* make sure to keep any end lines
* allow whitespace in front of gem definitions
## Code After:
def merge_gem_file(master_gem_file, gemfiles_contents)
master = []
master << "# GENERATED GEMFILE. DON'T EDIT THIS FILE, YOUR CHANGES WILL BE LOST\n\n"
master_gem_file.each_line do |line|
master << line
end
gemfiles_contents.each do |content|
content << "\n"
content.each_line do |line|
gem_name = get_gem_name(line)
if gem_name != nil && !(is_gem_exist(master, gem_name))
master << line
end
if line[0, 7] == 'source ' || line[0, 3] == 'end'
master << line
end
end
end
master.join("")
end
def is_gem_exist(array, name)
array.each do |line|
if line.include? "#{name}"
return true
end
end
return false
end
def get_gem_name(txt)
#p "is_gem_line? of #{txt}"
return nil unless /^\s*gem/.match(txt)
sp = txt.split('\'')
p sp
return nil unless sp.size > 2
#p "gives #{sp[1]}"
sp[1]
end
| def merge_gem_file(master_gem_file, gemfiles_contents)
master = []
master << "# GENERATED GEMFILE. DON'T EDIT THIS FILE, YOUR CHANGES WILL BE LOST\n\n"
master_gem_file.each_line do |line|
master << line
end
gemfiles_contents.each do |content|
content << "\n"
content.each_line do |line|
gem_name = get_gem_name(line)
if gem_name != nil && !(is_gem_exist(master, gem_name))
master << line
end
- if line[0, 7] == 'source '
+ if line[0, 7] == 'source ' || line[0, 3] == 'end'
master << line
end
end
end
master.join("")
end
def is_gem_exist(array, name)
array.each do |line|
if line.include? "#{name}"
return true
end
end
return false
end
def get_gem_name(txt)
#p "is_gem_line? of #{txt}"
- return nil unless txt[0,4] == 'gem '
+ return nil unless /^\s*gem/.match(txt)
sp = txt.split('\'')
p sp
return nil unless sp.size > 2
#p "gives #{sp[1]}"
sp[1]
end | 4 | 0.08 | 2 | 2 |
81a483f0089af213a15402c9f727fc42d834bc73 | README.md | README.md | Prueba tecnica ciudadenlinea
| Prueba tecnica ciudadenlinea
Para acceder al sitio ir a: http://formul.brinkster.net/ciudadenlinea/ | Define the URL of the site for testing | Define the URL of the site for testing | Markdown | mit | sergiohdez/ciudadenlinea,sergiohdez/ciudadenlinea,sergiohdez/ciudadenlinea | markdown | ## Code Before:
Prueba tecnica ciudadenlinea
## Instruction:
Define the URL of the site for testing
## Code After:
Prueba tecnica ciudadenlinea
Para acceder al sitio ir a: http://formul.brinkster.net/ciudadenlinea/ | Prueba tecnica ciudadenlinea
+
+ Para acceder al sitio ir a: http://formul.brinkster.net/ciudadenlinea/ | 2 | 2 | 2 | 0 |
14afa9a17f694648516b88f759c715c215b5fed3 | ds3-autogen-c/src/test/java/com/spectralogic/ds3autogen/c/Type_Test.java | ds3-autogen-c/src/test/java/com/spectralogic/ds3autogen/c/Type_Test.java | /*
package com.spectralogic.ds3autogen.c;
import com.spectralogic.ds3autogen.c.models.Element;
import org.junit.Test;
import java.text.ParseException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class Type_Test {
@Test
public void testElementTypeArrayToString() throws ParseException {
Element stringElement = new Element("arrayElement", "array", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
@Test
public void testElementTypeSetToString() throws ParseException {
Element stringElement = new Element("setElement", "java.util.Set", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
}
*/
| package com.spectralogic.ds3autogen.c;
import com.google.common.collect.ImmutableList;
import com.spectralogic.ds3autogen.api.models.Ds3Element;
import com.spectralogic.ds3autogen.c.models.Type;
import org.junit.Test;
import java.text.ParseException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class Type_Test {
@Test
public void testTypeIsPrimitive() throws ParseException {
Ds3Element testElement1 = new Ds3Element("intElement", "int", null, null);
Ds3Element testElement2 = new Ds3Element("boolElement", "boolean", null, null);
final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
builder.add(testElement1);
builder.add(testElement2);
Type testType = new Type("testType", null, builder.build());
assertThat(testType.isPrimitiveType(), is(true));
}
@Test
public void testTypeIsNotPrimitive() throws ParseException {
Ds3Element testElement1 = new Ds3Element("boolElement", "boolean", null, null);
Ds3Element testElement2 = new Ds3Element("complexElement", "com.spectralogic.s3.server.domain.UserApiBean", null, null);
final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
builder.add(testElement1);
builder.add(testElement2);
Type testType = new Type("testType", null, builder.build());
assertThat(testType.isPrimitiveType(), is(false));
}
/*
@Test
public void testElementTypeArrayToString() throws ParseException {
Element stringElement = new Element("arrayElement", "array", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
@Test
public void testElementTypeSetToString() throws ParseException {
Element stringElement = new Element("setElement", "java.util.Set", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
*/
}
| Add a few tests for ds3_autogen_c::Type | Add a few tests for ds3_autogen_c::Type
| Java | apache-2.0 | RachelTucker/ds3_autogen,DenverM80/ds3_autogen,RachelTucker/ds3_autogen,SpectraLogic/ds3_autogen,DenverM80/ds3_autogen,SpectraLogic/ds3_autogen,rpmoore/ds3_autogen | java | ## Code Before:
/*
package com.spectralogic.ds3autogen.c;
import com.spectralogic.ds3autogen.c.models.Element;
import org.junit.Test;
import java.text.ParseException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class Type_Test {
@Test
public void testElementTypeArrayToString() throws ParseException {
Element stringElement = new Element("arrayElement", "array", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
@Test
public void testElementTypeSetToString() throws ParseException {
Element stringElement = new Element("setElement", "java.util.Set", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
}
*/
## Instruction:
Add a few tests for ds3_autogen_c::Type
## Code After:
package com.spectralogic.ds3autogen.c;
import com.google.common.collect.ImmutableList;
import com.spectralogic.ds3autogen.api.models.Ds3Element;
import com.spectralogic.ds3autogen.c.models.Type;
import org.junit.Test;
import java.text.ParseException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class Type_Test {
@Test
public void testTypeIsPrimitive() throws ParseException {
Ds3Element testElement1 = new Ds3Element("intElement", "int", null, null);
Ds3Element testElement2 = new Ds3Element("boolElement", "boolean", null, null);
final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
builder.add(testElement1);
builder.add(testElement2);
Type testType = new Type("testType", null, builder.build());
assertThat(testType.isPrimitiveType(), is(true));
}
@Test
public void testTypeIsNotPrimitive() throws ParseException {
Ds3Element testElement1 = new Ds3Element("boolElement", "boolean", null, null);
Ds3Element testElement2 = new Ds3Element("complexElement", "com.spectralogic.s3.server.domain.UserApiBean", null, null);
final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
builder.add(testElement1);
builder.add(testElement2);
Type testType = new Type("testType", null, builder.build());
assertThat(testType.isPrimitiveType(), is(false));
}
/*
@Test
public void testElementTypeArrayToString() throws ParseException {
Element stringElement = new Element("arrayElement", "array", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
@Test
public void testElementTypeSetToString() throws ParseException {
Element stringElement = new Element("setElement", "java.util.Set", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
*/
}
| - /*
package com.spectralogic.ds3autogen.c;
+ import com.google.common.collect.ImmutableList;
- import com.spectralogic.ds3autogen.c.models.Element;
? ^
+ import com.spectralogic.ds3autogen.api.models.Ds3Element;
? ^^^ +++
+ import com.spectralogic.ds3autogen.c.models.Type;
import org.junit.Test;
import java.text.ParseException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class Type_Test {
+ @Test
+ public void testTypeIsPrimitive() throws ParseException {
+ Ds3Element testElement1 = new Ds3Element("intElement", "int", null, null);
+ Ds3Element testElement2 = new Ds3Element("boolElement", "boolean", null, null);
+ final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
+ builder.add(testElement1);
+ builder.add(testElement2);
+ Type testType = new Type("testType", null, builder.build());
+ assertThat(testType.isPrimitiveType(), is(true));
+ }
+ @Test
+ public void testTypeIsNotPrimitive() throws ParseException {
+ Ds3Element testElement1 = new Ds3Element("boolElement", "boolean", null, null);
+ Ds3Element testElement2 = new Ds3Element("complexElement", "com.spectralogic.s3.server.domain.UserApiBean", null, null);
+ final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
+ builder.add(testElement1);
+ builder.add(testElement2);
+ Type testType = new Type("testType", null, builder.build());
+ assertThat(testType.isPrimitiveType(), is(false));
+ }
+ /*
@Test
public void testElementTypeArrayToString() throws ParseException {
Element stringElement = new Element("arrayElement", "array", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
@Test
public void testElementTypeSetToString() throws ParseException {
Element stringElement = new Element("setElement", "java.util.Set", null, null);
assertThat(CHelper.elementTypeToString(stringElement), is(""));
}
+ */
}
- */ | 28 | 1.166667 | 25 | 3 |
e0e1bcfd77af5be0c2bc58a2147f8680a6c23e89 | modules/core/db/package.json | modules/core/db/package.json | {
"name": "decent-core-database",
"friendlyName": "Database",
"version": "1.0.0",
"description": "Database support for DecentCMS",
"author": "Bertrand Le Roy",
"license": "MIT",
"features": {
"couch-db-content-store": {
"name": "CouchDB Content Store",
"description": "A content store that uses a CouchDB database for storage."
}
},
"main": "./index",
"scripts": {
"test": "./test/index"
},
"devDependencies": {
"chai": "^2.3.0",
"grunt-mocha-test": "^0.12.7",
"mocha": "^2.2.4",
"proxyquire": "^1.4.0"
}
}
| {
"name": "decent-core-database",
"friendlyName": "Database",
"version": "1.0.0",
"description": "Database support for DecentCMS",
"author": "Bertrand Le Roy",
"license": "MIT",
"features": {
"couch-db": {
"name": "CouchDB",
"description": "Base service to access CouchDB databases."
},
"couch-db-content-store": {
"name": "CouchDB Content Store",
"description": "A content store that uses a CouchDB database for storage."
},
"couch-db-index": {
"name": "CouchDB Index",
"description": "An index service that stores index data in CouchDB. It can index content not stored in CouchDB."
}
},
"main": "./index",
"scripts": {
"test": "./test/index"
},
"devDependencies": {
"chai": "^2.3.0",
"grunt-mocha-test": "^0.12.7",
"mocha": "^2.2.4",
"proxyquire": "^1.4.0"
}
}
| Add new CouchDB services to manifest. | Add new CouchDB services to manifest.
| JSON | mit | DecentCMS/DecentCMS | json | ## Code Before:
{
"name": "decent-core-database",
"friendlyName": "Database",
"version": "1.0.0",
"description": "Database support for DecentCMS",
"author": "Bertrand Le Roy",
"license": "MIT",
"features": {
"couch-db-content-store": {
"name": "CouchDB Content Store",
"description": "A content store that uses a CouchDB database for storage."
}
},
"main": "./index",
"scripts": {
"test": "./test/index"
},
"devDependencies": {
"chai": "^2.3.0",
"grunt-mocha-test": "^0.12.7",
"mocha": "^2.2.4",
"proxyquire": "^1.4.0"
}
}
## Instruction:
Add new CouchDB services to manifest.
## Code After:
{
"name": "decent-core-database",
"friendlyName": "Database",
"version": "1.0.0",
"description": "Database support for DecentCMS",
"author": "Bertrand Le Roy",
"license": "MIT",
"features": {
"couch-db": {
"name": "CouchDB",
"description": "Base service to access CouchDB databases."
},
"couch-db-content-store": {
"name": "CouchDB Content Store",
"description": "A content store that uses a CouchDB database for storage."
},
"couch-db-index": {
"name": "CouchDB Index",
"description": "An index service that stores index data in CouchDB. It can index content not stored in CouchDB."
}
},
"main": "./index",
"scripts": {
"test": "./test/index"
},
"devDependencies": {
"chai": "^2.3.0",
"grunt-mocha-test": "^0.12.7",
"mocha": "^2.2.4",
"proxyquire": "^1.4.0"
}
}
| {
"name": "decent-core-database",
"friendlyName": "Database",
"version": "1.0.0",
"description": "Database support for DecentCMS",
"author": "Bertrand Le Roy",
"license": "MIT",
"features": {
+ "couch-db": {
+ "name": "CouchDB",
+ "description": "Base service to access CouchDB databases."
+ },
"couch-db-content-store": {
"name": "CouchDB Content Store",
"description": "A content store that uses a CouchDB database for storage."
+ },
+ "couch-db-index": {
+ "name": "CouchDB Index",
+ "description": "An index service that stores index data in CouchDB. It can index content not stored in CouchDB."
}
},
"main": "./index",
"scripts": {
"test": "./test/index"
},
"devDependencies": {
"chai": "^2.3.0",
"grunt-mocha-test": "^0.12.7",
"mocha": "^2.2.4",
"proxyquire": "^1.4.0"
}
} | 8 | 0.333333 | 8 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.