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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4ab099864a19bc91b50122853b6dc1808466d443 | gulpfile.js | gulpfile.js | var bower = require('bower'),
eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip');
// Installs bower dependencies
gulp.task('bower', function(callback) {
bower.commands.install([], {}, {})
.on('error', function(error) {
callback(error);
})
.on('end', function() {
callback();
});
});
// Builds and packs plugins sources
gulp.task('default', ['bower'], function() {
var version = require('./package.json').version;
return eventStream.merge(
getSources()
.pipe(zip('emoji-plugin-' + version + '.zip')),
getSources()
.pipe(tar('emoji-plugin-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
});
/**
* Returns files stream with the plugin sources.
*
* @returns {Object} Stream with VinylFS files.
*/
var getSources = function() {
return gulp.src([
'Plugin.php',
'README.md',
'LICENSE',
'js/*',
'css/*',
'components/emoji-images/emoji-images.js',
'components/emoji-images/readme.md',
'components/emoji-images/pngs/*'
],
{base: './'}
);
}
| var bower = require('bower'),
eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip');
// Installs bower dependencies
gulp.task('bower', function(callback) {
bower.commands.install([], {}, {})
.on('error', function(error) {
callback(error);
})
.on('end', function() {
callback();
});
});
gulp.task('prepare-release', ['bower'], function() {
var version = require('./package.json').version;
return eventStream.merge(
getSources()
.pipe(zip('emoji-plugin-' + version + '.zip')),
getSources()
.pipe(tar('emoji-plugin-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
});
// Builds and packs plugins sources
gulp.task('default', ['prepare-release'], function() {
// The "default" task is just an alias for "prepare-release" task.
});
/**
* Returns files stream with the plugin sources.
*
* @returns {Object} Stream with VinylFS files.
*/
var getSources = function() {
return gulp.src([
'Plugin.php',
'README.md',
'LICENSE',
'js/*',
'css/*',
'components/emoji-images/emoji-images.js',
'components/emoji-images/readme.md',
'components/emoji-images/pngs/*'
],
{base: './'}
);
}
| Add prepare-release task for consistency | Add prepare-release task for consistency
| JavaScript | apache-2.0 | Mibew/emoji-plugin,Mibew/emoji-plugin | javascript | ## Code Before:
var bower = require('bower'),
eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip');
// Installs bower dependencies
gulp.task('bower', function(callback) {
bower.commands.install([], {}, {})
.on('error', function(error) {
callback(error);
})
.on('end', function() {
callback();
});
});
// Builds and packs plugins sources
gulp.task('default', ['bower'], function() {
var version = require('./package.json').version;
return eventStream.merge(
getSources()
.pipe(zip('emoji-plugin-' + version + '.zip')),
getSources()
.pipe(tar('emoji-plugin-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
});
/**
* Returns files stream with the plugin sources.
*
* @returns {Object} Stream with VinylFS files.
*/
var getSources = function() {
return gulp.src([
'Plugin.php',
'README.md',
'LICENSE',
'js/*',
'css/*',
'components/emoji-images/emoji-images.js',
'components/emoji-images/readme.md',
'components/emoji-images/pngs/*'
],
{base: './'}
);
}
## Instruction:
Add prepare-release task for consistency
## Code After:
var bower = require('bower'),
eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip');
// Installs bower dependencies
gulp.task('bower', function(callback) {
bower.commands.install([], {}, {})
.on('error', function(error) {
callback(error);
})
.on('end', function() {
callback();
});
});
gulp.task('prepare-release', ['bower'], function() {
var version = require('./package.json').version;
return eventStream.merge(
getSources()
.pipe(zip('emoji-plugin-' + version + '.zip')),
getSources()
.pipe(tar('emoji-plugin-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
});
// Builds and packs plugins sources
gulp.task('default', ['prepare-release'], function() {
// The "default" task is just an alias for "prepare-release" task.
});
/**
* Returns files stream with the plugin sources.
*
* @returns {Object} Stream with VinylFS files.
*/
var getSources = function() {
return gulp.src([
'Plugin.php',
'README.md',
'LICENSE',
'js/*',
'css/*',
'components/emoji-images/emoji-images.js',
'components/emoji-images/readme.md',
'components/emoji-images/pngs/*'
],
{base: './'}
);
}
| var bower = require('bower'),
eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip');
// Installs bower dependencies
gulp.task('bower', function(callback) {
bower.commands.install([], {}, {})
.on('error', function(error) {
callback(error);
})
.on('end', function() {
callback();
});
});
- // Builds and packs plugins sources
- gulp.task('default', ['bower'], function() {
? ^ ^ ^ ^
+ gulp.task('prepare-release', ['bower'], function() {
? ^^ ^ ^^^^^ ^^^^
var version = require('./package.json').version;
return eventStream.merge(
getSources()
.pipe(zip('emoji-plugin-' + version + '.zip')),
getSources()
.pipe(tar('emoji-plugin-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
+ });
+
+ // Builds and packs plugins sources
+ gulp.task('default', ['prepare-release'], function() {
+ // The "default" task is just an alias for "prepare-release" task.
});
/**
* Returns files stream with the plugin sources.
*
* @returns {Object} Stream with VinylFS files.
*/
var getSources = function() {
return gulp.src([
'Plugin.php',
'README.md',
'LICENSE',
'js/*',
'css/*',
'components/emoji-images/emoji-images.js',
'components/emoji-images/readme.md',
'components/emoji-images/pngs/*'
],
{base: './'}
);
} | 8 | 0.150943 | 6 | 2 |
32e3a52e8451669679035180ae9e4e4ffceef457 | lib/storageservice.dart | lib/storageservice.dart | library storageservice;
import 'dart:html';
import 'dart:convert';
final String STORAGE_KEY = 'ddays';
List tasklist = [];
// add an item to a given List, then save
// this list in localStorage with the key 'STORAGE_KEY'.
void saveToStorage(item) {
tasklist.add(item);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// restore a to localstorage, under key 'STORAGE_KEY',
// saved List.
List loadFromStorage() {
return JSON.decode(window.localStorage[STORAGE_KEY]);
}
// delete a item from local Storage object with key 'STORAGE_KEY'.
void deleteItemInStorage(item) {
var storedlist = loadFromStorage().where((i) => i.timestamp == item.timestamp);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// delete localStorage key.
void deleteStorage() {
window.localStorage.clear();
}
| library storageservice;
import 'dart:html';
import 'dart:convert';
final String STORAGE_KEY = 'ddays';
List tasklist = [];
// add an item to a given List, then save
// this list in localStorage with the key 'STORAGE_KEY'.
void saveToStorage(item) {
tasklist.add(item);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// restore a to localstorage, under key 'STORAGE_KEY',
// saved List.
List loadFromStorage() {
tasklist = JSON.decode(window.localStorage[STORAGE_KEY]);
return tasklist;
}
// delete a item from local Storage object with key 'STORAGE_KEY'.
void deleteItemInStorage(item) {
var storedlist = loadFromStorage().where((i) => i.timestamp == item.timestamp);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// delete localStorage key.
void deleteStorage() {
window.localStorage.clear();
}
| Use tasklist global in loadFromStorage function. | Use tasklist global in loadFromStorage function.
| Dart | bsd-3-clause | mswift42/ddays,mswift42/ddays | dart | ## Code Before:
library storageservice;
import 'dart:html';
import 'dart:convert';
final String STORAGE_KEY = 'ddays';
List tasklist = [];
// add an item to a given List, then save
// this list in localStorage with the key 'STORAGE_KEY'.
void saveToStorage(item) {
tasklist.add(item);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// restore a to localstorage, under key 'STORAGE_KEY',
// saved List.
List loadFromStorage() {
return JSON.decode(window.localStorage[STORAGE_KEY]);
}
// delete a item from local Storage object with key 'STORAGE_KEY'.
void deleteItemInStorage(item) {
var storedlist = loadFromStorage().where((i) => i.timestamp == item.timestamp);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// delete localStorage key.
void deleteStorage() {
window.localStorage.clear();
}
## Instruction:
Use tasklist global in loadFromStorage function.
## Code After:
library storageservice;
import 'dart:html';
import 'dart:convert';
final String STORAGE_KEY = 'ddays';
List tasklist = [];
// add an item to a given List, then save
// this list in localStorage with the key 'STORAGE_KEY'.
void saveToStorage(item) {
tasklist.add(item);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// restore a to localstorage, under key 'STORAGE_KEY',
// saved List.
List loadFromStorage() {
tasklist = JSON.decode(window.localStorage[STORAGE_KEY]);
return tasklist;
}
// delete a item from local Storage object with key 'STORAGE_KEY'.
void deleteItemInStorage(item) {
var storedlist = loadFromStorage().where((i) => i.timestamp == item.timestamp);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// delete localStorage key.
void deleteStorage() {
window.localStorage.clear();
}
| library storageservice;
import 'dart:html';
import 'dart:convert';
final String STORAGE_KEY = 'ddays';
List tasklist = [];
// add an item to a given List, then save
// this list in localStorage with the key 'STORAGE_KEY'.
void saveToStorage(item) {
tasklist.add(item);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// restore a to localstorage, under key 'STORAGE_KEY',
// saved List.
List loadFromStorage() {
- return JSON.decode(window.localStorage[STORAGE_KEY]);
? -- ^^^
+ tasklist = JSON.decode(window.localStorage[STORAGE_KEY]);
? ^^^^^^^^^
+ return tasklist;
}
// delete a item from local Storage object with key 'STORAGE_KEY'.
void deleteItemInStorage(item) {
var storedlist = loadFromStorage().where((i) => i.timestamp == item.timestamp);
window.localStorage[STORAGE_KEY] = JSON.encode(storedlist);
}
// delete localStorage key.
void deleteStorage() {
window.localStorage.clear();
} | 3 | 0.09375 | 2 | 1 |
0a652ec1192b7fd9f56423ba4a42d04ad6464ca5 | web/templates/layout/_fonts_tracking_code.html.eex | web/templates/layout/_fonts_tracking_code.html.eex | <script>eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 7=g.b;4 2=3.p(\'r\');2.9=\'a/5\';2.c=\'d\';2.e=(\'6:\'==3.u.h?\'6:\':\'i:\')+\'//j.k.l/t/1.5?m=n&o=\'+7;(3.8(\'q\')[0]||3.8(\'s\')[0]).f(2);',31,31,'||mtiTracking|document|var|css|https|projectId|getElementsByTagName|type|text|MTIProjectId|rel|stylesheet|href|appendChild|window|protocol|http|fast|fonts|net|apiType|css|projectid|createElement|head|link|body||location'.split('|'),0,{}))</script>
| <script>
var MTIProjectId="38d55e48-4075-4e45-9b94-1601ba6215c1";
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 7=g.b;4 2=3.p(\'r\');2.9=\'a/5\';2.c=\'d\';2.e=(\'6:\'==3.u.h?\'6:\':\'i:\')+\'//j.k.l/t/1.5?m=n&o=\'+7;(3.8(\'q\')[0]||3.8(\'s\')[0]).f(2);',31,31,'||mtiTracking|document|var|css|https|projectId|getElementsByTagName|type|text|MTIProjectId|rel|stylesheet|href|appendChild|window|protocol|http|fast|fonts|net|apiType|css|projectid|createElement|head|link|body||location'.split('|'),0,{}))
</script>
| Add missing variable to tracking code | Add missing variable to tracking code
| HTML+EEX | mit | cazrin/stranger,cazrin/stranger | html+eex | ## Code Before:
<script>eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 7=g.b;4 2=3.p(\'r\');2.9=\'a/5\';2.c=\'d\';2.e=(\'6:\'==3.u.h?\'6:\':\'i:\')+\'//j.k.l/t/1.5?m=n&o=\'+7;(3.8(\'q\')[0]||3.8(\'s\')[0]).f(2);',31,31,'||mtiTracking|document|var|css|https|projectId|getElementsByTagName|type|text|MTIProjectId|rel|stylesheet|href|appendChild|window|protocol|http|fast|fonts|net|apiType|css|projectid|createElement|head|link|body||location'.split('|'),0,{}))</script>
## Instruction:
Add missing variable to tracking code
## Code After:
<script>
var MTIProjectId="38d55e48-4075-4e45-9b94-1601ba6215c1";
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 7=g.b;4 2=3.p(\'r\');2.9=\'a/5\';2.c=\'d\';2.e=(\'6:\'==3.u.h?\'6:\':\'i:\')+\'//j.k.l/t/1.5?m=n&o=\'+7;(3.8(\'q\')[0]||3.8(\'s\')[0]).f(2);',31,31,'||mtiTracking|document|var|css|https|projectId|getElementsByTagName|type|text|MTIProjectId|rel|stylesheet|href|appendChild|window|protocol|http|fast|fonts|net|apiType|css|projectid|createElement|head|link|body||location'.split('|'),0,{}))
</script>
| + <script>
+ var MTIProjectId="38d55e48-4075-4e45-9b94-1601ba6215c1";
- <script>eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 7=g.b;4 2=3.p(\'r\');2.9=\'a/5\';2.c=\'d\';2.e=(\'6:\'==3.u.h?\'6:\':\'i:\')+\'//j.k.l/t/1.5?m=n&o=\'+7;(3.8(\'q\')[0]||3.8(\'s\')[0]).f(2);',31,31,'||mtiTracking|document|var|css|https|projectId|getElementsByTagName|type|text|MTIProjectId|rel|stylesheet|href|appendChild|window|protocol|http|fast|fonts|net|apiType|css|projectid|createElement|head|link|body||location'.split('|'),0,{}))</script>
? -------- ---------
+ eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 7=g.b;4 2=3.p(\'r\');2.9=\'a/5\';2.c=\'d\';2.e=(\'6:\'==3.u.h?\'6:\':\'i:\')+\'//j.k.l/t/1.5?m=n&o=\'+7;(3.8(\'q\')[0]||3.8(\'s\')[0]).f(2);',31,31,'||mtiTracking|document|var|css|https|projectId|getElementsByTagName|type|text|MTIProjectId|rel|stylesheet|href|appendChild|window|protocol|http|fast|fonts|net|apiType|css|projectid|createElement|head|link|body||location'.split('|'),0,{}))
+ </script> | 5 | 5 | 4 | 1 |
fb768d3f8b8f7da09de6b0be26a10329effca3bd | avro4s-core/src/test/scala/com/sksamuel/avro4s/AvroNameTest.scala | avro4s-core/src/test/scala/com/sksamuel/avro4s/AvroNameTest.scala | package com.sksamuel.avro4s
import org.scalatest.{Matchers, WordSpec}
class AvroNameTest extends WordSpec with Matchers {
case class Foo(@AvroName("wibble") wobble: String, wubble: String)
"ToSchema" should {
"generate field names using @AvroName" in {
val schema = SchemaFor[Foo]()
val expected = new org.apache.avro.Schema.Parser().parse(getClass.getResourceAsStream("/avroname.avsc"))
schema.toString(true) shouldBe expected.toString(true)
}
}
"ToRecord" should {
"correctly be able to produce a record" in {
val toRecord = ToRecord[Foo]
toRecord(Foo("woop", "scoop"))
}
}
}
| package com.sksamuel.avro4s
import org.scalatest.{Matchers, WordSpec}
class AvroNameTest extends WordSpec with Matchers {
case class Foo(@AvroName("wibble") wobble: String, wubble: String)
"ToSchema" should {
"generate field names using @AvroName" in {
val schema = SchemaFor[Foo]()
val expected = new org.apache.avro.Schema.Parser().parse(getClass.getResourceAsStream("/avroname.avsc"))
schema.toString(true) shouldBe expected.toString(true)
}
}
"ToRecord" should {
"correctly be able to produce a record" in {
val toRecord = ToRecord[Foo]
toRecord(Foo("woop", "scoop"))
}
}
"FromRecord" should {
"correctly be able to produce a record" in {
val fromRecord = FromRecord[Foo]
val record = ToRecord[Foo](Foo("woop", "scoop"))
fromRecord(record)
}
}
}
| Add test for `FromRecord` with `@AvroName` annotation | Add test for `FromRecord` with `@AvroName` annotation
| Scala | apache-2.0 | sksamuel/avro4s,51zero/avro4s,sksamuel/avro4s | scala | ## Code Before:
package com.sksamuel.avro4s
import org.scalatest.{Matchers, WordSpec}
class AvroNameTest extends WordSpec with Matchers {
case class Foo(@AvroName("wibble") wobble: String, wubble: String)
"ToSchema" should {
"generate field names using @AvroName" in {
val schema = SchemaFor[Foo]()
val expected = new org.apache.avro.Schema.Parser().parse(getClass.getResourceAsStream("/avroname.avsc"))
schema.toString(true) shouldBe expected.toString(true)
}
}
"ToRecord" should {
"correctly be able to produce a record" in {
val toRecord = ToRecord[Foo]
toRecord(Foo("woop", "scoop"))
}
}
}
## Instruction:
Add test for `FromRecord` with `@AvroName` annotation
## Code After:
package com.sksamuel.avro4s
import org.scalatest.{Matchers, WordSpec}
class AvroNameTest extends WordSpec with Matchers {
case class Foo(@AvroName("wibble") wobble: String, wubble: String)
"ToSchema" should {
"generate field names using @AvroName" in {
val schema = SchemaFor[Foo]()
val expected = new org.apache.avro.Schema.Parser().parse(getClass.getResourceAsStream("/avroname.avsc"))
schema.toString(true) shouldBe expected.toString(true)
}
}
"ToRecord" should {
"correctly be able to produce a record" in {
val toRecord = ToRecord[Foo]
toRecord(Foo("woop", "scoop"))
}
}
"FromRecord" should {
"correctly be able to produce a record" in {
val fromRecord = FromRecord[Foo]
val record = ToRecord[Foo](Foo("woop", "scoop"))
fromRecord(record)
}
}
}
| package com.sksamuel.avro4s
import org.scalatest.{Matchers, WordSpec}
class AvroNameTest extends WordSpec with Matchers {
case class Foo(@AvroName("wibble") wobble: String, wubble: String)
"ToSchema" should {
"generate field names using @AvroName" in {
val schema = SchemaFor[Foo]()
val expected = new org.apache.avro.Schema.Parser().parse(getClass.getResourceAsStream("/avroname.avsc"))
schema.toString(true) shouldBe expected.toString(true)
}
}
"ToRecord" should {
"correctly be able to produce a record" in {
val toRecord = ToRecord[Foo]
toRecord(Foo("woop", "scoop"))
}
}
+
+ "FromRecord" should {
+ "correctly be able to produce a record" in {
+ val fromRecord = FromRecord[Foo]
+ val record = ToRecord[Foo](Foo("woop", "scoop"))
+
+ fromRecord(record)
+ }
+ }
} | 9 | 0.391304 | 9 | 0 |
78238fa6de93fa28fee9b6e003121bafcc1dc407 | batsignal.css | batsignal.css | body {
overflow: hidden;
}
.message {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 170px;
font-weight: bold;
text-align: center;
font-family: georgia;
padding-top: 40px;
}
.message.unread {
background-color: red;
color: white
}
.message.read {
background-color: green;
color: #42AC42;
}
.input-container {
background-color: white;
position: absolute;
z-index: 1;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
}
#text {
position: absolute;
left: 0;
font-size: 34px;
width: 100%;
}
.input-container button {
font-size: 34px;
position: absolute;
right: 0;
} | body {
overflow: hidden;
}
.message {
cursor: pointer;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 170px;
font-weight: bold;
text-align: center;
font-family: georgia;
padding-top: 40px;
}
.message.unread {
background-color: red;
color: white
}
.message.read {
background-color: green;
color: #42AC42;
}
.input-container {
background-color: white;
position: absolute;
z-index: 1;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
}
#text {
position: absolute;
left: 0;
font-size: 34px;
width: 100%;
}
.input-container button {
font-size: 34px;
position: absolute;
right: 0;
} | Allow messages to be marked as read on mobile | Allow messages to be marked as read on mobile
| CSS | mit | markdalgleish/batsignal | css | ## Code Before:
body {
overflow: hidden;
}
.message {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 170px;
font-weight: bold;
text-align: center;
font-family: georgia;
padding-top: 40px;
}
.message.unread {
background-color: red;
color: white
}
.message.read {
background-color: green;
color: #42AC42;
}
.input-container {
background-color: white;
position: absolute;
z-index: 1;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
}
#text {
position: absolute;
left: 0;
font-size: 34px;
width: 100%;
}
.input-container button {
font-size: 34px;
position: absolute;
right: 0;
}
## Instruction:
Allow messages to be marked as read on mobile
## Code After:
body {
overflow: hidden;
}
.message {
cursor: pointer;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 170px;
font-weight: bold;
text-align: center;
font-family: georgia;
padding-top: 40px;
}
.message.unread {
background-color: red;
color: white
}
.message.read {
background-color: green;
color: #42AC42;
}
.input-container {
background-color: white;
position: absolute;
z-index: 1;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
}
#text {
position: absolute;
left: 0;
font-size: 34px;
width: 100%;
}
.input-container button {
font-size: 34px;
position: absolute;
right: 0;
} | body {
overflow: hidden;
}
.message {
+ cursor: pointer;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 170px;
font-weight: bold;
text-align: center;
font-family: georgia;
padding-top: 40px;
}
.message.unread {
background-color: red;
color: white
}
.message.read {
background-color: green;
color: #42AC42;
}
.input-container {
background-color: white;
position: absolute;
z-index: 1;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
}
#text {
position: absolute;
left: 0;
font-size: 34px;
width: 100%;
}
.input-container button {
font-size: 34px;
position: absolute;
right: 0;
} | 1 | 0.022727 | 1 | 0 |
0f15015834ead9904039cefd4ce51b77184d8291 | scripts/hot-topics.coffee | scripts/hot-topics.coffee |
module.exports = (robot) ->
robot.brain.data.hot_topics or= {}
robot.respond /hot topic (.*) = (.*)/i, (msg) ->
robot.brain.data.hot_topics[msg.match[1].toLowerCase()] = msg.match[2]
msg.send "OK I'll remember that and let people know"
robot.respond /forget hot topic (.*)/i, (msg) ->
if robot.brain.data.hot_topics[msg.match[1].toLowerCase()]?
delete robot.brain.data.hot_topics[msg.match[1].toLowerCase()]
msg.send "OK forgot it."
else
msg.send "Didn't know anything about that anyway."
robot.respond /hot topics/i, (msg) ->
robot.brain.data.hot_topics or= {}
memories = for phrase, memory of robot.brain.data.hot_topics
"#{phrase} -> #{memory}"
msg.send memories.join("\n")
robot.hear /(.+)/i, (msg) ->
text = msg.message.text
unless text.match 'hot topic'
memories = for phrase, memory of robot.brain.data.hot_topics when text.toLowerCase().match(phrase)
memory
msg.send memories.join("\n")
|
module.exports = (robot) ->
robot.brain.data.hot_topics or= {}
robot.respond /hot topic (.*) = (.*)/i, (msg) ->
robot.brain.data.hot_topics[msg.match[1].toLowerCase()] = msg.match[2]
msg.send "OK, I'll remember that and let people know."
robot.respond /forget hot topic (.*)/i, (msg) ->
if robot.brain.data.hot_topics[msg.match[1].toLowerCase()]?
delete robot.brain.data.hot_topics[msg.match[1].toLowerCase()]
msg.send "OK, forgot it."
else
msg.send "Didn't know anything about that anyway."
robot.respond /hot topics/i, (msg) ->
robot.brain.data.hot_topics or= {}
memories = for phrase, memory of robot.brain.data.hot_topics
"#{phrase} -> #{memory}"
msg.send memories.join("\n")
robot.hear /(.+)/i, (msg) ->
text = msg.message.text
check = (text, phrase) ->
r = phrase.match /^\/(.*)\/$/
if r
phrase = RegExp(r[1], 'i')
!!text.toLowerCase().match(phrase)
unless text.match 'hot topic'
memories = for phrase, memory of robot.brain.data.hot_topics when check(text, phrase)
memory
msg.send memories.join("\n")
| Allow regexp in hot topics | Allow regexp in hot topics | CoffeeScript | mit | RiotGamesMinions/lefay,RiotGamesMinions/lefay | coffeescript | ## Code Before:
module.exports = (robot) ->
robot.brain.data.hot_topics or= {}
robot.respond /hot topic (.*) = (.*)/i, (msg) ->
robot.brain.data.hot_topics[msg.match[1].toLowerCase()] = msg.match[2]
msg.send "OK I'll remember that and let people know"
robot.respond /forget hot topic (.*)/i, (msg) ->
if robot.brain.data.hot_topics[msg.match[1].toLowerCase()]?
delete robot.brain.data.hot_topics[msg.match[1].toLowerCase()]
msg.send "OK forgot it."
else
msg.send "Didn't know anything about that anyway."
robot.respond /hot topics/i, (msg) ->
robot.brain.data.hot_topics or= {}
memories = for phrase, memory of robot.brain.data.hot_topics
"#{phrase} -> #{memory}"
msg.send memories.join("\n")
robot.hear /(.+)/i, (msg) ->
text = msg.message.text
unless text.match 'hot topic'
memories = for phrase, memory of robot.brain.data.hot_topics when text.toLowerCase().match(phrase)
memory
msg.send memories.join("\n")
## Instruction:
Allow regexp in hot topics
## Code After:
module.exports = (robot) ->
robot.brain.data.hot_topics or= {}
robot.respond /hot topic (.*) = (.*)/i, (msg) ->
robot.brain.data.hot_topics[msg.match[1].toLowerCase()] = msg.match[2]
msg.send "OK, I'll remember that and let people know."
robot.respond /forget hot topic (.*)/i, (msg) ->
if robot.brain.data.hot_topics[msg.match[1].toLowerCase()]?
delete robot.brain.data.hot_topics[msg.match[1].toLowerCase()]
msg.send "OK, forgot it."
else
msg.send "Didn't know anything about that anyway."
robot.respond /hot topics/i, (msg) ->
robot.brain.data.hot_topics or= {}
memories = for phrase, memory of robot.brain.data.hot_topics
"#{phrase} -> #{memory}"
msg.send memories.join("\n")
robot.hear /(.+)/i, (msg) ->
text = msg.message.text
check = (text, phrase) ->
r = phrase.match /^\/(.*)\/$/
if r
phrase = RegExp(r[1], 'i')
!!text.toLowerCase().match(phrase)
unless text.match 'hot topic'
memories = for phrase, memory of robot.brain.data.hot_topics when check(text, phrase)
memory
msg.send memories.join("\n")
|
module.exports = (robot) ->
robot.brain.data.hot_topics or= {}
robot.respond /hot topic (.*) = (.*)/i, (msg) ->
robot.brain.data.hot_topics[msg.match[1].toLowerCase()] = msg.match[2]
- msg.send "OK I'll remember that and let people know"
+ msg.send "OK, I'll remember that and let people know."
? + +
robot.respond /forget hot topic (.*)/i, (msg) ->
if robot.brain.data.hot_topics[msg.match[1].toLowerCase()]?
delete robot.brain.data.hot_topics[msg.match[1].toLowerCase()]
- msg.send "OK forgot it."
+ msg.send "OK, forgot it."
? +
else
msg.send "Didn't know anything about that anyway."
robot.respond /hot topics/i, (msg) ->
robot.brain.data.hot_topics or= {}
memories = for phrase, memory of robot.brain.data.hot_topics
"#{phrase} -> #{memory}"
msg.send memories.join("\n")
robot.hear /(.+)/i, (msg) ->
text = msg.message.text
+ check = (text, phrase) ->
+ r = phrase.match /^\/(.*)\/$/
+ if r
+ phrase = RegExp(r[1], 'i')
+ !!text.toLowerCase().match(phrase)
+
unless text.match 'hot topic'
- memories = for phrase, memory of robot.brain.data.hot_topics when text.toLowerCase().match(phrase)
? ^^^^^^^^^^^^^^^^^^^^^
+ memories = for phrase, memory of robot.brain.data.hot_topics when check(text, phrase)
? ++++++ ^^
memory
msg.send memories.join("\n") | 12 | 0.444444 | 9 | 3 |
e70d0d9f9ae134ec6532e6ede6eef9fbb12c97f5 | dependencies.txt | dependencies.txt | aptitude
vim
vim-gnome
meld
terminator
pgadmin3
audacity
blender
git
build-essential
default-jdk
maven
python
python-setuptools
python-pip
nodejs
npm
exuberant-ctags
ncurses-term
cmake
python-dev
python3-dev
curl
postgresql
postgis
lib32z1
lib32ncurses5
lib32stdc++6
| aptitude
gnome-tweak-tool
dconf-editor
gnome-shell-extensions
chrome-gnome-shell
vim
vim-gnome
meld
terminator
pgadmin3
audacity
blender
git
build-essential
default-jdk
maven
python
python-setuptools
python-pip
nodejs
npm
exuberant-ctags
ncurses-term
cmake
python-dev
python3-dev
curl
postgresql
postgis
lib32z1
lib32ncurses5
lib32stdc++6
| Add ferramentas do gnome para extensoes | Add ferramentas do gnome para extensoes
| Text | apache-2.0 | starlone/star.ubuntu-setup | text | ## Code Before:
aptitude
vim
vim-gnome
meld
terminator
pgadmin3
audacity
blender
git
build-essential
default-jdk
maven
python
python-setuptools
python-pip
nodejs
npm
exuberant-ctags
ncurses-term
cmake
python-dev
python3-dev
curl
postgresql
postgis
lib32z1
lib32ncurses5
lib32stdc++6
## Instruction:
Add ferramentas do gnome para extensoes
## Code After:
aptitude
gnome-tweak-tool
dconf-editor
gnome-shell-extensions
chrome-gnome-shell
vim
vim-gnome
meld
terminator
pgadmin3
audacity
blender
git
build-essential
default-jdk
maven
python
python-setuptools
python-pip
nodejs
npm
exuberant-ctags
ncurses-term
cmake
python-dev
python3-dev
curl
postgresql
postgis
lib32z1
lib32ncurses5
lib32stdc++6
| aptitude
+
+ gnome-tweak-tool
+ dconf-editor
+ gnome-shell-extensions
+ chrome-gnome-shell
vim
vim-gnome
meld
terminator
pgadmin3
audacity
blender
git
build-essential
default-jdk
maven
python
python-setuptools
python-pip
nodejs
npm
exuberant-ctags
ncurses-term
cmake
python-dev
python3-dev
curl
postgresql
postgis
lib32z1
lib32ncurses5
lib32stdc++6 | 5 | 0.131579 | 5 | 0 |
db7553e4f0ff5a1b01b46c1a1c75f2b254d4ef86 | demo/index.js | demo/index.js | "use strict";
if (process.argv.includes("browser") === true) {
require("./browser");
} else if (process.argv.includes("console") === true) {
require("./console");
} else {
console.error("Usage: npm run-script demo [type]\n\n console: console-based demo\n browser: browser-based demo\n");
}
| "use strict";
if (process.argv.indexOf("browser") >= 0) {
require("./browser");
} else if (process.argv.indexOf("console") >= 0) {
require("./console");
} else {
console.error("Usage: npm run-script demo [type]\n\n console: console-based demo\n browser: browser-based demo\n");
}
| Make demo work in Node 4 | Make demo work in Node 4
| JavaScript | mit | digitaldesignlabs/talisman,digitaldesignlabs/talisman | javascript | ## Code Before:
"use strict";
if (process.argv.includes("browser") === true) {
require("./browser");
} else if (process.argv.includes("console") === true) {
require("./console");
} else {
console.error("Usage: npm run-script demo [type]\n\n console: console-based demo\n browser: browser-based demo\n");
}
## Instruction:
Make demo work in Node 4
## Code After:
"use strict";
if (process.argv.indexOf("browser") >= 0) {
require("./browser");
} else if (process.argv.indexOf("console") >= 0) {
require("./console");
} else {
console.error("Usage: npm run-script demo [type]\n\n console: console-based demo\n browser: browser-based demo\n");
}
| "use strict";
- if (process.argv.includes("browser") === true) {
? --- ^ ^^ ^^^^
+ if (process.argv.indexOf("browser") >= 0) {
? ^^^ ^ ^
require("./browser");
- } else if (process.argv.includes("console") === true) {
? --- ^ ^^ ^^^^
+ } else if (process.argv.indexOf("console") >= 0) {
? ^^^ ^ ^
require("./console");
} else {
console.error("Usage: npm run-script demo [type]\n\n console: console-based demo\n browser: browser-based demo\n");
} | 4 | 0.444444 | 2 | 2 |
44559db31bdd161200f70669e391bcb93f78a246 | apps/onboarding/index.js | apps/onboarding/index.js | import express from 'express';
import SearchBlocks from '../../collections/search_blocks';
import { extend } from 'underscore';
import apolloMiddleware from 'react/apollo/middleware';
import setOnboardingComponentMiddleware from 'apps/onboarding/middleware/setOnboardingComponent';
const app = express();
app.set('views', `${__dirname}/templates`);
app.set('view engine', 'jade');
const renderOnboarding = (req, res, next) => {
res.render('index');
};
const middlewareStack = [
apolloMiddleware,
setOnboardingComponentMiddleware
];
app.get('/welcome', ...middlewareStack, renderOnboarding);
module.exports = app;
| import express from 'express';
import SearchBlocks from '../../collections/search_blocks';
import { extend } from 'underscore';
import apolloMiddleware from 'react/apollo/middleware';
import ensureLoggedInMiddleware from 'lib/middleware/ensure_logged_in.coffee';
import setOnboardingComponentMiddleware from 'apps/onboarding/middleware/setOnboardingComponent';
const app = express();
app.set('views', `${__dirname}/templates`);
app.set('view engine', 'jade');
const renderOnboarding = (req, res, next) => {
res.render('index');
};
const middlewareStack = [
ensureLoggedInMiddleware,
apolloMiddleware,
setOnboardingComponentMiddleware
];
app.get('/welcome', ...middlewareStack, renderOnboarding);
module.exports = app;
| Add ensure_logged_in to onboarding middleware stack | Add ensure_logged_in to onboarding middleware stack
| JavaScript | mit | aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell | javascript | ## Code Before:
import express from 'express';
import SearchBlocks from '../../collections/search_blocks';
import { extend } from 'underscore';
import apolloMiddleware from 'react/apollo/middleware';
import setOnboardingComponentMiddleware from 'apps/onboarding/middleware/setOnboardingComponent';
const app = express();
app.set('views', `${__dirname}/templates`);
app.set('view engine', 'jade');
const renderOnboarding = (req, res, next) => {
res.render('index');
};
const middlewareStack = [
apolloMiddleware,
setOnboardingComponentMiddleware
];
app.get('/welcome', ...middlewareStack, renderOnboarding);
module.exports = app;
## Instruction:
Add ensure_logged_in to onboarding middleware stack
## Code After:
import express from 'express';
import SearchBlocks from '../../collections/search_blocks';
import { extend } from 'underscore';
import apolloMiddleware from 'react/apollo/middleware';
import ensureLoggedInMiddleware from 'lib/middleware/ensure_logged_in.coffee';
import setOnboardingComponentMiddleware from 'apps/onboarding/middleware/setOnboardingComponent';
const app = express();
app.set('views', `${__dirname}/templates`);
app.set('view engine', 'jade');
const renderOnboarding = (req, res, next) => {
res.render('index');
};
const middlewareStack = [
ensureLoggedInMiddleware,
apolloMiddleware,
setOnboardingComponentMiddleware
];
app.get('/welcome', ...middlewareStack, renderOnboarding);
module.exports = app;
| import express from 'express';
import SearchBlocks from '../../collections/search_blocks';
import { extend } from 'underscore';
import apolloMiddleware from 'react/apollo/middleware';
+ import ensureLoggedInMiddleware from 'lib/middleware/ensure_logged_in.coffee';
import setOnboardingComponentMiddleware from 'apps/onboarding/middleware/setOnboardingComponent';
const app = express();
app.set('views', `${__dirname}/templates`);
app.set('view engine', 'jade');
const renderOnboarding = (req, res, next) => {
res.render('index');
};
const middlewareStack = [
+ ensureLoggedInMiddleware,
apolloMiddleware,
setOnboardingComponentMiddleware
];
app.get('/welcome', ...middlewareStack, renderOnboarding);
module.exports = app; | 2 | 0.086957 | 2 | 0 |
539608a9ca9a21707184496e744fc40a8cb72cc1 | announce/management/commands/migrate_mailchimp_users.py | announce/management/commands/migrate_mailchimp_users.py | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from announce.mailchimp import archive_members, list_members, batch_subscribe
from studygroups.models import Profile
import requests
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Synchronize mailchimp audience with users that opted in for communications'
def handle(self, *args, **options):
# get all mailchimp users
mailchimp_members = list_members()
filter_subscribed = lambda x: x.get('status') not in ['unsubscribed', 'cleaned']
mailchimp_members = filter(filter_subscribed, mailchimp_members)
emails = [member.get('email_address').lower() for member in mailchimp_members]
# add all members with communicagtion_opt_in == True to mailchimp
subscribed = User.objects.filter(profile__communication_opt_in=True, is_active=True, profile__email_confirmed_at__isnull=False)
to_sub = list(filter(lambda u: u.email.lower() not in emails, subscribed))
print('{} users will be added to the mailchimp list'.format(len(to_sub)))
batch_subscribe(to_sub)
# update profile.communication_opt_in = True for users subscribed to the mailchimp newsletter
unsubscribed_users = User.objects.filter(profile__communication_opt_in=False, is_active=True, profile__email_confirmed_at__isnull=False)
to_update = list(filter(lambda u: u.email.lower() in emails, unsubscribed_users))
for user in to_update:
user.profile.communication_opt_in = True
user.profile.save()
| from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from announce.mailchimp import archive_members, list_members, batch_subscribe
from studygroups.models import Profile
import requests
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Synchronize mailchimp audience with users that opted in for communications'
def handle(self, *args, **options):
# get all mailchimp users
mailchimp_members = list_members()
filter_subscribed = lambda x: x.get('status') not in ['unsubscribed', 'cleaned']
mailchimp_members = filter(filter_subscribed, mailchimp_members)
emails = [member.get('email_address').lower() for member in mailchimp_members]
# add all members with communicagtion_opt_in == True to mailchimp
subscribed = User.objects.filter(profile__communication_opt_in=True, is_active=True, profile__email_confirmed_at__isnull=False)
to_sub = list(filter(lambda u: u.email.lower() not in emails, subscribed))
print('{} users will be added to the mailchimp list'.format(len(to_sub)))
batch_subscribe(to_sub)
| Remove once of code for mailchimp list migration | Remove once of code for mailchimp list migration
| Python | mit | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | python | ## Code Before:
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from announce.mailchimp import archive_members, list_members, batch_subscribe
from studygroups.models import Profile
import requests
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Synchronize mailchimp audience with users that opted in for communications'
def handle(self, *args, **options):
# get all mailchimp users
mailchimp_members = list_members()
filter_subscribed = lambda x: x.get('status') not in ['unsubscribed', 'cleaned']
mailchimp_members = filter(filter_subscribed, mailchimp_members)
emails = [member.get('email_address').lower() for member in mailchimp_members]
# add all members with communicagtion_opt_in == True to mailchimp
subscribed = User.objects.filter(profile__communication_opt_in=True, is_active=True, profile__email_confirmed_at__isnull=False)
to_sub = list(filter(lambda u: u.email.lower() not in emails, subscribed))
print('{} users will be added to the mailchimp list'.format(len(to_sub)))
batch_subscribe(to_sub)
# update profile.communication_opt_in = True for users subscribed to the mailchimp newsletter
unsubscribed_users = User.objects.filter(profile__communication_opt_in=False, is_active=True, profile__email_confirmed_at__isnull=False)
to_update = list(filter(lambda u: u.email.lower() in emails, unsubscribed_users))
for user in to_update:
user.profile.communication_opt_in = True
user.profile.save()
## Instruction:
Remove once of code for mailchimp list migration
## Code After:
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from announce.mailchimp import archive_members, list_members, batch_subscribe
from studygroups.models import Profile
import requests
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Synchronize mailchimp audience with users that opted in for communications'
def handle(self, *args, **options):
# get all mailchimp users
mailchimp_members = list_members()
filter_subscribed = lambda x: x.get('status') not in ['unsubscribed', 'cleaned']
mailchimp_members = filter(filter_subscribed, mailchimp_members)
emails = [member.get('email_address').lower() for member in mailchimp_members]
# add all members with communicagtion_opt_in == True to mailchimp
subscribed = User.objects.filter(profile__communication_opt_in=True, is_active=True, profile__email_confirmed_at__isnull=False)
to_sub = list(filter(lambda u: u.email.lower() not in emails, subscribed))
print('{} users will be added to the mailchimp list'.format(len(to_sub)))
batch_subscribe(to_sub)
| from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from announce.mailchimp import archive_members, list_members, batch_subscribe
from studygroups.models import Profile
import requests
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Synchronize mailchimp audience with users that opted in for communications'
def handle(self, *args, **options):
# get all mailchimp users
mailchimp_members = list_members()
filter_subscribed = lambda x: x.get('status') not in ['unsubscribed', 'cleaned']
mailchimp_members = filter(filter_subscribed, mailchimp_members)
emails = [member.get('email_address').lower() for member in mailchimp_members]
# add all members with communicagtion_opt_in == True to mailchimp
subscribed = User.objects.filter(profile__communication_opt_in=True, is_active=True, profile__email_confirmed_at__isnull=False)
to_sub = list(filter(lambda u: u.email.lower() not in emails, subscribed))
print('{} users will be added to the mailchimp list'.format(len(to_sub)))
batch_subscribe(to_sub)
-
- # update profile.communication_opt_in = True for users subscribed to the mailchimp newsletter
- unsubscribed_users = User.objects.filter(profile__communication_opt_in=False, is_active=True, profile__email_confirmed_at__isnull=False)
- to_update = list(filter(lambda u: u.email.lower() in emails, unsubscribed_users))
- for user in to_update:
- user.profile.communication_opt_in = True
- user.profile.save()
-
-
- | 10 | 0.27027 | 0 | 10 |
abfe0538769145ac83031062ce3b22d2622f18bf | opwen_email_server/utils/temporary.py | opwen_email_server/utils/temporary.py | from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
def removing(path: str) -> str:
try:
yield path
finally:
_remove_if_exists(path)
def _remove_if_exists(path: str):
with suppress(FileNotFoundError):
remove(path)
| from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
from typing import Generator
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
def removing(path: str) -> Generator[str, None, None]:
try:
yield path
finally:
_remove_if_exists(path)
def _remove_if_exists(path: str):
with suppress(FileNotFoundError):
remove(path)
| Fix type annotation for context manager | Fix type annotation for context manager
| Python | apache-2.0 | ascoderu/opwen-cloudserver,ascoderu/opwen-cloudserver | python | ## Code Before:
from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
def removing(path: str) -> str:
try:
yield path
finally:
_remove_if_exists(path)
def _remove_if_exists(path: str):
with suppress(FileNotFoundError):
remove(path)
## Instruction:
Fix type annotation for context manager
## Code After:
from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
from typing import Generator
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
def removing(path: str) -> Generator[str, None, None]:
try:
yield path
finally:
_remove_if_exists(path)
def _remove_if_exists(path: str):
with suppress(FileNotFoundError):
remove(path)
| from contextlib import contextmanager
from contextlib import suppress
from os import close
from os import remove
from tempfile import mkstemp
+ from typing import Generator
def create_tempfilename() -> str:
file_descriptor, filename = mkstemp()
close(file_descriptor)
return filename
@contextmanager
- def removing(path: str) -> str:
+ def removing(path: str) -> Generator[str, None, None]:
try:
yield path
finally:
_remove_if_exists(path)
def _remove_if_exists(path: str):
with suppress(FileNotFoundError):
remove(path) | 3 | 0.125 | 2 | 1 |
9574c7edf155400504eedb84bd66d6ddd920a00b | zsh/aliases.zsh | zsh/aliases.zsh | alias reload!='. ~/.zshrc'
if [[ "$(uname -s)" == "Linux" ]]; then
alias open="xdg-open"
fi
alias p4s="git p4 submit -M"
| alias reload!='. ~/.zshrc'
if [[ "$(uname -s)" == "Linux" ]]; then
alias open="xdg-open"
fi
alias p4s="git p4 submit -M"
alias gvim="gvim --remote-tab"
| Add alias for gvim remote call | Add alias for gvim remote call
| Shell | mit | kaihowl/dotfiles,kaihowl/dotfiles,kaihowl/dotfiles,kaihowl/dotfiles,kaihowl/dotfiles | shell | ## Code Before:
alias reload!='. ~/.zshrc'
if [[ "$(uname -s)" == "Linux" ]]; then
alias open="xdg-open"
fi
alias p4s="git p4 submit -M"
## Instruction:
Add alias for gvim remote call
## Code After:
alias reload!='. ~/.zshrc'
if [[ "$(uname -s)" == "Linux" ]]; then
alias open="xdg-open"
fi
alias p4s="git p4 submit -M"
alias gvim="gvim --remote-tab"
| alias reload!='. ~/.zshrc'
if [[ "$(uname -s)" == "Linux" ]]; then
alias open="xdg-open"
fi
alias p4s="git p4 submit -M"
+ alias gvim="gvim --remote-tab" | 1 | 0.142857 | 1 | 0 |
b2c15b108bc66bf11d50d0c1c8cafe6b7e9590ee | recipes/grpcio/build.sh | recipes/grpcio/build.sh | rm -rf ${PREFIX}/include/openssl*
# set these so the default in setup.py are not used
export GRPC_PYTHON_LDFLAGS=""
if [[ $(uname) == Darwin ]]; then
# the makefile uses $AR for creating libraries, set it correctly here
export AR="$LIBTOOL -no_warning_for_no_symbols -o"
# we need a single set of openssl include files, the ones in PREFIX were
# removed above
export CFLAGS="${CFLAGS} -I./third_party/boringssl/include"
export CXXFLAGS="${CXXFLAGS} -I./third_party/boringssl/include"
# the Python extension has an unresolved _deflate symbol, link to libz to
# resolve
export LDFLAGS="${LDFLAGS} -lz"
fi
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
| export GRPC_PYTHON_LDFLAGS=""
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB="True"
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL="True"
# export GRPC_PYTHON_BUILD_SYSTEM_CARES="True"
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
| Use zlib and openssl from conda-forge | Use zlib and openssl from conda-forge | Shell | bsd-3-clause | ocefpaf/staged-recipes,sodre/staged-recipes,shadowwalkersb/staged-recipes,jakirkham/staged-recipes,sodre/staged-recipes,mcs07/staged-recipes,patricksnape/staged-recipes,birdsarah/staged-recipes,patricksnape/staged-recipes,kwilcox/staged-recipes,stuertz/staged-recipes,dschreij/staged-recipes,cpaulik/staged-recipes,SylvainCorlay/staged-recipes,conda-forge/staged-recipes,goanpeca/staged-recipes,ocefpaf/staged-recipes,asmeurer/staged-recipes,conda-forge/staged-recipes,igortg/staged-recipes,mariusvniekerk/staged-recipes,chrisburr/staged-recipes,isuruf/staged-recipes,igortg/staged-recipes,jochym/staged-recipes,ReimarBauer/staged-recipes,jakirkham/staged-recipes,mariusvniekerk/staged-recipes,petrushy/staged-recipes,scopatz/staged-recipes,rmcgibbo/staged-recipes,sodre/staged-recipes,rvalieris/staged-recipes,stuertz/staged-recipes,synapticarbors/staged-recipes,rvalieris/staged-recipes,jjhelmus/staged-recipes,isuruf/staged-recipes,goanpeca/staged-recipes,ReimarBauer/staged-recipes,SylvainCorlay/staged-recipes,cpaulik/staged-recipes,johanneskoester/staged-recipes,dschreij/staged-recipes,kwilcox/staged-recipes,johanneskoester/staged-recipes,shadowwalkersb/staged-recipes,jjhelmus/staged-recipes,ceholden/staged-recipes,Juanlu001/staged-recipes,birdsarah/staged-recipes,hadim/staged-recipes,petrushy/staged-recipes,basnijholt/staged-recipes,synapticarbors/staged-recipes,chrisburr/staged-recipes,ceholden/staged-recipes,rmcgibbo/staged-recipes,hadim/staged-recipes,asmeurer/staged-recipes,Juanlu001/staged-recipes,scopatz/staged-recipes,basnijholt/staged-recipes,mcs07/staged-recipes,jochym/staged-recipes | shell | ## Code Before:
rm -rf ${PREFIX}/include/openssl*
# set these so the default in setup.py are not used
export GRPC_PYTHON_LDFLAGS=""
if [[ $(uname) == Darwin ]]; then
# the makefile uses $AR for creating libraries, set it correctly here
export AR="$LIBTOOL -no_warning_for_no_symbols -o"
# we need a single set of openssl include files, the ones in PREFIX were
# removed above
export CFLAGS="${CFLAGS} -I./third_party/boringssl/include"
export CXXFLAGS="${CXXFLAGS} -I./third_party/boringssl/include"
# the Python extension has an unresolved _deflate symbol, link to libz to
# resolve
export LDFLAGS="${LDFLAGS} -lz"
fi
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
## Instruction:
Use zlib and openssl from conda-forge
## Code After:
export GRPC_PYTHON_LDFLAGS=""
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB="True"
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL="True"
# export GRPC_PYTHON_BUILD_SYSTEM_CARES="True"
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
| - rm -rf ${PREFIX}/include/openssl*
-
-
- # set these so the default in setup.py are not used
export GRPC_PYTHON_LDFLAGS=""
+ export GRPC_PYTHON_BUILD_SYSTEM_ZLIB="True"
+ export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL="True"
+ # export GRPC_PYTHON_BUILD_SYSTEM_CARES="True"
- if [[ $(uname) == Darwin ]]; then
- # the makefile uses $AR for creating libraries, set it correctly here
- export AR="$LIBTOOL -no_warning_for_no_symbols -o"
-
- # we need a single set of openssl include files, the ones in PREFIX were
- # removed above
- export CFLAGS="${CFLAGS} -I./third_party/boringssl/include"
- export CXXFLAGS="${CXXFLAGS} -I./third_party/boringssl/include"
-
- # the Python extension has an unresolved _deflate symbol, link to libz to
- # resolve
- export LDFLAGS="${LDFLAGS} -lz"
- fi
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv | 20 | 0.952381 | 3 | 17 |
b8ff046050370b74ff60290b5724087a35a700d9 | spec/checkout/best_offer_calculator_spec.rb | spec/checkout/best_offer_calculator_spec.rb | require 'spec_helper'
module Checkout
describe BestOfferCalculator do
context "Discount Quantity on the Pricing Rule" do
it "calculates a discount price for a product if the basket quantity matches the rule discount quantity" do
pricing_rule = {
"B" => { unit_price: 15, offers: [ { discount: 0.4, quantity: 2 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 2).should eq 30*0.4
end
it "chooses the best discounts based on the remaining quantity of items" do
pricing_rule = {
"B" => { unit_price: 30, offers: [ { discount: 0.15, quantity: 2 }, { discount: 0.15, quantity: 3 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 5).should eq 60*0.15+ 90*0.15
end
it "applies the discount for the items that match the discount quantity and the basic price for all the other items" do
pricing_rule = {
"B" => { unit_price: 15, offers: [ { discount: 0.45, quantity: 3 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 5).should eq 45 * 0.45
end
end
end
end | require 'spec_helper'
module Checkout
describe BestOfferCalculator do
context "Discount Quantity on the Pricing Rule" do
it "returns zero if there's no discount" do
pricing_rule = {
"B" => { unit_price: 15, offers: [] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 2).should eq 0
end
it "calculates a discount price for a product if the basket quantity matches the rule discount quantity" do
pricing_rule = {
"B" => { unit_price: 15, offers: [ { discount: 0.4, quantity: 2 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 2).should eq 30*0.4
end
it "chooses the best discounts based on the remaining quantity of items" do
pricing_rule = {
"B" => { unit_price: 30, offers: [ { discount: 0.15, quantity: 2 }, { discount: 0.15, quantity: 3 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 5).should eq 60*0.15 + 90*0.15
end
end
end
end | Update tests to match the new work | Update tests to match the new work
| Ruby | mit | omartell/checkout | ruby | ## Code Before:
require 'spec_helper'
module Checkout
describe BestOfferCalculator do
context "Discount Quantity on the Pricing Rule" do
it "calculates a discount price for a product if the basket quantity matches the rule discount quantity" do
pricing_rule = {
"B" => { unit_price: 15, offers: [ { discount: 0.4, quantity: 2 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 2).should eq 30*0.4
end
it "chooses the best discounts based on the remaining quantity of items" do
pricing_rule = {
"B" => { unit_price: 30, offers: [ { discount: 0.15, quantity: 2 }, { discount: 0.15, quantity: 3 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 5).should eq 60*0.15+ 90*0.15
end
it "applies the discount for the items that match the discount quantity and the basic price for all the other items" do
pricing_rule = {
"B" => { unit_price: 15, offers: [ { discount: 0.45, quantity: 3 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 5).should eq 45 * 0.45
end
end
end
end
## Instruction:
Update tests to match the new work
## Code After:
require 'spec_helper'
module Checkout
describe BestOfferCalculator do
context "Discount Quantity on the Pricing Rule" do
it "returns zero if there's no discount" do
pricing_rule = {
"B" => { unit_price: 15, offers: [] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 2).should eq 0
end
it "calculates a discount price for a product if the basket quantity matches the rule discount quantity" do
pricing_rule = {
"B" => { unit_price: 15, offers: [ { discount: 0.4, quantity: 2 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 2).should eq 30*0.4
end
it "chooses the best discounts based on the remaining quantity of items" do
pricing_rule = {
"B" => { unit_price: 30, offers: [ { discount: 0.15, quantity: 2 }, { discount: 0.15, quantity: 3 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 5).should eq 60*0.15 + 90*0.15
end
end
end
end | require 'spec_helper'
module Checkout
describe BestOfferCalculator do
context "Discount Quantity on the Pricing Rule" do
+
+ it "returns zero if there's no discount" do
+ pricing_rule = {
+ "B" => { unit_price: 15, offers: [] }
+ }
+ subject = BestOfferCalculator.new(pricing_rule)
+
+ subject.discount("B", 2).should eq 0
+ end
it "calculates a discount price for a product if the basket quantity matches the rule discount quantity" do
pricing_rule = {
"B" => { unit_price: 15, offers: [ { discount: 0.4, quantity: 2 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
subject.discount("B", 2).should eq 30*0.4
end
it "chooses the best discounts based on the remaining quantity of items" do
pricing_rule = {
"B" => { unit_price: 30, offers: [ { discount: 0.15, quantity: 2 }, { discount: 0.15, quantity: 3 } ] }
}
subject = BestOfferCalculator.new(pricing_rule)
- subject.discount("B", 5).should eq 60*0.15+ 90*0.15
+ subject.discount("B", 5).should eq 60*0.15 + 90*0.15
? +
- end
-
- it "applies the discount for the items that match the discount quantity and the basic price for all the other items" do
- pricing_rule = {
- "B" => { unit_price: 15, offers: [ { discount: 0.45, quantity: 3 } ] }
- }
- subject = BestOfferCalculator.new(pricing_rule)
-
- subject.discount("B", 5).should eq 45 * 0.45
end
end
end
end | 20 | 0.555556 | 10 | 10 |
6f65dc76eba9e50d20568a0a3ce94e65e048ec9d | app/views/user_mailer/reset_password_email.text.haml | app/views/user_mailer/reset_password_email.text.haml | Hello, #{@user.email}
===============================================
You have requested to reset your password.
To choose a new password, just follow this link: #{edit_password_url(@user.reset_password_token).html_safe}.
Have a great day!
| Hello, #{@user.first_name}
===============================================
You have requested to reset your password.
To choose a new password, just follow this link: #{edit_password_url(@user.reset_password_token).html_safe}
Have a great day!
| Change reset password email greeting to use first name and removed the period from the url to reduce copy/paste mistakes | Change reset password email greeting to use first name and removed the period from the url to reduce copy/paste mistakes
| Haml | agpl-3.0 | mkoon/gradecraft-development,mkoon/gradecraft-development,UM-USElab/gradecraft-development,peterkshultz/gradecraft-development,mkoon/gradecraft-development,UM-USElab/gradecraft-development,peterkshultz/gradecraft-development,peterkshultz/gradecraft-development,UM-USElab/gradecraft-development,UM-USElab/gradecraft-development | haml | ## Code Before:
Hello, #{@user.email}
===============================================
You have requested to reset your password.
To choose a new password, just follow this link: #{edit_password_url(@user.reset_password_token).html_safe}.
Have a great day!
## Instruction:
Change reset password email greeting to use first name and removed the period from the url to reduce copy/paste mistakes
## Code After:
Hello, #{@user.first_name}
===============================================
You have requested to reset your password.
To choose a new password, just follow this link: #{edit_password_url(@user.reset_password_token).html_safe}
Have a great day!
| - Hello, #{@user.email}
+ Hello, #{@user.first_name}
===============================================
You have requested to reset your password.
- To choose a new password, just follow this link: #{edit_password_url(@user.reset_password_token).html_safe}.
? -
+ To choose a new password, just follow this link: #{edit_password_url(@user.reset_password_token).html_safe}
Have a great day! | 4 | 0.5 | 2 | 2 |
91772aa5c2b82bb6027a5ffa28994d3626ee78ca | code/settings.json | code/settings.json | // Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "OperatorMono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 11,
"editor.formatOnType": true,
"npm-intellisense.scanDevDependencies": true,
"scss.validate": false,
"stylelint.enable": true,
"stylelint.config": {
"extends": "stylelint-config-standard"
},
"tslint.validateWithDefaultConfig": true,
"vsicons.icons": "/Users/clay/.vscode-insiders/icons.zip"
} | // Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "OperatorMono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 11,
"editor.formatOnType": true,
"npm-intellisense.scanDevDependencies": true,
"scss.validate": false,
"stylelint.enable": true,
"trailing-spaces.highlightCurrentLine": false,
"trailing-spaces.trimOnSave": true,
"tslint.validateWithDefaultConfig": true,
"vsicons.icons": "/Users/clay/.vscode-insiders/icons.zip"
} | Trim whitespace on save in VS Code | Trim whitespace on save in VS Code
| JSON | mit | smockle/dotfiles,smockle/dotfiles | json | ## Code Before:
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "OperatorMono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 11,
"editor.formatOnType": true,
"npm-intellisense.scanDevDependencies": true,
"scss.validate": false,
"stylelint.enable": true,
"stylelint.config": {
"extends": "stylelint-config-standard"
},
"tslint.validateWithDefaultConfig": true,
"vsicons.icons": "/Users/clay/.vscode-insiders/icons.zip"
}
## Instruction:
Trim whitespace on save in VS Code
## Code After:
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "OperatorMono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 11,
"editor.formatOnType": true,
"npm-intellisense.scanDevDependencies": true,
"scss.validate": false,
"stylelint.enable": true,
"trailing-spaces.highlightCurrentLine": false,
"trailing-spaces.trimOnSave": true,
"tslint.validateWithDefaultConfig": true,
"vsicons.icons": "/Users/clay/.vscode-insiders/icons.zip"
} | // Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "OperatorMono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 11,
"editor.formatOnType": true,
"npm-intellisense.scanDevDependencies": true,
-
+
"scss.validate": false,
"stylelint.enable": true,
- "stylelint.config": {
- "extends": "stylelint-config-standard"
- },
+
+ "trailing-spaces.highlightCurrentLine": false,
+ "trailing-spaces.trimOnSave": true,
"tslint.validateWithDefaultConfig": true,
"vsicons.icons": "/Users/clay/.vscode-insiders/icons.zip"
} | 8 | 0.421053 | 4 | 4 |
4902c4032175f06abdac8254d537d202542faacf | js/main.js | js/main.js | var scrollDown = function() {
$("html, body").animate({
scrollTop: $(document).height()-$(window).height()
}, "slow");
}
var fadeTo = function(value) {
$('#bottom').css("opacity", 0.6 * (1-value));
$('#fade').css("opacity", value * 0.8);
$('#overlay').css("opacity", value);
if (value > 0.5) {
$("#overlay span").css("pointer-events", "all");
} else {
$("#overlay span").css("pointer-events", "none");
}
}
var scrollValue = function() {
return ($(window).scrollTop() / $(window).height())/0.6;
}
//
$(function() {
fadeTo(scrollValue());
$("#bottom").on('click', function(event) {
scrollDown();
});
$(window).on('scroll', function(event) {
fadeTo(scrollValue());
});
window.onunload = function() {
scrollTo(0,0)
};
});
| var scrollDown = function() {
$("html, body").animate({
scrollTop: $(document).height()-$(window).height()
}, "slow");
}
var fadeTo = function(value) {
$('#bottom').css("opacity", 0.6 * (1-value));
$('#fade').css("opacity", value * 0.8);
$('#overlay').css("opacity", value);
if (value > 0.5) {
$("#overlay span").css("pointer-events", "all");
} else {
$("#overlay span").css("pointer-events", "none");
}
}
var scrollValue = function() {
return Math.max(($(window).scrollTop() / $(window).height())/0.6, 0.01);
}
var scrollCheck = function() {
fadeTo(scrollValue());
}
//
$(function() {
scrollCheck();
setInterval(scrollCheck, 39);
$("#bottom").on('click', function(event) {
scrollDown();
});
window.onunload = function() {
scrollTo(0,0)
};
});
| Fix mobile browser fade behavior | Fix mobile browser fade behavior
| JavaScript | mit | misternu/misternu.github.io,misternu/misternu.github.io,misternu/misternu.github.io | javascript | ## Code Before:
var scrollDown = function() {
$("html, body").animate({
scrollTop: $(document).height()-$(window).height()
}, "slow");
}
var fadeTo = function(value) {
$('#bottom').css("opacity", 0.6 * (1-value));
$('#fade').css("opacity", value * 0.8);
$('#overlay').css("opacity", value);
if (value > 0.5) {
$("#overlay span").css("pointer-events", "all");
} else {
$("#overlay span").css("pointer-events", "none");
}
}
var scrollValue = function() {
return ($(window).scrollTop() / $(window).height())/0.6;
}
//
$(function() {
fadeTo(scrollValue());
$("#bottom").on('click', function(event) {
scrollDown();
});
$(window).on('scroll', function(event) {
fadeTo(scrollValue());
});
window.onunload = function() {
scrollTo(0,0)
};
});
## Instruction:
Fix mobile browser fade behavior
## Code After:
var scrollDown = function() {
$("html, body").animate({
scrollTop: $(document).height()-$(window).height()
}, "slow");
}
var fadeTo = function(value) {
$('#bottom').css("opacity", 0.6 * (1-value));
$('#fade').css("opacity", value * 0.8);
$('#overlay').css("opacity", value);
if (value > 0.5) {
$("#overlay span").css("pointer-events", "all");
} else {
$("#overlay span").css("pointer-events", "none");
}
}
var scrollValue = function() {
return Math.max(($(window).scrollTop() / $(window).height())/0.6, 0.01);
}
var scrollCheck = function() {
fadeTo(scrollValue());
}
//
$(function() {
scrollCheck();
setInterval(scrollCheck, 39);
$("#bottom").on('click', function(event) {
scrollDown();
});
window.onunload = function() {
scrollTo(0,0)
};
});
| var scrollDown = function() {
$("html, body").animate({
scrollTop: $(document).height()-$(window).height()
}, "slow");
}
var fadeTo = function(value) {
$('#bottom').css("opacity", 0.6 * (1-value));
$('#fade').css("opacity", value * 0.8);
$('#overlay').css("opacity", value);
if (value > 0.5) {
$("#overlay span").css("pointer-events", "all");
} else {
$("#overlay span").css("pointer-events", "none");
}
}
var scrollValue = function() {
- return ($(window).scrollTop() / $(window).height())/0.6;
+ return Math.max(($(window).scrollTop() / $(window).height())/0.6, 0.01);
? +++++++++ +++++++
+ }
+
+ var scrollCheck = function() {
+ fadeTo(scrollValue());
}
//
$(function() {
- fadeTo(scrollValue());
+ scrollCheck();
+ setInterval(scrollCheck, 39);
$("#bottom").on('click', function(event) {
scrollDown();
- });
-
- $(window).on('scroll', function(event) {
- fadeTo(scrollValue());
});
window.onunload = function() {
scrollTo(0,0)
};
});
| 13 | 0.342105 | 7 | 6 |
9ae75d0caa3e6fb752a399f6bdb128d6354383ee | conf/templates/nova/nova-network-init.sh | conf/templates/nova/nova-network-init.sh |
set -o xtrace
set -o errexit
# Create a small network
nova-manage --flagfile %CFG_FILE% network create private %FIXED_RANGE% 1 %FIXED_NETWORK_SIZE%
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
echo "Not creating floating IPs (not supported by quantum server)"
else
# Create some floating ips
nova-manage --flagfile %CFG_FILE% floating create %FLOATING_RANGE%
# Create a second pool
nova-manage --flagfile %CFG_FILE% floating create --ip_range=%TEST_FLOATING_RANGE% --pool=%TEST_FLOATING_POOL%
fi
|
set -o xtrace
set -o errexit
# Create a small network
nova-manage --config-file %CFG_FILE% network create private %FIXED_RANGE% 1 %FIXED_NETWORK_SIZE%
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
echo "Not creating floating IPs (not supported by quantum server)"
else
# Create some floating ips
nova-manage --config-file %CFG_FILE% floating create %FLOATING_RANGE%
# Create a second pool
nova-manage --config-file %CFG_FILE% floating create --ip_range=%TEST_FLOATING_RANGE% --pool=%TEST_FLOATING_POOL%
fi
| Remove --flagfile and move to supported --config-file | Remove --flagfile and move to supported --config-file
| Shell | apache-2.0 | mc2014/anvil,stackforge/anvil,stackforge/anvil,mc2014/anvil | shell | ## Code Before:
set -o xtrace
set -o errexit
# Create a small network
nova-manage --flagfile %CFG_FILE% network create private %FIXED_RANGE% 1 %FIXED_NETWORK_SIZE%
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
echo "Not creating floating IPs (not supported by quantum server)"
else
# Create some floating ips
nova-manage --flagfile %CFG_FILE% floating create %FLOATING_RANGE%
# Create a second pool
nova-manage --flagfile %CFG_FILE% floating create --ip_range=%TEST_FLOATING_RANGE% --pool=%TEST_FLOATING_POOL%
fi
## Instruction:
Remove --flagfile and move to supported --config-file
## Code After:
set -o xtrace
set -o errexit
# Create a small network
nova-manage --config-file %CFG_FILE% network create private %FIXED_RANGE% 1 %FIXED_NETWORK_SIZE%
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
echo "Not creating floating IPs (not supported by quantum server)"
else
# Create some floating ips
nova-manage --config-file %CFG_FILE% floating create %FLOATING_RANGE%
# Create a second pool
nova-manage --config-file %CFG_FILE% floating create --ip_range=%TEST_FLOATING_RANGE% --pool=%TEST_FLOATING_POOL%
fi
|
set -o xtrace
set -o errexit
# Create a small network
- nova-manage --flagfile %CFG_FILE% network create private %FIXED_RANGE% 1 %FIXED_NETWORK_SIZE%
? ^^
+ nova-manage --config-file %CFG_FILE% network create private %FIXED_RANGE% 1 %FIXED_NETWORK_SIZE%
? +++ ^ +
if [[ "$ENABLED_SERVICES" =~ "quantum" ]]; then
echo "Not creating floating IPs (not supported by quantum server)"
else
# Create some floating ips
- nova-manage --flagfile %CFG_FILE% floating create %FLOATING_RANGE%
? ^^
+ nova-manage --config-file %CFG_FILE% floating create %FLOATING_RANGE%
? +++ ^ +
# Create a second pool
- nova-manage --flagfile %CFG_FILE% floating create --ip_range=%TEST_FLOATING_RANGE% --pool=%TEST_FLOATING_POOL%
? ^^
+ nova-manage --config-file %CFG_FILE% floating create --ip_range=%TEST_FLOATING_RANGE% --pool=%TEST_FLOATING_POOL%
? +++ ^ +
fi
| 6 | 0.352941 | 3 | 3 |
ab6cf9ec0c75acecd2ced9c1558a6e93536e6957 | test/renderer/epics/theming-spec.js | test/renderer/epics/theming-spec.js | import { expect } from 'chai';
import {
setTheme,
setStoredThemeObservable,
} from '../../../src/notebook/epics/theming';
describe('setTheme', () => {
it('creates an action of type SET_THEME with a theme', () => {
expect(setTheme('disco')).to.deep.equal({type: 'SET_THEME', theme: 'disco'})
});
});
describe('setStoredThemeObservable', () => {
it('returns an observable', () => {
const setStoredThemeObs = setStoredThemeObservable('disco');
expect(setStoredThemeObs.subscribe).to.not.be.null;
});
});
| import chai, { expect } from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
chai.use(sinonChai);
import {
setTheme,
setStoredThemeObservable,
} from '../../../src/notebook/epics/theming';
import storage from 'electron-json-storage';
describe('setTheme', () => {
it('creates an action of type SET_THEME with a theme', () => {
expect(setTheme('disco')).to.deep.equal({type: 'SET_THEME', theme: 'disco'})
});
});
describe('setStoredThemeObservable', () => {
it('returns an observable', () => {
const setStoredThemeObs = setStoredThemeObservable('disco');
expect(setStoredThemeObs.subscribe).to.not.be.null;
});
it('should set the value in the store', (done) => {
const setStoredThemeObs = setStoredThemeObservable('disco');
const set = sinon.spy(storage, 'set');
setStoredThemeObs.subscribe(() => {
expect(set).to.be.called;
done();
});
});
it('should return an error if not given a theme', (done) => {
const setStoredThemeObs = setStoredThemeObservable();
const set = sinon.spy(storage, 'set');
setStoredThemeObs.subscribe(() => {
throw new Error('Observable invalidly set theme.');
}, (error) => {
expect(set).to.be.called;
expect(error.message).to.equal('Must provide JSON and key');
});
done();
});
});
| Add tests for error in setTheme | test(themeSpec): Add tests for error in setTheme
| JavaScript | bsd-3-clause | jdetle/nteract,rgbkrk/nteract,jdfreder/nteract,jdetle/nteract,nteract/composition,captainsafia/nteract,0u812/nteract,nteract/nteract,captainsafia/nteract,jdfreder/nteract,rgbkrk/nteract,nteract/nteract,jdetle/nteract,nteract/nteract,rgbkrk/nteract,rgbkrk/nteract,nteract/composition,jdetle/nteract,jdfreder/nteract,captainsafia/nteract,nteract/nteract,temogen/nteract,temogen/nteract,nteract/composition,0u812/nteract,jdfreder/nteract,0u812/nteract,rgbkrk/nteract,temogen/nteract,captainsafia/nteract,0u812/nteract,nteract/nteract | javascript | ## Code Before:
import { expect } from 'chai';
import {
setTheme,
setStoredThemeObservable,
} from '../../../src/notebook/epics/theming';
describe('setTheme', () => {
it('creates an action of type SET_THEME with a theme', () => {
expect(setTheme('disco')).to.deep.equal({type: 'SET_THEME', theme: 'disco'})
});
});
describe('setStoredThemeObservable', () => {
it('returns an observable', () => {
const setStoredThemeObs = setStoredThemeObservable('disco');
expect(setStoredThemeObs.subscribe).to.not.be.null;
});
});
## Instruction:
test(themeSpec): Add tests for error in setTheme
## Code After:
import chai, { expect } from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
chai.use(sinonChai);
import {
setTheme,
setStoredThemeObservable,
} from '../../../src/notebook/epics/theming';
import storage from 'electron-json-storage';
describe('setTheme', () => {
it('creates an action of type SET_THEME with a theme', () => {
expect(setTheme('disco')).to.deep.equal({type: 'SET_THEME', theme: 'disco'})
});
});
describe('setStoredThemeObservable', () => {
it('returns an observable', () => {
const setStoredThemeObs = setStoredThemeObservable('disco');
expect(setStoredThemeObs.subscribe).to.not.be.null;
});
it('should set the value in the store', (done) => {
const setStoredThemeObs = setStoredThemeObservable('disco');
const set = sinon.spy(storage, 'set');
setStoredThemeObs.subscribe(() => {
expect(set).to.be.called;
done();
});
});
it('should return an error if not given a theme', (done) => {
const setStoredThemeObs = setStoredThemeObservable();
const set = sinon.spy(storage, 'set');
setStoredThemeObs.subscribe(() => {
throw new Error('Observable invalidly set theme.');
}, (error) => {
expect(set).to.be.called;
expect(error.message).to.equal('Must provide JSON and key');
});
done();
});
});
| - import { expect } from 'chai';
+ import chai, { expect } from 'chai';
? ++++++
+
+ import sinon from 'sinon';
+ import sinonChai from 'sinon-chai';
+
+ chai.use(sinonChai);
import {
setTheme,
setStoredThemeObservable,
} from '../../../src/notebook/epics/theming';
+
+ import storage from 'electron-json-storage';
describe('setTheme', () => {
it('creates an action of type SET_THEME with a theme', () => {
expect(setTheme('disco')).to.deep.equal({type: 'SET_THEME', theme: 'disco'})
});
});
describe('setStoredThemeObservable', () => {
it('returns an observable', () => {
const setStoredThemeObs = setStoredThemeObservable('disco');
expect(setStoredThemeObs.subscribe).to.not.be.null;
});
+ it('should set the value in the store', (done) => {
+ const setStoredThemeObs = setStoredThemeObservable('disco');
+ const set = sinon.spy(storage, 'set');
+
+ setStoredThemeObs.subscribe(() => {
+ expect(set).to.be.called;
+ done();
+ });
+ });
+ it('should return an error if not given a theme', (done) => {
+ const setStoredThemeObs = setStoredThemeObservable();
+ const set = sinon.spy(storage, 'set');
+
+ setStoredThemeObs.subscribe(() => {
+ throw new Error('Observable invalidly set theme.');
+ }, (error) => {
+ expect(set).to.be.called;
+ expect(error.message).to.equal('Must provide JSON and key');
+ });
+
+ done();
+ });
}); | 31 | 1.631579 | 30 | 1 |
01163ce7fc43b4ab2e5b9ab1c5f94556d0509004 | examples/tornado/auth_demo.py | examples/tornado/auth_demo.py | from mongrel2.config import *
main = Server(
uuid="f400bf85-4538-4f7a-8908-67e313d515c2",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="./",
default_host="localhost",
name="test",
pid_file="/run/mongrel2.pid",
port=6767,
hosts = [
Host(name="localhost",
routes={ r'/(.*)': Proxy(addr='127.0.0.1', port=8888) })
]
)
commit([main])
| from mongrel2.config import *
main = Server(
uuid="f400bf85-4538-4f7a-8908-67e313d515c2",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="./",
default_host="localhost",
name="test",
pid_file="/run/mongrel2.pid",
port=6767,
hosts = [
Host(name="localhost",
routes={ r'/(.*)': Proxy(addr='127.0.0.1', port=8888) })
]
)
commit([main], settings={'limits.buffer_size': 4 * 1024})
| Add the settings to the authdemo. | Add the settings to the authdemo. | Python | bsd-3-clause | niedbalski/mongrel2,jdesgats/mongrel2,winks/mongrel2,griffordson/mongrel2,cpick/mongrel2,duaneg/mongrel2,jagguli/mongrel2,mongrel2/mongrel2,issuu/mongrel2,metadave/mongrel2,steamraven/mongrel2,cpick/mongrel2,niedbalski/mongrel2,AustinWise/mongrel2,nmandery/mongrel2,markokr/mongrel2,reshefm/mongrel2,sshirokov/mongrel2,fanout/mongrel2,nickdesaulniers/mongrel2,mongrel2/mongrel2,ralphbean/mongrel2,aidenkeating/mongrel2,moai/mongrel2,jablkopp/mongrel2,jubarajborgohain/mongrel2,dermoth/mongrel2,bashi-bazouk/mongrel2,ameuret/mongrel2,metadave/mongrel2,markokr/mongrel2,AvdN/mongrel2,elo80ka/mongrel2,nickdesaulniers/mongrel2,wayneeseguin/mongrel2,mongrel2/mongrel2,steamraven/mongrel2,rpeterson/mongrel2,reshefm/mongrel2,ralphbean/mongrel2,winks/mongrel2,AlexVPopov/mongrel2,jiffyjeff/mongrel2,markokr/mongrel2,msteinert/mongrel2,AlexVPopov/mongrel2,duaneg/mongrel2,xrl/mongrel2,dermoth/mongrel2,musl/mongrel2,ameuret/mongrel2,aidenkeating/mongrel2,musl/mongrel2,moai/mongrel2,minrk/mongrel2,markokr/mongrel2,jagguli/mongrel2,jdesgats/mongrel2,apjanke/mongrel2,griffordson/mongrel2,AlexVPopov/mongrel2,xrl/mongrel2,krakensden/mongrel2,dermoth/mongrel2,AustinWise/mongrel2,elo80ka/mongrel2,cpick/mongrel2,msteinert/mongrel2,xrl/mongrel2,wayneeseguin/mongrel2,jasom/mongrel2,Gibheer/mongrel2,jubarajborgohain/mongrel2,jiffyjeff/mongrel2,musl/mongrel2,wayneeseguin/mongrel2,mbj/mongrel2,bashi-bazouk/mongrel2,apjanke/mongrel2,krakensden/mongrel2,fanout/mongrel2,musl/mongrel2,jasom/mongrel2,jubarajborgohain/mongrel2,sshirokov/mongrel2,jagguli/mongrel2,ameuret/mongrel2,msteinert/mongrel2,nickdesaulniers/mongrel2,jagguli/mongrel2,jablkopp/mongrel2,jablkopp/mongrel2,xrl/mongrel2,jasom/mongrel2,ralphbean/mongrel2,musl/mongrel2,rpeterson/mongrel2,yoink00/mongrel2,pjkundert/mongrel2,issuu/mongrel2,ameuret/mongrel2,yoink00/mongrel2,Gibheer/mongrel2,jdesgats/mongrel2,chickenkiller/mongrel2,nmandery/mongrel2,steamraven/mongrel2,nmandery/mongrel2,fanout/mongrel2,pjkundert/mongrel2,ralphbean/mongrel2,mbj/mongrel2,jagguli/mongrel2,steamraven/mongrel2,jdesgats/mongrel2,nickdesaulniers/mongrel2,rpeterson/mongrel2,fanout/mongrel2,minrk/mongrel2,elo80ka/mongrel2,aidenkeating/mongrel2,apjanke/mongrel2,apjanke/mongrel2,jdesgats/mongrel2,xrl/mongrel2,elo80ka/mongrel2,metadave/mongrel2,bashi-bazouk/mongrel2,krakensden/mongrel2,reshefm/mongrel2,mbj/mongrel2,jasom/mongrel2,moai/mongrel2,minrk/mongrel2,yoink00/mongrel2,AustinWise/mongrel2,moai/mongrel2,metadave/mongrel2,bashi-bazouk/mongrel2,nickdesaulniers/mongrel2,rpeterson/mongrel2,pjkundert/mongrel2,Gibheer/mongrel2,krakensden/mongrel2,krakensden/mongrel2,jablkopp/mongrel2,jablkopp/mongrel2,AvdN/mongrel2,wayneeseguin/mongrel2,issuu/mongrel2,bashi-bazouk/mongrel2,cpick/mongrel2,pjkundert/mongrel2,sshirokov/mongrel2,jiffyjeff/mongrel2,jasom/mongrel2,pjkundert/mongrel2,cpick/mongrel2,steamraven/mongrel2,minrk/mongrel2,cpick/mongrel2,jiffyjeff/mongrel2,issuu/mongrel2,yoink00/mongrel2,AlexVPopov/mongrel2,xrl/mongrel2,AlexVPopov/mongrel2,Gibheer/mongrel2,aidenkeating/mongrel2,apjanke/mongrel2,markokr/mongrel2,ameuret/mongrel2,mbj/mongrel2,griffordson/mongrel2,AvdN/mongrel2,AvdN/mongrel2,nmandery/mongrel2,ameuret/mongrel2,aidenkeating/mongrel2,chickenkiller/mongrel2,chickenkiller/mongrel2,fanout/mongrel2,jubarajborgohain/mongrel2,duaneg/mongrel2,winks/mongrel2,dermoth/mongrel2,moai/mongrel2,sshirokov/mongrel2,mongrel2/mongrel2,elo80ka/mongrel2,griffordson/mongrel2,minrk/mongrel2,niedbalski/mongrel2,mongrel2/mongrel2,aidenkeating/mongrel2,yoink00/mongrel2,yoink00/mongrel2,duaneg/mongrel2,winks/mongrel2,mongrel2/mongrel2,msteinert/mongrel2,niedbalski/mongrel2,jiffyjeff/mongrel2,chickenkiller/mongrel2,issuu/mongrel2,chickenkiller/mongrel2,reshefm/mongrel2,chickenkiller/mongrel2,AustinWise/mongrel2 | python | ## Code Before:
from mongrel2.config import *
main = Server(
uuid="f400bf85-4538-4f7a-8908-67e313d515c2",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="./",
default_host="localhost",
name="test",
pid_file="/run/mongrel2.pid",
port=6767,
hosts = [
Host(name="localhost",
routes={ r'/(.*)': Proxy(addr='127.0.0.1', port=8888) })
]
)
commit([main])
## Instruction:
Add the settings to the authdemo.
## Code After:
from mongrel2.config import *
main = Server(
uuid="f400bf85-4538-4f7a-8908-67e313d515c2",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="./",
default_host="localhost",
name="test",
pid_file="/run/mongrel2.pid",
port=6767,
hosts = [
Host(name="localhost",
routes={ r'/(.*)': Proxy(addr='127.0.0.1', port=8888) })
]
)
commit([main], settings={'limits.buffer_size': 4 * 1024})
| from mongrel2.config import *
main = Server(
uuid="f400bf85-4538-4f7a-8908-67e313d515c2",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="./",
default_host="localhost",
name="test",
pid_file="/run/mongrel2.pid",
port=6767,
hosts = [
Host(name="localhost",
routes={ r'/(.*)': Proxy(addr='127.0.0.1', port=8888) })
]
)
- commit([main])
+ commit([main], settings={'limits.buffer_size': 4 * 1024})
| 2 | 0.095238 | 1 | 1 |
0fe785183f6d7a631d2271d31ea17fd0190d2603 | templates/zerver/help/allow-image-link-previews.md | templates/zerver/help/allow-image-link-previews.md |
{!admin-only.md!}
By default, when a user links to an image or a website, a preview of the
image or website content is shown. You can choose to disable previews of
images and/or website links.
### Block image and website previews
{start_tabs}
{settings_tab|organization-settings}
1. Under **Other settings**, toggle **Show previews of uploaded and linked images**.
1. Under **Other settings**, toggle **Show previews of linked websites**.
{!save-changes.md!}
{end_tabs}
|
{!admin-only.md!}
By default, when a user links to an image or a website, a preview of the
image or website content is shown. You can choose to disable previews of
images and/or website links.
Zulip proxies all external images in messages through the server, to
prevent images from being used to track Zulip users.
### Block image and website previews
{start_tabs}
{settings_tab|organization-settings}
1. Under **Other settings**, toggle **Show previews of uploaded and linked images**.
1. Under **Other settings**, toggle **Show previews of linked websites**.
{!save-changes.md!}
{end_tabs}
| Document anti-tracking features of images. | help: Document anti-tracking features of images.
| Markdown | apache-2.0 | kou/zulip,rht/zulip,eeshangarg/zulip,hackerkid/zulip,andersk/zulip,hackerkid/zulip,eeshangarg/zulip,zulip/zulip,hackerkid/zulip,kou/zulip,hackerkid/zulip,eeshangarg/zulip,rht/zulip,zulip/zulip,rht/zulip,kou/zulip,rht/zulip,zulip/zulip,hackerkid/zulip,andersk/zulip,punchagan/zulip,kou/zulip,zulip/zulip,eeshangarg/zulip,punchagan/zulip,andersk/zulip,andersk/zulip,rht/zulip,zulip/zulip,eeshangarg/zulip,hackerkid/zulip,punchagan/zulip,zulip/zulip,eeshangarg/zulip,rht/zulip,kou/zulip,rht/zulip,zulip/zulip,hackerkid/zulip,kou/zulip,punchagan/zulip,eeshangarg/zulip,punchagan/zulip,punchagan/zulip,andersk/zulip,andersk/zulip,kou/zulip,punchagan/zulip,andersk/zulip | markdown | ## Code Before:
{!admin-only.md!}
By default, when a user links to an image or a website, a preview of the
image or website content is shown. You can choose to disable previews of
images and/or website links.
### Block image and website previews
{start_tabs}
{settings_tab|organization-settings}
1. Under **Other settings**, toggle **Show previews of uploaded and linked images**.
1. Under **Other settings**, toggle **Show previews of linked websites**.
{!save-changes.md!}
{end_tabs}
## Instruction:
help: Document anti-tracking features of images.
## Code After:
{!admin-only.md!}
By default, when a user links to an image or a website, a preview of the
image or website content is shown. You can choose to disable previews of
images and/or website links.
Zulip proxies all external images in messages through the server, to
prevent images from being used to track Zulip users.
### Block image and website previews
{start_tabs}
{settings_tab|organization-settings}
1. Under **Other settings**, toggle **Show previews of uploaded and linked images**.
1. Under **Other settings**, toggle **Show previews of linked websites**.
{!save-changes.md!}
{end_tabs}
|
{!admin-only.md!}
By default, when a user links to an image or a website, a preview of the
image or website content is shown. You can choose to disable previews of
images and/or website links.
+
+ Zulip proxies all external images in messages through the server, to
+ prevent images from being used to track Zulip users.
### Block image and website previews
{start_tabs}
{settings_tab|organization-settings}
1. Under **Other settings**, toggle **Show previews of uploaded and linked images**.
1. Under **Other settings**, toggle **Show previews of linked websites**.
{!save-changes.md!}
{end_tabs} | 3 | 0.15 | 3 | 0 |
553134c527561951c03e9460f252b097c7ed2caf | README.md | README.md | eBay API Client for Ruby
========================
Current API version is *951*
========================
This is a fork of the "CPlus/ebayapi-19" code.
The api implements the ebay Trading API. To get a list of calls look here:
http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/index.html
or
lib/ebay/api_methods.rb
Some key features:
* Simple and easy to use Ruby implementation.
* Ability to return a raw response for calls that return an extremely large response such as GetCategoriesRequest.
* Up-to-date with the eBay API version 951
* Months of usage in a production environment.
* Support for Platform Notifications baked right in.
For examples of many common tasks see the examples folder. Start with get_ebay_time.rb.
You need to get a develper account and place a config.rb (see template) in the
examples directory.
| eBay API Client for Ruby
========================
Current API version is *951*
========================
This is a fork of the "CPlus/ebayapi-19" code.
The api implements the ebay Trading API. To get a list of calls look here:
http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/index.html
or
lib/ebay/api_methods.rb
Some key features:
* Simple and easy to use Ruby implementation.
* Ability to return a raw response for calls that return an extremely large response such as GetCategoriesRequest.
* Up-to-date with the eBay API version 951
* Months of usage in a production environment.
* Support for Platform Notifications baked right in.
For examples of many common tasks see the examples folder. Start with get_ebay_time.rb.
You need to get a develper account and place a config.rb (see template) in the
examples directory.
## API Version and Schema Updates
Please follow this steps whenever you need to update API version and
corresponding scheme.
rake schema:update
rake classes:generate
rake test
| Add guide for API version and schema updates | Add guide for API version and schema updates
| Markdown | mit | main24/ebayapi-19,main24/ebayapi-19 | markdown | ## Code Before:
eBay API Client for Ruby
========================
Current API version is *951*
========================
This is a fork of the "CPlus/ebayapi-19" code.
The api implements the ebay Trading API. To get a list of calls look here:
http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/index.html
or
lib/ebay/api_methods.rb
Some key features:
* Simple and easy to use Ruby implementation.
* Ability to return a raw response for calls that return an extremely large response such as GetCategoriesRequest.
* Up-to-date with the eBay API version 951
* Months of usage in a production environment.
* Support for Platform Notifications baked right in.
For examples of many common tasks see the examples folder. Start with get_ebay_time.rb.
You need to get a develper account and place a config.rb (see template) in the
examples directory.
## Instruction:
Add guide for API version and schema updates
## Code After:
eBay API Client for Ruby
========================
Current API version is *951*
========================
This is a fork of the "CPlus/ebayapi-19" code.
The api implements the ebay Trading API. To get a list of calls look here:
http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/index.html
or
lib/ebay/api_methods.rb
Some key features:
* Simple and easy to use Ruby implementation.
* Ability to return a raw response for calls that return an extremely large response such as GetCategoriesRequest.
* Up-to-date with the eBay API version 951
* Months of usage in a production environment.
* Support for Platform Notifications baked right in.
For examples of many common tasks see the examples folder. Start with get_ebay_time.rb.
You need to get a develper account and place a config.rb (see template) in the
examples directory.
## API Version and Schema Updates
Please follow this steps whenever you need to update API version and
corresponding scheme.
rake schema:update
rake classes:generate
rake test
| eBay API Client for Ruby
========================
Current API version is *951*
========================
This is a fork of the "CPlus/ebayapi-19" code.
The api implements the ebay Trading API. To get a list of calls look here:
http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/index.html
or
lib/ebay/api_methods.rb
Some key features:
* Simple and easy to use Ruby implementation.
* Ability to return a raw response for calls that return an extremely large response such as GetCategoriesRequest.
* Up-to-date with the eBay API version 951
* Months of usage in a production environment.
* Support for Platform Notifications baked right in.
For examples of many common tasks see the examples folder. Start with get_ebay_time.rb.
You need to get a develper account and place a config.rb (see template) in the
examples directory.
+
+ ## API Version and Schema Updates
+
+ Please follow this steps whenever you need to update API version and
+ corresponding scheme.
+
+ rake schema:update
+ rake classes:generate
+ rake test | 9 | 0.310345 | 9 | 0 |
8cb2338394673688f103825e192b209309f3eac1 | lib/swissmatch/address.rb | lib/swissmatch/address.rb |
module SwissMatch
# Represents a swiss address. Used by directory service interfaces to return search
# results.
Address = Struct.new(:gender, :first_name, :last_name, :maiden_name, :street_name, :street_number, :zip_code, :city) do
def street
[street_name,street_number].compact.join(" ")
end
end
end
|
module SwissMatch
# Represents a swiss address. Used by directory service interfaces to return search
# results.
Address = Struct.new(:gender, :first_name, :last_name, :maiden_name, :street_name, :street_number, :zip_code, :city) do
def street
[street_name,street_number].compact.join(" ")
end
# Full family name including the maiden name
def family_name
name = last_name
name += " (-#{maiden_name})" if maiden_name.present?
end
end
end
| Add composed attribute family_name to SwissMatch::Address | Add composed attribute family_name to SwissMatch::Address
Adds a #family_name method to the SwissMatch::Address appending
the maiden_name to the last_name if available. This is similar
to the composed #street attribute.
| Ruby | bsd-2-clause | apeiros/swissmatch-directories | ruby | ## Code Before:
module SwissMatch
# Represents a swiss address. Used by directory service interfaces to return search
# results.
Address = Struct.new(:gender, :first_name, :last_name, :maiden_name, :street_name, :street_number, :zip_code, :city) do
def street
[street_name,street_number].compact.join(" ")
end
end
end
## Instruction:
Add composed attribute family_name to SwissMatch::Address
Adds a #family_name method to the SwissMatch::Address appending
the maiden_name to the last_name if available. This is similar
to the composed #street attribute.
## Code After:
module SwissMatch
# Represents a swiss address. Used by directory service interfaces to return search
# results.
Address = Struct.new(:gender, :first_name, :last_name, :maiden_name, :street_name, :street_number, :zip_code, :city) do
def street
[street_name,street_number].compact.join(" ")
end
# Full family name including the maiden name
def family_name
name = last_name
name += " (-#{maiden_name})" if maiden_name.present?
end
end
end
|
module SwissMatch
# Represents a swiss address. Used by directory service interfaces to return search
# results.
Address = Struct.new(:gender, :first_name, :last_name, :maiden_name, :street_name, :street_number, :zip_code, :city) do
def street
[street_name,street_number].compact.join(" ")
end
+
+ # Full family name including the maiden name
+ def family_name
+ name = last_name
+ name += " (-#{maiden_name})" if maiden_name.present?
+ end
end
end | 6 | 0.461538 | 6 | 0 |
bc02f7af09b60f896d029be40a8c188a685d2e7e | .travis.yml | .travis.yml | language: php
sudo: false
env:
global:
- COVERALLS=0
- PHPCS=0
matrix:
include:
- php: 5.3
- php: 5.4
env: COVERALLS=1 PHPCS=1
- php: 5.5
- php: 5.6
- php: 7
- php: hhvm
# - php: 5.4
# env: PHPCS=0 DEFAULT=1
allow_failures:
# allow failure for Php > 5.6
- php: 7
- php: hhvm
fast_finish: true
install:
composer install --prefer-source
script:
# - sh -c "if [ '$DEFAULT' = '1' ]; then ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; else ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=PSR2 ./src ./tests ; fi"
after_script:
- sh -c "if [ '$COVERALLS' = '1' ]; then vendor/bin/coveralls ; fi"
| language: php
sudo: false
env:
global:
- COVERALLS=0
- PHPCS=0
matrix:
include:
- php: 5.3
- php: 5.4
env: COVERALLS=1 PHPCS=1
- php: 5.5
- php: 5.6
- php: 7
- php: hhvm
# - php: 5.4
# env: PHPCS=0 DEFAULT=1
allow_failures:
# allow failure for Php > 5.6
- php: 7
- php: hhvm
fast_finish: true
install:
composer install --prefer-source
script:
- sh -c "if [ '$COVERALLS' = '1' ]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; else ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=PSR2 ./src ./tests ; fi"
after_script:
- sh -c "if [ '$COVERALLS' = '1' ]; then vendor/bin/coveralls ; fi"
| Remove unnecessary line in script | Remove unnecessary line in script | YAML | mit | theorchard/monolog-cascade,dmnc/monolog-cascade,djmattyg007/monolog-cascade | yaml | ## Code Before:
language: php
sudo: false
env:
global:
- COVERALLS=0
- PHPCS=0
matrix:
include:
- php: 5.3
- php: 5.4
env: COVERALLS=1 PHPCS=1
- php: 5.5
- php: 5.6
- php: 7
- php: hhvm
# - php: 5.4
# env: PHPCS=0 DEFAULT=1
allow_failures:
# allow failure for Php > 5.6
- php: 7
- php: hhvm
fast_finish: true
install:
composer install --prefer-source
script:
# - sh -c "if [ '$DEFAULT' = '1' ]; then ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; else ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=PSR2 ./src ./tests ; fi"
after_script:
- sh -c "if [ '$COVERALLS' = '1' ]; then vendor/bin/coveralls ; fi"
## Instruction:
Remove unnecessary line in script
## Code After:
language: php
sudo: false
env:
global:
- COVERALLS=0
- PHPCS=0
matrix:
include:
- php: 5.3
- php: 5.4
env: COVERALLS=1 PHPCS=1
- php: 5.5
- php: 5.6
- php: 7
- php: hhvm
# - php: 5.4
# env: PHPCS=0 DEFAULT=1
allow_failures:
# allow failure for Php > 5.6
- php: 7
- php: hhvm
fast_finish: true
install:
composer install --prefer-source
script:
- sh -c "if [ '$COVERALLS' = '1' ]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; else ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=PSR2 ./src ./tests ; fi"
after_script:
- sh -c "if [ '$COVERALLS' = '1' ]; then vendor/bin/coveralls ; fi"
| language: php
sudo: false
env:
global:
- COVERALLS=0
- PHPCS=0
matrix:
include:
- php: 5.3
- php: 5.4
env: COVERALLS=1 PHPCS=1
- php: 5.5
- php: 5.6
- php: 7
- php: hhvm
# - php: 5.4
# env: PHPCS=0 DEFAULT=1
allow_failures:
# allow failure for Php > 5.6
- php: 7
- php: hhvm
fast_finish: true
install:
composer install --prefer-source
script:
- # - sh -c "if [ '$DEFAULT' = '1' ]; then ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; else ./vendor/bin/phpunit ; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=PSR2 ./src ./tests ; fi"
after_script:
- sh -c "if [ '$COVERALLS' = '1' ]; then vendor/bin/coveralls ; fi" | 1 | 0.027027 | 0 | 1 |
0cb5f0b0e633e452cae1ec1eaf84796349e77acd | src/app/exporter/exporter.component.ts | src/app/exporter/exporter.component.ts | import { Component } from '@angular/core';
import { ChartFileExporterService } from '../chart-file/exporter/chart-file-exporter.service';
@Component({
selector: 'app-exporter',
templateUrl: './exporter.component.html',
styleUrls: ['./exporter.component.css'],
})
export class ExporterComponent {
constructor(public chartFileExporter: ChartFileExporterService) {
}
exportChart() {
const chartString = this.chartFileExporter.export();
const filename = 'notes.chart';
const chart = new File([chartString], filename, { type: 'text/plain' });
const url = window.URL.createObjectURL(chart);
const link = document.createElement('a');
link.setAttribute('style', 'display: none');
link.setAttribute('href', url);
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url);
}
}
| import { Component } from '@angular/core';
import { ChartFileExporterService } from '../chart-file/exporter/chart-file-exporter.service';
@Component({
selector: 'app-exporter',
templateUrl: './exporter.component.html',
styleUrls: ['./exporter.component.css'],
})
export class ExporterComponent {
constructor(public chartFileExporter: ChartFileExporterService) {
}
exportChart() {
const chartString = this.chartFileExporter.export();
const datetime = new Date()
.toISOString()
.replace(/:/g, '-')
.split('.')[0];
const filename = `notes-${datetime}.chart`;
const chart = new File([chartString], filename, { type: 'text/plain' });
const url = window.URL.createObjectURL(chart);
const link = document.createElement('a');
link.setAttribute('style', 'display: none');
link.setAttribute('href', url);
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url);
}
}
| Add timestamps to output files | feat: Add timestamps to output files
| TypeScript | mit | nb48/chart-hero,nb48/chart-hero,nb48/chart-hero | typescript | ## Code Before:
import { Component } from '@angular/core';
import { ChartFileExporterService } from '../chart-file/exporter/chart-file-exporter.service';
@Component({
selector: 'app-exporter',
templateUrl: './exporter.component.html',
styleUrls: ['./exporter.component.css'],
})
export class ExporterComponent {
constructor(public chartFileExporter: ChartFileExporterService) {
}
exportChart() {
const chartString = this.chartFileExporter.export();
const filename = 'notes.chart';
const chart = new File([chartString], filename, { type: 'text/plain' });
const url = window.URL.createObjectURL(chart);
const link = document.createElement('a');
link.setAttribute('style', 'display: none');
link.setAttribute('href', url);
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url);
}
}
## Instruction:
feat: Add timestamps to output files
## Code After:
import { Component } from '@angular/core';
import { ChartFileExporterService } from '../chart-file/exporter/chart-file-exporter.service';
@Component({
selector: 'app-exporter',
templateUrl: './exporter.component.html',
styleUrls: ['./exporter.component.css'],
})
export class ExporterComponent {
constructor(public chartFileExporter: ChartFileExporterService) {
}
exportChart() {
const chartString = this.chartFileExporter.export();
const datetime = new Date()
.toISOString()
.replace(/:/g, '-')
.split('.')[0];
const filename = `notes-${datetime}.chart`;
const chart = new File([chartString], filename, { type: 'text/plain' });
const url = window.URL.createObjectURL(chart);
const link = document.createElement('a');
link.setAttribute('style', 'display: none');
link.setAttribute('href', url);
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url);
}
}
| import { Component } from '@angular/core';
import { ChartFileExporterService } from '../chart-file/exporter/chart-file-exporter.service';
@Component({
selector: 'app-exporter',
templateUrl: './exporter.component.html',
styleUrls: ['./exporter.component.css'],
})
export class ExporterComponent {
constructor(public chartFileExporter: ChartFileExporterService) {
}
exportChart() {
const chartString = this.chartFileExporter.export();
+ const datetime = new Date()
+ .toISOString()
+ .replace(/:/g, '-')
+ .split('.')[0];
- const filename = 'notes.chart';
? ^ ^
+ const filename = `notes-${datetime}.chart`;
? ^ ++++++++++++ ^
const chart = new File([chartString], filename, { type: 'text/plain' });
const url = window.URL.createObjectURL(chart);
const link = document.createElement('a');
link.setAttribute('style', 'display: none');
link.setAttribute('href', url);
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url);
}
} | 6 | 0.214286 | 5 | 1 |
dc65920f52ca584608633cc511590b41b590f79e | billjobs/permissions.py | billjobs/permissions.py | from rest_framework import permissions
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define permission based on request method
"""
if request.method == 'GET':
# admin only
return request.user and request.user.is_staff
elif request.method == 'POST':
# is public
return True
# all other methods are accepted to allow 405 response
return True
| from rest_framework import permissions
from rest_framework.compat import is_authenticated
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define permission based on request method
"""
if request.method == 'GET':
# admin only
return request.user and request.user.is_staff
elif request.method == 'POST':
# is public
return True
# all other methods are accepted to allow 405 response
return True
class CustomUserDetailAPIPermission(permissions.BasePermission):
"""
Set custom permission for user detail API
* GET, PUT, DELETE :
* admin can access all users instance
* current user only his instance
* public is forbidden
"""
def has_permission(self, request, view):
"""
Give permission for admin or user to access API
"""
return (
request.user and
request.user.is_staff or
is_authenticated(request.user)
)
def has_object_permission(self, request, view, obj):
"""
Compare User instance in request is equal to User instance in obj
"""
return request.user.is_staff or obj == request.user
| Create permission for admin and user can access GET, PUT, DELETE method, user can access is instance only | Create permission for admin and user can access GET, PUT, DELETE method, user can access is instance only
| Python | mit | ioO/billjobs | python | ## Code Before:
from rest_framework import permissions
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define permission based on request method
"""
if request.method == 'GET':
# admin only
return request.user and request.user.is_staff
elif request.method == 'POST':
# is public
return True
# all other methods are accepted to allow 405 response
return True
## Instruction:
Create permission for admin and user can access GET, PUT, DELETE method, user can access is instance only
## Code After:
from rest_framework import permissions
from rest_framework.compat import is_authenticated
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define permission based on request method
"""
if request.method == 'GET':
# admin only
return request.user and request.user.is_staff
elif request.method == 'POST':
# is public
return True
# all other methods are accepted to allow 405 response
return True
class CustomUserDetailAPIPermission(permissions.BasePermission):
"""
Set custom permission for user detail API
* GET, PUT, DELETE :
* admin can access all users instance
* current user only his instance
* public is forbidden
"""
def has_permission(self, request, view):
"""
Give permission for admin or user to access API
"""
return (
request.user and
request.user.is_staff or
is_authenticated(request.user)
)
def has_object_permission(self, request, view, obj):
"""
Compare User instance in request is equal to User instance in obj
"""
return request.user.is_staff or obj == request.user
| from rest_framework import permissions
+ from rest_framework.compat import is_authenticated
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(self, request, view):
"""
Define permission based on request method
"""
if request.method == 'GET':
# admin only
return request.user and request.user.is_staff
elif request.method == 'POST':
# is public
return True
# all other methods are accepted to allow 405 response
return True
+
+ class CustomUserDetailAPIPermission(permissions.BasePermission):
+ """
+ Set custom permission for user detail API
+
+ * GET, PUT, DELETE :
+ * admin can access all users instance
+ * current user only his instance
+ * public is forbidden
+ """
+ def has_permission(self, request, view):
+ """
+ Give permission for admin or user to access API
+ """
+ return (
+ request.user and
+ request.user.is_staff or
+ is_authenticated(request.user)
+ )
+
+ def has_object_permission(self, request, view, obj):
+ """
+ Compare User instance in request is equal to User instance in obj
+ """
+ return request.user.is_staff or obj == request.user | 26 | 1.130435 | 26 | 0 |
73108517fcc288e785c3cfefeece8abae99386f7 | test/suites/fdleak.sh | test/suites/fdleak.sh | test_fdleak() {
LXD_FDLEAK_DIR=$(mktemp -d -p ${TEST_DIR} XXX)
chmod +x ${LXD_FDLEAK_DIR}
spawn_lxd ${LXD_FDLEAK_DIR}
pid=$(cat ${LXD_FDLEAK_DIR}/lxd.pid)
beforefds=`/bin/ls /proc/${pid}/fd | wc -l`
(
set -e
LXD_DIR=$LXD_FDLEAK_DIR
ensure_import_testimage
for i in `seq 5`; do
lxc init testimage leaktest1
lxc info leaktest1
if [ -z "${TRAVIS_PULL_REQUEST:-}" ]; then
lxc start leaktest1
lxc exec leaktest1 -- ps -ef
lxc stop leaktest1 --force
fi
lxc delete leaktest1
done
exit 0
)
afterfds=`/bin/ls /proc/${pid}/fd | wc -l`
leakedfds=$((afterfds - beforefds))
bad=0
[ ${leakedfds} -gt 5 ] && bad=1 || true
if [ ${bad} -eq 1 ]; then
echo "${leakedfds} FDS leaked"
ls /proc/${pid}/fd -al
false
fi
kill_lxd ${LXD_FDLEAK_DIR}
}
| test_fdleak() {
LXD_FDLEAK_DIR=$(mktemp -d -p ${TEST_DIR} XXX)
chmod +x ${LXD_FDLEAK_DIR}
spawn_lxd ${LXD_FDLEAK_DIR}
pid=$(cat ${LXD_FDLEAK_DIR}/lxd.pid)
beforefds=`/bin/ls /proc/${pid}/fd | wc -l`
(
set -e
LXD_DIR=$LXD_FDLEAK_DIR
ensure_import_testimage
for i in `seq 5`; do
lxc init testimage leaktest1
lxc info leaktest1
if [ -z "${TRAVIS_PULL_REQUEST:-}" ]; then
lxc start leaktest1
lxc exec leaktest1 -- ps -ef
lxc stop leaktest1 --force
fi
lxc delete leaktest1
done
exit 0
)
afterfds=`/bin/ls /proc/${pid}/fd | wc -l`
leakedfds=$((afterfds - beforefds))
bad=0
[ ${leakedfds} -gt 5 ] && bad=1 || true
if [ ${bad} -eq 1 ]; then
echo "${leakedfds} FDS leaked"
ls /proc/${pid}/fd -al
netstat -anp 2>&1 | grep ${pid}/
false
fi
kill_lxd ${LXD_FDLEAK_DIR}
}
| Print netstat on fd leak | tests: Print netstat on fd leak
Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com>
| Shell | apache-2.0 | stgraber/lxd,georghopp/lxd,mjeanson/lxd,Malizor/lxd,stgraber/lxd,techtonik/lxd,hallyn/lxd,ollie314/lxd,dustinkirkland/lxd,pcdummy/lxd,stgraber/lxd,chrisglass/lxd,Malizor/lxd,Skarlso/lxd,georghopp/lxd,hallyn/lxd,pcdummy/lxd,georghopp/lxd,akshaykarle/lxd,ollie314/lxd,yura-pakhuchiy/lxd,yura-pakhuchiy/lxd,erikmack/lxd,dustinkirkland/lxd,pcdummy/lxd,lxc/lxd,jsavikko/lxd,ericsnowcurrently/lxd,Skarlso/lxd,mjeanson/lxd,dustinkirkland/lxd,atxwebs/lxd,hallyn/lxd,achanda/lxd,achanda/lxd,atxwebs/lxd,atxwebs/lxd,lxc/lxd,erikmack/lxd,jsavikko/lxd,achanda/lxd,chrisglass/lxd,hallyn/lxd,ericsnowcurrently/lxd,Skarlso/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,hallyn/lxd,stgraber/lxd,stgraber/lxd,hallyn/lxd,Malizor/lxd,Skarlso/lxd,akshaykarle/lxd,ollie314/lxd,techtonik/lxd,lxc/lxd,lxc/lxd,erikmack/lxd,yura-pakhuchiy/lxd,lxc/lxd,chrisglass/lxd,atxwebs/lxd,lxc/lxd,akshaykarle/lxd,mjeanson/lxd,jsavikko/lxd,techtonik/lxd,ericsnowcurrently/lxd | shell | ## Code Before:
test_fdleak() {
LXD_FDLEAK_DIR=$(mktemp -d -p ${TEST_DIR} XXX)
chmod +x ${LXD_FDLEAK_DIR}
spawn_lxd ${LXD_FDLEAK_DIR}
pid=$(cat ${LXD_FDLEAK_DIR}/lxd.pid)
beforefds=`/bin/ls /proc/${pid}/fd | wc -l`
(
set -e
LXD_DIR=$LXD_FDLEAK_DIR
ensure_import_testimage
for i in `seq 5`; do
lxc init testimage leaktest1
lxc info leaktest1
if [ -z "${TRAVIS_PULL_REQUEST:-}" ]; then
lxc start leaktest1
lxc exec leaktest1 -- ps -ef
lxc stop leaktest1 --force
fi
lxc delete leaktest1
done
exit 0
)
afterfds=`/bin/ls /proc/${pid}/fd | wc -l`
leakedfds=$((afterfds - beforefds))
bad=0
[ ${leakedfds} -gt 5 ] && bad=1 || true
if [ ${bad} -eq 1 ]; then
echo "${leakedfds} FDS leaked"
ls /proc/${pid}/fd -al
false
fi
kill_lxd ${LXD_FDLEAK_DIR}
}
## Instruction:
tests: Print netstat on fd leak
Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com>
## Code After:
test_fdleak() {
LXD_FDLEAK_DIR=$(mktemp -d -p ${TEST_DIR} XXX)
chmod +x ${LXD_FDLEAK_DIR}
spawn_lxd ${LXD_FDLEAK_DIR}
pid=$(cat ${LXD_FDLEAK_DIR}/lxd.pid)
beforefds=`/bin/ls /proc/${pid}/fd | wc -l`
(
set -e
LXD_DIR=$LXD_FDLEAK_DIR
ensure_import_testimage
for i in `seq 5`; do
lxc init testimage leaktest1
lxc info leaktest1
if [ -z "${TRAVIS_PULL_REQUEST:-}" ]; then
lxc start leaktest1
lxc exec leaktest1 -- ps -ef
lxc stop leaktest1 --force
fi
lxc delete leaktest1
done
exit 0
)
afterfds=`/bin/ls /proc/${pid}/fd | wc -l`
leakedfds=$((afterfds - beforefds))
bad=0
[ ${leakedfds} -gt 5 ] && bad=1 || true
if [ ${bad} -eq 1 ]; then
echo "${leakedfds} FDS leaked"
ls /proc/${pid}/fd -al
netstat -anp 2>&1 | grep ${pid}/
false
fi
kill_lxd ${LXD_FDLEAK_DIR}
}
| test_fdleak() {
LXD_FDLEAK_DIR=$(mktemp -d -p ${TEST_DIR} XXX)
chmod +x ${LXD_FDLEAK_DIR}
spawn_lxd ${LXD_FDLEAK_DIR}
pid=$(cat ${LXD_FDLEAK_DIR}/lxd.pid)
beforefds=`/bin/ls /proc/${pid}/fd | wc -l`
(
set -e
LXD_DIR=$LXD_FDLEAK_DIR
ensure_import_testimage
for i in `seq 5`; do
lxc init testimage leaktest1
lxc info leaktest1
if [ -z "${TRAVIS_PULL_REQUEST:-}" ]; then
lxc start leaktest1
lxc exec leaktest1 -- ps -ef
lxc stop leaktest1 --force
fi
lxc delete leaktest1
done
exit 0
)
afterfds=`/bin/ls /proc/${pid}/fd | wc -l`
leakedfds=$((afterfds - beforefds))
bad=0
[ ${leakedfds} -gt 5 ] && bad=1 || true
if [ ${bad} -eq 1 ]; then
echo "${leakedfds} FDS leaked"
ls /proc/${pid}/fd -al
+ netstat -anp 2>&1 | grep ${pid}/
false
fi
kill_lxd ${LXD_FDLEAK_DIR}
} | 1 | 0.025641 | 1 | 0 |
79b7d0cbc4605d7dcc3e219680c8f1e46a5ce207 | pybb/templates/pybb/forum_last_update_info.html | pybb/templates/pybb/forum_last_update_info.html | {% if forum.updated %}
{{ forum.updated|date:"d.m.Y H:i" }}
{% endif %} | {% load pybb_tags %}
{% if forum.updated %}
{% pybb_time forum.updated %}
{% endif %}
| Use the pybb_time tag in the list of topics | Use the pybb_time tag in the list of topics
| HTML | bsd-2-clause | hovel/pybbm,hovel/pybbm,webu/pybbm,artfinder/pybbm,artfinder/pybbm,artfinder/pybbm,webu/pybbm,webu/pybbm,hovel/pybbm | html | ## Code Before:
{% if forum.updated %}
{{ forum.updated|date:"d.m.Y H:i" }}
{% endif %}
## Instruction:
Use the pybb_time tag in the list of topics
## Code After:
{% load pybb_tags %}
{% if forum.updated %}
{% pybb_time forum.updated %}
{% endif %}
| + {% load pybb_tags %}
+
{% if forum.updated %}
- {{ forum.updated|date:"d.m.Y H:i" }}
+ {% pybb_time forum.updated %}
{% endif %} | 4 | 1.333333 | 3 | 1 |
beee26fde4a070b64dee67e74c490e7ab0dc001b | layers/+vim/programming/packages.vim | layers/+vim/programming/packages.vim | Plug 'luochen1990/rainbow'
Plug 'scrooloose/nerdcommenter'
Plug 'Chiel92/vim-autoformat'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'skywind3000/asyncrun.vim', { 'on': ['AsyncRun!', 'AsyncRun'] }
Plug 'nathanaelkane/vim-indent-guides', { 'on': 'IndentGuidesToggle'}
if executable('ctags')
" Do not lazy loading tagbar, see vim-airline issue 1313.
Plug 'majutsushi/tagbar'
endif
| Plug 'luochen1990/rainbow'
Plug 'scrooloose/nerdcommenter'
Plug 'Chiel92/vim-autoformat'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'skywind3000/asyncrun.vim', { 'on': ['AsyncRun!', 'AsyncRun'] }
Plug 'nathanaelkane/vim-indent-guides', { 'on': 'IndentGuidesToggle'}
Plug 'editorconfig/editorconfig-vim'
if executable('ctags')
" Do not lazy loading tagbar, see vim-airline issue 1313.
Plug 'majutsushi/tagbar'
endif
| Add editorconfig-vim to programming layer | Add editorconfig-vim to programming layer
| VimL | mit | liuchengxu/space-vim,liuchengxu/space-vim | viml | ## Code Before:
Plug 'luochen1990/rainbow'
Plug 'scrooloose/nerdcommenter'
Plug 'Chiel92/vim-autoformat'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'skywind3000/asyncrun.vim', { 'on': ['AsyncRun!', 'AsyncRun'] }
Plug 'nathanaelkane/vim-indent-guides', { 'on': 'IndentGuidesToggle'}
if executable('ctags')
" Do not lazy loading tagbar, see vim-airline issue 1313.
Plug 'majutsushi/tagbar'
endif
## Instruction:
Add editorconfig-vim to programming layer
## Code After:
Plug 'luochen1990/rainbow'
Plug 'scrooloose/nerdcommenter'
Plug 'Chiel92/vim-autoformat'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'skywind3000/asyncrun.vim', { 'on': ['AsyncRun!', 'AsyncRun'] }
Plug 'nathanaelkane/vim-indent-guides', { 'on': 'IndentGuidesToggle'}
Plug 'editorconfig/editorconfig-vim'
if executable('ctags')
" Do not lazy loading tagbar, see vim-airline issue 1313.
Plug 'majutsushi/tagbar'
endif
| Plug 'luochen1990/rainbow'
Plug 'scrooloose/nerdcommenter'
Plug 'Chiel92/vim-autoformat'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'skywind3000/asyncrun.vim', { 'on': ['AsyncRun!', 'AsyncRun'] }
Plug 'nathanaelkane/vim-indent-guides', { 'on': 'IndentGuidesToggle'}
+ Plug 'editorconfig/editorconfig-vim'
if executable('ctags')
" Do not lazy loading tagbar, see vim-airline issue 1313.
Plug 'majutsushi/tagbar'
endif
| 1 | 0.066667 | 1 | 0 |
e9b9562a60d69c57251e6d3a12424bb357f527b3 | .travis.yml | .travis.yml | language: python
python:
- 2.7
- 3.4
- 3.5
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
install:
- pip install Cython
- pip install numpy
- pip install matplotlib
- pip install iminuit
- pip install pytest pytest-cov pytest-mpl
# ipython needed for docs: IPython.sphinxext.ipython_directive
- pip install ipython sphinx sphinx_rtd_theme
script:
- python setup.py build_ext -i
- python -m pytest
- python -m pytest --mpl tests/test_plotting.py
- cd doc && make html
| language: python
python:
- 2.7
- 3.4
- 3.5
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
install:
- pip install Cython
- pip install numpy
- pip install matplotlib
- pip install iminuit
- pip install pytest pytest-cov pytest-mpl
- pip install pylint
# ipython needed for docs: IPython.sphinxext.ipython_directive
- pip install ipython sphinx sphinx_rtd_theme
script:
- make flake8
- make pylint
- make test
- cd doc && make html
| Use Makefile target in CI tests. | Use Makefile target in CI tests.
Also run start running pylint again. | YAML | mit | iminuit/probfit,iminuit/probfit | yaml | ## Code Before:
language: python
python:
- 2.7
- 3.4
- 3.5
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
install:
- pip install Cython
- pip install numpy
- pip install matplotlib
- pip install iminuit
- pip install pytest pytest-cov pytest-mpl
# ipython needed for docs: IPython.sphinxext.ipython_directive
- pip install ipython sphinx sphinx_rtd_theme
script:
- python setup.py build_ext -i
- python -m pytest
- python -m pytest --mpl tests/test_plotting.py
- cd doc && make html
## Instruction:
Use Makefile target in CI tests.
Also run start running pylint again.
## Code After:
language: python
python:
- 2.7
- 3.4
- 3.5
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
install:
- pip install Cython
- pip install numpy
- pip install matplotlib
- pip install iminuit
- pip install pytest pytest-cov pytest-mpl
- pip install pylint
# ipython needed for docs: IPython.sphinxext.ipython_directive
- pip install ipython sphinx sphinx_rtd_theme
script:
- make flake8
- make pylint
- make test
- cd doc && make html
| language: python
python:
- 2.7
- 3.4
- 3.5
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
install:
- pip install Cython
- pip install numpy
- pip install matplotlib
- pip install iminuit
- pip install pytest pytest-cov pytest-mpl
+ - pip install pylint
# ipython needed for docs: IPython.sphinxext.ipython_directive
- pip install ipython sphinx sphinx_rtd_theme
script:
- - python setup.py build_ext -i
- - python -m pytest
- - python -m pytest --mpl tests/test_plotting.py
+ - make flake8
+ - make pylint
+ - make test
- cd doc && make html | 7 | 0.259259 | 4 | 3 |
9b774ae7e5725ffbf3f8f0780b67d1f7e5bff98d | ircelsos/sos.py | ircelsos/sos.py | from __future__ import print_function
from owslib.sos import SensorObservationService
BASE_URL = 'http://sos.irceline.be/sos'
def get_sos():
"""Return a SensorObservationService instance"""
return SensorObservationService(BASE_URL)
| from __future__ import print_function
import sys
import os
import datetime
from xml.etree import ElementTree
import requests
from owslib.sos import SensorObservationService
BASE_URL = 'http://sos.irceline.be/sos'
def get_sos():
"""Return a SensorObservationService instance"""
data_dir = ircelsos_data_dir()
if not os.path.exists(data_dir):
os.makedirs(data_dir)
xml_file = os.path.join(data_dir, 'capabilities.xml')
if os.path.isfile(xml_file):
xml = file(xml_file).read()
adapted = datetime.datetime.fromtimestamp(os.path.getmtime(xml_file))
outdated = (datetime.datetime.now() - adapted) > datetime.timedelta(1)
else:
xml = None
outdated = True
if not outdated:
sos = SensorObservationService(BASE_URL, xml=xml)
else:
try:
sos = SensorObservationService(BASE_URL)
except requests.ConnectionError:
sos = SensorObservationService(BASE_URL, xml=xml)
else:
with open(xml_file, 'w') as xml:
xml.write(ElementTree.tostring(sos._capabilities))
return sos
def ircelsos_data_dir():
"""Get the data directory
Adapted from jupyter_core
"""
home = os.path.expanduser('~')
if sys.platform == 'darwin':
return os.path.join(home, 'Library', 'ircelsos')
elif os.name == 'nt':
appdata = os.environ.get('APPDATA', os.path.join(home, '.local', 'share'))
return os.path.join(appdata, 'ircelsos')
else:
# Linux, non-OS X Unix, AIX, etc.
xdg = os.environ.get("XDG_DATA_HOME", os.path.join(home, '.local', 'share'))
return os.path.join(xdg, 'ircelsos')
| Enable offline import + save capabilities xml for reuse | Enable offline import + save capabilities xml for reuse
| Python | bsd-2-clause | jorisvandenbossche/ircelsos | python | ## Code Before:
from __future__ import print_function
from owslib.sos import SensorObservationService
BASE_URL = 'http://sos.irceline.be/sos'
def get_sos():
"""Return a SensorObservationService instance"""
return SensorObservationService(BASE_URL)
## Instruction:
Enable offline import + save capabilities xml for reuse
## Code After:
from __future__ import print_function
import sys
import os
import datetime
from xml.etree import ElementTree
import requests
from owslib.sos import SensorObservationService
BASE_URL = 'http://sos.irceline.be/sos'
def get_sos():
"""Return a SensorObservationService instance"""
data_dir = ircelsos_data_dir()
if not os.path.exists(data_dir):
os.makedirs(data_dir)
xml_file = os.path.join(data_dir, 'capabilities.xml')
if os.path.isfile(xml_file):
xml = file(xml_file).read()
adapted = datetime.datetime.fromtimestamp(os.path.getmtime(xml_file))
outdated = (datetime.datetime.now() - adapted) > datetime.timedelta(1)
else:
xml = None
outdated = True
if not outdated:
sos = SensorObservationService(BASE_URL, xml=xml)
else:
try:
sos = SensorObservationService(BASE_URL)
except requests.ConnectionError:
sos = SensorObservationService(BASE_URL, xml=xml)
else:
with open(xml_file, 'w') as xml:
xml.write(ElementTree.tostring(sos._capabilities))
return sos
def ircelsos_data_dir():
"""Get the data directory
Adapted from jupyter_core
"""
home = os.path.expanduser('~')
if sys.platform == 'darwin':
return os.path.join(home, 'Library', 'ircelsos')
elif os.name == 'nt':
appdata = os.environ.get('APPDATA', os.path.join(home, '.local', 'share'))
return os.path.join(appdata, 'ircelsos')
else:
# Linux, non-OS X Unix, AIX, etc.
xdg = os.environ.get("XDG_DATA_HOME", os.path.join(home, '.local', 'share'))
return os.path.join(xdg, 'ircelsos')
| from __future__ import print_function
+ import sys
+ import os
+ import datetime
+ from xml.etree import ElementTree
+
+ import requests
from owslib.sos import SensorObservationService
BASE_URL = 'http://sos.irceline.be/sos'
def get_sos():
"""Return a SensorObservationService instance"""
+ data_dir = ircelsos_data_dir()
+ if not os.path.exists(data_dir):
+ os.makedirs(data_dir)
+ xml_file = os.path.join(data_dir, 'capabilities.xml')
+
+ if os.path.isfile(xml_file):
+ xml = file(xml_file).read()
+ adapted = datetime.datetime.fromtimestamp(os.path.getmtime(xml_file))
+ outdated = (datetime.datetime.now() - adapted) > datetime.timedelta(1)
+ else:
+ xml = None
+ outdated = True
+
+ if not outdated:
+ sos = SensorObservationService(BASE_URL, xml=xml)
+ else:
+ try:
- return SensorObservationService(BASE_URL)
? ^^^^^^
+ sos = SensorObservationService(BASE_URL)
? ^^^^^^^^^^^^^
+ except requests.ConnectionError:
+ sos = SensorObservationService(BASE_URL, xml=xml)
+ else:
+ with open(xml_file, 'w') as xml:
+ xml.write(ElementTree.tostring(sos._capabilities))
+ return sos
+
+
+ def ircelsos_data_dir():
+ """Get the data directory
+
+ Adapted from jupyter_core
+ """
+ home = os.path.expanduser('~')
+
+ if sys.platform == 'darwin':
+ return os.path.join(home, 'Library', 'ircelsos')
+ elif os.name == 'nt':
+ appdata = os.environ.get('APPDATA', os.path.join(home, '.local', 'share'))
+ return os.path.join(appdata, 'ircelsos')
+ else:
+ # Linux, non-OS X Unix, AIX, etc.
+ xdg = os.environ.get("XDG_DATA_HOME", os.path.join(home, '.local', 'share'))
+ return os.path.join(xdg, 'ircelsos') | 49 | 4.083333 | 48 | 1 |
41b850ca7121b86bd1c361e3cc039d24089d7620 | plugins/plugins.yml | plugins/plugins.yml |
plugins:
loomio_webhooks:
repo: loomio/loomio_webhooks
version: master
loomio_org:
repo: loomio/loomio_org
version: master
|
plugins:
loomio_webhooks:
repo: loomio/loomio_webhooks
version: master
loomio_org_plugin:
repo: loomio/loomio_org_plugin
version: master
| Move to new repository name | Move to new repository name
| YAML | agpl-3.0 | loomio/loomio,sicambria/loomio,loomio/loomio,sicambria/loomio,piratas-ar/loomio,piratas-ar/loomio,sicambria/loomio,loomio/loomio,loomio/loomio,sicambria/loomio,piratas-ar/loomio,piratas-ar/loomio | yaml | ## Code Before:
plugins:
loomio_webhooks:
repo: loomio/loomio_webhooks
version: master
loomio_org:
repo: loomio/loomio_org
version: master
## Instruction:
Move to new repository name
## Code After:
plugins:
loomio_webhooks:
repo: loomio/loomio_webhooks
version: master
loomio_org_plugin:
repo: loomio/loomio_org_plugin
version: master
|
plugins:
loomio_webhooks:
repo: loomio/loomio_webhooks
version: master
- loomio_org:
+ loomio_org_plugin:
? +++++++
- repo: loomio/loomio_org
+ repo: loomio/loomio_org_plugin
? +++++++
version: master | 4 | 0.444444 | 2 | 2 |
d9836c141784b3e73db0c1c08660d2673bcb0bae | merb-haml/lib/merb-haml/template.rb | merb-haml/lib/merb-haml/template.rb | module Merb::Template
class Haml
def self.compile_template(path, name, mod)
path = File.expand_path(path)
config = (Merb.config[:haml] || {}).inject({}) do |c, (k, v)|
c[k.to_sym] = v
c
end.merge :filename => path
template = ::Haml::Engine.new(File.read(path), config)
template.def_method(mod, name)
name
end
module Mixin
def concat_haml(string, binding)
haml_buffer(binding).buffer << string
end
end
Merb::Template.register_extensions(self, %w[haml])
end
end
module Haml
class Engine
def def_method(object, name, *local_names)
method = object.is_a?(Module) ? :module_eval : :instance_eval
setup = "@_engine = 'haml'"
object.send(method, "def #{name}(_haml_locals = {}); #{setup}; #{precompiled_with_ambles(local_names)}; end",
@options[:filename], 0)
end
end
end
module Haml::Helpers
# Gets the buffer object for the haml instance
# identified in binding
def haml_buffer(binding)
eval("buffer", binding)
end
end
| module Merb::Template
class Haml
def self.compile_template(path, name, mod)
path = File.expand_path(path)
config = (Merb.config[:haml] || {}).inject({}) do |c, (k, v)|
c[k.to_sym] = v
c
end.merge :filename => path
template = ::Haml::Engine.new(File.read(path), config)
template.def_method(mod, name)
name
end
module Mixin
# Note that the binding here is not used, but is necessary to conform to
# the concat_* interface.
def concat_haml(string, binding)
haml_buffer.buffer << string
end
end
Merb::Template.register_extensions(self, %w[haml])
end
end
module Haml
class Engine
def def_method(object, name, *local_names)
method = object.is_a?(Module) ? :module_eval : :instance_eval
setup = "@_engine = 'haml'"
object.send(method, "def #{name}(_haml_locals = {}); #{setup}; #{precompiled_with_ambles(local_names)}; end",
@options[:filename], 0)
end
end
end
| Revert "Adds a haml_buffer method to Haml::Helpers. This was reporting being missing when using haml in a form." | Revert "Adds a haml_buffer method to Haml::Helpers. This was reporting being missing when using haml in a form."
This reverts commit 92c5b539c4bccebbc4b31ef9feb9e67dfd37fd6b.
See http://merb.lighthouseapp.com/projects/7435/tickets/72
| Ruby | mit | merb/merb,wycats/merb,merb/merb,wycats/merb,merb/merb,wycats/merb,wycats/merb,wycats/merb | ruby | ## Code Before:
module Merb::Template
class Haml
def self.compile_template(path, name, mod)
path = File.expand_path(path)
config = (Merb.config[:haml] || {}).inject({}) do |c, (k, v)|
c[k.to_sym] = v
c
end.merge :filename => path
template = ::Haml::Engine.new(File.read(path), config)
template.def_method(mod, name)
name
end
module Mixin
def concat_haml(string, binding)
haml_buffer(binding).buffer << string
end
end
Merb::Template.register_extensions(self, %w[haml])
end
end
module Haml
class Engine
def def_method(object, name, *local_names)
method = object.is_a?(Module) ? :module_eval : :instance_eval
setup = "@_engine = 'haml'"
object.send(method, "def #{name}(_haml_locals = {}); #{setup}; #{precompiled_with_ambles(local_names)}; end",
@options[:filename], 0)
end
end
end
module Haml::Helpers
# Gets the buffer object for the haml instance
# identified in binding
def haml_buffer(binding)
eval("buffer", binding)
end
end
## Instruction:
Revert "Adds a haml_buffer method to Haml::Helpers. This was reporting being missing when using haml in a form."
This reverts commit 92c5b539c4bccebbc4b31ef9feb9e67dfd37fd6b.
See http://merb.lighthouseapp.com/projects/7435/tickets/72
## Code After:
module Merb::Template
class Haml
def self.compile_template(path, name, mod)
path = File.expand_path(path)
config = (Merb.config[:haml] || {}).inject({}) do |c, (k, v)|
c[k.to_sym] = v
c
end.merge :filename => path
template = ::Haml::Engine.new(File.read(path), config)
template.def_method(mod, name)
name
end
module Mixin
# Note that the binding here is not used, but is necessary to conform to
# the concat_* interface.
def concat_haml(string, binding)
haml_buffer.buffer << string
end
end
Merb::Template.register_extensions(self, %w[haml])
end
end
module Haml
class Engine
def def_method(object, name, *local_names)
method = object.is_a?(Module) ? :module_eval : :instance_eval
setup = "@_engine = 'haml'"
object.send(method, "def #{name}(_haml_locals = {}); #{setup}; #{precompiled_with_ambles(local_names)}; end",
@options[:filename], 0)
end
end
end
| module Merb::Template
class Haml
def self.compile_template(path, name, mod)
path = File.expand_path(path)
config = (Merb.config[:haml] || {}).inject({}) do |c, (k, v)|
c[k.to_sym] = v
c
end.merge :filename => path
template = ::Haml::Engine.new(File.read(path), config)
template.def_method(mod, name)
name
end
module Mixin
-
+ # Note that the binding here is not used, but is necessary to conform to
+ # the concat_* interface.
def concat_haml(string, binding)
- haml_buffer(binding).buffer << string
? ---------
+ haml_buffer.buffer << string
end
end
Merb::Template.register_extensions(self, %w[haml])
end
end
module Haml
class Engine
def def_method(object, name, *local_names)
method = object.is_a?(Module) ? :module_eval : :instance_eval
setup = "@_engine = 'haml'"
object.send(method, "def #{name}(_haml_locals = {}); #{setup}; #{precompiled_with_ambles(local_names)}; end",
@options[:filename], 0)
end
end
end
-
- module Haml::Helpers
- # Gets the buffer object for the haml instance
- # identified in binding
- def haml_buffer(binding)
- eval("buffer", binding)
- end
- end
- | 14 | 0.291667 | 3 | 11 |
c3f12a793c709ca5954e0fe7c4a4a0160c3dd32d | init-package/init-volatile-highlights.el | init-package/init-volatile-highlights.el | (use-package volatile-highlights
:init (volatile-highlights-mode t)
:config
(progn
;; define extensions for evil mode
(vhl/define-extension 'evil_past_after 'evil-paste-after)
(vhl/install-extension 'evil_past_after)))
| (use-package volatile-highlights
:init (volatile-highlights-mode t))
| Remove evil config for volatile highlight (not working) | Remove evil config for volatile highlight (not working)
| Emacs Lisp | mit | tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs | emacs-lisp | ## Code Before:
(use-package volatile-highlights
:init (volatile-highlights-mode t)
:config
(progn
;; define extensions for evil mode
(vhl/define-extension 'evil_past_after 'evil-paste-after)
(vhl/install-extension 'evil_past_after)))
## Instruction:
Remove evil config for volatile highlight (not working)
## Code After:
(use-package volatile-highlights
:init (volatile-highlights-mode t))
| (use-package volatile-highlights
- :init (volatile-highlights-mode t)
+ :init (volatile-highlights-mode t))
? ++
- :config
- (progn
- ;; define extensions for evil mode
- (vhl/define-extension 'evil_past_after 'evil-paste-after)
- (vhl/install-extension 'evil_past_after))) | 7 | 1 | 1 | 6 |
645a38a83fa460c6e9afece739faa83aa2d16fbe | src/environment.ts | src/environment.ts | // made availabe by webpack plugins
// Unused VARS in .env are NOT included in the bundle
const ISPRODUCTION = process.env.NODE_ENV === 'production'
export const API_HOST = ISPRODUCTION
? process.env.PRODUCTION_HOST
: process.env.DEVELOPMENT_HOST
| // made availabe by webpack plugins
// Unused VARS in .env are NOT included in the bundle
export const ISPRODUCTION = process.env.NODE_ENV === 'production'
if (!(process.env.PRODUCTION_HOST && process.env.DEVELOPMENT_HOST)) {
throw 'PRODUCTION_HOST and DEVELOPMENT_HOST must be defined in env'
}
export const API_HOST = process.env.API_HOST
? process.env.API_HOST as string
: ISPRODUCTION ? process.env.PRODUCTION_HOST : process.env.DEVELOPMENT_HOST
| Allow API_HOST to be defiend in client env | Allow API_HOST to be defiend in client env
| TypeScript | mit | OpenDirective/brian,OpenDirective/brian,OpenDirective/brian | typescript | ## Code Before:
// made availabe by webpack plugins
// Unused VARS in .env are NOT included in the bundle
const ISPRODUCTION = process.env.NODE_ENV === 'production'
export const API_HOST = ISPRODUCTION
? process.env.PRODUCTION_HOST
: process.env.DEVELOPMENT_HOST
## Instruction:
Allow API_HOST to be defiend in client env
## Code After:
// made availabe by webpack plugins
// Unused VARS in .env are NOT included in the bundle
export const ISPRODUCTION = process.env.NODE_ENV === 'production'
if (!(process.env.PRODUCTION_HOST && process.env.DEVELOPMENT_HOST)) {
throw 'PRODUCTION_HOST and DEVELOPMENT_HOST must be defined in env'
}
export const API_HOST = process.env.API_HOST
? process.env.API_HOST as string
: ISPRODUCTION ? process.env.PRODUCTION_HOST : process.env.DEVELOPMENT_HOST
| // made availabe by webpack plugins
// Unused VARS in .env are NOT included in the bundle
- const ISPRODUCTION = process.env.NODE_ENV === 'production'
+ export const ISPRODUCTION = process.env.NODE_ENV === 'production'
? +++++++
- export const API_HOST = ISPRODUCTION
- ? process.env.PRODUCTION_HOST
- : process.env.DEVELOPMENT_HOST
+ if (!(process.env.PRODUCTION_HOST && process.env.DEVELOPMENT_HOST)) {
+ throw 'PRODUCTION_HOST and DEVELOPMENT_HOST must be defined in env'
+ }
+
+ export const API_HOST = process.env.API_HOST
+ ? process.env.API_HOST as string
+ : ISPRODUCTION ? process.env.PRODUCTION_HOST : process.env.DEVELOPMENT_HOST | 12 | 1.714286 | 8 | 4 |
f3cdd03f1e02f7fd0614d4421b831794c01de66d | tests/web_api/case_with_reform/reforms.py | tests/web_api/case_with_reform/reforms.py | from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person
class goes_to_school(Variable):
value_type = bool
default_value = True
entity = Person
label = "The person goes to school (only relevant for children)"
definition_period = MONTH
class add_variable_reform(Reform):
def apply(self):
self.add_variable(goes_to_school)
| from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person
def test_dynamic_variable():
class NewDynamicClass(Variable):
value_type = bool
default_value = True
entity = Person
label = "The person goes to school (only relevant for children)"
definition_period = MONTH
NewDynamicClass.__name__ = "goes_to_school"
return NewDynamicClass
class add_variable_reform(Reform):
def apply(self):
self.add_variable(test_dynamic_variable())
| Update test reform to make it fail without a fix | Update test reform to make it fail without a fix
| Python | agpl-3.0 | openfisca/openfisca-core,openfisca/openfisca-core | python | ## Code Before:
from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person
class goes_to_school(Variable):
value_type = bool
default_value = True
entity = Person
label = "The person goes to school (only relevant for children)"
definition_period = MONTH
class add_variable_reform(Reform):
def apply(self):
self.add_variable(goes_to_school)
## Instruction:
Update test reform to make it fail without a fix
## Code After:
from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person
def test_dynamic_variable():
class NewDynamicClass(Variable):
value_type = bool
default_value = True
entity = Person
label = "The person goes to school (only relevant for children)"
definition_period = MONTH
NewDynamicClass.__name__ = "goes_to_school"
return NewDynamicClass
class add_variable_reform(Reform):
def apply(self):
self.add_variable(test_dynamic_variable())
| from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person
- class goes_to_school(Variable):
+ def test_dynamic_variable():
+ class NewDynamicClass(Variable):
- value_type = bool
+ value_type = bool
? ++++
- default_value = True
+ default_value = True
? ++++
- entity = Person
+ entity = Person
? ++++
- label = "The person goes to school (only relevant for children)"
+ label = "The person goes to school (only relevant for children)"
? ++++
- definition_period = MONTH
+ definition_period = MONTH
? ++++
+
+ NewDynamicClass.__name__ = "goes_to_school"
+ return NewDynamicClass
class add_variable_reform(Reform):
def apply(self):
- self.add_variable(goes_to_school)
+ self.add_variable(test_dynamic_variable()) | 18 | 1.2 | 11 | 7 |
3b76f82d47732f6d9378ade276b32a1488c01a7f | server/links.go | server/links.go | package server
import (
"errors"
"net/url"
)
type getExternalLinksResponse struct {
StatusFeed *string `json:"statusFeed,omitempty"` // Location of the a JSON Feed for client's Status page News Feed
CustomLinks []CustomLink `json:"custom,omitempty"` // Any custom external links for client's User menu
}
// CustomLink is a handler that returns a custom link to be used in server's routes response, within ExternalLinks
type CustomLink struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
}
// NewCustomLinks transforms `--custom-link` CLI flag data or `CUSTOM_LINKS` ENV
// var data into a data structure that the Chronograf client will expect
func NewCustomLinks(links map[string]string) ([]CustomLink, error) {
var customLinks []CustomLink
for name, link := range links {
if name == "" {
return nil, errors.New("CustomLink missing key for Name")
}
if link == "" {
return nil, errors.New("CustomLink missing value for URL")
}
_, err := url.Parse(link)
if err != nil {
return nil, err
}
customLinks = append(customLinks, CustomLink{
Name: name,
URL: link,
})
}
return customLinks, nil
}
| package server
import (
"errors"
"net/url"
)
type getExternalLinksResponse struct {
StatusFeed *string `json:"statusFeed,omitempty"` // Location of the a JSON Feed for client's Status page News Feed
CustomLinks []CustomLink `json:"custom,omitempty"` // Any custom external links for client's User menu
}
// CustomLink is a handler that returns a custom link to be used in server's routes response, within ExternalLinks
type CustomLink struct {
Name string `json:"name"`
URL string `json:"url"`
}
// NewCustomLinks transforms `--custom-link` CLI flag data or `CUSTOM_LINKS` ENV
// var data into a data structure that the Chronograf client will expect
func NewCustomLinks(links map[string]string) ([]CustomLink, error) {
var customLinks []CustomLink
for name, link := range links {
if name == "" {
return nil, errors.New("CustomLink missing key for Name")
}
if link == "" {
return nil, errors.New("CustomLink missing value for URL")
}
_, err := url.Parse(link)
if err != nil {
return nil, err
}
customLinks = append(customLinks, CustomLink{
Name: name,
URL: link,
})
}
return customLinks, nil
}
| Remove omitempty from CustomLink definition since should never b | Remove omitempty from CustomLink definition since should never b
| Go | mit | influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdb/influxdb,influxdata/influxdb,nooproblem/influxdb,li-ang/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb | go | ## Code Before:
package server
import (
"errors"
"net/url"
)
type getExternalLinksResponse struct {
StatusFeed *string `json:"statusFeed,omitempty"` // Location of the a JSON Feed for client's Status page News Feed
CustomLinks []CustomLink `json:"custom,omitempty"` // Any custom external links for client's User menu
}
// CustomLink is a handler that returns a custom link to be used in server's routes response, within ExternalLinks
type CustomLink struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
}
// NewCustomLinks transforms `--custom-link` CLI flag data or `CUSTOM_LINKS` ENV
// var data into a data structure that the Chronograf client will expect
func NewCustomLinks(links map[string]string) ([]CustomLink, error) {
var customLinks []CustomLink
for name, link := range links {
if name == "" {
return nil, errors.New("CustomLink missing key for Name")
}
if link == "" {
return nil, errors.New("CustomLink missing value for URL")
}
_, err := url.Parse(link)
if err != nil {
return nil, err
}
customLinks = append(customLinks, CustomLink{
Name: name,
URL: link,
})
}
return customLinks, nil
}
## Instruction:
Remove omitempty from CustomLink definition since should never b
## Code After:
package server
import (
"errors"
"net/url"
)
type getExternalLinksResponse struct {
StatusFeed *string `json:"statusFeed,omitempty"` // Location of the a JSON Feed for client's Status page News Feed
CustomLinks []CustomLink `json:"custom,omitempty"` // Any custom external links for client's User menu
}
// CustomLink is a handler that returns a custom link to be used in server's routes response, within ExternalLinks
type CustomLink struct {
Name string `json:"name"`
URL string `json:"url"`
}
// NewCustomLinks transforms `--custom-link` CLI flag data or `CUSTOM_LINKS` ENV
// var data into a data structure that the Chronograf client will expect
func NewCustomLinks(links map[string]string) ([]CustomLink, error) {
var customLinks []CustomLink
for name, link := range links {
if name == "" {
return nil, errors.New("CustomLink missing key for Name")
}
if link == "" {
return nil, errors.New("CustomLink missing value for URL")
}
_, err := url.Parse(link)
if err != nil {
return nil, err
}
customLinks = append(customLinks, CustomLink{
Name: name,
URL: link,
})
}
return customLinks, nil
}
| package server
import (
"errors"
"net/url"
)
type getExternalLinksResponse struct {
StatusFeed *string `json:"statusFeed,omitempty"` // Location of the a JSON Feed for client's Status page News Feed
CustomLinks []CustomLink `json:"custom,omitempty"` // Any custom external links for client's User menu
}
// CustomLink is a handler that returns a custom link to be used in server's routes response, within ExternalLinks
type CustomLink struct {
- Name string `json:"name,omitempty"`
? ----------
+ Name string `json:"name"`
- URL string `json:"url,omitempty"`
? ----------
+ URL string `json:"url"`
}
// NewCustomLinks transforms `--custom-link` CLI flag data or `CUSTOM_LINKS` ENV
// var data into a data structure that the Chronograf client will expect
func NewCustomLinks(links map[string]string) ([]CustomLink, error) {
var customLinks []CustomLink
for name, link := range links {
if name == "" {
return nil, errors.New("CustomLink missing key for Name")
}
if link == "" {
return nil, errors.New("CustomLink missing value for URL")
}
_, err := url.Parse(link)
if err != nil {
return nil, err
}
customLinks = append(customLinks, CustomLink{
Name: name,
URL: link,
})
}
return customLinks, nil
} | 4 | 0.097561 | 2 | 2 |
cb86eb1a9c7f9929b1a06fffb22895498189287e | templates/sdz/base.html | templates/sdz/base.html | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>{%block title%}{%endblock%} - SdZ - PhonyProxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="SdZ" href="/static/sdz.css" />
<meta name="HandheldFriendly" content="true" />
<script type="text/javascript" src="/static/sdz.js"></script>
</head>
<body>
<div id="header">
<img src="http://www.siteduzero.com/Templates/images/designs/2/favicon.ico" />
PhonyProxy (Site du Zéro)
</div>
<div id="menu">
<a href="/sdz/">Accueil</a>
<a href="/sdz/forum/">Forum</a>
<a href="/sdz/news/">News</a>
<a href="/sdz/tutos/">Cours</a>
</div>
<div id="body">
{%block body%}
{%endblock%}
</div>
<div id="footer">
PhonyProxy : version mobile non officielle du Site du Zéro
</div>
</body>
</html>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>{%block title%}{%endblock%} - SdZ - PhonyProxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="SdZ" href="/static/sdz.css" />
<meta name="HandheldFriendly" content="true" />
<script type="text/javascript" src="/static/sdz.js"></script>
</head>
<body>
<div id="header">
<img src="http://www.siteduzero.com/Templates/images/designs/2/favicon.ico" />
PhonyProxy (Site du Zéro)
</div>
<div id="menu">
<a href="/sdz/">Accueil</a>
<a href="/sdz/news/">News</a>
<a href="/sdz/tutos/">Cours</a>
</div>
<div id="body">
{%block body%}
{%endblock%}
</div>
<div id="footer">
PhonyProxy : version mobile non officielle du Site du Zéro
</div>
</body>
</html>
| Remove forums from the menu links | Remove forums from the menu links
| HTML | bsd-3-clause | ProgVal/SdZpp,ProgVal/SdZpp | html | ## Code Before:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>{%block title%}{%endblock%} - SdZ - PhonyProxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="SdZ" href="/static/sdz.css" />
<meta name="HandheldFriendly" content="true" />
<script type="text/javascript" src="/static/sdz.js"></script>
</head>
<body>
<div id="header">
<img src="http://www.siteduzero.com/Templates/images/designs/2/favicon.ico" />
PhonyProxy (Site du Zéro)
</div>
<div id="menu">
<a href="/sdz/">Accueil</a>
<a href="/sdz/forum/">Forum</a>
<a href="/sdz/news/">News</a>
<a href="/sdz/tutos/">Cours</a>
</div>
<div id="body">
{%block body%}
{%endblock%}
</div>
<div id="footer">
PhonyProxy : version mobile non officielle du Site du Zéro
</div>
</body>
</html>
## Instruction:
Remove forums from the menu links
## Code After:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>{%block title%}{%endblock%} - SdZ - PhonyProxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="SdZ" href="/static/sdz.css" />
<meta name="HandheldFriendly" content="true" />
<script type="text/javascript" src="/static/sdz.js"></script>
</head>
<body>
<div id="header">
<img src="http://www.siteduzero.com/Templates/images/designs/2/favicon.ico" />
PhonyProxy (Site du Zéro)
</div>
<div id="menu">
<a href="/sdz/">Accueil</a>
<a href="/sdz/news/">News</a>
<a href="/sdz/tutos/">Cours</a>
</div>
<div id="body">
{%block body%}
{%endblock%}
</div>
<div id="footer">
PhonyProxy : version mobile non officielle du Site du Zéro
</div>
</body>
</html>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>{%block title%}{%endblock%} - SdZ - PhonyProxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="SdZ" href="/static/sdz.css" />
<meta name="HandheldFriendly" content="true" />
<script type="text/javascript" src="/static/sdz.js"></script>
</head>
<body>
<div id="header">
<img src="http://www.siteduzero.com/Templates/images/designs/2/favicon.ico" />
PhonyProxy (Site du Zéro)
</div>
<div id="menu">
<a href="/sdz/">Accueil</a>
- <a href="/sdz/forum/">Forum</a>
<a href="/sdz/news/">News</a>
<a href="/sdz/tutos/">Cours</a>
</div>
<div id="body">
{%block body%}
{%endblock%}
</div>
<div id="footer">
PhonyProxy : version mobile non officielle du Site du Zéro
</div>
</body>
</html> | 1 | 0.034483 | 0 | 1 |
a1f61004ed21e550aacdbeea2f911ab407231b1e | README.md | README.md |
Dynamic variable binding for Go
This package implements dynamic variable binding (a Lispy take on
thread-local storage) for a modified version of Go (specifically, [my
fork](https://github.com/dkolbly/go), which adds reflection on
goroutine ids and a concept of goroutine group ids).
|
Dynamic variable binding for Go
This package implements dynamic variable binding (a Lispy take on
thread-local storage) for a modified version of Go (specifically, [my
fork](https://github.com/dkolbly/go), which adds reflection on
goroutine ids and a concept of goroutine group ids).
The [gls](https://github.com/jtolds/gls) package is also very
interesting (and employs a truly creative systems hack!) and allows
you to do something very similar, but seems like it might be slow
(I haven't verified this) and doesn't support inheritance across
new goroutines which is important for my usecase (logging request
context across a family of sub-goroutines). On the plus side,
`gls` doesn't require a patched Go :-)
| Add reference to gls project | Add reference to gls project
| Markdown | mit | dkolbly/go-dynamic | markdown | ## Code Before:
Dynamic variable binding for Go
This package implements dynamic variable binding (a Lispy take on
thread-local storage) for a modified version of Go (specifically, [my
fork](https://github.com/dkolbly/go), which adds reflection on
goroutine ids and a concept of goroutine group ids).
## Instruction:
Add reference to gls project
## Code After:
Dynamic variable binding for Go
This package implements dynamic variable binding (a Lispy take on
thread-local storage) for a modified version of Go (specifically, [my
fork](https://github.com/dkolbly/go), which adds reflection on
goroutine ids and a concept of goroutine group ids).
The [gls](https://github.com/jtolds/gls) package is also very
interesting (and employs a truly creative systems hack!) and allows
you to do something very similar, but seems like it might be slow
(I haven't verified this) and doesn't support inheritance across
new goroutines which is important for my usecase (logging request
context across a family of sub-goroutines). On the plus side,
`gls` doesn't require a patched Go :-)
|
Dynamic variable binding for Go
This package implements dynamic variable binding (a Lispy take on
thread-local storage) for a modified version of Go (specifically, [my
fork](https://github.com/dkolbly/go), which adds reflection on
goroutine ids and a concept of goroutine group ids).
+ The [gls](https://github.com/jtolds/gls) package is also very
+ interesting (and employs a truly creative systems hack!) and allows
+ you to do something very similar, but seems like it might be slow
+ (I haven't verified this) and doesn't support inheritance across
+ new goroutines which is important for my usecase (logging request
+ context across a family of sub-goroutines). On the plus side,
+ `gls` doesn't require a patched Go :-)
+ | 8 | 0.888889 | 8 | 0 |
9aaf7802371c18a029b59abdc6ad90766ee239ef | meta/main.yml | meta/main.yml | ---
galaxy_info:
author: Tyler Cross
description: Scheduled starting and stopping of EC2 instances with cron jobs.
license: MIT
min_ansible_version: 1.2
platforms:
- name: Amazon
versions:
- all
- name: CentOS
versions:
- all
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
categories:
- cloud
- 'cloud:ec2'
dependencies: []
| ---
galaxy_info:
author: Tyler Cross
description: Scheduled starting and stopping of EC2 instances with cron jobs.
license: MIT
min_ansible_version: 1.2
platforms:
- name: Amazon
versions:
- all
- name: CentOS
versions:
- all
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
categories: [ 'cloud:ec2' ]
dependencies: []
| Remove cloud category since this is for EC2 | Remove cloud category since this is for EC2
| YAML | mit | wtcross/aws-overseer | yaml | ## Code Before:
---
galaxy_info:
author: Tyler Cross
description: Scheduled starting and stopping of EC2 instances with cron jobs.
license: MIT
min_ansible_version: 1.2
platforms:
- name: Amazon
versions:
- all
- name: CentOS
versions:
- all
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
categories:
- cloud
- 'cloud:ec2'
dependencies: []
## Instruction:
Remove cloud category since this is for EC2
## Code After:
---
galaxy_info:
author: Tyler Cross
description: Scheduled starting and stopping of EC2 instances with cron jobs.
license: MIT
min_ansible_version: 1.2
platforms:
- name: Amazon
versions:
- all
- name: CentOS
versions:
- all
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
categories: [ 'cloud:ec2' ]
dependencies: []
| ---
galaxy_info:
author: Tyler Cross
description: Scheduled starting and stopping of EC2 instances with cron jobs.
license: MIT
min_ansible_version: 1.2
platforms:
- name: Amazon
versions:
- all
- name: CentOS
versions:
- all
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
+ categories: [ 'cloud:ec2' ]
- categories:
- - cloud
- - 'cloud:ec2'
dependencies: [] | 4 | 0.125 | 1 | 3 |
277ceff9b1b4debb6357965c1a0158d31baa4450 | src/components/molecules/information-section.js | src/components/molecules/information-section.js | import React from 'react';
import styled from 'styled-components';
const InformationWrapper = styled.section`
text-align: center;
padding: 1.6rem 0;
`;
const Name = styled.h1`
font-size: 3.5rem;
`;
const InfoList = styled.ul`
display: inline-flex;
flex-direction: column;
`;
const InfoItem = styled.li`
:not(:last-child) {
margin-bottom: 0.3rem;
}
`;
const InfoLink = styled.a.attrs({
target: '_blank',
rel: 'noopener noreferrer',
})`
font-size: 1.4rem;
text-decoration: none;
padding-bottom: 1px;
border-bottom: 1px solid;
`;
const generateHref = (type, link) => {
switch (type) {
case 'email':
return `mailto:${link}`;
case 'phone':
return `tel:${link}`;
default:
return link;
}
};
const Information = ({ data, cvOf }) => {
return (
<InformationWrapper>
<Name>{cvOf}</Name>
<InfoList>
{data.map(exp => {
const { id, label, type, link } = exp;
return (
<InfoItem key={id}>
<InfoLink href={generateHref(type, link)}>{label}</InfoLink>
</InfoItem>
);
})}
</InfoList>
</InformationWrapper>
);
};
export default Information;
| import React from 'react';
import styled from 'styled-components';
const InformationWrapper = styled.section`
text-align: center;
padding: 1.6rem 0;
`;
const Name = styled.h1`
font-size: 3.5rem;
`;
const InfoList = styled.ul`
display: inline-flex;
flex-direction: column;
`;
const InfoItem = styled.li`
:not(:last-child) {
margin-bottom: 0.3rem;
}
`;
const InfoLink = styled.a.attrs({
target: '_blank',
rel: 'noopener noreferrer',
})`
font-size: 1.4rem;
text-decoration: none;
padding-bottom: 1px;
border-bottom: 1px solid;
@media screen and (min-width: ${props => props.theme.sizes.tablet}) {
font-size: 1.6rem;
}
`;
const generateHref = (type, link) => {
switch (type) {
case 'email':
return `mailto:${link}`;
case 'phone':
return `tel:${link}`;
default:
return link;
}
};
const Information = ({ data, cvOf }) => {
return (
<InformationWrapper>
<Name>{cvOf}</Name>
<InfoList>
{data.map(exp => {
const { id, label, type, link } = exp;
return (
<InfoItem key={id}>
<InfoLink href={generateHref(type, link)}>{label}</InfoLink>
</InfoItem>
);
})}
</InfoList>
</InformationWrapper>
);
};
export default Information;
| Increase size when tablet mode | Increase size when tablet mode
| JavaScript | mit | raulfdm/cv | javascript | ## Code Before:
import React from 'react';
import styled from 'styled-components';
const InformationWrapper = styled.section`
text-align: center;
padding: 1.6rem 0;
`;
const Name = styled.h1`
font-size: 3.5rem;
`;
const InfoList = styled.ul`
display: inline-flex;
flex-direction: column;
`;
const InfoItem = styled.li`
:not(:last-child) {
margin-bottom: 0.3rem;
}
`;
const InfoLink = styled.a.attrs({
target: '_blank',
rel: 'noopener noreferrer',
})`
font-size: 1.4rem;
text-decoration: none;
padding-bottom: 1px;
border-bottom: 1px solid;
`;
const generateHref = (type, link) => {
switch (type) {
case 'email':
return `mailto:${link}`;
case 'phone':
return `tel:${link}`;
default:
return link;
}
};
const Information = ({ data, cvOf }) => {
return (
<InformationWrapper>
<Name>{cvOf}</Name>
<InfoList>
{data.map(exp => {
const { id, label, type, link } = exp;
return (
<InfoItem key={id}>
<InfoLink href={generateHref(type, link)}>{label}</InfoLink>
</InfoItem>
);
})}
</InfoList>
</InformationWrapper>
);
};
export default Information;
## Instruction:
Increase size when tablet mode
## Code After:
import React from 'react';
import styled from 'styled-components';
const InformationWrapper = styled.section`
text-align: center;
padding: 1.6rem 0;
`;
const Name = styled.h1`
font-size: 3.5rem;
`;
const InfoList = styled.ul`
display: inline-flex;
flex-direction: column;
`;
const InfoItem = styled.li`
:not(:last-child) {
margin-bottom: 0.3rem;
}
`;
const InfoLink = styled.a.attrs({
target: '_blank',
rel: 'noopener noreferrer',
})`
font-size: 1.4rem;
text-decoration: none;
padding-bottom: 1px;
border-bottom: 1px solid;
@media screen and (min-width: ${props => props.theme.sizes.tablet}) {
font-size: 1.6rem;
}
`;
const generateHref = (type, link) => {
switch (type) {
case 'email':
return `mailto:${link}`;
case 'phone':
return `tel:${link}`;
default:
return link;
}
};
const Information = ({ data, cvOf }) => {
return (
<InformationWrapper>
<Name>{cvOf}</Name>
<InfoList>
{data.map(exp => {
const { id, label, type, link } = exp;
return (
<InfoItem key={id}>
<InfoLink href={generateHref(type, link)}>{label}</InfoLink>
</InfoItem>
);
})}
</InfoList>
</InformationWrapper>
);
};
export default Information;
| import React from 'react';
import styled from 'styled-components';
const InformationWrapper = styled.section`
text-align: center;
padding: 1.6rem 0;
`;
const Name = styled.h1`
font-size: 3.5rem;
`;
const InfoList = styled.ul`
display: inline-flex;
flex-direction: column;
`;
const InfoItem = styled.li`
:not(:last-child) {
margin-bottom: 0.3rem;
}
`;
const InfoLink = styled.a.attrs({
target: '_blank',
rel: 'noopener noreferrer',
})`
font-size: 1.4rem;
text-decoration: none;
padding-bottom: 1px;
border-bottom: 1px solid;
+
+ @media screen and (min-width: ${props => props.theme.sizes.tablet}) {
+ font-size: 1.6rem;
+ }
`;
const generateHref = (type, link) => {
switch (type) {
case 'email':
return `mailto:${link}`;
case 'phone':
return `tel:${link}`;
default:
return link;
}
};
const Information = ({ data, cvOf }) => {
return (
<InformationWrapper>
<Name>{cvOf}</Name>
<InfoList>
{data.map(exp => {
const { id, label, type, link } = exp;
return (
<InfoItem key={id}>
<InfoLink href={generateHref(type, link)}>{label}</InfoLink>
</InfoItem>
);
})}
</InfoList>
</InformationWrapper>
);
};
export default Information; | 4 | 0.064516 | 4 | 0 |
28e48c8c4b761fd641da8448d64a8680bd3bfd7c | examples/http-upload.lua | examples/http-upload.lua | local HTTP = require("http")
local Utils = require("utils")
local Table = require("table")
HTTP.create_server("0.0.0.0", 8080, function (req, res)
p("on_request", req)
local chunks = {}
local length = 0
req:on('data', function (chunk, len)
p("on_data", {chunk=chunk, len=len})
length = length + 1
chunks[length] = chunk
end)
req:on('end', function ()
local body = Table.concat(chunks, "")
p("on_end", {body=body})
res:write_head(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = #body
})
res:write(body)
res:close()
end)
end)
print("Server listening at http://localhost:8080/")
| local HTTP = require("http")
local Utils = require("utils")
local Table = require("table")
HTTP.create_server("0.0.0.0", 8080, function (req, res)
p("on_request", req)
local chunks = {}
local length = 0
req:on('data', function (chunk, len)
p("on_data", {len=len})
length = length + 1
chunks[length] = chunk
end)
req:on('end', function ()
local body = Table.concat(chunks, "")
p("on_end", {total_len=#body})
body = "length = " .. tostring(#body) .. "\n"
res:write_head(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = #body
})
res:write(body)
res:close()
end)
end)
print("Server listening at http://localhost:8080/")
| Fix upload example to not dump the actual data | Fix upload example to not dump the actual data
Change-Id: Icd849536e31061772e7fef953ddcea1a2f5c8a6d
| Lua | apache-2.0 | bsn069/luvit,rjeli/luvit,boundary/luvit,GabrielNicolasAvellaneda/luvit-upstream,luvit/luvit,bsn069/luvit,AndrewTsao/luvit,rjeli/luvit,sousoux/luvit,boundary/luvit,AndrewTsao/luvit,AndrewTsao/luvit,zhaozg/luvit,connectFree/lev,sousoux/luvit,luvit/luvit,kaustavha/luvit,rjeli/luvit,GabrielNicolasAvellaneda/luvit-upstream,GabrielNicolasAvellaneda/luvit-upstream,boundary/luvit,connectFree/lev,bsn069/luvit,boundary/luvit,DBarney/luvit,boundary/luvit,boundary/luvit,sousoux/luvit,kaustavha/luvit,GabrielNicolasAvellaneda/luvit-upstream,kaustavha/luvit,sousoux/luvit,zhaozg/luvit,DBarney/luvit,sousoux/luvit,rjeli/luvit,DBarney/luvit,DBarney/luvit,sousoux/luvit,brimworks/luvit | lua | ## Code Before:
local HTTP = require("http")
local Utils = require("utils")
local Table = require("table")
HTTP.create_server("0.0.0.0", 8080, function (req, res)
p("on_request", req)
local chunks = {}
local length = 0
req:on('data', function (chunk, len)
p("on_data", {chunk=chunk, len=len})
length = length + 1
chunks[length] = chunk
end)
req:on('end', function ()
local body = Table.concat(chunks, "")
p("on_end", {body=body})
res:write_head(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = #body
})
res:write(body)
res:close()
end)
end)
print("Server listening at http://localhost:8080/")
## Instruction:
Fix upload example to not dump the actual data
Change-Id: Icd849536e31061772e7fef953ddcea1a2f5c8a6d
## Code After:
local HTTP = require("http")
local Utils = require("utils")
local Table = require("table")
HTTP.create_server("0.0.0.0", 8080, function (req, res)
p("on_request", req)
local chunks = {}
local length = 0
req:on('data', function (chunk, len)
p("on_data", {len=len})
length = length + 1
chunks[length] = chunk
end)
req:on('end', function ()
local body = Table.concat(chunks, "")
p("on_end", {total_len=#body})
body = "length = " .. tostring(#body) .. "\n"
res:write_head(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = #body
})
res:write(body)
res:close()
end)
end)
print("Server listening at http://localhost:8080/")
| local HTTP = require("http")
local Utils = require("utils")
local Table = require("table")
HTTP.create_server("0.0.0.0", 8080, function (req, res)
p("on_request", req)
local chunks = {}
local length = 0
req:on('data', function (chunk, len)
- p("on_data", {chunk=chunk, len=len})
? -------------
+ p("on_data", {len=len})
length = length + 1
chunks[length] = chunk
end)
req:on('end', function ()
local body = Table.concat(chunks, "")
- p("on_end", {body=body})
? ^ ^^
+ p("on_end", {total_len=#body})
? ^ ^^^^^^^ +
-
+ body = "length = " .. tostring(#body) .. "\n"
res:write_head(200, {
["Content-Type"] = "text/plain",
["Content-Length"] = #body
})
res:write(body)
res:close()
end)
end)
print("Server listening at http://localhost:8080/")
| 6 | 0.206897 | 3 | 3 |
81e6d3bf53ff2b474b47f0d30e73e6554433f37f | test/dir/tempfile_test.rb | test/dir/tempfile_test.rb | require_relative '../test_helper'
require 'tempfile'
# Tempfile test class
class TempfileTest < Minitest::Test
include FakeFS
def test_open_should_not_raise_error
FakeFS do
# nothing raised
FileUtils.mkdir_p(Dir.tmpdir)
Tempfile.open('test')
end
end
end
| require_relative '../test_helper'
require 'tempfile'
# Tempfile test class
class TempfileTest < Minitest::Test
include FakeFS
def test_open_should_not_raise_error
FakeFS do
# nothing raised
FileUtils.mkdir_p(Dir.tmpdir)
Tempfile.open('test')
end
end
def test_create_block
FakeFS do
# nothing raised
FileUtils.mkdir_p(Dir.tmpdir)
# Ruby 2.3 requires a basename
Tempfile.create('') do |f|
f.write('Hello World!')
f.flush
assert_equal(File.read(f.path), 'Hello World!')
end
end
end
end
| Add a test for Tempfile.create | Add a test for Tempfile.create
On Ruby 2.7 this requires File.identical? to be implemented.
| Ruby | mit | fakefs/fakefs,defunkt/fakefs | ruby | ## Code Before:
require_relative '../test_helper'
require 'tempfile'
# Tempfile test class
class TempfileTest < Minitest::Test
include FakeFS
def test_open_should_not_raise_error
FakeFS do
# nothing raised
FileUtils.mkdir_p(Dir.tmpdir)
Tempfile.open('test')
end
end
end
## Instruction:
Add a test for Tempfile.create
On Ruby 2.7 this requires File.identical? to be implemented.
## Code After:
require_relative '../test_helper'
require 'tempfile'
# Tempfile test class
class TempfileTest < Minitest::Test
include FakeFS
def test_open_should_not_raise_error
FakeFS do
# nothing raised
FileUtils.mkdir_p(Dir.tmpdir)
Tempfile.open('test')
end
end
def test_create_block
FakeFS do
# nothing raised
FileUtils.mkdir_p(Dir.tmpdir)
# Ruby 2.3 requires a basename
Tempfile.create('') do |f|
f.write('Hello World!')
f.flush
assert_equal(File.read(f.path), 'Hello World!')
end
end
end
end
| require_relative '../test_helper'
require 'tempfile'
# Tempfile test class
class TempfileTest < Minitest::Test
include FakeFS
def test_open_should_not_raise_error
FakeFS do
# nothing raised
FileUtils.mkdir_p(Dir.tmpdir)
Tempfile.open('test')
end
end
+
+ def test_create_block
+ FakeFS do
+ # nothing raised
+ FileUtils.mkdir_p(Dir.tmpdir)
+ # Ruby 2.3 requires a basename
+ Tempfile.create('') do |f|
+ f.write('Hello World!')
+ f.flush
+
+ assert_equal(File.read(f.path), 'Hello World!')
+ end
+ end
+ end
end | 14 | 0.933333 | 14 | 0 |
9f8fec35a08f84ff639a874c7a31cbc92bee052c | app/index.jade | app/index.jade | doctype html
html(ng-app="DrinkMenu")
head
meta(charset="UTF-8" )
meta(name="viewport" content="width=device-width, initial-scale=1")
title Beer!
link(rel="stylesheet" type="text/css" href="app.css")
script(src="analytics.js")
body(ng-cloak)
include partial/drinklist
script(src="vendor/jquery/dist/jquery.min.js")
script(src="vendor/moment/min/moment.min.js")
script(src="vendor/angular/angular.min.js")
script(src="app.js")
script(type="text/ng-template" id="bev-select/t_bevselect.html")
include bev-select/t_bevselect
| doctype html
html(ng-app="DrinkMenu")
head
meta(charset="UTF-8" )
meta(name="viewport" content="width=device-width, initial-scale=1")
title Beer!
link(rel="stylesheet" type="text/css" href="app.css")
body(ng-cloak)
include partial/drinklist
script(src="vendor/jquery/dist/jquery.min.js")
script(src="vendor/moment/min/moment.min.js")
script(src="vendor/angular/angular.min.js")
script(src="analytics.js")
script(src="app.js")
script(type="text/ng-template" id="bev-select/t_bevselect.html")
include bev-select/t_bevselect
| Load analytics.js with the other js files. | Load analytics.js with the other js files.
| Jade | mit | bevly/bevly-ui,bevly/bevly-ui | jade | ## Code Before:
doctype html
html(ng-app="DrinkMenu")
head
meta(charset="UTF-8" )
meta(name="viewport" content="width=device-width, initial-scale=1")
title Beer!
link(rel="stylesheet" type="text/css" href="app.css")
script(src="analytics.js")
body(ng-cloak)
include partial/drinklist
script(src="vendor/jquery/dist/jquery.min.js")
script(src="vendor/moment/min/moment.min.js")
script(src="vendor/angular/angular.min.js")
script(src="app.js")
script(type="text/ng-template" id="bev-select/t_bevselect.html")
include bev-select/t_bevselect
## Instruction:
Load analytics.js with the other js files.
## Code After:
doctype html
html(ng-app="DrinkMenu")
head
meta(charset="UTF-8" )
meta(name="viewport" content="width=device-width, initial-scale=1")
title Beer!
link(rel="stylesheet" type="text/css" href="app.css")
body(ng-cloak)
include partial/drinklist
script(src="vendor/jquery/dist/jquery.min.js")
script(src="vendor/moment/min/moment.min.js")
script(src="vendor/angular/angular.min.js")
script(src="analytics.js")
script(src="app.js")
script(type="text/ng-template" id="bev-select/t_bevselect.html")
include bev-select/t_bevselect
| doctype html
html(ng-app="DrinkMenu")
head
meta(charset="UTF-8" )
meta(name="viewport" content="width=device-width, initial-scale=1")
title Beer!
link(rel="stylesheet" type="text/css" href="app.css")
- script(src="analytics.js")
body(ng-cloak)
include partial/drinklist
script(src="vendor/jquery/dist/jquery.min.js")
script(src="vendor/moment/min/moment.min.js")
script(src="vendor/angular/angular.min.js")
+ script(src="analytics.js")
script(src="app.js")
script(type="text/ng-template" id="bev-select/t_bevselect.html")
include bev-select/t_bevselect | 2 | 0.125 | 1 | 1 |
9c3bd12830e7ba1775202649f7030e590d6847be | .eslintrc.js | .eslintrc.js | module.exports = {
extends: ["matrix-org", "matrix-org/react-legacy"],
parser: "babel-eslint",
env: {
browser: true,
node: true,
},
globals: {
LANGUAGES_FILE: "readonly",
},
rules: {
// Things we do that break the ideal style
"no-constant-condition": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
"quotes": "off",
"indent": "off",
},
overrides: [{
"files": ["src/**/*.{ts,tsx}"],
"extends": ["matrix-org/ts"],
"rules": {
// We're okay being explicit at the moment
"@typescript-eslint/no-empty-interface": "off",
// We disable this while we're transitioning
"@typescript-eslint/no-explicit-any": "off",
// We'd rather not do this but we do
"@typescript-eslint/ban-ts-comment": "off",
"quotes": "off",
"no-extra-boolean-cast": "off",
},
}],
};
| module.exports = {
extends: ["matrix-org", "matrix-org/react-legacy"],
parser: "babel-eslint",
env: {
browser: true,
node: true,
},
globals: {
LANGUAGES_FILE: "readonly",
},
rules: {
// Things we do that break the ideal style
"no-constant-condition": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
"quotes": "off",
"indent": "off",
},
overrides: [{
"files": ["src/**/*.{ts,tsx}"],
"extends": ["matrix-org/ts"],
"rules": {
// We're okay being explicit at the moment
"@typescript-eslint/no-empty-interface": "off",
// We disable this while we're transitioning
"@typescript-eslint/no-explicit-any": "off",
// We'd rather not do this but we do
"@typescript-eslint/ban-ts-comment": "off",
"quotes": "off",
"indent": "off",
"no-extra-boolean-cast": "off",
},
}],
};
| Copy indent rule to TS as well | Copy indent rule to TS as well
| JavaScript | apache-2.0 | matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk | javascript | ## Code Before:
module.exports = {
extends: ["matrix-org", "matrix-org/react-legacy"],
parser: "babel-eslint",
env: {
browser: true,
node: true,
},
globals: {
LANGUAGES_FILE: "readonly",
},
rules: {
// Things we do that break the ideal style
"no-constant-condition": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
"quotes": "off",
"indent": "off",
},
overrides: [{
"files": ["src/**/*.{ts,tsx}"],
"extends": ["matrix-org/ts"],
"rules": {
// We're okay being explicit at the moment
"@typescript-eslint/no-empty-interface": "off",
// We disable this while we're transitioning
"@typescript-eslint/no-explicit-any": "off",
// We'd rather not do this but we do
"@typescript-eslint/ban-ts-comment": "off",
"quotes": "off",
"no-extra-boolean-cast": "off",
},
}],
};
## Instruction:
Copy indent rule to TS as well
## Code After:
module.exports = {
extends: ["matrix-org", "matrix-org/react-legacy"],
parser: "babel-eslint",
env: {
browser: true,
node: true,
},
globals: {
LANGUAGES_FILE: "readonly",
},
rules: {
// Things we do that break the ideal style
"no-constant-condition": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
"quotes": "off",
"indent": "off",
},
overrides: [{
"files": ["src/**/*.{ts,tsx}"],
"extends": ["matrix-org/ts"],
"rules": {
// We're okay being explicit at the moment
"@typescript-eslint/no-empty-interface": "off",
// We disable this while we're transitioning
"@typescript-eslint/no-explicit-any": "off",
// We'd rather not do this but we do
"@typescript-eslint/ban-ts-comment": "off",
"quotes": "off",
"indent": "off",
"no-extra-boolean-cast": "off",
},
}],
};
| module.exports = {
extends: ["matrix-org", "matrix-org/react-legacy"],
parser: "babel-eslint",
env: {
browser: true,
node: true,
},
globals: {
LANGUAGES_FILE: "readonly",
},
rules: {
// Things we do that break the ideal style
"no-constant-condition": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
"quotes": "off",
"indent": "off",
},
overrides: [{
"files": ["src/**/*.{ts,tsx}"],
"extends": ["matrix-org/ts"],
"rules": {
// We're okay being explicit at the moment
"@typescript-eslint/no-empty-interface": "off",
// We disable this while we're transitioning
"@typescript-eslint/no-explicit-any": "off",
// We'd rather not do this but we do
"@typescript-eslint/ban-ts-comment": "off",
"quotes": "off",
+ "indent": "off",
"no-extra-boolean-cast": "off",
},
}],
}; | 1 | 0.027778 | 1 | 0 |
fa53be17742602516c4699644772b99d1ed4c06e | last-stop/app/controllers/stops_controller.rb | last-stop/app/controllers/stops_controller.rb | class StopsController < ApplicationController
def index
@stops = Stop.all
render json: @stops
end
end
| class StopsController < ApplicationController
def index
#@stops = Stop.near(params[:location])
@stops = Stop.near([37.464763, -122.197985])
render json: @stops
end
end
| Update stops controller to return JSON | Update stops controller to return JSON
| Ruby | mit | Zanibas/Last-Stop,Zanibas/Last-Stop,Zanibas/Last-Stop | ruby | ## Code Before:
class StopsController < ApplicationController
def index
@stops = Stop.all
render json: @stops
end
end
## Instruction:
Update stops controller to return JSON
## Code After:
class StopsController < ApplicationController
def index
#@stops = Stop.near(params[:location])
@stops = Stop.near([37.464763, -122.197985])
render json: @stops
end
end
| class StopsController < ApplicationController
def index
- @stops = Stop.all
+ #@stops = Stop.near(params[:location])
+ @stops = Stop.near([37.464763, -122.197985])
render json: @stops
end
end
| 3 | 0.3 | 2 | 1 |
fe68c6e442b80cbad1679bc8f6e87eb9bf7ac3e4 | .travis.yml | .travis.yml | language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/pip
- vendor
env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak
matrix:
fast_finish: true
include:
- php: 5.6
env: CS_FIXER=run
- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest"
allow_failures:
- php: 7.0
- php: hhvm
before_script:
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d && echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer selfupdate
- composer config -q github-oauth.github.com $GITHUB_OAUTH_TOKEN
- travis_wait composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
script:
- if [ "$CS_FIXER" = "run" ]; then make cs_dry_run ; fi;
- make test
| language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/pip
env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak
matrix:
fast_finish: true
include:
- php: 5.6
env: CS_FIXER=run
- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest"
allow_failures:
- php: 7.0
- php: hhvm
before_script:
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d && echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer selfupdate
- composer config -q github-oauth.github.com $GITHUB_OAUTH_TOKEN
- travis_wait composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
script:
- if [ "$CS_FIXER" = "run" ]; then make cs_dry_run ; fi;
- make test
| Remove local vendor cache folder | Remove local vendor cache folder
See https://github.com/composer/composer/issues/4147#issuecomment-115258930
| YAML | mit | denny0223/GoogleAuthenticator,sonata-project/GoogleAuthenticator,Soullivaneuh/SonataGoogleAuthenticator,Soullivaneuh/SonataGoogleAuthenticator | yaml | ## Code Before:
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/pip
- vendor
env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak
matrix:
fast_finish: true
include:
- php: 5.6
env: CS_FIXER=run
- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest"
allow_failures:
- php: 7.0
- php: hhvm
before_script:
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d && echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer selfupdate
- composer config -q github-oauth.github.com $GITHUB_OAUTH_TOKEN
- travis_wait composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
script:
- if [ "$CS_FIXER" = "run" ]; then make cs_dry_run ; fi;
- make test
## Instruction:
Remove local vendor cache folder
See https://github.com/composer/composer/issues/4147#issuecomment-115258930
## Code After:
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/pip
env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak
matrix:
fast_finish: true
include:
- php: 5.6
env: CS_FIXER=run
- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest"
allow_failures:
- php: 7.0
- php: hhvm
before_script:
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d && echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer selfupdate
- composer config -q github-oauth.github.com $GITHUB_OAUTH_TOKEN
- travis_wait composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
script:
- if [ "$CS_FIXER" = "run" ]; then make cs_dry_run ; fi;
- make test
| language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/pip
- - vendor
env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak
matrix:
fast_finish: true
include:
- php: 5.6
env: CS_FIXER=run
- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest"
allow_failures:
- php: 7.0
- php: hhvm
before_script:
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d && echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer selfupdate
- composer config -q github-oauth.github.com $GITHUB_OAUTH_TOKEN
- travis_wait composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
script:
- if [ "$CS_FIXER" = "run" ]; then make cs_dry_run ; fi;
- make test | 1 | 0.02381 | 0 | 1 |
28e7cd5c93151907b465f2da7fd52c08396e0182 | src/main/scala/io/vertx/ext/asyncsql/mysql/impl/MysqlOverrides.scala | src/main/scala/io/vertx/ext/asyncsql/mysql/impl/MysqlOverrides.scala | package io.vertx.ext.asyncsql.mysql.impl
import io.vertx.ext.asyncsql.impl.CommandImplementations
/**
* @author <a href="http://www.campudus.com">Joern Bernhardt</a>.
*/
trait MysqlOverrides extends CommandImplementations {
override protected def escapeField(str: String): String = "`" + str.replace("`", "\\`") + "`"
override protected def selectCommand(table: String, fields: Stream[String], limit: Option[Int], offset: Option[Int]): String = {
val fieldsStr = if (fields.isEmpty) "*" else fields.map(escapeField).mkString(",")
val tableStr = escapeField(table)
val limitStr = limit.map(l => s"LIMIT $l").getOrElse(s"LIMIT ${Long.MaxValue}")
val offsetStr = offset.map(o => s"OFFSET $o").getOrElse("")
s"SELECT $fieldsStr FROM $tableStr $limitStr $offsetStr"
}
}
| package io.vertx.ext.asyncsql.mysql.impl
import io.vertx.ext.asyncsql.impl.CommandImplementations
/**
* @author <a href="http://www.campudus.com">Joern Bernhardt</a>.
*/
trait MysqlOverrides extends CommandImplementations {
override protected def escapeField(str: String): String = "`" + str.replace("`", "\\`") + "`"
override protected def selectCommand(table: String, fields: Stream[String], limit: Option[Int], offset: Option[Int]): String = {
val fieldsStr = if (fields.isEmpty) "*" else fields.map(escapeField).mkString(",")
val tableStr = escapeField(table)
val limitStr = (limit, offset) match {
case (Some(l), Some(o)) => s"LIMIT $o, $l"
case (None, Some(o)) => s"LIMIT $o, ${Long.MaxValue}"
case (Some(l), None) => s"LIMIT $l"
case _ => ""
}
s"SELECT $fieldsStr FROM $tableStr $limitStr"
}
}
| Make LIMIT clause nicer in MySQL select | Make LIMIT clause nicer in MySQL select
Signed-off-by: Joern Bernhardt <7b85a41a628204b76aba4326273a3ccc74bd009a@campudus.com>
| Scala | apache-2.0 | vert-x3/vertx-mysql-postgresql-client,InfoSec812/vertx-mysql-postgresql-service,vert-x3/vertx-mysql-postgresql-client,InfoSec812/vertx-mysql-postgresql-service,InfoSec812/vertx-mysql-postgresql-service | scala | ## Code Before:
package io.vertx.ext.asyncsql.mysql.impl
import io.vertx.ext.asyncsql.impl.CommandImplementations
/**
* @author <a href="http://www.campudus.com">Joern Bernhardt</a>.
*/
trait MysqlOverrides extends CommandImplementations {
override protected def escapeField(str: String): String = "`" + str.replace("`", "\\`") + "`"
override protected def selectCommand(table: String, fields: Stream[String], limit: Option[Int], offset: Option[Int]): String = {
val fieldsStr = if (fields.isEmpty) "*" else fields.map(escapeField).mkString(",")
val tableStr = escapeField(table)
val limitStr = limit.map(l => s"LIMIT $l").getOrElse(s"LIMIT ${Long.MaxValue}")
val offsetStr = offset.map(o => s"OFFSET $o").getOrElse("")
s"SELECT $fieldsStr FROM $tableStr $limitStr $offsetStr"
}
}
## Instruction:
Make LIMIT clause nicer in MySQL select
Signed-off-by: Joern Bernhardt <7b85a41a628204b76aba4326273a3ccc74bd009a@campudus.com>
## Code After:
package io.vertx.ext.asyncsql.mysql.impl
import io.vertx.ext.asyncsql.impl.CommandImplementations
/**
* @author <a href="http://www.campudus.com">Joern Bernhardt</a>.
*/
trait MysqlOverrides extends CommandImplementations {
override protected def escapeField(str: String): String = "`" + str.replace("`", "\\`") + "`"
override protected def selectCommand(table: String, fields: Stream[String], limit: Option[Int], offset: Option[Int]): String = {
val fieldsStr = if (fields.isEmpty) "*" else fields.map(escapeField).mkString(",")
val tableStr = escapeField(table)
val limitStr = (limit, offset) match {
case (Some(l), Some(o)) => s"LIMIT $o, $l"
case (None, Some(o)) => s"LIMIT $o, ${Long.MaxValue}"
case (Some(l), None) => s"LIMIT $l"
case _ => ""
}
s"SELECT $fieldsStr FROM $tableStr $limitStr"
}
}
| package io.vertx.ext.asyncsql.mysql.impl
import io.vertx.ext.asyncsql.impl.CommandImplementations
/**
* @author <a href="http://www.campudus.com">Joern Bernhardt</a>.
*/
trait MysqlOverrides extends CommandImplementations {
override protected def escapeField(str: String): String = "`" + str.replace("`", "\\`") + "`"
override protected def selectCommand(table: String, fields: Stream[String], limit: Option[Int], offset: Option[Int]): String = {
val fieldsStr = if (fields.isEmpty) "*" else fields.map(escapeField).mkString(",")
val tableStr = escapeField(table)
- val limitStr = limit.map(l => s"LIMIT $l").getOrElse(s"LIMIT ${Long.MaxValue}")
- val offsetStr = offset.map(o => s"OFFSET $o").getOrElse("")
+ val limitStr = (limit, offset) match {
+ case (Some(l), Some(o)) => s"LIMIT $o, $l"
+ case (None, Some(o)) => s"LIMIT $o, ${Long.MaxValue}"
+ case (Some(l), None) => s"LIMIT $l"
+ case _ => ""
+ }
- s"SELECT $fieldsStr FROM $tableStr $limitStr $offsetStr"
? -----------
+ s"SELECT $fieldsStr FROM $tableStr $limitStr"
}
} | 10 | 0.526316 | 7 | 3 |
b79108c849b5b729eaf35c9c217e04e974474753 | tree.py | tree.py | from PySide import QtGui, QtCore
class Tree(QtGui.QTreeView):
def __init__(self, parent=None):
super(Tree, self).__init__(parent)
def load_from_path(self, path):
""" Load directory containing file into the tree. """
# Link the tree to a model
model = QtGui.QFileSystemModel()
model.setRootPath(path)
self.setModel(model)
# Set the tree's index to the root of the model
indexRoot = model.index(model.rootPath())
self.setRootIndex(indexRoot)
# Display tree cleanly
self.hide_unwanted_info()
def hide_unwanted_info(self):
""" Hides unneeded columns and header. """
# Hide tree size and date columns
self.hideColumn(1)
self.hideColumn(2)
self.hideColumn(3)
# Hide tree header
self.setHeaderHidden(True)
| from PySide import QtGui, QtCore
class Tree(QtGui.QTreeView):
def __init__(self, parent=None):
super(Tree, self).__init__(parent)
def load_from_path(self, path):
""" Load directory containing file into the tree. """
# Link the tree to a model
model = QtGui.QFileSystemModel()
model.setRootPath(path)
self.setModel(model)
# Set the tree's index to the root of the model
indexRoot = model.index(model.rootPath())
self.setRootIndex(indexRoot)
# Display tree cleanly
self.hide_unwanted_info()
# Connect the selection changed signal
# selmodel = self.listing.selectionModel()
# self.selectionChanged.connect(self.handleSelectionChanged)
def hide_unwanted_info(self):
""" Hides unneeded columns and header. """
# Hide tree size and date columns
self.hideColumn(1)
self.hideColumn(2)
self.hideColumn(3)
# Hide tree header
self.setHeaderHidden(True)
def selectionChanged(self, selected, deselected):
"""
Event handler for selection changes.
"""
print "In selectionChanged"
indexes = selected.indexes()
if indexes:
print('row: %d' % indexes[0].row())
# print selected.value(indexes[0].row())
print self.model().data(indexes[0]) | Print selection in selectionChanged handler. | Print selection in selectionChanged handler.
| Python | bsd-3-clause | techdragon/sphinx-gui,audreyr/sphinx-gui,audreyr/sphinx-gui,techdragon/sphinx-gui | python | ## Code Before:
from PySide import QtGui, QtCore
class Tree(QtGui.QTreeView):
def __init__(self, parent=None):
super(Tree, self).__init__(parent)
def load_from_path(self, path):
""" Load directory containing file into the tree. """
# Link the tree to a model
model = QtGui.QFileSystemModel()
model.setRootPath(path)
self.setModel(model)
# Set the tree's index to the root of the model
indexRoot = model.index(model.rootPath())
self.setRootIndex(indexRoot)
# Display tree cleanly
self.hide_unwanted_info()
def hide_unwanted_info(self):
""" Hides unneeded columns and header. """
# Hide tree size and date columns
self.hideColumn(1)
self.hideColumn(2)
self.hideColumn(3)
# Hide tree header
self.setHeaderHidden(True)
## Instruction:
Print selection in selectionChanged handler.
## Code After:
from PySide import QtGui, QtCore
class Tree(QtGui.QTreeView):
def __init__(self, parent=None):
super(Tree, self).__init__(parent)
def load_from_path(self, path):
""" Load directory containing file into the tree. """
# Link the tree to a model
model = QtGui.QFileSystemModel()
model.setRootPath(path)
self.setModel(model)
# Set the tree's index to the root of the model
indexRoot = model.index(model.rootPath())
self.setRootIndex(indexRoot)
# Display tree cleanly
self.hide_unwanted_info()
# Connect the selection changed signal
# selmodel = self.listing.selectionModel()
# self.selectionChanged.connect(self.handleSelectionChanged)
def hide_unwanted_info(self):
""" Hides unneeded columns and header. """
# Hide tree size and date columns
self.hideColumn(1)
self.hideColumn(2)
self.hideColumn(3)
# Hide tree header
self.setHeaderHidden(True)
def selectionChanged(self, selected, deselected):
"""
Event handler for selection changes.
"""
print "In selectionChanged"
indexes = selected.indexes()
if indexes:
print('row: %d' % indexes[0].row())
# print selected.value(indexes[0].row())
print self.model().data(indexes[0]) | from PySide import QtGui, QtCore
class Tree(QtGui.QTreeView):
def __init__(self, parent=None):
super(Tree, self).__init__(parent)
def load_from_path(self, path):
""" Load directory containing file into the tree. """
# Link the tree to a model
model = QtGui.QFileSystemModel()
model.setRootPath(path)
self.setModel(model)
# Set the tree's index to the root of the model
indexRoot = model.index(model.rootPath())
self.setRootIndex(indexRoot)
# Display tree cleanly
self.hide_unwanted_info()
+
+ # Connect the selection changed signal
+ # selmodel = self.listing.selectionModel()
+ # self.selectionChanged.connect(self.handleSelectionChanged)
def hide_unwanted_info(self):
""" Hides unneeded columns and header. """
# Hide tree size and date columns
self.hideColumn(1)
self.hideColumn(2)
self.hideColumn(3)
# Hide tree header
self.setHeaderHidden(True)
+
+ def selectionChanged(self, selected, deselected):
+ """
+ Event handler for selection changes.
+ """
+ print "In selectionChanged"
+ indexes = selected.indexes()
+ if indexes:
+ print('row: %d' % indexes[0].row())
+ # print selected.value(indexes[0].row())
+ print self.model().data(indexes[0]) | 15 | 0.46875 | 15 | 0 |
260b3a1f3027932c72a969c96390924d480fa55d | static/widgets/reminders/js/everestConfig.js | static/widgets/reminders/js/everestConfig.js | var EverestConfig = {
endpoint: {
base: "http://everest-build:8082" /*,
patient: // show ability to extend
*/
}
}; | var EverestConfig = {
endpoint: {
base: "http://healthcare-demo:8081" /*,
patient: // show ability to extend
*/
}
};
| Update root URL for REST services... | Update root URL for REST services...
| JavaScript | mit | NextCenturyCorporation/healthcare-demo,NextCenturyCorporation/healthcare-demo,NextCenturyCorporation/healthcare-demo | javascript | ## Code Before:
var EverestConfig = {
endpoint: {
base: "http://everest-build:8082" /*,
patient: // show ability to extend
*/
}
};
## Instruction:
Update root URL for REST services...
## Code After:
var EverestConfig = {
endpoint: {
base: "http://healthcare-demo:8081" /*,
patient: // show ability to extend
*/
}
};
| var EverestConfig = {
endpoint: {
- base: "http://everest-build:8082" /*,
? ^^ -- ---- ^
+ base: "http://healthcare-demo:8081" /*,
? + ^^^^^^ +++ ^
patient: // show ability to extend
*/
}
}; | 2 | 0.25 | 1 | 1 |
8541ec09e237f1401095d31177bdde9ac1adaa39 | util/linkJS.py | util/linkJS.py |
import os
def linkJS(target_fn, file_list_fn, source_base, prologue="", module_dirs=[]):
with open(target_fn, "wb") as target:
target.write(prologue)
# Add files listed in file_list_fn
with open(file_list_fn) as file_list:
for source_fn in file_list:
source_fn = source_fn.replace("/", os.path.sep).strip()
if len(source_fn) > 0 and source_fn[0] != "#":
addContents(source_base, source_fn, target)
# Add all *.js files in module_dirs
for module_base in module_dirs:
for module_fn in os.listdir(module_base):
if module_fn.endswith(".js"):
addContents(module_base, module_fn, target)
def addContents(source_base, source_fn, target):
target.write("\n\n// " + source_fn + "\n\n")
with open(os.path.join(source_base, source_fn)) as source:
for line in source:
target.write(line)
|
import os
def linkJS(target_fn, file_list_fn, source_base, prologue="", module_dirs=[]):
with open(target_fn, "wb") as target:
target.write(prologue)
# Add files listed in file_list_fn
with open(file_list_fn) as file_list:
for source_fn in file_list:
source_fn = source_fn.replace("/", os.path.sep).strip()
if len(source_fn) > 0 and source_fn[0] != "#":
addContents(os.path.join(source_base, source_fn), target)
# Add all *.js files in module_dirs
for module_base in module_dirs:
for module_fn in os.listdir(module_base):
if module_fn.endswith(".js"):
addContents(os.path.join(module_base, module_fn), target)
def addContents(source_fn, target):
target.write("\n\n// " + source_fn + "\n\n")
with open(source_fn) as source:
for line in source:
target.write(line)
| Include full path to original files | Include full path to original files
| Python | mpl-2.0 | MozillaSecurity/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz | python | ## Code Before:
import os
def linkJS(target_fn, file_list_fn, source_base, prologue="", module_dirs=[]):
with open(target_fn, "wb") as target:
target.write(prologue)
# Add files listed in file_list_fn
with open(file_list_fn) as file_list:
for source_fn in file_list:
source_fn = source_fn.replace("/", os.path.sep).strip()
if len(source_fn) > 0 and source_fn[0] != "#":
addContents(source_base, source_fn, target)
# Add all *.js files in module_dirs
for module_base in module_dirs:
for module_fn in os.listdir(module_base):
if module_fn.endswith(".js"):
addContents(module_base, module_fn, target)
def addContents(source_base, source_fn, target):
target.write("\n\n// " + source_fn + "\n\n")
with open(os.path.join(source_base, source_fn)) as source:
for line in source:
target.write(line)
## Instruction:
Include full path to original files
## Code After:
import os
def linkJS(target_fn, file_list_fn, source_base, prologue="", module_dirs=[]):
with open(target_fn, "wb") as target:
target.write(prologue)
# Add files listed in file_list_fn
with open(file_list_fn) as file_list:
for source_fn in file_list:
source_fn = source_fn.replace("/", os.path.sep).strip()
if len(source_fn) > 0 and source_fn[0] != "#":
addContents(os.path.join(source_base, source_fn), target)
# Add all *.js files in module_dirs
for module_base in module_dirs:
for module_fn in os.listdir(module_base):
if module_fn.endswith(".js"):
addContents(os.path.join(module_base, module_fn), target)
def addContents(source_fn, target):
target.write("\n\n// " + source_fn + "\n\n")
with open(source_fn) as source:
for line in source:
target.write(line)
|
import os
def linkJS(target_fn, file_list_fn, source_base, prologue="", module_dirs=[]):
with open(target_fn, "wb") as target:
target.write(prologue)
# Add files listed in file_list_fn
with open(file_list_fn) as file_list:
for source_fn in file_list:
source_fn = source_fn.replace("/", os.path.sep).strip()
if len(source_fn) > 0 and source_fn[0] != "#":
- addContents(source_base, source_fn, target)
+ addContents(os.path.join(source_base, source_fn), target)
? +++++++++++++ +
# Add all *.js files in module_dirs
for module_base in module_dirs:
for module_fn in os.listdir(module_base):
if module_fn.endswith(".js"):
- addContents(module_base, module_fn, target)
+ addContents(os.path.join(module_base, module_fn), target)
? +++++++++++++ +
- def addContents(source_base, source_fn, target):
? -------------
+ def addContents(source_fn, target):
target.write("\n\n// " + source_fn + "\n\n")
- with open(os.path.join(source_base, source_fn)) as source:
+ with open(source_fn) as source:
for line in source:
target.write(line) | 8 | 0.296296 | 4 | 4 |
d0bc6b72a012be76bea9297852ba9fb144105e8c | src/templates/overview.html | src/templates/overview.html | <div class="row">
<div class="col-md-3">
<input (keyup)="onKey($event)" class="form-control">
<ul *ngIf="objects" class="list-group" id="objectList">
<li *ngFor="#object of objects"
[class.selected]="selectedObject && (selectedObject.identifier === object.identifier)"
(click)="onSelect(object)" class="list-group-item">
<div class="title">{{object.title}}</div>
<div class="identifier">{{object.identifier}}</div>
<div class="status"
[class.synced]="object.synced"
[class.unsynced]="!object.synced"
>✓</div>
</li>
</ul>
</div>
<div class="col-md-9">
<div *ngIf="selectedObject">
<form>
<div class="form-group">
<label>ID</label>
<input [(ngModel)]="selectedObject._id" class="form-control" readonly>
</div>
<div class="form-group">
<label>Identifier</label>
<input [(ngModel)]="selectedObject.identifier" class="form-control">
</div>
<div class="form-group">
<label>Title</label>
<input [(ngModel)]="selectedObject.title" class="form-control">
</div>
<div class="form-group">
<div><button (click)="save(selectedObject)" class="btn btn-small btn-default">Save</button></div>
</div>
</form>
</div>
</div>
</div>
| <div class="row">
<div class="col-md-3">
<input (keyup)="onKey($event)" class="form-control">
<ul *ngIf="objects" class="list-group" id="objectList">
<li *ngFor="#object of objects"
[class.selected]="selectedObject && (selectedObject.identifier === object.identifier)"
(click)="onSelect(object)" class="list-group-item">
<div class="title">{{object.title}}</div>
<div class="identifier">{{object.identifier}}</div>
<div class="status"
[class.synced]="object.synced"
[class.unsynced]="!object.synced"
>✓</div>
</li>
</ul>
</div>
<div class="col-md-9">
<div *ngIf="selectedObject">
<form>
<div class="form-group">
<label>Identifier</label>
<input [(ngModel)]="selectedObject.identifier" class="form-control">
</div>
<div class="form-group">
<label>Title</label>
<input [(ngModel)]="selectedObject.title" class="form-control">
</div>
<div class="form-group">
<div><button (click)="save(selectedObject)" class="btn btn-small btn-default">Save</button></div>
</div>
</form>
</div>
</div>
</div>
| Remove technical id from view. | Remove technical id from view.
| HTML | apache-2.0 | codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client | html | ## Code Before:
<div class="row">
<div class="col-md-3">
<input (keyup)="onKey($event)" class="form-control">
<ul *ngIf="objects" class="list-group" id="objectList">
<li *ngFor="#object of objects"
[class.selected]="selectedObject && (selectedObject.identifier === object.identifier)"
(click)="onSelect(object)" class="list-group-item">
<div class="title">{{object.title}}</div>
<div class="identifier">{{object.identifier}}</div>
<div class="status"
[class.synced]="object.synced"
[class.unsynced]="!object.synced"
>✓</div>
</li>
</ul>
</div>
<div class="col-md-9">
<div *ngIf="selectedObject">
<form>
<div class="form-group">
<label>ID</label>
<input [(ngModel)]="selectedObject._id" class="form-control" readonly>
</div>
<div class="form-group">
<label>Identifier</label>
<input [(ngModel)]="selectedObject.identifier" class="form-control">
</div>
<div class="form-group">
<label>Title</label>
<input [(ngModel)]="selectedObject.title" class="form-control">
</div>
<div class="form-group">
<div><button (click)="save(selectedObject)" class="btn btn-small btn-default">Save</button></div>
</div>
</form>
</div>
</div>
</div>
## Instruction:
Remove technical id from view.
## Code After:
<div class="row">
<div class="col-md-3">
<input (keyup)="onKey($event)" class="form-control">
<ul *ngIf="objects" class="list-group" id="objectList">
<li *ngFor="#object of objects"
[class.selected]="selectedObject && (selectedObject.identifier === object.identifier)"
(click)="onSelect(object)" class="list-group-item">
<div class="title">{{object.title}}</div>
<div class="identifier">{{object.identifier}}</div>
<div class="status"
[class.synced]="object.synced"
[class.unsynced]="!object.synced"
>✓</div>
</li>
</ul>
</div>
<div class="col-md-9">
<div *ngIf="selectedObject">
<form>
<div class="form-group">
<label>Identifier</label>
<input [(ngModel)]="selectedObject.identifier" class="form-control">
</div>
<div class="form-group">
<label>Title</label>
<input [(ngModel)]="selectedObject.title" class="form-control">
</div>
<div class="form-group">
<div><button (click)="save(selectedObject)" class="btn btn-small btn-default">Save</button></div>
</div>
</form>
</div>
</div>
</div>
| <div class="row">
<div class="col-md-3">
<input (keyup)="onKey($event)" class="form-control">
<ul *ngIf="objects" class="list-group" id="objectList">
<li *ngFor="#object of objects"
[class.selected]="selectedObject && (selectedObject.identifier === object.identifier)"
(click)="onSelect(object)" class="list-group-item">
<div class="title">{{object.title}}</div>
<div class="identifier">{{object.identifier}}</div>
<div class="status"
[class.synced]="object.synced"
[class.unsynced]="!object.synced"
>✓</div>
</li>
</ul>
</div>
<div class="col-md-9">
<div *ngIf="selectedObject">
<form>
<div class="form-group">
- <label>ID</label>
- <input [(ngModel)]="selectedObject._id" class="form-control" readonly>
- </div>
- <div class="form-group">
<label>Identifier</label>
<input [(ngModel)]="selectedObject.identifier" class="form-control">
</div>
<div class="form-group">
<label>Title</label>
<input [(ngModel)]="selectedObject.title" class="form-control">
</div>
<div class="form-group">
<div><button (click)="save(selectedObject)" class="btn btn-small btn-default">Save</button></div>
</div>
</form>
</div>
</div>
</div>
| 4 | 0.095238 | 0 | 4 |
4bdf651178b38b59bf15711cea65976185b5470f | spec/support/active_model_lint.rb | spec/support/active_model_lint.rb | require "active_model/lint"
require "test/unit/assertions"
shared_examples_for "ActiveModel" do
include ActiveModel::Lint::Tests
include Test::Unit::Assertions
before { @model = subject }
ActiveModel::Lint::Tests.public_instance_methods.map(&:to_s).grep(/^test/).each do |test|
example test.gsub("_", " ") do
send test
end
end
end
| require "active_model/lint"
require "test/unit/assertions"
shared_examples_for "ActiveModel" do
include ActiveModel::Lint::Tests
include Test::Unit::Assertions
attr_writer :assertions
def assertions
@assertions ||= 0
end
before { @model = subject }
ActiveModel::Lint::Tests.public_instance_methods.map(&:to_s).grep(/^test/).each do |test|
example test.gsub("_", " ") do
send test
end
end
end
| Update specs to pass with minitest 5 | Update specs to pass with minitest 5
| Ruby | mit | fiverr/active_attr,cgriego/active_attr,lloydk/active_attr,HaiTo/active_attr,estum/active_attr | ruby | ## Code Before:
require "active_model/lint"
require "test/unit/assertions"
shared_examples_for "ActiveModel" do
include ActiveModel::Lint::Tests
include Test::Unit::Assertions
before { @model = subject }
ActiveModel::Lint::Tests.public_instance_methods.map(&:to_s).grep(/^test/).each do |test|
example test.gsub("_", " ") do
send test
end
end
end
## Instruction:
Update specs to pass with minitest 5
## Code After:
require "active_model/lint"
require "test/unit/assertions"
shared_examples_for "ActiveModel" do
include ActiveModel::Lint::Tests
include Test::Unit::Assertions
attr_writer :assertions
def assertions
@assertions ||= 0
end
before { @model = subject }
ActiveModel::Lint::Tests.public_instance_methods.map(&:to_s).grep(/^test/).each do |test|
example test.gsub("_", " ") do
send test
end
end
end
| require "active_model/lint"
require "test/unit/assertions"
shared_examples_for "ActiveModel" do
include ActiveModel::Lint::Tests
include Test::Unit::Assertions
+ attr_writer :assertions
+
+ def assertions
+ @assertions ||= 0
+ end
before { @model = subject }
ActiveModel::Lint::Tests.public_instance_methods.map(&:to_s).grep(/^test/).each do |test|
example test.gsub("_", " ") do
send test
end
end
end | 5 | 0.333333 | 5 | 0 |
b2764b9ada2ca3bec548ceb82e71697f7515f14f | citrination_client/__init__.py | citrination_client/__init__.py | import os
import re
from citrination_client.base import *
from citrination_client.search import *
from citrination_client.data import *
from citrination_client.models import *
from citrination_client.views.descriptors import *
from .client import CitrinationClient
from pkg_resources import get_distribution, DistributionNotFound
def __get_version():
"""
Returns the version of this package, whether running from source or install
:return: The version of this package
"""
try:
# Try local first, if missing setup.py, then use pkg info
here = os.path.abspath(os.path.dirname(__file__))
print("here:"+here)
with open(os.path.join(here, "../setup.py")) as fp:
version_file = fp.read()
version_match = re.search(r"version=['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
except IOError:
pass
try:
_dist = get_distribution('citrination_client')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'citrination_client')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
raise RuntimeError("Unable to find version string.")
else:
return _dist.version
__version__ = __get_version()
| import os
import re
from citrination_client.base import *
from citrination_client.search import *
from citrination_client.data import *
from citrination_client.models import *
from citrination_client.views.descriptors import *
from .client import CitrinationClient
from pkg_resources import get_distribution, DistributionNotFound
def __get_version():
"""
Returns the version of this package, whether running from source or install
:return: The version of this package
"""
try:
# Try local first, if missing setup.py, then use pkg info
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "../setup.py")) as fp:
version_file = fp.read()
version_match = re.search(r"version=['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
except IOError:
pass
try:
_dist = get_distribution('citrination_client')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'citrination_client')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
raise RuntimeError("Unable to find version string.")
else:
return _dist.version
__version__ = __get_version()
| Remove debug print on getVersion | Remove debug print on getVersion
| Python | apache-2.0 | CitrineInformatics/python-citrination-client | python | ## Code Before:
import os
import re
from citrination_client.base import *
from citrination_client.search import *
from citrination_client.data import *
from citrination_client.models import *
from citrination_client.views.descriptors import *
from .client import CitrinationClient
from pkg_resources import get_distribution, DistributionNotFound
def __get_version():
"""
Returns the version of this package, whether running from source or install
:return: The version of this package
"""
try:
# Try local first, if missing setup.py, then use pkg info
here = os.path.abspath(os.path.dirname(__file__))
print("here:"+here)
with open(os.path.join(here, "../setup.py")) as fp:
version_file = fp.read()
version_match = re.search(r"version=['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
except IOError:
pass
try:
_dist = get_distribution('citrination_client')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'citrination_client')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
raise RuntimeError("Unable to find version string.")
else:
return _dist.version
__version__ = __get_version()
## Instruction:
Remove debug print on getVersion
## Code After:
import os
import re
from citrination_client.base import *
from citrination_client.search import *
from citrination_client.data import *
from citrination_client.models import *
from citrination_client.views.descriptors import *
from .client import CitrinationClient
from pkg_resources import get_distribution, DistributionNotFound
def __get_version():
"""
Returns the version of this package, whether running from source or install
:return: The version of this package
"""
try:
# Try local first, if missing setup.py, then use pkg info
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "../setup.py")) as fp:
version_file = fp.read()
version_match = re.search(r"version=['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
except IOError:
pass
try:
_dist = get_distribution('citrination_client')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'citrination_client')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
raise RuntimeError("Unable to find version string.")
else:
return _dist.version
__version__ = __get_version()
| import os
import re
from citrination_client.base import *
from citrination_client.search import *
from citrination_client.data import *
from citrination_client.models import *
from citrination_client.views.descriptors import *
from .client import CitrinationClient
from pkg_resources import get_distribution, DistributionNotFound
def __get_version():
"""
Returns the version of this package, whether running from source or install
:return: The version of this package
"""
try:
# Try local first, if missing setup.py, then use pkg info
here = os.path.abspath(os.path.dirname(__file__))
- print("here:"+here)
with open(os.path.join(here, "../setup.py")) as fp:
version_file = fp.read()
version_match = re.search(r"version=['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
except IOError:
pass
try:
_dist = get_distribution('citrination_client')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'citrination_client')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
raise RuntimeError("Unable to find version string.")
else:
return _dist.version
__version__ = __get_version() | 1 | 0.023256 | 0 | 1 |
e117d4cc60550c6c4da0f9ff6502043cab000e71 | circle.yml | circle.yml | machine:
node:
version: 7 | machine:
node:
version: 7
deployment:
dev:
branch: master
commands:
- pm2 deploy | Add deployment step on CI | Add deployment step on CI
| YAML | mit | mycsHQ/reviewly,mycsHQ/reviewly | yaml | ## Code Before:
machine:
node:
version: 7
## Instruction:
Add deployment step on CI
## Code After:
machine:
node:
version: 7
deployment:
dev:
branch: master
commands:
- pm2 deploy | machine:
node:
version: 7
+
+ deployment:
+ dev:
+ branch: master
+ commands:
+ - pm2 deploy | 6 | 2 | 6 | 0 |
527403397ba06f09f0278e370f4e7b87386d6106 | wav/wav_test.go | wav/wav_test.go | package wav
import (
"fmt"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestBasicWav(t *testing.T) {
fmt.Println("Running Basic Wav")
f, err := os.Open("test.wav")
fmt.Println(f)
require.Nil(t, err)
a, err := Load(f)
require.Nil(t, err)
err = <-a.Play()
require.Nil(t, err)
time.Sleep(4 * time.Second)
// In addition to the error tests here, this should play noise
}
| package wav
import (
"fmt"
"os"
"testing"
"time"
)
func TestBasicWav(t *testing.T) {
fmt.Println("Running Basic Wav")
f, err := os.Open("test.wav")
fmt.Println(f)
if err != nil {
t.Fatal("expected open err to be nil, was", err)
}
a, err := Load(f)
if err != nil {
t.Fatal("expected load err to be nil, was", err)
}
err = <-a.Play()
if err != nil {
t.Fatal("expected play err to be nil, was", err)
}
time.Sleep(4 * time.Second)
// In addition to the error tests here, this should play noise
}
| Remove require from wav test | Remove require from wav test
testify requires cgo on linux without certain go debug flags set. We should stop using it.
| Go | apache-2.0 | 200sc/klangsynthese | go | ## Code Before:
package wav
import (
"fmt"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestBasicWav(t *testing.T) {
fmt.Println("Running Basic Wav")
f, err := os.Open("test.wav")
fmt.Println(f)
require.Nil(t, err)
a, err := Load(f)
require.Nil(t, err)
err = <-a.Play()
require.Nil(t, err)
time.Sleep(4 * time.Second)
// In addition to the error tests here, this should play noise
}
## Instruction:
Remove require from wav test
testify requires cgo on linux without certain go debug flags set. We should stop using it.
## Code After:
package wav
import (
"fmt"
"os"
"testing"
"time"
)
func TestBasicWav(t *testing.T) {
fmt.Println("Running Basic Wav")
f, err := os.Open("test.wav")
fmt.Println(f)
if err != nil {
t.Fatal("expected open err to be nil, was", err)
}
a, err := Load(f)
if err != nil {
t.Fatal("expected load err to be nil, was", err)
}
err = <-a.Play()
if err != nil {
t.Fatal("expected play err to be nil, was", err)
}
time.Sleep(4 * time.Second)
// In addition to the error tests here, this should play noise
}
| package wav
import (
"fmt"
"os"
"testing"
"time"
-
- "github.com/stretchr/testify/require"
)
func TestBasicWav(t *testing.T) {
fmt.Println("Running Basic Wav")
f, err := os.Open("test.wav")
fmt.Println(f)
- require.Nil(t, err)
+ if err != nil {
+ t.Fatal("expected open err to be nil, was", err)
+ }
a, err := Load(f)
- require.Nil(t, err)
+ if err != nil {
+ t.Fatal("expected load err to be nil, was", err)
+ }
err = <-a.Play()
- require.Nil(t, err)
+ if err != nil {
+ t.Fatal("expected play err to be nil, was", err)
+ }
time.Sleep(4 * time.Second)
// In addition to the error tests here, this should play noise
} | 14 | 0.608696 | 9 | 5 |
e547a5c06500453e4bc14f9e9fed0febac3a098c | pages/blog/_slug/index.vue | pages/blog/_slug/index.vue | <template>
<main>
<header>
<h1>{{ post_title }}</h1>
<date-time-stamp :date="post_date" />
</header>
<section class="page-content" v-html="post_content"></section>
<div class="comments">
<vue-disqus
:shortname="disqus_shortname"
:identifier="post_uid"
:url="`${site_root_url}/${$nuxt.$route.path}`"
></vue-disqus>
</div>
</main>
</template>
<script>
import DateTimeStamp from '../../../components/DateTimeStamp.vue'
import { queryForDocType, generatePageData } from '@/prismic.config'
import makeMetaTags from '@/helpers/makeMetaTags'
export default {
components: { DateTimeStamp },
head() {
console.log(this.post_social_media_image)
return {
title: this.post_title,
meta: makeMetaTags(
this.post_title,
this.post_tldr,
this.post_social_media_image
)
}
},
async asyncData({ payload, params }) {
let pageData
if (payload) {
pageData = payload
} else {
const apiData = await queryForDocType(params.slug, 'my.blog_post.uid')
pageData = apiData.results[0]
}
return generatePageData('blog_post', pageData)
}
}
</script>
| <template>
<main>
<header>
<h1>{{ post_title }}</h1>
<date-time-stamp :date="post_date" />
</header>
<section class="page-content" v-html="post_content"></section>
<div class="comments">
<vue-disqus
:shortname="disqus_shortname"
:identifier="post_uid"
:url="`${site_root_url}/${$nuxt.$route.path}`"
></vue-disqus>
</div>
</main>
</template>
<script>
import DateTimeStamp from '../../../components/DateTimeStamp.vue'
import { queryForDocType, generatePageData } from '@/prismic.config'
import makeMetaTags from '@/helpers/makeMetaTags'
export default {
components: { DateTimeStamp },
head() {
return {
title: this.post_title,
meta: makeMetaTags(
this.post_title,
this.post_tldr,
this.post_social_media_image
)
}
},
async asyncData({ payload, params }) {
let pageData
if (payload) {
pageData = payload
} else {
const apiData = await queryForDocType(params.slug, 'my.blog_post.uid')
pageData = apiData.results[0]
}
return generatePageData('blog_post', pageData)
}
}
</script>
| Fix dependency issues and remove console statement 🧹 | Fix dependency issues and remove console statement 🧹
| Vue | mit | Jack-Barry/Jack-Barry.github.io | vue | ## Code Before:
<template>
<main>
<header>
<h1>{{ post_title }}</h1>
<date-time-stamp :date="post_date" />
</header>
<section class="page-content" v-html="post_content"></section>
<div class="comments">
<vue-disqus
:shortname="disqus_shortname"
:identifier="post_uid"
:url="`${site_root_url}/${$nuxt.$route.path}`"
></vue-disqus>
</div>
</main>
</template>
<script>
import DateTimeStamp from '../../../components/DateTimeStamp.vue'
import { queryForDocType, generatePageData } from '@/prismic.config'
import makeMetaTags from '@/helpers/makeMetaTags'
export default {
components: { DateTimeStamp },
head() {
console.log(this.post_social_media_image)
return {
title: this.post_title,
meta: makeMetaTags(
this.post_title,
this.post_tldr,
this.post_social_media_image
)
}
},
async asyncData({ payload, params }) {
let pageData
if (payload) {
pageData = payload
} else {
const apiData = await queryForDocType(params.slug, 'my.blog_post.uid')
pageData = apiData.results[0]
}
return generatePageData('blog_post', pageData)
}
}
</script>
## Instruction:
Fix dependency issues and remove console statement 🧹
## Code After:
<template>
<main>
<header>
<h1>{{ post_title }}</h1>
<date-time-stamp :date="post_date" />
</header>
<section class="page-content" v-html="post_content"></section>
<div class="comments">
<vue-disqus
:shortname="disqus_shortname"
:identifier="post_uid"
:url="`${site_root_url}/${$nuxt.$route.path}`"
></vue-disqus>
</div>
</main>
</template>
<script>
import DateTimeStamp from '../../../components/DateTimeStamp.vue'
import { queryForDocType, generatePageData } from '@/prismic.config'
import makeMetaTags from '@/helpers/makeMetaTags'
export default {
components: { DateTimeStamp },
head() {
return {
title: this.post_title,
meta: makeMetaTags(
this.post_title,
this.post_tldr,
this.post_social_media_image
)
}
},
async asyncData({ payload, params }) {
let pageData
if (payload) {
pageData = payload
} else {
const apiData = await queryForDocType(params.slug, 'my.blog_post.uid')
pageData = apiData.results[0]
}
return generatePageData('blog_post', pageData)
}
}
</script>
| <template>
<main>
<header>
<h1>{{ post_title }}</h1>
<date-time-stamp :date="post_date" />
</header>
<section class="page-content" v-html="post_content"></section>
<div class="comments">
<vue-disqus
:shortname="disqus_shortname"
:identifier="post_uid"
:url="`${site_root_url}/${$nuxt.$route.path}`"
></vue-disqus>
</div>
</main>
</template>
<script>
import DateTimeStamp from '../../../components/DateTimeStamp.vue'
import { queryForDocType, generatePageData } from '@/prismic.config'
import makeMetaTags from '@/helpers/makeMetaTags'
export default {
components: { DateTimeStamp },
head() {
- console.log(this.post_social_media_image)
return {
title: this.post_title,
meta: makeMetaTags(
this.post_title,
this.post_tldr,
this.post_social_media_image
)
}
},
async asyncData({ payload, params }) {
let pageData
if (payload) {
pageData = payload
} else {
const apiData = await queryForDocType(params.slug, 'my.blog_post.uid')
pageData = apiData.results[0]
}
return generatePageData('blog_post', pageData)
}
}
</script> | 1 | 0.020833 | 0 | 1 |
3c50a86625495082f68aa09c5580b702696c1684 | lib/romaji_kit/cli.rb | lib/romaji_kit/cli.rb | require 'thor'
module RomajiKit
class CLI < Thor
desc 'hepburnize', 'Convert kana to hepburn'
option :upcase, type: :boolean, aliases: '-u'
def hepburnize(text)
puts Converter.hepburnize(text, options[:upcase])
end
end
CLI.start
end
| require 'thor'
module RomajiKit
class CLI < Thor
class_option :upcase, type: :boolean, aliases: '-u'
desc 'hepburnize', 'Convert kana to hepburn'
def hepburnize(text)
puts Converter.hepburnize(text, options[:upcase])
end
desc 'nihon', 'Convert kana to Nihon-shiki romaji'
def nihon(text)
puts Converter.nihon(text, options[:upcase])
end
end
CLI.start
end
| Add `nihon` method for CLI | Add `nihon` method for CLI
| Ruby | mit | emsk/romaji_kit,emsk/romaji_kit,emsk/romajify,emsk/romajify | ruby | ## Code Before:
require 'thor'
module RomajiKit
class CLI < Thor
desc 'hepburnize', 'Convert kana to hepburn'
option :upcase, type: :boolean, aliases: '-u'
def hepburnize(text)
puts Converter.hepburnize(text, options[:upcase])
end
end
CLI.start
end
## Instruction:
Add `nihon` method for CLI
## Code After:
require 'thor'
module RomajiKit
class CLI < Thor
class_option :upcase, type: :boolean, aliases: '-u'
desc 'hepburnize', 'Convert kana to hepburn'
def hepburnize(text)
puts Converter.hepburnize(text, options[:upcase])
end
desc 'nihon', 'Convert kana to Nihon-shiki romaji'
def nihon(text)
puts Converter.nihon(text, options[:upcase])
end
end
CLI.start
end
| require 'thor'
module RomajiKit
class CLI < Thor
+ class_option :upcase, type: :boolean, aliases: '-u'
+
desc 'hepburnize', 'Convert kana to hepburn'
- option :upcase, type: :boolean, aliases: '-u'
def hepburnize(text)
puts Converter.hepburnize(text, options[:upcase])
+ end
+
+ desc 'nihon', 'Convert kana to Nihon-shiki romaji'
+ def nihon(text)
+ puts Converter.nihon(text, options[:upcase])
end
end
CLI.start
end | 8 | 0.615385 | 7 | 1 |
f6ae89f138491e6babe21abb3d1845cdf54b898b | Cargo.toml | Cargo.toml | [package]
name = "webbrowser"
description = "Open URLs in web browsers available on a platform"
version = "0.3.1"
authors = ["Amod Malviya @amodm"]
documentation = "http://code.rootnet.in/webbrowser-rs/webbrowser"
homepage = "https://github.com/amodm/webbrowser-rs"
repository = "https://github.com/amodm/webbrowser-rs"
readme = "README.md"
keywords = ["webbrowser", "browser"]
license = "MIT OR Apache-2.0"
edition = "2015"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.6", features = ["combaseapi", "objbase", "shellapi", "winerror"] }
| [package]
name = "webbrowser"
description = "Open URLs in web browsers available on a platform"
version = "0.3.1"
authors = ["Amod Malviya @amodm"]
documentation = "http://code.rootnet.in/webbrowser-rs/webbrowser"
homepage = "https://github.com/amodm/webbrowser-rs"
repository = "https://github.com/amodm/webbrowser-rs"
readme = "README.md"
keywords = ["webbrowser", "browser"]
license = "MIT OR Apache-2.0"
edition = "2015"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.6", features = ["combaseapi", "objbase", "shellapi", "winerror"] }
widestring = "0.4.0"
| Fix windows build - add missing crate | Fix windows build - add missing crate
| TOML | apache-2.0 | amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs | toml | ## Code Before:
[package]
name = "webbrowser"
description = "Open URLs in web browsers available on a platform"
version = "0.3.1"
authors = ["Amod Malviya @amodm"]
documentation = "http://code.rootnet.in/webbrowser-rs/webbrowser"
homepage = "https://github.com/amodm/webbrowser-rs"
repository = "https://github.com/amodm/webbrowser-rs"
readme = "README.md"
keywords = ["webbrowser", "browser"]
license = "MIT OR Apache-2.0"
edition = "2015"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.6", features = ["combaseapi", "objbase", "shellapi", "winerror"] }
## Instruction:
Fix windows build - add missing crate
## Code After:
[package]
name = "webbrowser"
description = "Open URLs in web browsers available on a platform"
version = "0.3.1"
authors = ["Amod Malviya @amodm"]
documentation = "http://code.rootnet.in/webbrowser-rs/webbrowser"
homepage = "https://github.com/amodm/webbrowser-rs"
repository = "https://github.com/amodm/webbrowser-rs"
readme = "README.md"
keywords = ["webbrowser", "browser"]
license = "MIT OR Apache-2.0"
edition = "2015"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.6", features = ["combaseapi", "objbase", "shellapi", "winerror"] }
widestring = "0.4.0"
| [package]
name = "webbrowser"
description = "Open URLs in web browsers available on a platform"
version = "0.3.1"
authors = ["Amod Malviya @amodm"]
documentation = "http://code.rootnet.in/webbrowser-rs/webbrowser"
homepage = "https://github.com/amodm/webbrowser-rs"
repository = "https://github.com/amodm/webbrowser-rs"
readme = "README.md"
keywords = ["webbrowser", "browser"]
license = "MIT OR Apache-2.0"
edition = "2015"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.6", features = ["combaseapi", "objbase", "shellapi", "winerror"] }
+ widestring = "0.4.0" | 1 | 0.066667 | 1 | 0 |
e27c2dfeeb1a3fcfc2ebeb6ed9e1a348960d5a91 | app/components/settings/area-detail/styles.js | app/components/settings/area-detail/styles.js | import Theme from 'config/theme';
import { StyleSheet } from 'react-native';
export default StyleSheet.create({
container: {
flex: 1,
backgroundColor: Theme.background.main
},
containerContent: {
paddingTop: 10
},
input: {
flex: 1
},
buttonContainer: {
padding: 10
},
imageContainer: {
backgroundColor: Theme.background.modal,
alignItems: 'center',
justifyContent: 'center'
},
image: {
width: 360,
height: 200,
resizeMode: 'cover'
},
title: {
marginLeft: Theme.margin.left,
marginRight: Theme.margin.right,
color: Theme.fontColors.light,
fontFamily: Theme.font,
fontSize: 17
},
row: {
marginTop: 16
},
section: {
flex: 1,
height: 64,
paddingLeft: Theme.margin.left,
paddingRight: Theme.margin.right,
backgroundColor: Theme.colors.color5,
borderBottomColor: Theme.borderColors.main,
borderBottomWidth: 2,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
},
name: {
width: 200,
height: 22,
fontFamily: Theme.font,
color: Theme.fontColors.secondary,
fontSize: 17,
fontWeight: '400'
}
});
| import Theme from 'config/theme';
import { StyleSheet } from 'react-native';
export default StyleSheet.create({
container: {
flex: 1,
backgroundColor: Theme.background.main
},
containerContent: {
paddingTop: 10
},
input: {
flex: 1,
fontSize: 17,
color: Theme.fontColors.secondary,
paddingTop: 14,
marginLeft: -4
},
buttonContainer: {
padding: 10
},
imageContainer: {
backgroundColor: Theme.background.modal,
alignItems: 'center',
justifyContent: 'center'
},
image: {
width: 360,
height: 200,
resizeMode: 'cover'
},
title: {
marginLeft: Theme.margin.left,
marginRight: Theme.margin.right,
color: Theme.fontColors.light,
fontFamily: Theme.font,
fontSize: 17
},
row: {
marginTop: 16
},
section: {
flex: 1,
height: 64,
paddingLeft: Theme.margin.left,
paddingRight: Theme.margin.right,
backgroundColor: Theme.colors.color5,
borderBottomColor: Theme.borderColors.main,
borderBottomWidth: 2,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
},
name: {
width: 200,
height: 22,
fontFamily: Theme.font,
color: Theme.fontColors.secondary,
fontSize: 17,
fontWeight: '400'
}
});
| Align input and not input text | Align input and not input text
| JavaScript | mit | Vizzuality/forest-watcher,Vizzuality/forest-watcher,Vizzuality/forest-watcher,Vizzuality/forest-watcher,Vizzuality/forest-watcher | javascript | ## Code Before:
import Theme from 'config/theme';
import { StyleSheet } from 'react-native';
export default StyleSheet.create({
container: {
flex: 1,
backgroundColor: Theme.background.main
},
containerContent: {
paddingTop: 10
},
input: {
flex: 1
},
buttonContainer: {
padding: 10
},
imageContainer: {
backgroundColor: Theme.background.modal,
alignItems: 'center',
justifyContent: 'center'
},
image: {
width: 360,
height: 200,
resizeMode: 'cover'
},
title: {
marginLeft: Theme.margin.left,
marginRight: Theme.margin.right,
color: Theme.fontColors.light,
fontFamily: Theme.font,
fontSize: 17
},
row: {
marginTop: 16
},
section: {
flex: 1,
height: 64,
paddingLeft: Theme.margin.left,
paddingRight: Theme.margin.right,
backgroundColor: Theme.colors.color5,
borderBottomColor: Theme.borderColors.main,
borderBottomWidth: 2,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
},
name: {
width: 200,
height: 22,
fontFamily: Theme.font,
color: Theme.fontColors.secondary,
fontSize: 17,
fontWeight: '400'
}
});
## Instruction:
Align input and not input text
## Code After:
import Theme from 'config/theme';
import { StyleSheet } from 'react-native';
export default StyleSheet.create({
container: {
flex: 1,
backgroundColor: Theme.background.main
},
containerContent: {
paddingTop: 10
},
input: {
flex: 1,
fontSize: 17,
color: Theme.fontColors.secondary,
paddingTop: 14,
marginLeft: -4
},
buttonContainer: {
padding: 10
},
imageContainer: {
backgroundColor: Theme.background.modal,
alignItems: 'center',
justifyContent: 'center'
},
image: {
width: 360,
height: 200,
resizeMode: 'cover'
},
title: {
marginLeft: Theme.margin.left,
marginRight: Theme.margin.right,
color: Theme.fontColors.light,
fontFamily: Theme.font,
fontSize: 17
},
row: {
marginTop: 16
},
section: {
flex: 1,
height: 64,
paddingLeft: Theme.margin.left,
paddingRight: Theme.margin.right,
backgroundColor: Theme.colors.color5,
borderBottomColor: Theme.borderColors.main,
borderBottomWidth: 2,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
},
name: {
width: 200,
height: 22,
fontFamily: Theme.font,
color: Theme.fontColors.secondary,
fontSize: 17,
fontWeight: '400'
}
});
| import Theme from 'config/theme';
import { StyleSheet } from 'react-native';
export default StyleSheet.create({
container: {
flex: 1,
backgroundColor: Theme.background.main
},
containerContent: {
paddingTop: 10
},
input: {
- flex: 1
+ flex: 1,
? +
+ fontSize: 17,
+ color: Theme.fontColors.secondary,
+ paddingTop: 14,
+ marginLeft: -4
},
buttonContainer: {
padding: 10
},
imageContainer: {
backgroundColor: Theme.background.modal,
alignItems: 'center',
justifyContent: 'center'
},
image: {
width: 360,
height: 200,
resizeMode: 'cover'
},
title: {
marginLeft: Theme.margin.left,
marginRight: Theme.margin.right,
color: Theme.fontColors.light,
fontFamily: Theme.font,
fontSize: 17
},
row: {
marginTop: 16
},
section: {
flex: 1,
height: 64,
paddingLeft: Theme.margin.left,
paddingRight: Theme.margin.right,
backgroundColor: Theme.colors.color5,
borderBottomColor: Theme.borderColors.main,
borderBottomWidth: 2,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
},
name: {
width: 200,
height: 22,
fontFamily: Theme.font,
color: Theme.fontColors.secondary,
fontSize: 17,
fontWeight: '400'
}
}); | 6 | 0.103448 | 5 | 1 |
40b19a6a331d349635e860d026c6749bccafd1d4 | lib/percy/client/resources.rb | lib/percy/client/resources.rb | require 'base64'
require 'digest'
module Percy
class Client
# A simple data container object used to pass data to create_snapshot.
class Resource
attr_accessor :sha
attr_accessor :resource_url
attr_accessor :is_root
attr_accessor :mimetype
def initialize(sha, resource_url, options = {})
@sha = sha
@resource_url = resource_url
@is_root = options[:is_root]
@mimetype = options[:mimetype]
end
def serialize
{
'type' => 'resources',
'id' => sha,
'resource-url' => resource_url,
'mimetype' => mimetype,
'is-root' => is_root,
}
end
end
module Resources
def upload_resource(build_id, content)
sha = Digest::SHA256.hexdigest(content)
data = {
'data' => {
'type' => 'resources',
'attributes' => {
'id' => sha,
'base64-content' => Base64.strict_encode64(content),
},
},
}
begin
post("#{full_base}/builds/#{build_id}/resources/", data)
rescue Percy::Client::ClientError => e
raise e if e.env.status != 409
STDERR.puts "[percy] Warning: unnecessary resource reuploaded with SHA-256: #{sha}"
end
true
end
end
end
end
| require 'base64'
require 'digest'
module Percy
class Client
# A simple data container object used to pass data to create_snapshot.
class Resource
attr_accessor :sha
attr_accessor :resource_url
attr_accessor :is_root
attr_accessor :mimetype
attr_accessor :content
def initialize(sha, resource_url, options = {})
@sha = sha
@resource_url = resource_url
@is_root = options[:is_root]
@mimetype = options[:mimetype]
# For user convenience of temporarily storing content with other data, but the actual data
# is never included when serialized.
@content = options[:content]
end
def serialize
{
'type' => 'resources',
'id' => sha,
'resource-url' => resource_url,
'mimetype' => mimetype,
'is-root' => is_root,
}
end
end
module Resources
def upload_resource(build_id, content)
sha = Digest::SHA256.hexdigest(content)
data = {
'data' => {
'type' => 'resources',
'attributes' => {
'id' => sha,
'base64-content' => Base64.strict_encode64(content),
},
},
}
begin
post("#{full_base}/builds/#{build_id}/resources/", data)
rescue Percy::Client::ClientError => e
raise e if e.env.status != 409
STDERR.puts "[percy] Warning: unnecessary resource reuploaded with SHA-256: #{sha}"
end
true
end
end
end
end
| Add ability to hold content in Resource container. | Add ability to hold content in Resource container.
| Ruby | mit | percy/percy-client,elia/percy-client | ruby | ## Code Before:
require 'base64'
require 'digest'
module Percy
class Client
# A simple data container object used to pass data to create_snapshot.
class Resource
attr_accessor :sha
attr_accessor :resource_url
attr_accessor :is_root
attr_accessor :mimetype
def initialize(sha, resource_url, options = {})
@sha = sha
@resource_url = resource_url
@is_root = options[:is_root]
@mimetype = options[:mimetype]
end
def serialize
{
'type' => 'resources',
'id' => sha,
'resource-url' => resource_url,
'mimetype' => mimetype,
'is-root' => is_root,
}
end
end
module Resources
def upload_resource(build_id, content)
sha = Digest::SHA256.hexdigest(content)
data = {
'data' => {
'type' => 'resources',
'attributes' => {
'id' => sha,
'base64-content' => Base64.strict_encode64(content),
},
},
}
begin
post("#{full_base}/builds/#{build_id}/resources/", data)
rescue Percy::Client::ClientError => e
raise e if e.env.status != 409
STDERR.puts "[percy] Warning: unnecessary resource reuploaded with SHA-256: #{sha}"
end
true
end
end
end
end
## Instruction:
Add ability to hold content in Resource container.
## Code After:
require 'base64'
require 'digest'
module Percy
class Client
# A simple data container object used to pass data to create_snapshot.
class Resource
attr_accessor :sha
attr_accessor :resource_url
attr_accessor :is_root
attr_accessor :mimetype
attr_accessor :content
def initialize(sha, resource_url, options = {})
@sha = sha
@resource_url = resource_url
@is_root = options[:is_root]
@mimetype = options[:mimetype]
# For user convenience of temporarily storing content with other data, but the actual data
# is never included when serialized.
@content = options[:content]
end
def serialize
{
'type' => 'resources',
'id' => sha,
'resource-url' => resource_url,
'mimetype' => mimetype,
'is-root' => is_root,
}
end
end
module Resources
def upload_resource(build_id, content)
sha = Digest::SHA256.hexdigest(content)
data = {
'data' => {
'type' => 'resources',
'attributes' => {
'id' => sha,
'base64-content' => Base64.strict_encode64(content),
},
},
}
begin
post("#{full_base}/builds/#{build_id}/resources/", data)
rescue Percy::Client::ClientError => e
raise e if e.env.status != 409
STDERR.puts "[percy] Warning: unnecessary resource reuploaded with SHA-256: #{sha}"
end
true
end
end
end
end
| require 'base64'
require 'digest'
module Percy
class Client
# A simple data container object used to pass data to create_snapshot.
class Resource
attr_accessor :sha
attr_accessor :resource_url
attr_accessor :is_root
attr_accessor :mimetype
+ attr_accessor :content
def initialize(sha, resource_url, options = {})
@sha = sha
@resource_url = resource_url
@is_root = options[:is_root]
@mimetype = options[:mimetype]
+
+ # For user convenience of temporarily storing content with other data, but the actual data
+ # is never included when serialized.
+ @content = options[:content]
end
def serialize
{
'type' => 'resources',
'id' => sha,
'resource-url' => resource_url,
'mimetype' => mimetype,
'is-root' => is_root,
}
end
end
module Resources
def upload_resource(build_id, content)
sha = Digest::SHA256.hexdigest(content)
data = {
'data' => {
'type' => 'resources',
'attributes' => {
'id' => sha,
'base64-content' => Base64.strict_encode64(content),
},
},
}
begin
post("#{full_base}/builds/#{build_id}/resources/", data)
rescue Percy::Client::ClientError => e
raise e if e.env.status != 409
STDERR.puts "[percy] Warning: unnecessary resource reuploaded with SHA-256: #{sha}"
end
true
end
end
end
end | 5 | 0.092593 | 5 | 0 |
82a86d909f37ec3d5349d03f80c5f0c432e32c08 | src/resources/js/modules/enso/__.js | src/resources/js/modules/enso/__.js | import store from '../../store';
const __ = store.getters[ 'localisation/__' ];
export default function (key, params) {
if (!store.getters[ 'localisation/isInitialised' ]) {
return key;
}
let translation = __(key);
if (typeof translation === 'undefined'
&& store.state.localisation.keyCollector) {
store.dispatch('localisation/addMissingKey', key);
}
translation = translation || key;
if(params) {
translation = translation.replace(/:(\w*)/g, function(e, key) {
let param = params[key.toLowerCase()] || key;
if(key === key.toUpperCase()) { // param is uppercased
param = param.toUpperCase();
} else if(key[0] === key[0].toUpperCase()) { // first letter is uppercased
param = param.charAt(0).toUpperCase() + param.slice(1);
}
return param;
});
}
return translation;
}
| import store from '../../store';
export default (key, params = null) => {
if (!store.getters['localisation/isInitialised']) {
return key;
}
let translation = store.getters['localisation/__'](key);
if (typeof translation === 'undefined' || translation == null) {
translation = key;
if (store.state.localisation.keyCollector) {
store.dispatch('localisation/addMissingKey', key);
}
}
return !!params && typeof params === 'object'
? translation.replace(/:(\w*)/g, (e, key) => {
if (typeof params[key.toLowerCase()] === 'undefined') {
return key;
}
const param = params[key.toLowerCase()];
if(key === key.toUpperCase()) {
return param.toUpperCase();
}
return key[0] === key[0].toUpperCase()
? param.charAt(0).toUpperCase() + param.slice(1)
: param;
})
: translation;
}
| Implement proposed changes + add `== null` check | Implement proposed changes + add `== null` check | JavaScript | mit | laravel-enso/Core,laravel-enso/Core | javascript | ## Code Before:
import store from '../../store';
const __ = store.getters[ 'localisation/__' ];
export default function (key, params) {
if (!store.getters[ 'localisation/isInitialised' ]) {
return key;
}
let translation = __(key);
if (typeof translation === 'undefined'
&& store.state.localisation.keyCollector) {
store.dispatch('localisation/addMissingKey', key);
}
translation = translation || key;
if(params) {
translation = translation.replace(/:(\w*)/g, function(e, key) {
let param = params[key.toLowerCase()] || key;
if(key === key.toUpperCase()) { // param is uppercased
param = param.toUpperCase();
} else if(key[0] === key[0].toUpperCase()) { // first letter is uppercased
param = param.charAt(0).toUpperCase() + param.slice(1);
}
return param;
});
}
return translation;
}
## Instruction:
Implement proposed changes + add `== null` check
## Code After:
import store from '../../store';
export default (key, params = null) => {
if (!store.getters['localisation/isInitialised']) {
return key;
}
let translation = store.getters['localisation/__'](key);
if (typeof translation === 'undefined' || translation == null) {
translation = key;
if (store.state.localisation.keyCollector) {
store.dispatch('localisation/addMissingKey', key);
}
}
return !!params && typeof params === 'object'
? translation.replace(/:(\w*)/g, (e, key) => {
if (typeof params[key.toLowerCase()] === 'undefined') {
return key;
}
const param = params[key.toLowerCase()];
if(key === key.toUpperCase()) {
return param.toUpperCase();
}
return key[0] === key[0].toUpperCase()
? param.charAt(0).toUpperCase() + param.slice(1)
: param;
})
: translation;
}
| import store from '../../store';
- const __ = store.getters[ 'localisation/__' ];
-
- export default function (key, params) {
? ---------
+ export default (key, params = null) => {
? +++++++ +++
- if (!store.getters[ 'localisation/isInitialised' ]) {
? - -
+ if (!store.getters['localisation/isInitialised']) {
return key;
}
- let translation = __(key);
+ let translation = store.getters['localisation/__'](key);
- if (typeof translation === 'undefined'
+ if (typeof translation === 'undefined' || translation == null) {
? ++++++++++++++++++++++++++
+ translation = key;
+
- && store.state.localisation.keyCollector) {
? ^^
+ if (store.state.localisation.keyCollector) {
? ^^ +
- store.dispatch('localisation/addMissingKey', key);
+ store.dispatch('localisation/addMissingKey', key);
? ++++
+ }
}
+ return !!params && typeof params === 'object'
- translation = translation || key;
- if(params) {
- translation = translation.replace(/:(\w*)/g, function(e, key) {
? ^^^^^^^^^^^^^ --------
+ ? translation.replace(/:(\w*)/g, (e, key) => {
? ^ +++
+ if (typeof params[key.toLowerCase()] === 'undefined') {
+ return key;
- let param = params[key.toLowerCase()] || key;
- if(key === key.toUpperCase()) { // param is uppercased
- param = param.toUpperCase();
- } else if(key[0] === key[0].toUpperCase()) { // first letter is uppercased
- param = param.charAt(0).toUpperCase() + param.slice(1);
}
+
+ const param = params[key.toLowerCase()];
+
+ if(key === key.toUpperCase()) {
+ return param.toUpperCase();
+ }
+
+ return key[0] === key[0].toUpperCase()
+ ? param.charAt(0).toUpperCase() + param.slice(1)
- return param;
? ^^^^^^
+ : param;
? ^^^^^
- });
? -
+ })
- }
- return translation;
? ^^^^^^
+ : translation;
? ^^^^^
} | 45 | 1.5 | 25 | 20 |
0727ed1ba7266da4ee5bfa6bbb069ac97460267a | spec/support/helpers.rb | spec/support/helpers.rb | module Helpers
# Creates `n` users as members of `space`
def self.create_fellows(n, space)
users = []
n.times do
u = FactoryGirl.create(:user)
space.add_member! u
users.push u
end
users
end
def self.setup_site_for_email_tests
attributes = {
:smtp_sender => Faker::Internet.email,
:name => Faker::Name.name
}
Site.current.update_attributes(attributes)
end
module ClassMethods
# Sets the custom actions that should also be checked by
# the matcher BeAbleToDoAnythingToMatcher
def set_custom_ability_actions(actions)
before(:each) do
Shoulda::Matchers::ActiveModel::BeAbleToDoAnythingToMatcher.
custom_actions = actions
end
end
end
end
| module Helpers
# Creates `n` users as members of `space`
def self.create_fellows(n, space)
users = []
n.times do
u = FactoryGirl.create(:user)
space.add_member! u
users.push u
end
users
end
def self.setup_site_for_email_tests
attributes = {
:locale => "en",
:smtp_sender => Faker::Internet.email,
:name => Faker::Name.name
}
Site.current.update_attributes(attributes)
end
module ClassMethods
# Sets the custom actions that should also be checked by
# the matcher BeAbleToDoAnythingToMatcher
def set_custom_ability_actions(actions)
before(:each) do
Shoulda::Matchers::ActiveModel::BeAbleToDoAnythingToMatcher.
custom_actions = actions
end
end
end
end
| Fix failing tests on some mailers | Fix failing tests on some mailers
| Ruby | agpl-3.0 | akratech/Akraconference,becueb/MconfWeb,mconf-rnp/mconf-web,mconf-rnp/mconf-web,mconf-rnp/mconf-web,mconf/mconf-web,fbottin/mconf-web,mconftec/mconf-web-santacasa,becueb/MconfWeb,amreis/mconf-web,mconftec/mconf-web-mytruecloud,amreis/mconf-web,mconftec/mconf-web-uergs,akratech/Akraconference,mconftec/mconf-web-uergs,mconf-ufrgs/mconf-web,mconftec/mconf-web-ufpe,amreis/mconf-web,mconftec/mconf-web-cedia,akratech/Akraconference,lfzawacki/mconf-web,mconftec/mconf-web-santacasa,becueb/MconfWeb,mconftec/mconf-web-mytruecloud,akratech/Akraconference,mconf-ufrgs/mconf-web,mconftec/mconf-web-uergs,fbottin/mconf-web,becueb/MconfWeb,mconftec/mconf-web-ufpe,mconf-ufrgs/mconf-web,lfzawacki/mconf-web,mconftec/mconf-web-mytruecloud,amreis/mconf-web,mconftec/mconf-web-ufpe,lfzawacki/mconf-web,mconf/mconf-web,mconf-ufrgs/mconf-web,fbottin/mconf-web,mconftec/mconf-web-santacasa,mconf/mconf-web,lfzawacki/mconf-web,mconftec/mconf-web-cedia,mconftec/mconf-web-santacasa,mconftec/mconf-web-uergs,mconftec/mconf-web-cedia,mconftec/mconf-web-ufpe,mconf/mconf-web,mconftec/mconf-web-mytruecloud,fbottin/mconf-web,mconf-rnp/mconf-web | ruby | ## Code Before:
module Helpers
# Creates `n` users as members of `space`
def self.create_fellows(n, space)
users = []
n.times do
u = FactoryGirl.create(:user)
space.add_member! u
users.push u
end
users
end
def self.setup_site_for_email_tests
attributes = {
:smtp_sender => Faker::Internet.email,
:name => Faker::Name.name
}
Site.current.update_attributes(attributes)
end
module ClassMethods
# Sets the custom actions that should also be checked by
# the matcher BeAbleToDoAnythingToMatcher
def set_custom_ability_actions(actions)
before(:each) do
Shoulda::Matchers::ActiveModel::BeAbleToDoAnythingToMatcher.
custom_actions = actions
end
end
end
end
## Instruction:
Fix failing tests on some mailers
## Code After:
module Helpers
# Creates `n` users as members of `space`
def self.create_fellows(n, space)
users = []
n.times do
u = FactoryGirl.create(:user)
space.add_member! u
users.push u
end
users
end
def self.setup_site_for_email_tests
attributes = {
:locale => "en",
:smtp_sender => Faker::Internet.email,
:name => Faker::Name.name
}
Site.current.update_attributes(attributes)
end
module ClassMethods
# Sets the custom actions that should also be checked by
# the matcher BeAbleToDoAnythingToMatcher
def set_custom_ability_actions(actions)
before(:each) do
Shoulda::Matchers::ActiveModel::BeAbleToDoAnythingToMatcher.
custom_actions = actions
end
end
end
end
| module Helpers
# Creates `n` users as members of `space`
def self.create_fellows(n, space)
users = []
n.times do
u = FactoryGirl.create(:user)
space.add_member! u
users.push u
end
users
end
def self.setup_site_for_email_tests
attributes = {
+ :locale => "en",
:smtp_sender => Faker::Internet.email,
:name => Faker::Name.name
}
Site.current.update_attributes(attributes)
end
module ClassMethods
# Sets the custom actions that should also be checked by
# the matcher BeAbleToDoAnythingToMatcher
def set_custom_ability_actions(actions)
before(:each) do
Shoulda::Matchers::ActiveModel::BeAbleToDoAnythingToMatcher.
custom_actions = actions
end
end
end
end | 1 | 0.028571 | 1 | 0 |
d013289630e2a194b9f126f7983dae09139f1fac | icekit/plugins/map/templates/icekit/plugins/map/embed.html | icekit/plugins/map/templates/icekit/plugins/map/embed.html | {% if instance.loc %}
<iframe src="http://maps.google.com/maps?q={{ instance.place_name }}&loc:{{ instance.loc }}&z=15&output=embed" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
{% else %}
Map cannot be displayed
{% endif %}
| {% if instance.loc %}
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="http://maps.google.com/maps?q={{ instance.place_name }}&loc:{{ instance.loc }}&z=15&output=embed"
frameborder="0" style="border:0" allowfullscreen>
</iframe>
</div>
{% else %}
Map cannot be displayed
{% endif %}
| Add boostrap response classes to iframe. | Add boostrap response classes to iframe.
| HTML | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | html | ## Code Before:
{% if instance.loc %}
<iframe src="http://maps.google.com/maps?q={{ instance.place_name }}&loc:{{ instance.loc }}&z=15&output=embed" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
{% else %}
Map cannot be displayed
{% endif %}
## Instruction:
Add boostrap response classes to iframe.
## Code After:
{% if instance.loc %}
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="http://maps.google.com/maps?q={{ instance.place_name }}&loc:{{ instance.loc }}&z=15&output=embed"
frameborder="0" style="border:0" allowfullscreen>
</iframe>
</div>
{% else %}
Map cannot be displayed
{% endif %}
| {% if instance.loc %}
- <iframe src="http://maps.google.com/maps?q={{ instance.place_name }}&loc:{{ instance.loc }}&z=15&output=embed" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
+ <div class="embed-responsive embed-responsive-16by9">
+ <iframe class="embed-responsive-item" src="http://maps.google.com/maps?q={{ instance.place_name }}&loc:{{ instance.loc }}&z=15&output=embed"
+ frameborder="0" style="border:0" allowfullscreen>
+ </iframe>
+ </div>
{% else %}
- Map cannot be displayed
+ Map cannot be displayed
? +
{% endif %} | 8 | 1.6 | 6 | 2 |
464c1b640013ae3ef1aba2b720138b68f1332d7f | spec/fixtures/records.yml | spec/fixtures/records.yml | ---
- :request:
:method: GET
:path: /hello.json
:query: ""
:body: ""
:response:
:method: GET
:path: /hello.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'world'
- :request:
:method: GET
:path: /query.json
:query: "with=params"
:body: ""
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'with params'
- :request:
:method: POST
:path: /body.json
:query: ""
:body: "with=body"
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
- :request:
:method: POST
:path: /json.json
:query: ""
:body:
name: test
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
| ---
- :request:
:method: GET
:path: /hello.json
:query: ""
:body: ""
:response:
:method: GET
:path: /hello.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'world'
- :request:
:method: GET
:path: /query.json
:query: "with=params"
:body: ""
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'with params'
- :request:
:method: POST
:path: /body.json
:query: ""
:body: "with=body"
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
- :request:
:method: POST
:path: /json.json
:query: ""
:body:
name: test
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
- :request:
:method: GET
:path: /json_response.json
:query: ""
:body: ""
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: '{"json":"content"}'
| Add fixture case with json body response | Add fixture case with json body response | YAML | mit | unixcharles/mock_server | yaml | ## Code Before:
---
- :request:
:method: GET
:path: /hello.json
:query: ""
:body: ""
:response:
:method: GET
:path: /hello.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'world'
- :request:
:method: GET
:path: /query.json
:query: "with=params"
:body: ""
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'with params'
- :request:
:method: POST
:path: /body.json
:query: ""
:body: "with=body"
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
- :request:
:method: POST
:path: /json.json
:query: ""
:body:
name: test
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
## Instruction:
Add fixture case with json body response
## Code After:
---
- :request:
:method: GET
:path: /hello.json
:query: ""
:body: ""
:response:
:method: GET
:path: /hello.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'world'
- :request:
:method: GET
:path: /query.json
:query: "with=params"
:body: ""
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'with params'
- :request:
:method: POST
:path: /body.json
:query: ""
:body: "with=body"
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
- :request:
:method: POST
:path: /json.json
:query: ""
:body:
name: test
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
- :request:
:method: GET
:path: /json_response.json
:query: ""
:body: ""
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: '{"json":"content"}'
| ---
- :request:
:method: GET
:path: /hello.json
:query: ""
:body: ""
:response:
:method: GET
:path: /hello.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'world'
- :request:
:method: GET
:path: /query.json
:query: "with=params"
:body: ""
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'with params'
- :request:
:method: POST
:path: /body.json
:query: ""
:body: "with=body"
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
- :request:
:method: POST
:path: /json.json
:query: ""
:body:
name: test
:response:
:method: GET
:path: /query.json
:status: 200
:headers:
Content-Type: application/json; charset=utf-8
:body: 'success post with body'
-
+ - :request:
+ :method: GET
+ :path: /json_response.json
+ :query: ""
+ :body: ""
+ :response:
+ :method: GET
+ :path: /query.json
+ :status: 200
+ :headers:
+ Content-Type: application/json; charset=utf-8
+ :body: '{"json":"content"}' | 13 | 0.254902 | 12 | 1 |
c1893a257a0685934607946f4c24758796eb74bf | lib/formatters/codeclimate.js | lib/formatters/codeclimate.js | 'use strict';
module.exports = function (err, data) {
if (err) {
return 'Debug output: %j' + JSON.stringify(data) + '\n' + JSON.stringify(err);
}
if (!data.length) {
return;
}
var returnString = '';
for (var i = 0, il = data.length; i < il; ++i) {
returnString += JSON.stringify({
type: 'issue',
check_name: 'Vulnerable module "' + data[i].module + '" identified',
description: '`' + data[i].module + '` ' + data[i].title,
categories: ['Security'],
remediation_points: 300000,
content: {
body: data[i].content
},
location: {
path: 'npm-shrinkwrap.json',
lines: {
begin: data[i].line.start,
end: data[i].line.end
}
}
}) + '\0\n';
}
return returnString;
};
| 'use strict';
module.exports = function (err, data) {
if (err) {
return err.stack;
}
if (!data.length) {
return;
}
var returnString = '';
for (var i = 0, il = data.length; i < il; ++i) {
returnString += JSON.stringify({
type: 'issue',
check_name: 'Vulnerable module "' + data[i].module + '" identified',
description: '`' + data[i].module + '` ' + data[i].title,
categories: ['Security'],
remediation_points: 300000,
content: {
body: data[i].content
},
location: {
path: 'npm-shrinkwrap.json',
lines: {
begin: data[i].line.start,
end: data[i].line.end
}
}
}) + '\0\n';
}
return returnString;
};
| Return error message in Code Climate runs | Return error message in Code Climate runs
Stringifying an Error object results in {} so the formatter was not
returning the actual underlying error with the Code Climate formatter.
This change returns the error so that they user can take action if an
analysis run fails.
This change returns the Error stack which includes a helpful error
message and the backtrace for debugging purposes.
| JavaScript | apache-2.0 | requiresafe/cli,chetanddesai/nsp,nodesecurity/nsp,ABaldwinHunter/nsp-classic,ABaldwinHunter/nsp | javascript | ## Code Before:
'use strict';
module.exports = function (err, data) {
if (err) {
return 'Debug output: %j' + JSON.stringify(data) + '\n' + JSON.stringify(err);
}
if (!data.length) {
return;
}
var returnString = '';
for (var i = 0, il = data.length; i < il; ++i) {
returnString += JSON.stringify({
type: 'issue',
check_name: 'Vulnerable module "' + data[i].module + '" identified',
description: '`' + data[i].module + '` ' + data[i].title,
categories: ['Security'],
remediation_points: 300000,
content: {
body: data[i].content
},
location: {
path: 'npm-shrinkwrap.json',
lines: {
begin: data[i].line.start,
end: data[i].line.end
}
}
}) + '\0\n';
}
return returnString;
};
## Instruction:
Return error message in Code Climate runs
Stringifying an Error object results in {} so the formatter was not
returning the actual underlying error with the Code Climate formatter.
This change returns the error so that they user can take action if an
analysis run fails.
This change returns the Error stack which includes a helpful error
message and the backtrace for debugging purposes.
## Code After:
'use strict';
module.exports = function (err, data) {
if (err) {
return err.stack;
}
if (!data.length) {
return;
}
var returnString = '';
for (var i = 0, il = data.length; i < il; ++i) {
returnString += JSON.stringify({
type: 'issue',
check_name: 'Vulnerable module "' + data[i].module + '" identified',
description: '`' + data[i].module + '` ' + data[i].title,
categories: ['Security'],
remediation_points: 300000,
content: {
body: data[i].content
},
location: {
path: 'npm-shrinkwrap.json',
lines: {
begin: data[i].line.start,
end: data[i].line.end
}
}
}) + '\0\n';
}
return returnString;
};
| 'use strict';
module.exports = function (err, data) {
if (err) {
- return 'Debug output: %j' + JSON.stringify(data) + '\n' + JSON.stringify(err);
+ return err.stack;
}
if (!data.length) {
return;
}
var returnString = '';
for (var i = 0, il = data.length; i < il; ++i) {
returnString += JSON.stringify({
type: 'issue',
check_name: 'Vulnerable module "' + data[i].module + '" identified',
description: '`' + data[i].module + '` ' + data[i].title,
categories: ['Security'],
remediation_points: 300000,
content: {
body: data[i].content
},
location: {
path: 'npm-shrinkwrap.json',
lines: {
begin: data[i].line.start,
end: data[i].line.end
}
}
}) + '\0\n';
}
return returnString;
}; | 2 | 0.057143 | 1 | 1 |
d959e87e16280eb4cbcb7ca80b64c89cacde2662 | addon/components/simple-table-cell.js | addon/components/simple-table-cell.js | import Ember from 'ember';
import layout from '../templates/components/simple-table-cell';
export default Ember.Component.extend({
layout,
tagName: 'th',
classNameBindings: ['columnsClass'],
attributeBindings: ['rowspan', 'colspan', 'columnsStyle:style'],
columnsClass: Ember.computed.alias('columns.classes'),
columnsStyle: Ember.computed('columns.style', {
get() {
return Ember.String.htmlSafe(this.get('columns.style'));
}
}),
actions: {
sortBy(key) {
return this.get('sortAction')(key);
}
}
});
| import Ember from 'ember';
import layout from '../templates/components/simple-table-cell';
export default Ember.Component.extend({
layout,
tagName: 'th',
classNameBindings: ['columnsClass'],
attributeBindings: ['rowspan', 'colspan', 'columnsStyle:style'],
columnsClass: Ember.computed('columns.classes', {
get() {
let columns = this.get('columns');
let column = Ember.isArray(columns) ? columns[0] : columns;
return Ember.String.htmlSafe(column.classes);
}
}),
columnsStyle: Ember.computed('columns.style', {
get() {
let columns = this.get('columns');
let column = Ember.isArray(columns) ? columns[0] : columns;
return Ember.String.htmlSafe(column.style);
}
}),
actions: {
sortBy(key) {
return this.get('sortAction')(key);
}
}
});
| Fix styles and classes for grouped columns | Fix styles and classes for grouped columns
| JavaScript | mit | Baltazore/ember-simple-table,Baltazore/ember-simple-table | javascript | ## Code Before:
import Ember from 'ember';
import layout from '../templates/components/simple-table-cell';
export default Ember.Component.extend({
layout,
tagName: 'th',
classNameBindings: ['columnsClass'],
attributeBindings: ['rowspan', 'colspan', 'columnsStyle:style'],
columnsClass: Ember.computed.alias('columns.classes'),
columnsStyle: Ember.computed('columns.style', {
get() {
return Ember.String.htmlSafe(this.get('columns.style'));
}
}),
actions: {
sortBy(key) {
return this.get('sortAction')(key);
}
}
});
## Instruction:
Fix styles and classes for grouped columns
## Code After:
import Ember from 'ember';
import layout from '../templates/components/simple-table-cell';
export default Ember.Component.extend({
layout,
tagName: 'th',
classNameBindings: ['columnsClass'],
attributeBindings: ['rowspan', 'colspan', 'columnsStyle:style'],
columnsClass: Ember.computed('columns.classes', {
get() {
let columns = this.get('columns');
let column = Ember.isArray(columns) ? columns[0] : columns;
return Ember.String.htmlSafe(column.classes);
}
}),
columnsStyle: Ember.computed('columns.style', {
get() {
let columns = this.get('columns');
let column = Ember.isArray(columns) ? columns[0] : columns;
return Ember.String.htmlSafe(column.style);
}
}),
actions: {
sortBy(key) {
return this.get('sortAction')(key);
}
}
});
| import Ember from 'ember';
import layout from '../templates/components/simple-table-cell';
export default Ember.Component.extend({
layout,
tagName: 'th',
classNameBindings: ['columnsClass'],
attributeBindings: ['rowspan', 'colspan', 'columnsStyle:style'],
- columnsClass: Ember.computed.alias('columns.classes'),
? ------ -
+ columnsClass: Ember.computed('columns.classes', {
? ++
+ get() {
+ let columns = this.get('columns');
+ let column = Ember.isArray(columns) ? columns[0] : columns;
+ return Ember.String.htmlSafe(column.classes);
+ }
+ }),
columnsStyle: Ember.computed('columns.style', {
get() {
+ let columns = this.get('columns');
+ let column = Ember.isArray(columns) ? columns[0] : columns;
- return Ember.String.htmlSafe(this.get('columns.style'));
? ---------- - --
+ return Ember.String.htmlSafe(column.style);
}
}),
actions: {
sortBy(key) {
return this.get('sortAction')(key);
}
}
}); | 12 | 0.5 | 10 | 2 |
8405b28f9fa1d2383fdd8d74f84e50465e212253 | coroutine.js | coroutine.js |
// Coroutine function that returns a promise that resolves when the coroutine
// is finished. Accepts a generator function, and assumes that everything
// yielded from the generator function is a promise.
module.exports = function coroutine(generatorFunction) {
let gen = generatorFunction()
return new Promise(resolve => {
// Handle every single value yielded by the generator function.
function step(value) {
let result = gen.next(value)
if (result.done) {
// Generator is done, so handle its return value.
resolve(result.value)
} else {
// Generator is not done, so result.value is a promise.
let promise = result.value
// When the promise is done, run this function again.
promise.then(newValue => step(newValue))
}
}
step(undefined)
})
}
|
// Coroutine function that returns a promise that resolves when the coroutine
// is finished. Accepts a generator function, and assumes that everything
// yielded from the generator function is a promise.
module.exports = function coroutine(generatorFunction) {
let gen = generatorFunction()
return new Promise(resolve => {
// Handle every single result yielded by the generator function.
function next(result) {
if (result.done) {
// Generator is done, so resolve to its return value.
resolve(result.value)
} else {
// Generator is not done, so result.value is a promise.
let promise = result.value
// When the promise is done, run this function again.
promise.then(newValue => {
let newResult = gen.next(newValue)
next(newResult)
})
}
}
next(gen.next())
})
}
| Refactor so that next() takes the return value of gen.next() | Refactor so that next() takes the return value of gen.next()
| JavaScript | apache-2.0 | feihong/node-examples,feihong/node-examples | javascript | ## Code Before:
// Coroutine function that returns a promise that resolves when the coroutine
// is finished. Accepts a generator function, and assumes that everything
// yielded from the generator function is a promise.
module.exports = function coroutine(generatorFunction) {
let gen = generatorFunction()
return new Promise(resolve => {
// Handle every single value yielded by the generator function.
function step(value) {
let result = gen.next(value)
if (result.done) {
// Generator is done, so handle its return value.
resolve(result.value)
} else {
// Generator is not done, so result.value is a promise.
let promise = result.value
// When the promise is done, run this function again.
promise.then(newValue => step(newValue))
}
}
step(undefined)
})
}
## Instruction:
Refactor so that next() takes the return value of gen.next()
## Code After:
// Coroutine function that returns a promise that resolves when the coroutine
// is finished. Accepts a generator function, and assumes that everything
// yielded from the generator function is a promise.
module.exports = function coroutine(generatorFunction) {
let gen = generatorFunction()
return new Promise(resolve => {
// Handle every single result yielded by the generator function.
function next(result) {
if (result.done) {
// Generator is done, so resolve to its return value.
resolve(result.value)
} else {
// Generator is not done, so result.value is a promise.
let promise = result.value
// When the promise is done, run this function again.
promise.then(newValue => {
let newResult = gen.next(newValue)
next(newResult)
})
}
}
next(gen.next())
})
}
|
// Coroutine function that returns a promise that resolves when the coroutine
// is finished. Accepts a generator function, and assumes that everything
// yielded from the generator function is a promise.
module.exports = function coroutine(generatorFunction) {
let gen = generatorFunction()
+
return new Promise(resolve => {
- // Handle every single value yielded by the generator function.
? ^^ ^^
+ // Handle every single result yielded by the generator function.
? ^^^^ ^
+ function next(result) {
- function step(value) {
- let result = gen.next(value)
if (result.done) {
- // Generator is done, so handle its return value.
? ^^^^
+ // Generator is done, so resolve to its return value.
? ^^^^ + +++
resolve(result.value)
} else {
// Generator is not done, so result.value is a promise.
let promise = result.value
// When the promise is done, run this function again.
- promise.then(newValue => step(newValue))
? ^^^^^^^^^^^^^^^
+ promise.then(newValue => {
? ^
+ let newResult = gen.next(newValue)
+ next(newResult)
+ })
}
}
- step(undefined)
+
+ next(gen.next())
})
} | 16 | 0.695652 | 10 | 6 |
a0f8a7bcc765f8fb07a2760a09307faf39404aca | lib/adapter.js | lib/adapter.js | /*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://cksource.com/ckfinder/license
*/
( function( window, bender ) {
'use strict';
var unlock = bender.defer(),
originalRequire = window.require;
// TODO what if require is never called?
bender.require = function( deps, callback ) {
originalRequire( deps, function() {
callback.apply( null, arguments );
unlock();
} );
};
} )( this, bender );
| /*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://cksource.com/ckfinder/license
*/
( function( window, bender ) {
'use strict';
bender.require = function( deps, callback ) {
var unlock = bender.defer();
window.require( deps, function() {
callback.apply( null, arguments );
unlock();
} );
};
} )( this, bender );
| Move bender.defer() inside the require call. | Move bender.defer() inside the require call.
| JavaScript | mit | benderjs/benderjs-amd | javascript | ## Code Before:
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://cksource.com/ckfinder/license
*/
( function( window, bender ) {
'use strict';
var unlock = bender.defer(),
originalRequire = window.require;
// TODO what if require is never called?
bender.require = function( deps, callback ) {
originalRequire( deps, function() {
callback.apply( null, arguments );
unlock();
} );
};
} )( this, bender );
## Instruction:
Move bender.defer() inside the require call.
## Code After:
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://cksource.com/ckfinder/license
*/
( function( window, bender ) {
'use strict';
bender.require = function( deps, callback ) {
var unlock = bender.defer();
window.require( deps, function() {
callback.apply( null, arguments );
unlock();
} );
};
} )( this, bender );
| /*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://cksource.com/ckfinder/license
*/
( function( window, bender ) {
'use strict';
+ bender.require = function( deps, callback ) {
- var unlock = bender.defer(),
? ^
+ var unlock = bender.defer();
? + ^
- originalRequire = window.require;
- // TODO what if require is never called?
- bender.require = function( deps, callback ) {
- originalRequire( deps, function() {
? ^^^^ ^^^
+ window.require( deps, function() {
? ^ ^^^^^
callback.apply( null, arguments );
unlock();
} );
};
} )( this, bender ); | 8 | 0.4 | 3 | 5 |
b04d0e863c4387c147ef8e9e7d067f3b0e302148 | src/app/views/sessions/session/session.component.less | src/app/views/sessions/session/session.component.less | .session-view {
position: fixed;
width: 100%;
height: calc(~"100vh - 85px");
}
.close-well-button {
position: relative;
right: -10px;
top: -15px;
}
.split-1 {
padding-left: 15px;
}
.split-2 {
padding-right: 15px;
padding-bottom: 15px;
}
:host ::ng-deep split-gutter {
background-color: white !important;
}
| .session-view {
position: fixed;
width: 100%;
height: calc(~"100vh - 85px");
}
.close-well-button {
position: relative;
right: -10px;
top: -15px;
}
.split-1 {
padding-left: 15px;
}
.split-2 {
padding-right: 15px;
}
:host ::ng-deep split-gutter {
background-color: white !important;
}
| Remove bottom padding from split2 | Remove bottom padding from split2
| Less | mit | chipster/chipster-web,chipster/chipster-web,chipster/chipster-web | less | ## Code Before:
.session-view {
position: fixed;
width: 100%;
height: calc(~"100vh - 85px");
}
.close-well-button {
position: relative;
right: -10px;
top: -15px;
}
.split-1 {
padding-left: 15px;
}
.split-2 {
padding-right: 15px;
padding-bottom: 15px;
}
:host ::ng-deep split-gutter {
background-color: white !important;
}
## Instruction:
Remove bottom padding from split2
## Code After:
.session-view {
position: fixed;
width: 100%;
height: calc(~"100vh - 85px");
}
.close-well-button {
position: relative;
right: -10px;
top: -15px;
}
.split-1 {
padding-left: 15px;
}
.split-2 {
padding-right: 15px;
}
:host ::ng-deep split-gutter {
background-color: white !important;
}
| .session-view {
position: fixed;
width: 100%;
height: calc(~"100vh - 85px");
}
.close-well-button {
position: relative;
right: -10px;
top: -15px;
}
.split-1 {
padding-left: 15px;
}
.split-2 {
padding-right: 15px;
- padding-bottom: 15px;
}
:host ::ng-deep split-gutter {
background-color: white !important;
} | 1 | 0.041667 | 0 | 1 |
fbc0a83bc9a72c57ba56cecd9fa06e7e86ea7589 | nbgrader/auth/base.py | nbgrader/auth/base.py | """Base formgrade authenticator."""
from traitlets.config.configurable import LoggingConfigurable
class BaseAuth(LoggingConfigurable):
"""Base formgrade authenticator."""
def __init__(self, ip, port, base_directory, **kwargs):
super(BaseAuth, self).__init__(**kwargs)
self._ip = ip
self._port = port
self._base_url = ''
self._base_directory = base_directory
@property
def base_url(self):
return self._base_url
@property
def login_url(self):
return ''
def get_user(self, handler):
return 'nbgrader'
def authenticate(self, user):
"""Authenticate a user."""
return user
def notebook_server_exists(self):
"""Checks for a notebook server."""
return False
def get_notebook_server_cookie(self):
"""Gets a cookie that is needed to access the notebook server."""
return None
def get_notebook_url(self, relative_path):
"""Gets the notebook's url."""
raise NotImplementedError
def transform_handler(self, handler):
return handler
def stop(self):
"""Stops the notebook server."""
pass
| """Base formgrade authenticator."""
from traitlets.config.configurable import LoggingConfigurable
class BaseAuth(LoggingConfigurable):
"""Base formgrade authenticator."""
def __init__(self, ip, port, base_directory, **kwargs):
self._ip = ip
self._port = port
self._base_url = ''
self._base_directory = base_directory
super(BaseAuth, self).__init__(**kwargs)
@property
def base_url(self):
return self._base_url
@property
def login_url(self):
return ''
def get_user(self, handler):
return 'nbgrader'
def authenticate(self, user):
"""Authenticate a user."""
return user
def notebook_server_exists(self):
"""Checks for a notebook server."""
return False
def get_notebook_server_cookie(self):
"""Gets a cookie that is needed to access the notebook server."""
return None
def get_notebook_url(self, relative_path):
"""Gets the notebook's url."""
raise NotImplementedError
def transform_handler(self, handler):
return handler
def stop(self):
"""Stops the notebook server."""
pass
| Set instances variables in auth before init | Set instances variables in auth before init
| Python | bsd-3-clause | ellisonbg/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,ellisonbg/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader | python | ## Code Before:
"""Base formgrade authenticator."""
from traitlets.config.configurable import LoggingConfigurable
class BaseAuth(LoggingConfigurable):
"""Base formgrade authenticator."""
def __init__(self, ip, port, base_directory, **kwargs):
super(BaseAuth, self).__init__(**kwargs)
self._ip = ip
self._port = port
self._base_url = ''
self._base_directory = base_directory
@property
def base_url(self):
return self._base_url
@property
def login_url(self):
return ''
def get_user(self, handler):
return 'nbgrader'
def authenticate(self, user):
"""Authenticate a user."""
return user
def notebook_server_exists(self):
"""Checks for a notebook server."""
return False
def get_notebook_server_cookie(self):
"""Gets a cookie that is needed to access the notebook server."""
return None
def get_notebook_url(self, relative_path):
"""Gets the notebook's url."""
raise NotImplementedError
def transform_handler(self, handler):
return handler
def stop(self):
"""Stops the notebook server."""
pass
## Instruction:
Set instances variables in auth before init
## Code After:
"""Base formgrade authenticator."""
from traitlets.config.configurable import LoggingConfigurable
class BaseAuth(LoggingConfigurable):
"""Base formgrade authenticator."""
def __init__(self, ip, port, base_directory, **kwargs):
self._ip = ip
self._port = port
self._base_url = ''
self._base_directory = base_directory
super(BaseAuth, self).__init__(**kwargs)
@property
def base_url(self):
return self._base_url
@property
def login_url(self):
return ''
def get_user(self, handler):
return 'nbgrader'
def authenticate(self, user):
"""Authenticate a user."""
return user
def notebook_server_exists(self):
"""Checks for a notebook server."""
return False
def get_notebook_server_cookie(self):
"""Gets a cookie that is needed to access the notebook server."""
return None
def get_notebook_url(self, relative_path):
"""Gets the notebook's url."""
raise NotImplementedError
def transform_handler(self, handler):
return handler
def stop(self):
"""Stops the notebook server."""
pass
| """Base formgrade authenticator."""
from traitlets.config.configurable import LoggingConfigurable
class BaseAuth(LoggingConfigurable):
"""Base formgrade authenticator."""
def __init__(self, ip, port, base_directory, **kwargs):
- super(BaseAuth, self).__init__(**kwargs)
self._ip = ip
self._port = port
self._base_url = ''
self._base_directory = base_directory
+ super(BaseAuth, self).__init__(**kwargs)
@property
def base_url(self):
return self._base_url
@property
def login_url(self):
return ''
def get_user(self, handler):
return 'nbgrader'
def authenticate(self, user):
"""Authenticate a user."""
return user
def notebook_server_exists(self):
"""Checks for a notebook server."""
return False
def get_notebook_server_cookie(self):
"""Gets a cookie that is needed to access the notebook server."""
return None
def get_notebook_url(self, relative_path):
"""Gets the notebook's url."""
raise NotImplementedError
def transform_handler(self, handler):
return handler
def stop(self):
"""Stops the notebook server."""
pass | 2 | 0.042553 | 1 | 1 |
2a6c66428daeaa4d6aaecfec552cbffd03096cea | frontend/js/google-analytics.js | frontend/js/google-analytics.js | export default function initGoogleAnalytics(port) {
port.subscribe((path) => {
ga && ga('set', 'page', path);
ga && ga('send', 'pageview');
});
}
| const ga = window.ga || undefined;
export default function initGoogleAnalytics(port) {
port.subscribe((path) => {
ga && ga('set', 'page', path);
ga && ga('send', 'pageview');
});
}
| Make ga always an existing variable | Make ga always an existing variable
| JavaScript | agpl-3.0 | Tradenomiliitto/tradenomiitti,Tradenomiliitto/tradenomiitti,Tradenomiliitto/tradenomiitti | javascript | ## Code Before:
export default function initGoogleAnalytics(port) {
port.subscribe((path) => {
ga && ga('set', 'page', path);
ga && ga('send', 'pageview');
});
}
## Instruction:
Make ga always an existing variable
## Code After:
const ga = window.ga || undefined;
export default function initGoogleAnalytics(port) {
port.subscribe((path) => {
ga && ga('set', 'page', path);
ga && ga('send', 'pageview');
});
}
| + const ga = window.ga || undefined;
export default function initGoogleAnalytics(port) {
port.subscribe((path) => {
ga && ga('set', 'page', path);
ga && ga('send', 'pageview');
});
} | 1 | 0.166667 | 1 | 0 |
04ccfe4abc23f35e7a9fdf901702b34e84aeb796 | README.md | README.md |
[](https://codeclimate.com/github/rootulp/hackerrank)
[](https://rootulp.mit-license.org)
> [Hackerrank](https://www.hackerrank.com) solutions
## Contribute
I'd appreciate any feedback via [issues](https://github.com/rootulp/hackerrank/issues/new).
## Getting Started
If you are new to hackerrank, you can get started at [hackerrank.com](https://www.hackerrank.com).
## License
[MIT](https://rootulp.mit-license.org/) © [Rootul Patel](https://rootulp.com)
|
[](https://codeclimate.com/github/rootulp/hackerrank)
[](https://rootulp.mit-license.org)
> [Hackerrank](https://www.hackerrank.com) solutions
## Contribute
I'd appreciate any feedback via [issues](https://github.com/rootulp/hackerrank/issues/new).
## Getting Started
If you are new to hackerrank, you can get started at [hackerrank.com](https://www.hackerrank.com).
## Code Style
| language | code style & linter | command |
|--------------|--------------------------------------------------------------------------------------------------------------------|------------------------------------|
| ruby | [](https://github.com/bbatsov/rubocop) | `rubocop .` |
| python | [](https://www.python.org/dev/peps/pep-0008/) | `pep8 .` |
| javascript | [](https://github.com/prettier/prettier) | `prettier <file>` |
## License
[MIT](https://rootulp.mit-license.org/) © [Rootul Patel](https://rootulp.com)
| Copy code style block from exercism | Copy code style block from exercism | Markdown | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | markdown | ## Code Before:
[](https://codeclimate.com/github/rootulp/hackerrank)
[](https://rootulp.mit-license.org)
> [Hackerrank](https://www.hackerrank.com) solutions
## Contribute
I'd appreciate any feedback via [issues](https://github.com/rootulp/hackerrank/issues/new).
## Getting Started
If you are new to hackerrank, you can get started at [hackerrank.com](https://www.hackerrank.com).
## License
[MIT](https://rootulp.mit-license.org/) © [Rootul Patel](https://rootulp.com)
## Instruction:
Copy code style block from exercism
## Code After:
[](https://codeclimate.com/github/rootulp/hackerrank)
[](https://rootulp.mit-license.org)
> [Hackerrank](https://www.hackerrank.com) solutions
## Contribute
I'd appreciate any feedback via [issues](https://github.com/rootulp/hackerrank/issues/new).
## Getting Started
If you are new to hackerrank, you can get started at [hackerrank.com](https://www.hackerrank.com).
## Code Style
| language | code style & linter | command |
|--------------|--------------------------------------------------------------------------------------------------------------------|------------------------------------|
| ruby | [](https://github.com/bbatsov/rubocop) | `rubocop .` |
| python | [](https://www.python.org/dev/peps/pep-0008/) | `pep8 .` |
| javascript | [](https://github.com/prettier/prettier) | `prettier <file>` |
## License
[MIT](https://rootulp.mit-license.org/) © [Rootul Patel](https://rootulp.com)
|
[](https://codeclimate.com/github/rootulp/hackerrank)
[](https://rootulp.mit-license.org)
> [Hackerrank](https://www.hackerrank.com) solutions
## Contribute
I'd appreciate any feedback via [issues](https://github.com/rootulp/hackerrank/issues/new).
## Getting Started
If you are new to hackerrank, you can get started at [hackerrank.com](https://www.hackerrank.com).
+ ## Code Style
+
+ | language | code style & linter | command |
+ |--------------|--------------------------------------------------------------------------------------------------------------------|------------------------------------|
+ | ruby | [](https://github.com/bbatsov/rubocop) | `rubocop .` |
+ | python | [](https://www.python.org/dev/peps/pep-0008/) | `pep8 .` |
+ | javascript | [](https://github.com/prettier/prettier) | `prettier <file>` |
+
## License
[MIT](https://rootulp.mit-license.org/) © [Rootul Patel](https://rootulp.com) | 8 | 0.470588 | 8 | 0 |
4403f7c7590244c5be7a10f1d694d0504653c329 | config/map.json | config/map.json | {
"domElementId": "map",
"tileLayers": {
"base-tiles": {
"url": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "00:00",
"off": "08:46"
}
},
"aux-tiles": {
"url": "http://{s}.tiles.mapbox.com/v3/digitalsadhu.jbf3mhe1/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "08:46",
"off": "23:59"
}
},
"linz-land-packets": {
"url": "https://tiles-{s}.data-cdn.linz.govt.nz/services;key=2b48020828f04b3cb97822be1d384222/tiles/v4/layer=772,style=auto,color=003399/{z}/{x}/{y}.png",
"zIndex": 11
}
},
"bounds": [
[-43.577988,172.515934],
[-43.461397,172.749529]
]
}
| {
"domElementId": "map",
"tileLayers": {
"base-tiles": {
"url": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "00:00",
"off": "08:46"
}
},
"aux-tiles": {
"url": "http://{s}.tiles.mapbox.com/v3/digitalsadhu.jbf3mhe1/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "08:46",
"off": "23:59"
}
}
},
"bounds": [
[-43.577988,172.515934],
[-43.461397,172.749529]
]
}
| Remove linz land packet tilelayer | Remove linz land packet tilelayer
Url has been changed on us. (Teach me for view source grabbing
their tileserver url) removing for now
| JSON | mit | mediasuitenz/mappy,mediasuitenz/mappy | json | ## Code Before:
{
"domElementId": "map",
"tileLayers": {
"base-tiles": {
"url": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "00:00",
"off": "08:46"
}
},
"aux-tiles": {
"url": "http://{s}.tiles.mapbox.com/v3/digitalsadhu.jbf3mhe1/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "08:46",
"off": "23:59"
}
},
"linz-land-packets": {
"url": "https://tiles-{s}.data-cdn.linz.govt.nz/services;key=2b48020828f04b3cb97822be1d384222/tiles/v4/layer=772,style=auto,color=003399/{z}/{x}/{y}.png",
"zIndex": 11
}
},
"bounds": [
[-43.577988,172.515934],
[-43.461397,172.749529]
]
}
## Instruction:
Remove linz land packet tilelayer
Url has been changed on us. (Teach me for view source grabbing
their tileserver url) removing for now
## Code After:
{
"domElementId": "map",
"tileLayers": {
"base-tiles": {
"url": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "00:00",
"off": "08:46"
}
},
"aux-tiles": {
"url": "http://{s}.tiles.mapbox.com/v3/digitalsadhu.jbf3mhe1/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "08:46",
"off": "23:59"
}
}
},
"bounds": [
[-43.577988,172.515934],
[-43.461397,172.749529]
]
}
| {
"domElementId": "map",
"tileLayers": {
"base-tiles": {
"url": "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "00:00",
"off": "08:46"
}
},
"aux-tiles": {
"url": "http://{s}.tiles.mapbox.com/v3/digitalsadhu.jbf3mhe1/{z}/{x}/{y}.png",
"attribution": "",
"maxZoom": 18,
"zIndex": 10,
"time": {
"on": "08:46",
"off": "23:59"
}
- },
- "linz-land-packets": {
- "url": "https://tiles-{s}.data-cdn.linz.govt.nz/services;key=2b48020828f04b3cb97822be1d384222/tiles/v4/layer=772,style=auto,color=003399/{z}/{x}/{y}.png",
- "zIndex": 11
}
},
"bounds": [
[-43.577988,172.515934],
[-43.461397,172.749529]
]
} | 4 | 0.121212 | 0 | 4 |
bcbf340ced5acd867aa5cb3905434f998efa1829 | lib/switch_user.rb | lib/switch_user.rb | module SwitchUser
if defined? Rails::Engine
class Engine < Rails::Engine
config.to_prepare do
ApplicationController.helper(SwitchUserHelper)
end
end
else
%w(controllers helpers).each do |dir|
path = File.join(File.dirname(__FILE__), '..', 'app', dir)
$LOAD_PATH << path
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
ActionView::Base.send :include, SwitchUserHelper
end
end
mattr_accessor :provider
self.provider = :devise
mattr_accessor :available_users
self.available_users = { :user => lambda { User.all } }
mattr_accessor :available_users_identifiers
self.available_users_identifiers = { :user => :id }
mattr_accessor :available_users_names
self.available_users_names = { :user => :email }
mattr_accessor :controller_guard
self.controller_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :view_guard
self.view_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :redirect_path
self.redirect_path = lambda { |request, params| request.env["HTTP_REFERER"] ? :back : root_path }
def self.setup
yield self
end
end
| module SwitchUser
if defined? Rails::Engine
class Engine < Rails::Engine
config.to_prepare do
ActionView::Base.send :include, SwitchUserHelper
end
end
else
%w(controllers helpers).each do |dir|
path = File.join(File.dirname(__FILE__), '..', 'app', dir)
$LOAD_PATH << path
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
ActionView::Base.send :include, SwitchUserHelper
end
end
mattr_accessor :provider
self.provider = :devise
mattr_accessor :available_users
self.available_users = { :user => lambda { User.all } }
mattr_accessor :available_users_identifiers
self.available_users_identifiers = { :user => :id }
mattr_accessor :available_users_names
self.available_users_names = { :user => :email }
mattr_accessor :controller_guard
self.controller_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :view_guard
self.view_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :redirect_path
self.redirect_path = lambda { |request, params| request.env["HTTP_REFERER"] ? :back : root_path }
def self.setup
yield self
end
end
| Update Helper Initializer to prevent app start failure due to Helper naming errors from app helpers being initialized too early | Update Helper Initializer to prevent app start failure due to Helper naming errors from app helpers being initialized too early | Ruby | mit | MustWin/switch_user,cyanna/switch_user,cyanna/switch_user,MustWin/switch_user,vkill/switch_user,vkill/switch_user,mitsuru/switch_user,gregmolnar/switch_user,flyerhzm/switch_user,flyerhzm/switch_user,mitsuru/switch_user | ruby | ## Code Before:
module SwitchUser
if defined? Rails::Engine
class Engine < Rails::Engine
config.to_prepare do
ApplicationController.helper(SwitchUserHelper)
end
end
else
%w(controllers helpers).each do |dir|
path = File.join(File.dirname(__FILE__), '..', 'app', dir)
$LOAD_PATH << path
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
ActionView::Base.send :include, SwitchUserHelper
end
end
mattr_accessor :provider
self.provider = :devise
mattr_accessor :available_users
self.available_users = { :user => lambda { User.all } }
mattr_accessor :available_users_identifiers
self.available_users_identifiers = { :user => :id }
mattr_accessor :available_users_names
self.available_users_names = { :user => :email }
mattr_accessor :controller_guard
self.controller_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :view_guard
self.view_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :redirect_path
self.redirect_path = lambda { |request, params| request.env["HTTP_REFERER"] ? :back : root_path }
def self.setup
yield self
end
end
## Instruction:
Update Helper Initializer to prevent app start failure due to Helper naming errors from app helpers being initialized too early
## Code After:
module SwitchUser
if defined? Rails::Engine
class Engine < Rails::Engine
config.to_prepare do
ActionView::Base.send :include, SwitchUserHelper
end
end
else
%w(controllers helpers).each do |dir|
path = File.join(File.dirname(__FILE__), '..', 'app', dir)
$LOAD_PATH << path
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
ActionView::Base.send :include, SwitchUserHelper
end
end
mattr_accessor :provider
self.provider = :devise
mattr_accessor :available_users
self.available_users = { :user => lambda { User.all } }
mattr_accessor :available_users_identifiers
self.available_users_identifiers = { :user => :id }
mattr_accessor :available_users_names
self.available_users_names = { :user => :email }
mattr_accessor :controller_guard
self.controller_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :view_guard
self.view_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :redirect_path
self.redirect_path = lambda { |request, params| request.env["HTTP_REFERER"] ? :back : root_path }
def self.setup
yield self
end
end
| module SwitchUser
if defined? Rails::Engine
class Engine < Rails::Engine
config.to_prepare do
- ApplicationController.helper(SwitchUserHelper)
+ ActionView::Base.send :include, SwitchUserHelper
end
end
else
%w(controllers helpers).each do |dir|
path = File.join(File.dirname(__FILE__), '..', 'app', dir)
$LOAD_PATH << path
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
ActionView::Base.send :include, SwitchUserHelper
end
end
mattr_accessor :provider
self.provider = :devise
mattr_accessor :available_users
self.available_users = { :user => lambda { User.all } }
mattr_accessor :available_users_identifiers
self.available_users_identifiers = { :user => :id }
mattr_accessor :available_users_names
self.available_users_names = { :user => :email }
mattr_accessor :controller_guard
self.controller_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :view_guard
self.view_guard = lambda { |current_user, request| Rails.env.development? }
mattr_accessor :redirect_path
self.redirect_path = lambda { |request, params| request.env["HTTP_REFERER"] ? :back : root_path }
def self.setup
yield self
end
end | 2 | 0.04878 | 1 | 1 |
78fbbf62b4d61e619ddebec4a390105274366044 | app/views/people/_show.html.haml | app/views/people/_show.html.haml | .form-view
= render "form"
= render 'show_invoices'
= render 'show_attachments'
| %ul.tabs
%li.active= link_to 'Kontakt', '#contact'
%li= link_to 'Rechnungen', '#invoic'
%li= link_to 'Dokumente', '#attachments'
.tab-content
#contact.active= render "form"
#invoic= render 'show_invoices'
#attachments= render 'show_attachments'
| Use tabs for contact, invoice, attachment parts in people view. | Use tabs for contact, invoice, attachment parts in people view.
| Haml | agpl-3.0 | wtag/bookyt,silvermind/bookyt,hauledev/bookyt,hauledev/bookyt,silvermind/bookyt,silvermind/bookyt,gaapt/bookyt,xuewenfei/bookyt,xuewenfei/bookyt,wtag/bookyt,gaapt/bookyt,huerlisi/bookyt,xuewenfei/bookyt,huerlisi/bookyt,huerlisi/bookyt,gaapt/bookyt,hauledev/bookyt,gaapt/bookyt,silvermind/bookyt,wtag/bookyt,hauledev/bookyt | haml | ## Code Before:
.form-view
= render "form"
= render 'show_invoices'
= render 'show_attachments'
## Instruction:
Use tabs for contact, invoice, attachment parts in people view.
## Code After:
%ul.tabs
%li.active= link_to 'Kontakt', '#contact'
%li= link_to 'Rechnungen', '#invoic'
%li= link_to 'Dokumente', '#attachments'
.tab-content
#contact.active= render "form"
#invoic= render 'show_invoices'
#attachments= render 'show_attachments'
| - .form-view
- = render "form"
+ %ul.tabs
+ %li.active= link_to 'Kontakt', '#contact'
+ %li= link_to 'Rechnungen', '#invoic'
+ %li= link_to 'Dokumente', '#attachments'
+ .tab-content
+ #contact.active= render "form"
- = render 'show_invoices'
+ #invoic= render 'show_invoices'
? +++++++++
- = render 'show_attachments'
+ #attachments= render 'show_attachments'
? ++++++++++++++
| 12 | 2.4 | 8 | 4 |
28155df2bef16f415127fd6e65bd5f223f816d47 | packages/core/strapi/lib/middlewares/security.js | packages/core/strapi/lib/middlewares/security.js | 'use strict';
const { defaultsDeep, merge } = require('lodash/fp');
const helmet = require('koa-helmet');
const defaults = {
crossOriginEmbedderPolicy: false,
crossOriginOpenerPolicy: false,
crossOriginResourcePolicy: false,
originAgentCluster: false,
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:'],
'media-src': ["'self'", 'data:', 'blob:'],
upgradeInsecureRequests: null,
},
},
xssFilter: false,
hsts: {
maxAge: 31536000,
includeSubDomains: true,
},
frameguard: {
action: 'sameorigin',
},
};
/**
* @type {import('./').MiddlewareFactory}
*/
module.exports = config => (ctx, next) => {
let helmetConfig = defaultsDeep(defaults, config);
if (
ctx.method === 'GET' &&
['/graphql', '/documentation'].some(str => ctx.path.startsWith(str))
) {
helmetConfig = merge(helmetConfig, {
contentSecurityPolicy: {
directives: {
'script-src': ["'self'", "'unsafe-inline'", 'cdn.jsdelivr.net'],
'img-src': ["'self'", 'data:', 'cdn.jsdelivr.net', 'strapi.io'],
},
},
});
}
return helmet(helmetConfig)(ctx, next);
};
| 'use strict';
const { defaultsDeep, merge } = require('lodash/fp');
const helmet = require('koa-helmet');
const defaults = {
crossOriginEmbedderPolicy: false,
crossOriginOpenerPolicy: false,
crossOriginResourcePolicy: false,
originAgentCluster: false,
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'https://dl.airtable.com'],
'media-src': ["'self'", 'data:', 'blob:'],
upgradeInsecureRequests: null,
},
},
xssFilter: false,
hsts: {
maxAge: 31536000,
includeSubDomains: true,
},
frameguard: {
action: 'sameorigin',
},
};
/**
* @type {import('./').MiddlewareFactory}
*/
module.exports = config => (ctx, next) => {
let helmetConfig = defaultsDeep(defaults, config);
if (
ctx.method === 'GET' &&
['/graphql', '/documentation'].some(str => ctx.path.startsWith(str))
) {
helmetConfig = merge(helmetConfig, {
contentSecurityPolicy: {
directives: {
'script-src': ["'self'", "'unsafe-inline'", 'cdn.jsdelivr.net'],
'img-src': ["'self'", 'data:', 'cdn.jsdelivr.net', 'strapi.io'],
},
},
});
}
return helmet(helmetConfig)(ctx, next);
};
| Add airtable in CSP policy | Add airtable in CSP policy
| JavaScript | mit | wistityhq/strapi,wistityhq/strapi | javascript | ## Code Before:
'use strict';
const { defaultsDeep, merge } = require('lodash/fp');
const helmet = require('koa-helmet');
const defaults = {
crossOriginEmbedderPolicy: false,
crossOriginOpenerPolicy: false,
crossOriginResourcePolicy: false,
originAgentCluster: false,
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:'],
'media-src': ["'self'", 'data:', 'blob:'],
upgradeInsecureRequests: null,
},
},
xssFilter: false,
hsts: {
maxAge: 31536000,
includeSubDomains: true,
},
frameguard: {
action: 'sameorigin',
},
};
/**
* @type {import('./').MiddlewareFactory}
*/
module.exports = config => (ctx, next) => {
let helmetConfig = defaultsDeep(defaults, config);
if (
ctx.method === 'GET' &&
['/graphql', '/documentation'].some(str => ctx.path.startsWith(str))
) {
helmetConfig = merge(helmetConfig, {
contentSecurityPolicy: {
directives: {
'script-src': ["'self'", "'unsafe-inline'", 'cdn.jsdelivr.net'],
'img-src': ["'self'", 'data:', 'cdn.jsdelivr.net', 'strapi.io'],
},
},
});
}
return helmet(helmetConfig)(ctx, next);
};
## Instruction:
Add airtable in CSP policy
## Code After:
'use strict';
const { defaultsDeep, merge } = require('lodash/fp');
const helmet = require('koa-helmet');
const defaults = {
crossOriginEmbedderPolicy: false,
crossOriginOpenerPolicy: false,
crossOriginResourcePolicy: false,
originAgentCluster: false,
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'https://dl.airtable.com'],
'media-src': ["'self'", 'data:', 'blob:'],
upgradeInsecureRequests: null,
},
},
xssFilter: false,
hsts: {
maxAge: 31536000,
includeSubDomains: true,
},
frameguard: {
action: 'sameorigin',
},
};
/**
* @type {import('./').MiddlewareFactory}
*/
module.exports = config => (ctx, next) => {
let helmetConfig = defaultsDeep(defaults, config);
if (
ctx.method === 'GET' &&
['/graphql', '/documentation'].some(str => ctx.path.startsWith(str))
) {
helmetConfig = merge(helmetConfig, {
contentSecurityPolicy: {
directives: {
'script-src': ["'self'", "'unsafe-inline'", 'cdn.jsdelivr.net'],
'img-src': ["'self'", 'data:', 'cdn.jsdelivr.net', 'strapi.io'],
},
},
});
}
return helmet(helmetConfig)(ctx, next);
};
| 'use strict';
const { defaultsDeep, merge } = require('lodash/fp');
const helmet = require('koa-helmet');
const defaults = {
crossOriginEmbedderPolicy: false,
crossOriginOpenerPolicy: false,
crossOriginResourcePolicy: false,
originAgentCluster: false,
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
- 'img-src': ["'self'", 'data:', 'blob:'],
+ 'img-src': ["'self'", 'data:', 'blob:', 'https://dl.airtable.com'],
? +++++++++++++++++++++++++++
'media-src': ["'self'", 'data:', 'blob:'],
upgradeInsecureRequests: null,
},
},
xssFilter: false,
hsts: {
maxAge: 31536000,
includeSubDomains: true,
},
frameguard: {
action: 'sameorigin',
},
};
/**
* @type {import('./').MiddlewareFactory}
*/
module.exports = config => (ctx, next) => {
let helmetConfig = defaultsDeep(defaults, config);
if (
ctx.method === 'GET' &&
['/graphql', '/documentation'].some(str => ctx.path.startsWith(str))
) {
helmetConfig = merge(helmetConfig, {
contentSecurityPolicy: {
directives: {
'script-src': ["'self'", "'unsafe-inline'", 'cdn.jsdelivr.net'],
'img-src': ["'self'", 'data:', 'cdn.jsdelivr.net', 'strapi.io'],
},
},
});
}
return helmet(helmetConfig)(ctx, next);
}; | 2 | 0.039216 | 1 | 1 |
4a35bba58917fb361fcf58725e1ece907075955b | project.clj | project.clj | (defproject caesium "0.8.0-SNAPSHOT"
:description "libsodium for clojure"
:url "https://github.com/lvh/caesium"
:deploy-repositories [["releases" :clojars]
["snapshots" :clojars]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.github.jnr/jnr-ffi "2.0.9"]
[commons-codec/commons-codec "1.10"]]
:main ^:skip-aot caesium.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[criterium "0.4.4"]]}
:test {:plugins [[lein-cljfmt "0.3.0"]
[lein-kibit "0.1.2"]
[jonase/eastwood "0.2.3"]
[lein-codox "0.9.4"]
[lein-cloverage "1.0.7-SNAPSHOT"]]}}
:codox {:metadata {:doc/format :markdown}
:output-path "doc"}
:global-vars {*warn-on-reflection* true})
| (defproject caesium "0.8.0-SNAPSHOT"
:description "libsodium for clojure"
:url "https://github.com/lvh/caesium"
:deploy-repositories [["releases" :clojars]
["snapshots" :clojars]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.github.jnr/jnr-ffi "2.0.9"]
[commons-codec/commons-codec "1.10"]
[byte-streams "0.2.2"]]
:main ^:skip-aot caesium.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[criterium "0.4.4"]]}
:test {:plugins [[lein-cljfmt "0.3.0"]
[lein-kibit "0.1.2"]
[jonase/eastwood "0.2.3"]
[lein-codox "0.9.4"]
[lein-cloverage "1.0.7-SNAPSHOT"]]}}
:codox {:metadata {:doc/format :markdown}
:output-path "doc"}
:global-vars {*warn-on-reflection* true})
| Add byte-streams for type conversions | Add byte-streams for type conversions
| Clojure | epl-1.0 | lvh/caesium | clojure | ## Code Before:
(defproject caesium "0.8.0-SNAPSHOT"
:description "libsodium for clojure"
:url "https://github.com/lvh/caesium"
:deploy-repositories [["releases" :clojars]
["snapshots" :clojars]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.github.jnr/jnr-ffi "2.0.9"]
[commons-codec/commons-codec "1.10"]]
:main ^:skip-aot caesium.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[criterium "0.4.4"]]}
:test {:plugins [[lein-cljfmt "0.3.0"]
[lein-kibit "0.1.2"]
[jonase/eastwood "0.2.3"]
[lein-codox "0.9.4"]
[lein-cloverage "1.0.7-SNAPSHOT"]]}}
:codox {:metadata {:doc/format :markdown}
:output-path "doc"}
:global-vars {*warn-on-reflection* true})
## Instruction:
Add byte-streams for type conversions
## Code After:
(defproject caesium "0.8.0-SNAPSHOT"
:description "libsodium for clojure"
:url "https://github.com/lvh/caesium"
:deploy-repositories [["releases" :clojars]
["snapshots" :clojars]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.github.jnr/jnr-ffi "2.0.9"]
[commons-codec/commons-codec "1.10"]
[byte-streams "0.2.2"]]
:main ^:skip-aot caesium.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[criterium "0.4.4"]]}
:test {:plugins [[lein-cljfmt "0.3.0"]
[lein-kibit "0.1.2"]
[jonase/eastwood "0.2.3"]
[lein-codox "0.9.4"]
[lein-cloverage "1.0.7-SNAPSHOT"]]}}
:codox {:metadata {:doc/format :markdown}
:output-path "doc"}
:global-vars {*warn-on-reflection* true})
| (defproject caesium "0.8.0-SNAPSHOT"
:description "libsodium for clojure"
:url "https://github.com/lvh/caesium"
:deploy-repositories [["releases" :clojars]
["snapshots" :clojars]]
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.github.jnr/jnr-ffi "2.0.9"]
- [commons-codec/commons-codec "1.10"]]
? -
+ [commons-codec/commons-codec "1.10"]
+ [byte-streams "0.2.2"]]
:main ^:skip-aot caesium.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:dependencies [[criterium "0.4.4"]]}
:test {:plugins [[lein-cljfmt "0.3.0"]
[lein-kibit "0.1.2"]
[jonase/eastwood "0.2.3"]
[lein-codox "0.9.4"]
[lein-cloverage "1.0.7-SNAPSHOT"]]}}
:codox {:metadata {:doc/format :markdown}
:output-path "doc"}
:global-vars {*warn-on-reflection* true}) | 3 | 0.136364 | 2 | 1 |
c74949597419f0faffa6e8e6980d47cc86927248 | haproxy.cfg | haproxy.cfg | global
pidfile /var/run/haproxy.pid
defaults
mode http
balance roundrobin
option dontlognull
option dontlog-normal
option forwardfor
option redispatch
maxconn 5000
timeout connect 5s
timeout client 20s
timeout server 20s
timeout queue 30s
timeout http-request 5s
timeout http-keep-alive 15s
stats enable
stats refresh 30s
stats realm Strictly\ Private
stats auth admin:admin
stats uri /admin?stats
frontend dummy-fe
bind *:80
bind *:443
mode http
option http-server-close
acl url_dummy path_beg /dummy
use_backend dummy-be if url_dummy
backend dummy-be
mode http
server dummy 1.1.1.1:1111 check
| global
pidfile /var/run/haproxy.pid
defaults
mode http
balance roundrobin
option dontlognull
option dontlog-normal
option forwardfor
option redispatch
maxconn 5000
timeout connect 5s
timeout client 20s
timeout server 20s
timeout queue 30s
timeout http-request 5s
timeout http-keep-alive 15s
stats enable
stats refresh 30s
stats realm Strictly\ Private
stats auth admin:admin
stats uri /admin?stats
frontend dummy-fe
bind *:80
bind *:443
mode http
option http-server-close
acl url_dummy path_beg /dummy
use_backend dummy-be if url_dummy
backend dummy-be
mode http
server dummy 127.0.0.1:1111
| Change dummy server to 127.0.0.1 | Change dummy server to 127.0.0.1
| INI | mit | leostarcevic/docker-flow-proxy,leostarcevic/docker-flow-proxy | ini | ## Code Before:
global
pidfile /var/run/haproxy.pid
defaults
mode http
balance roundrobin
option dontlognull
option dontlog-normal
option forwardfor
option redispatch
maxconn 5000
timeout connect 5s
timeout client 20s
timeout server 20s
timeout queue 30s
timeout http-request 5s
timeout http-keep-alive 15s
stats enable
stats refresh 30s
stats realm Strictly\ Private
stats auth admin:admin
stats uri /admin?stats
frontend dummy-fe
bind *:80
bind *:443
mode http
option http-server-close
acl url_dummy path_beg /dummy
use_backend dummy-be if url_dummy
backend dummy-be
mode http
server dummy 1.1.1.1:1111 check
## Instruction:
Change dummy server to 127.0.0.1
## Code After:
global
pidfile /var/run/haproxy.pid
defaults
mode http
balance roundrobin
option dontlognull
option dontlog-normal
option forwardfor
option redispatch
maxconn 5000
timeout connect 5s
timeout client 20s
timeout server 20s
timeout queue 30s
timeout http-request 5s
timeout http-keep-alive 15s
stats enable
stats refresh 30s
stats realm Strictly\ Private
stats auth admin:admin
stats uri /admin?stats
frontend dummy-fe
bind *:80
bind *:443
mode http
option http-server-close
acl url_dummy path_beg /dummy
use_backend dummy-be if url_dummy
backend dummy-be
mode http
server dummy 127.0.0.1:1111
| global
pidfile /var/run/haproxy.pid
defaults
mode http
balance roundrobin
option dontlognull
option dontlog-normal
option forwardfor
option redispatch
maxconn 5000
timeout connect 5s
timeout client 20s
timeout server 20s
timeout queue 30s
timeout http-request 5s
timeout http-keep-alive 15s
stats enable
stats refresh 30s
stats realm Strictly\ Private
stats auth admin:admin
stats uri /admin?stats
frontend dummy-fe
bind *:80
bind *:443
mode http
option http-server-close
acl url_dummy path_beg /dummy
use_backend dummy-be if url_dummy
backend dummy-be
mode http
- server dummy 1.1.1.1:1111 check
? ^ ^ ------
+ server dummy 127.0.0.1:1111
? ++ ^ ^
| 2 | 0.054054 | 1 | 1 |
22f6b5822dee0d953cbac5e902262d05fdafc363 | pkg/lib/_global-variables.scss | pkg/lib/_global-variables.scss | @import "@patternfly/patternfly/base/patternfly-variables.scss";
/* Bootstrap scss compilation will complain if these are not set
* https://github.com/twbs/bootstrap/issues/23982
*/
$grid-gutter-width: 30px;
$font-size-base: 1;
/*
* PatternFly 4 adapting the lists too early.
* When PF4 has a breakpoint of 768px width, it's actually 1108 for us, as the sidebar is 340px.
* (This does use the intended content area, but there's a mismatch between content and browser width as we use iframes.)
* So redefine grid breakpoints
*/
$pf-global--breakpoint--xs: 0 !default;
$pf-global--breakpoint--sm: 236px !default;
$pf-global--breakpoint--md: 428px !default;
$pf-global--breakpoint--lg: 652px !default;
$pf-global--breakpoint--xl: 860px !default;
$pf-global--breakpoint--2xl: 1110px !default;
| @import "@patternfly/patternfly/base/patternfly-variables.scss";
/*
* PatternFly 4 adapting the lists too early.
* When PF4 has a breakpoint of 768px width, it's actually 1108 for us, as the sidebar is 340px.
* (This does use the intended content area, but there's a mismatch between content and browser width as we use iframes.)
* So redefine grid breakpoints
*/
$pf-global--breakpoint--xs: 0 !default;
$pf-global--breakpoint--sm: 236px !default;
$pf-global--breakpoint--md: 428px !default;
$pf-global--breakpoint--lg: 652px !default;
$pf-global--breakpoint--xl: 860px !default;
$pf-global--breakpoint--2xl: 1110px !default;
| Remove hack for bootstrap compilation in global-variables | lib: Remove hack for bootstrap compilation in global-variables
Bootstrap was dropped in 3a1d772d92bb2bf628ed26b7d1d68a1f1cbd6bf1.
| SCSS | lgpl-2.1 | mvollmer/cockpit,martinpitt/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,mvollmer/cockpit,mvollmer/cockpit,cockpit-project/cockpit,mvollmer/cockpit,cockpit-project/cockpit,martinpitt/cockpit,cockpit-project/cockpit,martinpitt/cockpit,martinpitt/cockpit,martinpitt/cockpit,mvollmer/cockpit | scss | ## Code Before:
@import "@patternfly/patternfly/base/patternfly-variables.scss";
/* Bootstrap scss compilation will complain if these are not set
* https://github.com/twbs/bootstrap/issues/23982
*/
$grid-gutter-width: 30px;
$font-size-base: 1;
/*
* PatternFly 4 adapting the lists too early.
* When PF4 has a breakpoint of 768px width, it's actually 1108 for us, as the sidebar is 340px.
* (This does use the intended content area, but there's a mismatch between content and browser width as we use iframes.)
* So redefine grid breakpoints
*/
$pf-global--breakpoint--xs: 0 !default;
$pf-global--breakpoint--sm: 236px !default;
$pf-global--breakpoint--md: 428px !default;
$pf-global--breakpoint--lg: 652px !default;
$pf-global--breakpoint--xl: 860px !default;
$pf-global--breakpoint--2xl: 1110px !default;
## Instruction:
lib: Remove hack for bootstrap compilation in global-variables
Bootstrap was dropped in 3a1d772d92bb2bf628ed26b7d1d68a1f1cbd6bf1.
## Code After:
@import "@patternfly/patternfly/base/patternfly-variables.scss";
/*
* PatternFly 4 adapting the lists too early.
* When PF4 has a breakpoint of 768px width, it's actually 1108 for us, as the sidebar is 340px.
* (This does use the intended content area, but there's a mismatch between content and browser width as we use iframes.)
* So redefine grid breakpoints
*/
$pf-global--breakpoint--xs: 0 !default;
$pf-global--breakpoint--sm: 236px !default;
$pf-global--breakpoint--md: 428px !default;
$pf-global--breakpoint--lg: 652px !default;
$pf-global--breakpoint--xl: 860px !default;
$pf-global--breakpoint--2xl: 1110px !default;
| @import "@patternfly/patternfly/base/patternfly-variables.scss";
-
- /* Bootstrap scss compilation will complain if these are not set
- * https://github.com/twbs/bootstrap/issues/23982
- */
- $grid-gutter-width: 30px;
- $font-size-base: 1;
/*
* PatternFly 4 adapting the lists too early.
* When PF4 has a breakpoint of 768px width, it's actually 1108 for us, as the sidebar is 340px.
* (This does use the intended content area, but there's a mismatch between content and browser width as we use iframes.)
* So redefine grid breakpoints
*/
$pf-global--breakpoint--xs: 0 !default;
$pf-global--breakpoint--sm: 236px !default;
$pf-global--breakpoint--md: 428px !default;
$pf-global--breakpoint--lg: 652px !default;
$pf-global--breakpoint--xl: 860px !default;
$pf-global--breakpoint--2xl: 1110px !default; | 6 | 0.3 | 0 | 6 |
c6268d1f33c6ca5b9a910b69a0f593b7e6a1d959 | app/models/trackback.rb | app/models/trackback.rb | class Trackback < Feedback
content_fields :excerpt
validates :title, :excerpt, :url, presence: true
# attr_accessible :url, :blog_name, :title, :excerpt, :ip, :published, :article_id
def initialize(*args, &block)
super(*args, &block)
self.title ||= url
self.blog_name ||= ''
end
before_create :process_trackback
def process_trackback
if excerpt.length >= 251
# this limits excerpt to 250 chars, including the trailing "..."
self.excerpt = excerpt[0..246] << '...'
end
end
def article_allows_feedback?
return true if article.allow_pings?
errors.add(:article, 'Article is not pingable')
false
end
def blog_allows_feedback?
return true unless blog.global_pings_disable
errors.add(:article, 'Pings are disabled')
false
end
def originator
blog_name
end
def body
excerpt
end
def body=(newval)
self.excerpt = newval
end
def feed_title
"Trackback from #{blog_name}: #{title} on #{article.title}"
end
end
| class Trackback < Feedback
content_fields :excerpt
validates :title, :excerpt, :url, presence: true
before_create :process_trackback
def process_trackback
if excerpt.length >= 251
# this limits excerpt to 250 chars, including the trailing "..."
self.excerpt = excerpt[0..246] << '...'
end
end
def article_allows_feedback?
return true if article.allow_pings?
errors.add(:article, 'Article is not pingable')
false
end
def blog_allows_feedback?
return true unless blog.global_pings_disable
errors.add(:article, 'Pings are disabled')
false
end
def originator
blog_name
end
def body
excerpt
end
def body=(newval)
self.excerpt = newval
end
def feed_title
"Trackback from #{blog_name}: #{title} on #{article.title}"
end
end
| Remove superfluous initializer from Trackback | Remove superfluous initializer from Trackback
No new Trackback objects should be stored in the database, and also no
tests fail when this code is removed.
| Ruby | mit | publify/publify_core,publify/publify_core,publify/publify_core | ruby | ## Code Before:
class Trackback < Feedback
content_fields :excerpt
validates :title, :excerpt, :url, presence: true
# attr_accessible :url, :blog_name, :title, :excerpt, :ip, :published, :article_id
def initialize(*args, &block)
super(*args, &block)
self.title ||= url
self.blog_name ||= ''
end
before_create :process_trackback
def process_trackback
if excerpt.length >= 251
# this limits excerpt to 250 chars, including the trailing "..."
self.excerpt = excerpt[0..246] << '...'
end
end
def article_allows_feedback?
return true if article.allow_pings?
errors.add(:article, 'Article is not pingable')
false
end
def blog_allows_feedback?
return true unless blog.global_pings_disable
errors.add(:article, 'Pings are disabled')
false
end
def originator
blog_name
end
def body
excerpt
end
def body=(newval)
self.excerpt = newval
end
def feed_title
"Trackback from #{blog_name}: #{title} on #{article.title}"
end
end
## Instruction:
Remove superfluous initializer from Trackback
No new Trackback objects should be stored in the database, and also no
tests fail when this code is removed.
## Code After:
class Trackback < Feedback
content_fields :excerpt
validates :title, :excerpt, :url, presence: true
before_create :process_trackback
def process_trackback
if excerpt.length >= 251
# this limits excerpt to 250 chars, including the trailing "..."
self.excerpt = excerpt[0..246] << '...'
end
end
def article_allows_feedback?
return true if article.allow_pings?
errors.add(:article, 'Article is not pingable')
false
end
def blog_allows_feedback?
return true unless blog.global_pings_disable
errors.add(:article, 'Pings are disabled')
false
end
def originator
blog_name
end
def body
excerpt
end
def body=(newval)
self.excerpt = newval
end
def feed_title
"Trackback from #{blog_name}: #{title} on #{article.title}"
end
end
| class Trackback < Feedback
content_fields :excerpt
validates :title, :excerpt, :url, presence: true
-
- # attr_accessible :url, :blog_name, :title, :excerpt, :ip, :published, :article_id
-
- def initialize(*args, &block)
- super(*args, &block)
- self.title ||= url
- self.blog_name ||= ''
- end
before_create :process_trackback
def process_trackback
if excerpt.length >= 251
# this limits excerpt to 250 chars, including the trailing "..."
self.excerpt = excerpt[0..246] << '...'
end
end
def article_allows_feedback?
return true if article.allow_pings?
errors.add(:article, 'Article is not pingable')
false
end
def blog_allows_feedback?
return true unless blog.global_pings_disable
errors.add(:article, 'Pings are disabled')
false
end
def originator
blog_name
end
def body
excerpt
end
def body=(newval)
self.excerpt = newval
end
def feed_title
"Trackback from #{blog_name}: #{title} on #{article.title}"
end
end | 8 | 0.156863 | 0 | 8 |
e2862f3015a10b5a3bb071d23353c8fad7617e32 | lib/resolver.js | lib/resolver.js | const providers = {
"env": require('provider/env'),
"file": require('provider/file')
}
module.exports.resolve = function(config) {
const providerType = config.type
const provider = providers[providerType]
return provider.init(config)
}
| const providers = {
"env": require('provider/env'),
"file": require('provider/file')
}
module.exports.resolve = function(config) {
const providerType = config.type
const provider = providers[providerType]
if(provider !== undefined) {
return provider.init(config)
}
}
| Add check for undefined provider | Add check for undefined provider
| JavaScript | apache-2.0 | reneweb/dvar,reneweb/dvar | javascript | ## Code Before:
const providers = {
"env": require('provider/env'),
"file": require('provider/file')
}
module.exports.resolve = function(config) {
const providerType = config.type
const provider = providers[providerType]
return provider.init(config)
}
## Instruction:
Add check for undefined provider
## Code After:
const providers = {
"env": require('provider/env'),
"file": require('provider/file')
}
module.exports.resolve = function(config) {
const providerType = config.type
const provider = providers[providerType]
if(provider !== undefined) {
return provider.init(config)
}
}
| const providers = {
"env": require('provider/env'),
"file": require('provider/file')
}
module.exports.resolve = function(config) {
const providerType = config.type
const provider = providers[providerType]
+ if(provider !== undefined) {
- return provider.init(config)
+ return provider.init(config)
? ++
+ }
} | 4 | 0.4 | 3 | 1 |
249405fb87ac49b8b02c6bc6eed38087f1b80a8b | t1/README.md | t1/README.md | ERROR: type should be string, got "\nhttps://github.com/taschetto/ads/blob/master/t1/drawing.svg\n\n## Queues info:\n\nQueue | Type | Min arrival | Max arrival | Min service | Max service\n---|--------|-----|-----|-----|-----\nCAI|G/G/6/50|1 min|2 min|1 min|15 min\nINF|G/G/1/10|4 min|7 min|5 min|12 min\nTES|G/G/2/15|8 min|12 min|10 min|35 min\nVAL|G/G/3/25|N/A|N/A|2 min|4 min\nEMB|G/G/3/30|N/A|N/A|4 min|9 min\nTRO|G/G/2/20|10 min|15 min|9 min|14 min\n\n## Probabilities\n\nSrc | Dst | Probability\n:-----:|:-----------:|-----------:\nCAI|INF|0.1\nCAI|TES|0.1\nCAI|VAL|0.5\nCAI|EMB|0.15\nCAI|TRO|0.05\nCAI|**out**|0.1\nINF|CAI|0.55\nINF|TES|0.2\nINF|**out**|0.25\nTES|CAI|0.6\nTES|INF|0.1\nTES|**out**|0.3\nVAL|CAI|0.1\nVAL|INF|0.05\nVAL|TES|0.02\nVAL|**out**|0.83\nEMB|CAI|0.05\nEMB|INF|0.05\nEMB|TES|0.1\nEMB|VAL|0.55\nEMB|**out**|0.25\nTRO|CAI|0.1\nTRO|INF|0.1\nTRO|TES|0.05\nTRO|**out**|0.75\n" | ERROR: type should be string, got "\nhttps://github.com/taschetto/ads/blob/master/t1/drawing.svg\n\n## Queues info:\n\nhttps://github.com/taschetto/ads/blob/master/t1/queues-info.xls\n" | Add reference to queues info file | Add reference to queues info file
| Markdown | mit | taschetto/ads,taschetto/ads,taschetto/ads | markdown | ## Code Before:
https://github.com/taschetto/ads/blob/master/t1/drawing.svg
## Queues info:
Queue | Type | Min arrival | Max arrival | Min service | Max service
---|--------|-----|-----|-----|-----
CAI|G/G/6/50|1 min|2 min|1 min|15 min
INF|G/G/1/10|4 min|7 min|5 min|12 min
TES|G/G/2/15|8 min|12 min|10 min|35 min
VAL|G/G/3/25|N/A|N/A|2 min|4 min
EMB|G/G/3/30|N/A|N/A|4 min|9 min
TRO|G/G/2/20|10 min|15 min|9 min|14 min
## Probabilities
Src | Dst | Probability
:-----:|:-----------:|-----------:
CAI|INF|0.1
CAI|TES|0.1
CAI|VAL|0.5
CAI|EMB|0.15
CAI|TRO|0.05
CAI|**out**|0.1
INF|CAI|0.55
INF|TES|0.2
INF|**out**|0.25
TES|CAI|0.6
TES|INF|0.1
TES|**out**|0.3
VAL|CAI|0.1
VAL|INF|0.05
VAL|TES|0.02
VAL|**out**|0.83
EMB|CAI|0.05
EMB|INF|0.05
EMB|TES|0.1
EMB|VAL|0.55
EMB|**out**|0.25
TRO|CAI|0.1
TRO|INF|0.1
TRO|TES|0.05
TRO|**out**|0.75
## Instruction:
Add reference to queues info file
## Code After:
https://github.com/taschetto/ads/blob/master/t1/drawing.svg
## Queues info:
https://github.com/taschetto/ads/blob/master/t1/queues-info.xls
| ERROR: type should be string, got " \n https://github.com/taschetto/ads/blob/master/t1/drawing.svg\n \n ## Queues info:\n \n+ https://github.com/taschetto/ads/blob/master/t1/queues-info.xls\n- Queue | Type | Min arrival | Max arrival | Min service | Max service\n- ---|--------|-----|-----|-----|-----\n- CAI|G/G/6/50|1 min|2 min|1 min|15 min\n- INF|G/G/1/10|4 min|7 min|5 min|12 min\n- TES|G/G/2/15|8 min|12 min|10 min|35 min\n- VAL|G/G/3/25|N/A|N/A|2 min|4 min\n- EMB|G/G/3/30|N/A|N/A|4 min|9 min\n- TRO|G/G/2/20|10 min|15 min|9 min|14 min\n- \n- ## Probabilities\n- \n- Src | Dst | Probability\n- :-----:|:-----------:|-----------:\n- CAI|INF|0.1\n- CAI|TES|0.1\n- CAI|VAL|0.5\n- CAI|EMB|0.15\n- CAI|TRO|0.05\n- CAI|**out**|0.1\n- INF|CAI|0.55\n- INF|TES|0.2\n- INF|**out**|0.25\n- TES|CAI|0.6\n- TES|INF|0.1\n- TES|**out**|0.3\n- VAL|CAI|0.1\n- VAL|INF|0.05\n- VAL|TES|0.02\n- VAL|**out**|0.83\n- EMB|CAI|0.05\n- EMB|INF|0.05\n- EMB|TES|0.1\n- EMB|VAL|0.55\n- EMB|**out**|0.25\n- TRO|CAI|0.1\n- TRO|INF|0.1\n- TRO|TES|0.05\n- TRO|**out**|0.75" | 39 | 0.906977 | 1 | 38 |
f1af90a1e2e2f8e2ba1f7f585ed7131d6592a9fd | README.md | README.md |
Stash your files temporarily on a remote server.
## Install
```sh
pip install stasher
```
## Usage
```sh
export STASH_URL=https://my-secret-stash.herokuapp.com
export STASH_TOKEN=***very-secret-token***
# pushing to your stash server
stash push my-box-name myfile1.txt
stash push my-box-name myfile2.txt
# pulling from your stash server
stash pull my-box-name
# see more options
stash -h
stash push -h
stash pull -h
```
## Deploy server for stasher
[](https://heroku.com/deploy?template=https://github.com/andreif/stasher)
It will generate `STASH_TOKEN` variable for you, which you can see with:
```sh
heroku config:get STASH_TOKEN
```
The token can be changed with:
```sh
heroku config:set STASH_TOKEN=***your-value***
```
|
Stash your files temporarily on a remote server.
## Install
```sh
pip install stasher
```
## Usage
```sh
export STASH_URL=https://my-secret-stash.herokuapp.com
export STASH_TOKEN=***very-secret-token***
# pushing to your stash server
stash push my-box-name myfile1.txt
stash push my-box-name myfile2.txt
# pulling from your stash server
stash pull my-box-name
# see more options
stash -h
stash push -h
stash pull -h
```
## Deploy stasher on Heroku
[](https://heroku.com/deploy?template=https://github.com/andreif/stasher)
It will generate `STASH_TOKEN` variable for you, which you can see with:
```sh
heroku config:get STASH_TOKEN
```
The token can be changed with:
```sh
heroku config:set STASH_TOKEN=***your-value***
```
### Manual deploy
Install Heroku CLI, see https://devcenter.heroku.com/articles/heroku-cli
```sh
git clone git@github.com:andreif/stasher.git
cd stasher
heroku apps:create my-secret-stash
heroku git:remote -a my-secret-stash
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set STASH_TOKEN=***very-secret-token***
git push heroku master
heroku open
```
| Add instructions for manual deploy. | Add instructions for manual deploy.
| Markdown | mit | andreif/stasher | markdown | ## Code Before:
Stash your files temporarily on a remote server.
## Install
```sh
pip install stasher
```
## Usage
```sh
export STASH_URL=https://my-secret-stash.herokuapp.com
export STASH_TOKEN=***very-secret-token***
# pushing to your stash server
stash push my-box-name myfile1.txt
stash push my-box-name myfile2.txt
# pulling from your stash server
stash pull my-box-name
# see more options
stash -h
stash push -h
stash pull -h
```
## Deploy server for stasher
[](https://heroku.com/deploy?template=https://github.com/andreif/stasher)
It will generate `STASH_TOKEN` variable for you, which you can see with:
```sh
heroku config:get STASH_TOKEN
```
The token can be changed with:
```sh
heroku config:set STASH_TOKEN=***your-value***
```
## Instruction:
Add instructions for manual deploy.
## Code After:
Stash your files temporarily on a remote server.
## Install
```sh
pip install stasher
```
## Usage
```sh
export STASH_URL=https://my-secret-stash.herokuapp.com
export STASH_TOKEN=***very-secret-token***
# pushing to your stash server
stash push my-box-name myfile1.txt
stash push my-box-name myfile2.txt
# pulling from your stash server
stash pull my-box-name
# see more options
stash -h
stash push -h
stash pull -h
```
## Deploy stasher on Heroku
[](https://heroku.com/deploy?template=https://github.com/andreif/stasher)
It will generate `STASH_TOKEN` variable for you, which you can see with:
```sh
heroku config:get STASH_TOKEN
```
The token can be changed with:
```sh
heroku config:set STASH_TOKEN=***your-value***
```
### Manual deploy
Install Heroku CLI, see https://devcenter.heroku.com/articles/heroku-cli
```sh
git clone git@github.com:andreif/stasher.git
cd stasher
heroku apps:create my-secret-stash
heroku git:remote -a my-secret-stash
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set STASH_TOKEN=***very-secret-token***
git push heroku master
heroku open
```
|
Stash your files temporarily on a remote server.
## Install
```sh
pip install stasher
```
## Usage
```sh
export STASH_URL=https://my-secret-stash.herokuapp.com
export STASH_TOKEN=***very-secret-token***
# pushing to your stash server
stash push my-box-name myfile1.txt
stash push my-box-name myfile2.txt
# pulling from your stash server
stash pull my-box-name
# see more options
stash -h
stash push -h
stash pull -h
```
- ## Deploy server for stasher
+ ## Deploy stasher on Heroku
[](https://heroku.com/deploy?template=https://github.com/andreif/stasher)
It will generate `STASH_TOKEN` variable for you, which you can see with:
```sh
heroku config:get STASH_TOKEN
```
The token can be changed with:
```sh
heroku config:set STASH_TOKEN=***your-value***
```
+
+ ### Manual deploy
+
+ Install Heroku CLI, see https://devcenter.heroku.com/articles/heroku-cli
+
+ ```sh
+ git clone git@github.com:andreif/stasher.git
+ cd stasher
+
+ heroku apps:create my-secret-stash
+ heroku git:remote -a my-secret-stash
+ heroku addons:create heroku-postgresql:hobby-dev
+ heroku config:set STASH_TOKEN=***very-secret-token***
+
+ git push heroku master
+ heroku open
+ ``` | 19 | 0.431818 | 18 | 1 |
4ce0ab9daa8d733d5f9d89a600abfdad550dec39 | .travis.yml | .travis.yml | language: python
matrix:
include:
- os: linux
sudo: false
python: 2.7
- os: linux
sudo: false
python: 3.5
- os: osx
language: generic
install:
- pip install pyflakes pep8 coverage coveralls nose
script:
- pyflakes .
- pep8 .
- nosetests
- coveralls
| language: python
matrix:
include:
- os: linux
sudo: false
python: 2.7
- os: linux
sudo: false
python: 3.5
- os: osx
language: generic
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip2 install pyflakes pep8 coverage coveralls nose; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install pyflakes pep8 coverage coveralls nose; fi
script:
- pyflakes .
- pep8 .
- nosetests
- coveralls
| Fix OS X Travis CI | Fix OS X Travis CI
| YAML | mit | mpeterv/hererocks,mpeterv/hererocks | yaml | ## Code Before:
language: python
matrix:
include:
- os: linux
sudo: false
python: 2.7
- os: linux
sudo: false
python: 3.5
- os: osx
language: generic
install:
- pip install pyflakes pep8 coverage coveralls nose
script:
- pyflakes .
- pep8 .
- nosetests
- coveralls
## Instruction:
Fix OS X Travis CI
## Code After:
language: python
matrix:
include:
- os: linux
sudo: false
python: 2.7
- os: linux
sudo: false
python: 3.5
- os: osx
language: generic
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip2 install pyflakes pep8 coverage coveralls nose; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install pyflakes pep8 coverage coveralls nose; fi
script:
- pyflakes .
- pep8 .
- nosetests
- coveralls
| language: python
matrix:
include:
- os: linux
sudo: false
python: 2.7
- os: linux
sudo: false
python: 3.5
- os: osx
language: generic
install:
- - pip install pyflakes pep8 coverage coveralls nose
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip2 install pyflakes pep8 coverage coveralls nose; fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install pyflakes pep8 coverage coveralls nose; fi
script:
- pyflakes .
- pep8 .
- nosetests
- coveralls | 3 | 0.142857 | 2 | 1 |
c5bd00b8d980c531185fa0421da213ff35a6b7bb | lib/sub_diff/differ.rb | lib/sub_diff/differ.rb | module SubDiff
class Differ < Struct.new(:diff_collection, :diff_method)
Match = Struct.new(:match, :prefix, :suffix, :replacement) do
alias_method :to_str, :match
end
def diff(*args)
# Ruby 1.8.7 does not support additional args after * (splat)
block = args.pop
diff_collection.diffable.send(diff_method, args.first) do |match|
# This needs to be called later since it will overwrite
# the special regex $` (prefix) and $' (suffix) globals
replacement = proc { match.sub(*args, &block) }
match = Match.new(match, $`, $', replacement.call)
yield(diff_collection, match)
end
diff_collection
end
end
end
| module SubDiff
class Differ < Struct.new(:diff_collection, :diff_method)
class Match < Struct.new(:match, :prefix, :suffix, :replacement)
alias_method :to_str, :match
end
def diff(*args)
# Ruby 1.8.7 does not support additional args after * (splat)
block = args.pop
diff_collection.diffable.send(diff_method, args.first) do |match|
# This needs to be called later since it will overwrite
# the special regex $` (prefix) and $' (suffix) globals
replacement = proc { match.sub(*args, &block) }
match = Match.new(match, $`, $', replacement.call)
yield(diff_collection, match)
end
diff_collection
end
end
end
| Make Match a class instead of a Struct | Make Match a class instead of a Struct
| Ruby | mit | shuber/sub_diff | ruby | ## Code Before:
module SubDiff
class Differ < Struct.new(:diff_collection, :diff_method)
Match = Struct.new(:match, :prefix, :suffix, :replacement) do
alias_method :to_str, :match
end
def diff(*args)
# Ruby 1.8.7 does not support additional args after * (splat)
block = args.pop
diff_collection.diffable.send(diff_method, args.first) do |match|
# This needs to be called later since it will overwrite
# the special regex $` (prefix) and $' (suffix) globals
replacement = proc { match.sub(*args, &block) }
match = Match.new(match, $`, $', replacement.call)
yield(diff_collection, match)
end
diff_collection
end
end
end
## Instruction:
Make Match a class instead of a Struct
## Code After:
module SubDiff
class Differ < Struct.new(:diff_collection, :diff_method)
class Match < Struct.new(:match, :prefix, :suffix, :replacement)
alias_method :to_str, :match
end
def diff(*args)
# Ruby 1.8.7 does not support additional args after * (splat)
block = args.pop
diff_collection.diffable.send(diff_method, args.first) do |match|
# This needs to be called later since it will overwrite
# the special regex $` (prefix) and $' (suffix) globals
replacement = proc { match.sub(*args, &block) }
match = Match.new(match, $`, $', replacement.call)
yield(diff_collection, match)
end
diff_collection
end
end
end
| module SubDiff
class Differ < Struct.new(:diff_collection, :diff_method)
- Match = Struct.new(:match, :prefix, :suffix, :replacement) do
? ^ ---
+ class Match < Struct.new(:match, :prefix, :suffix, :replacement)
? ++++++ ^
alias_method :to_str, :match
end
def diff(*args)
# Ruby 1.8.7 does not support additional args after * (splat)
block = args.pop
diff_collection.diffable.send(diff_method, args.first) do |match|
# This needs to be called later since it will overwrite
# the special regex $` (prefix) and $' (suffix) globals
replacement = proc { match.sub(*args, &block) }
match = Match.new(match, $`, $', replacement.call)
yield(diff_collection, match)
end
diff_collection
end
end
end | 2 | 0.086957 | 1 | 1 |
418c857d0c157f631600bdcc8868237ef7da22c7 | composer.json | composer.json | {
"name": "clippings/freezable",
"description": "Freeze values in objects",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Haralan Dobrev",
"email": "hkdobrev@gmail.com",
"role": "Author"
}
],
"require": {
"php": ">=5.4"
},
"autoload": {
"psr-4": {"Clippings\\Freezable\\": "src/"}
}
}
| {
"name": "clippings/freezable",
"description": "Freeze values in objects",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Haralan Dobrev",
"email": "hkdobrev@gmail.com",
"role": "Author"
}
],
"require": {
"php": ">=5.4"
},
"autoload": {
"psr-4": {"Clippings\\Freezable\\": "src/"}
},
"extra": {
"branch-alias": {
"dev-master": "0.1.x-dev"
}
}
}
| Add branch alias: dev-master → 0.1.x-dev | Add branch alias: dev-master → 0.1.x-dev
| JSON | bsd-3-clause | clippings/freezable | json | ## Code Before:
{
"name": "clippings/freezable",
"description": "Freeze values in objects",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Haralan Dobrev",
"email": "hkdobrev@gmail.com",
"role": "Author"
}
],
"require": {
"php": ">=5.4"
},
"autoload": {
"psr-4": {"Clippings\\Freezable\\": "src/"}
}
}
## Instruction:
Add branch alias: dev-master → 0.1.x-dev
## Code After:
{
"name": "clippings/freezable",
"description": "Freeze values in objects",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Haralan Dobrev",
"email": "hkdobrev@gmail.com",
"role": "Author"
}
],
"require": {
"php": ">=5.4"
},
"autoload": {
"psr-4": {"Clippings\\Freezable\\": "src/"}
},
"extra": {
"branch-alias": {
"dev-master": "0.1.x-dev"
}
}
}
| {
"name": "clippings/freezable",
"description": "Freeze values in objects",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Haralan Dobrev",
"email": "hkdobrev@gmail.com",
"role": "Author"
}
],
"require": {
"php": ">=5.4"
},
"autoload": {
"psr-4": {"Clippings\\Freezable\\": "src/"}
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.1.x-dev"
+ }
}
} | 5 | 0.277778 | 5 | 0 |
4f76d799edab526b1de4ac24b61c909336b86bb9 | gba/devkitarm/source/main.c | gba/devkitarm/source/main.c | // GBT Player v3.0.9
//
// SPDX-License-Identifier: MIT
//
// Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com>
#include <gba.h>
#include <stdio.h>
#include "gbt_player.h"
extern const uint8_t *template_data[];
int main(int argc, char *argv[])
{
irqInit();
irqEnable(IRQ_VBLANK);
consoleDemoInit();
iprintf("GBT Player v3.0.9");
gbt_play(template_data, 5);
while (1)
{
VBlankIntrWait();
gbt_update();
}
}
| // GBT Player v3.0.9
//
// SPDX-License-Identifier: MIT
//
// Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com>
#include <gba.h>
#include "gbt_player.h"
extern const uint8_t *template_data[];
int main(int argc, char *argv[])
{
irqInit();
irqEnable(IRQ_VBLANK);
gbt_play(template_data, 5);
while (1)
{
VBlankIntrWait();
gbt_update();
}
}
| Stop using console in demo ROM | gba: Stop using console in demo ROM
This makes it easier to analyse the elf map file to look for changes
after modifications to GBT Player.
| C | mit | AntonioND/gbt-player,AntonioND/gbt-player,AntonioND/gbt-player | c | ## Code Before:
// GBT Player v3.0.9
//
// SPDX-License-Identifier: MIT
//
// Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com>
#include <gba.h>
#include <stdio.h>
#include "gbt_player.h"
extern const uint8_t *template_data[];
int main(int argc, char *argv[])
{
irqInit();
irqEnable(IRQ_VBLANK);
consoleDemoInit();
iprintf("GBT Player v3.0.9");
gbt_play(template_data, 5);
while (1)
{
VBlankIntrWait();
gbt_update();
}
}
## Instruction:
gba: Stop using console in demo ROM
This makes it easier to analyse the elf map file to look for changes
after modifications to GBT Player.
## Code After:
// GBT Player v3.0.9
//
// SPDX-License-Identifier: MIT
//
// Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com>
#include <gba.h>
#include "gbt_player.h"
extern const uint8_t *template_data[];
int main(int argc, char *argv[])
{
irqInit();
irqEnable(IRQ_VBLANK);
gbt_play(template_data, 5);
while (1)
{
VBlankIntrWait();
gbt_update();
}
}
| // GBT Player v3.0.9
//
// SPDX-License-Identifier: MIT
//
// Copyright (c) 2022, Antonio Niño Díaz <antonio_nd@outlook.com>
#include <gba.h>
-
- #include <stdio.h>
#include "gbt_player.h"
extern const uint8_t *template_data[];
int main(int argc, char *argv[])
{
irqInit();
irqEnable(IRQ_VBLANK);
- consoleDemoInit();
-
- iprintf("GBT Player v3.0.9");
-
gbt_play(template_data, 5);
while (1)
{
VBlankIntrWait();
gbt_update();
}
} | 6 | 0.193548 | 0 | 6 |
99fdbd0dc42fd265a2d72f9dedcd93c6cd97a494 | cfg/after/plugin/tmux_navigator.vim | cfg/after/plugin/tmux_navigator.vim | " map Meta keys for tmux-navigator
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
" handle Meta keys in terminal
if !has('gui_running')
silent! execute 'set <F31>=h'
silent! execute 'set <F32>=j'
silent! execute 'set <F33>=k'
silent! execute 'set <F34>=l'
nmap <F31> <M-h>
nmap <F32> <M-j>
nmap <F33> <M-k>
nmap <F34> <M-l>
endif
| " handle Meta keys in terminal
if !has('gui_running')
silent! execute 'set <M-h>=h'
silent! execute 'set <M-j>=j'
silent! execute 'set <M-k>=k'
silent! execute 'set <M-l>=l'
endif
" map Meta keys for tmux-navigator
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
tnoremap <silent> <M-h> <C-w>:TmuxNavigateLeft<CR>
tnoremap <silent> <M-j> <C-w>:TmuxNavigateDown<CR>
tnoremap <silent> <M-k> <C-w>:TmuxNavigateUp<CR>
tnoremap <silent> <M-l> <C-w>:TmuxNavigateRight<CR>
| Add tnoremap for M-hjkl mappings | Add tnoremap for M-hjkl mappings
Seems like the new terminal feature is much easier to use if I can
navigate easily across the windows. Allowing for my M-hjkl maps in
terminal windows lets me do pretty much that.
| VimL | mit | igemnace/vim-config,igemnace/my-vim-config,igemnace/vim-config,igemnace/vim-config | viml | ## Code Before:
" map Meta keys for tmux-navigator
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
" handle Meta keys in terminal
if !has('gui_running')
silent! execute 'set <F31>=h'
silent! execute 'set <F32>=j'
silent! execute 'set <F33>=k'
silent! execute 'set <F34>=l'
nmap <F31> <M-h>
nmap <F32> <M-j>
nmap <F33> <M-k>
nmap <F34> <M-l>
endif
## Instruction:
Add tnoremap for M-hjkl mappings
Seems like the new terminal feature is much easier to use if I can
navigate easily across the windows. Allowing for my M-hjkl maps in
terminal windows lets me do pretty much that.
## Code After:
" handle Meta keys in terminal
if !has('gui_running')
silent! execute 'set <M-h>=h'
silent! execute 'set <M-j>=j'
silent! execute 'set <M-k>=k'
silent! execute 'set <M-l>=l'
endif
" map Meta keys for tmux-navigator
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
tnoremap <silent> <M-h> <C-w>:TmuxNavigateLeft<CR>
tnoremap <silent> <M-j> <C-w>:TmuxNavigateDown<CR>
tnoremap <silent> <M-k> <C-w>:TmuxNavigateUp<CR>
tnoremap <silent> <M-l> <C-w>:TmuxNavigateRight<CR>
| + " handle Meta keys in terminal
+ if !has('gui_running')
+ silent! execute 'set <M-h>=h'
+ silent! execute 'set <M-j>=j'
+ silent! execute 'set <M-k>=k'
+ silent! execute 'set <M-l>=l'
+ endif
+
" map Meta keys for tmux-navigator
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
+ tnoremap <silent> <M-h> <C-w>:TmuxNavigateLeft<CR>
+ tnoremap <silent> <M-j> <C-w>:TmuxNavigateDown<CR>
+ tnoremap <silent> <M-k> <C-w>:TmuxNavigateUp<CR>
+ tnoremap <silent> <M-l> <C-w>:TmuxNavigateRight<CR>
-
- " handle Meta keys in terminal
- if !has('gui_running')
- silent! execute 'set <F31>=h'
- silent! execute 'set <F32>=j'
- silent! execute 'set <F33>=k'
- silent! execute 'set <F34>=l'
- nmap <F31> <M-h>
- nmap <F32> <M-j>
- nmap <F33> <M-k>
- nmap <F34> <M-l>
- endif | 24 | 1.411765 | 12 | 12 |
54f5f616b92173e4855dcba4294829a5eb1b209f | Dependencies/setupFMILibrary.bat | Dependencies/setupFMILibrary.bat | @ECHO OFF
REM $Id$
REM Bat script building FMILibrary dependency automatically
REM Author: Peter Nordin peter.nordin@liu.se
set basedir=%~dp0
set name=FMILibrary
set codedir=%basedir%\%name%_code
set builddir=%basedir%\%name%_build
set installdir=%basedir%\%name%
set OLDPATH=%PATH%
call setHopsanBuildPaths.bat
REM We don want msys in the path so we have to set it manually
set PATH=%mingw_path%;%cmake_path%;%OLDPATH%
REM build
mkdir %builddir%
cd %builddir%
cmake -Wno-dev -G "MinGW Makefiles" -DFMILIB_FMI_PLATFORM="win64" -DFMILIB_INSTALL_PREFIX=%installdir% %codedir%
mingw32-make.exe -j4
mingw32-make.exe install
cd %basedir%
echo.
echo setupFMILibrary.bat done
pause
| @ECHO OFF
REM $Id$
REM Bat script building FMILibrary dependency automatically
REM Author: Peter Nordin peter.nordin@liu.se
set basedir=%~dp0
set name=FMILibrary
set zipdir=%name%-2.0.2
set zipfile=tools\%zipdir%-src.zip
set codedir=%basedir%\%name%_code
set builddir=%basedir%\%name%_build
set installdir=%basedir%\%name%
REM Unpack
echo.
echo Clearing old directory (if it exists)
if exist %codedir% rd /s/q %codedir%
echo Unpacking %zipfile%
tools\7z\7za.exe x %zipfile% -y > nul
move %zipdir% %codedir%
set OLDPATH=%PATH%
call setHopsanBuildPaths.bat
REM We don want msys in the path so we have to set it manually
set PATH=%mingw_path%;%cmake_path%;%OLDPATH%
REM build
mkdir %builddir%
cd %builddir%
cmake -Wno-dev -G "MinGW Makefiles" -DFMILIB_FMI_PLATFORM="win64" -DFMILIB_INSTALL_PREFIX=%installdir% %codedir%
mingw32-make.exe -j4
mingw32-make.exe install
cd %basedir%
echo.
echo setupFMILibrary.bat done
pause
| Add zip file unpacking to FMILibrary windows setup script | Add zip file unpacking to FMILibrary windows setup script
| Batchfile | apache-2.0 | Hopsan/hopsan,Hopsan/hopsan,Hopsan/hopsan,Hopsan/hopsan,Hopsan/hopsan,Hopsan/hopsan | batchfile | ## Code Before:
@ECHO OFF
REM $Id$
REM Bat script building FMILibrary dependency automatically
REM Author: Peter Nordin peter.nordin@liu.se
set basedir=%~dp0
set name=FMILibrary
set codedir=%basedir%\%name%_code
set builddir=%basedir%\%name%_build
set installdir=%basedir%\%name%
set OLDPATH=%PATH%
call setHopsanBuildPaths.bat
REM We don want msys in the path so we have to set it manually
set PATH=%mingw_path%;%cmake_path%;%OLDPATH%
REM build
mkdir %builddir%
cd %builddir%
cmake -Wno-dev -G "MinGW Makefiles" -DFMILIB_FMI_PLATFORM="win64" -DFMILIB_INSTALL_PREFIX=%installdir% %codedir%
mingw32-make.exe -j4
mingw32-make.exe install
cd %basedir%
echo.
echo setupFMILibrary.bat done
pause
## Instruction:
Add zip file unpacking to FMILibrary windows setup script
## Code After:
@ECHO OFF
REM $Id$
REM Bat script building FMILibrary dependency automatically
REM Author: Peter Nordin peter.nordin@liu.se
set basedir=%~dp0
set name=FMILibrary
set zipdir=%name%-2.0.2
set zipfile=tools\%zipdir%-src.zip
set codedir=%basedir%\%name%_code
set builddir=%basedir%\%name%_build
set installdir=%basedir%\%name%
REM Unpack
echo.
echo Clearing old directory (if it exists)
if exist %codedir% rd /s/q %codedir%
echo Unpacking %zipfile%
tools\7z\7za.exe x %zipfile% -y > nul
move %zipdir% %codedir%
set OLDPATH=%PATH%
call setHopsanBuildPaths.bat
REM We don want msys in the path so we have to set it manually
set PATH=%mingw_path%;%cmake_path%;%OLDPATH%
REM build
mkdir %builddir%
cd %builddir%
cmake -Wno-dev -G "MinGW Makefiles" -DFMILIB_FMI_PLATFORM="win64" -DFMILIB_INSTALL_PREFIX=%installdir% %codedir%
mingw32-make.exe -j4
mingw32-make.exe install
cd %basedir%
echo.
echo setupFMILibrary.bat done
pause
| @ECHO OFF
REM $Id$
REM Bat script building FMILibrary dependency automatically
REM Author: Peter Nordin peter.nordin@liu.se
set basedir=%~dp0
set name=FMILibrary
+ set zipdir=%name%-2.0.2
+ set zipfile=tools\%zipdir%-src.zip
set codedir=%basedir%\%name%_code
set builddir=%basedir%\%name%_build
set installdir=%basedir%\%name%
+
+
+ REM Unpack
+ echo.
+ echo Clearing old directory (if it exists)
+ if exist %codedir% rd /s/q %codedir%
+ echo Unpacking %zipfile%
+ tools\7z\7za.exe x %zipfile% -y > nul
+ move %zipdir% %codedir%
set OLDPATH=%PATH%
call setHopsanBuildPaths.bat
REM We don want msys in the path so we have to set it manually
set PATH=%mingw_path%;%cmake_path%;%OLDPATH%
REM build
mkdir %builddir%
cd %builddir%
cmake -Wno-dev -G "MinGW Makefiles" -DFMILIB_FMI_PLATFORM="win64" -DFMILIB_INSTALL_PREFIX=%installdir% %codedir%
mingw32-make.exe -j4
mingw32-make.exe install
cd %basedir%
echo.
echo setupFMILibrary.bat done
pause | 11 | 0.37931 | 11 | 0 |
26f507ae6c41e489bec65a167c14e8932459d780 | weaviate.conf.json | weaviate.conf.json | {
"environments": [
{
"name": "development",
"database": {
"name": "dgraph"
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
},
{
"name": "graph",
"database": {
"name": "dgraph",
"database_config" : {
"host": "127.0.0.1",
"port": 9080
}
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org-simple.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org-simple.json"
},
"mqttEnabled": false
}
]
}
| {
"environments": [
{
"name": "development",
"database": {
"name": "dgraph"
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
},
{
"name": "graph",
"database": {
"name": "dgraph",
"database_config" : {
"host": "127.0.0.1",
"port": 9080
}
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
}
]
}
| Set to always load RDF schemas | gh-159: Set to always load RDF schemas
| JSON | bsd-3-clause | weaviate/weaviate,weaviate/weaviate | json | ## Code Before:
{
"environments": [
{
"name": "development",
"database": {
"name": "dgraph"
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
},
{
"name": "graph",
"database": {
"name": "dgraph",
"database_config" : {
"host": "127.0.0.1",
"port": 9080
}
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org-simple.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org-simple.json"
},
"mqttEnabled": false
}
]
}
## Instruction:
gh-159: Set to always load RDF schemas
## Code After:
{
"environments": [
{
"name": "development",
"database": {
"name": "dgraph"
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
},
{
"name": "graph",
"database": {
"name": "dgraph",
"database_config" : {
"host": "127.0.0.1",
"port": 9080
}
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
}
]
}
| {
"environments": [
{
"name": "development",
"database": {
"name": "dgraph"
},
"schemas": {
"Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
"Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
},
{
"name": "graph",
"database": {
"name": "dgraph",
"database_config" : {
"host": "127.0.0.1",
"port": 9080
}
},
"schemas": {
- "Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org-simple.json",
? -------
+ "Thing": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Thing-schema_org.json",
- "Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org-simple.json"
? -------
+ "Action": "https://raw.githubusercontent.com/weaviate/weaviate-semantic-schemas/master/weaviate-schema-Action-schema_org.json"
},
"mqttEnabled": false
}
]
} | 4 | 0.133333 | 2 | 2 |
27320eaa4c67012b62b464b5e04ef7185946af9b | scripts/upgrade/env.sh | scripts/upgrade/env.sh |
function canonicalize() (
cd "${1%/*}"
echo "${PWD}/${1##*/}"
)
if [ -f build.gradle ]; then
[ -z "${FORCE_UPGRADE}" ] && export JENKINS_USER="admin" || export JENKINS_USER="${JENKINS_USER:-admin}"
export JENKINS_PASSWORD="${JENKINS_PASSWORD:-$(<"${JENKINS_HOME}"/secrets/initialAdminPassword)}"
unset JENKINS_CALL_ARGS
jenkins-call-url -a -v -v "${JENKINS_WEB}"/api/json -o /dev/null
export JENKINS_CALL_ARGS="-m POST ${JENKINS_WEB}/scriptText --data-string script= -d"
else
echo "Not in repository root." 1>&2
fi
|
function canonicalize() (
cd "${1%/*}"
echo "${PWD}/${1##*/}"
)
if [ -f build.gradle ]; then
[ -z "${FORCE_UPGRADE}" ] && export JENKINS_USER="admin" || export JENKINS_USER="${JENKINS_USER:-admin}"
export JENKINS_PASSWORD="${JENKINS_PASSWORD:-$(<"${JENKINS_HOME}"/secrets/initialAdminPassword)}"
unset JENKINS_CALL_ARGS
"${SCRIPT_LIBARY_PATH}"/jenkins-call-url -a -v -v "${JENKINS_WEB}"/api/json -o /dev/null
export JENKINS_CALL_ARGS="-m POST ${JENKINS_WEB}/scriptText --data-string script= -d"
else
echo "Not in repository root." 1>&2
fi
| Add script path prefix to jenkins-call-url command | Add script path prefix to jenkins-call-url command
This resolves an issue where the jenkins-call-url command
is not found when the env.sh file is source from other
scripts.
| Shell | apache-2.0 | samrocketman/jenkins-bootstrap-shared,samrocketman/jenkins-bootstrap-shared | shell | ## Code Before:
function canonicalize() (
cd "${1%/*}"
echo "${PWD}/${1##*/}"
)
if [ -f build.gradle ]; then
[ -z "${FORCE_UPGRADE}" ] && export JENKINS_USER="admin" || export JENKINS_USER="${JENKINS_USER:-admin}"
export JENKINS_PASSWORD="${JENKINS_PASSWORD:-$(<"${JENKINS_HOME}"/secrets/initialAdminPassword)}"
unset JENKINS_CALL_ARGS
jenkins-call-url -a -v -v "${JENKINS_WEB}"/api/json -o /dev/null
export JENKINS_CALL_ARGS="-m POST ${JENKINS_WEB}/scriptText --data-string script= -d"
else
echo "Not in repository root." 1>&2
fi
## Instruction:
Add script path prefix to jenkins-call-url command
This resolves an issue where the jenkins-call-url command
is not found when the env.sh file is source from other
scripts.
## Code After:
function canonicalize() (
cd "${1%/*}"
echo "${PWD}/${1##*/}"
)
if [ -f build.gradle ]; then
[ -z "${FORCE_UPGRADE}" ] && export JENKINS_USER="admin" || export JENKINS_USER="${JENKINS_USER:-admin}"
export JENKINS_PASSWORD="${JENKINS_PASSWORD:-$(<"${JENKINS_HOME}"/secrets/initialAdminPassword)}"
unset JENKINS_CALL_ARGS
"${SCRIPT_LIBARY_PATH}"/jenkins-call-url -a -v -v "${JENKINS_WEB}"/api/json -o /dev/null
export JENKINS_CALL_ARGS="-m POST ${JENKINS_WEB}/scriptText --data-string script= -d"
else
echo "Not in repository root." 1>&2
fi
|
function canonicalize() (
cd "${1%/*}"
echo "${PWD}/${1##*/}"
)
if [ -f build.gradle ]; then
[ -z "${FORCE_UPGRADE}" ] && export JENKINS_USER="admin" || export JENKINS_USER="${JENKINS_USER:-admin}"
export JENKINS_PASSWORD="${JENKINS_PASSWORD:-$(<"${JENKINS_HOME}"/secrets/initialAdminPassword)}"
unset JENKINS_CALL_ARGS
- jenkins-call-url -a -v -v "${JENKINS_WEB}"/api/json -o /dev/null
+ "${SCRIPT_LIBARY_PATH}"/jenkins-call-url -a -v -v "${JENKINS_WEB}"/api/json -o /dev/null
? ++++++++++++++++++++++++
export JENKINS_CALL_ARGS="-m POST ${JENKINS_WEB}/scriptText --data-string script= -d"
else
echo "Not in repository root." 1>&2
fi | 2 | 0.133333 | 1 | 1 |
21e0205ebf599f00000af9167a9152ad34d5c2fa | guests/templates/emails/guest_checklist_reminder.html | guests/templates/emails/guest_checklist_reminder.html | Hello {{ guest.group.name }}!
<br/><br/>It's here! And we're SUPER excited to share it with you! Our brand new Guest Checklist is taking the place of
our old form, and will walk you through all the info we need to gather about you and your group, panels, events, and
plans.
<br/><br/>You can get to your checklist from this link:
<a href="{{ c.URL_BASE }}/guests/index?id={{ guest.id }}" target="_blank">{{ c.URL_BASE }}/guests/index?id={{ guest.id }}</a>
<br/><br/>Please remember that <strong>the deadline to complete the checklist is October 15, 2017</strong>.
<br/><br/>If you have any questions or run into any snags, hit us up at guests@magfest.org.
<br/><br/>Can't wait to see you in January!
<br/>-The Guests/Events Crew
| Hello {{ guest.group.leader.first_name }} and {{ guest.group.name }}!
<br/><br/>It's here! And we're SUPER excited to share it with you! Our brand new Guest Checklist is taking the place of
our old form, and will walk you through all the info we need to gather about you and your group, panels, events, and
plans.
<br/><br/>You can get to your checklist from this link:
<a href="{{ c.URL_BASE }}/guests/index?id={{ guest.id }}" target="_blank">{{ c.URL_BASE }}/guests/index?id={{ guest.id }}</a>
<br/><br/>Please remember that <strong>the deadline to complete the checklist is {{ c.GUEST_INFO_DEADLINE|datetime_local }}</strong>.
<br/><br/>If you have any questions or run into any snags, hit us up at guests@magfest.org.
<br/><br/>Can't wait to see you in January!
<br/>-The Guests/Events Crew
| Edit Guest checklist email Updates the text of the email, per the guest department | Edit Guest checklist email
Updates the text of the email, per the guest department
| HTML | agpl-3.0 | magfest/bands,magfest/bands | html | ## Code Before:
Hello {{ guest.group.name }}!
<br/><br/>It's here! And we're SUPER excited to share it with you! Our brand new Guest Checklist is taking the place of
our old form, and will walk you through all the info we need to gather about you and your group, panels, events, and
plans.
<br/><br/>You can get to your checklist from this link:
<a href="{{ c.URL_BASE }}/guests/index?id={{ guest.id }}" target="_blank">{{ c.URL_BASE }}/guests/index?id={{ guest.id }}</a>
<br/><br/>Please remember that <strong>the deadline to complete the checklist is October 15, 2017</strong>.
<br/><br/>If you have any questions or run into any snags, hit us up at guests@magfest.org.
<br/><br/>Can't wait to see you in January!
<br/>-The Guests/Events Crew
## Instruction:
Edit Guest checklist email
Updates the text of the email, per the guest department
## Code After:
Hello {{ guest.group.leader.first_name }} and {{ guest.group.name }}!
<br/><br/>It's here! And we're SUPER excited to share it with you! Our brand new Guest Checklist is taking the place of
our old form, and will walk you through all the info we need to gather about you and your group, panels, events, and
plans.
<br/><br/>You can get to your checklist from this link:
<a href="{{ c.URL_BASE }}/guests/index?id={{ guest.id }}" target="_blank">{{ c.URL_BASE }}/guests/index?id={{ guest.id }}</a>
<br/><br/>Please remember that <strong>the deadline to complete the checklist is {{ c.GUEST_INFO_DEADLINE|datetime_local }}</strong>.
<br/><br/>If you have any questions or run into any snags, hit us up at guests@magfest.org.
<br/><br/>Can't wait to see you in January!
<br/>-The Guests/Events Crew
| - Hello {{ guest.group.name }}!
+ Hello {{ guest.group.leader.first_name }} and {{ guest.group.name }}!
<br/><br/>It's here! And we're SUPER excited to share it with you! Our brand new Guest Checklist is taking the place of
our old form, and will walk you through all the info we need to gather about you and your group, panels, events, and
plans.
<br/><br/>You can get to your checklist from this link:
<a href="{{ c.URL_BASE }}/guests/index?id={{ guest.id }}" target="_blank">{{ c.URL_BASE }}/guests/index?id={{ guest.id }}</a>
- <br/><br/>Please remember that <strong>the deadline to complete the checklist is October 15, 2017</strong>.
? ^^^^^ ^^^^^^^^
+ <br/><br/>Please remember that <strong>the deadline to complete the checklist is {{ c.GUEST_INFO_DEADLINE|datetime_local }}</strong>.
? ++++++++++++++ +++++++++++++++++++++ ^^ ^^
<br/><br/>If you have any questions or run into any snags, hit us up at guests@magfest.org.
<br/><br/>Can't wait to see you in January!
<br/>-The Guests/Events Crew | 4 | 0.266667 | 2 | 2 |
171b08661543212599a0483097b8c21420abdd5d | src/api/github.js | src/api/github.js | import l from 'chalk-log'
import axe from './axe'
export default {
getUserRepos ({ username, token, page }) {
const params = (token) ? { auth: { username, password: token } } : {}
if (token) {
let url = `/user/repos`
url += '?per_page=100'
url += '&sort=updated'
url += '&affiliation=owner'
return axe.get(url, params)
.then(res => res.data)
.catch(err => l.error(err))
} else {
let url = `/users/${username}/repos`
url += '?per_page=100'
url += '&sort=updated'
return axe.get(url)
.then(res => res.data)
.catch(err => l.error(err))
}
},
getStarredRepos ({ username, page }) {
let url = `/users/${username}/starred`
url += '?per_page=100'
url += `&page=${page}`
return axe.get(url)
.then(res => res.data)
.catch(err => l.error(err))
}
}
| import l from 'chalk-log'
import axe from './axe'
export default {
getUserRepos ({ username, token, page }) {
let params = {}
let url = ''
if (token) {
url = `/user/repos`
url += '?per_page=100'
url += `&page=${page}`
url += '&sort=updated'
url += '&affiliation=owner'
params = { auth: { username, password: token } }
} else {
url = `/users/${username}/repos`
url += '?per_page=100'
url += `&page=${page}`
url += '&sort=updated'
}
return axe.get(url, params)
.then(res => {
return res.data
})
.catch(err => l.error(err))
},
getStarredRepos ({ username, page }) {
let url = `/users/${username}/starred`
url += '?per_page=100'
url += `&page=${page}`
return axe.get(url)
.then(res => res.data)
.catch(err => l.error(err))
}
}
| Refactor & add `page` query parameter | Refactor & add `page` query parameter
| JavaScript | mit | frenchbread/repos2md | javascript | ## Code Before:
import l from 'chalk-log'
import axe from './axe'
export default {
getUserRepos ({ username, token, page }) {
const params = (token) ? { auth: { username, password: token } } : {}
if (token) {
let url = `/user/repos`
url += '?per_page=100'
url += '&sort=updated'
url += '&affiliation=owner'
return axe.get(url, params)
.then(res => res.data)
.catch(err => l.error(err))
} else {
let url = `/users/${username}/repos`
url += '?per_page=100'
url += '&sort=updated'
return axe.get(url)
.then(res => res.data)
.catch(err => l.error(err))
}
},
getStarredRepos ({ username, page }) {
let url = `/users/${username}/starred`
url += '?per_page=100'
url += `&page=${page}`
return axe.get(url)
.then(res => res.data)
.catch(err => l.error(err))
}
}
## Instruction:
Refactor & add `page` query parameter
## Code After:
import l from 'chalk-log'
import axe from './axe'
export default {
getUserRepos ({ username, token, page }) {
let params = {}
let url = ''
if (token) {
url = `/user/repos`
url += '?per_page=100'
url += `&page=${page}`
url += '&sort=updated'
url += '&affiliation=owner'
params = { auth: { username, password: token } }
} else {
url = `/users/${username}/repos`
url += '?per_page=100'
url += `&page=${page}`
url += '&sort=updated'
}
return axe.get(url, params)
.then(res => {
return res.data
})
.catch(err => l.error(err))
},
getStarredRepos ({ username, page }) {
let url = `/users/${username}/starred`
url += '?per_page=100'
url += `&page=${page}`
return axe.get(url)
.then(res => res.data)
.catch(err => l.error(err))
}
}
| import l from 'chalk-log'
import axe from './axe'
export default {
getUserRepos ({ username, token, page }) {
- const params = (token) ? { auth: { username, password: token } } : {}
+ let params = {}
+ let url = ''
if (token) {
- let url = `/user/repos`
? ----
+ url = `/user/repos`
url += '?per_page=100'
+ url += `&page=${page}`
url += '&sort=updated'
url += '&affiliation=owner'
+
+ params = { auth: { username, password: token } }
- return axe.get(url, params)
- .then(res => res.data)
- .catch(err => l.error(err))
} else {
- let url = `/users/${username}/repos`
? ----
+ url = `/users/${username}/repos`
url += '?per_page=100'
+ url += `&page=${page}`
url += '&sort=updated'
- return axe.get(url)
- .then(res => res.data)
- .catch(err => l.error(err))
}
+
+ return axe.get(url, params)
+ .then(res => {
+ return res.data
+ })
+ .catch(err => l.error(err))
},
getStarredRepos ({ username, page }) {
let url = `/users/${username}/starred`
url += '?per_page=100'
url += `&page=${page}`
return axe.get(url)
.then(res => res.data)
.catch(err => l.error(err))
}
} | 23 | 0.676471 | 14 | 9 |
69755e54ad5c7b8813f01b738d6318da77a79e05 | README.md | README.md | IMDb
====
An IMDb interface for Node
```typescript
import { IMDb, Movie } from '../src'
async function example(): Promise<Movie> {
let i = new IMDb()
let movie = await i.getMovie('tt3501632') // Thor: Ragnarok
return movie
}
example()
.then((movie) => console.log(movie.getTitle()))
.catch((e) => console.error(e))
```
| IMDb [](https://circleci.com/gh/mhsjlw/imdb)
====
An IMDb interface for Node
```typescript
import { IMDb, Movie } from '../src'
async function example(): Promise<Movie> {
let i = new IMDb()
let movie = await i.getMovie('tt3501632') // Thor: Ragnarok
return movie
}
example()
.then((movie) => console.log(movie.getTitle()))
.catch((e) => console.error(e))
```
| Add status badge [no ci] | Add status badge [no ci]
| Markdown | mit | mhsjlw/imdb | markdown | ## Code Before:
IMDb
====
An IMDb interface for Node
```typescript
import { IMDb, Movie } from '../src'
async function example(): Promise<Movie> {
let i = new IMDb()
let movie = await i.getMovie('tt3501632') // Thor: Ragnarok
return movie
}
example()
.then((movie) => console.log(movie.getTitle()))
.catch((e) => console.error(e))
```
## Instruction:
Add status badge [no ci]
## Code After:
IMDb [](https://circleci.com/gh/mhsjlw/imdb)
====
An IMDb interface for Node
```typescript
import { IMDb, Movie } from '../src'
async function example(): Promise<Movie> {
let i = new IMDb()
let movie = await i.getMovie('tt3501632') // Thor: Ragnarok
return movie
}
example()
.then((movie) => console.log(movie.getTitle()))
.catch((e) => console.error(e))
```
| - IMDb
+ IMDb [](https://circleci.com/gh/mhsjlw/imdb)
====
An IMDb interface for Node
```typescript
import { IMDb, Movie } from '../src'
async function example(): Promise<Movie> {
let i = new IMDb()
let movie = await i.getMovie('tt3501632') // Thor: Ragnarok
return movie
}
example()
.then((movie) => console.log(movie.getTitle()))
.catch((e) => console.error(e))
``` | 2 | 0.111111 | 1 | 1 |
762147b8660a507ac5db8d0408162e8463b2fe8e | daiquiri/registry/serializers.py | daiquiri/registry/serializers.py | from rest_framework import serializers
from daiquiri.core.serializers import JSONListField, JSONDictField
class DublincoreSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
description = serializers.SerializerMethodField()
publisher = serializers.SerializerMethodField()
subjects = serializers.ReadOnlyField()
def get_description(self, obj):
return obj['content']['description']
def get_publisher(self, obj):
return obj['curation']['publisher']
class VoresourceSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
created = serializers.ReadOnlyField()
updated = serializers.ReadOnlyField()
voresource_status = serializers.ReadOnlyField(default='active')
curation = JSONDictField(default={})
content = JSONDictField(default={})
capabilities = JSONListField(default=[])
tableset = JSONListField(default=[])
managed_authority = serializers.ReadOnlyField(default=None)
managing_org = serializers.ReadOnlyField(default=None)
type = serializers.ReadOnlyField()
| from rest_framework import serializers
from daiquiri.core.serializers import JSONDictField, JSONListField
class DublincoreSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
description = serializers.SerializerMethodField()
publisher = serializers.SerializerMethodField()
subjects = serializers.ReadOnlyField()
def get_description(self, obj):
return obj['content']['description']
def get_publisher(self, obj):
return obj['curation']['publisher']
class VoresourceSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
created = serializers.ReadOnlyField()
updated = serializers.ReadOnlyField()
type = serializers.ReadOnlyField()
status = serializers.ReadOnlyField()
curation = JSONDictField(default={})
content = JSONDictField(default={})
capabilities = JSONListField(default=[])
tableset = JSONListField(default=[])
managed_authority = serializers.ReadOnlyField(default=None)
managing_org = serializers.ReadOnlyField(default=None)
| Fix status field in OAI-PMH | Fix status field in OAI-PMH
| Python | apache-2.0 | aipescience/django-daiquiri,aipescience/django-daiquiri,aipescience/django-daiquiri | python | ## Code Before:
from rest_framework import serializers
from daiquiri.core.serializers import JSONListField, JSONDictField
class DublincoreSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
description = serializers.SerializerMethodField()
publisher = serializers.SerializerMethodField()
subjects = serializers.ReadOnlyField()
def get_description(self, obj):
return obj['content']['description']
def get_publisher(self, obj):
return obj['curation']['publisher']
class VoresourceSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
created = serializers.ReadOnlyField()
updated = serializers.ReadOnlyField()
voresource_status = serializers.ReadOnlyField(default='active')
curation = JSONDictField(default={})
content = JSONDictField(default={})
capabilities = JSONListField(default=[])
tableset = JSONListField(default=[])
managed_authority = serializers.ReadOnlyField(default=None)
managing_org = serializers.ReadOnlyField(default=None)
type = serializers.ReadOnlyField()
## Instruction:
Fix status field in OAI-PMH
## Code After:
from rest_framework import serializers
from daiquiri.core.serializers import JSONDictField, JSONListField
class DublincoreSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
description = serializers.SerializerMethodField()
publisher = serializers.SerializerMethodField()
subjects = serializers.ReadOnlyField()
def get_description(self, obj):
return obj['content']['description']
def get_publisher(self, obj):
return obj['curation']['publisher']
class VoresourceSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
created = serializers.ReadOnlyField()
updated = serializers.ReadOnlyField()
type = serializers.ReadOnlyField()
status = serializers.ReadOnlyField()
curation = JSONDictField(default={})
content = JSONDictField(default={})
capabilities = JSONListField(default=[])
tableset = JSONListField(default=[])
managed_authority = serializers.ReadOnlyField(default=None)
managing_org = serializers.ReadOnlyField(default=None)
| from rest_framework import serializers
- from daiquiri.core.serializers import JSONListField, JSONDictField
? ^ ^ ^ ^
+ from daiquiri.core.serializers import JSONDictField, JSONListField
? ^ ^ ^ ^
class DublincoreSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
description = serializers.SerializerMethodField()
publisher = serializers.SerializerMethodField()
subjects = serializers.ReadOnlyField()
def get_description(self, obj):
return obj['content']['description']
def get_publisher(self, obj):
return obj['curation']['publisher']
class VoresourceSerializer(serializers.Serializer):
identifier = serializers.ReadOnlyField()
title = serializers.ReadOnlyField()
created = serializers.ReadOnlyField()
updated = serializers.ReadOnlyField()
- voresource_status = serializers.ReadOnlyField(default='active')
+ type = serializers.ReadOnlyField()
+ status = serializers.ReadOnlyField()
curation = JSONDictField(default={})
content = JSONDictField(default={})
capabilities = JSONListField(default=[])
tableset = JSONListField(default=[])
managed_authority = serializers.ReadOnlyField(default=None)
managing_org = serializers.ReadOnlyField(default=None)
- type = serializers.ReadOnlyField() | 6 | 0.166667 | 3 | 3 |
010ffbec057e80f90c35def60ed5eec1f57fd4d4 | package.json | package.json | {
"name": "mockups-creator",
"description": "A NodeJS App that creates static HTML mockups using Grunt",
"version": "0.0.1",
"dependencies": {
"grunt": "*",
"grunt-autoprefixer": "*",
"grunt-closurecompiler": "*",
"grunt-contrib-clean": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-copy": "*",
"grunt-contrib-sass": "*",
"grunt-contrib-watch": "*",
"grunt-fontgen": "*",
"grunt-rsync": "*",
"grunt-sass": "*",
"grunt-tasty-swig": "*",
"grunt-yui-compressor": "*",
"node.extend": "*"
},
"engines": {
"node": ">=0.8.0"
}
}
| {
"name": "mockups-creator",
"description": "A NodeJS App that creates static HTML mockups using Grunt",
"repository": {
"type": "git",
"url": "https://github.com/julianxhokaxhiu/mockups-creator.git"
},
"version": "0.0.1",
"dependencies": {
"grunt": "*",
"grunt-autoprefixer": "*",
"grunt-closurecompiler": "*",
"grunt-contrib-clean": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-copy": "*",
"grunt-contrib-sass": "*",
"grunt-contrib-watch": "*",
"grunt-fontgen": "*",
"grunt-rsync": "*",
"grunt-sass": "*",
"grunt-tasty-swig": "*",
"grunt-yui-compressor": "*",
"node.extend": "*"
},
"engines": {
"node": ">=0.8.0"
}
}
| Add the missing repository field. | Add the missing repository field.
| JSON | mit | julianxhokaxhiu/mockups-creator,julianxhokaxhiu/mockups-creator | json | ## Code Before:
{
"name": "mockups-creator",
"description": "A NodeJS App that creates static HTML mockups using Grunt",
"version": "0.0.1",
"dependencies": {
"grunt": "*",
"grunt-autoprefixer": "*",
"grunt-closurecompiler": "*",
"grunt-contrib-clean": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-copy": "*",
"grunt-contrib-sass": "*",
"grunt-contrib-watch": "*",
"grunt-fontgen": "*",
"grunt-rsync": "*",
"grunt-sass": "*",
"grunt-tasty-swig": "*",
"grunt-yui-compressor": "*",
"node.extend": "*"
},
"engines": {
"node": ">=0.8.0"
}
}
## Instruction:
Add the missing repository field.
## Code After:
{
"name": "mockups-creator",
"description": "A NodeJS App that creates static HTML mockups using Grunt",
"repository": {
"type": "git",
"url": "https://github.com/julianxhokaxhiu/mockups-creator.git"
},
"version": "0.0.1",
"dependencies": {
"grunt": "*",
"grunt-autoprefixer": "*",
"grunt-closurecompiler": "*",
"grunt-contrib-clean": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-copy": "*",
"grunt-contrib-sass": "*",
"grunt-contrib-watch": "*",
"grunt-fontgen": "*",
"grunt-rsync": "*",
"grunt-sass": "*",
"grunt-tasty-swig": "*",
"grunt-yui-compressor": "*",
"node.extend": "*"
},
"engines": {
"node": ">=0.8.0"
}
}
| {
"name": "mockups-creator",
"description": "A NodeJS App that creates static HTML mockups using Grunt",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/julianxhokaxhiu/mockups-creator.git"
+ },
"version": "0.0.1",
"dependencies": {
"grunt": "*",
"grunt-autoprefixer": "*",
"grunt-closurecompiler": "*",
"grunt-contrib-clean": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-copy": "*",
"grunt-contrib-sass": "*",
"grunt-contrib-watch": "*",
"grunt-fontgen": "*",
"grunt-rsync": "*",
"grunt-sass": "*",
"grunt-tasty-swig": "*",
"grunt-yui-compressor": "*",
"node.extend": "*"
},
"engines": {
"node": ">=0.8.0"
}
} | 4 | 0.166667 | 4 | 0 |
2b20268fb8f7f1721b184df7376ec456710fc23b | pages/transcode.md | pages/transcode.md | title: Trans*Code
callout_big_1: A hack day for the trans* and non-binary community
callout_small: Monday 30th October.
---
[Trans*Code](http://trans-code.org/) returns to PyCon UK for a day-long
hackathon to address issues facing the trans\* and nonbinary community. The
day is open to all trans\* and nonbinary people and allies, and we welcome
participants from all skill levels and backgrounds.
The day will begin with participants suggesting apps and projects that are of
particular interest to the trans\* and nonbinary community. We'll then
self-organize into teams, and spend the day working on our projects.
***
Entrance to the Trans\*Code hack day is included in the [conference
ticket](/tickets/).
However, if you are just coming to Cardiff for the hack day on Monday,
[tickets](https://www.eventbrite.com/e/transcode-pycon-uk-2017-tickets-38377166137?aff=utm_source%3Deb_email%26utm_medium%3Demail%26utm_campaign%3Dnew_event_email&utm_term=eventurl_text)
are free.
We are also able to give away a number of tickets to the whole conference to
Trans\*Code attendees. Please, see instructions on the EventBrite event
| title: Trans*Code
---
[Trans*Code](http://trans-code.org/) returns to PyCon UK for a day-long
hackathon to address issues facing the trans\* and nonbinary community. The
day is open to all trans\* and nonbinary people and allies, and we welcome
participants from all skill levels and backgrounds.
The day will begin with participants suggesting apps and projects that are of
particular interest to the trans\* and nonbinary community. We'll then
self-organize into teams, and spend the day working on our projects.
***
Entrance to the Trans\*Code hack day is included in the [conference
ticket](/tickets/).
However, if you are just coming to Cardiff for the hack day on Monday,
[tickets](https://www.eventbrite.com/e/transcode-pycon-uk-2017-tickets-38377166137?aff=utm_source%3Deb_email%26utm_medium%3Demail%26utm_campaign%3Dnew_event_email&utm_term=eventurl_text)
are free.
We are also able to give away a number of tickets to the whole conference to
Trans\*Code attendees. Please, see instructions on the EventBrite event
| Remove callouts which don't seem to be used this year | Remove callouts which don't seem to be used this year | Markdown | mit | nanuxbe/2017.pyconuk.org,PyconUK/2017.pyconuk.org,nanuxbe/2017.pyconuk.org,PyconUK/2017.pyconuk.org,nanuxbe/2017.pyconuk.org,PyconUK/2017.pyconuk.org | markdown | ## Code Before:
title: Trans*Code
callout_big_1: A hack day for the trans* and non-binary community
callout_small: Monday 30th October.
---
[Trans*Code](http://trans-code.org/) returns to PyCon UK for a day-long
hackathon to address issues facing the trans\* and nonbinary community. The
day is open to all trans\* and nonbinary people and allies, and we welcome
participants from all skill levels and backgrounds.
The day will begin with participants suggesting apps and projects that are of
particular interest to the trans\* and nonbinary community. We'll then
self-organize into teams, and spend the day working on our projects.
***
Entrance to the Trans\*Code hack day is included in the [conference
ticket](/tickets/).
However, if you are just coming to Cardiff for the hack day on Monday,
[tickets](https://www.eventbrite.com/e/transcode-pycon-uk-2017-tickets-38377166137?aff=utm_source%3Deb_email%26utm_medium%3Demail%26utm_campaign%3Dnew_event_email&utm_term=eventurl_text)
are free.
We are also able to give away a number of tickets to the whole conference to
Trans\*Code attendees. Please, see instructions on the EventBrite event
## Instruction:
Remove callouts which don't seem to be used this year
## Code After:
title: Trans*Code
---
[Trans*Code](http://trans-code.org/) returns to PyCon UK for a day-long
hackathon to address issues facing the trans\* and nonbinary community. The
day is open to all trans\* and nonbinary people and allies, and we welcome
participants from all skill levels and backgrounds.
The day will begin with participants suggesting apps and projects that are of
particular interest to the trans\* and nonbinary community. We'll then
self-organize into teams, and spend the day working on our projects.
***
Entrance to the Trans\*Code hack day is included in the [conference
ticket](/tickets/).
However, if you are just coming to Cardiff for the hack day on Monday,
[tickets](https://www.eventbrite.com/e/transcode-pycon-uk-2017-tickets-38377166137?aff=utm_source%3Deb_email%26utm_medium%3Demail%26utm_campaign%3Dnew_event_email&utm_term=eventurl_text)
are free.
We are also able to give away a number of tickets to the whole conference to
Trans\*Code attendees. Please, see instructions on the EventBrite event
| title: Trans*Code
- callout_big_1: A hack day for the trans* and non-binary community
- callout_small: Monday 30th October.
---
[Trans*Code](http://trans-code.org/) returns to PyCon UK for a day-long
hackathon to address issues facing the trans\* and nonbinary community. The
day is open to all trans\* and nonbinary people and allies, and we welcome
participants from all skill levels and backgrounds.
The day will begin with participants suggesting apps and projects that are of
particular interest to the trans\* and nonbinary community. We'll then
self-organize into teams, and spend the day working on our projects.
***
Entrance to the Trans\*Code hack day is included in the [conference
ticket](/tickets/).
However, if you are just coming to Cardiff for the hack day on Monday,
[tickets](https://www.eventbrite.com/e/transcode-pycon-uk-2017-tickets-38377166137?aff=utm_source%3Deb_email%26utm_medium%3Demail%26utm_campaign%3Dnew_event_email&utm_term=eventurl_text)
are free.
We are also able to give away a number of tickets to the whole conference to
Trans\*Code attendees. Please, see instructions on the EventBrite event | 2 | 0.08 | 0 | 2 |
b5e887b938263fc4094fe46043d4fd9a4e83a49e | src/main/java/edu/hm/hafner/shareit/util/AssertionFailedException.java | src/main/java/edu/hm/hafner/shareit/util/AssertionFailedException.java | package edu.hm.hafner.shareit.util;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
/**
* Thrown to indicate that a contract assertion check has been failed.
*
* @author Ulli Hafner
*/
public final class AssertionFailedException extends RuntimeException {
private static final long serialVersionUID = -7033759120346380864L;
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message.
*
* @param message
* the detail error message.
*/
AssertionFailedException(@CheckForNull final String message) {
super(message);
log(this);
}
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message and cause.
*
* @param message
* the detail error message.
* @param cause the cause (which is saved for later retrieval by the
* {@link Throwable#getCause()} method). (A <tt>null</tt> value
* is permitted, and indicates that the cause is nonexistent or
* unknown.)
*/
AssertionFailedException(@CheckForNull final String message, @CheckForNull final Throwable cause) {
super(message, cause);
log(cause);
}
private static void log(final Throwable exception) {
LOGGER.log(Level.WARNING, "Assertion failed.", exception);
}
private static final Logger LOGGER = Logger.getLogger(AssertionFailedException.class.getName());
}
| package edu.hm.hafner.shareit.util;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
/**
* Thrown to indicate that a contract assertion check has been failed.
*
* @author Ulli Hafner
*/
public final class AssertionFailedException extends IllegalArgumentException {
private static final long serialVersionUID = -7033759120346380864L;
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message.
*
* @param message
* the detail error message.
*/
AssertionFailedException(@CheckForNull final String message) {
super(message);
log(this);
}
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message and cause.
*
* @param message
* the detail error message.
* @param cause the cause (which is saved for later retrieval by the
* {@link Throwable#getCause()} method). (A <tt>null</tt> value
* is permitted, and indicates that the cause is nonexistent or
* unknown.)
*/
AssertionFailedException(@CheckForNull final String message, @CheckForNull final Throwable cause) {
super(message, cause);
log(cause);
}
private static void log(final Throwable exception) {
LOGGER.log(Level.WARNING, "Assertion failed.", exception);
}
private static final Logger LOGGER = Logger.getLogger(AssertionFailedException.class.getName());
}
| Make AFE sub type of IAE. | Make AFE sub type of IAE. | Java | mit | uhafner/shareit | java | ## Code Before:
package edu.hm.hafner.shareit.util;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
/**
* Thrown to indicate that a contract assertion check has been failed.
*
* @author Ulli Hafner
*/
public final class AssertionFailedException extends RuntimeException {
private static final long serialVersionUID = -7033759120346380864L;
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message.
*
* @param message
* the detail error message.
*/
AssertionFailedException(@CheckForNull final String message) {
super(message);
log(this);
}
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message and cause.
*
* @param message
* the detail error message.
* @param cause the cause (which is saved for later retrieval by the
* {@link Throwable#getCause()} method). (A <tt>null</tt> value
* is permitted, and indicates that the cause is nonexistent or
* unknown.)
*/
AssertionFailedException(@CheckForNull final String message, @CheckForNull final Throwable cause) {
super(message, cause);
log(cause);
}
private static void log(final Throwable exception) {
LOGGER.log(Level.WARNING, "Assertion failed.", exception);
}
private static final Logger LOGGER = Logger.getLogger(AssertionFailedException.class.getName());
}
## Instruction:
Make AFE sub type of IAE.
## Code After:
package edu.hm.hafner.shareit.util;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
/**
* Thrown to indicate that a contract assertion check has been failed.
*
* @author Ulli Hafner
*/
public final class AssertionFailedException extends IllegalArgumentException {
private static final long serialVersionUID = -7033759120346380864L;
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message.
*
* @param message
* the detail error message.
*/
AssertionFailedException(@CheckForNull final String message) {
super(message);
log(this);
}
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message and cause.
*
* @param message
* the detail error message.
* @param cause the cause (which is saved for later retrieval by the
* {@link Throwable#getCause()} method). (A <tt>null</tt> value
* is permitted, and indicates that the cause is nonexistent or
* unknown.)
*/
AssertionFailedException(@CheckForNull final String message, @CheckForNull final Throwable cause) {
super(message, cause);
log(cause);
}
private static void log(final Throwable exception) {
LOGGER.log(Level.WARNING, "Assertion failed.", exception);
}
private static final Logger LOGGER = Logger.getLogger(AssertionFailedException.class.getName());
}
| package edu.hm.hafner.shareit.util;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
/**
* Thrown to indicate that a contract assertion check has been failed.
*
* @author Ulli Hafner
*/
- public final class AssertionFailedException extends RuntimeException {
? ^ ---
+ public final class AssertionFailedException extends IllegalArgumentException {
? ^^^^^^^^^^ ++
private static final long serialVersionUID = -7033759120346380864L;
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message.
*
* @param message
* the detail error message.
*/
AssertionFailedException(@CheckForNull final String message) {
super(message);
log(this);
}
/**
* Constructs an {@link AssertionFailedException} with the specified
* detail message and cause.
*
* @param message
* the detail error message.
* @param cause the cause (which is saved for later retrieval by the
* {@link Throwable#getCause()} method). (A <tt>null</tt> value
* is permitted, and indicates that the cause is nonexistent or
* unknown.)
*/
AssertionFailedException(@CheckForNull final String message, @CheckForNull final Throwable cause) {
super(message, cause);
log(cause);
}
private static void log(final Throwable exception) {
LOGGER.log(Level.WARNING, "Assertion failed.", exception);
}
private static final Logger LOGGER = Logger.getLogger(AssertionFailedException.class.getName());
} | 2 | 0.039216 | 1 | 1 |
7d0e29e99acd4f41a704d3f7d0c2a59cb6ef1c33 | src/_langs/en/fundamentals/discovery-and-distribution/avoid-mixed-content/index.markdown | src/_langs/en/fundamentals/discovery-and-distribution/avoid-mixed-content/index.markdown | ---
layout: section
title: "Preventing mixed content"
description: "Learn about mixed content, and why you should care about HTTP resources served over secure connections."
id: mixed-content
collection: discovery-and-distribution
authors:
- petelepage
- johyphenel
article:
written_on: 2015-09-25
updated_on: 2015-09-25
order: 1
priority: 0
published: false
---
{% comment %}
Guide list content will be output by the landing layout based on the article collection matching page.id
{% endcomment %}
| ---
layout: section
title: "Preventing mixed content"
description: "Learn about mixed content, and why you should care about HTTP resources served over secure connections."
introduction: "HTTPS is important to protect both your site and your users from attack. Mixed content degrades the security and user experience of your HTTPS site. Learn about mixed content, and why you should care about HTTP resources served over secure connections."
id: mixed-content
collection: discovery-and-distribution
authors:
- petelepage
- johyphenel
article:
written_on: 2015-09-25
updated_on: 2015-09-25
order: 1
priority: 0
published: false
---
{% comment %}
Guide list content will be output by the landing layout based on the article collection matching page.id
{% endcomment %}
| Add introduction to preventing mixed content | Add introduction to preventing mixed content
| Markdown | apache-2.0 | johyphenel/WebFundamentals,raulsenaferreira/WebFundamentals,johyphenel/WebFundamentals,jakearchibald/WebFundamentals,jakearchibald/WebFundamentals,iacdingping/WebFundamentals,johyphenel/WebFundamentals,raulsenaferreira/WebFundamentals,thinkerchan/WebFundamentals,thinkerchan/WebFundamentals,johyphenel/WebFundamentals,iacdingping/WebFundamentals,iacdingping/WebFundamentals,johyphenel/WebFundamentals,iacdingping/WebFundamentals,jakearchibald/WebFundamentals,iacdingping/WebFundamentals,thinkerchan/WebFundamentals,jakearchibald/WebFundamentals,raulsenaferreira/WebFundamentals,raulsenaferreira/WebFundamentals,thinkerchan/WebFundamentals,raulsenaferreira/WebFundamentals,thinkerchan/WebFundamentals,johyphenel/WebFundamentals,jakearchibald/WebFundamentals,jakearchibald/WebFundamentals,iacdingping/WebFundamentals,thinkerchan/WebFundamentals,raulsenaferreira/WebFundamentals | markdown | ## Code Before:
---
layout: section
title: "Preventing mixed content"
description: "Learn about mixed content, and why you should care about HTTP resources served over secure connections."
id: mixed-content
collection: discovery-and-distribution
authors:
- petelepage
- johyphenel
article:
written_on: 2015-09-25
updated_on: 2015-09-25
order: 1
priority: 0
published: false
---
{% comment %}
Guide list content will be output by the landing layout based on the article collection matching page.id
{% endcomment %}
## Instruction:
Add introduction to preventing mixed content
## Code After:
---
layout: section
title: "Preventing mixed content"
description: "Learn about mixed content, and why you should care about HTTP resources served over secure connections."
introduction: "HTTPS is important to protect both your site and your users from attack. Mixed content degrades the security and user experience of your HTTPS site. Learn about mixed content, and why you should care about HTTP resources served over secure connections."
id: mixed-content
collection: discovery-and-distribution
authors:
- petelepage
- johyphenel
article:
written_on: 2015-09-25
updated_on: 2015-09-25
order: 1
priority: 0
published: false
---
{% comment %}
Guide list content will be output by the landing layout based on the article collection matching page.id
{% endcomment %}
| ---
layout: section
title: "Preventing mixed content"
description: "Learn about mixed content, and why you should care about HTTP resources served over secure connections."
+ introduction: "HTTPS is important to protect both your site and your users from attack. Mixed content degrades the security and user experience of your HTTPS site. Learn about mixed content, and why you should care about HTTP resources served over secure connections."
id: mixed-content
collection: discovery-and-distribution
authors:
- petelepage
- johyphenel
article:
written_on: 2015-09-25
updated_on: 2015-09-25
order: 1
priority: 0
published: false
---
{% comment %}
Guide list content will be output by the landing layout based on the article collection matching page.id
{% endcomment %} | 1 | 0.05 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.