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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53bc2900e2eb4f0a3662a7d6c0f0626f2e8fa794 | syntax/template-string.js | syntax/template-string.js |
var str1 = `abcde`;
var str2 = `abcde${str1}abcde`;
var str3 = `abcde${(function () { return 'abc'; }())}abcde`;
var str4 = `abcde${({prop1: 1, prop2: 'p'})['prop1']}abcde`;
var str5 = `abcde${({prop1: 1, prop2: `edcba${1}ebcda`})['prop1']}abcde`;
var str6 = `abcde${({
prop1: 1,
prop2: `edcba${1}ebcda`
})['prop1']}abcde`;
var str7 = `abcde${(function () {
return `edcba${str1 + `zz${1}zz`}edcba`;
}())}abcde`;
var str8 = tag1`abcd ${a}`
var str9 = `s${`<tag attr=${exp}>${exp}</tag>`}`
|
var str1 = `abcde`;
var str2 = `abcde${str1}abcde`;
var str3 = `abcde${(function () { return 'abc'; }())}abcde`;
var str4 = `abcde${({prop1: 1, prop2: 'p'})['prop1']}abcde`;
var str5 = `abcde${({prop1: 1, prop2: `edcba${1}ebcda`})['prop1']}abcde`;
var str6 = `abcde${({
prop1: 1,
prop2: `edcba${1}ebcda`
})['prop1']}abcde`;
var str7 = `abcde${(function () {
return `edcba${str1 + `zz${1}zz`}edcba`;
}())}abcde`;
var str8 = tag1`abcd ${a}`
var str9 = `s${`<tag attr=${exp}>${exp}</tag>`}`
var str10 = `<tag attr=${exp}>${exp}</tag>`
`${`<tag attr=${exp}>${exp}</tag>`}`
| Add more complex template string | Add more complex template string
| JavaScript | mit | othree/js-syntax-test,othree/js-syntax-test,othree/js-syntax-test | javascript | ## Code Before:
var str1 = `abcde`;
var str2 = `abcde${str1}abcde`;
var str3 = `abcde${(function () { return 'abc'; }())}abcde`;
var str4 = `abcde${({prop1: 1, prop2: 'p'})['prop1']}abcde`;
var str5 = `abcde${({prop1: 1, prop2: `edcba${1}ebcda`})['prop1']}abcde`;
var str6 = `abcde${({
prop1: 1,
prop2: `edcba${1}ebcda`
})['prop1']}abcde`;
var str7 = `abcde${(function () {
return `edcba${str1 + `zz${1}zz`}edcba`;
}())}abcde`;
var str8 = tag1`abcd ${a}`
var str9 = `s${`<tag attr=${exp}>${exp}</tag>`}`
## Instruction:
Add more complex template string
## Code After:
var str1 = `abcde`;
var str2 = `abcde${str1}abcde`;
var str3 = `abcde${(function () { return 'abc'; }())}abcde`;
var str4 = `abcde${({prop1: 1, prop2: 'p'})['prop1']}abcde`;
var str5 = `abcde${({prop1: 1, prop2: `edcba${1}ebcda`})['prop1']}abcde`;
var str6 = `abcde${({
prop1: 1,
prop2: `edcba${1}ebcda`
})['prop1']}abcde`;
var str7 = `abcde${(function () {
return `edcba${str1 + `zz${1}zz`}edcba`;
}())}abcde`;
var str8 = tag1`abcd ${a}`
var str9 = `s${`<tag attr=${exp}>${exp}</tag>`}`
var str10 = `<tag attr=${exp}>${exp}</tag>`
`${`<tag attr=${exp}>${exp}</tag>`}`
|
var str1 = `abcde`;
var str2 = `abcde${str1}abcde`;
var str3 = `abcde${(function () { return 'abc'; }())}abcde`;
var str4 = `abcde${({prop1: 1, prop2: 'p'})['prop1']}abcde`;
var str5 = `abcde${({prop1: 1, prop2: `edcba${1}ebcda`})['prop1']}abcde`;
var str6 = `abcde${({
prop1: 1,
prop2: `edcba${1}ebcda`
})['prop1']}abcde`;
var str7 = `abcde${(function () {
return `edcba${str1 + `zz${1}zz`}edcba`;
}())}abcde`;
var str8 = tag1`abcd ${a}`
var str9 = `s${`<tag attr=${exp}>${exp}</tag>`}`
+
+ var str10 = `<tag attr=${exp}>${exp}</tag>`
+ `${`<tag attr=${exp}>${exp}</tag>`}` | 3 | 0.130435 | 3 | 0 |
68e6085605fd78db2c7108b6a7659ce04b47655f | packages/app/link.js | packages/app/link.js | import { defineComponent } from 'vue'
import { RouterLink as VueRouterLink } from 'vue-router'
import { getPreloadPath } from './lib/runtime-utils'
const prefetchedPaths = new Set()
export const RouterLink = defineComponent({
...VueRouterLink,
name: 'RouterLink',
async mounted() {
if (import.meta.env.DEV) return
const { matched, path } = this.$router.resolve(this.to)
if (prefetchedPaths.has(path)) return
const components = await Promise.all(
matched.map((m) =>
typeof m.components.default === 'function'
? m.components.default()
: m.components.default
)
)
for (const component of components) {
if (component.$$staticPreload) {
const url = getPreloadPath(path)
fetch(url, { credentials: `include` })
prefetchedPaths.add(path)
break
}
}
},
})
| import { defineComponent } from 'vue'
import { RouterLink as VueRouterLink } from 'vue-router'
import { getPreloadPath } from './lib/runtime-utils'
const prefetchedPaths = new Set()
const link = import.meta.env.SSR ? null : document.createElement('link')
const hasPrefetch = import.meta.env.SSR
? false
: link.relList && link.relList.supports && link.relList.supports('prefetch')
/**
* Fetch URL using `<link rel="prefetch">` with fallback to `fetch` API
* Safari doesn't have it enabled by default: https://caniuse.com/?search=prefetch
* @param {string} url
*/
const prefetchURL = (url) => {
if (hasPrefetch) {
const link = document.createElement('link')
link.rel = 'prefetch'
link.href = url
document.head.appendChild(link)
} else {
fetch(url, { credentials: `include` })
}
}
export const RouterLink = defineComponent({
...VueRouterLink,
name: 'RouterLink',
async mounted() {
if (import.meta.env.DEV) return
const { matched, path } = this.$router.resolve(this.to)
if (prefetchedPaths.has(path)) return
const components = await Promise.all(
matched.map((m) =>
typeof m.components.default === 'function'
? m.components.default()
: m.components.default
)
)
for (const component of components) {
if (component.$$staticPreload) {
const url = getPreloadPath(path)
prefetchURL(url)
prefetchedPaths.add(path)
break
}
}
},
})
| Revert "refactor: use fetch to prefetch url" | Revert "refactor: use fetch to prefetch url"
This reverts commit e6f214d84a8546057af7bdc16424621a9249e8d8.
| JavaScript | mit | ream/ream | javascript | ## Code Before:
import { defineComponent } from 'vue'
import { RouterLink as VueRouterLink } from 'vue-router'
import { getPreloadPath } from './lib/runtime-utils'
const prefetchedPaths = new Set()
export const RouterLink = defineComponent({
...VueRouterLink,
name: 'RouterLink',
async mounted() {
if (import.meta.env.DEV) return
const { matched, path } = this.$router.resolve(this.to)
if (prefetchedPaths.has(path)) return
const components = await Promise.all(
matched.map((m) =>
typeof m.components.default === 'function'
? m.components.default()
: m.components.default
)
)
for (const component of components) {
if (component.$$staticPreload) {
const url = getPreloadPath(path)
fetch(url, { credentials: `include` })
prefetchedPaths.add(path)
break
}
}
},
})
## Instruction:
Revert "refactor: use fetch to prefetch url"
This reverts commit e6f214d84a8546057af7bdc16424621a9249e8d8.
## Code After:
import { defineComponent } from 'vue'
import { RouterLink as VueRouterLink } from 'vue-router'
import { getPreloadPath } from './lib/runtime-utils'
const prefetchedPaths = new Set()
const link = import.meta.env.SSR ? null : document.createElement('link')
const hasPrefetch = import.meta.env.SSR
? false
: link.relList && link.relList.supports && link.relList.supports('prefetch')
/**
* Fetch URL using `<link rel="prefetch">` with fallback to `fetch` API
* Safari doesn't have it enabled by default: https://caniuse.com/?search=prefetch
* @param {string} url
*/
const prefetchURL = (url) => {
if (hasPrefetch) {
const link = document.createElement('link')
link.rel = 'prefetch'
link.href = url
document.head.appendChild(link)
} else {
fetch(url, { credentials: `include` })
}
}
export const RouterLink = defineComponent({
...VueRouterLink,
name: 'RouterLink',
async mounted() {
if (import.meta.env.DEV) return
const { matched, path } = this.$router.resolve(this.to)
if (prefetchedPaths.has(path)) return
const components = await Promise.all(
matched.map((m) =>
typeof m.components.default === 'function'
? m.components.default()
: m.components.default
)
)
for (const component of components) {
if (component.$$staticPreload) {
const url = getPreloadPath(path)
prefetchURL(url)
prefetchedPaths.add(path)
break
}
}
},
})
| import { defineComponent } from 'vue'
import { RouterLink as VueRouterLink } from 'vue-router'
import { getPreloadPath } from './lib/runtime-utils'
const prefetchedPaths = new Set()
+
+ const link = import.meta.env.SSR ? null : document.createElement('link')
+ const hasPrefetch = import.meta.env.SSR
+ ? false
+ : link.relList && link.relList.supports && link.relList.supports('prefetch')
+
+ /**
+ * Fetch URL using `<link rel="prefetch">` with fallback to `fetch` API
+ * Safari doesn't have it enabled by default: https://caniuse.com/?search=prefetch
+ * @param {string} url
+ */
+ const prefetchURL = (url) => {
+ if (hasPrefetch) {
+ const link = document.createElement('link')
+ link.rel = 'prefetch'
+ link.href = url
+ document.head.appendChild(link)
+ } else {
+ fetch(url, { credentials: `include` })
+ }
+ }
export const RouterLink = defineComponent({
...VueRouterLink,
name: 'RouterLink',
async mounted() {
if (import.meta.env.DEV) return
const { matched, path } = this.$router.resolve(this.to)
if (prefetchedPaths.has(path)) return
const components = await Promise.all(
matched.map((m) =>
typeof m.components.default === 'function'
? m.components.default()
: m.components.default
)
)
for (const component of components) {
if (component.$$staticPreload) {
const url = getPreloadPath(path)
- fetch(url, { credentials: `include` })
+ prefetchURL(url)
prefetchedPaths.add(path)
break
}
}
},
}) | 23 | 0.657143 | 22 | 1 |
201e22250f4b8d478187ee1c4fd212e294962bec | rebase.js | rebase.js | // : (Transform, [Step], [Step], [Step]) → number
// Undo a given set of steps, apply a set of other steps, and then
// redo them.
function rebaseSteps(transform, steps, inverted, inside) {
for (let i = inverted.length - 1; i >= 0; i--) transform.step(inverted[i])
transform.mapping.mapFrom = inverted.length
for (let i = 0; i < inside.length; i++) transform.step(inside[i])
for (let i = 0; i < steps.length; i++) {
let mapped = steps[i].map(transform.mapping)
transform.mapping.mapFrom--
if (mapped && !transform.maybeStep(mapped).failed)
transform.mapping.setMirror(transform.mapping.mapFrom, transform.steps.length - 1)
}
return inverted.length + inside.length
}
exports.rebaseSteps = rebaseSteps
| // : (Transform, [Step], [Step], [Step]) → number
// Undo a given set of steps, apply a set of other steps, and then
// redo them.
function rebaseSteps(transform, steps, inverted, inside) {
for (let i = inverted.length - 1; i >= 0; i--) transform.step(inverted[i])
for (let i = 0; i < inside.length; i++) transform.step(inside[i])
for (let i = 0, mapFrom = inverted.length; i < steps.length; i++) {
let mapped = steps[i].map(transform.mapping.slice(mapFrom))
mapFrom--
if (mapped && !transform.maybeStep(mapped).failed)
transform.mapping.setMirror(mapFrom, transform.steps.length - 1)
}
return inverted.length + inside.length
}
exports.rebaseSteps = rebaseSteps
| Use a cleaner interface for partially mapping through a remapping | Use a cleaner interface for partially mapping through a remapping
| JavaScript | mit | ProseMirror/prosemirror-collab | javascript | ## Code Before:
// : (Transform, [Step], [Step], [Step]) → number
// Undo a given set of steps, apply a set of other steps, and then
// redo them.
function rebaseSteps(transform, steps, inverted, inside) {
for (let i = inverted.length - 1; i >= 0; i--) transform.step(inverted[i])
transform.mapping.mapFrom = inverted.length
for (let i = 0; i < inside.length; i++) transform.step(inside[i])
for (let i = 0; i < steps.length; i++) {
let mapped = steps[i].map(transform.mapping)
transform.mapping.mapFrom--
if (mapped && !transform.maybeStep(mapped).failed)
transform.mapping.setMirror(transform.mapping.mapFrom, transform.steps.length - 1)
}
return inverted.length + inside.length
}
exports.rebaseSteps = rebaseSteps
## Instruction:
Use a cleaner interface for partially mapping through a remapping
## Code After:
// : (Transform, [Step], [Step], [Step]) → number
// Undo a given set of steps, apply a set of other steps, and then
// redo them.
function rebaseSteps(transform, steps, inverted, inside) {
for (let i = inverted.length - 1; i >= 0; i--) transform.step(inverted[i])
for (let i = 0; i < inside.length; i++) transform.step(inside[i])
for (let i = 0, mapFrom = inverted.length; i < steps.length; i++) {
let mapped = steps[i].map(transform.mapping.slice(mapFrom))
mapFrom--
if (mapped && !transform.maybeStep(mapped).failed)
transform.mapping.setMirror(mapFrom, transform.steps.length - 1)
}
return inverted.length + inside.length
}
exports.rebaseSteps = rebaseSteps
| // : (Transform, [Step], [Step], [Step]) → number
// Undo a given set of steps, apply a set of other steps, and then
// redo them.
function rebaseSteps(transform, steps, inverted, inside) {
for (let i = inverted.length - 1; i >= 0; i--) transform.step(inverted[i])
- transform.mapping.mapFrom = inverted.length
for (let i = 0; i < inside.length; i++) transform.step(inside[i])
- for (let i = 0; i < steps.length; i++) {
+ for (let i = 0, mapFrom = inverted.length; i < steps.length; i++) {
? +++++++++++++++++++++++++++
- let mapped = steps[i].map(transform.mapping)
+ let mapped = steps[i].map(transform.mapping.slice(mapFrom))
? ++++++++++++++ +
- transform.mapping.mapFrom--
+ mapFrom--
if (mapped && !transform.maybeStep(mapped).failed)
- transform.mapping.setMirror(transform.mapping.mapFrom, transform.steps.length - 1)
? ------------------
+ transform.mapping.setMirror(mapFrom, transform.steps.length - 1)
}
return inverted.length + inside.length
}
exports.rebaseSteps = rebaseSteps | 9 | 0.5625 | 4 | 5 |
95d60746e1684ceaf3b8d95f3e75b7ac9af9a610 | metadata/net.guildem.publicip.yml | metadata/net.guildem.publicip.yml | Categories:
- Connectivity
- Internet
License: MIT
AuthorName: Guillaume Démurgé
AuthorEmail: gdemurge@gmail.com
SourceCode: https://github.com/guildem/publicip-android
IssueTracker: https://github.com/guildem/publicip-android/issues
Changelog: https://github.com/guildem/publicip-android/blob/HEAD/CHANGELOG.md
AutoName: Public IP
RepoType: git
Repo: https://github.com/guildem/publicip-android
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 1.0.0
subdir: app
gradle:
- yes
- versionName: 1.0.1
versionCode: 2
disable: contains firebase
commit: 1.0.1
subdir: app
gradle:
- yes
- versionName: 1.1.0
versionCode: 3
commit: 1.1.0
subdir: app
gradle:
- yes
- versionName: 1.2.0
versionCode: 4
commit: 1.2.0
subdir: app
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 1.2.0
CurrentVersionCode: 4
| Categories:
- Connectivity
- Internet
License: MIT
AuthorName: Guillaume Démurgé
AuthorEmail: gdemurge@gmail.com
SourceCode: https://github.com/guildem/publicip-android
IssueTracker: https://github.com/guildem/publicip-android/issues
Changelog: https://github.com/guildem/publicip-android/blob/HEAD/CHANGELOG.md
AutoName: Public IP
RepoType: git
Repo: https://github.com/guildem/publicip-android
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 1.0.0
subdir: app
gradle:
- yes
- versionName: 1.0.1
versionCode: 2
disable: contains firebase
commit: 1.0.1
subdir: app
gradle:
- yes
- versionName: 1.1.0
versionCode: 3
commit: 1.1.0
subdir: app
gradle:
- yes
- versionName: 1.2.0
versionCode: 4
commit: 1.2.0
subdir: app
gradle:
- yes
- versionName: 1.2.1
versionCode: 5
commit: 1.2.1
subdir: app
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 1.2.1
CurrentVersionCode: 5
| Update Public IP to 1.2.1 (5) | Update Public IP to 1.2.1 (5)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- Connectivity
- Internet
License: MIT
AuthorName: Guillaume Démurgé
AuthorEmail: gdemurge@gmail.com
SourceCode: https://github.com/guildem/publicip-android
IssueTracker: https://github.com/guildem/publicip-android/issues
Changelog: https://github.com/guildem/publicip-android/blob/HEAD/CHANGELOG.md
AutoName: Public IP
RepoType: git
Repo: https://github.com/guildem/publicip-android
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 1.0.0
subdir: app
gradle:
- yes
- versionName: 1.0.1
versionCode: 2
disable: contains firebase
commit: 1.0.1
subdir: app
gradle:
- yes
- versionName: 1.1.0
versionCode: 3
commit: 1.1.0
subdir: app
gradle:
- yes
- versionName: 1.2.0
versionCode: 4
commit: 1.2.0
subdir: app
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 1.2.0
CurrentVersionCode: 4
## Instruction:
Update Public IP to 1.2.1 (5)
## Code After:
Categories:
- Connectivity
- Internet
License: MIT
AuthorName: Guillaume Démurgé
AuthorEmail: gdemurge@gmail.com
SourceCode: https://github.com/guildem/publicip-android
IssueTracker: https://github.com/guildem/publicip-android/issues
Changelog: https://github.com/guildem/publicip-android/blob/HEAD/CHANGELOG.md
AutoName: Public IP
RepoType: git
Repo: https://github.com/guildem/publicip-android
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 1.0.0
subdir: app
gradle:
- yes
- versionName: 1.0.1
versionCode: 2
disable: contains firebase
commit: 1.0.1
subdir: app
gradle:
- yes
- versionName: 1.1.0
versionCode: 3
commit: 1.1.0
subdir: app
gradle:
- yes
- versionName: 1.2.0
versionCode: 4
commit: 1.2.0
subdir: app
gradle:
- yes
- versionName: 1.2.1
versionCode: 5
commit: 1.2.1
subdir: app
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 1.2.1
CurrentVersionCode: 5
| Categories:
- Connectivity
- Internet
License: MIT
AuthorName: Guillaume Démurgé
AuthorEmail: gdemurge@gmail.com
SourceCode: https://github.com/guildem/publicip-android
IssueTracker: https://github.com/guildem/publicip-android/issues
Changelog: https://github.com/guildem/publicip-android/blob/HEAD/CHANGELOG.md
AutoName: Public IP
RepoType: git
Repo: https://github.com/guildem/publicip-android
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 1.0.0
subdir: app
gradle:
- yes
- versionName: 1.0.1
versionCode: 2
disable: contains firebase
commit: 1.0.1
subdir: app
gradle:
- yes
- versionName: 1.1.0
versionCode: 3
commit: 1.1.0
subdir: app
gradle:
- yes
- versionName: 1.2.0
versionCode: 4
commit: 1.2.0
subdir: app
gradle:
- yes
+ - versionName: 1.2.1
+ versionCode: 5
+ commit: 1.2.1
+ subdir: app
+ gradle:
+ - yes
+
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
- CurrentVersion: 1.2.0
? ^
+ CurrentVersion: 1.2.1
? ^
- CurrentVersionCode: 4
? ^
+ CurrentVersionCode: 5
? ^
| 11 | 0.22449 | 9 | 2 |
09c96b3d906f88049010c8f1efff62efcdb85964 | cv.md | cv.md | ---
layout: page
title: CV
permalink: /cv
---
There are two versions of my CV available on this site:
- [Web CV (recommended)](/markdown-cv)
- [CV in PDF format](pdf/whipp_CV.pdf)
| ---
layout: page
title: CV
permalink: /cv
---
There are two versions of my CV available on this site:
- [Academic CV (recommended)](/markdown-cv)
- [Teaching CV](/teaching-cv)
- [Academic CV in PDF format](pdf/whipp_CV.pdf)
| Add link to teaching CV | Add link to teaching CV | Markdown | mit | dwhipp3980/dwhipp3980.github.io,davewhipp/davewhipp.github.io,davewhipp/davewhipp.github.io | markdown | ## Code Before:
---
layout: page
title: CV
permalink: /cv
---
There are two versions of my CV available on this site:
- [Web CV (recommended)](/markdown-cv)
- [CV in PDF format](pdf/whipp_CV.pdf)
## Instruction:
Add link to teaching CV
## Code After:
---
layout: page
title: CV
permalink: /cv
---
There are two versions of my CV available on this site:
- [Academic CV (recommended)](/markdown-cv)
- [Teaching CV](/teaching-cv)
- [Academic CV in PDF format](pdf/whipp_CV.pdf)
| ---
layout: page
title: CV
permalink: /cv
---
There are two versions of my CV available on this site:
- - [Web CV (recommended)](/markdown-cv)
? ^ ^
+ - [Academic CV (recommended)](/markdown-cv)
? ^^^^ ^^^
+ - [Teaching CV](/teaching-cv)
- - [CV in PDF format](pdf/whipp_CV.pdf)
+ - [Academic CV in PDF format](pdf/whipp_CV.pdf)
? +++++++++
| 5 | 0.555556 | 3 | 2 |
7d5614b16c42402176fd331b366cbbfda3d0cc0e | app/controllers/people_controller.rb | app/controllers/people_controller.rb | class PeopleController < ApplicationController
def show
@person = Person.friendly_find(params)
end
def redirect_show
person = Person.find_by(name: params[:name_slug].gsub('_', ' '))
if person
redirect_to person_url(id: person.id, slug: person.slug), status: 301
else
fail ActiveRecord::RecordNotFound
end
end
end
| class PeopleController < ApplicationController
def show
@person = Person.friendly_find(params)
end
def redirect_show
person = Person.find_by(name: params[:name_slug].gsub('_', ' '))
if person
redirect_to person.friendly_path, status: 301
else
fail ActiveRecord::RecordNotFound
end
end
end
| Fix for the 2010-era candidate url people redirect. | Fix for the 2010-era candidate url people redirect.
| Ruby | unlicense | OpenDemocracyManitoba/winnipegelection,OpenDemocracyManitoba/winnipegelection,OpenDemocracyManitoba/winnipegelection,OpenDemocracyManitoba/winnipegelection | ruby | ## Code Before:
class PeopleController < ApplicationController
def show
@person = Person.friendly_find(params)
end
def redirect_show
person = Person.find_by(name: params[:name_slug].gsub('_', ' '))
if person
redirect_to person_url(id: person.id, slug: person.slug), status: 301
else
fail ActiveRecord::RecordNotFound
end
end
end
## Instruction:
Fix for the 2010-era candidate url people redirect.
## Code After:
class PeopleController < ApplicationController
def show
@person = Person.friendly_find(params)
end
def redirect_show
person = Person.find_by(name: params[:name_slug].gsub('_', ' '))
if person
redirect_to person.friendly_path, status: 301
else
fail ActiveRecord::RecordNotFound
end
end
end
| class PeopleController < ApplicationController
def show
@person = Person.friendly_find(params)
end
def redirect_show
person = Person.find_by(name: params[:name_slug].gsub('_', ' '))
if person
- redirect_to person_url(id: person.id, slug: person.slug), status: 301
+ redirect_to person.friendly_path, status: 301
else
fail ActiveRecord::RecordNotFound
end
end
end | 2 | 0.142857 | 1 | 1 |
b93c9dcb95959b8d11a8370979bb0958c0656dc3 | README.org | README.org | * Hyphen Keeper
A small web app to keep a whitelist of approved hyphenation patterns.
This web app will let you maintain a list of words and their approved
hyphenation patterns. In the background it will generate hyphenation
pattern files to be used with [[https://github.com/hunspell/hyphen][libhyphen]].
| * Hyphen Keeper
A small web app to keep a whitelist of approved hyphenation patterns.
This web app will let you maintain a list of words and their approved
hyphenation patterns. In the background it will generate hyphenation
pattern files to be used with [[https://github.com/hunspell/hyphen][libhyphen]].
** License
Copyright © 2016 Swiss Library for the Blind, Visually Impaired and Print Disabled.
Distributed under the [[http://www.gnu.org/licenses/agpl-3.0.html][GNU Affero General Public License]]. See the file LICENSE.
| Change the license to GNU Affero General Public License | Change the license to GNU Affero General Public License
| Org | agpl-3.0 | sbsdev/hyphen-keeper | org | ## Code Before:
* Hyphen Keeper
A small web app to keep a whitelist of approved hyphenation patterns.
This web app will let you maintain a list of words and their approved
hyphenation patterns. In the background it will generate hyphenation
pattern files to be used with [[https://github.com/hunspell/hyphen][libhyphen]].
## Instruction:
Change the license to GNU Affero General Public License
## Code After:
* Hyphen Keeper
A small web app to keep a whitelist of approved hyphenation patterns.
This web app will let you maintain a list of words and their approved
hyphenation patterns. In the background it will generate hyphenation
pattern files to be used with [[https://github.com/hunspell/hyphen][libhyphen]].
** License
Copyright © 2016 Swiss Library for the Blind, Visually Impaired and Print Disabled.
Distributed under the [[http://www.gnu.org/licenses/agpl-3.0.html][GNU Affero General Public License]]. See the file LICENSE.
| * Hyphen Keeper
A small web app to keep a whitelist of approved hyphenation patterns.
This web app will let you maintain a list of words and their approved
hyphenation patterns. In the background it will generate hyphenation
pattern files to be used with [[https://github.com/hunspell/hyphen][libhyphen]].
+
+ ** License
+
+ Copyright © 2016 Swiss Library for the Blind, Visually Impaired and Print Disabled.
+
+ Distributed under the [[http://www.gnu.org/licenses/agpl-3.0.html][GNU Affero General Public License]]. See the file LICENSE. | 6 | 0.857143 | 6 | 0 |
1a680a4efce2bb6166be5fbff943c0662ab3eaa3 | README.md | README.md | * leo_backend_db
** Overview
="leo_backend_db"= is wrapper of local KVS and uses Basho bitcask, Basho eleveldb and Erlang ETS
[[https://github.com/basho/bitcask][bitcask]].
[[https://github.com/basho/eleveldb][eleveldb]].
[[http://www.erlang.org/doc/man/ets.html][Erlang ETS]].
Leo-BackendDB uses the "rebar" build system.
Makefile so that simply running "make" at the top level should work.
[[https://github.com/basho/rebar][Rebar]].
Leo-BackendDB requires Erlang R14B04 or later.
| leo_backend_db
==============
Overview
--------
* ="leo_backend_db"= is wrapper of local KVS and uses Basho bitcask, Basho eleveldb and Erlang ETS
* [bitcask](https://github.com/basho/bitcask)
* [eleveldb](https://github.com/basho/eleveldb)
* [Erlang ETS](http://www.erlang.org/doc/man/ets.html)
* Leo-BackendDB uses the "rebar" build system. Makefile so that simply running "make" at the top level should work.
* [rebar](https://github.com/basho/rebar)
* Leo-BackendDB requires Erlang R14B04 or later.
| Modify readme to correct format | Modify readme to correct format
| Markdown | apache-2.0 | leo-project/leo_backend_db | markdown | ## Code Before:
* leo_backend_db
** Overview
="leo_backend_db"= is wrapper of local KVS and uses Basho bitcask, Basho eleveldb and Erlang ETS
[[https://github.com/basho/bitcask][bitcask]].
[[https://github.com/basho/eleveldb][eleveldb]].
[[http://www.erlang.org/doc/man/ets.html][Erlang ETS]].
Leo-BackendDB uses the "rebar" build system.
Makefile so that simply running "make" at the top level should work.
[[https://github.com/basho/rebar][Rebar]].
Leo-BackendDB requires Erlang R14B04 or later.
## Instruction:
Modify readme to correct format
## Code After:
leo_backend_db
==============
Overview
--------
* ="leo_backend_db"= is wrapper of local KVS and uses Basho bitcask, Basho eleveldb and Erlang ETS
* [bitcask](https://github.com/basho/bitcask)
* [eleveldb](https://github.com/basho/eleveldb)
* [Erlang ETS](http://www.erlang.org/doc/man/ets.html)
* Leo-BackendDB uses the "rebar" build system. Makefile so that simply running "make" at the top level should work.
* [rebar](https://github.com/basho/rebar)
* Leo-BackendDB requires Erlang R14B04 or later.
| - * leo_backend_db
? --
+ leo_backend_db
+ ==============
- ** Overview
- ="leo_backend_db"= is wrapper of local KVS and uses Basho bitcask, Basho eleveldb and Erlang ETS
- [[https://github.com/basho/bitcask][bitcask]].
- [[https://github.com/basho/eleveldb][eleveldb]].
- [[http://www.erlang.org/doc/man/ets.html][Erlang ETS]].
+ Overview
+ --------
- Leo-BackendDB uses the "rebar" build system.
- Makefile so that simply running "make" at the top level should work.
- [[https://github.com/basho/rebar][Rebar]].
- Leo-BackendDB requires Erlang R14B04 or later.
+ * ="leo_backend_db"= is wrapper of local KVS and uses Basho bitcask, Basho eleveldb and Erlang ETS
+ * [bitcask](https://github.com/basho/bitcask)
+ * [eleveldb](https://github.com/basho/eleveldb)
+ * [Erlang ETS](http://www.erlang.org/doc/man/ets.html)
+ * Leo-BackendDB uses the "rebar" build system. Makefile so that simply running "make" at the top level should work.
+ * [rebar](https://github.com/basho/rebar)
+ * Leo-BackendDB requires Erlang R14B04 or later.
+ | 22 | 1.692308 | 12 | 10 |
d183632736ae90bdc69e4fbf3c81d2088fc99968 | scripts/docker_clang60_env.sh | scripts/docker_clang60_env.sh | export OMPI_CC=clang
export OMPI_CXX=clang++
export CC=mpicc
export CXX=mpicxx
# Add clang OpenMP runtime library to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# Suppress leak sanitizer on functions we have no control of.
export LSAN_OPTIONS=suppressions=/scratch/source/trilinos/release/DataTransferKit/scripts/leak_blacklist.txt
# Set the ASAN_SYMBOLIZER_PATH environment variable to point to the
# llvm-symbolizer to make AddressSanitizer symbolize its output. This makes
# the reports more human-readable.
export ASAN_SYMBOLIZER_PATH=/opt/llvm/6.0/bin/llvm-symbolizer
# Use SANITIZER_FLAGS to add Wextra flags to avoid increasing the complexity of
# our script. We don't put Wextra directly in docker_cmake because it would
# affect every build and the number of warnings is very large.
export SANITIZER_FLAGS="-Wextra -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=/scratch/source/trilinos/release/DataTransferKit/scripts/undefined_blacklist.txt"
| export OMPI_CC=clang
export OMPI_CXX=clang++
export CC=mpicc
export CXX=mpicxx
# Add clang OpenMP runtime library to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
if [ ! -z "$1" ]
then
# Suppress leak sanitizer on functions we have no control of.
export LSAN_OPTIONS=suppressions=/scratch/source/trilinos/release/DataTransferKit/scripts/leak_blacklist.txt
# Set the ASAN_SYMBOLIZER_PATH environment variable to point to the
# llvm-symbolizer to make AddressSanitizer symbolize its output. This makes
# the reports more human-readable.
export ASAN_SYMBOLIZER_PATH=/opt/llvm/6.0/bin/llvm-symbolizer
# Use SANITIZER_FLAGS to add Wextra flags to avoid increasing the complexity
# of our script. We don't put Wextra directly in docker_cmake because it
# would affect every build and the number of warnings is very large.
export SANITIZER_FLAGS="-Wextra -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=/scratch/source/trilinos/release/DataTransferKit/scripts/undefined_blacklist.txt"
fi
| Enable the sanitizer when any argument is passed to the script that setup clang | Enable the sanitizer when any argument is passed to the script that setup clang
| Shell | bsd-3-clause | dalg24/DataTransferKit,ORNL-CEES/DataTransferKit,ORNL-CEES/DataTransferKit,Rombur/DataTransferKit,dalg24/DataTransferKit,Rombur/DataTransferKit,dalg24/DataTransferKit,Rombur/DataTransferKit,dalg24/DataTransferKit,ORNL-CEES/DataTransferKit,ORNL-CEES/DataTransferKit,Rombur/DataTransferKit | shell | ## Code Before:
export OMPI_CC=clang
export OMPI_CXX=clang++
export CC=mpicc
export CXX=mpicxx
# Add clang OpenMP runtime library to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# Suppress leak sanitizer on functions we have no control of.
export LSAN_OPTIONS=suppressions=/scratch/source/trilinos/release/DataTransferKit/scripts/leak_blacklist.txt
# Set the ASAN_SYMBOLIZER_PATH environment variable to point to the
# llvm-symbolizer to make AddressSanitizer symbolize its output. This makes
# the reports more human-readable.
export ASAN_SYMBOLIZER_PATH=/opt/llvm/6.0/bin/llvm-symbolizer
# Use SANITIZER_FLAGS to add Wextra flags to avoid increasing the complexity of
# our script. We don't put Wextra directly in docker_cmake because it would
# affect every build and the number of warnings is very large.
export SANITIZER_FLAGS="-Wextra -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=/scratch/source/trilinos/release/DataTransferKit/scripts/undefined_blacklist.txt"
## Instruction:
Enable the sanitizer when any argument is passed to the script that setup clang
## Code After:
export OMPI_CC=clang
export OMPI_CXX=clang++
export CC=mpicc
export CXX=mpicxx
# Add clang OpenMP runtime library to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
if [ ! -z "$1" ]
then
# Suppress leak sanitizer on functions we have no control of.
export LSAN_OPTIONS=suppressions=/scratch/source/trilinos/release/DataTransferKit/scripts/leak_blacklist.txt
# Set the ASAN_SYMBOLIZER_PATH environment variable to point to the
# llvm-symbolizer to make AddressSanitizer symbolize its output. This makes
# the reports more human-readable.
export ASAN_SYMBOLIZER_PATH=/opt/llvm/6.0/bin/llvm-symbolizer
# Use SANITIZER_FLAGS to add Wextra flags to avoid increasing the complexity
# of our script. We don't put Wextra directly in docker_cmake because it
# would affect every build and the number of warnings is very large.
export SANITIZER_FLAGS="-Wextra -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=/scratch/source/trilinos/release/DataTransferKit/scripts/undefined_blacklist.txt"
fi
| export OMPI_CC=clang
export OMPI_CXX=clang++
export CC=mpicc
export CXX=mpicxx
# Add clang OpenMP runtime library to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
+ if [ ! -z "$1" ]
+ then
- # Suppress leak sanitizer on functions we have no control of.
+ # Suppress leak sanitizer on functions we have no control of.
? ++
- export LSAN_OPTIONS=suppressions=/scratch/source/trilinos/release/DataTransferKit/scripts/leak_blacklist.txt
+ export LSAN_OPTIONS=suppressions=/scratch/source/trilinos/release/DataTransferKit/scripts/leak_blacklist.txt
? ++
- # Set the ASAN_SYMBOLIZER_PATH environment variable to point to the
+ # Set the ASAN_SYMBOLIZER_PATH environment variable to point to the
? ++
- # llvm-symbolizer to make AddressSanitizer symbolize its output. This makes
+ # llvm-symbolizer to make AddressSanitizer symbolize its output. This makes
? ++
- # the reports more human-readable.
+ # the reports more human-readable.
? ++
- export ASAN_SYMBOLIZER_PATH=/opt/llvm/6.0/bin/llvm-symbolizer
+ export ASAN_SYMBOLIZER_PATH=/opt/llvm/6.0/bin/llvm-symbolizer
? ++
- # Use SANITIZER_FLAGS to add Wextra flags to avoid increasing the complexity of
? ---
+ # Use SANITIZER_FLAGS to add Wextra flags to avoid increasing the complexity
? ++
- # our script. We don't put Wextra directly in docker_cmake because it would
? ------
+ # of our script. We don't put Wextra directly in docker_cmake because it
? ++ +++
- # affect every build and the number of warnings is very large.
+ # would affect every build and the number of warnings is very large.
? ++ ++++++
- export SANITIZER_FLAGS="-Wextra -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=/scratch/source/trilinos/release/DataTransferKit/scripts/undefined_blacklist.txt"
+ export SANITIZER_FLAGS="-Wextra -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=/scratch/source/trilinos/release/DataTransferKit/scripts/undefined_blacklist.txt"
? ++
+ fi | 23 | 1.15 | 13 | 10 |
61f25d143d04e225e626ac5b491de91d3eb8e299 | libraries/core.php | libraries/core.php | <?php namespace Cello;
use \Asset,
\Event,
Orchestra\Acl,
Orchestra\Core as O;
class Core {
/**
* Start your engine.
*
* @static
* @access public
* @return void
*/
public static function start()
{
Acl::make('cello')->attach(O::memory());
// Append all Cello required assets for Orchestra Administrator
// Interface usage mainly on Resources page.
Event::listen('orchestra.started: backend', function()
{
$asset = Asset::container('orchestra.backend');
$asset->script('redactor', 'bundles/orchestra/vendor/redactor/redactor.js', array('jquery', 'bootstrap'));
$asset->script('cello', 'bundles/cello/js/cello.min.js', array('redactor'));
$asset->style('redactor', 'bundles/orchestra/vendor/redactor/css/redactor.css', array('bootstrap'));
});
}
} | <?php namespace Cello;
use \Asset,
\Event,
Orchestra\Acl,
Orchestra\Core as O;
class Core {
/**
* Start your engine.
*
* @static
* @access public
* @return void
*/
public static function start()
{
Acl::make('cello')->attach(O::memory());
// Append all Cello required assets for Orchestra Administrator
// Interface usage mainly on Resources page.
Event::listen('orchestra.started: backend', function()
{
$asset = Asset::container('orchestra.backend: footer');
$asset->script('redactor', 'bundles/orchestra/vendor/redactor/redactor.min.js', array('jquery', 'bootstrap'));
$asset->script('cello', 'bundles/cello/js/cello.min.js', array('redactor'));
$asset->style('redactor', 'bundles/orchestra/vendor/redactor/css/redactor.css', array('bootstrap'));
});
}
} | Update asset loading to be loaded in footer. | Update asset loading to be loaded in footer.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
| PHP | mit | orchestral/cello,orchestral/cello | php | ## Code Before:
<?php namespace Cello;
use \Asset,
\Event,
Orchestra\Acl,
Orchestra\Core as O;
class Core {
/**
* Start your engine.
*
* @static
* @access public
* @return void
*/
public static function start()
{
Acl::make('cello')->attach(O::memory());
// Append all Cello required assets for Orchestra Administrator
// Interface usage mainly on Resources page.
Event::listen('orchestra.started: backend', function()
{
$asset = Asset::container('orchestra.backend');
$asset->script('redactor', 'bundles/orchestra/vendor/redactor/redactor.js', array('jquery', 'bootstrap'));
$asset->script('cello', 'bundles/cello/js/cello.min.js', array('redactor'));
$asset->style('redactor', 'bundles/orchestra/vendor/redactor/css/redactor.css', array('bootstrap'));
});
}
}
## Instruction:
Update asset loading to be loaded in footer.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
## Code After:
<?php namespace Cello;
use \Asset,
\Event,
Orchestra\Acl,
Orchestra\Core as O;
class Core {
/**
* Start your engine.
*
* @static
* @access public
* @return void
*/
public static function start()
{
Acl::make('cello')->attach(O::memory());
// Append all Cello required assets for Orchestra Administrator
// Interface usage mainly on Resources page.
Event::listen('orchestra.started: backend', function()
{
$asset = Asset::container('orchestra.backend: footer');
$asset->script('redactor', 'bundles/orchestra/vendor/redactor/redactor.min.js', array('jquery', 'bootstrap'));
$asset->script('cello', 'bundles/cello/js/cello.min.js', array('redactor'));
$asset->style('redactor', 'bundles/orchestra/vendor/redactor/css/redactor.css', array('bootstrap'));
});
}
} | <?php namespace Cello;
use \Asset,
\Event,
Orchestra\Acl,
Orchestra\Core as O;
class Core {
/**
* Start your engine.
*
* @static
* @access public
* @return void
*/
public static function start()
{
Acl::make('cello')->attach(O::memory());
// Append all Cello required assets for Orchestra Administrator
// Interface usage mainly on Resources page.
Event::listen('orchestra.started: backend', function()
{
- $asset = Asset::container('orchestra.backend');
+ $asset = Asset::container('orchestra.backend: footer');
? ++++++++
- $asset->script('redactor', 'bundles/orchestra/vendor/redactor/redactor.js', array('jquery', 'bootstrap'));
+ $asset->script('redactor', 'bundles/orchestra/vendor/redactor/redactor.min.js', array('jquery', 'bootstrap'));
? ++++
$asset->script('cello', 'bundles/cello/js/cello.min.js', array('redactor'));
$asset->style('redactor', 'bundles/orchestra/vendor/redactor/css/redactor.css', array('bootstrap'));
});
}
} | 4 | 0.125 | 2 | 2 |
938e7f0622177b7ee55c8723755b1d5656023753 | readme.md | readme.md |
> Get your internal IP address
## Install
```
$ npm install internal-ip
```
## Usage
```js
const internalIp = require('internal-ip');
internalIp.v6().then(ip => {
console.log(ip);
//=> 'fe80::1'
});
internalIp.v4().then(ip => {
console.log(ip);
//=> '10.0.0.79'
});
```
In the case no address can be determined, `::1` or `127.0.0.1` will be returned as a fallback. If you think this is incorrect, please open an [issue](https://github.com/sindresorhus/internal-ip/issues/new).
## Related
- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module
- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
> Get your internal IP address
## Install
```
$ npm install internal-ip
```
## Usage
```js
const internalIp = require('internal-ip');
internalIp.v6().then(ip => {
console.log(ip);
//=> 'fe80::1'
});
internalIp.v4().then(ip => {
console.log(ip);
//=> '10.0.0.79'
});
```
The module relies on tools provided by most operating systems. One notable exception may be the `ip` command which is used on Linux. If it's missing, it can usually be installed with the `iproute2` package in your package manager.
In the case no address can be determined, `::1` or `127.0.0.1` will be returned as a fallback. If you think this is incorrect, please open an [issue](https://github.com/sindresorhus/internal-ip/issues/new).
## Related
- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module
- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
| Add note about 'ip' command in README | Add note about 'ip' command in README
| Markdown | mit | sindresorhus/internal-ip,sindresorhus/internal-ip | markdown | ## Code Before:
> Get your internal IP address
## Install
```
$ npm install internal-ip
```
## Usage
```js
const internalIp = require('internal-ip');
internalIp.v6().then(ip => {
console.log(ip);
//=> 'fe80::1'
});
internalIp.v4().then(ip => {
console.log(ip);
//=> '10.0.0.79'
});
```
In the case no address can be determined, `::1` or `127.0.0.1` will be returned as a fallback. If you think this is incorrect, please open an [issue](https://github.com/sindresorhus/internal-ip/issues/new).
## Related
- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module
- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
## Instruction:
Add note about 'ip' command in README
## Code After:
> Get your internal IP address
## Install
```
$ npm install internal-ip
```
## Usage
```js
const internalIp = require('internal-ip');
internalIp.v6().then(ip => {
console.log(ip);
//=> 'fe80::1'
});
internalIp.v4().then(ip => {
console.log(ip);
//=> '10.0.0.79'
});
```
The module relies on tools provided by most operating systems. One notable exception may be the `ip` command which is used on Linux. If it's missing, it can usually be installed with the `iproute2` package in your package manager.
In the case no address can be determined, `::1` or `127.0.0.1` will be returned as a fallback. If you think this is incorrect, please open an [issue](https://github.com/sindresorhus/internal-ip/issues/new).
## Related
- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module
- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
> Get your internal IP address
## Install
```
$ npm install internal-ip
```
## Usage
```js
const internalIp = require('internal-ip');
internalIp.v6().then(ip => {
console.log(ip);
//=> 'fe80::1'
});
internalIp.v4().then(ip => {
console.log(ip);
//=> '10.0.0.79'
});
```
+ The module relies on tools provided by most operating systems. One notable exception may be the `ip` command which is used on Linux. If it's missing, it can usually be installed with the `iproute2` package in your package manager.
+
In the case no address can be determined, `::1` or `127.0.0.1` will be returned as a fallback. If you think this is incorrect, please open an [issue](https://github.com/sindresorhus/internal-ip/issues/new).
## Related
- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module
- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address
## License
MIT © [Sindre Sorhus](https://sindresorhus.com) | 2 | 0.051282 | 2 | 0 |
e164bc4dbdd3fa7bf6275e634b0417254eaaad1c | Server/Java/httprpc-server-test/src/org/httprpc/test/testdata.html | Server/Java/httprpc-server-test/src/org/httprpc/test/testdata.html | <html>
<head>
<title>Test Data</title>
<style type="text/css" media="screen">
table {
border-collapse:collapse;
border:1px solid #000000;
}
td {
border:1px solid #000000;
}
</style>
</head>
<body>
<table>
<tr>
<td>{{@a}}</td>
<td>{{@b}}</td>
<td>{{@c}}</td>
</tr>
{{#.}}<tr>
<td>{{a:test=lower:^html}}</td>
<td>{{b:format=0x%04x}}</td>
<td>{{c:format=currency}}</td>
</tr>{{/.}}
</table>
</body>
</html>
| <html>
<head>
<title>Test Data</title>
<style type="text/css" media="screen">
table {
border-collapse:collapse;
border:1px solid #000000;
}
td {
border:1px solid #000000;
}
</style>
</head>
<body>
<p>UTF-8 characters: åéîóü</p>
<table>
<tr>
<td>{{@a}}</td>
<td>{{@b}}</td>
<td>{{@c}}</td>
</tr>
{{#.}}<tr>
<td>{{a:test=lower:^html}}</td>
<td>{{b:format=0x%04x}}</td>
<td>{{c:format=currency}}</td>
</tr>{{/.}}
</table>
</body>
</html>
| Add UTF-8 characters to test template. | Add UTF-8 characters to test template.
| HTML | apache-2.0 | gk-brown/HTTP-RPC,gk-brown/WebRPC,gk-brown/WebRPC,gk-brown/WebRPC,gk-brown/HTTP-RPC,gk-brown/WebRPC,gk-brown/WebRPC,gk-brown/WebRPC,gk-brown/HTTP-RPC | html | ## Code Before:
<html>
<head>
<title>Test Data</title>
<style type="text/css" media="screen">
table {
border-collapse:collapse;
border:1px solid #000000;
}
td {
border:1px solid #000000;
}
</style>
</head>
<body>
<table>
<tr>
<td>{{@a}}</td>
<td>{{@b}}</td>
<td>{{@c}}</td>
</tr>
{{#.}}<tr>
<td>{{a:test=lower:^html}}</td>
<td>{{b:format=0x%04x}}</td>
<td>{{c:format=currency}}</td>
</tr>{{/.}}
</table>
</body>
</html>
## Instruction:
Add UTF-8 characters to test template.
## Code After:
<html>
<head>
<title>Test Data</title>
<style type="text/css" media="screen">
table {
border-collapse:collapse;
border:1px solid #000000;
}
td {
border:1px solid #000000;
}
</style>
</head>
<body>
<p>UTF-8 characters: åéîóü</p>
<table>
<tr>
<td>{{@a}}</td>
<td>{{@b}}</td>
<td>{{@c}}</td>
</tr>
{{#.}}<tr>
<td>{{a:test=lower:^html}}</td>
<td>{{b:format=0x%04x}}</td>
<td>{{c:format=currency}}</td>
</tr>{{/.}}
</table>
</body>
</html>
| <html>
<head>
<title>Test Data</title>
<style type="text/css" media="screen">
table {
border-collapse:collapse;
border:1px solid #000000;
}
td {
border:1px solid #000000;
}
</style>
</head>
<body>
+ <p>UTF-8 characters: åéîóü</p>
<table>
<tr>
<td>{{@a}}</td>
<td>{{@b}}</td>
<td>{{@c}}</td>
</tr>
{{#.}}<tr>
<td>{{a:test=lower:^html}}</td>
<td>{{b:format=0x%04x}}</td>
<td>{{c:format=currency}}</td>
</tr>{{/.}}
</table>
</body>
</html> | 1 | 0.035714 | 1 | 0 |
d709cc4a3d8f1eeb3d8e76c0d2945e905c14f546 | test/testdeck/src/commands/cluster_commands/ProvisionCommand.ts | test/testdeck/src/commands/cluster_commands/ProvisionCommand.ts | import {Argv} from 'yargs'
import { ClusterFactory } from '../../ClusterManager'
import {Config} from '../../Config'
interface Opts {
config: string
}
class ProvisionCommand {
command = "provision"
describe = "Provision a cluster"
builder(yargs: Argv) {
return yargs
.option('config', {
describe: 'Cluster configuration location',
type: 'string'
})
}
async handler(opts: Opts) {
const config = await Config.Load('./config.yml')
const cluster = await ClusterFactory.CreateCluster(opts.config || config.clusterConfig, {
image: config.baseImage,
licenseFile: config.licenseFile
})
await cluster.startCluster()
}
}
module.exports = new ProvisionCommand()
| import {Argv} from 'yargs'
import { ClusterFactory } from '../../ClusterManager'
import {Config} from '../../Config'
interface Opts {
config: string
image: string
}
class ProvisionCommand {
command = "provision"
describe = "Provision a cluster"
builder(yargs: Argv) {
return yargs
.option('config', {
describe: 'Cluster configuration location',
type: 'string'
})
.option('image', {
describe: 'The Rundeck Docker image to use instead of the default',
type: 'string'
})
}
async handler(opts: Opts) {
const config = await Config.Load('./config.yml')
const cluster = await ClusterFactory.CreateCluster(opts.config || config.clusterConfig, {
image: opts.image || config.baseImage,
licenseFile: config.licenseFile
})
await cluster.startCluster()
}
}
module.exports = new ProvisionCommand()
| Add image option to provision | Add image option to provision
| TypeScript | apache-2.0 | rundeck/rundeck,variacode/rundeck,rundeck/rundeck,rundeck/rundeck,rundeck/rundeck,variacode/rundeck,variacode/rundeck,variacode/rundeck,variacode/rundeck,rundeck/rundeck | typescript | ## Code Before:
import {Argv} from 'yargs'
import { ClusterFactory } from '../../ClusterManager'
import {Config} from '../../Config'
interface Opts {
config: string
}
class ProvisionCommand {
command = "provision"
describe = "Provision a cluster"
builder(yargs: Argv) {
return yargs
.option('config', {
describe: 'Cluster configuration location',
type: 'string'
})
}
async handler(opts: Opts) {
const config = await Config.Load('./config.yml')
const cluster = await ClusterFactory.CreateCluster(opts.config || config.clusterConfig, {
image: config.baseImage,
licenseFile: config.licenseFile
})
await cluster.startCluster()
}
}
module.exports = new ProvisionCommand()
## Instruction:
Add image option to provision
## Code After:
import {Argv} from 'yargs'
import { ClusterFactory } from '../../ClusterManager'
import {Config} from '../../Config'
interface Opts {
config: string
image: string
}
class ProvisionCommand {
command = "provision"
describe = "Provision a cluster"
builder(yargs: Argv) {
return yargs
.option('config', {
describe: 'Cluster configuration location',
type: 'string'
})
.option('image', {
describe: 'The Rundeck Docker image to use instead of the default',
type: 'string'
})
}
async handler(opts: Opts) {
const config = await Config.Load('./config.yml')
const cluster = await ClusterFactory.CreateCluster(opts.config || config.clusterConfig, {
image: opts.image || config.baseImage,
licenseFile: config.licenseFile
})
await cluster.startCluster()
}
}
module.exports = new ProvisionCommand()
| import {Argv} from 'yargs'
import { ClusterFactory } from '../../ClusterManager'
import {Config} from '../../Config'
interface Opts {
config: string
+ image: string
}
class ProvisionCommand {
command = "provision"
describe = "Provision a cluster"
builder(yargs: Argv) {
return yargs
.option('config', {
describe: 'Cluster configuration location',
type: 'string'
})
+ .option('image', {
+ describe: 'The Rundeck Docker image to use instead of the default',
+ type: 'string'
+ })
}
async handler(opts: Opts) {
const config = await Config.Load('./config.yml')
const cluster = await ClusterFactory.CreateCluster(opts.config || config.clusterConfig, {
- image: config.baseImage,
+ image: opts.image || config.baseImage,
? ++++++++++++++
licenseFile: config.licenseFile
})
await cluster.startCluster()
}
}
module.exports = new ProvisionCommand() | 7 | 0.205882 | 6 | 1 |
4b2d1f424a846ed3762100ed69ed3ff57b20e670 | Code/src/main/java/nl/utwente/viskell/ui/components/SliderBlock.java | Code/src/main/java/nl/utwente/viskell/ui/components/SliderBlock.java | package nl.utwente.viskell.ui.components;
import javafx.fxml.FXML;
import javafx.scene.control.Slider;
import nl.utwente.viskell.ui.CustomUIPane;
/**
* An extension of ValueBlock.
* The value of this Block can be changed by dragging a slider.
* Ranges from 0 to 1 (both inclusive).
*/
public class SliderBlock extends ValueBlock {
@FXML protected Slider slider;
/**
* Constructs a new SliderBlock
* @param pane The parent pane this Block resides on.
*/
public SliderBlock(CustomUIPane pane) {
super(pane, pane.getEnvInstance().buildType("Fractional a => a"), "0.0", "SliderBlock");
slider.setValue(0.0);
setValue("0.0");
slider.valueProperty().addListener(ev -> {
setValue(String.format("%.5f", slider.getValue()));
this.initiateConnectionChanges();
});
}
}
| package nl.utwente.viskell.ui.components;
import javafx.fxml.FXML;
import javafx.scene.control.Slider;
import nl.utwente.viskell.ui.CustomUIPane;
/**
* An extension of ValueBlock.
* The value of this Block can be changed by dragging a slider.
* Ranges from 0 to 1 (both inclusive).
*/
public class SliderBlock extends ValueBlock {
@FXML protected Slider slider;
/**
* Constructs a new SliderBlock
* @param pane The parent pane this Block resides on.
*/
public SliderBlock(CustomUIPane pane) {
super(pane, pane.getEnvInstance().buildType("Fractional a => a"), "0.0", "SliderBlock");
slider.setValue(0.0);
setValue("0.0");
slider.valueProperty().addListener(ev -> {
setValue(String.format(Locale.US, "%.5f", slider.getValue()));
this.initiateConnectionChanges();
});
}
}
| Fix format of slider block floats to be always valid. | Fix format of slider block floats to be always valid. | Java | mit | wandernauta/viskell,viskell/viskell,andrewdavidmackenzie/viskell | java | ## Code Before:
package nl.utwente.viskell.ui.components;
import javafx.fxml.FXML;
import javafx.scene.control.Slider;
import nl.utwente.viskell.ui.CustomUIPane;
/**
* An extension of ValueBlock.
* The value of this Block can be changed by dragging a slider.
* Ranges from 0 to 1 (both inclusive).
*/
public class SliderBlock extends ValueBlock {
@FXML protected Slider slider;
/**
* Constructs a new SliderBlock
* @param pane The parent pane this Block resides on.
*/
public SliderBlock(CustomUIPane pane) {
super(pane, pane.getEnvInstance().buildType("Fractional a => a"), "0.0", "SliderBlock");
slider.setValue(0.0);
setValue("0.0");
slider.valueProperty().addListener(ev -> {
setValue(String.format("%.5f", slider.getValue()));
this.initiateConnectionChanges();
});
}
}
## Instruction:
Fix format of slider block floats to be always valid.
## Code After:
package nl.utwente.viskell.ui.components;
import javafx.fxml.FXML;
import javafx.scene.control.Slider;
import nl.utwente.viskell.ui.CustomUIPane;
/**
* An extension of ValueBlock.
* The value of this Block can be changed by dragging a slider.
* Ranges from 0 to 1 (both inclusive).
*/
public class SliderBlock extends ValueBlock {
@FXML protected Slider slider;
/**
* Constructs a new SliderBlock
* @param pane The parent pane this Block resides on.
*/
public SliderBlock(CustomUIPane pane) {
super(pane, pane.getEnvInstance().buildType("Fractional a => a"), "0.0", "SliderBlock");
slider.setValue(0.0);
setValue("0.0");
slider.valueProperty().addListener(ev -> {
setValue(String.format(Locale.US, "%.5f", slider.getValue()));
this.initiateConnectionChanges();
});
}
}
| package nl.utwente.viskell.ui.components;
import javafx.fxml.FXML;
import javafx.scene.control.Slider;
import nl.utwente.viskell.ui.CustomUIPane;
/**
* An extension of ValueBlock.
* The value of this Block can be changed by dragging a slider.
* Ranges from 0 to 1 (both inclusive).
*/
public class SliderBlock extends ValueBlock {
@FXML protected Slider slider;
/**
* Constructs a new SliderBlock
* @param pane The parent pane this Block resides on.
*/
public SliderBlock(CustomUIPane pane) {
super(pane, pane.getEnvInstance().buildType("Fractional a => a"), "0.0", "SliderBlock");
slider.setValue(0.0);
setValue("0.0");
slider.valueProperty().addListener(ev -> {
- setValue(String.format("%.5f", slider.getValue()));
+ setValue(String.format(Locale.US, "%.5f", slider.getValue()));
? +++++++++++
this.initiateConnectionChanges();
});
}
} | 2 | 0.066667 | 1 | 1 |
1cf3b41c8020ec2dde64045973e44b9754f682db | src/containers/Root/Root.prod.jsx | src/containers/Root/Root.prod.jsx | import React from 'react'
import { Provider } from 'react-redux'
import { browserHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import configureStore from 'store/configureStore'
import Routes from './Routes'
const store = configureStore()
const history = syncHistoryWithStore(browserHistory, store)
export default (
<Provider store={ store }>
<Routes history={ history } />
</Provider>
)
| import React from 'react'
import { Provider } from 'react-redux'
import { browserHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import configureStore from 'store/configureStore'
import Routes from './Routes'
const initialState = window.__INITIAL_STATE__
const store = configureStore(initialState)
const history = syncHistoryWithStore(browserHistory, store)
export default (
<Provider store={ store }>
<Routes history={ history } />
</Provider>
)
| Prepare redux store to handle server-side rendering. | Prepare redux store to handle server-side rendering.
| JSX | mit | ADI-Labs/calendar-web,ADI-Labs/calendar-web | jsx | ## Code Before:
import React from 'react'
import { Provider } from 'react-redux'
import { browserHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import configureStore from 'store/configureStore'
import Routes from './Routes'
const store = configureStore()
const history = syncHistoryWithStore(browserHistory, store)
export default (
<Provider store={ store }>
<Routes history={ history } />
</Provider>
)
## Instruction:
Prepare redux store to handle server-side rendering.
## Code After:
import React from 'react'
import { Provider } from 'react-redux'
import { browserHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import configureStore from 'store/configureStore'
import Routes from './Routes'
const initialState = window.__INITIAL_STATE__
const store = configureStore(initialState)
const history = syncHistoryWithStore(browserHistory, store)
export default (
<Provider store={ store }>
<Routes history={ history } />
</Provider>
)
| import React from 'react'
import { Provider } from 'react-redux'
import { browserHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import configureStore from 'store/configureStore'
import Routes from './Routes'
+ const initialState = window.__INITIAL_STATE__
- const store = configureStore()
+ const store = configureStore(initialState)
? ++++++++++++
const history = syncHistoryWithStore(browserHistory, store)
export default (
<Provider store={ store }>
<Routes history={ history } />
</Provider>
) | 3 | 0.2 | 2 | 1 |
626154fda07d5c39a3e3ed32b55450973eac9b29 | README.md | README.md |
> [SVProgressHUD](https://github.com/SVProgressHUD/SVProgressHUD) is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS.
This binding is for getting it worked on Xamarin.iOS with fully access to all methods.
Update latest native library version [**2.1**](https://github.com/SVProgressHUD/SVProgressHUD)
## Nuget
* `Install-Package SVProgressHUD`
* <https://www.nuget.org/packages/SVProgressHUD>
## Build
* `make`
* Output: `build/SVProgressHUD.dll`
## Usage
* `SVProgressHUD.Show();`
* `SVProgressHUD.Dismiss();`
* `using SVProgressHUDBinding`
* Full documentation: <https://github.com/SVProgressHUD/SVProgressHUD>
|
> [SVProgressHUD](https://github.com/SVProgressHUD/SVProgressHUD) is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS.
This binding is for getting it worked on Xamarin.iOS with fully access to all methods.
Update latest native library version [**2.1**](https://github.com/SVProgressHUD/SVProgressHUD)
## Nuget
* `Install-Package SVProgressHUD`
* <https://www.nuget.org/packages/SVProgressHUD>
## Build
* `make`
* Output: `build/SVProgressHUD.dll`
## Sample Code
```
using System;
using SVProgressHUDBinding;
using UIKit;
namespace DemoHUD
{
public partial class ViewController : UIViewController
{
protected ViewController(IntPtr handle) : base(handle)
{
// Note: this .ctor should not contain any initialization logic.
}
partial void BtnToggle_TouchUpInside(UIButton sender)
{
if (!SVProgressHUD.IsVisible)
{
//Show loading indicator
SVProgressHUD.Show();
} else
{
//Hide loading indicator
SVProgressHUD.Dismiss();
}
}
}
}
```
* Full documentation: <https://github.com/SVProgressHUD/SVProgressHUD>
| Update Sample Code, use inside UIViewController | Update Sample Code, use inside UIViewController | Markdown | mit | trinnguyen/SVProgressHUD-Xamarin | markdown | ## Code Before:
> [SVProgressHUD](https://github.com/SVProgressHUD/SVProgressHUD) is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS.
This binding is for getting it worked on Xamarin.iOS with fully access to all methods.
Update latest native library version [**2.1**](https://github.com/SVProgressHUD/SVProgressHUD)
## Nuget
* `Install-Package SVProgressHUD`
* <https://www.nuget.org/packages/SVProgressHUD>
## Build
* `make`
* Output: `build/SVProgressHUD.dll`
## Usage
* `SVProgressHUD.Show();`
* `SVProgressHUD.Dismiss();`
* `using SVProgressHUDBinding`
* Full documentation: <https://github.com/SVProgressHUD/SVProgressHUD>
## Instruction:
Update Sample Code, use inside UIViewController
## Code After:
> [SVProgressHUD](https://github.com/SVProgressHUD/SVProgressHUD) is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS.
This binding is for getting it worked on Xamarin.iOS with fully access to all methods.
Update latest native library version [**2.1**](https://github.com/SVProgressHUD/SVProgressHUD)
## Nuget
* `Install-Package SVProgressHUD`
* <https://www.nuget.org/packages/SVProgressHUD>
## Build
* `make`
* Output: `build/SVProgressHUD.dll`
## Sample Code
```
using System;
using SVProgressHUDBinding;
using UIKit;
namespace DemoHUD
{
public partial class ViewController : UIViewController
{
protected ViewController(IntPtr handle) : base(handle)
{
// Note: this .ctor should not contain any initialization logic.
}
partial void BtnToggle_TouchUpInside(UIButton sender)
{
if (!SVProgressHUD.IsVisible)
{
//Show loading indicator
SVProgressHUD.Show();
} else
{
//Hide loading indicator
SVProgressHUD.Dismiss();
}
}
}
}
```
* Full documentation: <https://github.com/SVProgressHUD/SVProgressHUD>
|
> [SVProgressHUD](https://github.com/SVProgressHUD/SVProgressHUD) is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS.
This binding is for getting it worked on Xamarin.iOS with fully access to all methods.
Update latest native library version [**2.1**](https://github.com/SVProgressHUD/SVProgressHUD)
## Nuget
* `Install-Package SVProgressHUD`
* <https://www.nuget.org/packages/SVProgressHUD>
## Build
* `make`
* Output: `build/SVProgressHUD.dll`
- ## Usage
- * `SVProgressHUD.Show();`
- * `SVProgressHUD.Dismiss();`
+ ## Sample Code
+ ```
+ using System;
- * `using SVProgressHUDBinding`
? --- ^
+ using SVProgressHUDBinding;
? ^
+ using UIKit;
+
+ namespace DemoHUD
+ {
+ public partial class ViewController : UIViewController
+ {
+ protected ViewController(IntPtr handle) : base(handle)
+ {
+ // Note: this .ctor should not contain any initialization logic.
+ }
+
+ partial void BtnToggle_TouchUpInside(UIButton sender)
+ {
+ if (!SVProgressHUD.IsVisible)
+ {
+ //Show loading indicator
+ SVProgressHUD.Show();
+ } else
+ {
+ //Hide loading indicator
+ SVProgressHUD.Dismiss();
+ }
+ }
+ }
+ }
+ ```
* Full documentation: <https://github.com/SVProgressHUD/SVProgressHUD> | 34 | 1.7 | 30 | 4 |
30b3feb412fc1585e03dad0980d53c5e158a0624 | src/main/java/com/stripe/model/ChargeLevel3.java | src/main/java/com/stripe/model/ChargeLevel3.java | package com.stripe.model;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public final class ChargeLevel3 extends StripeObject {
protected List<ChargeLevel3LineItem> lineItems;
protected String merchantReference;
protected String shippingAddressZip;
protected Long shippingAmount;
} | package com.stripe.model;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public final class ChargeLevel3 extends StripeObject {
protected String customerReference;
protected List<ChargeLevel3LineItem> lineItems;
protected String merchantReference;
protected String shippingAddressZip;
protected String shippingFromZip;
protected Long shippingAmount;
} | Add extra properties to the Level III data on a Charge | Add extra properties to the Level III data on a Charge
| Java | mit | stripe/stripe-java | java | ## Code Before:
package com.stripe.model;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public final class ChargeLevel3 extends StripeObject {
protected List<ChargeLevel3LineItem> lineItems;
protected String merchantReference;
protected String shippingAddressZip;
protected Long shippingAmount;
}
## Instruction:
Add extra properties to the Level III data on a Charge
## Code After:
package com.stripe.model;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public final class ChargeLevel3 extends StripeObject {
protected String customerReference;
protected List<ChargeLevel3LineItem> lineItems;
protected String merchantReference;
protected String shippingAddressZip;
protected String shippingFromZip;
protected Long shippingAmount;
} | package com.stripe.model;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public final class ChargeLevel3 extends StripeObject {
+ protected String customerReference;
protected List<ChargeLevel3LineItem> lineItems;
protected String merchantReference;
protected String shippingAddressZip;
+ protected String shippingFromZip;
protected Long shippingAmount;
} | 2 | 0.117647 | 2 | 0 |
1aba4c628adaca49e706917001338fc21bfe77e8 | src/golang/finalize/cli/main.go | src/golang/finalize/cli/main.go | package main
import (
"golang/finalize"
_ "golang/hooks"
"os"
"github.com/cloudfoundry/libbuildpack"
)
type config struct {
Config struct {
GoVersion string `yaml:"GoVersion"`
VendorTool string `yaml:"VendorTool"`
Godep string `yaml:"Godep"`
} `yaml:"config"`
}
func main() {
stager, err := libbuildpack.NewStager(os.Args[1:], libbuildpack.NewLogger())
if err := libbuildpack.SetStagingEnvironment(stager.DepsDir); err != nil {
stager.Log.Error("Unable to setup environment variables: %s", err.Error())
os.Exit(10)
}
gf, err := finalize.NewFinalizer(stager)
if err != nil {
os.Exit(11)
}
if err := finalize.Run(gf); err != nil {
os.Exit(12)
}
if err := libbuildpack.SetLaunchEnvironment(stager.DepsDir, stager.BuildDir); err != nil {
stager.Log.Error("Unable to setup launch environment: %s", err.Error())
os.Exit(13)
}
if err := libbuildpack.RunAfterCompile(stager); err != nil {
stager.Log.Error("After Compile: %s", err.Error())
os.Exit(14)
}
stager.StagingComplete()
}
| package main
import (
"golang/finalize"
_ "golang/hooks"
"os"
"github.com/cloudfoundry/libbuildpack"
)
type config struct {
Config struct {
GoVersion string `yaml:"GoVersion"`
VendorTool string `yaml:"VendorTool"`
Godep string `yaml:"Godep"`
} `yaml:"config"`
}
func main() {
stager, err := libbuildpack.NewStager(os.Args[1:], libbuildpack.NewLogger())
if err := libbuildpack.SetStagingEnvironment(stager.DepsDir); err != nil {
stager.Log.Error("Unable to setup environment variables: %s", err.Error())
os.Exit(10)
}
gf, err := finalize.NewFinalizer(stager)
if err != nil {
os.Exit(11)
}
if err := finalize.Run(gf); err != nil {
os.Exit(12)
}
if err := libbuildpack.RunAfterCompile(stager); err != nil {
stager.Log.Error("After Compile: %s", err.Error())
os.Exit(13)
}
if err := libbuildpack.SetLaunchEnvironment(stager.DepsDir, stager.BuildDir); err != nil {
stager.Log.Error("Unable to setup launch environment: %s", err.Error())
os.Exit(14)
}
stager.StagingComplete()
}
| Make .profile.d scripts and hooks compatible | Make .profile.d scripts and hooks compatible
- hooks should come before writing to .profile.d directory
[#145118801]
Signed-off-by: Dave Goddard <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@goddard.id.au>
| Go | apache-2.0 | cloudfoundry/go-buildpack,cloudfoundry/go-buildpack,cloudfoundry/go-buildpack | go | ## Code Before:
package main
import (
"golang/finalize"
_ "golang/hooks"
"os"
"github.com/cloudfoundry/libbuildpack"
)
type config struct {
Config struct {
GoVersion string `yaml:"GoVersion"`
VendorTool string `yaml:"VendorTool"`
Godep string `yaml:"Godep"`
} `yaml:"config"`
}
func main() {
stager, err := libbuildpack.NewStager(os.Args[1:], libbuildpack.NewLogger())
if err := libbuildpack.SetStagingEnvironment(stager.DepsDir); err != nil {
stager.Log.Error("Unable to setup environment variables: %s", err.Error())
os.Exit(10)
}
gf, err := finalize.NewFinalizer(stager)
if err != nil {
os.Exit(11)
}
if err := finalize.Run(gf); err != nil {
os.Exit(12)
}
if err := libbuildpack.SetLaunchEnvironment(stager.DepsDir, stager.BuildDir); err != nil {
stager.Log.Error("Unable to setup launch environment: %s", err.Error())
os.Exit(13)
}
if err := libbuildpack.RunAfterCompile(stager); err != nil {
stager.Log.Error("After Compile: %s", err.Error())
os.Exit(14)
}
stager.StagingComplete()
}
## Instruction:
Make .profile.d scripts and hooks compatible
- hooks should come before writing to .profile.d directory
[#145118801]
Signed-off-by: Dave Goddard <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@goddard.id.au>
## Code After:
package main
import (
"golang/finalize"
_ "golang/hooks"
"os"
"github.com/cloudfoundry/libbuildpack"
)
type config struct {
Config struct {
GoVersion string `yaml:"GoVersion"`
VendorTool string `yaml:"VendorTool"`
Godep string `yaml:"Godep"`
} `yaml:"config"`
}
func main() {
stager, err := libbuildpack.NewStager(os.Args[1:], libbuildpack.NewLogger())
if err := libbuildpack.SetStagingEnvironment(stager.DepsDir); err != nil {
stager.Log.Error("Unable to setup environment variables: %s", err.Error())
os.Exit(10)
}
gf, err := finalize.NewFinalizer(stager)
if err != nil {
os.Exit(11)
}
if err := finalize.Run(gf); err != nil {
os.Exit(12)
}
if err := libbuildpack.RunAfterCompile(stager); err != nil {
stager.Log.Error("After Compile: %s", err.Error())
os.Exit(13)
}
if err := libbuildpack.SetLaunchEnvironment(stager.DepsDir, stager.BuildDir); err != nil {
stager.Log.Error("Unable to setup launch environment: %s", err.Error())
os.Exit(14)
}
stager.StagingComplete()
}
| package main
import (
"golang/finalize"
_ "golang/hooks"
"os"
"github.com/cloudfoundry/libbuildpack"
)
type config struct {
- Config struct {
? ^^
+ Config struct {
? ^
- GoVersion string `yaml:"GoVersion"`
? ^^^^
+ GoVersion string `yaml:"GoVersion"`
? ^^
- VendorTool string `yaml:"VendorTool"`
? ^^^^
+ VendorTool string `yaml:"VendorTool"`
? ^^
- Godep string `yaml:"Godep"`
? ^^^^
+ Godep string `yaml:"Godep"`
? ^^
- } `yaml:"config"`
? ^^
+ } `yaml:"config"`
? ^
}
func main() {
stager, err := libbuildpack.NewStager(os.Args[1:], libbuildpack.NewLogger())
if err := libbuildpack.SetStagingEnvironment(stager.DepsDir); err != nil {
stager.Log.Error("Unable to setup environment variables: %s", err.Error())
os.Exit(10)
}
gf, err := finalize.NewFinalizer(stager)
if err != nil {
os.Exit(11)
}
if err := finalize.Run(gf); err != nil {
os.Exit(12)
}
- if err := libbuildpack.SetLaunchEnvironment(stager.DepsDir, stager.BuildDir); err != nil {
- stager.Log.Error("Unable to setup launch environment: %s", err.Error())
+ if err := libbuildpack.RunAfterCompile(stager); err != nil {
+ stager.Log.Error("After Compile: %s", err.Error())
os.Exit(13)
}
- if err := libbuildpack.RunAfterCompile(stager); err != nil {
- stager.Log.Error("After Compile: %s", err.Error())
+ if err := libbuildpack.SetLaunchEnvironment(stager.DepsDir, stager.BuildDir); err != nil {
+ stager.Log.Error("Unable to setup launch environment: %s", err.Error())
os.Exit(14)
}
stager.StagingComplete()
} | 18 | 0.382979 | 9 | 9 |
e84b1f723f6b00103f6bda59a5a5fa9e799200d2 | resources/toc.xsl | resources/toc.xsl | <?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<xsl:param name="current"/>
<xsl:template match="ArrayOfTypeInfo">
<nav class="toc">
<ul>
<xsl:apply-templates/>
</ul>
</nav>
</xsl:template>
<xsl:template match="TypeInfo">
<li>
<xsl:attribute name="class">
<xsl:if test="TypeInfo">has-childs </xsl:if>
<xsl:if test="'' = $current">current </xsl:if>
</xsl:attribute>
<a href="{@Id}">
<xsl:value-of select="FullName"/>
</a>
<xsl:if test="TypeInfo">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet> | <?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<xsl:param name="current"/>
<xsl:template match="/">
<xsl:text disable-output-escaping="yes"><!DOCTYPE html>
</xsl:text>
<html>
<head>
<meta charset="utf-8"/>
<title>Table of Contents</title>
</head>
<body>
<nav class="toc">
<xsl:apply-templates/>
</nav>
</body>
</html>
</xsl:template>
<xsl:template match="ArrayOfTypeInfo">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="TypeInfo">
<li>
<xsl:attribute name="class">
<xsl:if test="TypeInfo">has-childs </xsl:if>
<xsl:if test="'' = $current">current </xsl:if>
</xsl:attribute>
<a href="{@Id}">
<xsl:value-of select="FullName"/>
</a>
<xsl:if test="TypeInfo">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet> | Write ToC as (almost) valid HTML5 | Write ToC as (almost) valid HTML5
| XSLT | bsd-2-clause | joriszwart/dokumentasi | xslt | ## Code Before:
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<xsl:param name="current"/>
<xsl:template match="ArrayOfTypeInfo">
<nav class="toc">
<ul>
<xsl:apply-templates/>
</ul>
</nav>
</xsl:template>
<xsl:template match="TypeInfo">
<li>
<xsl:attribute name="class">
<xsl:if test="TypeInfo">has-childs </xsl:if>
<xsl:if test="'' = $current">current </xsl:if>
</xsl:attribute>
<a href="{@Id}">
<xsl:value-of select="FullName"/>
</a>
<xsl:if test="TypeInfo">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet>
## Instruction:
Write ToC as (almost) valid HTML5
## Code After:
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<xsl:param name="current"/>
<xsl:template match="/">
<xsl:text disable-output-escaping="yes"><!DOCTYPE html>
</xsl:text>
<html>
<head>
<meta charset="utf-8"/>
<title>Table of Contents</title>
</head>
<body>
<nav class="toc">
<xsl:apply-templates/>
</nav>
</body>
</html>
</xsl:template>
<xsl:template match="ArrayOfTypeInfo">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="TypeInfo">
<li>
<xsl:attribute name="class">
<xsl:if test="TypeInfo">has-childs </xsl:if>
<xsl:if test="'' = $current">current </xsl:if>
</xsl:attribute>
<a href="{@Id}">
<xsl:value-of select="FullName"/>
</a>
<xsl:if test="TypeInfo">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet> | <?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<xsl:param name="current"/>
+ <xsl:template match="/">
+ <xsl:text disable-output-escaping="yes"><!DOCTYPE html>
+ </xsl:text>
+ <html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Table of Contents</title>
+ </head>
+ <body>
+ <nav class="toc">
+ <xsl:apply-templates/>
+ </nav>
+ </body>
+ </html>
+ </xsl:template>
+
<xsl:template match="ArrayOfTypeInfo">
- <nav class="toc">
- <ul>
? --
+ <ul>
- <xsl:apply-templates/>
? --
+ <xsl:apply-templates/>
- </ul>
? --
+ </ul>
- </nav>
</xsl:template>
<xsl:template match="TypeInfo">
<li>
<xsl:attribute name="class">
<xsl:if test="TypeInfo">has-childs </xsl:if>
<xsl:if test="'' = $current">current </xsl:if>
</xsl:attribute>
<a href="{@Id}">
<xsl:value-of select="FullName"/>
</a>
<xsl:if test="TypeInfo">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet> | 24 | 0.685714 | 19 | 5 |
0dbd55f505f8afd0cd7f1256bb7ed5156fbe157d | lib/settings/DefaultSettings.ts | lib/settings/DefaultSettings.ts | import {VoidHook} from "../tasks/Hooks";
export default {
projectType: "frontend",
port: 5000,
liveReloadPort: 35729,
distribution: "dist",
targets: "targets",
bootstrapperStyles: "",
watchStyles: [
"styles"
],
test: "test/**/*.ts",
images: "images",
assets: "assets",
autoprefixer: ["last 2 versions", "> 1%"],
scripts: "scripts/**/*.{ts,tsx}",
revisionExclude: [],
nodemon: {},
uglifyjs: {
output: {
"ascii_only": true
}
},
preBuild: VoidHook,
postBuild: VoidHook
} | import {VoidHook} from "../tasks/Hooks";
export default {
projectType: "frontend",
port: 5000,
liveReloadPort: 35729,
distribution: "dist",
targets: "targets",
bootstrapperStyles: "",
watchStyles: [
"styles"
],
test: "test/**/*.ts",
images: "images",
assets: "assets",
autoprefixer: ["last 2 versions", "> 1%"],
scripts: "scripts/**/*.{ts,tsx}",
revisionExclude: [],
nodemon: {},
uglifyjs: {
output: {
"ascii_only": true
}
},
preBuild: VoidHook,
postBuild: VoidHook,
typescriptPath: require.resolve("typescript")
} | Add typescript path in default settings | Add typescript path in default settings
| TypeScript | mit | mtfranchetto/smild,mtfranchetto/smild,mtfranchetto/smild | typescript | ## Code Before:
import {VoidHook} from "../tasks/Hooks";
export default {
projectType: "frontend",
port: 5000,
liveReloadPort: 35729,
distribution: "dist",
targets: "targets",
bootstrapperStyles: "",
watchStyles: [
"styles"
],
test: "test/**/*.ts",
images: "images",
assets: "assets",
autoprefixer: ["last 2 versions", "> 1%"],
scripts: "scripts/**/*.{ts,tsx}",
revisionExclude: [],
nodemon: {},
uglifyjs: {
output: {
"ascii_only": true
}
},
preBuild: VoidHook,
postBuild: VoidHook
}
## Instruction:
Add typescript path in default settings
## Code After:
import {VoidHook} from "../tasks/Hooks";
export default {
projectType: "frontend",
port: 5000,
liveReloadPort: 35729,
distribution: "dist",
targets: "targets",
bootstrapperStyles: "",
watchStyles: [
"styles"
],
test: "test/**/*.ts",
images: "images",
assets: "assets",
autoprefixer: ["last 2 versions", "> 1%"],
scripts: "scripts/**/*.{ts,tsx}",
revisionExclude: [],
nodemon: {},
uglifyjs: {
output: {
"ascii_only": true
}
},
preBuild: VoidHook,
postBuild: VoidHook,
typescriptPath: require.resolve("typescript")
} | import {VoidHook} from "../tasks/Hooks";
export default {
projectType: "frontend",
port: 5000,
liveReloadPort: 35729,
distribution: "dist",
targets: "targets",
bootstrapperStyles: "",
watchStyles: [
"styles"
],
test: "test/**/*.ts",
images: "images",
assets: "assets",
autoprefixer: ["last 2 versions", "> 1%"],
scripts: "scripts/**/*.{ts,tsx}",
revisionExclude: [],
nodemon: {},
uglifyjs: {
output: {
"ascii_only": true
}
},
preBuild: VoidHook,
- postBuild: VoidHook
+ postBuild: VoidHook,
? +
+ typescriptPath: require.resolve("typescript")
} | 3 | 0.111111 | 2 | 1 |
015f85622b33df01971ffc784f0f7594da30c889 | app/controllers/name.controller.js | app/controllers/name.controller.js | 'use strict';
angular.module('houseBand')
.controller('NameCtrl', function($state){
this.roomCheck = function(room){
if(room){
return $state.go('home', {room: room})
}
alert('Please name your band')
return false
}
});
| 'use strict';
angular.module('houseBand')
.controller('NameCtrl', function($state){
this.roomCheck = function(room){
if(room){
return $state.go('home', {room: room.toLowerCase()})
}
alert('Please name your band');
return false
}
});
| Make room name lower case | Make room name lower case
| JavaScript | mit | HouseBand/client,HouseBand/client | javascript | ## Code Before:
'use strict';
angular.module('houseBand')
.controller('NameCtrl', function($state){
this.roomCheck = function(room){
if(room){
return $state.go('home', {room: room})
}
alert('Please name your band')
return false
}
});
## Instruction:
Make room name lower case
## Code After:
'use strict';
angular.module('houseBand')
.controller('NameCtrl', function($state){
this.roomCheck = function(room){
if(room){
return $state.go('home', {room: room.toLowerCase()})
}
alert('Please name your band');
return false
}
});
| 'use strict';
angular.module('houseBand')
.controller('NameCtrl', function($state){
this.roomCheck = function(room){
if(room){
- return $state.go('home', {room: room})
+ return $state.go('home', {room: room.toLowerCase()})
? ++++++++++++++
}
- alert('Please name your band')
+ alert('Please name your band');
? +
return false
}
}); | 4 | 0.307692 | 2 | 2 |
be0a078aa004470a450dddfa5a8e770b2e0ad97c | disk/datadog_checks/disk/__init__.py | disk/datadog_checks/disk/__init__.py | from .__about__ import __version__
from .disk import Disk
all = [
'__version__', 'Disk'
]
| from .__about__ import __version__ # NOQA F401
from .disk import Disk # NOQA F401
all = [
'__version__', 'Disk'
]
| Fix flake8 issues and ignore unused | [Disk] Fix flake8 issues and ignore unused
| Python | bsd-3-clause | DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core | python | ## Code Before:
from .__about__ import __version__
from .disk import Disk
all = [
'__version__', 'Disk'
]
## Instruction:
[Disk] Fix flake8 issues and ignore unused
## Code After:
from .__about__ import __version__ # NOQA F401
from .disk import Disk # NOQA F401
all = [
'__version__', 'Disk'
]
| - from .__about__ import __version__
+ from .__about__ import __version__ # NOQA F401
? +++++++++++++
- from .disk import Disk
+ from .disk import Disk # NOQA F401
? +++++++++++++
all = [
- '__version__', 'Disk'
+ '__version__', 'Disk'
? ++
] | 6 | 1 | 3 | 3 |
c6324350baf04d791393653a989c49b734684556 | README.md | README.md |
[](https://travis-ci.org/hyperoslo/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
## Usage
```swift
<API>
```
## Installation
**TimeAgo** is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'TimeAgo'
```
## Author
Hyper, ios@hyper.no
## License
**TimeAgo** is available under the MIT license. See the LICENSE file for more info.
|
[](https://travis-ci.org/hyperoslo/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
## Usage
```swift
let now = NSDate()
let agoString = now.timeAgo
```
## Installation
**TimeAgo** is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'TimeAgo'
```
## Author
Hyper, ios@hyper.no
## License
**TimeAgo** is available under the MIT license. See the LICENSE file for more info.
| Add usage example to Readme.md | Add usage example to Readme.md
| Markdown | mit | hyperoslo/TimeAgo,hyperoslo/TimeAgo | markdown | ## Code Before:
[](https://travis-ci.org/hyperoslo/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
## Usage
```swift
<API>
```
## Installation
**TimeAgo** is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'TimeAgo'
```
## Author
Hyper, ios@hyper.no
## License
**TimeAgo** is available under the MIT license. See the LICENSE file for more info.
## Instruction:
Add usage example to Readme.md
## Code After:
[](https://travis-ci.org/hyperoslo/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
## Usage
```swift
let now = NSDate()
let agoString = now.timeAgo
```
## Installation
**TimeAgo** is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'TimeAgo'
```
## Author
Hyper, ios@hyper.no
## License
**TimeAgo** is available under the MIT license. See the LICENSE file for more info.
|
[](https://travis-ci.org/hyperoslo/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
[](http://cocoadocs.org/docsets/TimeAgo)
## Usage
```swift
- <API>
+ let now = NSDate()
+ let agoString = now.timeAgo
```
## Installation
**TimeAgo** is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'TimeAgo'
```
## Author
Hyper, ios@hyper.no
## License
**TimeAgo** is available under the MIT license. See the LICENSE file for more info. | 3 | 0.107143 | 2 | 1 |
30a3a33c9df23be5c2b43134d515607a9e6f4ad5 | README.md | README.md | Advanced Symlink publishing for Flow and Neos
=============================================
This package provides advanced symlink publishing options for Flow and Neos.
Most importantly, this package adds the option to publish resources using relative symlinks.
This is important when you run Flow or Neos with a chrooted PHP interpreter.
Installation
------------
Install using composer:
composer require mittwald-flow/symlink-publishing
Configuration
-------------
You can configure relative symlink publishing in the Flow settings.
**It is enabled by default!**
TYPO3:
Flow:
resource:
targets:
localWebDirectoryPersistentResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
localWebDirectoryStaticResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
License
-------
This package is MIT-licensed. See the [license file](LICENSE) for more information.
Credits
-------
This package is based on a [change](https://review.typo3.org/30519) by Christian Müller. | Advanced Symlink publishing for Flow and Neos
=============================================
This package provides advanced symlink publishing options for Flow and Neos.
Most importantly, this package adds the option to publish resources using relative symlinks.
This is important when you run Flow or Neos with a chrooted PHP interpreter.
Installation
------------
Install using composer:
composer require mittwald-flow/symlink-publishing
Next delete all absolute referenced symlinks, etc., from the _Resources folder:
rm -rf Web/_Resources
Finally reissue the relative referenced symlinks, etc.:
./flow resources:publish
Configuration
-------------
You can configure relative symlink publishing in the Flow settings.
**It is enabled by default!**
TYPO3:
Flow:
resource:
targets:
localWebDirectoryPersistentResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
localWebDirectoryStaticResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
License
-------
This package is MIT-licensed. See the [license file](LICENSE) for more information.
Credits
-------
This package is based on a [change](https://review.typo3.org/30519) by Christian Müller.
| Remove old absolute referenced symlinks | [TASK] Remove old absolute referenced symlinks
It wasn't mentioned that you need to manually remove all old references to the absolutely referenced symlinks by deleting the _Resources directory and recreating resource symlinks. | Markdown | mit | mittwald/flow-symlink-publishing | markdown | ## Code Before:
Advanced Symlink publishing for Flow and Neos
=============================================
This package provides advanced symlink publishing options for Flow and Neos.
Most importantly, this package adds the option to publish resources using relative symlinks.
This is important when you run Flow or Neos with a chrooted PHP interpreter.
Installation
------------
Install using composer:
composer require mittwald-flow/symlink-publishing
Configuration
-------------
You can configure relative symlink publishing in the Flow settings.
**It is enabled by default!**
TYPO3:
Flow:
resource:
targets:
localWebDirectoryPersistentResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
localWebDirectoryStaticResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
License
-------
This package is MIT-licensed. See the [license file](LICENSE) for more information.
Credits
-------
This package is based on a [change](https://review.typo3.org/30519) by Christian Müller.
## Instruction:
[TASK] Remove old absolute referenced symlinks
It wasn't mentioned that you need to manually remove all old references to the absolutely referenced symlinks by deleting the _Resources directory and recreating resource symlinks.
## Code After:
Advanced Symlink publishing for Flow and Neos
=============================================
This package provides advanced symlink publishing options for Flow and Neos.
Most importantly, this package adds the option to publish resources using relative symlinks.
This is important when you run Flow or Neos with a chrooted PHP interpreter.
Installation
------------
Install using composer:
composer require mittwald-flow/symlink-publishing
Next delete all absolute referenced symlinks, etc., from the _Resources folder:
rm -rf Web/_Resources
Finally reissue the relative referenced symlinks, etc.:
./flow resources:publish
Configuration
-------------
You can configure relative symlink publishing in the Flow settings.
**It is enabled by default!**
TYPO3:
Flow:
resource:
targets:
localWebDirectoryPersistentResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
localWebDirectoryStaticResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
License
-------
This package is MIT-licensed. See the [license file](LICENSE) for more information.
Credits
-------
This package is based on a [change](https://review.typo3.org/30519) by Christian Müller.
| Advanced Symlink publishing for Flow and Neos
=============================================
This package provides advanced symlink publishing options for Flow and Neos.
Most importantly, this package adds the option to publish resources using relative symlinks.
This is important when you run Flow or Neos with a chrooted PHP interpreter.
Installation
------------
Install using composer:
composer require mittwald-flow/symlink-publishing
+
+ Next delete all absolute referenced symlinks, etc., from the _Resources folder:
+
+ rm -rf Web/_Resources
+
+ Finally reissue the relative referenced symlinks, etc.:
+
+ ./flow resources:publish
Configuration
-------------
You can configure relative symlink publishing in the Flow settings.
**It is enabled by default!**
TYPO3:
Flow:
resource:
targets:
localWebDirectoryPersistentResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
localWebDirectoryStaticResourcesTarget:
target: 'Mw\SymlinkPublishing\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
License
-------
This package is MIT-licensed. See the [license file](LICENSE) for more information.
Credits
-------
This package is based on a [change](https://review.typo3.org/30519) by Christian Müller. | 8 | 0.190476 | 8 | 0 |
b767f184caf17277501f13b063cbc26c1378068e | generators/app/templates/skill/states.js | generators/app/templates/skill/states.js | 'use strict';
exports.register = function register(skill) {
skill.onIntent('LaunchIntent', () => ({ reply: 'Intent.Launch', to: 'entry' }));
skill.onIntent('AMAZON.HelpIntent', () => ({ reply: 'Intent.Help', to: 'die' }));
};
| 'use strict';
const Reply = require('voxa').Reply;
exports.register = function register(skill) {
// This event is triggered after new session has started
skill.onSessionStarted((alexaEvent) => {});
// This event is triggered before the current session has ended
skill.onSessionEnded((alexaEvent) => {});
// This can be used to plug new information in the request
skill.onRequestStated((alexaEvent) => {});
// This handler will catch all errors generated when trying to make transitions in the stateMachine, this could include errors in the state machine controllers
skill.onStateMachineError((alexaEvent, reply, error) =>
// it gets the current reply, which could be incomplete due to an error.
new Reply(alexaEvent, { tell: 'An error in the controllers code' }).write(),
);
// This is the more general handler and will catch all unhandled errors in the framework
skill.onError((alexaEvent, error) =>
new Reply(alexaEvent, { tell: 'An unrecoverable error occurred.' }).write(),
);
// This event is triggered before every time the user response to an Alexa event...
// and it have two parameters, alexaEvent and the reply controller.
skill.onBeforeReplySent((alexaEvent, reply) => { });
// Launch intent example
skill.onIntent('LaunchIntent', () => ({ reply: 'Intent.Launch', to: 'entry' }));
// AMAMAZON Build-in Help Intent example
skill.onIntent('AMAZON.HelpIntent', () => ({ reply: 'Intent.Help', to: 'die' }));
};
| Use onSessionHandlers, also onError, onStateMachineError and onBeforeReplySent | Use onSessionHandlers, also onError, onStateMachineError and onBeforeReplySent
| JavaScript | mit | mediarain/generator-voxa-skill | javascript | ## Code Before:
'use strict';
exports.register = function register(skill) {
skill.onIntent('LaunchIntent', () => ({ reply: 'Intent.Launch', to: 'entry' }));
skill.onIntent('AMAZON.HelpIntent', () => ({ reply: 'Intent.Help', to: 'die' }));
};
## Instruction:
Use onSessionHandlers, also onError, onStateMachineError and onBeforeReplySent
## Code After:
'use strict';
const Reply = require('voxa').Reply;
exports.register = function register(skill) {
// This event is triggered after new session has started
skill.onSessionStarted((alexaEvent) => {});
// This event is triggered before the current session has ended
skill.onSessionEnded((alexaEvent) => {});
// This can be used to plug new information in the request
skill.onRequestStated((alexaEvent) => {});
// This handler will catch all errors generated when trying to make transitions in the stateMachine, this could include errors in the state machine controllers
skill.onStateMachineError((alexaEvent, reply, error) =>
// it gets the current reply, which could be incomplete due to an error.
new Reply(alexaEvent, { tell: 'An error in the controllers code' }).write(),
);
// This is the more general handler and will catch all unhandled errors in the framework
skill.onError((alexaEvent, error) =>
new Reply(alexaEvent, { tell: 'An unrecoverable error occurred.' }).write(),
);
// This event is triggered before every time the user response to an Alexa event...
// and it have two parameters, alexaEvent and the reply controller.
skill.onBeforeReplySent((alexaEvent, reply) => { });
// Launch intent example
skill.onIntent('LaunchIntent', () => ({ reply: 'Intent.Launch', to: 'entry' }));
// AMAMAZON Build-in Help Intent example
skill.onIntent('AMAZON.HelpIntent', () => ({ reply: 'Intent.Help', to: 'die' }));
};
| 'use strict';
+ const Reply = require('voxa').Reply;
+
exports.register = function register(skill) {
+ // This event is triggered after new session has started
+ skill.onSessionStarted((alexaEvent) => {});
+ // This event is triggered before the current session has ended
+ skill.onSessionEnded((alexaEvent) => {});
+ // This can be used to plug new information in the request
+ skill.onRequestStated((alexaEvent) => {});
+
+ // This handler will catch all errors generated when trying to make transitions in the stateMachine, this could include errors in the state machine controllers
+ skill.onStateMachineError((alexaEvent, reply, error) =>
+ // it gets the current reply, which could be incomplete due to an error.
+ new Reply(alexaEvent, { tell: 'An error in the controllers code' }).write(),
+ );
+
+ // This is the more general handler and will catch all unhandled errors in the framework
+ skill.onError((alexaEvent, error) =>
+ new Reply(alexaEvent, { tell: 'An unrecoverable error occurred.' }).write(),
+ );
+
+ // This event is triggered before every time the user response to an Alexa event...
+ // and it have two parameters, alexaEvent and the reply controller.
+ skill.onBeforeReplySent((alexaEvent, reply) => { });
+ // Launch intent example
skill.onIntent('LaunchIntent', () => ({ reply: 'Intent.Launch', to: 'entry' }));
+ // AMAMAZON Build-in Help Intent example
skill.onIntent('AMAZON.HelpIntent', () => ({ reply: 'Intent.Help', to: 'die' }));
}; | 25 | 4.166667 | 25 | 0 |
00f1924256a62b65b7481584b437f34867443505 | KIBANA.md | KIBANA.md |
Folder **kibana** contains sample Kibana objects for quick start.
## Installation
Installation is the same as for all [dashboards](https://github.com/elastic/beats-dashboards) from official beats. Download [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) and place to folder **kibana**. To load the dashboards, execute the [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) pointing to the Elasticsearch HTTP URL:
```bash
cd ~/workspace/go/src/github.com/radoondas/elasticbeat/kibana
# get the content of the file [import_dashboards.sh](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.sh) and save on the disk
chmod u+x load.sh
./import_dashboards.sh -url http://localhost:9200
```
Note: Windows script is located here as [import_dashboards.ps1](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.ps1)
If you want to use HTTP authentication for Elasticsearch, you can specify the credentials as a second parameter:
```bash
./import_dashboards.sh -url http://localhost:9200 -user 'admin:password'
```
For more options:
```bash
./import_dashboards.sh -h
```
## Examples


|
Folder **kibana** contains sample Kibana objects for quick start.
## Installation
Installation is the same as for all [dashboards](https://github.com/elastic/beats-dashboards) from official beats. Download [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) and place to folder **kibana**. To load the dashboards, execute the [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) pointing to the Elasticsearch HTTP URL:
```bash
cd ~/workspace/go/src/github.com/radoondas/elasticbeat/kibana
# get the content of the file [import_dashboards.sh](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.sh) and save on the disk
chmod u+x import_dashboards.sh
./import_dashboards.sh -url http://localhost:9200
```
Note: Windows script is located here as [import_dashboards.ps1](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.ps1)
If you want to use HTTP authentication for Elasticsearch, you can specify the credentials as a second parameter:
```bash
./import_dashboards.sh -url http://localhost:9200 -user 'admin:password'
```
For more options:
```bash
./import_dashboards.sh -h
```
## Examples


| Update script name in documantation | Update script name in documantation
| Markdown | apache-2.0 | radoondas/elasticbeat | markdown | ## Code Before:
Folder **kibana** contains sample Kibana objects for quick start.
## Installation
Installation is the same as for all [dashboards](https://github.com/elastic/beats-dashboards) from official beats. Download [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) and place to folder **kibana**. To load the dashboards, execute the [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) pointing to the Elasticsearch HTTP URL:
```bash
cd ~/workspace/go/src/github.com/radoondas/elasticbeat/kibana
# get the content of the file [import_dashboards.sh](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.sh) and save on the disk
chmod u+x load.sh
./import_dashboards.sh -url http://localhost:9200
```
Note: Windows script is located here as [import_dashboards.ps1](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.ps1)
If you want to use HTTP authentication for Elasticsearch, you can specify the credentials as a second parameter:
```bash
./import_dashboards.sh -url http://localhost:9200 -user 'admin:password'
```
For more options:
```bash
./import_dashboards.sh -h
```
## Examples


## Instruction:
Update script name in documantation
## Code After:
Folder **kibana** contains sample Kibana objects for quick start.
## Installation
Installation is the same as for all [dashboards](https://github.com/elastic/beats-dashboards) from official beats. Download [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) and place to folder **kibana**. To load the dashboards, execute the [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) pointing to the Elasticsearch HTTP URL:
```bash
cd ~/workspace/go/src/github.com/radoondas/elasticbeat/kibana
# get the content of the file [import_dashboards.sh](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.sh) and save on the disk
chmod u+x import_dashboards.sh
./import_dashboards.sh -url http://localhost:9200
```
Note: Windows script is located here as [import_dashboards.ps1](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.ps1)
If you want to use HTTP authentication for Elasticsearch, you can specify the credentials as a second parameter:
```bash
./import_dashboards.sh -url http://localhost:9200 -user 'admin:password'
```
For more options:
```bash
./import_dashboards.sh -h
```
## Examples


|
Folder **kibana** contains sample Kibana objects for quick start.
## Installation
Installation is the same as for all [dashboards](https://github.com/elastic/beats-dashboards) from official beats. Download [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) and place to folder **kibana**. To load the dashboards, execute the [script](https://github.com/elastic/beats-dashboards/blob/master/load.sh) pointing to the Elasticsearch HTTP URL:
```bash
cd ~/workspace/go/src/github.com/radoondas/elasticbeat/kibana
# get the content of the file [import_dashboards.sh](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.sh) and save on the disk
- chmod u+x load.sh
+ chmod u+x import_dashboards.sh
./import_dashboards.sh -url http://localhost:9200
```
Note: Windows script is located here as [import_dashboards.ps1](https://github.com/elastic/beats/blob/master/dev-tools/import_dashboards.ps1)
If you want to use HTTP authentication for Elasticsearch, you can specify the credentials as a second parameter:
```bash
./import_dashboards.sh -url http://localhost:9200 -user 'admin:password'
```
For more options:
```bash
./import_dashboards.sh -h
```
## Examples

 | 2 | 0.064516 | 1 | 1 |
9e1de3f52aaecc9532b3b3b0988a14aaf4ab713f | lib/global-admin/addon/cluster-templates/new/route.js | lib/global-admin/addon/cluster-templates/new/route.js | import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
access: service(),
clusterTemplates: service(),
model() {
return hash({
clusterTemplate: this.globalStore.createRecord({ type: 'clustertemplate', }),
clusterTemplateRevision: this.globalStore.createRecord({
name: 'first-revision',
type: 'clusterTemplateRevision',
enabled: true,
clusterConfig: this.globalStore.createRecord({
type: 'clusterSpecBase',
rancherKubernetesEngineConfig: this.globalStore.createRecord({ type: 'rancherKubernetesEngineConfig' })
})
}),
psps: this.globalStore.findAll('podSecurityPolicyTemplate'),
users: this.globalStore.findAll('user'),
});
},
afterModel(model, transition) {
if (transition.from && transition.from.name === 'global-admin.clusters.index') {
this.controllerFor(this.routeName).set('parentRoute', transition.from.name);
}
return this.clusterTemplates.fetchQuestionsSchema();
},
});
| import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
access: service(),
clusterTemplates: service(),
model() {
return hash({
clusterTemplate: this.globalStore.createRecord({ type: 'clustertemplate', }),
clusterTemplateRevision: this.globalStore.createRecord({
name: 'v1',
type: 'clusterTemplateRevision',
enabled: true,
clusterConfig: this.globalStore.createRecord({
type: 'clusterSpecBase',
rancherKubernetesEngineConfig: this.globalStore.createRecord({ type: 'rancherKubernetesEngineConfig' })
})
}),
psps: this.globalStore.findAll('podSecurityPolicyTemplate'),
users: this.globalStore.findAll('user'),
});
},
afterModel(model, transition) {
if (transition.from && transition.from.name === 'global-admin.clusters.index') {
this.controllerFor(this.routeName).set('parentRoute', transition.from.name);
}
return this.clusterTemplates.fetchQuestionsSchema();
},
});
| Change ct default revision name to v1 | Change ct default revision name to v1
https://github.com/rancher/rancher/issues/22162
| JavaScript | apache-2.0 | rancher/ui,westlywright/ui,vincent99/ui,westlywright/ui,rancher/ui,vincent99/ui,rancherio/ui,rancherio/ui,rancher/ui,westlywright/ui,vincent99/ui,rancherio/ui | javascript | ## Code Before:
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
access: service(),
clusterTemplates: service(),
model() {
return hash({
clusterTemplate: this.globalStore.createRecord({ type: 'clustertemplate', }),
clusterTemplateRevision: this.globalStore.createRecord({
name: 'first-revision',
type: 'clusterTemplateRevision',
enabled: true,
clusterConfig: this.globalStore.createRecord({
type: 'clusterSpecBase',
rancherKubernetesEngineConfig: this.globalStore.createRecord({ type: 'rancherKubernetesEngineConfig' })
})
}),
psps: this.globalStore.findAll('podSecurityPolicyTemplate'),
users: this.globalStore.findAll('user'),
});
},
afterModel(model, transition) {
if (transition.from && transition.from.name === 'global-admin.clusters.index') {
this.controllerFor(this.routeName).set('parentRoute', transition.from.name);
}
return this.clusterTemplates.fetchQuestionsSchema();
},
});
## Instruction:
Change ct default revision name to v1
https://github.com/rancher/rancher/issues/22162
## Code After:
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
access: service(),
clusterTemplates: service(),
model() {
return hash({
clusterTemplate: this.globalStore.createRecord({ type: 'clustertemplate', }),
clusterTemplateRevision: this.globalStore.createRecord({
name: 'v1',
type: 'clusterTemplateRevision',
enabled: true,
clusterConfig: this.globalStore.createRecord({
type: 'clusterSpecBase',
rancherKubernetesEngineConfig: this.globalStore.createRecord({ type: 'rancherKubernetesEngineConfig' })
})
}),
psps: this.globalStore.findAll('podSecurityPolicyTemplate'),
users: this.globalStore.findAll('user'),
});
},
afterModel(model, transition) {
if (transition.from && transition.from.name === 'global-admin.clusters.index') {
this.controllerFor(this.routeName).set('parentRoute', transition.from.name);
}
return this.clusterTemplates.fetchQuestionsSchema();
},
});
| import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default Route.extend({
globalStore: service(),
access: service(),
clusterTemplates: service(),
model() {
return hash({
clusterTemplate: this.globalStore.createRecord({ type: 'clustertemplate', }),
clusterTemplateRevision: this.globalStore.createRecord({
- name: 'first-revision',
? -------- ^^^^^
+ name: 'v1',
? ^
type: 'clusterTemplateRevision',
enabled: true,
clusterConfig: this.globalStore.createRecord({
type: 'clusterSpecBase',
rancherKubernetesEngineConfig: this.globalStore.createRecord({ type: 'rancherKubernetesEngineConfig' })
})
}),
psps: this.globalStore.findAll('podSecurityPolicyTemplate'),
users: this.globalStore.findAll('user'),
});
},
afterModel(model, transition) {
if (transition.from && transition.from.name === 'global-admin.clusters.index') {
this.controllerFor(this.routeName).set('parentRoute', transition.from.name);
}
return this.clusterTemplates.fetchQuestionsSchema();
},
}); | 2 | 0.058824 | 1 | 1 |
aef6e5ec04e17ec9192b96739e2f69f46781e4f7 | circle.yml | circle.yml | machine:
node:
version: 4.3.1
dependencies:
post:
- npm install -g gulp-cli && gulp build
test:
override:
- npm run lint
general:
artifacts:
- "build"
- "data"
- "index.html"
| machine:
node:
version: 4.3.1
dependencies:
post:
- npm install -g gulp-cli && gulp build
test:
override:
- npm run lint
post:
- cp -R build data index.html $CIRCLE_ARTIFACTS
| Copy build files to $CIRCLE_ARTIFACTS to unconfuse Precog | Copy build files to $CIRCLE_ARTIFACTS to unconfuse Precog
| YAML | mit | tangrams/tangram-play,tangrams/tangram-play | yaml | ## Code Before:
machine:
node:
version: 4.3.1
dependencies:
post:
- npm install -g gulp-cli && gulp build
test:
override:
- npm run lint
general:
artifacts:
- "build"
- "data"
- "index.html"
## Instruction:
Copy build files to $CIRCLE_ARTIFACTS to unconfuse Precog
## Code After:
machine:
node:
version: 4.3.1
dependencies:
post:
- npm install -g gulp-cli && gulp build
test:
override:
- npm run lint
post:
- cp -R build data index.html $CIRCLE_ARTIFACTS
| machine:
node:
version: 4.3.1
dependencies:
post:
- npm install -g gulp-cli && gulp build
test:
override:
- npm run lint
+ post:
+ - cp -R build data index.html $CIRCLE_ARTIFACTS
-
- general:
- artifacts:
- - "build"
- - "data"
- - "index.html" | 8 | 0.470588 | 2 | 6 |
67ebb3317ff6ed4a83e2364204f05c305e391da1 | public_html/php/mail-config.php | public_html/php/mail-config.php | <?php
/**
* mailer-config.php
* This file contains your reCAPTCHA keys, and your recipients email addresses.
*
* @param string $siteKey your public reCAPTCHA API key
* @param string $secret your secret reCAPTCHA API key
* @param array $MAIL_RECIPIENTS array of email addresses and corresponding recipient names to send form responses to
*
* This file has been gitignored!
**/
// your Google reCAPTCHA keys here
$siteKey = '6Lce7iETAAAAAMMOWyA_2wlnlnRZ5tIXtobpYm74';
$secret = '6Lce7iETAAAAABVAWZ8MxXA2vSLD6DCxmzNmIZGF';
/**
* attach the recipients to the message
* notice this an array that can include or omit the the recipient's real name
* use the recipients' real name where possible; this reduces the probability of the Email being marked as spam
**/
$MAIL_RECIPIENTS = ["jordanv215@gmail.com" => "Jordan Vinson"]; | <?php
/**
* mailer-config.php
* This file contains your reCAPTCHA keys, and your recipients email addresses.
*
* @param string $siteKey your public reCAPTCHA API key
* @param string $secret your secret reCAPTCHA API key
* @param array $MAIL_RECIPIENTS array of email addresses and corresponding recipient names to send form responses to
*
* This file has been gitignored!
**/
// your Google reCAPTCHA keys here
$siteKey = '6Lce7iETAAAAAMMOWyA_2wlnlnRZ5tIXtobpYm74';
$secret = '6Lce7iETAAAAABVAWZ8MxXA2vSLD6DCxmzNmIZGF';
/**
* attach the recipients to the message
* notice this an array that can include or omit the the recipient's real name
* use the recipients' real name where possible; this reduces the probability of the Email being marked as spam
**/
$MAIL_RECIPIENTS = ["jordanv215@gmail.com" => "Jordan Vinson"];
// comment for test push
| Test commit for bootcamp ssh | Test commit for bootcamp ssh
| PHP | apache-2.0 | jordanv215/moparvinson-jordanpwp,jordanv215/moparvinson-jordanpwp | php | ## Code Before:
<?php
/**
* mailer-config.php
* This file contains your reCAPTCHA keys, and your recipients email addresses.
*
* @param string $siteKey your public reCAPTCHA API key
* @param string $secret your secret reCAPTCHA API key
* @param array $MAIL_RECIPIENTS array of email addresses and corresponding recipient names to send form responses to
*
* This file has been gitignored!
**/
// your Google reCAPTCHA keys here
$siteKey = '6Lce7iETAAAAAMMOWyA_2wlnlnRZ5tIXtobpYm74';
$secret = '6Lce7iETAAAAABVAWZ8MxXA2vSLD6DCxmzNmIZGF';
/**
* attach the recipients to the message
* notice this an array that can include or omit the the recipient's real name
* use the recipients' real name where possible; this reduces the probability of the Email being marked as spam
**/
$MAIL_RECIPIENTS = ["jordanv215@gmail.com" => "Jordan Vinson"];
## Instruction:
Test commit for bootcamp ssh
## Code After:
<?php
/**
* mailer-config.php
* This file contains your reCAPTCHA keys, and your recipients email addresses.
*
* @param string $siteKey your public reCAPTCHA API key
* @param string $secret your secret reCAPTCHA API key
* @param array $MAIL_RECIPIENTS array of email addresses and corresponding recipient names to send form responses to
*
* This file has been gitignored!
**/
// your Google reCAPTCHA keys here
$siteKey = '6Lce7iETAAAAAMMOWyA_2wlnlnRZ5tIXtobpYm74';
$secret = '6Lce7iETAAAAABVAWZ8MxXA2vSLD6DCxmzNmIZGF';
/**
* attach the recipients to the message
* notice this an array that can include or omit the the recipient's real name
* use the recipients' real name where possible; this reduces the probability of the Email being marked as spam
**/
$MAIL_RECIPIENTS = ["jordanv215@gmail.com" => "Jordan Vinson"];
// comment for test push
| <?php
/**
* mailer-config.php
* This file contains your reCAPTCHA keys, and your recipients email addresses.
*
* @param string $siteKey your public reCAPTCHA API key
* @param string $secret your secret reCAPTCHA API key
* @param array $MAIL_RECIPIENTS array of email addresses and corresponding recipient names to send form responses to
*
* This file has been gitignored!
**/
// your Google reCAPTCHA keys here
$siteKey = '6Lce7iETAAAAAMMOWyA_2wlnlnRZ5tIXtobpYm74';
$secret = '6Lce7iETAAAAABVAWZ8MxXA2vSLD6DCxmzNmIZGF';
/**
* attach the recipients to the message
* notice this an array that can include or omit the the recipient's real name
* use the recipients' real name where possible; this reduces the probability of the Email being marked as spam
**/
$MAIL_RECIPIENTS = ["jordanv215@gmail.com" => "Jordan Vinson"];
+
+
+ // comment for test push | 3 | 0.130435 | 3 | 0 |
2c5995ac2c8fd79d007d8a30e8e58e836f0d121b | application/src/main.php | application/src/main.php | <?php
include '/data/vendor/autoload.php';
use Sil\PhpEnv\Env;
use Sil\PhpEnv\EnvVarNotFoundException;
try {
$result1 = Env::get('COMPOSER_AUTH', 'LDV: something is wrong!');
echo $result1 . PHP_EOL;
$result2 = Env::get('LDV', 'LDV: default value!');
echo $result2 . PHP_EOL;
$result3 = Env::requireEnv('LDV');
echo $result3 . PHP_EOL;
} catch (EnvVarNotFoundException $exc) {
echo $exc->getMessage() . PHP_EOL;
echo $exc->getTraceAsString() . PHP_EOL;
}
| <?php
include '/data/vendor/autoload.php';
use Sil\PhpEnv\Env;
use Sil\PhpEnv\EnvVarNotFoundException;
try {
$result1 = Env::get('COMPOSER_AUTH', 'LDV: something is wrong!');
echo $result1 . PHP_EOL;
$result2 = Env::get('LDV', 'LDV: default value!');
echo $result2 . PHP_EOL;
$result3 = Env::requireEnv('LDV');
echo $result3 . PHP_EOL;
} catch (EnvVarNotFoundException $exc) {
echo $exc->getMessage() . PHP_EOL;
echo $exc->getTraceAsString() . PHP_EOL;
}
echo '-------------------------------' . PHP_EOL;
echo '__DIR__=' . __DIR__ . PHP_EOL;
echo 'dirname=' . dirname(__DIR__) . PHP_EOL;
echo 'basename=' . basename(__DIR__) . PHP_EOL;
echo 'pathinfo:' . PHP_EOL;
var_dump(pathinfo(__DIR__));
echo 'pathinfo:' . PHP_EOL;
var_dump((pathinfo(__FILE__)));
| Test dirname(), basename(), pathinfo() functions. | Test dirname(), basename(), pathinfo() functions.
| PHP | mit | lvail/use-silphpenv | php | ## Code Before:
<?php
include '/data/vendor/autoload.php';
use Sil\PhpEnv\Env;
use Sil\PhpEnv\EnvVarNotFoundException;
try {
$result1 = Env::get('COMPOSER_AUTH', 'LDV: something is wrong!');
echo $result1 . PHP_EOL;
$result2 = Env::get('LDV', 'LDV: default value!');
echo $result2 . PHP_EOL;
$result3 = Env::requireEnv('LDV');
echo $result3 . PHP_EOL;
} catch (EnvVarNotFoundException $exc) {
echo $exc->getMessage() . PHP_EOL;
echo $exc->getTraceAsString() . PHP_EOL;
}
## Instruction:
Test dirname(), basename(), pathinfo() functions.
## Code After:
<?php
include '/data/vendor/autoload.php';
use Sil\PhpEnv\Env;
use Sil\PhpEnv\EnvVarNotFoundException;
try {
$result1 = Env::get('COMPOSER_AUTH', 'LDV: something is wrong!');
echo $result1 . PHP_EOL;
$result2 = Env::get('LDV', 'LDV: default value!');
echo $result2 . PHP_EOL;
$result3 = Env::requireEnv('LDV');
echo $result3 . PHP_EOL;
} catch (EnvVarNotFoundException $exc) {
echo $exc->getMessage() . PHP_EOL;
echo $exc->getTraceAsString() . PHP_EOL;
}
echo '-------------------------------' . PHP_EOL;
echo '__DIR__=' . __DIR__ . PHP_EOL;
echo 'dirname=' . dirname(__DIR__) . PHP_EOL;
echo 'basename=' . basename(__DIR__) . PHP_EOL;
echo 'pathinfo:' . PHP_EOL;
var_dump(pathinfo(__DIR__));
echo 'pathinfo:' . PHP_EOL;
var_dump((pathinfo(__FILE__)));
| <?php
include '/data/vendor/autoload.php';
use Sil\PhpEnv\Env;
use Sil\PhpEnv\EnvVarNotFoundException;
try {
$result1 = Env::get('COMPOSER_AUTH', 'LDV: something is wrong!');
echo $result1 . PHP_EOL;
$result2 = Env::get('LDV', 'LDV: default value!');
echo $result2 . PHP_EOL;
$result3 = Env::requireEnv('LDV');
echo $result3 . PHP_EOL;
} catch (EnvVarNotFoundException $exc) {
echo $exc->getMessage() . PHP_EOL;
echo $exc->getTraceAsString() . PHP_EOL;
}
+ echo '-------------------------------' . PHP_EOL;
+ echo '__DIR__=' . __DIR__ . PHP_EOL;
+ echo 'dirname=' . dirname(__DIR__) . PHP_EOL;
+ echo 'basename=' . basename(__DIR__) . PHP_EOL;
+ echo 'pathinfo:' . PHP_EOL;
+ var_dump(pathinfo(__DIR__));
+ echo 'pathinfo:' . PHP_EOL;
+ var_dump((pathinfo(__FILE__)));
+ | 9 | 0.428571 | 9 | 0 |
32480a30114ed967058490d19f081080e3609ece | app/scripts/components/quotas/filters.js | app/scripts/components/quotas/filters.js | // @ngInject
export function quotaName($filter) {
var names = {
floating_ip_count: gettext('Floating IP count'),
vcpu: gettext('vCPU count'),
ram: gettext('RAM'),
storage: gettext('Storage'),
vm_count: gettext('Virtual machines count'),
instances: gettext('Instances count'),
volumes: gettext('Volumes count'),
snapshots: gettext('Snapshots count'),
cost: gettext('Monthly cost'),
};
return function(name) {
if (names[name]) {
return names[name];
}
name = name.replace(/_/g, ' ');
return $filter('titleCase')(name);
};
}
// @ngInject
export function quotaValue($filter) {
var filters = {
ram: 'filesize',
storage: 'filesize',
backup_storage: 'filesize',
cost: 'defaultCurrency',
};
return function(value, name) {
if (value == -1) {
return '∞';
}
var filter = filters[name];
if (filter) {
return $filter(filter)(value);
} else {
return value;
}
};
}
| // @ngInject
export function quotaName($filter) {
var names = {
floating_ip_count: gettext('Floating IP count'),
vcpu: gettext('vCPU count'),
ram: gettext('RAM'),
storage: gettext('Storage'),
vm_count: gettext('Virtual machines count'),
instances: gettext('Instances count'),
volumes: gettext('Volumes count'),
snapshots: gettext('Snapshots count'),
cost: gettext('Monthly cost'),
};
return function(name) {
if (names[name]) {
return names[name];
}
name = name.replace(/_/g, ' ');
return $filter('titleCase')(name);
};
}
// @ngInject
export function quotaValue($filter) {
var filters = {
ram: 'filesize',
storage: 'filesize',
volumes_size: 'filesize',
snapshots_size: 'filesize',
backup_storage: 'filesize',
cost: 'defaultCurrency',
};
return function(value, name) {
if (value == -1) {
return '∞';
}
var filter = filters[name];
if (filter) {
return $filter(filter)(value);
} else {
return value;
}
};
}
| Format volume and snapshot size quota using filesize filter [WAL-813]. | Format volume and snapshot size quota using filesize filter [WAL-813].
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | javascript | ## Code Before:
// @ngInject
export function quotaName($filter) {
var names = {
floating_ip_count: gettext('Floating IP count'),
vcpu: gettext('vCPU count'),
ram: gettext('RAM'),
storage: gettext('Storage'),
vm_count: gettext('Virtual machines count'),
instances: gettext('Instances count'),
volumes: gettext('Volumes count'),
snapshots: gettext('Snapshots count'),
cost: gettext('Monthly cost'),
};
return function(name) {
if (names[name]) {
return names[name];
}
name = name.replace(/_/g, ' ');
return $filter('titleCase')(name);
};
}
// @ngInject
export function quotaValue($filter) {
var filters = {
ram: 'filesize',
storage: 'filesize',
backup_storage: 'filesize',
cost: 'defaultCurrency',
};
return function(value, name) {
if (value == -1) {
return '∞';
}
var filter = filters[name];
if (filter) {
return $filter(filter)(value);
} else {
return value;
}
};
}
## Instruction:
Format volume and snapshot size quota using filesize filter [WAL-813].
## Code After:
// @ngInject
export function quotaName($filter) {
var names = {
floating_ip_count: gettext('Floating IP count'),
vcpu: gettext('vCPU count'),
ram: gettext('RAM'),
storage: gettext('Storage'),
vm_count: gettext('Virtual machines count'),
instances: gettext('Instances count'),
volumes: gettext('Volumes count'),
snapshots: gettext('Snapshots count'),
cost: gettext('Monthly cost'),
};
return function(name) {
if (names[name]) {
return names[name];
}
name = name.replace(/_/g, ' ');
return $filter('titleCase')(name);
};
}
// @ngInject
export function quotaValue($filter) {
var filters = {
ram: 'filesize',
storage: 'filesize',
volumes_size: 'filesize',
snapshots_size: 'filesize',
backup_storage: 'filesize',
cost: 'defaultCurrency',
};
return function(value, name) {
if (value == -1) {
return '∞';
}
var filter = filters[name];
if (filter) {
return $filter(filter)(value);
} else {
return value;
}
};
}
| // @ngInject
export function quotaName($filter) {
var names = {
floating_ip_count: gettext('Floating IP count'),
vcpu: gettext('vCPU count'),
ram: gettext('RAM'),
storage: gettext('Storage'),
vm_count: gettext('Virtual machines count'),
instances: gettext('Instances count'),
volumes: gettext('Volumes count'),
snapshots: gettext('Snapshots count'),
cost: gettext('Monthly cost'),
};
return function(name) {
if (names[name]) {
return names[name];
}
name = name.replace(/_/g, ' ');
return $filter('titleCase')(name);
};
}
// @ngInject
export function quotaValue($filter) {
var filters = {
ram: 'filesize',
storage: 'filesize',
+ volumes_size: 'filesize',
+ snapshots_size: 'filesize',
backup_storage: 'filesize',
cost: 'defaultCurrency',
};
return function(value, name) {
if (value == -1) {
return '∞';
}
var filter = filters[name];
if (filter) {
return $filter(filter)(value);
} else {
return value;
}
};
} | 2 | 0.047619 | 2 | 0 |
4e2917d13041b6e6df8caf78fdb48f820a838263 | cities-and-suburbs/index.php | cities-and-suburbs/index.php | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cities & Suburbs</title>
</head>
<body>
<h1>Cities and Suburbs</h1>
<select name="city" id="city">
<option>Please select a city...</option>
<?php
// Connect to database
$dbc = new mysqli('localhost', 'root', '', 'ajax_cities_suburbs');
// Prepare SQL
$sql = "SELECT cityName, cityID
FROM cities";
// Run the SQL
$result = $dbc->query($sql);
// Loop through results
while( $city = $result->fetch_assoc() ) {
echo '<option value="'.$city['cityID'].'">';
echo $city['cityName'];
echo '</option>';
}
?>
</select>
</body>
</html> | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cities & Suburbs</title>
</head>
<body>
<h1>Cities and Suburbs</h1>
<select name="city" id="city">
<option>Please select a city...</option>
<?php
// Connect to database
$dbc = new mysqli('localhost', 'root', '', 'ajax_cities_suburbs');
// Prepare SQL
$sql = "SELECT cityName, cityID
FROM cities";
// Run the SQL
$result = $dbc->query($sql);
// Loop through results
while( $city = $result->fetch_assoc() ) : ?>
<option value="<?= $city['cityID']; ?>">
<?= $city['cityName']; ?>
</option>
<?php endwhile;
?>
</select>
</body>
</html> | Update to alternative syntax just because... | Update to alternative syntax just because...
| PHP | mit | sampanganiban/ajax,claudefoley/ajax,claudefoley/ajax,KeakOne/ajax,sampanganiban/ajax,claudefoley/ajax,sampanganiban/ajax,KeakOne/ajax,KeakOne/ajax | php | ## Code Before:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cities & Suburbs</title>
</head>
<body>
<h1>Cities and Suburbs</h1>
<select name="city" id="city">
<option>Please select a city...</option>
<?php
// Connect to database
$dbc = new mysqli('localhost', 'root', '', 'ajax_cities_suburbs');
// Prepare SQL
$sql = "SELECT cityName, cityID
FROM cities";
// Run the SQL
$result = $dbc->query($sql);
// Loop through results
while( $city = $result->fetch_assoc() ) {
echo '<option value="'.$city['cityID'].'">';
echo $city['cityName'];
echo '</option>';
}
?>
</select>
</body>
</html>
## Instruction:
Update to alternative syntax just because...
## Code After:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cities & Suburbs</title>
</head>
<body>
<h1>Cities and Suburbs</h1>
<select name="city" id="city">
<option>Please select a city...</option>
<?php
// Connect to database
$dbc = new mysqli('localhost', 'root', '', 'ajax_cities_suburbs');
// Prepare SQL
$sql = "SELECT cityName, cityID
FROM cities";
// Run the SQL
$result = $dbc->query($sql);
// Loop through results
while( $city = $result->fetch_assoc() ) : ?>
<option value="<?= $city['cityID']; ?>">
<?= $city['cityName']; ?>
</option>
<?php endwhile;
?>
</select>
</body>
</html> | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cities & Suburbs</title>
</head>
<body>
<h1>Cities and Suburbs</h1>
<select name="city" id="city">
<option>Please select a city...</option>
<?php
// Connect to database
$dbc = new mysqli('localhost', 'root', '', 'ajax_cities_suburbs');
// Prepare SQL
$sql = "SELECT cityName, cityID
FROM cities";
// Run the SQL
$result = $dbc->query($sql);
// Loop through results
- while( $city = $result->fetch_assoc() ) {
? ^
+ while( $city = $result->fetch_assoc() ) : ?>
? ^^^^
+
- echo '<option value="'.$city['cityID'].'">';
? ------ ^^ ^^ --
+ <option value="<?= $city['cityID']; ?>">
? ^^^^ ^^^^
- echo $city['cityName'];
? ^^^^
+ <?= $city['cityName']; ?>
? ^^^ +++
- echo '</option>';
? ------ --
+ </option>
- }
+
+ <?php endwhile;
?>
</select>
</body>
</html> | 12 | 0.342857 | 7 | 5 |
ceaa561a408168291fc06ef02ff6801338d178da | static/js/irc.js | static/js/irc.js | // irc.js
//
// Defines helper functions for working with IRC messages in Javascript.
var irc = (function(window){
var my = {};
// The regex used to parse IRC messages. I swear, it works.
my.IRCRegex = /^(?:\:(\S+) )?(\S+)(?: ([^:]+))?(?: :(.*))?$/;
// parseIRCMsg takes an IRC message and returns an object with four fields:
// the prefix, the command, the parameters, and the trailing section. These
// fields are named "prefix", "command", "params" and "trailing". Only the
// "command" field is mandatory: the others may be set to undefined.
my.parseIRCMsg = function(msg){
msg = msg.trim();
var parsed = my.IRCRegex.exec(msg);
if (!parsed) return null;
else return {
prefix: parsed[1],
command: parsed[2],
params: parsed[3],
trailing: parsed[4]
};
};
return my;
})(window);
| // irc.js
//
// Defines helper functions for working with IRC messages in Javascript.
var irc = (function(window){
var my = {};
// The regex used to parse IRC messages. I swear, it works.
my.IRCRegex = /^(?:\:(\S+) )?(\S+)(?: ([^:]+))?(?: :(.*))?$/;
// parseIRCMsg takes an IRC message and returns an object with four fields:
// the prefix, the command, the parameters, and the trailing section. These
// fields are named "prefix", "command", "params" and "trailing". Only the
// "command" field is mandatory: the others may be set to undefined.
my.parseIRCMsg = function(msg){
msg = msg.trim();
var parsed = my.IRCRegex.exec(msg);
if (!parsed) return null;
else return {
prefix: parsed[1],
command: parsed[2],
params: parsed[3],
trailing: parsed[4]
};
};
// Serializes an object representing a Javascript object to a string.
// Right now this is gloriously inefficient. Suck it up, we'll fix it
// later.
my.serializeIRCMsg = function(msgobj) {
var out = "";
if (msgobj.prefix) {
out += ":" + msgobj.prefix + " ";
}
out += msgobj.command;
if (msgobj.params) {
out += " " + msgobj.params;
}
if (msgobj.trailing) {
out += " :" + msgobj.trailing;
}
out += "\r\n";
return out;
};
return my;
})(window);
| Add serializeIRCMsg function to IRC module. | Add serializeIRCMsg function to IRC module.
| JavaScript | mit | Lukasa/pyrc,Lukasa/pyrc | javascript | ## Code Before:
// irc.js
//
// Defines helper functions for working with IRC messages in Javascript.
var irc = (function(window){
var my = {};
// The regex used to parse IRC messages. I swear, it works.
my.IRCRegex = /^(?:\:(\S+) )?(\S+)(?: ([^:]+))?(?: :(.*))?$/;
// parseIRCMsg takes an IRC message and returns an object with four fields:
// the prefix, the command, the parameters, and the trailing section. These
// fields are named "prefix", "command", "params" and "trailing". Only the
// "command" field is mandatory: the others may be set to undefined.
my.parseIRCMsg = function(msg){
msg = msg.trim();
var parsed = my.IRCRegex.exec(msg);
if (!parsed) return null;
else return {
prefix: parsed[1],
command: parsed[2],
params: parsed[3],
trailing: parsed[4]
};
};
return my;
})(window);
## Instruction:
Add serializeIRCMsg function to IRC module.
## Code After:
// irc.js
//
// Defines helper functions for working with IRC messages in Javascript.
var irc = (function(window){
var my = {};
// The regex used to parse IRC messages. I swear, it works.
my.IRCRegex = /^(?:\:(\S+) )?(\S+)(?: ([^:]+))?(?: :(.*))?$/;
// parseIRCMsg takes an IRC message and returns an object with four fields:
// the prefix, the command, the parameters, and the trailing section. These
// fields are named "prefix", "command", "params" and "trailing". Only the
// "command" field is mandatory: the others may be set to undefined.
my.parseIRCMsg = function(msg){
msg = msg.trim();
var parsed = my.IRCRegex.exec(msg);
if (!parsed) return null;
else return {
prefix: parsed[1],
command: parsed[2],
params: parsed[3],
trailing: parsed[4]
};
};
// Serializes an object representing a Javascript object to a string.
// Right now this is gloriously inefficient. Suck it up, we'll fix it
// later.
my.serializeIRCMsg = function(msgobj) {
var out = "";
if (msgobj.prefix) {
out += ":" + msgobj.prefix + " ";
}
out += msgobj.command;
if (msgobj.params) {
out += " " + msgobj.params;
}
if (msgobj.trailing) {
out += " :" + msgobj.trailing;
}
out += "\r\n";
return out;
};
return my;
})(window);
| // irc.js
//
// Defines helper functions for working with IRC messages in Javascript.
var irc = (function(window){
var my = {};
// The regex used to parse IRC messages. I swear, it works.
my.IRCRegex = /^(?:\:(\S+) )?(\S+)(?: ([^:]+))?(?: :(.*))?$/;
// parseIRCMsg takes an IRC message and returns an object with four fields:
// the prefix, the command, the parameters, and the trailing section. These
// fields are named "prefix", "command", "params" and "trailing". Only the
// "command" field is mandatory: the others may be set to undefined.
my.parseIRCMsg = function(msg){
msg = msg.trim();
var parsed = my.IRCRegex.exec(msg);
if (!parsed) return null;
else return {
prefix: parsed[1],
command: parsed[2],
params: parsed[3],
trailing: parsed[4]
};
};
+ // Serializes an object representing a Javascript object to a string.
+ // Right now this is gloriously inefficient. Suck it up, we'll fix it
+ // later.
+ my.serializeIRCMsg = function(msgobj) {
+ var out = "";
+
+ if (msgobj.prefix) {
+ out += ":" + msgobj.prefix + " ";
+ }
+
+ out += msgobj.command;
+
+ if (msgobj.params) {
+ out += " " + msgobj.params;
+ }
+
+ if (msgobj.trailing) {
+ out += " :" + msgobj.trailing;
+ }
+
+ out += "\r\n";
+
+ return out;
+ };
+
return my;
})(window); | 25 | 0.925926 | 25 | 0 |
cc4e3fbd22750aa5b51b4dfe485e4323c2ee2e0c | kotori/PreferencesWindowController.swift | kotori/PreferencesWindowController.swift | import Cocoa
class PreferencesWindowController: NSWindowController {
static let sharedInstance: PreferencesWindowController = PreferencesWindowController(windowNibName: "Preferences")
}
| import Cocoa
class PreferencesWindowController: NSWindowController {
static let shared = PreferencesWindowController(windowNibName: "Preferences")
}
| Use shared instead of sharedInstance | Use shared instead of sharedInstance
| Swift | mit | Watson1978/kotori,Watson1978/kotori,Watson1978/kotori,Watson1978/kotori | swift | ## Code Before:
import Cocoa
class PreferencesWindowController: NSWindowController {
static let sharedInstance: PreferencesWindowController = PreferencesWindowController(windowNibName: "Preferences")
}
## Instruction:
Use shared instead of sharedInstance
## Code After:
import Cocoa
class PreferencesWindowController: NSWindowController {
static let shared = PreferencesWindowController(windowNibName: "Preferences")
}
| import Cocoa
class PreferencesWindowController: NSWindowController {
- static let sharedInstance: PreferencesWindowController = PreferencesWindowController(windowNibName: "Preferences")
? -------------------------------------
+ static let shared = PreferencesWindowController(windowNibName: "Preferences")
} | 2 | 0.4 | 1 | 1 |
70d435e1176a1132db6a04c34c04567df354d1d9 | cla_backend/apps/reports/management/commands/mi_cb1_report.py | cla_backend/apps/reports/management/commands/mi_cb1_report.py | import logging
from django.core.management.base import BaseCommand
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "This runs the MCCB1sSLA report"
def handle(self, *args, **options):
self.create_report()
def create_report():
print("stuff goes here")
# '{"action": "Export", "csrfmiddlewaretoken": "PQk4Pt55CL0NBapx9hSqZTJkSn6tL6TL", "date_from": "08/05/2021", "date_to": "10/05/2021"}'
# report_data = json_stuff_goes_here
# ExportTask().delay(user_person.pk, filename_of_report, mi_cb1_extract_agilisys, report_data)
| import logging
from django.core.management.base import BaseCommand
from reports.tasks import ExportTask
from core.models import get_web_user
from django.views.decorators.csrf import csrf_exempt
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "This runs the MCCB1sSLA report"
def handle(self, *args, **options):
self.create_report()
@csrf_exempt
def create_report(self):
report_data = '{"action": "Export", "csrfmiddlewaretoken": "PQk4Pt55CL0NBapx9hSqZTJkSn6tL6TL", "date_from": "2021-05-08", "date_to": "2021-05-10"}'
# report_data = json_stuff_goes_here
web_user = get_web_user()
filename_of_report = "WEEKLY-REPORT-TEST.csv"
ExportTask().delay(web_user.pk, filename_of_report, "MICB1Extract", report_data)
| Send weekly report to aws | Send weekly report to aws
| Python | mit | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | python | ## Code Before:
import logging
from django.core.management.base import BaseCommand
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "This runs the MCCB1sSLA report"
def handle(self, *args, **options):
self.create_report()
def create_report():
print("stuff goes here")
# '{"action": "Export", "csrfmiddlewaretoken": "PQk4Pt55CL0NBapx9hSqZTJkSn6tL6TL", "date_from": "08/05/2021", "date_to": "10/05/2021"}'
# report_data = json_stuff_goes_here
# ExportTask().delay(user_person.pk, filename_of_report, mi_cb1_extract_agilisys, report_data)
## Instruction:
Send weekly report to aws
## Code After:
import logging
from django.core.management.base import BaseCommand
from reports.tasks import ExportTask
from core.models import get_web_user
from django.views.decorators.csrf import csrf_exempt
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "This runs the MCCB1sSLA report"
def handle(self, *args, **options):
self.create_report()
@csrf_exempt
def create_report(self):
report_data = '{"action": "Export", "csrfmiddlewaretoken": "PQk4Pt55CL0NBapx9hSqZTJkSn6tL6TL", "date_from": "2021-05-08", "date_to": "2021-05-10"}'
# report_data = json_stuff_goes_here
web_user = get_web_user()
filename_of_report = "WEEKLY-REPORT-TEST.csv"
ExportTask().delay(web_user.pk, filename_of_report, "MICB1Extract", report_data)
| import logging
from django.core.management.base import BaseCommand
-
+ from reports.tasks import ExportTask
+ from core.models import get_web_user
+ from django.views.decorators.csrf import csrf_exempt
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "This runs the MCCB1sSLA report"
def handle(self, *args, **options):
self.create_report()
+ @csrf_exempt
- def create_report():
+ def create_report(self):
? ++++
- print("stuff goes here")
-
- # '{"action": "Export", "csrfmiddlewaretoken": "PQk4Pt55CL0NBapx9hSqZTJkSn6tL6TL", "date_from": "08/05/2021", "date_to": "10/05/2021"}'
? ^ ------ ------
+ report_data = '{"action": "Export", "csrfmiddlewaretoken": "PQk4Pt55CL0NBapx9hSqZTJkSn6tL6TL", "date_from": "2021-05-08", "date_to": "2021-05-10"}'
? ^^^^^^^^^^^^^ ++++++ ++++++
# report_data = json_stuff_goes_here
+ web_user = get_web_user()
+ filename_of_report = "WEEKLY-REPORT-TEST.csv"
- # ExportTask().delay(user_person.pk, filename_of_report, mi_cb1_extract_agilisys, report_data)
? ---------- ------- ^^^^^ ^^ ^^^^^^^^^
+ ExportTask().delay(web_user.pk, filename_of_report, "MICB1Extract", report_data)
? ++++ ^^^^^ ^ ^
| 15 | 0.75 | 9 | 6 |
349082e38ebf57e3f4caf364963ea4434ce9d3cf | readme.txt | readme.txt | === AVH RPS Competition ===
Contributors: petervanderdoes
Donate link: http://blog.avirtualhome.com/wordpress-plugins/
Tags:
Requires at least: 3.4
Tested up to: 3.4.1
Stable tag: 1.3.1
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
== Description ==
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
= Features =
== Installation ==
It comes installed on the site
== Frequently Asked Questions ==
None
== Screenshots ==
None
== Changelog ==
= Version 1.4.0-dev.1 =
* Preparation for new development cycle.
= Version 1.3.1 =
* Preparation for new development cycle.
= Version 1.3.0 =
* Remove AVH Framework from plugin.
AVH Framework has been created as a seperate plugin.
* Bugfix: New users don't see any competitions.
= Version 1.2.7 =
* Bugfix: Methods not found
= Version 1.2.2 =
* Enhancement: Close competitions when needed.
= Version 1.2.1 =
* Bugfix: Competitions show up in duplicates
= Version 1.2.0 =
* When a member has two different classifications the submission form is wrong.
= Version 1.0.0 =
* Initial version | === AVH RPS Competition ===
Contributors: petervanderdoes
Donate link: http://blog.avirtualhome.com/wordpress-plugins/
Tags:
Requires at least: 3.4
Tested up to: 3.4.1
Stable tag: 1.3.1
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
== Description ==
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
= Features =
== Installation ==
It comes installed on the site
== Frequently Asked Questions ==
None
== Screenshots ==
None
== Changelog ==
= Version 1.4.0-dev.1 =
* Show closing date at competition list.
* Remove unnecessary CSS classes
* Removes unnecessary redirect.
* Clean up code to remove PHP notices.
= Version 1.3.1 =
* Preparation for new development cycle.
= Version 1.3.0 =
* Remove AVH Framework from plugin.
AVH Framework has been created as a seperate plugin.
* Bugfix: New users don't see any competitions.
= Version 1.2.7 =
* Bugfix: Methods not found
= Version 1.2.2 =
* Enhancement: Close competitions when needed.
= Version 1.2.1 =
* Bugfix: Competitions show up in duplicates
= Version 1.2.0 =
* When a member has two different classifications the submission form is wrong.
= Version 1.0.0 =
* Initial version
| Update changelog with latest changes | Update changelog with latest changes
| Text | bsd-3-clause | petervanderdoes/AVH-Raritan-Photographic-Society,petervanderdoes/AVH-Raritan-Photographic-Society,petervanderdoes/AVH-Raritan-Photographic-Society,petervanderdoes/AVH-Raritan-Photographic-Society | text | ## Code Before:
=== AVH RPS Competition ===
Contributors: petervanderdoes
Donate link: http://blog.avirtualhome.com/wordpress-plugins/
Tags:
Requires at least: 3.4
Tested up to: 3.4.1
Stable tag: 1.3.1
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
== Description ==
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
= Features =
== Installation ==
It comes installed on the site
== Frequently Asked Questions ==
None
== Screenshots ==
None
== Changelog ==
= Version 1.4.0-dev.1 =
* Preparation for new development cycle.
= Version 1.3.1 =
* Preparation for new development cycle.
= Version 1.3.0 =
* Remove AVH Framework from plugin.
AVH Framework has been created as a seperate plugin.
* Bugfix: New users don't see any competitions.
= Version 1.2.7 =
* Bugfix: Methods not found
= Version 1.2.2 =
* Enhancement: Close competitions when needed.
= Version 1.2.1 =
* Bugfix: Competitions show up in duplicates
= Version 1.2.0 =
* When a member has two different classifications the submission form is wrong.
= Version 1.0.0 =
* Initial version
## Instruction:
Update changelog with latest changes
## Code After:
=== AVH RPS Competition ===
Contributors: petervanderdoes
Donate link: http://blog.avirtualhome.com/wordpress-plugins/
Tags:
Requires at least: 3.4
Tested up to: 3.4.1
Stable tag: 1.3.1
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
== Description ==
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
= Features =
== Installation ==
It comes installed on the site
== Frequently Asked Questions ==
None
== Screenshots ==
None
== Changelog ==
= Version 1.4.0-dev.1 =
* Show closing date at competition list.
* Remove unnecessary CSS classes
* Removes unnecessary redirect.
* Clean up code to remove PHP notices.
= Version 1.3.1 =
* Preparation for new development cycle.
= Version 1.3.0 =
* Remove AVH Framework from plugin.
AVH Framework has been created as a seperate plugin.
* Bugfix: New users don't see any competitions.
= Version 1.2.7 =
* Bugfix: Methods not found
= Version 1.2.2 =
* Enhancement: Close competitions when needed.
= Version 1.2.1 =
* Bugfix: Competitions show up in duplicates
= Version 1.2.0 =
* When a member has two different classifications the submission form is wrong.
= Version 1.0.0 =
* Initial version
| === AVH RPS Competition ===
Contributors: petervanderdoes
Donate link: http://blog.avirtualhome.com/wordpress-plugins/
Tags:
Requires at least: 3.4
Tested up to: 3.4.1
Stable tag: 1.3.1
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
== Description ==
The AVH RPS Competition plugin was written to manage the competitions of the Raritan Photographic Society.
= Features =
== Installation ==
It comes installed on the site
== Frequently Asked Questions ==
None
== Screenshots ==
None
== Changelog ==
= Version 1.4.0-dev.1 =
- * Preparation for new development cycle.
+ * Show closing date at competition list.
+ * Remove unnecessary CSS classes
+ * Removes unnecessary redirect.
+ * Clean up code to remove PHP notices.
= Version 1.3.1 =
* Preparation for new development cycle.
= Version 1.3.0 =
* Remove AVH Framework from plugin.
AVH Framework has been created as a seperate plugin.
* Bugfix: New users don't see any competitions.
= Version 1.2.7 =
* Bugfix: Methods not found
= Version 1.2.2 =
* Enhancement: Close competitions when needed.
= Version 1.2.1 =
* Bugfix: Competitions show up in duplicates
= Version 1.2.0 =
* When a member has two different classifications the submission form is wrong.
= Version 1.0.0 =
* Initial version | 5 | 0.090909 | 4 | 1 |
1d4c30f07dfce5726fd78b25234865d9ab26b4ce | client/helpers.js | client/helpers.js | UI.registerHelper("getPrettyDateAndTime", function(timestamp) {
if(timestamp)
return moment(timestamp).format('M/D/YY h:mm:ss A');
});
UI.registerHelper("getCurrentUserDisplayName", function() {
return getUserName(Meteor.user());
});
Template.expiredAlert.expired = function() {
if (this.userId == Meteor.userId()) {
if (this.createdAt < daysUntilExpiration() && this.updatedAt < daysUntilExpiration()) {
return true
} else if (this.createdAt < daysUntilExpiration()) {
return true
} else {
return false;
}
} else {
return false;
}
} | UI.registerHelper("getPrettyDateAndTime", function(timestamp) {
if(timestamp)
return moment(timestamp).format('M/D/YY h:mm:ss A');
});
UI.registerHelper("getCurrentUserDisplayName", function() {
return getUserName(Meteor.user());
});
Template.expiredAlert.expired = function() {
if (this.userId == Meteor.userId()) {
if ((this.createdAt < daysUntilExpiration()) && (this.updatedAt < daysUntilExpiration())) {
return true
} else if ((this.createdAt < daysUntilExpiration()) && (this.updatedAt == undefined)) {
return true
} else {
return false;
}
} else {
return false;
}
} | Fix Expired logic to catch Jobs never updated | Fix Expired logic to catch Jobs never updated
| JavaScript | mit | EtherCasts/wework,tizol/wework,nate-strauser/wework,EtherCasts/wework,kaoskeya/wework,chrisshayan/wework,chrisshayan/wework,inderpreetsingh/wework,nate-strauser/wework,BENSEBTI/wework,kaoskeya/wework,inderpreetsingh/wework,princesust/wework,num3a/wework,tizol/wework,princesust/wework,BENSEBTI/wework,num3a/wework | javascript | ## Code Before:
UI.registerHelper("getPrettyDateAndTime", function(timestamp) {
if(timestamp)
return moment(timestamp).format('M/D/YY h:mm:ss A');
});
UI.registerHelper("getCurrentUserDisplayName", function() {
return getUserName(Meteor.user());
});
Template.expiredAlert.expired = function() {
if (this.userId == Meteor.userId()) {
if (this.createdAt < daysUntilExpiration() && this.updatedAt < daysUntilExpiration()) {
return true
} else if (this.createdAt < daysUntilExpiration()) {
return true
} else {
return false;
}
} else {
return false;
}
}
## Instruction:
Fix Expired logic to catch Jobs never updated
## Code After:
UI.registerHelper("getPrettyDateAndTime", function(timestamp) {
if(timestamp)
return moment(timestamp).format('M/D/YY h:mm:ss A');
});
UI.registerHelper("getCurrentUserDisplayName", function() {
return getUserName(Meteor.user());
});
Template.expiredAlert.expired = function() {
if (this.userId == Meteor.userId()) {
if ((this.createdAt < daysUntilExpiration()) && (this.updatedAt < daysUntilExpiration())) {
return true
} else if ((this.createdAt < daysUntilExpiration()) && (this.updatedAt == undefined)) {
return true
} else {
return false;
}
} else {
return false;
}
} | UI.registerHelper("getPrettyDateAndTime", function(timestamp) {
if(timestamp)
return moment(timestamp).format('M/D/YY h:mm:ss A');
});
UI.registerHelper("getCurrentUserDisplayName", function() {
return getUserName(Meteor.user());
});
Template.expiredAlert.expired = function() {
if (this.userId == Meteor.userId()) {
- if (this.createdAt < daysUntilExpiration() && this.updatedAt < daysUntilExpiration()) {
+ if ((this.createdAt < daysUntilExpiration()) && (this.updatedAt < daysUntilExpiration())) {
? + + + +
return true
- } else if (this.createdAt < daysUntilExpiration()) {
+ } else if ((this.createdAt < daysUntilExpiration()) && (this.updatedAt == undefined)) {
? + ++++++++++++++++++++++++++++++++++
return true
} else {
return false;
}
} else {
return false;
}
} | 4 | 0.181818 | 2 | 2 |
df534bc1d68e309795bd7f308afa52cc60e90937 | src/main/resources/templates/lecturer/addCourse.html | src/main/resources/templates/lecturer/addCourse.html | <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns="http://www.w3.org/1999/xhtml"
layout:decorator="lecturer/index">
<body>
<main layout:fragment="main">
<div class="container">
<h3 th:text="${subject.name}">Courses</h3>
<form class="row"
th:object="${addCourseForm}"
th:action="@{addCourse(subjectId=__${subject.id}__)}"
method="post">
<div class="col s12">
<textarea class="materialize-textarea col s6"
th:field="*{course.description}"
th:placeholder="#{lecturer.addCourse.description}">
</textarea>
<div class="input-field">
<input class="col s2 right" type="number" id="studentLimits"
th:field="*{course.studentLimits}"/>
<span class="col s2 right offset-s2" for="studentLimits"
th:text="#{lecturer.addCourse.studentLimits}"></span>
</div>
</div>
<div class="col s12"></div>
<div class="col s12">
<div class="col s4" th:each="tag, status : *{activeAndInactiveTags}">
<input type="checkbox"
th:field="*{activeAndInactiveTags[__${status.index}__].active}"
th:id="'tag' + ${status.index}"/>
<label class="checkboxLabel"
th:for="'tag' + ${status.index}"
th:text="${tag.tag.name}"></label>
</div>
</div>
<div class="col s12"></div>
<div class="col s12">
<button class="btn right" type="submit" th:text="#{lecturer.addCourse.save}">Submit
</button>
</div>
</form>
</div>
</main>
</body>
</html> | <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns="http://www.w3.org/1999/xhtml"
layout:decorator="lecturer/index">
<body>
<main layout:fragment="main">
<div class="container">
<h3 th:text="${subject.name}">Courses</h3>
<form class="row"
th:object="${addCourseForm}"
th:action="@{addCourse(subjectId=__${subject.id}__)}"
method="post">
<div th:replace="lecturer/lecturerFragments:: addAndEdit"></div>
</form>
</div>
</main>
</body>
</html> | Refactor add course template to work with fragments | Refactor add course template to work with fragments
| HTML | mit | university-information-system/uis,university-information-system/uis,university-information-system/uis,university-information-system/uis | html | ## Code Before:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns="http://www.w3.org/1999/xhtml"
layout:decorator="lecturer/index">
<body>
<main layout:fragment="main">
<div class="container">
<h3 th:text="${subject.name}">Courses</h3>
<form class="row"
th:object="${addCourseForm}"
th:action="@{addCourse(subjectId=__${subject.id}__)}"
method="post">
<div class="col s12">
<textarea class="materialize-textarea col s6"
th:field="*{course.description}"
th:placeholder="#{lecturer.addCourse.description}">
</textarea>
<div class="input-field">
<input class="col s2 right" type="number" id="studentLimits"
th:field="*{course.studentLimits}"/>
<span class="col s2 right offset-s2" for="studentLimits"
th:text="#{lecturer.addCourse.studentLimits}"></span>
</div>
</div>
<div class="col s12"></div>
<div class="col s12">
<div class="col s4" th:each="tag, status : *{activeAndInactiveTags}">
<input type="checkbox"
th:field="*{activeAndInactiveTags[__${status.index}__].active}"
th:id="'tag' + ${status.index}"/>
<label class="checkboxLabel"
th:for="'tag' + ${status.index}"
th:text="${tag.tag.name}"></label>
</div>
</div>
<div class="col s12"></div>
<div class="col s12">
<button class="btn right" type="submit" th:text="#{lecturer.addCourse.save}">Submit
</button>
</div>
</form>
</div>
</main>
</body>
</html>
## Instruction:
Refactor add course template to work with fragments
## Code After:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns="http://www.w3.org/1999/xhtml"
layout:decorator="lecturer/index">
<body>
<main layout:fragment="main">
<div class="container">
<h3 th:text="${subject.name}">Courses</h3>
<form class="row"
th:object="${addCourseForm}"
th:action="@{addCourse(subjectId=__${subject.id}__)}"
method="post">
<div th:replace="lecturer/lecturerFragments:: addAndEdit"></div>
</form>
</div>
</main>
</body>
</html> | <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns="http://www.w3.org/1999/xhtml"
layout:decorator="lecturer/index">
<body>
<main layout:fragment="main">
<div class="container">
<h3 th:text="${subject.name}">Courses</h3>
<form class="row"
th:object="${addCourseForm}"
th:action="@{addCourse(subjectId=__${subject.id}__)}"
method="post">
+ <div th:replace="lecturer/lecturerFragments:: addAndEdit"></div>
- <div class="col s12">
- <textarea class="materialize-textarea col s6"
- th:field="*{course.description}"
- th:placeholder="#{lecturer.addCourse.description}">
- </textarea>
- <div class="input-field">
- <input class="col s2 right" type="number" id="studentLimits"
- th:field="*{course.studentLimits}"/>
- <span class="col s2 right offset-s2" for="studentLimits"
- th:text="#{lecturer.addCourse.studentLimits}"></span>
- </div>
- </div>
- <div class="col s12"></div>
- <div class="col s12">
- <div class="col s4" th:each="tag, status : *{activeAndInactiveTags}">
- <input type="checkbox"
- th:field="*{activeAndInactiveTags[__${status.index}__].active}"
- th:id="'tag' + ${status.index}"/>
- <label class="checkboxLabel"
- th:for="'tag' + ${status.index}"
- th:text="${tag.tag.name}"></label>
- </div>
- </div>
- <div class="col s12"></div>
-
-
- <div class="col s12">
- <button class="btn right" type="submit" th:text="#{lecturer.addCourse.save}">Submit
- </button>
-
- </div>
</form>
</div>
</main>
</body>
</html> | 32 | 0.592593 | 1 | 31 |
25cec2a87fe3e41875a3fcf1c8cfd71ec6495402 | spec/spec_helper.rb | spec/spec_helper.rb | require 'tmpdir'
require 'fileutils'
require 'vimrunner'
VIM = Vimrunner::Runner.start_gvim
VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim')
RSpec.configure do |config|
# cd into a temporary directory for every example.
config.around do |example|
original_dir = FileUtils.getwd
Dir.mktmpdir do |tmp_dir|
FileUtils.cd(tmp_dir)
example.call
end
FileUtils.cd(original_dir)
end
config.before do
VIM.command("cd #{FileUtils.getwd}")
end
config.after(:suite) do
VIM.kill
end
end
| require 'tmpdir'
require 'fileutils'
require 'vimrunner'
VIM = Vimrunner::Runner.start_gvim
VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim')
RSpec.configure do |config|
# cd into a temporary directory for every example.
config.around do |example|
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
example.call
end
end
end
config.before do
VIM.command("cd #{FileUtils.getwd}")
end
config.after(:suite) do
VIM.kill
end
end
| Use Dir.chdir to switch directories. | Use Dir.chdir to switch directories.
| Ruby | mit | mudge/runspec.vim | ruby | ## Code Before:
require 'tmpdir'
require 'fileutils'
require 'vimrunner'
VIM = Vimrunner::Runner.start_gvim
VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim')
RSpec.configure do |config|
# cd into a temporary directory for every example.
config.around do |example|
original_dir = FileUtils.getwd
Dir.mktmpdir do |tmp_dir|
FileUtils.cd(tmp_dir)
example.call
end
FileUtils.cd(original_dir)
end
config.before do
VIM.command("cd #{FileUtils.getwd}")
end
config.after(:suite) do
VIM.kill
end
end
## Instruction:
Use Dir.chdir to switch directories.
## Code After:
require 'tmpdir'
require 'fileutils'
require 'vimrunner'
VIM = Vimrunner::Runner.start_gvim
VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim')
RSpec.configure do |config|
# cd into a temporary directory for every example.
config.around do |example|
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
example.call
end
end
end
config.before do
VIM.command("cd #{FileUtils.getwd}")
end
config.after(:suite) do
VIM.kill
end
end
| require 'tmpdir'
require 'fileutils'
require 'vimrunner'
VIM = Vimrunner::Runner.start_gvim
VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim')
RSpec.configure do |config|
# cd into a temporary directory for every example.
config.around do |example|
- original_dir = FileUtils.getwd
- Dir.mktmpdir do |tmp_dir|
? ----
+ Dir.mktmpdir do |dir|
- FileUtils.cd(tmp_dir)
+ Dir.chdir(dir) do
- example.call
+ example.call
? ++
+ end
end
- FileUtils.cd(original_dir)
end
config.before do
VIM.command("cd #{FileUtils.getwd}")
end
config.after(:suite) do
VIM.kill
end
end
| 9 | 0.321429 | 4 | 5 |
0a0f4594b8f03641c978c7dc703b8ca3c007cb39 | src/main/java/com/sixt/service/framework/kafka/messaging/ProducerFactory.java | src/main/java/com/sixt/service/framework/kafka/messaging/ProducerFactory.java | /**
* Copyright 2016-2017 Sixt GmbH & Co. Autovermietung KG
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.sixt.service.framework.kafka.messaging;
import com.google.inject.Inject;
import com.sixt.service.framework.ServiceProperties;
import org.apache.kafka.clients.CommonClientConfigs;
import java.util.Properties;
public class ProducerFactory {
private final ServiceProperties serviceProperties;
@Inject
public ProducerFactory(ServiceProperties serviceProperties) {
this.serviceProperties = serviceProperties;
}
public Producer createProducer() {
String kafkaBootstrapServers = serviceProperties.getKafkaServer();
Properties kafkaProducerConfig = new Properties();
kafkaProducerConfig.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, kafkaBootstrapServers);
return new Producer(kafkaProducerConfig);
}
} | /**
* Copyright 2016-2017 Sixt GmbH & Co. Autovermietung KG
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.sixt.service.framework.kafka.messaging;
import com.google.inject.Inject;
import com.sixt.service.framework.ServiceProperties;
import org.apache.kafka.clients.CommonClientConfigs;
import org.apache.kafka.clients.producer.ProducerConfig;
import java.util.Properties;
public class ProducerFactory {
private final ServiceProperties serviceProperties;
@Inject
public ProducerFactory(ServiceProperties serviceProperties) {
this.serviceProperties = serviceProperties;
}
public Producer createProducer() {
String kafkaBootstrapServers = serviceProperties.getKafkaServer();
Properties kafkaProducerConfig = new Properties();
kafkaProducerConfig.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, kafkaBootstrapServers);
kafkaProducerConfig.put(ProducerConfig.ACKS_CONFIG, "all"); // ensure that records have been replicated to other kafka nodes
return new Producer(kafkaProducerConfig);
}
} | Set ack to all to ensure records are replicated on other kafka nodes. | Set ack to all to ensure records are replicated on other kafka nodes.
| Java | apache-2.0 | tomasulo/ja-micro,Sixt/ja-micro,Sixt/ja-micro,tomasulo/ja-micro | java | ## Code Before:
/**
* Copyright 2016-2017 Sixt GmbH & Co. Autovermietung KG
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.sixt.service.framework.kafka.messaging;
import com.google.inject.Inject;
import com.sixt.service.framework.ServiceProperties;
import org.apache.kafka.clients.CommonClientConfigs;
import java.util.Properties;
public class ProducerFactory {
private final ServiceProperties serviceProperties;
@Inject
public ProducerFactory(ServiceProperties serviceProperties) {
this.serviceProperties = serviceProperties;
}
public Producer createProducer() {
String kafkaBootstrapServers = serviceProperties.getKafkaServer();
Properties kafkaProducerConfig = new Properties();
kafkaProducerConfig.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, kafkaBootstrapServers);
return new Producer(kafkaProducerConfig);
}
}
## Instruction:
Set ack to all to ensure records are replicated on other kafka nodes.
## Code After:
/**
* Copyright 2016-2017 Sixt GmbH & Co. Autovermietung KG
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.sixt.service.framework.kafka.messaging;
import com.google.inject.Inject;
import com.sixt.service.framework.ServiceProperties;
import org.apache.kafka.clients.CommonClientConfigs;
import org.apache.kafka.clients.producer.ProducerConfig;
import java.util.Properties;
public class ProducerFactory {
private final ServiceProperties serviceProperties;
@Inject
public ProducerFactory(ServiceProperties serviceProperties) {
this.serviceProperties = serviceProperties;
}
public Producer createProducer() {
String kafkaBootstrapServers = serviceProperties.getKafkaServer();
Properties kafkaProducerConfig = new Properties();
kafkaProducerConfig.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, kafkaBootstrapServers);
kafkaProducerConfig.put(ProducerConfig.ACKS_CONFIG, "all"); // ensure that records have been replicated to other kafka nodes
return new Producer(kafkaProducerConfig);
}
} | /**
* Copyright 2016-2017 Sixt GmbH & Co. Autovermietung KG
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.sixt.service.framework.kafka.messaging;
import com.google.inject.Inject;
import com.sixt.service.framework.ServiceProperties;
import org.apache.kafka.clients.CommonClientConfigs;
+ import org.apache.kafka.clients.producer.ProducerConfig;
import java.util.Properties;
public class ProducerFactory {
private final ServiceProperties serviceProperties;
@Inject
public ProducerFactory(ServiceProperties serviceProperties) {
this.serviceProperties = serviceProperties;
}
public Producer createProducer() {
String kafkaBootstrapServers = serviceProperties.getKafkaServer();
Properties kafkaProducerConfig = new Properties();
kafkaProducerConfig.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, kafkaBootstrapServers);
+ kafkaProducerConfig.put(ProducerConfig.ACKS_CONFIG, "all"); // ensure that records have been replicated to other kafka nodes
return new Producer(kafkaProducerConfig);
}
} | 2 | 0.051282 | 2 | 0 |
52f64bd9266e7d4c839017e4d1e6e9b5bfc9d3a3 | site/_assets/site.css | site/_assets/site.css | a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
code {
background-color: #fff;
}
.navbar {
border-bottom: 1px solid #eee;
margin-bottom: 1em;
padding-bottom: 1em;
padding-top: 1em;
width: 100%;
}
.navbar ul {
list-style: none;
margin-bottom: 0;
}
.navbar li {
float: left;
margin-bottom: 0;
margin-right: 2em;
position: relative;
}
.navbar a {
color: #222;
font-size: 11px;
font-weight: 600;
letter-spacing: .2rem;
text-transform: uppercase;
}
.navbar a:hover {
color: rgb(30, 174, 219)
}
.sidebar li {
line-height: 1.2em;
}
.sidebar ul {
list-style: none;
}
| a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre > code {
white-space: pre-wrap;
}
code {
background-color: #fff;
}
.navbar {
border-bottom: 1px solid #eee;
margin-bottom: 1em;
padding-bottom: 1em;
padding-top: 1em;
width: 100%;
}
.navbar ul {
list-style: none;
margin-bottom: 0;
}
.navbar li {
float: left;
margin-bottom: 0;
margin-right: 2em;
position: relative;
}
.navbar a {
color: #222;
font-size: 11px;
font-weight: 600;
letter-spacing: .2rem;
text-transform: uppercase;
}
.navbar a:hover {
color: rgb(30, 174, 219)
}
.sidebar li {
line-height: 1.2em;
}
.sidebar ul {
list-style: none;
}
| Make relevance example word wrap | Make relevance example word wrap
| CSS | apache-2.0 | bigfix/developer.bigfix.com,briangreenery/developer.bigfix.com,bigfix/developer.bigfix.com,briangreenery/developer.bigfix.com,gearoidibm/relevance.io,bigfix/developer.bigfix.com,gearoidibm/relevance.io,briangreenery/developer.bigfix.com,gearoidibm/relevance.io | css | ## Code Before:
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
code {
background-color: #fff;
}
.navbar {
border-bottom: 1px solid #eee;
margin-bottom: 1em;
padding-bottom: 1em;
padding-top: 1em;
width: 100%;
}
.navbar ul {
list-style: none;
margin-bottom: 0;
}
.navbar li {
float: left;
margin-bottom: 0;
margin-right: 2em;
position: relative;
}
.navbar a {
color: #222;
font-size: 11px;
font-weight: 600;
letter-spacing: .2rem;
text-transform: uppercase;
}
.navbar a:hover {
color: rgb(30, 174, 219)
}
.sidebar li {
line-height: 1.2em;
}
.sidebar ul {
list-style: none;
}
## Instruction:
Make relevance example word wrap
## Code After:
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre > code {
white-space: pre-wrap;
}
code {
background-color: #fff;
}
.navbar {
border-bottom: 1px solid #eee;
margin-bottom: 1em;
padding-bottom: 1em;
padding-top: 1em;
width: 100%;
}
.navbar ul {
list-style: none;
margin-bottom: 0;
}
.navbar li {
float: left;
margin-bottom: 0;
margin-right: 2em;
position: relative;
}
.navbar a {
color: #222;
font-size: 11px;
font-weight: 600;
letter-spacing: .2rem;
text-transform: uppercase;
}
.navbar a:hover {
color: rgb(30, 174, 219)
}
.sidebar li {
line-height: 1.2em;
}
.sidebar ul {
list-style: none;
}
| a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
+ }
+
+ pre > code {
+ white-space: pre-wrap;
}
code {
background-color: #fff;
}
.navbar {
border-bottom: 1px solid #eee;
margin-bottom: 1em;
padding-bottom: 1em;
padding-top: 1em;
width: 100%;
}
.navbar ul {
list-style: none;
margin-bottom: 0;
}
.navbar li {
float: left;
margin-bottom: 0;
margin-right: 2em;
position: relative;
}
.navbar a {
color: #222;
font-size: 11px;
font-weight: 600;
letter-spacing: .2rem;
text-transform: uppercase;
}
.navbar a:hover {
color: rgb(30, 174, 219)
}
.sidebar li {
line-height: 1.2em;
}
.sidebar ul {
list-style: none;
} | 4 | 0.078431 | 4 | 0 |
89b86fb7bd7b7594c5ba4a645079e19c964e9465 | content/content/variables/type_casting_inference.md | content/content/variables/type_casting_inference.md | ---
title: Type Casting and Inference
---
# Type Casting and Inference
Nim is a statically typed language. As such, each variable has a type associated with it. As seen in the previous example these types are inferred in the `const`, `let` and `var` declarations by the compiler.
```nimrod
# These types are inferred.
var x = 5 # int
var y = "foo" # string
# Assigning a value of a different type will result in a compile-time error.
x = y
```
```console
$ nim c -r typeinference.nim
typeinference.nim(6, 4) Error: type mismatch: got (string) but expected 'int'
```
You may optionally specify the type after a colon (`:`). In some cases the compiler will expect you to explicitly cast types, for which two ways are available:
- type conversion, whose safety checked by the compiler
- the `cast` keyword, which is unsafe and should be used only where you know what you are doing, such as in interfacing with C
```nimrod
var x = int(1.0 / 3) # type conversion
var y = "Foobar"
proc ffi(foo: ptr array[6, char]) = echo repr(foo)
ffi(cast[ptr array[6, char]](addr y[0]))
```
```console
$ nim c -r typecasting.nim
ref 002C8030 --> ['F', 'o', 'o', 'b', 'a', 'r']
```
| ---
title: Type Casting and Inference
---
# Type Casting and Inference
Nim is a statically typed language. As such, each variable has a type associated with it. As seen in the previous example these types are inferred in the `const`, `let` and `var` declarations by the compiler.
```nimrod
# These types are inferred.
var x = 5 # int
var y = "foo" # string
# Assigning a value of a different type will result in a compile-time error.
x = y
```
```console
$ nim c -r typeinference.nim
typeinference.nim(6, 4) Error: type mismatch: got (string) but expected 'int'
```
You may optionally specify the type after a colon (`:`). In some cases the compiler will expect you to explicitly cast types, for which multiple ways are available:
- type conversion, whose safety checked by the compiler
- the `cast` keyword, which is unsafe and should be used only where you know what you are doing, such as in interfacing with C
```nimrod
var x = int(1.0 / 3) # type conversion
var y: seq[int] = @[] # empty seq needs type specification
var z = "Foobar"
proc ffi(foo: ptr array[6, char]) = echo repr(foo)
ffi(cast[ptr array[6, char]](addr z[0]))
```
```console
$ nim c -r typecasting.nim
ref 002C8030 --> ['F', 'o', 'o', 'b', 'a', 'r']
```
| Add empty seqs to type casting doc | Add empty seqs to type casting doc | Markdown | unlicense | flaviut/nim-by-example,flaviut/nim-by-example,flaviut/nim-by-example,flaviut/nim-by-example | markdown | ## Code Before:
---
title: Type Casting and Inference
---
# Type Casting and Inference
Nim is a statically typed language. As such, each variable has a type associated with it. As seen in the previous example these types are inferred in the `const`, `let` and `var` declarations by the compiler.
```nimrod
# These types are inferred.
var x = 5 # int
var y = "foo" # string
# Assigning a value of a different type will result in a compile-time error.
x = y
```
```console
$ nim c -r typeinference.nim
typeinference.nim(6, 4) Error: type mismatch: got (string) but expected 'int'
```
You may optionally specify the type after a colon (`:`). In some cases the compiler will expect you to explicitly cast types, for which two ways are available:
- type conversion, whose safety checked by the compiler
- the `cast` keyword, which is unsafe and should be used only where you know what you are doing, such as in interfacing with C
```nimrod
var x = int(1.0 / 3) # type conversion
var y = "Foobar"
proc ffi(foo: ptr array[6, char]) = echo repr(foo)
ffi(cast[ptr array[6, char]](addr y[0]))
```
```console
$ nim c -r typecasting.nim
ref 002C8030 --> ['F', 'o', 'o', 'b', 'a', 'r']
```
## Instruction:
Add empty seqs to type casting doc
## Code After:
---
title: Type Casting and Inference
---
# Type Casting and Inference
Nim is a statically typed language. As such, each variable has a type associated with it. As seen in the previous example these types are inferred in the `const`, `let` and `var` declarations by the compiler.
```nimrod
# These types are inferred.
var x = 5 # int
var y = "foo" # string
# Assigning a value of a different type will result in a compile-time error.
x = y
```
```console
$ nim c -r typeinference.nim
typeinference.nim(6, 4) Error: type mismatch: got (string) but expected 'int'
```
You may optionally specify the type after a colon (`:`). In some cases the compiler will expect you to explicitly cast types, for which multiple ways are available:
- type conversion, whose safety checked by the compiler
- the `cast` keyword, which is unsafe and should be used only where you know what you are doing, such as in interfacing with C
```nimrod
var x = int(1.0 / 3) # type conversion
var y: seq[int] = @[] # empty seq needs type specification
var z = "Foobar"
proc ffi(foo: ptr array[6, char]) = echo repr(foo)
ffi(cast[ptr array[6, char]](addr z[0]))
```
```console
$ nim c -r typecasting.nim
ref 002C8030 --> ['F', 'o', 'o', 'b', 'a', 'r']
```
| ---
title: Type Casting and Inference
---
# Type Casting and Inference
Nim is a statically typed language. As such, each variable has a type associated with it. As seen in the previous example these types are inferred in the `const`, `let` and `var` declarations by the compiler.
```nimrod
# These types are inferred.
var x = 5 # int
var y = "foo" # string
# Assigning a value of a different type will result in a compile-time error.
x = y
```
```console
$ nim c -r typeinference.nim
typeinference.nim(6, 4) Error: type mismatch: got (string) but expected 'int'
```
- You may optionally specify the type after a colon (`:`). In some cases the compiler will expect you to explicitly cast types, for which two ways are available:
? ^^
+ You may optionally specify the type after a colon (`:`). In some cases the compiler will expect you to explicitly cast types, for which multiple ways are available:
? +++ ^^^^
- type conversion, whose safety checked by the compiler
- the `cast` keyword, which is unsafe and should be used only where you know what you are doing, such as in interfacing with C
```nimrod
var x = int(1.0 / 3) # type conversion
+ var y: seq[int] = @[] # empty seq needs type specification
+
- var y = "Foobar"
? ^
+ var z = "Foobar"
? ^
proc ffi(foo: ptr array[6, char]) = echo repr(foo)
- ffi(cast[ptr array[6, char]](addr y[0]))
? ^
+ ffi(cast[ptr array[6, char]](addr z[0]))
? ^
```
```console
$ nim c -r typecasting.nim
ref 002C8030 --> ['F', 'o', 'o', 'b', 'a', 'r']
``` | 8 | 0.210526 | 5 | 3 |
ad2115f9794a4897d98898b39556eea7bf92d6c9 | app/views/sprint/create.blade.php | app/views/sprint/create.blade.php | @extends('layouts.default')
@section('content')
<h1>Create sprint for {{ $project->title }}</h1>
@stop
| @extends('layouts.default')
@section('content')
<h1>Create sprint for {{ $project->title }}</h1>
{{ Form::open(['method' => 'POST', 'route' => ['store_sprint_path', $project->id]]) }}
<div class="form-group">
{{ Form::label('title', 'Title:') }}
{{ Form::text('title', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sprint_start', 'Sprint start:') }}
{{ Form::text('sprint_start', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sprint_end', 'Sprint end:') }}
{{ Form::text('sprint_end', '', ['class' => 'form-control']) }}
</div>
{{ Form::submit('Create new sprint', ['class' => 'btn btn-primary']) }}
{{ Form::close() }}
@stop
| Add form for sprint creation. | Add form for sprint creation.
| PHP | apache-2.0 | christopher-johnson/phabricator,christopher-johnson/phabricator,christopher-johnson/phabricator,christopher-johnson/phabricator,christopher-johnson/phabricator | php | ## Code Before:
@extends('layouts.default')
@section('content')
<h1>Create sprint for {{ $project->title }}</h1>
@stop
## Instruction:
Add form for sprint creation.
## Code After:
@extends('layouts.default')
@section('content')
<h1>Create sprint for {{ $project->title }}</h1>
{{ Form::open(['method' => 'POST', 'route' => ['store_sprint_path', $project->id]]) }}
<div class="form-group">
{{ Form::label('title', 'Title:') }}
{{ Form::text('title', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sprint_start', 'Sprint start:') }}
{{ Form::text('sprint_start', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sprint_end', 'Sprint end:') }}
{{ Form::text('sprint_end', '', ['class' => 'form-control']) }}
</div>
{{ Form::submit('Create new sprint', ['class' => 'btn btn-primary']) }}
{{ Form::close() }}
@stop
| @extends('layouts.default')
@section('content')
<h1>Create sprint for {{ $project->title }}</h1>
+
+ {{ Form::open(['method' => 'POST', 'route' => ['store_sprint_path', $project->id]]) }}
+ <div class="form-group">
+ {{ Form::label('title', 'Title:') }}
+ {{ Form::text('title', '', ['class' => 'form-control']) }}
+ </div>
+
+ <div class="form-group">
+ {{ Form::label('sprint_start', 'Sprint start:') }}
+ {{ Form::text('sprint_start', '', ['class' => 'form-control']) }}
+ </div>
+
+ <div class="form-group">
+ {{ Form::label('sprint_end', 'Sprint end:') }}
+ {{ Form::text('sprint_end', '', ['class' => 'form-control']) }}
+ </div>
+
+ {{ Form::submit('Create new sprint', ['class' => 'btn btn-primary']) }}
+ {{ Form::close() }}
@stop | 19 | 3.8 | 19 | 0 |
ee1be0d8fed31f9f68fafd4d11eab6bb6a96abe9 | client/views/stages/_stage.html | client/views/stages/_stage.html | <template name="_stage">
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} bar">
<p class="{{#if stage.isCurrent}}text-warning{{/if}} vertical-text">
{{stage.title}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</p>
</div>
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} stage-content">
{{#if stage._id}}
<div class="panel-heading">
{{_ stage.title true}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</div>
<ul class="list-group">
{{# each goal in stage.goals}}
{{> _goal goal=goal stage=stage}}
{{/each}}
</ul>
<div class="panel-body">
<a href="#" class="btn btn-success pull-right js-add-goal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</a>
</div>
{{/if}}
</div>
</template>
| <template name="_stage">
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} bar">
<p class=" text-capitalize {{#if stage.isCurrent}}text-warning{{/if}} vertical-text">
{{stage.title}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</p>
</div>
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} stage-content">
{{#if stage._id}}
<div class="panel-heading text-capitalize">
{{stage.title true}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</div>
<ul class="list-group">
{{# each goal in stage.goals}}
{{> _goal goal=goal stage=stage}}
{{/each}}
</ul>
<div class="panel-body">
<a href="#" class="btn btn-success pull-right js-add-goal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</a>
</div>
{{/if}}
</div>
</template>
| Fix stage title displaying in lower case | Fix stage title displaying in lower case
| HTML | mit | keenethics/pelorus,keenethics/pelorus | html | ## Code Before:
<template name="_stage">
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} bar">
<p class="{{#if stage.isCurrent}}text-warning{{/if}} vertical-text">
{{stage.title}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</p>
</div>
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} stage-content">
{{#if stage._id}}
<div class="panel-heading">
{{_ stage.title true}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</div>
<ul class="list-group">
{{# each goal in stage.goals}}
{{> _goal goal=goal stage=stage}}
{{/each}}
</ul>
<div class="panel-body">
<a href="#" class="btn btn-success pull-right js-add-goal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</a>
</div>
{{/if}}
</div>
</template>
## Instruction:
Fix stage title displaying in lower case
## Code After:
<template name="_stage">
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} bar">
<p class=" text-capitalize {{#if stage.isCurrent}}text-warning{{/if}} vertical-text">
{{stage.title}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</p>
</div>
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} stage-content">
{{#if stage._id}}
<div class="panel-heading text-capitalize">
{{stage.title true}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</div>
<ul class="list-group">
{{# each goal in stage.goals}}
{{> _goal goal=goal stage=stage}}
{{/each}}
</ul>
<div class="panel-body">
<a href="#" class="btn btn-success pull-right js-add-goal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</a>
</div>
{{/if}}
</div>
</template>
| <template name="_stage">
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} bar">
- <p class="{{#if stage.isCurrent}}text-warning{{/if}} vertical-text">
+ <p class=" text-capitalize {{#if stage.isCurrent}}text-warning{{/if}} vertical-text">
? +++++++++++++++++
{{stage.title}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</p>
</div>
<div class="panel panel-{{#if stage.isCurrent}}warning{{else}}default{{/if}} stage-content">
{{#if stage._id}}
- <div class="panel-heading">
+ <div class="panel-heading text-capitalize">
? ++++++++++++++++
- {{_ stage.title true}}
? --
+ {{stage.title true}}
{{#if stage.progress}} ({{stage.progress}}%){{/if}}
</div>
<ul class="list-group">
{{# each goal in stage.goals}}
{{> _goal goal=goal stage=stage}}
{{/each}}
</ul>
<div class="panel-body">
<a href="#" class="btn btn-success pull-right js-add-goal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</a>
</div>
{{/if}}
</div>
</template> | 6 | 0.230769 | 3 | 3 |
e9f3b6f9eb59ef7290498e8ceaf81c2bc66c8f59 | ichnaea/gunicorn_config.py | ichnaea/gunicorn_config.py | worker_class = "sync"
# Set timeout to the same value as the default one from Amazon ELB (60 secs).
# It should be 60 seconds, but gunicorn halves the configured value,
# see https://github.com/benoitc/gunicorn/issues/829
timeout = 120
# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000
# Avoid too much output on the console
loglevel = "warning"
def post_worker_init(worker):
from random import randint
# Use 10% jitter, to prevent all workers from restarting at once,
# as they get an almost equal number of requests
jitter = randint(0, max_requests // 10)
worker.max_requests += jitter
# Actually initialize the application
worker.wsgi(None, None)
| worker_class = "sync"
# Set timeout to the same value as the default one from Amazon ELB (60 secs).
timeout = 60
# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000
# Avoid too much output on the console
loglevel = "warning"
def post_worker_init(worker):
from random import randint
# Use 10% jitter, to prevent all workers from restarting at once,
# as they get an almost equal number of requests
jitter = randint(0, max_requests // 10)
worker.max_requests += jitter
# Actually initialize the application
worker.wsgi(None, None)
| Update gunicorn timeout after gunicorn issue was answered. | Update gunicorn timeout after gunicorn issue was answered.
| Python | apache-2.0 | mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea | python | ## Code Before:
worker_class = "sync"
# Set timeout to the same value as the default one from Amazon ELB (60 secs).
# It should be 60 seconds, but gunicorn halves the configured value,
# see https://github.com/benoitc/gunicorn/issues/829
timeout = 120
# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000
# Avoid too much output on the console
loglevel = "warning"
def post_worker_init(worker):
from random import randint
# Use 10% jitter, to prevent all workers from restarting at once,
# as they get an almost equal number of requests
jitter = randint(0, max_requests // 10)
worker.max_requests += jitter
# Actually initialize the application
worker.wsgi(None, None)
## Instruction:
Update gunicorn timeout after gunicorn issue was answered.
## Code After:
worker_class = "sync"
# Set timeout to the same value as the default one from Amazon ELB (60 secs).
timeout = 60
# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000
# Avoid too much output on the console
loglevel = "warning"
def post_worker_init(worker):
from random import randint
# Use 10% jitter, to prevent all workers from restarting at once,
# as they get an almost equal number of requests
jitter = randint(0, max_requests // 10)
worker.max_requests += jitter
# Actually initialize the application
worker.wsgi(None, None)
| worker_class = "sync"
# Set timeout to the same value as the default one from Amazon ELB (60 secs).
- # It should be 60 seconds, but gunicorn halves the configured value,
- # see https://github.com/benoitc/gunicorn/issues/829
- timeout = 120
? ^^
+ timeout = 60
? ^
# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000
# Avoid too much output on the console
loglevel = "warning"
def post_worker_init(worker):
from random import randint
# Use 10% jitter, to prevent all workers from restarting at once,
# as they get an almost equal number of requests
jitter = randint(0, max_requests // 10)
worker.max_requests += jitter
# Actually initialize the application
worker.wsgi(None, None) | 4 | 0.16 | 1 | 3 |
e83c2f2aaa9ba2b349f9cb41e2148609cd970cac | READ_BEFORE_UPDATE.md | READ_BEFORE_UPDATE.md |
* The size of the ``serial`` column in the ``pidea_audit`` database table was increased from 20 to 40 characters.
Please verify that your database can handle this increasing of the table size! |
* Some combinations of installed packages may cause problems with the LDAP resolver:
* ldap3 2.1.1, pyasn1 0.4.2: Attempts to use STARTTLS fail with an exception (Issue #885)
* ldap3 >= 2.3: The user list appears to be empty, the log shows LDAPSizeLimitExceededResult exceptions. (Issue #887)
This can be mitigated by setting a size limit greater than the number of users in the LDAP directory.
* ldap3 >= 2.4: User attributes are not retrieved properly (Issue #911)
* ldap3 >= 2.4.1: UnicodeError on authentication, token view displays resolver errors (Issue #911)
* ldap3 >= 2.4.1: Cannot search for non-ASCII characters in user view (#980)
* Depending on your requirements, you may consider using ldap3 2.1.1 and pyasn1 0.1.9.
While this combination does not exhibit any of the problems listed above, both software
releases are quite old and several security fixes have been incorporated since then!
* The size of the ``serial`` column in the ``pidea_audit`` database table was increased from 20 to 40 characters.
Please verify that your database can handle this increasing of the table size!
| Add Update Notes on ldap3+pyasn1 | Add Update Notes on ldap3+pyasn1
| Markdown | agpl-3.0 | privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea | markdown | ## Code Before:
* The size of the ``serial`` column in the ``pidea_audit`` database table was increased from 20 to 40 characters.
Please verify that your database can handle this increasing of the table size!
## Instruction:
Add Update Notes on ldap3+pyasn1
## Code After:
* Some combinations of installed packages may cause problems with the LDAP resolver:
* ldap3 2.1.1, pyasn1 0.4.2: Attempts to use STARTTLS fail with an exception (Issue #885)
* ldap3 >= 2.3: The user list appears to be empty, the log shows LDAPSizeLimitExceededResult exceptions. (Issue #887)
This can be mitigated by setting a size limit greater than the number of users in the LDAP directory.
* ldap3 >= 2.4: User attributes are not retrieved properly (Issue #911)
* ldap3 >= 2.4.1: UnicodeError on authentication, token view displays resolver errors (Issue #911)
* ldap3 >= 2.4.1: Cannot search for non-ASCII characters in user view (#980)
* Depending on your requirements, you may consider using ldap3 2.1.1 and pyasn1 0.1.9.
While this combination does not exhibit any of the problems listed above, both software
releases are quite old and several security fixes have been incorporated since then!
* The size of the ``serial`` column in the ``pidea_audit`` database table was increased from 20 to 40 characters.
Please verify that your database can handle this increasing of the table size!
|
+ * Some combinations of installed packages may cause problems with the LDAP resolver:
+ * ldap3 2.1.1, pyasn1 0.4.2: Attempts to use STARTTLS fail with an exception (Issue #885)
+ * ldap3 >= 2.3: The user list appears to be empty, the log shows LDAPSizeLimitExceededResult exceptions. (Issue #887)
+ This can be mitigated by setting a size limit greater than the number of users in the LDAP directory.
+ * ldap3 >= 2.4: User attributes are not retrieved properly (Issue #911)
+ * ldap3 >= 2.4.1: UnicodeError on authentication, token view displays resolver errors (Issue #911)
+ * ldap3 >= 2.4.1: Cannot search for non-ASCII characters in user view (#980)
+ * Depending on your requirements, you may consider using ldap3 2.1.1 and pyasn1 0.1.9.
+ While this combination does not exhibit any of the problems listed above, both software
+ releases are quite old and several security fixes have been incorporated since then!
* The size of the ``serial`` column in the ``pidea_audit`` database table was increased from 20 to 40 characters.
Please verify that your database can handle this increasing of the table size! | 10 | 3.333333 | 10 | 0 |
b17006c7c45b86ff91b6c502417da44c24ba6975 | spec/spec_helper.rb | spec/spec_helper.rb | require 'open3'
require 'pathname'
def autotags(command, path = nil, verbose: false)
args = []
args << '-v' if verbose
args << command
args << path if path
raw_autotags(*args)
end
def raw_autotags(*args)
script = Pathname.new(__FILE__) + '../../autotags'
stdint, out, status = Open3.popen2e script.to_s, *(args.map(&:to_s))
code = status.value.exitstatus
stdint.close
out.autoclose = true
code
end
def tmpdir
path = Dir.mktmpdir
Pathname.new path
end
def dummy_proc
pid = Process.fork do
sleep
end
Thread.new { Process.wait pid }
pid
end
def snooze
sleep 0.1
end
def clean_dir(dir)
begin
pidfile = dir + '.autotags.pid'
if pidfile.exist?
Process.kill :SIGTERM, pidfile.read.to_i
snooze
end
rescue # rubocop:disable Lint/HandleExceptions
end
dir.rmtree
end
def pid_running?(pid)
Process.kill 0, pid
true
rescue
false
end
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
end
| require 'open3'
require 'tmpdir'
require 'pathname'
def autotags(command, path = nil, verbose: false)
args = []
args << '-v' if verbose
args << command
args << path if path
raw_autotags(*args)
end
def raw_autotags(*args)
script = Pathname.new(__FILE__) + '../../autotags'
stdint, out, status = Open3.popen2e script.to_s, *(args.map(&:to_s))
code = status.value.exitstatus
stdint.close
out.autoclose = true
code
end
def tmpdir
path = Dir.mktmpdir
Pathname.new path
end
def dummy_proc
pid = Process.fork do
sleep
end
Thread.new { Process.wait pid }
pid
end
def snooze
sleep 0.1
end
def clean_dir(dir)
begin
pidfile = dir + '.autotags.pid'
if pidfile.exist?
Process.kill :SIGTERM, pidfile.read.to_i
snooze
end
rescue # rubocop:disable Lint/HandleExceptions
end
dir.rmtree
end
def pid_running?(pid)
Process.kill 0, pid
true
rescue
false
end
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
end
| Fix super insane mktmpdir missing error | Fix super insane mktmpdir missing error
| Ruby | mit | beraboris/autotags,beraboris/autotags | ruby | ## Code Before:
require 'open3'
require 'pathname'
def autotags(command, path = nil, verbose: false)
args = []
args << '-v' if verbose
args << command
args << path if path
raw_autotags(*args)
end
def raw_autotags(*args)
script = Pathname.new(__FILE__) + '../../autotags'
stdint, out, status = Open3.popen2e script.to_s, *(args.map(&:to_s))
code = status.value.exitstatus
stdint.close
out.autoclose = true
code
end
def tmpdir
path = Dir.mktmpdir
Pathname.new path
end
def dummy_proc
pid = Process.fork do
sleep
end
Thread.new { Process.wait pid }
pid
end
def snooze
sleep 0.1
end
def clean_dir(dir)
begin
pidfile = dir + '.autotags.pid'
if pidfile.exist?
Process.kill :SIGTERM, pidfile.read.to_i
snooze
end
rescue # rubocop:disable Lint/HandleExceptions
end
dir.rmtree
end
def pid_running?(pid)
Process.kill 0, pid
true
rescue
false
end
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
end
## Instruction:
Fix super insane mktmpdir missing error
## Code After:
require 'open3'
require 'tmpdir'
require 'pathname'
def autotags(command, path = nil, verbose: false)
args = []
args << '-v' if verbose
args << command
args << path if path
raw_autotags(*args)
end
def raw_autotags(*args)
script = Pathname.new(__FILE__) + '../../autotags'
stdint, out, status = Open3.popen2e script.to_s, *(args.map(&:to_s))
code = status.value.exitstatus
stdint.close
out.autoclose = true
code
end
def tmpdir
path = Dir.mktmpdir
Pathname.new path
end
def dummy_proc
pid = Process.fork do
sleep
end
Thread.new { Process.wait pid }
pid
end
def snooze
sleep 0.1
end
def clean_dir(dir)
begin
pidfile = dir + '.autotags.pid'
if pidfile.exist?
Process.kill :SIGTERM, pidfile.read.to_i
snooze
end
rescue # rubocop:disable Lint/HandleExceptions
end
dir.rmtree
end
def pid_running?(pid)
Process.kill 0, pid
true
rescue
false
end
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
end
| require 'open3'
+ require 'tmpdir'
require 'pathname'
def autotags(command, path = nil, verbose: false)
args = []
args << '-v' if verbose
args << command
args << path if path
raw_autotags(*args)
end
def raw_autotags(*args)
script = Pathname.new(__FILE__) + '../../autotags'
stdint, out, status = Open3.popen2e script.to_s, *(args.map(&:to_s))
code = status.value.exitstatus
stdint.close
out.autoclose = true
code
end
def tmpdir
path = Dir.mktmpdir
Pathname.new path
end
def dummy_proc
pid = Process.fork do
sleep
end
Thread.new { Process.wait pid }
pid
end
def snooze
sleep 0.1
end
def clean_dir(dir)
begin
pidfile = dir + '.autotags.pid'
if pidfile.exist?
Process.kill :SIGTERM, pidfile.read.to_i
snooze
end
rescue # rubocop:disable Lint/HandleExceptions
end
dir.rmtree
end
def pid_running?(pid)
Process.kill 0, pid
true
rescue
false
end
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
end | 1 | 0.015625 | 1 | 0 |
b6170a2ec91bd2e15e17710c651f227adf1518c8 | SQGlobalMarco.h | SQGlobalMarco.h | //
// SQGlobalMarco.h
//
// Created by Shi Eric on 3/18/12.
// Copyright (c) 2012 Safe&Quick[http://www.saick.net]. All rights reserved.
//
#ifndef _SQGlobalMarco_h
#define _SQGlobalMarco_h
#define kMinOSVersion 4.0f
#define saferelease(foo) {if(foo != nil) {[foo release]; foo = nil;}}
#define isLandscape (UIInterfaceOrientationIsLandscape\
([[UIApplication sharedApplication] statusBarOrientation]))
#define isPad ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]\
&& [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define isPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kOSVersion (float)([[[UIDevice currentDevice] systemVersion] length] > 0 ? [[[UIDevice currentDevice] systemVersion] doubleValue] : kMinOSVersion)
#endif
| //
// SQGlobalMarco.h
//
// Created by Shi Eric on 3/18/12.
// Copyright (c) 2012 Safe&Quick[http://www.saick.net]. All rights reserved.
//
#ifndef _SQGlobalMarco_h
#define _SQGlobalMarco_h
#define kMinOSVersion 4.0f
#define saferelease(foo) {if(foo != nil) {[foo release]; foo = nil;}}
#define isLandscape (UIInterfaceOrientationIsLandscape\
([[UIApplication sharedApplication] statusBarOrientation]))
#define isPad ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]\
&& [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define isPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kOSVersion (float)([[[UIDevice currentDevice] systemVersion] length] > 0 ? [[[UIDevice currentDevice] systemVersion] doubleValue] : kMinOSVersion)
#define kScreenSize [[UIScreen mainScreen] bounds].size
// Radians to degrees
#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
// Degrees to radians
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
#endif
| Add kScreenSize and Radians to or from degrees | Add kScreenSize and Radians to or from degrees
| C | mit | shjborage/SQCommonUtils | c | ## Code Before:
//
// SQGlobalMarco.h
//
// Created by Shi Eric on 3/18/12.
// Copyright (c) 2012 Safe&Quick[http://www.saick.net]. All rights reserved.
//
#ifndef _SQGlobalMarco_h
#define _SQGlobalMarco_h
#define kMinOSVersion 4.0f
#define saferelease(foo) {if(foo != nil) {[foo release]; foo = nil;}}
#define isLandscape (UIInterfaceOrientationIsLandscape\
([[UIApplication sharedApplication] statusBarOrientation]))
#define isPad ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]\
&& [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define isPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kOSVersion (float)([[[UIDevice currentDevice] systemVersion] length] > 0 ? [[[UIDevice currentDevice] systemVersion] doubleValue] : kMinOSVersion)
#endif
## Instruction:
Add kScreenSize and Radians to or from degrees
## Code After:
//
// SQGlobalMarco.h
//
// Created by Shi Eric on 3/18/12.
// Copyright (c) 2012 Safe&Quick[http://www.saick.net]. All rights reserved.
//
#ifndef _SQGlobalMarco_h
#define _SQGlobalMarco_h
#define kMinOSVersion 4.0f
#define saferelease(foo) {if(foo != nil) {[foo release]; foo = nil;}}
#define isLandscape (UIInterfaceOrientationIsLandscape\
([[UIApplication sharedApplication] statusBarOrientation]))
#define isPad ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]\
&& [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define isPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kOSVersion (float)([[[UIDevice currentDevice] systemVersion] length] > 0 ? [[[UIDevice currentDevice] systemVersion] doubleValue] : kMinOSVersion)
#define kScreenSize [[UIScreen mainScreen] bounds].size
// Radians to degrees
#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
// Degrees to radians
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
#endif
| //
// SQGlobalMarco.h
//
// Created by Shi Eric on 3/18/12.
// Copyright (c) 2012 Safe&Quick[http://www.saick.net]. All rights reserved.
//
#ifndef _SQGlobalMarco_h
#define _SQGlobalMarco_h
#define kMinOSVersion 4.0f
#define saferelease(foo) {if(foo != nil) {[foo release]; foo = nil;}}
#define isLandscape (UIInterfaceOrientationIsLandscape\
([[UIApplication sharedApplication] statusBarOrientation]))
#define isPad ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]\
&& [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define isPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kOSVersion (float)([[[UIDevice currentDevice] systemVersion] length] > 0 ? [[[UIDevice currentDevice] systemVersion] doubleValue] : kMinOSVersion)
+ #define kScreenSize [[UIScreen mainScreen] bounds].size
+
+ // Radians to degrees
+ #define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
+ // Degrees to radians
+ #define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
+
#endif | 7 | 0.28 | 7 | 0 |
3886c69112a611c498dc5fef4ee2a83795d1f7f8 | app/system/database/records/location.json | app/system/database/records/location.json | {
"location_name": "Default",
"location_address_1": "Broad Ln",
"location_city": "Coventry",
"location_telephone": "8765456789",
"location_country_id": 222,
"offer_delivery": 1,
"offer_collection": 1,
"delivery_time": 15,
"collection_time": 15,
"reservation_time_interval": 15,
"reservation_stay_time": 45,
"location_lat": 52.415884,
"location_lng": -1.603648,
"location_status": 1,
"options": {
"hours": {
"opening": {
"type": "24_7"
},
"delivery": {
"type": "24_7"
},
"collection": {
"type": "24_7"
}
}
},
"delivery_areas": [
{
"name": "Area 1",
"type": "circle",
"conditions": [
{
"priority": 1,
"amount": 10,
"type": "all",
"total": 0
}
],
"boundaries": {
"polygon": null,
"vertices": null,
"circle": {
"lat": 52.415884,
"lng": -1.603648,
"radius": 1500
}
}
}
]
} | {
"location_name": "Default",
"location_address_1": "Broad Ln",
"location_city": "Coventry",
"location_telephone": "8765456789",
"location_country_id": 222,
"offer_delivery": 1,
"offer_collection": 1,
"delivery_time": 15,
"collection_time": 15,
"reservation_time_interval": 15,
"reservation_stay_time": 45,
"location_lat": 52.415884,
"location_lng": -1.603648,
"location_status": 1,
"options": {
"hours": {
"opening": {
"type": "24_7"
},
"delivery": {
"type": "24_7"
},
"collection": {
"type": "24_7"
}
}
},
"delivery_areas": [
{
"name": "Area 1",
"type": "circle",
"is_default": 1,
"conditions": [
{
"priority": 1,
"amount": 10,
"type": "all",
"total": 0
}
],
"boundaries": {
"polygon": null,
"vertices": null,
"circle": {
"lat": 52.415884,
"lng": -1.603648,
"radius": 1500
}
}
}
]
} | Set the demo delivery area as default | Set the demo delivery area as default
| JSON | mit | sampoyigi/TastyIgniter,sampoyigi/TastyIgniter,tastyigniter/TastyIgniter,sampoyigi/TastyIgniter,tastyigniter/TastyIgniter,sampoyigi/TastyIgniter | json | ## Code Before:
{
"location_name": "Default",
"location_address_1": "Broad Ln",
"location_city": "Coventry",
"location_telephone": "8765456789",
"location_country_id": 222,
"offer_delivery": 1,
"offer_collection": 1,
"delivery_time": 15,
"collection_time": 15,
"reservation_time_interval": 15,
"reservation_stay_time": 45,
"location_lat": 52.415884,
"location_lng": -1.603648,
"location_status": 1,
"options": {
"hours": {
"opening": {
"type": "24_7"
},
"delivery": {
"type": "24_7"
},
"collection": {
"type": "24_7"
}
}
},
"delivery_areas": [
{
"name": "Area 1",
"type": "circle",
"conditions": [
{
"priority": 1,
"amount": 10,
"type": "all",
"total": 0
}
],
"boundaries": {
"polygon": null,
"vertices": null,
"circle": {
"lat": 52.415884,
"lng": -1.603648,
"radius": 1500
}
}
}
]
}
## Instruction:
Set the demo delivery area as default
## Code After:
{
"location_name": "Default",
"location_address_1": "Broad Ln",
"location_city": "Coventry",
"location_telephone": "8765456789",
"location_country_id": 222,
"offer_delivery": 1,
"offer_collection": 1,
"delivery_time": 15,
"collection_time": 15,
"reservation_time_interval": 15,
"reservation_stay_time": 45,
"location_lat": 52.415884,
"location_lng": -1.603648,
"location_status": 1,
"options": {
"hours": {
"opening": {
"type": "24_7"
},
"delivery": {
"type": "24_7"
},
"collection": {
"type": "24_7"
}
}
},
"delivery_areas": [
{
"name": "Area 1",
"type": "circle",
"is_default": 1,
"conditions": [
{
"priority": 1,
"amount": 10,
"type": "all",
"total": 0
}
],
"boundaries": {
"polygon": null,
"vertices": null,
"circle": {
"lat": 52.415884,
"lng": -1.603648,
"radius": 1500
}
}
}
]
} | {
"location_name": "Default",
"location_address_1": "Broad Ln",
"location_city": "Coventry",
"location_telephone": "8765456789",
"location_country_id": 222,
"offer_delivery": 1,
"offer_collection": 1,
"delivery_time": 15,
"collection_time": 15,
"reservation_time_interval": 15,
"reservation_stay_time": 45,
"location_lat": 52.415884,
"location_lng": -1.603648,
"location_status": 1,
"options": {
"hours": {
"opening": {
"type": "24_7"
},
"delivery": {
"type": "24_7"
},
"collection": {
"type": "24_7"
}
}
},
"delivery_areas": [
{
"name": "Area 1",
"type": "circle",
+ "is_default": 1,
"conditions": [
{
"priority": 1,
"amount": 10,
"type": "all",
"total": 0
}
],
"boundaries": {
"polygon": null,
"vertices": null,
"circle": {
"lat": 52.415884,
"lng": -1.603648,
"radius": 1500
}
}
}
]
} | 1 | 0.019231 | 1 | 0 |
e66bcf5461332a06b45cb579e971afc3ee2045a8 | url-groups.csv | url-groups.csv | ---
layout: null
sitemap:
exclude: 'yes'
---
url,cat1,cat2,cat3
blog/,Blog Home,Auth0 based tutorial,
{% for post in site.posts %}{% capture rawtext %}{{ site.baseurl | replace_first:'/','' }}{% if post.alias == nil %}{{ post.url }}{% else %}{{ post.alias }}{% endif %},{% if post.category == nil %}Auth0 based tutorial{% else %}{{ post.category }}{% endif %}{% endcapture %}{{ rawtext | split:',' | row_format_csv:4 }}
{% endfor %}
| ---
layout: null
sitemap:
exclude: 'yes'
---
url,cat1,cat2,cat3,auth0_aside,post_length
blog/,Blog Home,Auth0 based tutorial,
{% for post in site.posts %}{% capture rawtext %}{{ site.baseurl | replace_first:'/','' }}{% if post.alias == nil %}{{ post.url }}{% else %}{{ post.alias }}{% endif %},{% if post.category == nil %}Auth0 based tutorial{% else %}{{ post.category }}{% endif %}{% endcapture %}{{ rawtext | split:',' | row_format_csv:4 }}
{% endfor %}
| Add auth0_aside and post_length to URL groups CSV | Add auth0_aside and post_length to URL groups CSV
| CSV | mit | auth0/blog,kmaida/blog,kmaida/blog,kmaida/blog,auth0/blog,auth0/blog,auth0/blog,kmaida/blog | csv | ## Code Before:
---
layout: null
sitemap:
exclude: 'yes'
---
url,cat1,cat2,cat3
blog/,Blog Home,Auth0 based tutorial,
{% for post in site.posts %}{% capture rawtext %}{{ site.baseurl | replace_first:'/','' }}{% if post.alias == nil %}{{ post.url }}{% else %}{{ post.alias }}{% endif %},{% if post.category == nil %}Auth0 based tutorial{% else %}{{ post.category }}{% endif %}{% endcapture %}{{ rawtext | split:',' | row_format_csv:4 }}
{% endfor %}
## Instruction:
Add auth0_aside and post_length to URL groups CSV
## Code After:
---
layout: null
sitemap:
exclude: 'yes'
---
url,cat1,cat2,cat3,auth0_aside,post_length
blog/,Blog Home,Auth0 based tutorial,
{% for post in site.posts %}{% capture rawtext %}{{ site.baseurl | replace_first:'/','' }}{% if post.alias == nil %}{{ post.url }}{% else %}{{ post.alias }}{% endif %},{% if post.category == nil %}Auth0 based tutorial{% else %}{{ post.category }}{% endif %}{% endcapture %}{{ rawtext | split:',' | row_format_csv:4 }}
{% endfor %}
| ---
layout: null
sitemap:
exclude: 'yes'
---
- url,cat1,cat2,cat3
+ url,cat1,cat2,cat3,auth0_aside,post_length
blog/,Blog Home,Auth0 based tutorial,
{% for post in site.posts %}{% capture rawtext %}{{ site.baseurl | replace_first:'/','' }}{% if post.alias == nil %}{{ post.url }}{% else %}{{ post.alias }}{% endif %},{% if post.category == nil %}Auth0 based tutorial{% else %}{{ post.category }}{% endif %}{% endcapture %}{{ rawtext | split:',' | row_format_csv:4 }}
{% endfor %} | 2 | 0.222222 | 1 | 1 |
5aff001c90ed4bb1975505c21b5d547b07479a87 | vim/config/languages/json.vim | vim/config/languages/json.vim | "
" vim-json configuration
"
" Disable concealing
let g:vim_json_syntax_conceal = 0
" Enable syntax folding for javascript files
au FileType json setlocal foldmethod=syntax
| "
" vim-json configuration
"
" Disable concealing
let g:vim_json_syntax_conceal = 0
" Enable syntax folding for javascript files
au FileType json setlocal foldmethod=syntax
au FileType json set expandtab
au FileType json set shiftwidth=2
au FileType json set tabstop=2
au FileType json set softtabstop=2
| Fix tabstop and shiftwidth for JSON | Fix tabstop and shiftwidth for JSON
| VimL | mit | sebdah/vim-ide | viml | ## Code Before:
"
" vim-json configuration
"
" Disable concealing
let g:vim_json_syntax_conceal = 0
" Enable syntax folding for javascript files
au FileType json setlocal foldmethod=syntax
## Instruction:
Fix tabstop and shiftwidth for JSON
## Code After:
"
" vim-json configuration
"
" Disable concealing
let g:vim_json_syntax_conceal = 0
" Enable syntax folding for javascript files
au FileType json setlocal foldmethod=syntax
au FileType json set expandtab
au FileType json set shiftwidth=2
au FileType json set tabstop=2
au FileType json set softtabstop=2
| "
" vim-json configuration
"
" Disable concealing
let g:vim_json_syntax_conceal = 0
" Enable syntax folding for javascript files
au FileType json setlocal foldmethod=syntax
+
+ au FileType json set expandtab
+ au FileType json set shiftwidth=2
+ au FileType json set tabstop=2
+ au FileType json set softtabstop=2 | 5 | 0.555556 | 5 | 0 |
0546ab581677975f491307f418abec0cc3343e13 | src/main/java/entitygen/FileClassLoader.java | src/main/java/entitygen/FileClassLoader.java | package entitygen;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
public class FileClassLoader extends ClassLoader {
public FileClassLoader() {
// Empty
}
public Class<?> nameToClass(String className, String fileName) {
try (InputStream is = new FileInputStream(fileName);) {
int n = is.available();
byte[] bytes = new byte[n];
int ret = is.read(bytes, 0, n);
if (ret != n) {
throw new IOException("Expected " + n + " bytes but read " + ret);
}
ByteBuffer data = ByteBuffer.wrap(bytes);
return defineClass(className, data, null);
} catch (IOException e) {
throw new RuntimeException("Couldnt open " + className + "(" + e + ")", e);
}
}
}
| package entitygen;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/**
* Plain File-based class loader
* @author Ian Darwin
*/
public class FileClassLoader extends ClassLoader {
private final String dir;
public FileClassLoader(String dir) {
this.dir = dir;
}
@Override
public Class<?> loadClass(String className) throws ClassNotFoundException {
String fileName = dir + "/" + className.replaceAll("\\.", "/") + ".class";
if (new File(fileName).exists()) {
return nameToClass(className, fileName);
} else {
return getSystemClassLoader().loadClass(className);
}
}
public Class<?> nameToClass(String className, String fileName) {
try (InputStream is = new FileInputStream(fileName)) {
int n = is.available();
byte[] bytes = new byte[n];
int ret = is.read(bytes, 0, n);
if (ret != n) {
throw new IOException("Expected " + n + " bytes but read " + ret);
}
ByteBuffer data = ByteBuffer.wrap(bytes);
return defineClass(className, data, null);
} catch (IOException e) {
throw new RuntimeException("Couldnt open " + className + "(" + e + ")", e);
}
}
}
| Make it grow up to be a real ClassLoader | Make it grow up to be a real ClassLoader
| Java | bsd-2-clause | IanDarwin/entitygen,IanDarwin/entitygen | java | ## Code Before:
package entitygen;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
public class FileClassLoader extends ClassLoader {
public FileClassLoader() {
// Empty
}
public Class<?> nameToClass(String className, String fileName) {
try (InputStream is = new FileInputStream(fileName);) {
int n = is.available();
byte[] bytes = new byte[n];
int ret = is.read(bytes, 0, n);
if (ret != n) {
throw new IOException("Expected " + n + " bytes but read " + ret);
}
ByteBuffer data = ByteBuffer.wrap(bytes);
return defineClass(className, data, null);
} catch (IOException e) {
throw new RuntimeException("Couldnt open " + className + "(" + e + ")", e);
}
}
}
## Instruction:
Make it grow up to be a real ClassLoader
## Code After:
package entitygen;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/**
* Plain File-based class loader
* @author Ian Darwin
*/
public class FileClassLoader extends ClassLoader {
private final String dir;
public FileClassLoader(String dir) {
this.dir = dir;
}
@Override
public Class<?> loadClass(String className) throws ClassNotFoundException {
String fileName = dir + "/" + className.replaceAll("\\.", "/") + ".class";
if (new File(fileName).exists()) {
return nameToClass(className, fileName);
} else {
return getSystemClassLoader().loadClass(className);
}
}
public Class<?> nameToClass(String className, String fileName) {
try (InputStream is = new FileInputStream(fileName)) {
int n = is.available();
byte[] bytes = new byte[n];
int ret = is.read(bytes, 0, n);
if (ret != n) {
throw new IOException("Expected " + n + " bytes but read " + ret);
}
ByteBuffer data = ByteBuffer.wrap(bytes);
return defineClass(className, data, null);
} catch (IOException e) {
throw new RuntimeException("Couldnt open " + className + "(" + e + ")", e);
}
}
}
| package entitygen;
+ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
+ /**
+ * Plain File-based class loader
+ * @author Ian Darwin
+ */
public class FileClassLoader extends ClassLoader {
+ private final String dir;
+
- public FileClassLoader() {
+ public FileClassLoader(String dir) {
? ++++++++++
- // Empty
+ this.dir = dir;
+ }
+
+ @Override
+ public Class<?> loadClass(String className) throws ClassNotFoundException {
+ String fileName = dir + "/" + className.replaceAll("\\.", "/") + ".class";
+ if (new File(fileName).exists()) {
+ return nameToClass(className, fileName);
+ } else {
+ return getSystemClassLoader().loadClass(className);
+ }
}
public Class<?> nameToClass(String className, String fileName) {
- try (InputStream is = new FileInputStream(fileName);) {
? -
+ try (InputStream is = new FileInputStream(fileName)) {
int n = is.available();
byte[] bytes = new byte[n];
int ret = is.read(bytes, 0, n);
if (ret != n) {
throw new IOException("Expected " + n + " bytes but read " + ret);
}
ByteBuffer data = ByteBuffer.wrap(bytes);
return defineClass(className, data, null);
} catch (IOException e) {
throw new RuntimeException("Couldnt open " + className + "(" + e + ")", e);
}
}
} | 23 | 0.793103 | 20 | 3 |
51c801cb23e5355431d77a3ab7fa27d4552be616 | init.js | init.js | (function(window, document, undefined){
'use strict';
var $ = window.jQuery;
function init () {
if ($('#filter-nav').length > 0) {
return;
}
var nav = '<div class="subnav-links" id="filter-nav" style="overflow: hidden; width: 100%; margin-top: 20px; text-transform: uppercase; letter-spacing: 1px;">';
nav += '<a href="#" class="subnav-item selected" data-all="true">All</a>';
var items = $('.info .js-selectable-text')
.map(function () {
return /[^.]+$/.exec($(this).attr('title'));
})
.splice(0)
.filter(function (e, i, arr) {
return arr.lastIndexOf(e) === i;
});
items.forEach(function (el) {
nav += '<a href="#" class="subnav-item">' + el + '</a>';
});
nav += '</div>';
$('#toc').append(nav);
}
init();
if ($('#js-repo-pjax-container').length) {
new window.MutationObserver(init).observe(document.querySelector('#js-repo-pjax-container'), {childList: true});
}
})(this, this.document);
| (function(window, document, undefined){
'use strict';
var $ = window.jQuery;
var config = {
images: ['jpg', 'jpeg', 'bmp', 'png', 'gif'],
videos: ['avi', 'mp4', 'webm', 'flv', 'mkv'],
css: ['css', 'less', 'sass', 'scss', 'styl'],
javascript: ['js', 'coffee'],
html: ['html', 'erb', 'swig', 'jade', 'hbs']
};
function init () {
if ($('#filter-nav').length > 0) {
return;
}
var nav = '<div class="subnav-links" id="filter-nav" style="overflow: hidden; width: 100%; margin-top: 20px; text-transform: uppercase; letter-spacing: 1px;">';
nav += '<a href="#" class="subnav-item selected" data-all="true">All</a>';
var items = $('.info .js-selectable-text')
.map(function () {
return /[^.]+$/.exec($(this).attr('title'));
})
.splice(0)
.filter(function (e, i, arr) {
return arr.lastIndexOf(e) === i;
});
items.forEach(function (el) {
nav += '<a href="#" class="subnav-item">' + el + '</a>';
});
nav += '</div>';
$('#toc').append(nav);
}
init();
if ($('#js-repo-pjax-container').length) {
new window.MutationObserver(init).observe(document.querySelector('#js-repo-pjax-container'), {childList: true});
}
})(this, this.document);
| Add config with group mappings | Add config with group mappings | JavaScript | mit | danielhusar/github-pr-filter | javascript | ## Code Before:
(function(window, document, undefined){
'use strict';
var $ = window.jQuery;
function init () {
if ($('#filter-nav').length > 0) {
return;
}
var nav = '<div class="subnav-links" id="filter-nav" style="overflow: hidden; width: 100%; margin-top: 20px; text-transform: uppercase; letter-spacing: 1px;">';
nav += '<a href="#" class="subnav-item selected" data-all="true">All</a>';
var items = $('.info .js-selectable-text')
.map(function () {
return /[^.]+$/.exec($(this).attr('title'));
})
.splice(0)
.filter(function (e, i, arr) {
return arr.lastIndexOf(e) === i;
});
items.forEach(function (el) {
nav += '<a href="#" class="subnav-item">' + el + '</a>';
});
nav += '</div>';
$('#toc').append(nav);
}
init();
if ($('#js-repo-pjax-container').length) {
new window.MutationObserver(init).observe(document.querySelector('#js-repo-pjax-container'), {childList: true});
}
})(this, this.document);
## Instruction:
Add config with group mappings
## Code After:
(function(window, document, undefined){
'use strict';
var $ = window.jQuery;
var config = {
images: ['jpg', 'jpeg', 'bmp', 'png', 'gif'],
videos: ['avi', 'mp4', 'webm', 'flv', 'mkv'],
css: ['css', 'less', 'sass', 'scss', 'styl'],
javascript: ['js', 'coffee'],
html: ['html', 'erb', 'swig', 'jade', 'hbs']
};
function init () {
if ($('#filter-nav').length > 0) {
return;
}
var nav = '<div class="subnav-links" id="filter-nav" style="overflow: hidden; width: 100%; margin-top: 20px; text-transform: uppercase; letter-spacing: 1px;">';
nav += '<a href="#" class="subnav-item selected" data-all="true">All</a>';
var items = $('.info .js-selectable-text')
.map(function () {
return /[^.]+$/.exec($(this).attr('title'));
})
.splice(0)
.filter(function (e, i, arr) {
return arr.lastIndexOf(e) === i;
});
items.forEach(function (el) {
nav += '<a href="#" class="subnav-item">' + el + '</a>';
});
nav += '</div>';
$('#toc').append(nav);
}
init();
if ($('#js-repo-pjax-container').length) {
new window.MutationObserver(init).observe(document.querySelector('#js-repo-pjax-container'), {childList: true});
}
})(this, this.document);
| (function(window, document, undefined){
'use strict';
var $ = window.jQuery;
+
+ var config = {
+ images: ['jpg', 'jpeg', 'bmp', 'png', 'gif'],
+ videos: ['avi', 'mp4', 'webm', 'flv', 'mkv'],
+ css: ['css', 'less', 'sass', 'scss', 'styl'],
+ javascript: ['js', 'coffee'],
+ html: ['html', 'erb', 'swig', 'jade', 'hbs']
+ };
function init () {
if ($('#filter-nav').length > 0) {
return;
}
var nav = '<div class="subnav-links" id="filter-nav" style="overflow: hidden; width: 100%; margin-top: 20px; text-transform: uppercase; letter-spacing: 1px;">';
nav += '<a href="#" class="subnav-item selected" data-all="true">All</a>';
var items = $('.info .js-selectable-text')
.map(function () {
return /[^.]+$/.exec($(this).attr('title'));
})
.splice(0)
.filter(function (e, i, arr) {
return arr.lastIndexOf(e) === i;
});
items.forEach(function (el) {
nav += '<a href="#" class="subnav-item">' + el + '</a>';
});
nav += '</div>';
$('#toc').append(nav);
}
init();
if ($('#js-repo-pjax-container').length) {
new window.MutationObserver(init).observe(document.querySelector('#js-repo-pjax-container'), {childList: true});
}
})(this, this.document); | 8 | 0.210526 | 8 | 0 |
a5b2bd915630a003d1843c3ac97e62031e33ad51 | Command/FrontendPipelineCommand.php | Command/FrontendPipelineCommand.php | <?php
namespace Wizbii\PipelineBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Wizbii\PipelineBundle\Service\Pipeline;
use Wizbii\PipelineBundle\Service\PipelineProvider;
class FrontendPipelineCommand extends ContainerAwareCommand
{
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$consumers = $this->getConsumers($input->getOption('direct'));
echo join(" ", $consumers->getArrayCopy());
}
protected function configure()
{
$this
->setName('pipeline:frontend:list')
->addOption('direct', null, InputOption::VALUE_NONE)
;
}
protected function getConsumers(bool $directConsumers)
{
$serviceId = $directConsumers ? "pipeline.consumers.direct" : "pipeline.consumers";
return $this->getContainer()->get($serviceId);
}
} | <?php
namespace Wizbii\PipelineBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Wizbii\PipelineBundle\Service\Pipeline;
use Wizbii\PipelineBundle\Service\PipelineProvider;
class FrontendPipelineCommand extends ContainerAwareCommand
{
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$consumers = $this->getConsumers($input->getOption('direct'));
$asJson = $input->getOption('json');
$output->write($asJson ? json_encode($consumers) : join(" ", $consumers));
}
protected function configure()
{
$this
->setName('pipeline:frontend:list')
->addOption('direct', null, InputOption::VALUE_NONE)
->addOption('json', null, InputOption::VALUE_NONE)
;
}
protected function getConsumers(bool $directConsumers)
{
$serviceId = $directConsumers ? "pipeline.consumers.direct" : "pipeline.consumers";
return $this->getContainer()->get($serviceId)->getArrayCopy();
}
} | Allow to dump frontend consumers in JSON | Allow to dump frontend consumers in JSON
| PHP | mit | wizbii/pipeline,wizbii/pipeline | php | ## Code Before:
<?php
namespace Wizbii\PipelineBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Wizbii\PipelineBundle\Service\Pipeline;
use Wizbii\PipelineBundle\Service\PipelineProvider;
class FrontendPipelineCommand extends ContainerAwareCommand
{
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$consumers = $this->getConsumers($input->getOption('direct'));
echo join(" ", $consumers->getArrayCopy());
}
protected function configure()
{
$this
->setName('pipeline:frontend:list')
->addOption('direct', null, InputOption::VALUE_NONE)
;
}
protected function getConsumers(bool $directConsumers)
{
$serviceId = $directConsumers ? "pipeline.consumers.direct" : "pipeline.consumers";
return $this->getContainer()->get($serviceId);
}
}
## Instruction:
Allow to dump frontend consumers in JSON
## Code After:
<?php
namespace Wizbii\PipelineBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Wizbii\PipelineBundle\Service\Pipeline;
use Wizbii\PipelineBundle\Service\PipelineProvider;
class FrontendPipelineCommand extends ContainerAwareCommand
{
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$consumers = $this->getConsumers($input->getOption('direct'));
$asJson = $input->getOption('json');
$output->write($asJson ? json_encode($consumers) : join(" ", $consumers));
}
protected function configure()
{
$this
->setName('pipeline:frontend:list')
->addOption('direct', null, InputOption::VALUE_NONE)
->addOption('json', null, InputOption::VALUE_NONE)
;
}
protected function getConsumers(bool $directConsumers)
{
$serviceId = $directConsumers ? "pipeline.consumers.direct" : "pipeline.consumers";
return $this->getContainer()->get($serviceId)->getArrayCopy();
}
} | <?php
namespace Wizbii\PipelineBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Wizbii\PipelineBundle\Service\Pipeline;
use Wizbii\PipelineBundle\Service\PipelineProvider;
class FrontendPipelineCommand extends ContainerAwareCommand
{
/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$consumers = $this->getConsumers($input->getOption('direct'));
+ $asJson = $input->getOption('json');
- echo join(" ", $consumers->getArrayCopy());
+ $output->write($asJson ? json_encode($consumers) : join(" ", $consumers));
}
protected function configure()
{
$this
->setName('pipeline:frontend:list')
->addOption('direct', null, InputOption::VALUE_NONE)
+ ->addOption('json', null, InputOption::VALUE_NONE)
;
}
protected function getConsumers(bool $directConsumers)
{
$serviceId = $directConsumers ? "pipeline.consumers.direct" : "pipeline.consumers";
- return $this->getContainer()->get($serviceId);
+ return $this->getContainer()->get($serviceId)->getArrayCopy();
? ++++++++++++++++
}
} | 6 | 0.15 | 4 | 2 |
a56f94b9b994baa0d381b1908594cf9eca8066ef | cookbooks/apt/templates/default/hp.list.erb | cookbooks/apt/templates/default/hp.list.erb |
deb <%= @url %> trusty/current non-free
|
<% if node[:lsb][:release].to_f >= 16.04 -%>
deb <%= @url %> xenial/current non-free
<% else -%>
deb <%= @url %> trusty/current non-free
<% end -%>
| Use the xenial repository for HP tools on 16.04 and later | Use the xenial repository for HP tools on 16.04 and later
| HTML+ERB | apache-2.0 | tomhughes/openstreetmap-chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,openstreetmap/chef,tomhughes/openstreetmap-chef,Firefishy/chef,Firefishy/chef,Firefishy/chef,Firefishy/chef,openstreetmap/chef,tomhughes/openstreetmap-chef,openstreetmap/chef,Firefishy/chef,Firefishy/chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,zerebubuth/openstreetmap-chef,openstreetmap/chef,tomhughes/openstreetmap-chef,openstreetmap/chef,Firefishy/chef,tomhughes/openstreetmap-chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,Firefishy/chef | html+erb | ## Code Before:
deb <%= @url %> trusty/current non-free
## Instruction:
Use the xenial repository for HP tools on 16.04 and later
## Code After:
<% if node[:lsb][:release].to_f >= 16.04 -%>
deb <%= @url %> xenial/current non-free
<% else -%>
deb <%= @url %> trusty/current non-free
<% end -%>
|
+ <% if node[:lsb][:release].to_f >= 16.04 -%>
+ deb <%= @url %> xenial/current non-free
+ <% else -%>
deb <%= @url %> trusty/current non-free
+ <% end -%> | 4 | 2 | 4 | 0 |
4a1156e7ed3598903fd6643535259a1d92df2736 | sw/device/lib/dif/dif_edn.c | sw/device/lib/dif/dif_edn.c | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/dif/dif_edn.h"
#include "edn_regs.h" // Generated
| // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/dif/dif_edn.h"
#include "edn_regs.h" // Generated
dif_result_t dif_edn_init(mmio_region_t base_addr, dif_edn_t *edn) {
if (edn == NULL) {
return kDifBadArg;
}
edn->base_addr = base_addr;
return kDifOk;
}
| Add init DIF for EDN | [sw/dif/edn] Add init DIF for EDN
This enables EDN irqs to be tested with the automated irq test.
Signed-off-by: Srikrishna Iyer <2803d640feace36379942447842f26c7747b4dc3@google.com>
| C | apache-2.0 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan | c | ## Code Before:
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/dif/dif_edn.h"
#include "edn_regs.h" // Generated
## Instruction:
[sw/dif/edn] Add init DIF for EDN
This enables EDN irqs to be tested with the automated irq test.
Signed-off-by: Srikrishna Iyer <2803d640feace36379942447842f26c7747b4dc3@google.com>
## Code After:
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/dif/dif_edn.h"
#include "edn_regs.h" // Generated
dif_result_t dif_edn_init(mmio_region_t base_addr, dif_edn_t *edn) {
if (edn == NULL) {
return kDifBadArg;
}
edn->base_addr = base_addr;
return kDifOk;
}
| // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/dif/dif_edn.h"
#include "edn_regs.h" // Generated
+
+ dif_result_t dif_edn_init(mmio_region_t base_addr, dif_edn_t *edn) {
+ if (edn == NULL) {
+ return kDifBadArg;
+ }
+
+ edn->base_addr = base_addr;
+
+ return kDifOk;
+ } | 10 | 1.428571 | 10 | 0 |
c12146a840b8da7457ce373605629981e168acd9 | t/File-Object/04-new.t | t/File-Object/04-new.t | use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 3;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n");
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n");
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
| use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 5;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n", 'Bad \'\' parameter.');
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n",
'Bad \'something\' parameter.');
# Test.
eval {
File::Object->new(
'type' => 'XXX',
);
};
is($EVAL_ERROR, "Bad 'type' parameter.\n", 'Bad \'type\' parameter.');
# Test.
eval {
File::Object->new(
'dir' => 'BAD_ARRAY',
);
};
is($EVAL_ERROR, "'dir' parameter must be a reference to array.\n",
'Bad \'dir\' parameter.');
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
| Add test comments. Add two new tests. | Add test comments. Add two new tests.
| Perl | bsd-2-clause | tupinek/File-Object | perl | ## Code Before:
use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 3;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n");
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n");
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
## Instruction:
Add test comments. Add two new tests.
## Code After:
use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 5;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n", 'Bad \'\' parameter.');
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n",
'Bad \'something\' parameter.');
# Test.
eval {
File::Object->new(
'type' => 'XXX',
);
};
is($EVAL_ERROR, "Bad 'type' parameter.\n", 'Bad \'type\' parameter.');
# Test.
eval {
File::Object->new(
'dir' => 'BAD_ARRAY',
);
};
is($EVAL_ERROR, "'dir' parameter must be a reference to array.\n",
'Bad \'dir\' parameter.');
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
| use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
- use Test::More 'tests' => 3;
? ^
+ use Test::More 'tests' => 5;
? ^
# Test.
eval {
File::Object->new('');
};
- is($EVAL_ERROR, "Unknown parameter ''.\n");
+ is($EVAL_ERROR, "Unknown parameter ''.\n", 'Bad \'\' parameter.');
? +++++++++++++++++++++++
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
- is($EVAL_ERROR, "Unknown parameter 'something'.\n");
? ^^
+ is($EVAL_ERROR, "Unknown parameter 'something'.\n",
? ^
+ 'Bad \'something\' parameter.');
+
+ # Test.
+ eval {
+ File::Object->new(
+ 'type' => 'XXX',
+ );
+ };
+ is($EVAL_ERROR, "Bad 'type' parameter.\n", 'Bad \'type\' parameter.');
+
+ # Test.
+ eval {
+ File::Object->new(
+ 'dir' => 'BAD_ARRAY',
+ );
+ };
+ is($EVAL_ERROR, "'dir' parameter must be a reference to array.\n",
+ 'Bad \'dir\' parameter.');
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object'); | 24 | 0.96 | 21 | 3 |
e164a50432f4f133e07d864a1923852754924f34 | byceps/services/authentication/service.py | byceps/services/authentication/service.py |
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password import service as password_service
def authenticate(screen_name: str, password: str) -> User:
"""Try to authenticate the user.
Return the user object on success, or raise an exception on failure.
"""
# Look up user.
user = user_service.find_user_by_screen_name(screen_name)
if user is None:
# Screen name is unknown.
raise AuthenticationFailed()
# Verify credentials.
if not password_service.is_password_valid_for_user(user.id, password):
# Password does not match.
raise AuthenticationFailed()
# Account must be active.
if not user.is_active:
# User account is disabled.
raise AuthenticationFailed()
return user
|
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password import service as password_service
def authenticate(screen_name: str, password: str) -> User:
"""Try to authenticate the user.
Return the user object on success, or raise an exception on failure.
"""
# Look up user.
user = user_service.find_user_by_screen_name(screen_name)
if user is None:
# Screen name is unknown.
raise AuthenticationFailed()
# Account must be active.
if not user.is_active:
# User account is disabled.
raise AuthenticationFailed()
# Verify credentials.
if not password_service.is_password_valid_for_user(user.id, password):
# Password does not match.
raise AuthenticationFailed()
return user
| Check for account activity before password verification | Check for account activity before password verification
| Python | bsd-3-clause | m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | python | ## Code Before:
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password import service as password_service
def authenticate(screen_name: str, password: str) -> User:
"""Try to authenticate the user.
Return the user object on success, or raise an exception on failure.
"""
# Look up user.
user = user_service.find_user_by_screen_name(screen_name)
if user is None:
# Screen name is unknown.
raise AuthenticationFailed()
# Verify credentials.
if not password_service.is_password_valid_for_user(user.id, password):
# Password does not match.
raise AuthenticationFailed()
# Account must be active.
if not user.is_active:
# User account is disabled.
raise AuthenticationFailed()
return user
## Instruction:
Check for account activity before password verification
## Code After:
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password import service as password_service
def authenticate(screen_name: str, password: str) -> User:
"""Try to authenticate the user.
Return the user object on success, or raise an exception on failure.
"""
# Look up user.
user = user_service.find_user_by_screen_name(screen_name)
if user is None:
# Screen name is unknown.
raise AuthenticationFailed()
# Account must be active.
if not user.is_active:
# User account is disabled.
raise AuthenticationFailed()
# Verify credentials.
if not password_service.is_password_valid_for_user(user.id, password):
# Password does not match.
raise AuthenticationFailed()
return user
|
from ..user.models.user import User
from ..user import service as user_service
from .exceptions import AuthenticationFailed
from .password import service as password_service
def authenticate(screen_name: str, password: str) -> User:
"""Try to authenticate the user.
Return the user object on success, or raise an exception on failure.
"""
# Look up user.
user = user_service.find_user_by_screen_name(screen_name)
if user is None:
# Screen name is unknown.
raise AuthenticationFailed()
+ # Account must be active.
+ if not user.is_active:
+ # User account is disabled.
+ raise AuthenticationFailed()
+
# Verify credentials.
if not password_service.is_password_valid_for_user(user.id, password):
# Password does not match.
raise AuthenticationFailed()
- # Account must be active.
- if not user.is_active:
- # User account is disabled.
- raise AuthenticationFailed()
-
return user | 10 | 0.333333 | 5 | 5 |
61a8a3447e2e2e5ab9858e27cabb7fbd040cde12 | lib/burrow/client.rb | lib/burrow/client.rb | class Burrow::Client
attr_reader :message, :connection
def initialize(queue, method, params={})
@connection = Burrow::Connection.new(queue)
@message = Burrow::Message.new(method, params)
end
def self.call(queue, method, params)
new(queue, method, params).call
end
def call
publish
subscribe
end
def publish
connection.exchange.publish(
JSON.generate(message.attributes), {
correlation_id: message.id,
reply_to: connection.return_queue.name,
routing_key: connection.queue.name
}
)
end
def subscribe
response = nil
connection.return_queue.subscribe(block: true) do |delivery_info, properties, payload|
if properties[:correlation_id] == message.id
response = payload
delivery_info.consumer.cancel
end
end
JSON.parse(response)
end
end
| class Burrow::Client
attr_reader :connection
def initialize(queue)
@connection = Burrow::Connection.new(queue)
end
def publish(method, params={})
message = Burrow::Message.new(method, params)
connection.exchange.publish(
JSON.generate(message.attributes), {
correlation_id: message.id,
reply_to: connection.return_queue.name,
routing_key: connection.queue.name
}
)
response = nil
connection.return_queue.subscribe(block: true) do |delivery_info, properties, payload|
if properties[:correlation_id] == message.id
response = payload
delivery_info.consumer.cancel
end
end
JSON.parse(response)
end
end
| Bring the Client api in line with the Server | Bring the Client api in line with the Server
| Ruby | mit | tigrish/burrow | ruby | ## Code Before:
class Burrow::Client
attr_reader :message, :connection
def initialize(queue, method, params={})
@connection = Burrow::Connection.new(queue)
@message = Burrow::Message.new(method, params)
end
def self.call(queue, method, params)
new(queue, method, params).call
end
def call
publish
subscribe
end
def publish
connection.exchange.publish(
JSON.generate(message.attributes), {
correlation_id: message.id,
reply_to: connection.return_queue.name,
routing_key: connection.queue.name
}
)
end
def subscribe
response = nil
connection.return_queue.subscribe(block: true) do |delivery_info, properties, payload|
if properties[:correlation_id] == message.id
response = payload
delivery_info.consumer.cancel
end
end
JSON.parse(response)
end
end
## Instruction:
Bring the Client api in line with the Server
## Code After:
class Burrow::Client
attr_reader :connection
def initialize(queue)
@connection = Burrow::Connection.new(queue)
end
def publish(method, params={})
message = Burrow::Message.new(method, params)
connection.exchange.publish(
JSON.generate(message.attributes), {
correlation_id: message.id,
reply_to: connection.return_queue.name,
routing_key: connection.queue.name
}
)
response = nil
connection.return_queue.subscribe(block: true) do |delivery_info, properties, payload|
if properties[:correlation_id] == message.id
response = payload
delivery_info.consumer.cancel
end
end
JSON.parse(response)
end
end
| class Burrow::Client
- attr_reader :message, :connection
? ----------
+ attr_reader :connection
- def initialize(queue, method, params={})
+ def initialize(queue)
@connection = Burrow::Connection.new(queue)
- @message = Burrow::Message.new(method, params)
end
+ def publish(method, params={})
+ message = Burrow::Message.new(method, params)
- def self.call(queue, method, params)
- new(queue, method, params).call
- end
- def call
- publish
- subscribe
- end
-
- def publish
connection.exchange.publish(
JSON.generate(message.attributes), {
correlation_id: message.id,
reply_to: connection.return_queue.name,
routing_key: connection.queue.name
}
)
- end
- def subscribe
response = nil
connection.return_queue.subscribe(block: true) do |delivery_info, properties, payload|
if properties[:correlation_id] == message.id
response = payload
delivery_info.consumer.cancel
end
end
JSON.parse(response)
end
end | 18 | 0.473684 | 4 | 14 |
e380d669bc09e047282be1d91cc95a7651300141 | farms/tests/test_models.py | farms/tests/test_models.py | """Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = AddressFactory.create()
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
| """Unit test the farms models."""
from ..factories import AddressFactory
from ..models import Address
import pytest
def test_address_factory_generates_valid_address():
# GIVEN any state
# WHEN building a new address
address = AddressFactory.build()
# THEN it has all the information we want
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
@pytest.mark.django_db
def test_address_can_be_saved_and_retrieved():
# GIVEN a fresh address instance
address = AddressFactory.build()
street = address.street
postal_code = address.postal_code
# WHEN saving it to the database
address.save()
# THEN the db entry is correct
saved_address = Address.objects.last()
assert saved_address.street == street
assert saved_address.postal_code == postal_code
| Add integration test for Address model | Add integration test for Address model
| Python | mit | FlowFX/sturdy-potato,FlowFX/sturdy-potato,FlowFX/sturdy-potato | python | ## Code Before:
"""Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = AddressFactory.create()
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
## Instruction:
Add integration test for Address model
## Code After:
"""Unit test the farms models."""
from ..factories import AddressFactory
from ..models import Address
import pytest
def test_address_factory_generates_valid_address():
# GIVEN any state
# WHEN building a new address
address = AddressFactory.build()
# THEN it has all the information we want
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
@pytest.mark.django_db
def test_address_can_be_saved_and_retrieved():
# GIVEN a fresh address instance
address = AddressFactory.build()
street = address.street
postal_code = address.postal_code
# WHEN saving it to the database
address.save()
# THEN the db entry is correct
saved_address = Address.objects.last()
assert saved_address.street == street
assert saved_address.postal_code == postal_code
| """Unit test the farms models."""
- from farms.factories import AddressFactory
? ^^^^^
+ from ..factories import AddressFactory
? ^
+ from ..models import Address
- from mock import MagicMock
+ import pytest
- def test_address_factory_generates_valid_addresses_sort_of(mocker):
? ---------- ------
+ def test_address_factory_generates_valid_address():
- """Same test, but using pytest-mock."""
- mocker.patch('farms.models.Address.save', MagicMock(name="save"))
+ # GIVEN any state
+ # WHEN building a new address
+ address = AddressFactory.build()
+ # THEN it has all the information we want
- address = AddressFactory.create()
-
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
+
+
+ @pytest.mark.django_db
+ def test_address_can_be_saved_and_retrieved():
+ # GIVEN a fresh address instance
+ address = AddressFactory.build()
+ street = address.street
+ postal_code = address.postal_code
+
+ # WHEN saving it to the database
+ address.save()
+
+ # THEN the db entry is correct
+ saved_address = Address.objects.last()
+
+ assert saved_address.street == street
+ assert saved_address.postal_code == postal_code | 32 | 1.882353 | 25 | 7 |
0c60642bcd423d7d396614797a04f9d6b59e9559 | attributes/default.rb | attributes/default.rb |
default['nodejs']['install_method'] = 'source'
default['nodejs']['version'] = '0.8.16'
default['nodejs']['checksum'] = '2cd09d4227c787d6886be45dc54dad5aed779d7bd4b1e15ba930101d9d1ed2a4'
default['nodejs']['dir'] = '/usr/local'
default['nodejs']['npm'] = '1.2.0'
default['nodejs']['src_url'] = "http://nodejs.org/dist"
|
default['nodejs']['install_method'] = 'source'
default['nodejs']['version'] = '0.8.18'
default['nodejs']['checksum'] = '1d63dd42f9bd22f087585ddf80a881c6acbe1664891b1dda3b71306fe9ae00f9'
default['nodejs']['dir'] = '/usr/local'
default['nodejs']['npm'] = '1.2.0'
default['nodejs']['src_url'] = "http://nodejs.org/dist"
| Update to latest stable release | Update to latest stable release
| Ruby | apache-2.0 | redguide/nodejs,tas50/nodejs | ruby | ## Code Before:
default['nodejs']['install_method'] = 'source'
default['nodejs']['version'] = '0.8.16'
default['nodejs']['checksum'] = '2cd09d4227c787d6886be45dc54dad5aed779d7bd4b1e15ba930101d9d1ed2a4'
default['nodejs']['dir'] = '/usr/local'
default['nodejs']['npm'] = '1.2.0'
default['nodejs']['src_url'] = "http://nodejs.org/dist"
## Instruction:
Update to latest stable release
## Code After:
default['nodejs']['install_method'] = 'source'
default['nodejs']['version'] = '0.8.18'
default['nodejs']['checksum'] = '1d63dd42f9bd22f087585ddf80a881c6acbe1664891b1dda3b71306fe9ae00f9'
default['nodejs']['dir'] = '/usr/local'
default['nodejs']['npm'] = '1.2.0'
default['nodejs']['src_url'] = "http://nodejs.org/dist"
|
default['nodejs']['install_method'] = 'source'
- default['nodejs']['version'] = '0.8.16'
? ^
+ default['nodejs']['version'] = '0.8.18'
? ^
- default['nodejs']['checksum'] = '2cd09d4227c787d6886be45dc54dad5aed779d7bd4b1e15ba930101d9d1ed2a4'
+ default['nodejs']['checksum'] = '1d63dd42f9bd22f087585ddf80a881c6acbe1664891b1dda3b71306fe9ae00f9'
default['nodejs']['dir'] = '/usr/local'
default['nodejs']['npm'] = '1.2.0'
default['nodejs']['src_url'] = "http://nodejs.org/dist" | 4 | 0.571429 | 2 | 2 |
268c056b33bbebcacf329974e6d88467b1b90d1b | modules/ti.Network/osx/osx_network_status.cpp | modules/ti.Network/osx/osx_network_status.cpp | /**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2009, 2010 Appcelerator, Inc. All Rights Reserved.
*/
#include "../network_status.h"
#include <SystemConfiguration/SCNetworkReachability.h>
namespace ti
{
void NetworkStatus::InitializeLoop()
{
}
void NetworkStatus::CleanupLoop()
{
}
bool NetworkStatus::GetStatus()
{
static SCNetworkReachabilityRef primaryTarget =
SCNetworkReachabilityCreateWithName(0, "www.google.com");
if (!primaryTarget)
return true;
SCNetworkConnectionFlags flags;
SCNetworkReachabilityGetFlags(primaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
static SCNetworkReachabilityRef secondaryTarget =
SCNetworkReachabilityCreateWithName(0, "www.yahoo.com");
if (!secondaryTarget)
return true;
SCNetworkReachabilityGetFlags(secondaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
return false;
}
}
| /**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2009, 2010 Appcelerator, Inc. All Rights Reserved.
*/
#include "../network_status.h"
#include <SystemConfiguration/SCNetworkReachability.h>
namespace ti
{
static SCNetworkReachabilityRef primaryTarget = 0;
static SCNetworkReachabilityRef secondaryTarget = 0;
void NetworkStatus::InitializeLoop()
{
primaryTarget = SCNetworkReachabilityCreateWithName(0, "www.google.com");
secondaryTarget = SCNetworkReachabilityCreateWithName(0, "www.yahoo.com");
}
void NetworkStatus::CleanupLoop()
{
if (primaryTarget)
CFRelease(primaryTarget);
if (secondaryTarget)
CFRelease(secondaryTarget);
}
bool NetworkStatus::GetStatus()
{
if (!primaryTarget)
return true;
SCNetworkConnectionFlags flags;
SCNetworkReachabilityGetFlags(primaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
if (!secondaryTarget)
return true;
SCNetworkReachabilityGetFlags(secondaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
return false;
}
}
| Clean up allocated memory during shutdown in OS X NetworkStatus. | Clean up allocated memory during shutdown in OS X NetworkStatus.
| C++ | apache-2.0 | jvkops/titanium_desktop,appcelerator/titanium_desktop,appcelerator/titanium_desktop,appcelerator/titanium_desktop,appcelerator/titanium_desktop,wyrover/titanium_desktop,wyrover/titanium_desktop,jvkops/titanium_desktop,jvkops/titanium_desktop,wyrover/titanium_desktop,wyrover/titanium_desktop,appcelerator/titanium_desktop,wyrover/titanium_desktop,jvkops/titanium_desktop,wyrover/titanium_desktop,jvkops/titanium_desktop,jvkops/titanium_desktop | c++ | ## Code Before:
/**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2009, 2010 Appcelerator, Inc. All Rights Reserved.
*/
#include "../network_status.h"
#include <SystemConfiguration/SCNetworkReachability.h>
namespace ti
{
void NetworkStatus::InitializeLoop()
{
}
void NetworkStatus::CleanupLoop()
{
}
bool NetworkStatus::GetStatus()
{
static SCNetworkReachabilityRef primaryTarget =
SCNetworkReachabilityCreateWithName(0, "www.google.com");
if (!primaryTarget)
return true;
SCNetworkConnectionFlags flags;
SCNetworkReachabilityGetFlags(primaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
static SCNetworkReachabilityRef secondaryTarget =
SCNetworkReachabilityCreateWithName(0, "www.yahoo.com");
if (!secondaryTarget)
return true;
SCNetworkReachabilityGetFlags(secondaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
return false;
}
}
## Instruction:
Clean up allocated memory during shutdown in OS X NetworkStatus.
## Code After:
/**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2009, 2010 Appcelerator, Inc. All Rights Reserved.
*/
#include "../network_status.h"
#include <SystemConfiguration/SCNetworkReachability.h>
namespace ti
{
static SCNetworkReachabilityRef primaryTarget = 0;
static SCNetworkReachabilityRef secondaryTarget = 0;
void NetworkStatus::InitializeLoop()
{
primaryTarget = SCNetworkReachabilityCreateWithName(0, "www.google.com");
secondaryTarget = SCNetworkReachabilityCreateWithName(0, "www.yahoo.com");
}
void NetworkStatus::CleanupLoop()
{
if (primaryTarget)
CFRelease(primaryTarget);
if (secondaryTarget)
CFRelease(secondaryTarget);
}
bool NetworkStatus::GetStatus()
{
if (!primaryTarget)
return true;
SCNetworkConnectionFlags flags;
SCNetworkReachabilityGetFlags(primaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
if (!secondaryTarget)
return true;
SCNetworkReachabilityGetFlags(secondaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
return false;
}
}
| /**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2009, 2010 Appcelerator, Inc. All Rights Reserved.
*/
#include "../network_status.h"
#include <SystemConfiguration/SCNetworkReachability.h>
namespace ti
{
+ static SCNetworkReachabilityRef primaryTarget = 0;
+ static SCNetworkReachabilityRef secondaryTarget = 0;
+
void NetworkStatus::InitializeLoop()
{
+ primaryTarget = SCNetworkReachabilityCreateWithName(0, "www.google.com");
+ secondaryTarget = SCNetworkReachabilityCreateWithName(0, "www.yahoo.com");
}
void NetworkStatus::CleanupLoop()
{
+ if (primaryTarget)
+ CFRelease(primaryTarget);
+ if (secondaryTarget)
+ CFRelease(secondaryTarget);
}
bool NetworkStatus::GetStatus()
{
- static SCNetworkReachabilityRef primaryTarget =
- SCNetworkReachabilityCreateWithName(0, "www.google.com");
if (!primaryTarget)
return true;
SCNetworkConnectionFlags flags;
SCNetworkReachabilityGetFlags(primaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
- static SCNetworkReachabilityRef secondaryTarget =
- SCNetworkReachabilityCreateWithName(0, "www.yahoo.com");
if (!secondaryTarget)
return true;
SCNetworkReachabilityGetFlags(secondaryTarget, &flags);
if ((flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired))
return true;
return false;
}
} | 13 | 0.276596 | 9 | 4 |
d23d17717c12d0b43eec62fd3e4420351f16c100 | plugin/github-issues.vim | plugin/github-issues.vim | " File: github-issues.vim
" Version: 1.0.0
" Description: Pulls github issues into Vim
" Maintainer: Jonathan Warner <jaxbot@gmail.com> <http://github.com/jaxbot>
" Homepage: http://jaxbot.me/
" Repository: https://github.com/jaxbot/github-issues.vim
" License: Copyright (C) 2014 Jonathan Warner
" Released under the MIT license
" ======================================================================
"
if exists("g:github_issues_loaded") || &cp
finish
endif
let g:github_issues_loaded = "shi"
python <<NOMAS
import sys
import threading
import time
import vim
import json
import urllib2
def pullGithubAPIData():
data = urllib2.urlopen("https://api.github.com/repos/jaxbot/chrome-devtools.vim/issues").read()
issues = json.loads(data)
for issue in issues:
vim.current.buffer.append(str(issue["number"]) + " " + issue["title"])
vim.command("1delete _")
NOMAS
function! s:getGithubIssues()
silent edit github://issues
normal ggdG
set buftype=nofile
nnoremap <buffer> <cr> :normal ^y$<cr><C-^>p
python pullGithubAPIData()
endfunction
command! -nargs=0 GIssues call s:getGithubIssues()
| " File: github-issues.vim
" Version: 1.0.0
" Description: Pulls github issues into Vim
" Maintainer: Jonathan Warner <jaxbot@gmail.com> <http://github.com/jaxbot>
" Homepage: http://jaxbot.me/
" Repository: https://github.com/jaxbot/github-issues.vim
" License: Copyright (C) 2014 Jonathan Warner
" Released under the MIT license
" ======================================================================
"
if exists("g:github_issues_loaded") || &cp
finish
endif
let g:github_issues_loaded = "shi"
python <<NOMAS
import sys
import threading
import time
import vim
import json
import urllib2
def pullGithubAPIData():
data = urllib2.urlopen("https://api.github.com/repos/jaxbot/chrome-devtools.vim/issues").read()
issues = json.loads(data)
for issue in issues:
vim.current.buffer.append(str(issue["number"]) + " " + issue["title"])
vim.command("1delete _")
NOMAS
function! s:getGithubIssues()
silent split github://issues
normal ggdG
set buftype=nofile
nnoremap <buffer> <cr> :normal ^y$<cr>:q<cr><C-w>pp
python pullGithubAPIData()
endfunction
command! -nargs=0 GIssues call s:getGithubIssues()
| Make window load as split, then close | Make window load as split, then close
| VimL | mit | jonmorehouse/vimhub | viml | ## Code Before:
" File: github-issues.vim
" Version: 1.0.0
" Description: Pulls github issues into Vim
" Maintainer: Jonathan Warner <jaxbot@gmail.com> <http://github.com/jaxbot>
" Homepage: http://jaxbot.me/
" Repository: https://github.com/jaxbot/github-issues.vim
" License: Copyright (C) 2014 Jonathan Warner
" Released under the MIT license
" ======================================================================
"
if exists("g:github_issues_loaded") || &cp
finish
endif
let g:github_issues_loaded = "shi"
python <<NOMAS
import sys
import threading
import time
import vim
import json
import urllib2
def pullGithubAPIData():
data = urllib2.urlopen("https://api.github.com/repos/jaxbot/chrome-devtools.vim/issues").read()
issues = json.loads(data)
for issue in issues:
vim.current.buffer.append(str(issue["number"]) + " " + issue["title"])
vim.command("1delete _")
NOMAS
function! s:getGithubIssues()
silent edit github://issues
normal ggdG
set buftype=nofile
nnoremap <buffer> <cr> :normal ^y$<cr><C-^>p
python pullGithubAPIData()
endfunction
command! -nargs=0 GIssues call s:getGithubIssues()
## Instruction:
Make window load as split, then close
## Code After:
" File: github-issues.vim
" Version: 1.0.0
" Description: Pulls github issues into Vim
" Maintainer: Jonathan Warner <jaxbot@gmail.com> <http://github.com/jaxbot>
" Homepage: http://jaxbot.me/
" Repository: https://github.com/jaxbot/github-issues.vim
" License: Copyright (C) 2014 Jonathan Warner
" Released under the MIT license
" ======================================================================
"
if exists("g:github_issues_loaded") || &cp
finish
endif
let g:github_issues_loaded = "shi"
python <<NOMAS
import sys
import threading
import time
import vim
import json
import urllib2
def pullGithubAPIData():
data = urllib2.urlopen("https://api.github.com/repos/jaxbot/chrome-devtools.vim/issues").read()
issues = json.loads(data)
for issue in issues:
vim.current.buffer.append(str(issue["number"]) + " " + issue["title"])
vim.command("1delete _")
NOMAS
function! s:getGithubIssues()
silent split github://issues
normal ggdG
set buftype=nofile
nnoremap <buffer> <cr> :normal ^y$<cr>:q<cr><C-w>pp
python pullGithubAPIData()
endfunction
command! -nargs=0 GIssues call s:getGithubIssues()
| " File: github-issues.vim
" Version: 1.0.0
" Description: Pulls github issues into Vim
" Maintainer: Jonathan Warner <jaxbot@gmail.com> <http://github.com/jaxbot>
" Homepage: http://jaxbot.me/
" Repository: https://github.com/jaxbot/github-issues.vim
" License: Copyright (C) 2014 Jonathan Warner
" Released under the MIT license
" ======================================================================
"
if exists("g:github_issues_loaded") || &cp
finish
endif
let g:github_issues_loaded = "shi"
python <<NOMAS
import sys
import threading
import time
import vim
import json
import urllib2
def pullGithubAPIData():
data = urllib2.urlopen("https://api.github.com/repos/jaxbot/chrome-devtools.vim/issues").read()
issues = json.loads(data)
for issue in issues:
vim.current.buffer.append(str(issue["number"]) + " " + issue["title"])
vim.command("1delete _")
NOMAS
function! s:getGithubIssues()
- silent edit github://issues
? ^^
+ silent split github://issues
? ^^^
normal ggdG
set buftype=nofile
- nnoremap <buffer> <cr> :normal ^y$<cr><C-^>p
? ^
+ nnoremap <buffer> <cr> :normal ^y$<cr>:q<cr><C-w>pp
? ++++++ ^ +
python pullGithubAPIData()
endfunction
command! -nargs=0 GIssues call s:getGithubIssues()
| 4 | 0.095238 | 2 | 2 |
0a1f792691b1e5e0b93bec00daa54091b1f67fba | app/views/layouts/marketing.haml | app/views/layouts/marketing.haml | !!! 5
%html
%head
%meta{:charset => "utf-8"}
%title= "Stumpwise | Simply Powerful Campaigns"
=stylesheet_link_tag 'marketing.css'
=javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'
=javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js'
=javascript_include_tag 'jrails.js'
=yield :head
=yield | !!! 5
%html
%head
%meta{:charset => "utf-8"}
%title= "Stumpwise | Simply Powerful Campaigns"
=stylesheet_link_tag 'marketing.css'
=yield :head
=yield | Clear out partial encryption errors. | Clear out partial encryption errors. | Haml | mit | marclove/stumpwise,marclove/stumpwise | haml | ## Code Before:
!!! 5
%html
%head
%meta{:charset => "utf-8"}
%title= "Stumpwise | Simply Powerful Campaigns"
=stylesheet_link_tag 'marketing.css'
=javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'
=javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js'
=javascript_include_tag 'jrails.js'
=yield :head
=yield
## Instruction:
Clear out partial encryption errors.
## Code After:
!!! 5
%html
%head
%meta{:charset => "utf-8"}
%title= "Stumpwise | Simply Powerful Campaigns"
=stylesheet_link_tag 'marketing.css'
=yield :head
=yield | !!! 5
%html
%head
%meta{:charset => "utf-8"}
%title= "Stumpwise | Simply Powerful Campaigns"
=stylesheet_link_tag 'marketing.css'
- =javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'
- =javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js'
- =javascript_include_tag 'jrails.js'
=yield :head
=yield | 3 | 0.272727 | 0 | 3 |
4cad0cb70016c8aa27bedbdf925c3b3fe5db6e42 | natero/lib/natero/base.rb | natero/lib/natero/base.rb | class Natero::Base
extend Natero::RequestHelper
include Serializable
BASE_URI = 'https://api.natero.com'
VERSION_URI = '/api/v2'
REQUIRED_PARAMS = []
attr_reader :raw_response
def self.endpoint(*params)
params = [endpoint_path, params, Natero.api_key_uri].flatten.compact.map(&:to_s)
Natero.full_endpoint_uri(BASE_URI, VERSION_URI, params)
end
def self.endpoint_path
raise NotImplementedError.new('This method needs to be overridden in a child class.')
end
def self.json_data(body)
{ body: body, headers: json_headers }
end
def self.json_headers
{ 'Content-Type': 'application/json' }
end
def initialize(params, raw_response = nil)
missing_params = REQUIRED_PARAMS - params.keys
raise ArgumentError.new("Missing required params #{missing_params.join(', ')}") unless missing_params.empty?
params.each do |k, v|
instance_variable_set("@#{k}", v)
self.class.class_eval { attr_reader :"#{k}" }
end
@raw_response = raw_response
end
def to_json
serialize
end
end | class Natero::Base
extend Natero::RequestHelper
include Serializable
BASE_URI = 'https://api.natero.com'
VERSION_URI = '/api/v2'
REQUIRED_PARAMS = []
attr_reader :raw_response
def self.endpoint(*params)
params = [endpoint_path, params, Natero.api_key_uri].flatten.compact.map(&:to_s)
Natero.full_endpoint_uri(BASE_URI, VERSION_URI, params)
end
def self.endpoint_path
raise NotImplementedError.new(
'This method needs to be overridden in a child class. Proper implementation should return an array where '\
'each index contains a different part of the path. For example: [\'test\', \'best\'] becomes \'/test/best/\'.'
)
end
def self.json_data(body)
{ body: body, headers: json_headers }
end
def self.json_headers
{ 'Content-Type': 'application/json' }
end
def initialize(params, raw_response = nil)
missing_params = REQUIRED_PARAMS - params.keys
raise ArgumentError.new("Missing required params #{missing_params.join(', ')}") unless missing_params.empty?
params.each do |k, v|
instance_variable_set("@#{k}", v)
self.class.class_eval { attr_reader :"#{k}" }
end
@raw_response = raw_response
end
def to_json
serialize
end
end | Add better error message when a child class doesn't implement endpoint_path. | Add better error message when a child class doesn't implement endpoint_path.
| Ruby | mit | bonusly/natero,bonusly/natero | ruby | ## Code Before:
class Natero::Base
extend Natero::RequestHelper
include Serializable
BASE_URI = 'https://api.natero.com'
VERSION_URI = '/api/v2'
REQUIRED_PARAMS = []
attr_reader :raw_response
def self.endpoint(*params)
params = [endpoint_path, params, Natero.api_key_uri].flatten.compact.map(&:to_s)
Natero.full_endpoint_uri(BASE_URI, VERSION_URI, params)
end
def self.endpoint_path
raise NotImplementedError.new('This method needs to be overridden in a child class.')
end
def self.json_data(body)
{ body: body, headers: json_headers }
end
def self.json_headers
{ 'Content-Type': 'application/json' }
end
def initialize(params, raw_response = nil)
missing_params = REQUIRED_PARAMS - params.keys
raise ArgumentError.new("Missing required params #{missing_params.join(', ')}") unless missing_params.empty?
params.each do |k, v|
instance_variable_set("@#{k}", v)
self.class.class_eval { attr_reader :"#{k}" }
end
@raw_response = raw_response
end
def to_json
serialize
end
end
## Instruction:
Add better error message when a child class doesn't implement endpoint_path.
## Code After:
class Natero::Base
extend Natero::RequestHelper
include Serializable
BASE_URI = 'https://api.natero.com'
VERSION_URI = '/api/v2'
REQUIRED_PARAMS = []
attr_reader :raw_response
def self.endpoint(*params)
params = [endpoint_path, params, Natero.api_key_uri].flatten.compact.map(&:to_s)
Natero.full_endpoint_uri(BASE_URI, VERSION_URI, params)
end
def self.endpoint_path
raise NotImplementedError.new(
'This method needs to be overridden in a child class. Proper implementation should return an array where '\
'each index contains a different part of the path. For example: [\'test\', \'best\'] becomes \'/test/best/\'.'
)
end
def self.json_data(body)
{ body: body, headers: json_headers }
end
def self.json_headers
{ 'Content-Type': 'application/json' }
end
def initialize(params, raw_response = nil)
missing_params = REQUIRED_PARAMS - params.keys
raise ArgumentError.new("Missing required params #{missing_params.join(', ')}") unless missing_params.empty?
params.each do |k, v|
instance_variable_set("@#{k}", v)
self.class.class_eval { attr_reader :"#{k}" }
end
@raw_response = raw_response
end
def to_json
serialize
end
end | class Natero::Base
extend Natero::RequestHelper
include Serializable
BASE_URI = 'https://api.natero.com'
VERSION_URI = '/api/v2'
REQUIRED_PARAMS = []
attr_reader :raw_response
def self.endpoint(*params)
params = [endpoint_path, params, Natero.api_key_uri].flatten.compact.map(&:to_s)
Natero.full_endpoint_uri(BASE_URI, VERSION_URI, params)
end
def self.endpoint_path
- raise NotImplementedError.new('This method needs to be overridden in a child class.')
+ raise NotImplementedError.new(
+ 'This method needs to be overridden in a child class. Proper implementation should return an array where '\
+ 'each index contains a different part of the path. For example: [\'test\', \'best\'] becomes \'/test/best/\'.'
+ )
end
def self.json_data(body)
{ body: body, headers: json_headers }
end
def self.json_headers
{ 'Content-Type': 'application/json' }
end
def initialize(params, raw_response = nil)
missing_params = REQUIRED_PARAMS - params.keys
raise ArgumentError.new("Missing required params #{missing_params.join(', ')}") unless missing_params.empty?
params.each do |k, v|
instance_variable_set("@#{k}", v)
self.class.class_eval { attr_reader :"#{k}" }
end
@raw_response = raw_response
end
def to_json
serialize
end
end | 5 | 0.116279 | 4 | 1 |
cd51a94434bf698097fbab288057d2ec1cfd0964 | src/ui/document/doc.ts | src/ui/document/doc.ts | import anchorme from 'anchorme'
import { basename } from 'path'
import { loadFile } from '../../fs/load-file'
import * as storage from '../../fs/storage'
import { openLinksInExternalBrowser, setFileMenuItemsEnable } from '../../utils/general-utils'
import { anchormeOptions } from './anchorme-options'
import * as documentStyle from './document-style'
export class Doc {
private appName: string
private document: Document
private container: HTMLElement
constructor(appName: string, document: Document) {
this.appName = appName
this.document = document
this.container = document.getElementById('app_container')!
}
public open(filePath: string): void {
this.setTitle(`${basename(filePath)} - ${this.appName}`)
this.container.scrollIntoView()
this.setText(anchorme(loadFile(filePath), anchormeOptions))
documentStyle.setLinkColor(storage.getLinkColor())
openLinksInExternalBrowser()
setFileMenuItemsEnable(true)
}
public close(): void {
this.setTitle(this.appName)
this.setText('')
setFileMenuItemsEnable(false)
}
private setTitle(title: string): void {
this.document.title = title
}
private setText(text: string): void {
this.container.innerHTML = text
}
}
| import anchorme from 'anchorme'
import { basename } from 'path'
import { loadFile } from '../../fs/load-file'
import * as storage from '../../fs/storage'
import { openLinksInExternalBrowser, setFileMenuItemsEnable } from '../../utils/general-utils'
import { anchormeOptions } from './anchorme-options'
import * as documentStyle from './document-style'
export class Doc {
private appName: string
private document: Document
private container: HTMLElement
constructor(appName: string, document: Document) {
this.appName = appName
this.document = document
this.container = document.getElementById('app_container')!
}
public open(filePath: string): void {
this.setTitle(`${basename(filePath)} - ${this.appName}`)
this.container.scrollIntoView()
this.setText(anchorme(loadFile(filePath), anchormeOptions))
documentStyle.setLinkColor(storage.getLinkColor())
openLinksInExternalBrowser()
setFileMenuItemsEnable(true)
}
public close(): void {
this.setTitle(this.appName)
this.setText('')
setFileMenuItemsEnable(false)
}
private setTitle(title: string): void {
this.document.title = title
}
// Trim trailing spaces before newlines
private setText(text: string): void {
this.container.innerHTML = text.replace(/[^\S\r\n]+$/gm, '')
}
}
| Trim trailing spaces before newlines | Trim trailing spaces before newlines
| TypeScript | mit | nrlquaker/nfov,nrlquaker/nfov | typescript | ## Code Before:
import anchorme from 'anchorme'
import { basename } from 'path'
import { loadFile } from '../../fs/load-file'
import * as storage from '../../fs/storage'
import { openLinksInExternalBrowser, setFileMenuItemsEnable } from '../../utils/general-utils'
import { anchormeOptions } from './anchorme-options'
import * as documentStyle from './document-style'
export class Doc {
private appName: string
private document: Document
private container: HTMLElement
constructor(appName: string, document: Document) {
this.appName = appName
this.document = document
this.container = document.getElementById('app_container')!
}
public open(filePath: string): void {
this.setTitle(`${basename(filePath)} - ${this.appName}`)
this.container.scrollIntoView()
this.setText(anchorme(loadFile(filePath), anchormeOptions))
documentStyle.setLinkColor(storage.getLinkColor())
openLinksInExternalBrowser()
setFileMenuItemsEnable(true)
}
public close(): void {
this.setTitle(this.appName)
this.setText('')
setFileMenuItemsEnable(false)
}
private setTitle(title: string): void {
this.document.title = title
}
private setText(text: string): void {
this.container.innerHTML = text
}
}
## Instruction:
Trim trailing spaces before newlines
## Code After:
import anchorme from 'anchorme'
import { basename } from 'path'
import { loadFile } from '../../fs/load-file'
import * as storage from '../../fs/storage'
import { openLinksInExternalBrowser, setFileMenuItemsEnable } from '../../utils/general-utils'
import { anchormeOptions } from './anchorme-options'
import * as documentStyle from './document-style'
export class Doc {
private appName: string
private document: Document
private container: HTMLElement
constructor(appName: string, document: Document) {
this.appName = appName
this.document = document
this.container = document.getElementById('app_container')!
}
public open(filePath: string): void {
this.setTitle(`${basename(filePath)} - ${this.appName}`)
this.container.scrollIntoView()
this.setText(anchorme(loadFile(filePath), anchormeOptions))
documentStyle.setLinkColor(storage.getLinkColor())
openLinksInExternalBrowser()
setFileMenuItemsEnable(true)
}
public close(): void {
this.setTitle(this.appName)
this.setText('')
setFileMenuItemsEnable(false)
}
private setTitle(title: string): void {
this.document.title = title
}
// Trim trailing spaces before newlines
private setText(text: string): void {
this.container.innerHTML = text.replace(/[^\S\r\n]+$/gm, '')
}
}
| import anchorme from 'anchorme'
import { basename } from 'path'
import { loadFile } from '../../fs/load-file'
import * as storage from '../../fs/storage'
import { openLinksInExternalBrowser, setFileMenuItemsEnable } from '../../utils/general-utils'
import { anchormeOptions } from './anchorme-options'
import * as documentStyle from './document-style'
export class Doc {
private appName: string
private document: Document
private container: HTMLElement
constructor(appName: string, document: Document) {
this.appName = appName
this.document = document
this.container = document.getElementById('app_container')!
}
public open(filePath: string): void {
this.setTitle(`${basename(filePath)} - ${this.appName}`)
this.container.scrollIntoView()
this.setText(anchorme(loadFile(filePath), anchormeOptions))
documentStyle.setLinkColor(storage.getLinkColor())
openLinksInExternalBrowser()
setFileMenuItemsEnable(true)
}
public close(): void {
this.setTitle(this.appName)
this.setText('')
setFileMenuItemsEnable(false)
}
private setTitle(title: string): void {
this.document.title = title
}
+ // Trim trailing spaces before newlines
private setText(text: string): void {
- this.container.innerHTML = text
+ this.container.innerHTML = text.replace(/[^\S\r\n]+$/gm, '')
}
} | 3 | 0.071429 | 2 | 1 |
0014a87f653ce63830dc38ccb6ef368a843f6f98 | config/ember-try.js | config/ember-try.js | 'use strict';
const getChannelURL = require('ember-source-channel-url');
module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
scenarios: [
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
};
});
};
| 'use strict';
const getChannelURL = require('ember-source-channel-url');
module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
scenarios: [
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
};
});
};
| Remove Ember 2.12 from Ember Try config | Remove Ember 2.12 from Ember Try config
| JavaScript | mit | jpadilla/ember-cli-simple-auth-token,jpadilla/ember-simple-auth-token,jpadilla/ember-simple-auth-token,jpadilla/ember-cli-simple-auth-token | javascript | ## Code Before:
'use strict';
const getChannelURL = require('ember-source-channel-url');
module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
scenarios: [
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
};
});
};
## Instruction:
Remove Ember 2.12 from Ember Try config
## Code After:
'use strict';
const getChannelURL = require('ember-source-channel-url');
module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
scenarios: [
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
};
});
};
| 'use strict';
const getChannelURL = require('ember-source-channel-url');
module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
scenarios: [
- {
- name: 'ember-lts-2.12',
- npm: {
- devDependencies: {
- 'ember-source': '~2.12.0'
- }
- }
- },
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
};
});
}; | 8 | 0.114286 | 0 | 8 |
211316babb5c6069f48559a6ca31c0f9a96542f7 | lib/smartdown_flows/employee-parental-leave/employee-parental-leave.txt | lib/smartdown_flows/employee-parental-leave/employee-parental-leave.txt | meta_description: Employee parental leave
status: draft
satisfies_need: 101018
# Employee parental leave
TODO: write content
[start: circumstances]
| meta_description: Employee parental leave
status: draft
satisfies_need: 101018
# Employee parental leave
A draft of the Smart Answer for Shared Parental Leave. This is a working in
progress and has not been published yet and is only available on preview.
[start: circumstances]
| Improve the SPL start page | Improve the SPL start page
Try to manage expectations a bit, for anyone working on the flow, or
testing it. Make clear it's not live yet
| Text | mit | tadast/smart-answers,tadast/smart-answers,lutgendorff/smart-answers,stwalsh/smart-answers,alphagov/smart-answers,lutgendorff/smart-answers,tadast/smart-answers,askl56/smart-answers,aledelcueto/smart-answers,askl56/smart-answers,lutgendorff/smart-answers,ministryofjustice/smart-answers,alphagov/smart-answers,stwalsh/smart-answers,tadast/smart-answers,stwalsh/smart-answers,stwalsh/smart-answers,ministryofjustice/smart-answers,alphagov/smart-answers,aledelcueto/smart-answers,ministryofjustice/smart-answers,askl56/smart-answers,alphagov/smart-answers,askl56/smart-answers,lutgendorff/smart-answers,aledelcueto/smart-answers,aledelcueto/smart-answers | text | ## Code Before:
meta_description: Employee parental leave
status: draft
satisfies_need: 101018
# Employee parental leave
TODO: write content
[start: circumstances]
## Instruction:
Improve the SPL start page
Try to manage expectations a bit, for anyone working on the flow, or
testing it. Make clear it's not live yet
## Code After:
meta_description: Employee parental leave
status: draft
satisfies_need: 101018
# Employee parental leave
A draft of the Smart Answer for Shared Parental Leave. This is a working in
progress and has not been published yet and is only available on preview.
[start: circumstances]
| meta_description: Employee parental leave
status: draft
satisfies_need: 101018
# Employee parental leave
- TODO: write content
+ A draft of the Smart Answer for Shared Parental Leave. This is a working in
+ progress and has not been published yet and is only available on preview.
[start: circumstances] | 3 | 0.333333 | 2 | 1 |
fd5ffa436edfeaca29abacf273a60575a69bc427 | src/myevents/README.md | src/myevents/README.md |
This is the code used in the following video:
http://channel9.msdn.com/Events/windowsazure/learn/Node-JS-in-Windows-Azure |
This is the code used in the following video:
http://channel9.msdn.com/Events/windowsazure/learn/Node-JS-in-Windows-Azure
## Notice
This example has been updated to support current tooling API and more modern markup ('The Times They Are A Changin')
To see original example as it was written invoke this git command from console:
```
git checkout 1bf63bc957316182d346a43cc0add712360b338a
HEAD is now at 1bf63bc... Added myevents example.
``` | Add note about original example revert if required | Add note about original example revert if required
| Markdown | unlicense | peterblazejewicz/azure-nodejs-examples,peterblazejewicz/azure-nodejs-examples | markdown | ## Code Before:
This is the code used in the following video:
http://channel9.msdn.com/Events/windowsazure/learn/Node-JS-in-Windows-Azure
## Instruction:
Add note about original example revert if required
## Code After:
This is the code used in the following video:
http://channel9.msdn.com/Events/windowsazure/learn/Node-JS-in-Windows-Azure
## Notice
This example has been updated to support current tooling API and more modern markup ('The Times They Are A Changin')
To see original example as it was written invoke this git command from console:
```
git checkout 1bf63bc957316182d346a43cc0add712360b338a
HEAD is now at 1bf63bc... Added myevents example.
``` |
This is the code used in the following video:
http://channel9.msdn.com/Events/windowsazure/learn/Node-JS-in-Windows-Azure
+
+ ## Notice
+
+ This example has been updated to support current tooling API and more modern markup ('The Times They Are A Changin')
+
+ To see original example as it was written invoke this git command from console:
+ ```
+ git checkout 1bf63bc957316182d346a43cc0add712360b338a
+ HEAD is now at 1bf63bc... Added myevents example.
+ ``` | 10 | 2.5 | 10 | 0 |
783a18b1ed4e3053861315eccfee5bf55a467c02 | services/frontend/src/components/elements/account/follow.js | services/frontend/src/components/elements/account/follow.js | import React from 'react';
import steem from 'steem'
import { Button } from 'semantic-ui-react'
export default class AccountFollow extends React.Component {
constructor(props) {
super(props)
this.state = {
processing: false,
following: props.account.following || []
}
}
componentWillReceiveProps(nextProps) {
if(this.state.processing && nextProps.length !== this.state.following.length) {
this.setState({processing: false})
}
}
follow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "follow",
who: this.props.who
})
}
unfollow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "unfollow",
who: this.props.who
})
}
render() {
const loading = (this.state.processing || !this.props.account || !this.props.account.following)
const following = (this.props.account.following && this.props.account.following.indexOf(this.props.who) !== -1)
return (
<Button
color={(loading) ? 'grey' : (following) ? 'orange' : 'green' }
content={(following) ? 'Unfollow' : 'Follow'}
loading={loading}
onClick={(loading) ? () => {} : (following) ? this.unfollow : this.follow}
/>
)
}
}
| import React from 'react';
import steem from 'steem'
import { Button } from 'semantic-ui-react'
export default class AccountFollow extends React.Component {
constructor(props) {
super(props)
this.state = {
processing: false,
following: props.account.following || []
}
}
componentWillReceiveProps(nextProps) {
if(this.state.processing && nextProps.length !== this.state.following.length) {
this.setState({processing: false})
}
}
follow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "follow",
who: this.props.who
})
}
unfollow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "unfollow",
who: this.props.who
})
}
render() {
if(this.props.account.name === this.props.who) return false
const loading = (this.state.processing || !this.props.account || !this.props.account.following)
const following = (this.props.account.following && this.props.account.following.indexOf(this.props.who) !== -1)
return (
<Button
color={(loading) ? 'grey' : (following) ? 'orange' : 'green' }
content={(following) ? 'Unfollow' : 'Follow'}
loading={loading}
onClick={(loading) ? () => {} : (following) ? this.unfollow : this.follow}
/>
)
}
}
| Hide for your own account. | Hide for your own account.
| JavaScript | mit | aaroncox/chainbb,aaroncox/chainbb | javascript | ## Code Before:
import React from 'react';
import steem from 'steem'
import { Button } from 'semantic-ui-react'
export default class AccountFollow extends React.Component {
constructor(props) {
super(props)
this.state = {
processing: false,
following: props.account.following || []
}
}
componentWillReceiveProps(nextProps) {
if(this.state.processing && nextProps.length !== this.state.following.length) {
this.setState({processing: false})
}
}
follow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "follow",
who: this.props.who
})
}
unfollow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "unfollow",
who: this.props.who
})
}
render() {
const loading = (this.state.processing || !this.props.account || !this.props.account.following)
const following = (this.props.account.following && this.props.account.following.indexOf(this.props.who) !== -1)
return (
<Button
color={(loading) ? 'grey' : (following) ? 'orange' : 'green' }
content={(following) ? 'Unfollow' : 'Follow'}
loading={loading}
onClick={(loading) ? () => {} : (following) ? this.unfollow : this.follow}
/>
)
}
}
## Instruction:
Hide for your own account.
## Code After:
import React from 'react';
import steem from 'steem'
import { Button } from 'semantic-ui-react'
export default class AccountFollow extends React.Component {
constructor(props) {
super(props)
this.state = {
processing: false,
following: props.account.following || []
}
}
componentWillReceiveProps(nextProps) {
if(this.state.processing && nextProps.length !== this.state.following.length) {
this.setState({processing: false})
}
}
follow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "follow",
who: this.props.who
})
}
unfollow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "unfollow",
who: this.props.who
})
}
render() {
if(this.props.account.name === this.props.who) return false
const loading = (this.state.processing || !this.props.account || !this.props.account.following)
const following = (this.props.account.following && this.props.account.following.indexOf(this.props.who) !== -1)
return (
<Button
color={(loading) ? 'grey' : (following) ? 'orange' : 'green' }
content={(following) ? 'Unfollow' : 'Follow'}
loading={loading}
onClick={(loading) ? () => {} : (following) ? this.unfollow : this.follow}
/>
)
}
}
| import React from 'react';
import steem from 'steem'
import { Button } from 'semantic-ui-react'
export default class AccountFollow extends React.Component {
constructor(props) {
super(props)
this.state = {
processing: false,
following: props.account.following || []
}
}
componentWillReceiveProps(nextProps) {
if(this.state.processing && nextProps.length !== this.state.following.length) {
this.setState({processing: false})
}
}
follow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "follow",
who: this.props.who
})
}
unfollow = (e) => {
this.setState({processing: true})
this.props.actions.follow({
account: this.props.account,
action: "unfollow",
who: this.props.who
})
}
render() {
+ if(this.props.account.name === this.props.who) return false
const loading = (this.state.processing || !this.props.account || !this.props.account.following)
const following = (this.props.account.following && this.props.account.following.indexOf(this.props.who) !== -1)
return (
<Button
color={(loading) ? 'grey' : (following) ? 'orange' : 'green' }
content={(following) ? 'Unfollow' : 'Follow'}
loading={loading}
onClick={(loading) ? () => {} : (following) ? this.unfollow : this.follow}
/>
)
}
} | 1 | 0.021277 | 1 | 0 |
f8cb37f6373f230756c9329c0f266d16018783ff | install_awesome_vimrc.sh | install_awesome_vimrc.sh | cd ~/.vim_runtime
git submodule init
git submodule update
echo 'set runtimepath=~/.vim_runtime,~/.vim_runtime/after,\$VIMRUNTIME
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
try
source ~/.vim_runtime/my_configs.vim
catch
endtry' > ~/.vimrc
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
| cd ~/.vim_runtime
git submodule init
git submodule update
echo 'set runtimepath+=~/.vim_runtime
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
try
source ~/.vim_runtime/my_configs.vim
catch
endtry' > ~/.vimrc
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
| Add to the runtime path instead of reseting it | Add to the runtime path instead of reseting it
| Shell | mit | nahwar/my-vim-config,krruzic/vimrc,xelliott/vimrc,jcestlavie/vimrc,daniilguit/vimrc,ChrisOHu/vimrc-1,saullocastro/vimrc,jladuval/vimrc,khatchad/vimrc,khatchad/vimrc,longlinht/vimrc,alexjab/vimrc,spino327/vimrcsp,nahwar/my-vim-config,ChrisOHu/vimrc-1,stevenswong/vimrc,zztoy/vimrc,vladimiraerov/vimrc,phylroy/vimrc,jladuval/vimrc,phylroy/vimrc,DocHoncho/vimrc,killuazhu/vimrc,ballercat/vim-settings,anymuse/vimrc,spino327/vimrcsp,markguo/myvimconf,jcftang/vimrc,vladimiraerov/vimrc,NcLang/vimrc,dineshg13/vim_runtime,nahwar/my-vim-config,abnerf/vimrc,alexnguyen91/vimrc,alexjab/vimrc,ballercat/vim-settings,tkshredz23/vimrc,davespanton/vimrc,xuev/vimrc,jcftang/vimrc,stefano-garzarella/vimrc,dezull/vimrc,dineshg13/vim_runtime,dpendolino/vimrc,lavender-flowerdew/vimrc,phylroy/vimrc,wming126/vimrc_github,RobertTheNerd/vimrc,nalajcie/vimrc,amix/vimrc,wilgoszpl/vimrc,derwentx/vimrc,lavender-flowerdew/vimrc,stevenswong/vimrc,stevenswong/vimrc,ivan19871002/vimrc,guangyy/vimrc,mishadev/vimrc,dpendolino/vimrc,davespanton/vimrc,abnerf/vimrc,guangyy/vimrc,khatchad/vimrc,derwentx/vimrc,NcLang/vimrc,stevenswong/vimrc,ChrisOHu/vimrc,wming126/vimrc_github,vladimiraerov/vimrc,reAsOn2010/vimrc,khatchad/vimrc,sonictk/vimrc,ballercat/vim-settings,freohr/vimrc,jcestlavie/vimrc,guangyy/vimrc,timothyjamesjensen/vimrc,alexjab/vimrc,jcestlavie/vimrc,timothyjamesjensen/vimrc,UX-Anakin/VIMRC,jimjing/vimrc,xelliott/vimrc,saullocastro/vimrc,mishadev/vimrc,jimjing/vimrc,sonictk/vimrc,dineshg13/vim_runtime,sonictk/vimrc,off99555/vimrc,tkshredz23/vimrc,ChrisOHu/vimrc-1,jcestlavie/vimrc,NcLang/vimrc,davespanton/vimrc,RobertTheNerd/vimrc,zztoy/vimrc,off99555/vimrc,zztoy/vimrc,jcftang/vimrc,markguo/myvimconf,DocHoncho/vimrc,amix/vimrc,longlinht/vimrc,DocHoncho/vimrc,off99555/vimrc,hyliker/vimrc,UX-Anakin/VIMRC,khatchad/vimrc,alexjab/vimrc,ChrisOHu/vimrc,tkshredz23/vimrc,killuazhu/vimrc,dineshg13/vim_runtime,ChrisOHu/vimrc-1,sonictk/vimrc,khatchad/vimrc,xuev/vimrc,RobertTheNerd/vimrc,dezull/vimrc,sonictk/vimrc,qhadron/vim_config,khatchad/vimrc,spino327/vimrcsp,saullocastro/vimrc,amix/vimrc,trevorijones/vimrc,dpendolino/vimrc,xuev/vimrc,davespanton/vimrc,dpendolino/vimrc,ChrisOHu/vimrc-1,ChrisOHu/vimrc,jladuval/vimrc,lavender-flowerdew/vimrc,wming126/vimrc_github,dezull/vimrc,wming126/vimrc_github,iwifigame/vimrc,hyliker/vimrc,umayr/vimrc,guangyy/vimrc,ekcode/vimrc,sabaka/vimrc,qhadron/vim_config,mishadev/vimrc,rageofjerry/vimrc,anymuse/vimrc,alexnguyen91/vimrc,abnerf/vimrc,nalajcie/vimrc,phylroy/vimrc,sonictk/vimrc,IanZhao/.vim,anymuse/vimrc,khatchad/vimrc,xuev/vimrc,zztoy/vimrc,spino327/vimrcsp,khatchad/vimrc,ballercat/vim-settings,mishadev/vimrc,anymuse/vimrc,markguo/myvimconf,dezull/vimrc,daniilguit/vimrc,timothyjamesjensen/vimrc,killuazhu/vimrc,hyliker/vimrc,jimjing/vimrc,wming126/vimrc_github,nalajcie/vimrc,nalajcie/vimrc,alexjab/vimrc,qhadron/vim_config,stefano-garzarella/vimrc,khatchad/vimrc,qhadron/vim_config,lavender-flowerdew/vimrc,jcestlavie/vimrc,timothyjamesjensen/vimrc,ChrisOHu/vimrc,vladimiraerov/vimrc,spino327/vimrcsp,jcftang/vimrc,freohr/vimrc,stevenswong/vimrc,phylroy/vimrc,ekcode/vimrc,alexnguyen91/vimrc,UX-Anakin/VIMRC,tkshredz23/vimrc,NcLang/vimrc,off99555/vimrc,mishadev/vimrc,daniilguit/vimrc,mishadev/vimrc,liangxiaoju/vimrc,khatchad/vimrc,dpendolino/vimrc,jcftang/vimrc,tkshredz23/vimrc,khatchad/vimrc,hyliker/vimrc,liangxiaoju/vimrc,RobertTheNerd/vimrc,guangyy/vimrc,saullocastro/vimrc,reAsOn2010/vimrc,liangxiaoju/vimrc,daniilguit/vimrc,alexnguyen91/vimrc,longlinht/vimrc,abnerf/vimrc,DocHoncho/vimrc,abnerf/vimrc,stefano-garzarella/vimrc,nalajcie/vimrc,killuazhu/vimrc,dineshg13/vim_runtime,derwentx/vimrc,reAsOn2010/vimrc,dpendolino/vimrc,amix/vimrc,wming126/vimrc_github,NcLang/vimrc,daniilguit/vimrc,ballercat/vim-settings,phylroy/vimrc,vladimiraerov/vimrc,abnerf/vimrc,iwifigame/vimrc,hyliker/vimrc,wilgoszpl/vimrc,timothyjamesjensen/vimrc,ChrisOHu/vimrc,ChrisOHu/vimrc-1,nahwar/my-vim-config,killuazhu/vimrc,IanZhao/.vim,NcLang/vimrc,jimjing/vimrc,reAsOn2010/vimrc,zztoy/vimrc,spino327/vimrcsp,timothyjamesjensen/vimrc,jcestlavie/vimrc,longlinht/vimrc,ekcode/vimrc,lavender-flowerdew/vimrc,davespanton/vimrc,phylroy/vimrc,UX-Anakin/VIMRC,anymuse/vimrc,daniilguit/vimrc,dezull/vimrc,xuev/vimrc,longlinht/vimrc,markguo/myvimconf,xelliott/vimrc,stevenswong/vimrc,UX-Anakin/VIMRC,lavender-flowerdew/vimrc,longlinht/vimrc,xelliott/vimrc,alexjab/vimrc,ekcode/vimrc,egeniesse/vimrc,anymuse/vimrc,hyliker/vimrc,reAsOn2010/vimrc,ChrisOHu/vimrc,NcLang/vimrc,nahwar/my-vim-config,liangxiaoju/vimrc,zztoy/vimrc,qhadron/vim_config,orland0m/vimrc,UX-Anakin/VIMRC,stefano-garzarella/vimrc,trevorijones/vimrc,ChrisOHu/vimrc,jimjing/vimrc,khatchad/vimrc,killuazhu/vimrc,nahwar/my-vim-config,saullocastro/vimrc,off99555/vimrc,markguo/myvimconf,stefano-garzarella/vimrc,xelliott/vimrc,markguo/myvimconf,ivan19871002/vimrc,stefano-garzarella/vimrc,ivan19871002/vimrc,ivan19871002/vimrc,wming126/vimrc_github,dezull/vimrc,DocHoncho/vimrc,fno2010/vimrc,vladimiraerov/vimrc,saullocastro/vimrc,khatchad/vimrc,khatchad/vimrc | shell | ## Code Before:
cd ~/.vim_runtime
git submodule init
git submodule update
echo 'set runtimepath=~/.vim_runtime,~/.vim_runtime/after,\$VIMRUNTIME
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
try
source ~/.vim_runtime/my_configs.vim
catch
endtry' > ~/.vimrc
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
## Instruction:
Add to the runtime path instead of reseting it
## Code After:
cd ~/.vim_runtime
git submodule init
git submodule update
echo 'set runtimepath+=~/.vim_runtime
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
try
source ~/.vim_runtime/my_configs.vim
catch
endtry' > ~/.vimrc
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
| cd ~/.vim_runtime
git submodule init
git submodule update
- echo 'set runtimepath=~/.vim_runtime,~/.vim_runtime/after,\$VIMRUNTIME
+ echo 'set runtimepath+=~/.vim_runtime
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
try
source ~/.vim_runtime/my_configs.vim
catch
endtry' > ~/.vimrc
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)" | 2 | 0.117647 | 1 | 1 |
e3859a6937aa4848c9940f7e6bbecfa35bd845bc | src/cli.js | src/cli.js |
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory that contains your built Electron app (e.g. with `electron-packager`)',
demand: true
})
.option('dest', {
describe: 'Directory that will contain the resulting Windows installer',
demand: true
})
.option('config', {
describe: 'JSON file that contains the metadata for your application',
config: true
})
.example('$0 --src dist/app/ --dest dist/installer/', 'use metadata from `dist/app/`')
.example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`')
.wrap(null)
.argv
console.log('Creating package (this may take a while)')
var options = _.omit(argv, ['$0', '_', 'version'])
installer(options, function (err) {
if (err) {
console.error(err, err.stack)
process.exit(1)
}
console.log('Successfully created package at ' + argv.dest)
})
|
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory that contains your built Electron app (e.g. with `electron-packager`)',
demand: true
})
.option('dest', {
describe: 'Directory that will contain the resulting Windows installer',
demand: true
})
.option('config', {
describe: 'JSON file that contains the metadata for your application',
config: true
})
.example('$0 --src dist/app/ --dest dist/installer/', 'use metadata from `dist/app/`')
.example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`')
.wrap(null)
.argv
console.log('Creating package (this may take a while)')
var options = _.omit(argv, ['$0', '_', 'version'])
installer(options)
.then(() => console.log(`Successfully created package at ${argv.dest}`))
.catch(err => {
console.error(err, err.stack)
process.exit(1)
})
| Use promise installer when using CLI | Use promise installer when using CLI
| JavaScript | mit | unindented/electron-installer-windows,unindented/electron-installer-windows | javascript | ## Code Before:
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory that contains your built Electron app (e.g. with `electron-packager`)',
demand: true
})
.option('dest', {
describe: 'Directory that will contain the resulting Windows installer',
demand: true
})
.option('config', {
describe: 'JSON file that contains the metadata for your application',
config: true
})
.example('$0 --src dist/app/ --dest dist/installer/', 'use metadata from `dist/app/`')
.example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`')
.wrap(null)
.argv
console.log('Creating package (this may take a while)')
var options = _.omit(argv, ['$0', '_', 'version'])
installer(options, function (err) {
if (err) {
console.error(err, err.stack)
process.exit(1)
}
console.log('Successfully created package at ' + argv.dest)
})
## Instruction:
Use promise installer when using CLI
## Code After:
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory that contains your built Electron app (e.g. with `electron-packager`)',
demand: true
})
.option('dest', {
describe: 'Directory that will contain the resulting Windows installer',
demand: true
})
.option('config', {
describe: 'JSON file that contains the metadata for your application',
config: true
})
.example('$0 --src dist/app/ --dest dist/installer/', 'use metadata from `dist/app/`')
.example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`')
.wrap(null)
.argv
console.log('Creating package (this may take a while)')
var options = _.omit(argv, ['$0', '_', 'version'])
installer(options)
.then(() => console.log(`Successfully created package at ${argv.dest}`))
.catch(err => {
console.error(err, err.stack)
process.exit(1)
})
|
var _ = require('lodash')
var yargs = require('yargs')
var installer = require('./installer')
var pkg = require('../package.json')
var argv = yargs
.version(pkg.version)
.usage(pkg.description + '\n\nUsage: $0 --src <inputdir> --dest <outputdir>')
.option('src', {
describe: 'Directory that contains your built Electron app (e.g. with `electron-packager`)',
demand: true
})
.option('dest', {
describe: 'Directory that will contain the resulting Windows installer',
demand: true
})
.option('config', {
describe: 'JSON file that contains the metadata for your application',
config: true
})
.example('$0 --src dist/app/ --dest dist/installer/', 'use metadata from `dist/app/`')
.example('$0 --src dist/app/ --dest dist/installer/ --config config.json', 'use metadata from `config.json`')
.wrap(null)
.argv
console.log('Creating package (this may take a while)')
var options = _.omit(argv, ['$0', '_', 'version'])
- installer(options, function (err) {
- if (err) {
+
+ installer(options)
+ .then(() => console.log(`Successfully created package at ${argv.dest}`))
+ .catch(err => {
console.error(err, err.stack)
process.exit(1)
- }
+ })
? +
-
- console.log('Successfully created package at ' + argv.dest)
- }) | 11 | 0.289474 | 5 | 6 |
195f6d80692f624af50d3221adf05228180b434d | config/initializers/delayed_job_config.rb | config/initializers/delayed_job_config.rb | SEEK::Application.configure do
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 3
Delayed::Worker.max_attempts = 1
Delayed::Worker.max_run_time = 1.day
Delayed::Worker.backend = :active_record
#Delayed::Worker.logger = Delayed::Worker.logger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/worker.log'),Logger::INFO)
#Delayed::Worker.logger.auto_flushing = 1
end
| SEEK::Application.configure do
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 3
Delayed::Worker.max_attempts = 1
Delayed::Worker.max_run_time = 1.day
Delayed::Worker.read_ahead = 20
Delayed::Worker.backend = :active_record
#Delayed::Worker.logger = Delayed::Worker.logger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/worker.log'),Logger::INFO)
#Delayed::Worker.logger.auto_flushing = 1
end
| Set Delayed job to read ahead more jobs. | Set Delayed job to read ahead more jobs.
This is so that seek jobs don't get trapped behind player jobs.
| Ruby | bsd-3-clause | stuzart/seek,HITS-SDBV/seek,aina1205/SysMO-DB-seek,aina1205/nmtrypi-seek,HITS-SDBV/nmtrypi-seek,aina1205/SysMO-DB-seek,HITS-SDBV/nmtrypi-seek,Virtual-Liver-Network/seek,SynthSys/seek,HITS-SDBV/nmtrypi-seek,kjgarza/frame_experiment,Virtual-Liver-Network/seek,BioVeL/seek,Virtual-Liver-Network/seek,kjgarza/frame_experiment,stuzart/seek,aina1205/nmtrypi-seek,SynthSys/seek,Virtual-Liver-Network/seek,aina1205/nmtrypi-seek,SynthSys/seek,aina1205/nmtrypi-seek,BioVeL/seek,stuzart/seek,BioVeL/seek,HITS-SDBV/seek,HITS-SDBV/seek,BioVeL/seek,aina1205/SysMO-DB-seek,kjgarza/frame_experiment,HITS-SDBV/nmtrypi-seek,SynthSys/seek,HITS-SDBV/seek,kjgarza/frame_experiment | ruby | ## Code Before:
SEEK::Application.configure do
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 3
Delayed::Worker.max_attempts = 1
Delayed::Worker.max_run_time = 1.day
Delayed::Worker.backend = :active_record
#Delayed::Worker.logger = Delayed::Worker.logger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/worker.log'),Logger::INFO)
#Delayed::Worker.logger.auto_flushing = 1
end
## Instruction:
Set Delayed job to read ahead more jobs.
This is so that seek jobs don't get trapped behind player jobs.
## Code After:
SEEK::Application.configure do
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 3
Delayed::Worker.max_attempts = 1
Delayed::Worker.max_run_time = 1.day
Delayed::Worker.read_ahead = 20
Delayed::Worker.backend = :active_record
#Delayed::Worker.logger = Delayed::Worker.logger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/worker.log'),Logger::INFO)
#Delayed::Worker.logger.auto_flushing = 1
end
| SEEK::Application.configure do
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 3
Delayed::Worker.max_attempts = 1
Delayed::Worker.max_run_time = 1.day
+ Delayed::Worker.read_ahead = 20
Delayed::Worker.backend = :active_record
#Delayed::Worker.logger = Delayed::Worker.logger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/worker.log'),Logger::INFO)
#Delayed::Worker.logger.auto_flushing = 1
end | 1 | 0.090909 | 1 | 0 |
8908927ef342b7763cce9d7b69c53a2a51dae4c9 | Sources/CommandLine.swift | Sources/CommandLine.swift | struct CommandLine {
var text = "Hello, World!"
}
| import Foundation
#if !os(macOS)
public typealias Process = Task
#endif
public typealias Command = String
public enum CommandLineResult {
case output(String)
case error(String)
}
/// Ref.: https://github.com/spotify/HubFramework/blob/master/live/sources/CommandLine.swift
public struct CommandLine {
public func execute(_ command: Command, with arguments: [String] = []) -> CommandLineResult {
let process = Process()
process.launchPath = command
process.arguments = arguments
let outputPipe = Pipe()
let errorPipe = Pipe()
process.standardOutput = outputPipe
process.standardError = errorPipe
process.launch()
if let errorOutput = output(from: errorPipe), errorOutput.characters.count > 0 {
return .error(errorOutput)
} else {
return .output(output(from: outputPipe) ?? "")
}
}
private func output(from pipe: Pipe) -> String? {
let outputData = pipe.fileHandleForReading.readDataToEndOfFile()
return String(data: outputData, encoding: .utf8)
}
}
| Add implementation of command line | Add implementation of command line
| Swift | apache-2.0 | swish-server/CommandLine | swift | ## Code Before:
struct CommandLine {
var text = "Hello, World!"
}
## Instruction:
Add implementation of command line
## Code After:
import Foundation
#if !os(macOS)
public typealias Process = Task
#endif
public typealias Command = String
public enum CommandLineResult {
case output(String)
case error(String)
}
/// Ref.: https://github.com/spotify/HubFramework/blob/master/live/sources/CommandLine.swift
public struct CommandLine {
public func execute(_ command: Command, with arguments: [String] = []) -> CommandLineResult {
let process = Process()
process.launchPath = command
process.arguments = arguments
let outputPipe = Pipe()
let errorPipe = Pipe()
process.standardOutput = outputPipe
process.standardError = errorPipe
process.launch()
if let errorOutput = output(from: errorPipe), errorOutput.characters.count > 0 {
return .error(errorOutput)
} else {
return .output(output(from: outputPipe) ?? "")
}
}
private func output(from pipe: Pipe) -> String? {
let outputData = pipe.fileHandleForReading.readDataToEndOfFile()
return String(data: outputData, encoding: .utf8)
}
}
| - struct CommandLine {
+ import Foundation
- var text = "Hello, World!"
+ #if !os(macOS)
+ public typealias Process = Task
+ #endif
+
+ public typealias Command = String
+
+ public enum CommandLineResult {
+
+ case output(String)
+ case error(String)
+
}
+
+ /// Ref.: https://github.com/spotify/HubFramework/blob/master/live/sources/CommandLine.swift
+ public struct CommandLine {
+
+ public func execute(_ command: Command, with arguments: [String] = []) -> CommandLineResult {
+ let process = Process()
+ process.launchPath = command
+ process.arguments = arguments
+
+ let outputPipe = Pipe()
+ let errorPipe = Pipe()
+ process.standardOutput = outputPipe
+ process.standardError = errorPipe
+ process.launch()
+
+ if let errorOutput = output(from: errorPipe), errorOutput.characters.count > 0 {
+ return .error(errorOutput)
+ } else {
+ return .output(output(from: outputPipe) ?? "")
+ }
+ }
+
+ private func output(from pipe: Pipe) -> String? {
+ let outputData = pipe.fileHandleForReading.readDataToEndOfFile()
+ return String(data: outputData, encoding: .utf8)
+ }
+
+ } | 42 | 10.5 | 40 | 2 |
15050d624dc9659d8ac9b8b172237a2284713773 | app/models/stop.rb | app/models/stop.rb | class Stop < ActiveRecord::Base
# Callbacks
before_save :convert_short_name
# Relations
has_and_belongs_to_many :routes
# Validations
validates :name, :presence => true
validates :short_name, :presence => true, :uniqueness => true
validates :longitude, :numericality => true, :inclusion => { :in => -180..180 }
validates :latitude, :numericality => true, :inclusion => { :in => -90..90}
# Scopes, so I don't have to type so much.
scope :enabled, where(:enabled => true)
scope :disabled, where(:enabled => false)
# I prefer to use the short name instead of the ID.
def to_param
short_name
end
# Convert the short-name to lowercase, which
# I am treating as the lowest common denominator.
def convert_short_name
short_name.downcase!
true # So the save doesn't give up?
end
end
| class Stop < ActiveRecord::Base
# Callbacks
before_save :convert_short_name
# Relations
has_and_belongs_to_many :routes
# Validations
validates :name, :presence => true
validates :short_name, :presence => true, :uniqueness => true
validates :longitude, :numericality => true, :inclusion => { :in => -180..180 }
validates :latitude, :numericality => true, :inclusion => { :in => -90..90}
# Scopes, so I don't have to type so much.
scope :enabled, where(:enabled => true)
scope :disabled, where(:enabled => false)
# I prefer to use the short name instead of the ID.
def to_param
short_name
end
# Convert the short-name to a parameter, which in
# this case tolerates [A-z0-9\-]
def convert_short_name
self.short_name = self.short_name.parameterize
true # So the save doesn't give up?
end
end
| Use a different method to clean up the short name. | Use a different method to clean up the short name.
| Ruby | mit | wtg/shuttle_tracking,wtg/shuttle_tracking,wtg/shuttle_tracking | ruby | ## Code Before:
class Stop < ActiveRecord::Base
# Callbacks
before_save :convert_short_name
# Relations
has_and_belongs_to_many :routes
# Validations
validates :name, :presence => true
validates :short_name, :presence => true, :uniqueness => true
validates :longitude, :numericality => true, :inclusion => { :in => -180..180 }
validates :latitude, :numericality => true, :inclusion => { :in => -90..90}
# Scopes, so I don't have to type so much.
scope :enabled, where(:enabled => true)
scope :disabled, where(:enabled => false)
# I prefer to use the short name instead of the ID.
def to_param
short_name
end
# Convert the short-name to lowercase, which
# I am treating as the lowest common denominator.
def convert_short_name
short_name.downcase!
true # So the save doesn't give up?
end
end
## Instruction:
Use a different method to clean up the short name.
## Code After:
class Stop < ActiveRecord::Base
# Callbacks
before_save :convert_short_name
# Relations
has_and_belongs_to_many :routes
# Validations
validates :name, :presence => true
validates :short_name, :presence => true, :uniqueness => true
validates :longitude, :numericality => true, :inclusion => { :in => -180..180 }
validates :latitude, :numericality => true, :inclusion => { :in => -90..90}
# Scopes, so I don't have to type so much.
scope :enabled, where(:enabled => true)
scope :disabled, where(:enabled => false)
# I prefer to use the short name instead of the ID.
def to_param
short_name
end
# Convert the short-name to a parameter, which in
# this case tolerates [A-z0-9\-]
def convert_short_name
self.short_name = self.short_name.parameterize
true # So the save doesn't give up?
end
end
| class Stop < ActiveRecord::Base
# Callbacks
before_save :convert_short_name
# Relations
has_and_belongs_to_many :routes
# Validations
validates :name, :presence => true
validates :short_name, :presence => true, :uniqueness => true
validates :longitude, :numericality => true, :inclusion => { :in => -180..180 }
validates :latitude, :numericality => true, :inclusion => { :in => -90..90}
# Scopes, so I don't have to type so much.
scope :enabled, where(:enabled => true)
scope :disabled, where(:enabled => false)
# I prefer to use the short name instead of the ID.
def to_param
short_name
end
- # Convert the short-name to lowercase, which
? ^^^ ----
+ # Convert the short-name to a parameter, which in
? ^^^^^^^^^ +++
- # I am treating as the lowest common denominator.
+ # this case tolerates [A-z0-9\-]
def convert_short_name
- short_name.downcase!
+ self.short_name = self.short_name.parameterize
true # So the save doesn't give up?
end
end | 6 | 0.2 | 3 | 3 |
c22c6c3a0927f224cb9a396173292ec2a332a74e | setup.py | setup.py | from setuptools import setup
setup(
name='polygraph',
version='0.1.0',
description='Python library for defining GraphQL schemas',
url='https://github.com/yen223/polygraph/',
author='Wei Yen, Lee',
author_email='hello@weiyen.net',
license='MIT',
install_requires=[
'marshmallow>=3.0.0b2',
'graphql-core>=1.0.1',
],
extras_require={
'dev': [
'flake8',
'ipython',
'autopep8',
]
}
)
| from setuptools import setup
setup(
name='polygraph',
version='0.1.0',
description='Python library for defining GraphQL schemas',
url='https://github.com/yen223/polygraph/',
author='Wei Yen, Lee',
author_email='hello@weiyen.net',
license='MIT',
install_requires=[
'marshmallow>=3.0.0b2',
'graphql-core>=1.0.1',
],
extras_require={
'dev': [
'flake8',
'ipython',
'autopep8',
'isort',
]
}
)
| Add isort as a development requirement | Add isort as a development requirement
| Python | mit | polygraph-python/polygraph | python | ## Code Before:
from setuptools import setup
setup(
name='polygraph',
version='0.1.0',
description='Python library for defining GraphQL schemas',
url='https://github.com/yen223/polygraph/',
author='Wei Yen, Lee',
author_email='hello@weiyen.net',
license='MIT',
install_requires=[
'marshmallow>=3.0.0b2',
'graphql-core>=1.0.1',
],
extras_require={
'dev': [
'flake8',
'ipython',
'autopep8',
]
}
)
## Instruction:
Add isort as a development requirement
## Code After:
from setuptools import setup
setup(
name='polygraph',
version='0.1.0',
description='Python library for defining GraphQL schemas',
url='https://github.com/yen223/polygraph/',
author='Wei Yen, Lee',
author_email='hello@weiyen.net',
license='MIT',
install_requires=[
'marshmallow>=3.0.0b2',
'graphql-core>=1.0.1',
],
extras_require={
'dev': [
'flake8',
'ipython',
'autopep8',
'isort',
]
}
)
| from setuptools import setup
setup(
name='polygraph',
version='0.1.0',
description='Python library for defining GraphQL schemas',
url='https://github.com/yen223/polygraph/',
author='Wei Yen, Lee',
author_email='hello@weiyen.net',
license='MIT',
install_requires=[
'marshmallow>=3.0.0b2',
'graphql-core>=1.0.1',
],
extras_require={
'dev': [
'flake8',
'ipython',
'autopep8',
+ 'isort',
]
}
) | 1 | 0.043478 | 1 | 0 |
5674c623ae955e55c4b4006d834a6ee8811158ae | recipes-graphics/xorg-xserver/libdri2_git.bb | recipes-graphics/xorg-xserver/libdri2_git.bb |
DESCRIPTION = "X.Org X server -- A10/A13 display driver"
PR = "1"
LICENSE = "MIT-X"
LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
SRC_URI = "git://github.com/robclark/libdri2.git;protocol=http;branch=master"
SRCREV_pn-${PN} = "4f1eef3183df2b270c3d5cbef07343ee5127a6a4"
S = "${WORKDIR}/git"
inherit autotools
|
DESCRIPTION = "Library for the DRI2 extension to the X Window System"
PR = "2"
DEPENDS = "libdrm libxext xextproto libxfixes"
LICENSE = "MIT-X"
LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
SRC_URI = "git://github.com/robclark/libdri2.git;protocol=http;branch=master"
SRCREV_pn-${PN} = "4f1eef3183df2b270c3d5cbef07343ee5127a6a4"
S = "${WORKDIR}/git"
inherit autotools
| Fix dependecies and description of libdri2 recipe. | Fix dependecies and description of libdri2 recipe.
| BitBake | mit | geomatsi/meta-sunxi,jlucius/meta-sunxi,O-Computers/meta-sunxi,soderstrom-rikard/meta-sunxi,linux-sunxi/meta-sunxi,twoerner/meta-sunxi,rofehr/meta-sunxi,soderstrom-rikard/meta-sunxi,rofehr/meta-sunxi,geomatsi/meta-sunxi,O-Computers/meta-sunxi,jlucius/meta-sunxi,linux-sunxi/meta-sunxi,jlucius/meta-sunxi,linux-sunxi/meta-sunxi,net147/meta-sunxi,O-Computers/meta-sunxi,rofehr/meta-sunxi,twoerner/meta-sunxi,ebutera/meta-sunxi,remahl/meta-sunxi,net147/meta-sunxi,ebutera/meta-sunxi | bitbake | ## Code Before:
DESCRIPTION = "X.Org X server -- A10/A13 display driver"
PR = "1"
LICENSE = "MIT-X"
LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
SRC_URI = "git://github.com/robclark/libdri2.git;protocol=http;branch=master"
SRCREV_pn-${PN} = "4f1eef3183df2b270c3d5cbef07343ee5127a6a4"
S = "${WORKDIR}/git"
inherit autotools
## Instruction:
Fix dependecies and description of libdri2 recipe.
## Code After:
DESCRIPTION = "Library for the DRI2 extension to the X Window System"
PR = "2"
DEPENDS = "libdrm libxext xextproto libxfixes"
LICENSE = "MIT-X"
LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
SRC_URI = "git://github.com/robclark/libdri2.git;protocol=http;branch=master"
SRCREV_pn-${PN} = "4f1eef3183df2b270c3d5cbef07343ee5127a6a4"
S = "${WORKDIR}/git"
inherit autotools
|
- DESCRIPTION = "X.Org X server -- A10/A13 display driver"
+ DESCRIPTION = "Library for the DRI2 extension to the X Window System"
- PR = "1"
? ^
+ PR = "2"
? ^
+
+ DEPENDS = "libdrm libxext xextproto libxfixes"
LICENSE = "MIT-X"
LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
SRC_URI = "git://github.com/robclark/libdri2.git;protocol=http;branch=master"
SRCREV_pn-${PN} = "4f1eef3183df2b270c3d5cbef07343ee5127a6a4"
S = "${WORKDIR}/git"
inherit autotools
| 6 | 0.375 | 4 | 2 |
1be65018f378557a722885b4567cca7f7bdaae48 | schemas/stsci.edu/asdf/core/externalarray-1.0.0.yaml | schemas/stsci.edu/asdf/core/externalarray-1.0.0.yaml | %YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/core/externalarray-1.0.0"
tag: "tag:stsci.edu:asdf/core/externalarray-1.0.0"
title: Point to an array-like object in an external file.
description: |
Allow referencing of array-like objects in external files. These files can be
any type of file and in any absolute or relative location to the asdf file.
Loading of these files into arrays is not handled by asdf.
examples:
-
- Example external reference
- |
!core/externalarray-1.0.0
datatype: int16
fileuri: aia.lev1_euv_12s.2017-09-06T120001Z.94.image_lev1.fits
shape: [4096, 4096]
target: 1
type: object
properties:
source:
type: string
target:
anyOf:
- type: integer
- type: string
datatype:
type: string
shape:
type: array
items:
anyOf:
- type: integer
minimum: 0
...
| %YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/core/externalarray-1.0.0"
tag: "tag:stsci.edu:asdf/core/externalarray-1.0.0"
title: Point to an array-like object in an external file.
description: |
Allow referencing of array-like objects in external files. These files can be
any type of file and in any absolute or relative location to the asdf file.
Loading of these files into arrays is not handled by asdf.
examples:
-
- Example external reference
- |
!core/externalarray-1.0.0
datatype: int16
fileuri: aia.lev1_euv_12s.2017-09-06T120001Z.94.image_lev1.fits
shape: [4096, 4096]
target: 1
type: object
properties:
source:
type: string
target:
anyOf:
- type: integer
- type: string
datatype:
type: string
shape:
type: array
items:
anyOf:
- type: integer
minimum: 0
requiredProperties: [source, target, datatype, shape]
additionalProperties: true
...
| Allow additional properties to enable more flexibility with readers | Allow additional properties to enable more flexibility with readers
| YAML | bsd-3-clause | spacetelescope/asdf-standard | yaml | ## Code Before:
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/core/externalarray-1.0.0"
tag: "tag:stsci.edu:asdf/core/externalarray-1.0.0"
title: Point to an array-like object in an external file.
description: |
Allow referencing of array-like objects in external files. These files can be
any type of file and in any absolute or relative location to the asdf file.
Loading of these files into arrays is not handled by asdf.
examples:
-
- Example external reference
- |
!core/externalarray-1.0.0
datatype: int16
fileuri: aia.lev1_euv_12s.2017-09-06T120001Z.94.image_lev1.fits
shape: [4096, 4096]
target: 1
type: object
properties:
source:
type: string
target:
anyOf:
- type: integer
- type: string
datatype:
type: string
shape:
type: array
items:
anyOf:
- type: integer
minimum: 0
...
## Instruction:
Allow additional properties to enable more flexibility with readers
## Code After:
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/core/externalarray-1.0.0"
tag: "tag:stsci.edu:asdf/core/externalarray-1.0.0"
title: Point to an array-like object in an external file.
description: |
Allow referencing of array-like objects in external files. These files can be
any type of file and in any absolute or relative location to the asdf file.
Loading of these files into arrays is not handled by asdf.
examples:
-
- Example external reference
- |
!core/externalarray-1.0.0
datatype: int16
fileuri: aia.lev1_euv_12s.2017-09-06T120001Z.94.image_lev1.fits
shape: [4096, 4096]
target: 1
type: object
properties:
source:
type: string
target:
anyOf:
- type: integer
- type: string
datatype:
type: string
shape:
type: array
items:
anyOf:
- type: integer
minimum: 0
requiredProperties: [source, target, datatype, shape]
additionalProperties: true
...
| %YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/core/externalarray-1.0.0"
tag: "tag:stsci.edu:asdf/core/externalarray-1.0.0"
title: Point to an array-like object in an external file.
description: |
Allow referencing of array-like objects in external files. These files can be
any type of file and in any absolute or relative location to the asdf file.
Loading of these files into arrays is not handled by asdf.
examples:
-
- Example external reference
- |
!core/externalarray-1.0.0
datatype: int16
fileuri: aia.lev1_euv_12s.2017-09-06T120001Z.94.image_lev1.fits
shape: [4096, 4096]
target: 1
type: object
properties:
source:
type: string
target:
anyOf:
- type: integer
- type: string
datatype:
type: string
shape:
type: array
items:
anyOf:
- type: integer
minimum: 0
+
+ requiredProperties: [source, target, datatype, shape]
+ additionalProperties: true
... | 3 | 0.081081 | 3 | 0 |
5fddf81ef05cc1f72b1379b9f823b78b68efd6ac | README.md | README.md |
A set of routines useful for getting and plotting Environment Canada bulk weather data. EC keeps historical data (updated daily) for a large number of weather stations across Canada. This bulk data can be obtained manually using terminal commands (wget) and saved as text files for later use.
Up-to-date instruction for downloading data from Environment Canada can be found at:
ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/
Folder: Get_More_Data_Plus_de_donnees > Readme.txt
This is cumbersome, so I created these routines to easily download the data for a particular station, as well as plot the resulting data.
The routines do the following functions:
* download data from Environment Canada
* save data in a consolidated format
* load consolidated data
* update data with data from Environment Canada
* grouping routines to group data by month or year
* smoothing routines to estimate a trendline for the data
* various plotting routines to display the data in useful forms
* miscellatious routines
|
A set of routines useful for getting and plotting Environment Canada bulk weather data. EC keeps historical data (updated daily) for a large number of weather stations across Canada. This bulk data can be obtained manually using terminal commands (wget) and saved as text files for later use.
Up-to-date instruction for downloading data from Environment Canada can be found at:
ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/
Folder: Get_More_Data_Plus_de_donnees > Readme.txt
This is cumbersome, so I created these routines to easily download the data for a particular station, as well as plot the resulting data.
The routines do the following functions:
* download data from Environment Canada
* save data in a consolidated format
* load consolidated data
* update data with data from Environment Canada
* grouping routines to group data by month or year
* smoothing routines to estimate a trendline for the data
* various plotting routines to display the data in useful forms
* miscellatious routines
## Current Work
I'm investigating smoothing techniques such as adding polynomial regression to lowess, and possibly SSA. An interesting discussion on smoothing can be found at: https://tamino.wordpress.com/2014/01/11/smooth-3/
## Upcoming Changes
* I will eventually move the smoothing functions into their own file to make them useful elsewhere.
* The initializing weather stations and cities will be put into a text file loaded at the beginning to add more flexibility. Change a file, rather than changing the source code. I may do the same with the basepath variable, or determine from code location.
| Update Current and Future Work | Update Current and Future Work | Markdown | bsd-3-clause | dneuman/Weather | markdown | ## Code Before:
A set of routines useful for getting and plotting Environment Canada bulk weather data. EC keeps historical data (updated daily) for a large number of weather stations across Canada. This bulk data can be obtained manually using terminal commands (wget) and saved as text files for later use.
Up-to-date instruction for downloading data from Environment Canada can be found at:
ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/
Folder: Get_More_Data_Plus_de_donnees > Readme.txt
This is cumbersome, so I created these routines to easily download the data for a particular station, as well as plot the resulting data.
The routines do the following functions:
* download data from Environment Canada
* save data in a consolidated format
* load consolidated data
* update data with data from Environment Canada
* grouping routines to group data by month or year
* smoothing routines to estimate a trendline for the data
* various plotting routines to display the data in useful forms
* miscellatious routines
## Instruction:
Update Current and Future Work
## Code After:
A set of routines useful for getting and plotting Environment Canada bulk weather data. EC keeps historical data (updated daily) for a large number of weather stations across Canada. This bulk data can be obtained manually using terminal commands (wget) and saved as text files for later use.
Up-to-date instruction for downloading data from Environment Canada can be found at:
ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/
Folder: Get_More_Data_Plus_de_donnees > Readme.txt
This is cumbersome, so I created these routines to easily download the data for a particular station, as well as plot the resulting data.
The routines do the following functions:
* download data from Environment Canada
* save data in a consolidated format
* load consolidated data
* update data with data from Environment Canada
* grouping routines to group data by month or year
* smoothing routines to estimate a trendline for the data
* various plotting routines to display the data in useful forms
* miscellatious routines
## Current Work
I'm investigating smoothing techniques such as adding polynomial regression to lowess, and possibly SSA. An interesting discussion on smoothing can be found at: https://tamino.wordpress.com/2014/01/11/smooth-3/
## Upcoming Changes
* I will eventually move the smoothing functions into their own file to make them useful elsewhere.
* The initializing weather stations and cities will be put into a text file loaded at the beginning to add more flexibility. Change a file, rather than changing the source code. I may do the same with the basepath variable, or determine from code location.
|
A set of routines useful for getting and plotting Environment Canada bulk weather data. EC keeps historical data (updated daily) for a large number of weather stations across Canada. This bulk data can be obtained manually using terminal commands (wget) and saved as text files for later use.
Up-to-date instruction for downloading data from Environment Canada can be found at:
ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/
Folder: Get_More_Data_Plus_de_donnees > Readme.txt
This is cumbersome, so I created these routines to easily download the data for a particular station, as well as plot the resulting data.
The routines do the following functions:
* download data from Environment Canada
* save data in a consolidated format
* load consolidated data
* update data with data from Environment Canada
* grouping routines to group data by month or year
* smoothing routines to estimate a trendline for the data
* various plotting routines to display the data in useful forms
* miscellatious routines
+
+ ## Current Work
+ I'm investigating smoothing techniques such as adding polynomial regression to lowess, and possibly SSA. An interesting discussion on smoothing can be found at: https://tamino.wordpress.com/2014/01/11/smooth-3/
+
+ ## Upcoming Changes
+ * I will eventually move the smoothing functions into their own file to make them useful elsewhere.
+ * The initializing weather stations and cities will be put into a text file loaded at the beginning to add more flexibility. Change a file, rather than changing the source code. I may do the same with the basepath variable, or determine from code location. | 7 | 0.368421 | 7 | 0 |
ff0aac45ed5f764546b262a57a9788a281bf638d | spec/sweet_spec.rb | spec/sweet_spec.rb |
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "SweetJS" do
it "compiles macros" do
source = (<<-JS)
macro def {
case $name:ident $params $body => {
function $name $params $body
}
}
def sweet(a) {
console.log("Macros are sweet!");
}
JS
compiled = SweetJS.new.compile(source)
compiled.should =~ /function sweet/
end
it "has a class method to compile macros" do
source = (<<-JS)
macro def {
case $name:ident $params $body => {
function $name $params $body
}
}
def sweet(a) {
console.log("Macros are sweet!");
}
JS
compiled = SweetJS.compile(source)
compiled.should =~ /function sweet/
end
it "throws an exception when compilation fails" do
lambda {
compiled = SweetJS.new.compile((<<-JS))
def sweet(a) { console.log("Macros are sweet!"); }
JS
}.should raise_error(SweetJS::Error)
end
end
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "SweetJS" do
let(:source) {
(<<-JS)
macro def {
case $name:ident $params $body => {
function $name $params $body
}
}
def sweet(a) {
console.log("Macros are sweet!");
}
JS
}
it "compiles macros" do
compiled = SweetJS.new.compile(source)
compiled.should =~ /function sweet/
end
it "has a class method to compile macros" do
compiled = SweetJS.compile(source)
compiled.should =~ /function sweet/
end
it "throws an exception when compilation fails" do
lambda {
compiled = SweetJS.new.compile((<<-JS))
def sweet(a) { console.log("Macros are sweet!"); }
JS
}.should raise_error(SweetJS::Error)
end
it "compiles IO objects as well as strings" do
io = StringIO.new(source)
lambda {
SweetJS.compile(io).should =~ /function sweet/
}.should_not raise_error(SweetJS::Error)
end
end
| Add test for compiling IO objects | Add test for compiling IO objects
| Ruby | mit | magnetised/sweetjs,magnetised/sweetjs | ruby | ## Code Before:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "SweetJS" do
it "compiles macros" do
source = (<<-JS)
macro def {
case $name:ident $params $body => {
function $name $params $body
}
}
def sweet(a) {
console.log("Macros are sweet!");
}
JS
compiled = SweetJS.new.compile(source)
compiled.should =~ /function sweet/
end
it "has a class method to compile macros" do
source = (<<-JS)
macro def {
case $name:ident $params $body => {
function $name $params $body
}
}
def sweet(a) {
console.log("Macros are sweet!");
}
JS
compiled = SweetJS.compile(source)
compiled.should =~ /function sweet/
end
it "throws an exception when compilation fails" do
lambda {
compiled = SweetJS.new.compile((<<-JS))
def sweet(a) { console.log("Macros are sweet!"); }
JS
}.should raise_error(SweetJS::Error)
end
end
## Instruction:
Add test for compiling IO objects
## Code After:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "SweetJS" do
let(:source) {
(<<-JS)
macro def {
case $name:ident $params $body => {
function $name $params $body
}
}
def sweet(a) {
console.log("Macros are sweet!");
}
JS
}
it "compiles macros" do
compiled = SweetJS.new.compile(source)
compiled.should =~ /function sweet/
end
it "has a class method to compile macros" do
compiled = SweetJS.compile(source)
compiled.should =~ /function sweet/
end
it "throws an exception when compilation fails" do
lambda {
compiled = SweetJS.new.compile((<<-JS))
def sweet(a) { console.log("Macros are sweet!"); }
JS
}.should raise_error(SweetJS::Error)
end
it "compiles IO objects as well as strings" do
io = StringIO.new(source)
lambda {
SweetJS.compile(io).should =~ /function sweet/
}.should_not raise_error(SweetJS::Error)
end
end
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "SweetJS" do
- it "compiles macros" do
- source = (<<-JS)
+ let(:source) {
+ (<<-JS)
macro def {
case $name:ident $params $body => {
function $name $params $body
}
}
def sweet(a) {
console.log("Macros are sweet!");
}
JS
+ }
+
+ it "compiles macros" do
compiled = SweetJS.new.compile(source)
compiled.should =~ /function sweet/
end
it "has a class method to compile macros" do
- source = (<<-JS)
- macro def {
- case $name:ident $params $body => {
- function $name $params $body
- }
- }
- def sweet(a) {
- console.log("Macros are sweet!");
- }
- JS
compiled = SweetJS.compile(source)
compiled.should =~ /function sweet/
end
it "throws an exception when compilation fails" do
lambda {
compiled = SweetJS.new.compile((<<-JS))
def sweet(a) { console.log("Macros are sweet!"); }
JS
}.should raise_error(SweetJS::Error)
end
+
+ it "compiles IO objects as well as strings" do
+ io = StringIO.new(source)
+ lambda {
+ SweetJS.compile(io).should =~ /function sweet/
+ }.should_not raise_error(SweetJS::Error)
+ end
end | 24 | 0.571429 | 12 | 12 |
fd2d68e17934492fdc1af4c0667cf77c8732bcb7 | source/index.html.erb | source/index.html.erb | <h1 class="cover-heading">Understanding sensor data.</h1>
<p class="lead">Sensorama captures samples from <b>all</b> sensors
of your iPhone at fixed time intervals and sends the captured
data to your e-mail address. We store the copy too, for research
and improving Sensorama. Everything in free, open and
easy-to-read JSON format.</p>
<p class="lead">
<a href="https://itunes.apple.com/us/app/sensorama/id1159788831?mt=8" class="btn btn-lg btn-secondary">
Download on the AppStore
</a>
</p>
<span hidden id="active_page_name">home</span>
| <h1 class="cover-heading">Understanding sensor data.</h1>
<p class="lead">Sensorama captures samples from <b>all</b> sensors
of your iPhone at fixed time intervals and sends the captured
data to your e-mail address. We store the copy too, for research
and improving Sensorama. Everything in free, open and
easy-to-read JSON format.</p>
<p class="lead">
<a href="https://itunes.apple.com/us/app/sensorama/id1159788831?mt=8" class="btn btn-lg btn-secondary">
Download on the AppStore
</a>
</p>
<p class="lead">
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/wkoszek/sensorama-ios" data-style="mega" data-count-href="/wkoszek/sensorama-ios/stargazers" data-count-api="/repos/wkoszek/sensorama-ios#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star wkoszek/sensorama-ios on GitHub">Star</a>
<a href="https://twitter.com/share" class="twitter-share-button" data-size="large" data-via="wkoszek" data-hashtags="ios" data-related="s,sensoramaapp" data-show-count="false">Tweet</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</p>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<span hidden id="active_page_name">home</span>
| Bring Github and Twitter buttons. | Bring Github and Twitter buttons.
| HTML+ERB | bsd-2-clause | wkoszek/sensorama-website,wkoszek/sensorama-website,wkoszek/sensorama-website | html+erb | ## Code Before:
<h1 class="cover-heading">Understanding sensor data.</h1>
<p class="lead">Sensorama captures samples from <b>all</b> sensors
of your iPhone at fixed time intervals and sends the captured
data to your e-mail address. We store the copy too, for research
and improving Sensorama. Everything in free, open and
easy-to-read JSON format.</p>
<p class="lead">
<a href="https://itunes.apple.com/us/app/sensorama/id1159788831?mt=8" class="btn btn-lg btn-secondary">
Download on the AppStore
</a>
</p>
<span hidden id="active_page_name">home</span>
## Instruction:
Bring Github and Twitter buttons.
## Code After:
<h1 class="cover-heading">Understanding sensor data.</h1>
<p class="lead">Sensorama captures samples from <b>all</b> sensors
of your iPhone at fixed time intervals and sends the captured
data to your e-mail address. We store the copy too, for research
and improving Sensorama. Everything in free, open and
easy-to-read JSON format.</p>
<p class="lead">
<a href="https://itunes.apple.com/us/app/sensorama/id1159788831?mt=8" class="btn btn-lg btn-secondary">
Download on the AppStore
</a>
</p>
<p class="lead">
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/wkoszek/sensorama-ios" data-style="mega" data-count-href="/wkoszek/sensorama-ios/stargazers" data-count-api="/repos/wkoszek/sensorama-ios#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star wkoszek/sensorama-ios on GitHub">Star</a>
<a href="https://twitter.com/share" class="twitter-share-button" data-size="large" data-via="wkoszek" data-hashtags="ios" data-related="s,sensoramaapp" data-show-count="false">Tweet</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</p>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<span hidden id="active_page_name">home</span>
| <h1 class="cover-heading">Understanding sensor data.</h1>
<p class="lead">Sensorama captures samples from <b>all</b> sensors
of your iPhone at fixed time intervals and sends the captured
data to your e-mail address. We store the copy too, for research
and improving Sensorama. Everything in free, open and
easy-to-read JSON format.</p>
<p class="lead">
<a href="https://itunes.apple.com/us/app/sensorama/id1159788831?mt=8" class="btn btn-lg btn-secondary">
Download on the AppStore
</a>
</p>
+ <p class="lead">
+ <!-- Place this tag where you want the button to render. -->
+ <a class="github-button" href="https://github.com/wkoszek/sensorama-ios" data-style="mega" data-count-href="/wkoszek/sensorama-ios/stargazers" data-count-api="/repos/wkoszek/sensorama-ios#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star wkoszek/sensorama-ios on GitHub">Star</a>
+
+
+
+
+ <a href="https://twitter.com/share" class="twitter-share-button" data-size="large" data-via="wkoszek" data-hashtags="ios" data-related="s,sensoramaapp" data-show-count="false">Tweet</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
+ </p>
+ <!-- Place this tag in your head or just before your close body tag. -->
+ <script async defer src="https://buttons.github.io/buttons.js"></script>
<span hidden id="active_page_name">home</span> | 11 | 0.846154 | 11 | 0 |
5196e0a9a9d55140a71d76940ee86417f0835976 | README.rst | README.rst | ========
Notifier
========
In memory pub/sub for humans.
* Free software: Apache license
| ========
Notifier
========
In memory pub/sub [5]_
* Free software: Apache license
.. [5] See: `publish–subscribe pattern <https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern>`_
| Tweak this file to be more useful. | Tweak this file to be more useful. | reStructuredText | apache-2.0 | harlowja/notifier | restructuredtext | ## Code Before:
========
Notifier
========
In memory pub/sub for humans.
* Free software: Apache license
## Instruction:
Tweak this file to be more useful.
## Code After:
========
Notifier
========
In memory pub/sub [5]_
* Free software: Apache license
.. [5] See: `publish–subscribe pattern <https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern>`_
| ========
Notifier
========
- In memory pub/sub for humans.
+ In memory pub/sub [5]_
* Free software: Apache license
+
+ .. [5] See: `publish–subscribe pattern <https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern>`_ | 4 | 0.571429 | 3 | 1 |
ca4f5fce9d2b66c5e470b1772dd1c76d2eec802d | src/server/middleware/parseJsonValidator.js | src/server/middleware/parseJsonValidator.js | import areObjectValuesDefined from '../utils/areObjectValuesDefined';
import pickVariablesFromJson from '../utils/pickVariablesFromJson';
/**
* "parseJson" Express middelware
* @see https://github.com/danistefanovic/hooka/blob/master/docs/webhooks.md#parsejson
* @param {Array} parseJson Config for "parseJson"
* @return {void}
*/
export default function parseJsonValidator(parseJson) {
return (req, res, next) => {
const env = pickVariablesFromJson(req.body, parseJson);
if (parseJson && !areObjectValuesDefined(env)) {
return res.status(400).send('JSON path does not match');
}
next();
};
}
| import areObjectValuesDefined from '../utils/areObjectValuesDefined';
import pickVariablesFromJson from '../utils/pickVariablesFromJson';
/**
* "parseJson" Express middelware
* @see https://github.com/danistefanovic/hooka/blob/master/docs/webhooks.md#parsejson
* @param {Array} parseJson Config for "parseJson"
* @return {void}
*/
export default function parseJsonValidator(parseJson) {
return (req, res, next) => {
const env = pickVariablesFromJson(req.body, parseJson);
if (parseJson && !areObjectValuesDefined(env)) {
const variables = JSON.stringify(env, replaceUndefined, ' ');
return res.status(400).send(`A JSON path does not match: ${variables}`);
}
next();
};
}
function replaceUndefined(key, value) {
return (value === undefined) ? 'not found' : value;
}
| Add variables to 'parseJson' error message | Add variables to 'parseJson' error message
| JavaScript | mit | danistefanovic/hooka | javascript | ## Code Before:
import areObjectValuesDefined from '../utils/areObjectValuesDefined';
import pickVariablesFromJson from '../utils/pickVariablesFromJson';
/**
* "parseJson" Express middelware
* @see https://github.com/danistefanovic/hooka/blob/master/docs/webhooks.md#parsejson
* @param {Array} parseJson Config for "parseJson"
* @return {void}
*/
export default function parseJsonValidator(parseJson) {
return (req, res, next) => {
const env = pickVariablesFromJson(req.body, parseJson);
if (parseJson && !areObjectValuesDefined(env)) {
return res.status(400).send('JSON path does not match');
}
next();
};
}
## Instruction:
Add variables to 'parseJson' error message
## Code After:
import areObjectValuesDefined from '../utils/areObjectValuesDefined';
import pickVariablesFromJson from '../utils/pickVariablesFromJson';
/**
* "parseJson" Express middelware
* @see https://github.com/danistefanovic/hooka/blob/master/docs/webhooks.md#parsejson
* @param {Array} parseJson Config for "parseJson"
* @return {void}
*/
export default function parseJsonValidator(parseJson) {
return (req, res, next) => {
const env = pickVariablesFromJson(req.body, parseJson);
if (parseJson && !areObjectValuesDefined(env)) {
const variables = JSON.stringify(env, replaceUndefined, ' ');
return res.status(400).send(`A JSON path does not match: ${variables}`);
}
next();
};
}
function replaceUndefined(key, value) {
return (value === undefined) ? 'not found' : value;
}
| import areObjectValuesDefined from '../utils/areObjectValuesDefined';
import pickVariablesFromJson from '../utils/pickVariablesFromJson';
/**
* "parseJson" Express middelware
* @see https://github.com/danistefanovic/hooka/blob/master/docs/webhooks.md#parsejson
* @param {Array} parseJson Config for "parseJson"
* @return {void}
*/
export default function parseJsonValidator(parseJson) {
return (req, res, next) => {
const env = pickVariablesFromJson(req.body, parseJson);
if (parseJson && !areObjectValuesDefined(env)) {
+ const variables = JSON.stringify(env, replaceUndefined, ' ');
- return res.status(400).send('JSON path does not match');
? ^ ^
+ return res.status(400).send(`A JSON path does not match: ${variables}`);
? ^^^ ^^^^^^^^^^^^^^^
}
next();
};
}
+
+ function replaceUndefined(key, value) {
+ return (value === undefined) ? 'not found' : value;
+ } | 7 | 0.388889 | 6 | 1 |
fa4f9279941532093e7af6f763561f2adabafefd | qdriverstation/snapcraft.yaml | qdriverstation/snapcraft.yaml | name: qdriverstation
version: 16.06.1
summary: Open source clone of the FRC Driver Station
description: The QDriverStation is a cross-platform and open-source alternative to the FRC Driver Station. It supports the FRC 2009-2014 communication protocol and the FRC 2015-2016 protocol.
confinement: devmode
apps:
qdriverstation:
command: desktop-launch qdriverstation
plugs:
- x11
- network
- pulseaudio
- network-bind
- system-observe
- network-observe
parts:
qdriverstation:
plugin: qmake
source-type: git
source: https://github.com/FRC-Utilities/QDriverStation.git
build-packages:
- libsdl2-dev
- qttools5-dev
- build-essential
- libqt5webkit5-dev
- qtmultimedia5-dev
- qtdeclarative5-dev
- qttools5-dev-tools
after: [desktop/qt5]
env:
plugin: nil
stage-packages:
- libsdl2-2.0-0
- libqt5gui5
- libqt5qml5
- libqt5quick5
- libqt5widgets5
- libqt5network5
- libqt5multimedia5
- libqt5declarative5
- qml-module-qtquick2
- qml-module-qtquick-window2
- qml-module-qtquick-layouts
- qml-module-qtquick-controls
- qml-module-qt-labs-settings
after: [qdriverstation]
| name: qdriverstation
version: 16.06.1
summary: Open source clone of the FRC Driver Station
description: The QDriverStation is a cross-platform and open-source alternative to the FRC Driver Station. It supports the FRC 2009-2014 communication protocol and the FRC 2015-2016 protocol.
confinement: devmode
apps:
qdriverstation:
command: desktop-launch qdriverstation
parts:
qdriverstation:
source: https://github.com/FRC-Utilities/QDriverStation.git
plugin: qmake
build-packages:
- libsdl2-dev
- qttools5-dev
- build-essential
- libqt5webkit5-dev
- qtmultimedia5-dev
- qtdeclarative5-dev
- qttools5-dev-tools
after: [desktop/qt5]
env:
plugin: nil
stage-packages:
- libsdl2-2.0-0
- libqt5gui5
- libqt5qml5
- libqt5quick5
- libqt5widgets5
- libqt5network5
- libqt5multimedia5
- libqt5declarative5
- qml-module-qtquick2
- qml-module-qtquick-window2
- qml-module-qtquick-layouts
- qml-module-qtquick-controls
- qml-module-qt-labs-settings
after: [qdriverstation]
| Remove plugs as it needs devmode to not confuse | Remove plugs as it needs devmode to not confuse
Follow as well new guidelines.
| YAML | mit | ubuntu/snappy-playpen,elopio/snappy-playpen,Zap123/snappy-playpen,jamestait/snappy-playpen,elopio/snappy-playpen,dplanella/snappy-playpen,ubuntu/snappy-playpen,jamestait/snappy-playpen,Winael/snappy-playpen-1,jamestait/snappy-playpen,elopio/snappy-playpen,Winael/snappy-playpen-1,wandrewkeech/snappy-playpen,dplanella/snappy-playpen,jamestait/snappy-playpen,Zap123/snappy-playpen,ubuntu/snappy-playpen,elopio/snappy-playpen,wandrewkeech/snappy-playpen,ubuntu/snappy-playpen | yaml | ## Code Before:
name: qdriverstation
version: 16.06.1
summary: Open source clone of the FRC Driver Station
description: The QDriverStation is a cross-platform and open-source alternative to the FRC Driver Station. It supports the FRC 2009-2014 communication protocol and the FRC 2015-2016 protocol.
confinement: devmode
apps:
qdriverstation:
command: desktop-launch qdriverstation
plugs:
- x11
- network
- pulseaudio
- network-bind
- system-observe
- network-observe
parts:
qdriverstation:
plugin: qmake
source-type: git
source: https://github.com/FRC-Utilities/QDriverStation.git
build-packages:
- libsdl2-dev
- qttools5-dev
- build-essential
- libqt5webkit5-dev
- qtmultimedia5-dev
- qtdeclarative5-dev
- qttools5-dev-tools
after: [desktop/qt5]
env:
plugin: nil
stage-packages:
- libsdl2-2.0-0
- libqt5gui5
- libqt5qml5
- libqt5quick5
- libqt5widgets5
- libqt5network5
- libqt5multimedia5
- libqt5declarative5
- qml-module-qtquick2
- qml-module-qtquick-window2
- qml-module-qtquick-layouts
- qml-module-qtquick-controls
- qml-module-qt-labs-settings
after: [qdriverstation]
## Instruction:
Remove plugs as it needs devmode to not confuse
Follow as well new guidelines.
## Code After:
name: qdriverstation
version: 16.06.1
summary: Open source clone of the FRC Driver Station
description: The QDriverStation is a cross-platform and open-source alternative to the FRC Driver Station. It supports the FRC 2009-2014 communication protocol and the FRC 2015-2016 protocol.
confinement: devmode
apps:
qdriverstation:
command: desktop-launch qdriverstation
parts:
qdriverstation:
source: https://github.com/FRC-Utilities/QDriverStation.git
plugin: qmake
build-packages:
- libsdl2-dev
- qttools5-dev
- build-essential
- libqt5webkit5-dev
- qtmultimedia5-dev
- qtdeclarative5-dev
- qttools5-dev-tools
after: [desktop/qt5]
env:
plugin: nil
stage-packages:
- libsdl2-2.0-0
- libqt5gui5
- libqt5qml5
- libqt5quick5
- libqt5widgets5
- libqt5network5
- libqt5multimedia5
- libqt5declarative5
- qml-module-qtquick2
- qml-module-qtquick-window2
- qml-module-qtquick-layouts
- qml-module-qtquick-controls
- qml-module-qt-labs-settings
after: [qdriverstation]
| name: qdriverstation
version: 16.06.1
summary: Open source clone of the FRC Driver Station
description: The QDriverStation is a cross-platform and open-source alternative to the FRC Driver Station. It supports the FRC 2009-2014 communication protocol and the FRC 2015-2016 protocol.
confinement: devmode
apps:
qdriverstation:
command: desktop-launch qdriverstation
- plugs:
- - x11
- - network
- - pulseaudio
- - network-bind
- - system-observe
- - network-observe
parts:
qdriverstation:
+ source: https://github.com/FRC-Utilities/QDriverStation.git
plugin: qmake
- source-type: git
- source: https://github.com/FRC-Utilities/QDriverStation.git
build-packages:
- libsdl2-dev
- qttools5-dev
- build-essential
- libqt5webkit5-dev
- qtmultimedia5-dev
- qtdeclarative5-dev
- qttools5-dev-tools
after: [desktop/qt5]
env:
plugin: nil
stage-packages:
- libsdl2-2.0-0
- libqt5gui5
- libqt5qml5
- libqt5quick5
- libqt5widgets5
- libqt5network5
- libqt5multimedia5
- libqt5declarative5
- qml-module-qtquick2
- qml-module-qtquick-window2
- qml-module-qtquick-layouts
- qml-module-qtquick-controls
- qml-module-qt-labs-settings
after: [qdriverstation]
| 10 | 0.204082 | 1 | 9 |
d6bcd842e30addedff6c02034fd7f422ac9dbbaa | experimental-download.js | experimental-download.js | experimental-download.js | var AWS = require('aws-sdk');
var filePath = '/Users/mikermcneil/Desktop/foo.txt';
var awsAccessKey = process.argv[2];
var awsSecret = process.argv[3];
var bucketName = 'experiment-jun28-2018';
console.log('Using AWS access key:', awsAccessKey);
console.log('Using AWS secret:', awsSecret);
console.log('Using bucket:', bucketName);
console.log('Uploading file:', filePath);
var s3 = new AWS.S3({
apiVersion: '2006-03-01',
region: 'us-west-2',
accessKeyId: awsAccessKey,
secretAccessKey: awsSecret
});
var readable = s3.getObject({
Bucket: bucketName,
Key: require('path').basename(filePath),
})
.createReadStream();
readable.on('error', (err)=>{
console.error('s3 download stream error:',err);
});
var drain = require('fs').createWriteStream('/Users/mikermcneil/Desktop/downloaded-foo.txt');
drain.on('error', (err)=>{
console.error('local filesystem write error:',err);
});
readable.pipe(drain);
console.log('Download Success!');
// wtf:
//
// s3.getObject({
// Bucket: bucketName,
// Key: require('path').basename(filePath),
// }, function (err, data) {
// if (err) {
// console.log('Error', err);
// } if (data) {
// console.log('Download Success', data);
// }
// });
| Set up experimental download using aws-sdk directly | Set up experimental download using aws-sdk directly
| JavaScript | mit | balderdashy/skipper-s3 | javascript | ## Code Before:
experimental-download.js
## Instruction:
Set up experimental download using aws-sdk directly
## Code After:
var AWS = require('aws-sdk');
var filePath = '/Users/mikermcneil/Desktop/foo.txt';
var awsAccessKey = process.argv[2];
var awsSecret = process.argv[3];
var bucketName = 'experiment-jun28-2018';
console.log('Using AWS access key:', awsAccessKey);
console.log('Using AWS secret:', awsSecret);
console.log('Using bucket:', bucketName);
console.log('Uploading file:', filePath);
var s3 = new AWS.S3({
apiVersion: '2006-03-01',
region: 'us-west-2',
accessKeyId: awsAccessKey,
secretAccessKey: awsSecret
});
var readable = s3.getObject({
Bucket: bucketName,
Key: require('path').basename(filePath),
})
.createReadStream();
readable.on('error', (err)=>{
console.error('s3 download stream error:',err);
});
var drain = require('fs').createWriteStream('/Users/mikermcneil/Desktop/downloaded-foo.txt');
drain.on('error', (err)=>{
console.error('local filesystem write error:',err);
});
readable.pipe(drain);
console.log('Download Success!');
// wtf:
//
// s3.getObject({
// Bucket: bucketName,
// Key: require('path').basename(filePath),
// }, function (err, data) {
// if (err) {
// console.log('Error', err);
// } if (data) {
// console.log('Download Success', data);
// }
// });
| - experimental-download.js
+ var AWS = require('aws-sdk');
+
+
+
+ var filePath = '/Users/mikermcneil/Desktop/foo.txt';
+ var awsAccessKey = process.argv[2];
+ var awsSecret = process.argv[3];
+ var bucketName = 'experiment-jun28-2018';
+
+ console.log('Using AWS access key:', awsAccessKey);
+ console.log('Using AWS secret:', awsSecret);
+ console.log('Using bucket:', bucketName);
+ console.log('Uploading file:', filePath);
+
+ var s3 = new AWS.S3({
+ apiVersion: '2006-03-01',
+ region: 'us-west-2',
+ accessKeyId: awsAccessKey,
+ secretAccessKey: awsSecret
+ });
+
+
+ var readable = s3.getObject({
+ Bucket: bucketName,
+ Key: require('path').basename(filePath),
+ })
+ .createReadStream();
+ readable.on('error', (err)=>{
+ console.error('s3 download stream error:',err);
+ });
+ var drain = require('fs').createWriteStream('/Users/mikermcneil/Desktop/downloaded-foo.txt');
+ drain.on('error', (err)=>{
+ console.error('local filesystem write error:',err);
+ });
+
+ readable.pipe(drain);
+ console.log('Download Success!');
+
+
+ // wtf:
+ //
+ // s3.getObject({
+ // Bucket: bucketName,
+ // Key: require('path').basename(filePath),
+ // }, function (err, data) {
+ // if (err) {
+ // console.log('Error', err);
+ // } if (data) {
+ // console.log('Download Success', data);
+ // }
+ // }); | 52 | 52 | 51 | 1 |
d0eeb6149b818b966a0d16113121391a76b99e15 | lib/server/xhr.js | lib/server/xhr.js | var xhr = require('xmlhttprequest').XMLHttpRequest;
var relative = /^https?:\/\//i;
var MyXMLHttpRequest = global.XMLHttpRequest = function() {
xhr.apply(this, arguments);
var oldOpen = this.open;
this.open = function() {
var args = Array.prototype.slice.call(arguments);
var url = args[1];
if(url && !relative.test(url)) {
args[1] = MyXMLHttpRequest.base + url;
}
return oldOpen.apply(this, args);
};
};
module.exports = function() {
return function(req, res, next) {
MyXMLHttpRequest.base = req.protocol + "://" + req.get('host');
next();
};
};
| var xhr = require('xmlhttprequest').XMLHttpRequest;
var relative = /^https?:\/\//i;
var MyXMLHttpRequest = global.XMLHttpRequest = function() {
xhr.apply(this, arguments);
var oldOpen = this.open;
this.open = function() {
var args = Array.prototype.slice.call(arguments);
var url = args[1];
if(url && !relative.test(url)) {
args[1] = MyXMLHttpRequest.base + url;
}
return oldOpen.apply(this, args);
};
// jQuery checks for this property to see if XHR supports CORS
this.withCredentials = true;
};
module.exports = function() {
return function(req, res, next) {
MyXMLHttpRequest.base = req.protocol + "://" + req.get('host');
next();
};
};
| Allow CORS support check for jQuery to pass | Allow CORS support check for jQuery to pass
| JavaScript | mit | donejs/done-ssr,donejs/done-ssr | javascript | ## Code Before:
var xhr = require('xmlhttprequest').XMLHttpRequest;
var relative = /^https?:\/\//i;
var MyXMLHttpRequest = global.XMLHttpRequest = function() {
xhr.apply(this, arguments);
var oldOpen = this.open;
this.open = function() {
var args = Array.prototype.slice.call(arguments);
var url = args[1];
if(url && !relative.test(url)) {
args[1] = MyXMLHttpRequest.base + url;
}
return oldOpen.apply(this, args);
};
};
module.exports = function() {
return function(req, res, next) {
MyXMLHttpRequest.base = req.protocol + "://" + req.get('host');
next();
};
};
## Instruction:
Allow CORS support check for jQuery to pass
## Code After:
var xhr = require('xmlhttprequest').XMLHttpRequest;
var relative = /^https?:\/\//i;
var MyXMLHttpRequest = global.XMLHttpRequest = function() {
xhr.apply(this, arguments);
var oldOpen = this.open;
this.open = function() {
var args = Array.prototype.slice.call(arguments);
var url = args[1];
if(url && !relative.test(url)) {
args[1] = MyXMLHttpRequest.base + url;
}
return oldOpen.apply(this, args);
};
// jQuery checks for this property to see if XHR supports CORS
this.withCredentials = true;
};
module.exports = function() {
return function(req, res, next) {
MyXMLHttpRequest.base = req.protocol + "://" + req.get('host');
next();
};
};
| var xhr = require('xmlhttprequest').XMLHttpRequest;
var relative = /^https?:\/\//i;
var MyXMLHttpRequest = global.XMLHttpRequest = function() {
xhr.apply(this, arguments);
var oldOpen = this.open;
this.open = function() {
var args = Array.prototype.slice.call(arguments);
var url = args[1];
if(url && !relative.test(url)) {
args[1] = MyXMLHttpRequest.base + url;
}
return oldOpen.apply(this, args);
};
+ // jQuery checks for this property to see if XHR supports CORS
+ this.withCredentials = true;
};
module.exports = function() {
return function(req, res, next) {
MyXMLHttpRequest.base = req.protocol + "://" + req.get('host');
next();
};
}; | 2 | 0.086957 | 2 | 0 |
73ada3ac5ed0d73bae1418d3940998f18201d8e2 | eak-update.sh | eak-update.sh | APPDIR="/Users/fayimora/Code/brutehack-frontend"
PATCHDIR="/tmp/eakpatch"
EAKDIR="/tmp/ember-app-kit-master"
# first generate patches of important files
FILES="bower.json package.json Gruntfile.js karma.conf.js .jshintrc .bowerrc" # app/app.js app/adapters/application.js"
echo "Patching application code with updates"
mkdir -p ${PATCHDIR}
for i in ${FILES}
do
mkdir -p ${PATCHDIR}/$(dirname ${i})
diff -Nau ${APPDIR}/${i} ${EAKDIR}/${i} > ${PATCHDIR}/${i}
patch ${APPDIR}/${i} ${PATCHDIR}/${i}
done
echo "updating tasks directory"
rm -rf ${APPDIR}/tasks/*
cp -r ${EAKDIR}/tasks/* ${APPDIR}/tasks/
cd ${APPDIR}
echo "running npm update"
npm update
echo "running bower update"
bower update
| APPDIR="/Users/fayimora/Code/brutehack-frontend"
PATCHDIR="/tmp/eakpatch"
EAKDIR="/tmp/ember-app-kit-master"
cd ${EAKDIR}
git pull origin master
cd ${APPDIR}
# first generate patches of important files
FILES="bower.json package.json Gruntfile.js karma.conf.js .jshintrc .bowerrc" # app/app.js app/adapters/application.js"
echo "Patching application code with updates"
mkdir -p ${PATCHDIR}
for i in ${FILES}
do
mkdir -p ${PATCHDIR}/$(dirname ${i})
diff -Nau ${APPDIR}/${i} ${EAKDIR}/${i} > ${PATCHDIR}/${i}
patch ${APPDIR}/${i} ${PATCHDIR}/${i}
done
echo "updating tasks directory"
rm -rf ${APPDIR}/tasks/*
cp -r ${EAKDIR}/tasks/* ${APPDIR}/tasks/
cd ${APPDIR}
echo "running npm update"
npm update
echo "running bower update"
bower update
| Update script should update repo before updating | Update script should update repo before updating
| Shell | mit | fayimora/brutehack-frontend,fayimora/brutehack-frontend | shell | ## Code Before:
APPDIR="/Users/fayimora/Code/brutehack-frontend"
PATCHDIR="/tmp/eakpatch"
EAKDIR="/tmp/ember-app-kit-master"
# first generate patches of important files
FILES="bower.json package.json Gruntfile.js karma.conf.js .jshintrc .bowerrc" # app/app.js app/adapters/application.js"
echo "Patching application code with updates"
mkdir -p ${PATCHDIR}
for i in ${FILES}
do
mkdir -p ${PATCHDIR}/$(dirname ${i})
diff -Nau ${APPDIR}/${i} ${EAKDIR}/${i} > ${PATCHDIR}/${i}
patch ${APPDIR}/${i} ${PATCHDIR}/${i}
done
echo "updating tasks directory"
rm -rf ${APPDIR}/tasks/*
cp -r ${EAKDIR}/tasks/* ${APPDIR}/tasks/
cd ${APPDIR}
echo "running npm update"
npm update
echo "running bower update"
bower update
## Instruction:
Update script should update repo before updating
## Code After:
APPDIR="/Users/fayimora/Code/brutehack-frontend"
PATCHDIR="/tmp/eakpatch"
EAKDIR="/tmp/ember-app-kit-master"
cd ${EAKDIR}
git pull origin master
cd ${APPDIR}
# first generate patches of important files
FILES="bower.json package.json Gruntfile.js karma.conf.js .jshintrc .bowerrc" # app/app.js app/adapters/application.js"
echo "Patching application code with updates"
mkdir -p ${PATCHDIR}
for i in ${FILES}
do
mkdir -p ${PATCHDIR}/$(dirname ${i})
diff -Nau ${APPDIR}/${i} ${EAKDIR}/${i} > ${PATCHDIR}/${i}
patch ${APPDIR}/${i} ${PATCHDIR}/${i}
done
echo "updating tasks directory"
rm -rf ${APPDIR}/tasks/*
cp -r ${EAKDIR}/tasks/* ${APPDIR}/tasks/
cd ${APPDIR}
echo "running npm update"
npm update
echo "running bower update"
bower update
| APPDIR="/Users/fayimora/Code/brutehack-frontend"
PATCHDIR="/tmp/eakpatch"
EAKDIR="/tmp/ember-app-kit-master"
+
+ cd ${EAKDIR}
+ git pull origin master
+ cd ${APPDIR}
# first generate patches of important files
FILES="bower.json package.json Gruntfile.js karma.conf.js .jshintrc .bowerrc" # app/app.js app/adapters/application.js"
echo "Patching application code with updates"
mkdir -p ${PATCHDIR}
for i in ${FILES}
do
mkdir -p ${PATCHDIR}/$(dirname ${i})
diff -Nau ${APPDIR}/${i} ${EAKDIR}/${i} > ${PATCHDIR}/${i}
patch ${APPDIR}/${i} ${PATCHDIR}/${i}
done
echo "updating tasks directory"
rm -rf ${APPDIR}/tasks/*
cp -r ${EAKDIR}/tasks/* ${APPDIR}/tasks/
cd ${APPDIR}
echo "running npm update"
npm update
echo "running bower update"
bower update | 4 | 0.148148 | 4 | 0 |
e930b86325cbe76c12baa45396a7259a5ea84045 | src/main/java/com/davidflex/supermarket/agents/utils/WarehousesComparator.java | src/main/java/com/davidflex/supermarket/agents/utils/WarehousesComparator.java | package com.davidflex.supermarket.agents.utils;
import com.davidflex.supermarket.ontologies.company.elements.Warehouse;
import com.davidflex.supermarket.ontologies.ecommerce.elements.Location;
import java.util.Comparator;
/**
* Sort a list of warehouses according to their distance to the user's location.
*/
public class WarehousesComparator implements Comparator<Warehouse> {
private Location customer;
public WarehousesComparator(Location customerLocation) {
this.customer = customerLocation;
}
@Override
public int compare(Warehouse w1, Warehouse w2) {
double d1 = squaredEuclidianDistance(customer.getX(), customer.getX(), w1.getX(), w1.getY());
double d2 = squaredEuclidianDistance(customer.getX(), customer.getX(), w2.getX(), w2.getY());
return (int) (d1 - d2);
}
/**
* Calculate the Squared Euclidean Distance from the point to another point.
* It place progressively greater weight on objects that are farther apart.
*/
private double squaredEuclidianDistance(int x1, int x2, int y1, int y2) {
double d = 0D;
d += Math.pow(x1 - y1, 2.0);
d += Math.pow(x2 - y2, 2.0);
return d;
}
}
| package com.davidflex.supermarket.agents.utils;
import com.davidflex.supermarket.ontologies.company.elements.Warehouse;
import com.davidflex.supermarket.ontologies.ecommerce.elements.Location;
import java.util.Comparator;
/**
* Sort a list of warehouses according to their distance to the user's location.
*/
public class WarehousesComparator implements Comparator<Warehouse> {
private Location customer;
public WarehousesComparator(Location customerLocation) {
this.customer = customerLocation;
}
@Override
public int compare(Warehouse w1, Warehouse w2) {
double d1 = squaredEuclidianDistance(customer.getX(), customer.getY(), w1.getX(), w1.getY());
double d2 = squaredEuclidianDistance(customer.getX(), customer.getY(), w2.getX(), w2.getY());
return (int) (d1 - d2);
}
/**
* Calculate the Squared Euclidean Distance from the point to another point.
* It place progressively greater weight on objects that are farther apart.
*
* @return the square euclidean distance.
*/
private double squaredEuclidianDistance(int x1, int x2, int y1, int y2) {
double d = 0D;
d += Math.pow(x1 - y1, 2.0);
d += Math.pow(x2 - y2, 2.0);
return d;
}
}
| Fix miss spell in warehouse comparator | Fix miss spell in warehouse comparator
| Java | apache-2.0 | davidmigloz/supermarket-agent-system | java | ## Code Before:
package com.davidflex.supermarket.agents.utils;
import com.davidflex.supermarket.ontologies.company.elements.Warehouse;
import com.davidflex.supermarket.ontologies.ecommerce.elements.Location;
import java.util.Comparator;
/**
* Sort a list of warehouses according to their distance to the user's location.
*/
public class WarehousesComparator implements Comparator<Warehouse> {
private Location customer;
public WarehousesComparator(Location customerLocation) {
this.customer = customerLocation;
}
@Override
public int compare(Warehouse w1, Warehouse w2) {
double d1 = squaredEuclidianDistance(customer.getX(), customer.getX(), w1.getX(), w1.getY());
double d2 = squaredEuclidianDistance(customer.getX(), customer.getX(), w2.getX(), w2.getY());
return (int) (d1 - d2);
}
/**
* Calculate the Squared Euclidean Distance from the point to another point.
* It place progressively greater weight on objects that are farther apart.
*/
private double squaredEuclidianDistance(int x1, int x2, int y1, int y2) {
double d = 0D;
d += Math.pow(x1 - y1, 2.0);
d += Math.pow(x2 - y2, 2.0);
return d;
}
}
## Instruction:
Fix miss spell in warehouse comparator
## Code After:
package com.davidflex.supermarket.agents.utils;
import com.davidflex.supermarket.ontologies.company.elements.Warehouse;
import com.davidflex.supermarket.ontologies.ecommerce.elements.Location;
import java.util.Comparator;
/**
* Sort a list of warehouses according to their distance to the user's location.
*/
public class WarehousesComparator implements Comparator<Warehouse> {
private Location customer;
public WarehousesComparator(Location customerLocation) {
this.customer = customerLocation;
}
@Override
public int compare(Warehouse w1, Warehouse w2) {
double d1 = squaredEuclidianDistance(customer.getX(), customer.getY(), w1.getX(), w1.getY());
double d2 = squaredEuclidianDistance(customer.getX(), customer.getY(), w2.getX(), w2.getY());
return (int) (d1 - d2);
}
/**
* Calculate the Squared Euclidean Distance from the point to another point.
* It place progressively greater weight on objects that are farther apart.
*
* @return the square euclidean distance.
*/
private double squaredEuclidianDistance(int x1, int x2, int y1, int y2) {
double d = 0D;
d += Math.pow(x1 - y1, 2.0);
d += Math.pow(x2 - y2, 2.0);
return d;
}
}
| package com.davidflex.supermarket.agents.utils;
import com.davidflex.supermarket.ontologies.company.elements.Warehouse;
import com.davidflex.supermarket.ontologies.ecommerce.elements.Location;
import java.util.Comparator;
/**
* Sort a list of warehouses according to their distance to the user's location.
*/
public class WarehousesComparator implements Comparator<Warehouse> {
private Location customer;
public WarehousesComparator(Location customerLocation) {
this.customer = customerLocation;
}
@Override
public int compare(Warehouse w1, Warehouse w2) {
- double d1 = squaredEuclidianDistance(customer.getX(), customer.getX(), w1.getX(), w1.getY());
? ^
+ double d1 = squaredEuclidianDistance(customer.getX(), customer.getY(), w1.getX(), w1.getY());
? ^
- double d2 = squaredEuclidianDistance(customer.getX(), customer.getX(), w2.getX(), w2.getY());
? ^
+ double d2 = squaredEuclidianDistance(customer.getX(), customer.getY(), w2.getX(), w2.getY());
? ^
return (int) (d1 - d2);
}
/**
* Calculate the Squared Euclidean Distance from the point to another point.
* It place progressively greater weight on objects that are farther apart.
+ *
+ * @return the square euclidean distance.
*/
private double squaredEuclidianDistance(int x1, int x2, int y1, int y2) {
double d = 0D;
d += Math.pow(x1 - y1, 2.0);
d += Math.pow(x2 - y2, 2.0);
return d;
}
} | 6 | 0.166667 | 4 | 2 |
21d1060b6410c651e35c95630aeca89361d379a5 | packages/we/web-routes-boomerang.yaml | packages/we/web-routes-boomerang.yaml | homepage: ''
changelog-type: ''
hash: 5885435f8527a056d820630e26f76567d4106c8e13fe67a0bc191149dc9f4242
test-bench-deps: {}
maintainer: partners@seereason.com
synopsis: Use boomerang for type-safe URL parsers/printers
changelog: ''
basic-deps:
base: ! '>=4 && <5'
text: ! '>=0.11 && <1.3'
boomerang: ! '>=1.4 && <1.5'
parsec: ==3.1.*
web-routes: ! '>=0.26'
mtl: -any
all-versions:
- 0.25.0
- 0.25.1
- 0.26.0
- 0.27.0
- 0.27.1
- 0.28.0
- 0.28.1
- 0.28.2
- 0.28.3
- 0.28.4
- 0.28.4.2
author: jeremy@seereason.com
latest: 0.28.4.2
description-type: haddock
description: This module add support for creating url parsers/printers using a single
unified grammar specification
license-name: BSD-3-Clause
| homepage: ''
changelog-type: ''
hash: dd466f0241c0337c7c694a9e4f5871f3764f77515098f9d334498cedcfff3132
test-bench-deps: {}
maintainer: partners@seereason.com
synopsis: Use boomerang for type-safe URL parsers/printers
changelog: ''
basic-deps:
base: '>=4.9 && <5'
text: '>=0.11 && <2.1'
boomerang: '>=1.4 && <1.5'
parsec: ==3.1.*
web-routes: '>=0.26 && <0.28'
mtl: <2.3
all-versions:
- 0.25.0
- 0.25.1
- 0.26.0
- 0.27.0
- 0.27.1
- 0.28.0
- 0.28.1
- 0.28.2
- 0.28.3
- 0.28.4
- 0.28.4.2
- 0.28.4.3
author: jeremy@seereason.com
latest: 0.28.4.3
description-type: haddock
description: This module add support for creating url parsers/printers using a single
unified grammar specification
license-name: BSD-3-Clause
| Update from Hackage at 2022-04-20T17:29:18Z | Update from Hackage at 2022-04-20T17:29:18Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: 5885435f8527a056d820630e26f76567d4106c8e13fe67a0bc191149dc9f4242
test-bench-deps: {}
maintainer: partners@seereason.com
synopsis: Use boomerang for type-safe URL parsers/printers
changelog: ''
basic-deps:
base: ! '>=4 && <5'
text: ! '>=0.11 && <1.3'
boomerang: ! '>=1.4 && <1.5'
parsec: ==3.1.*
web-routes: ! '>=0.26'
mtl: -any
all-versions:
- 0.25.0
- 0.25.1
- 0.26.0
- 0.27.0
- 0.27.1
- 0.28.0
- 0.28.1
- 0.28.2
- 0.28.3
- 0.28.4
- 0.28.4.2
author: jeremy@seereason.com
latest: 0.28.4.2
description-type: haddock
description: This module add support for creating url parsers/printers using a single
unified grammar specification
license-name: BSD-3-Clause
## Instruction:
Update from Hackage at 2022-04-20T17:29:18Z
## Code After:
homepage: ''
changelog-type: ''
hash: dd466f0241c0337c7c694a9e4f5871f3764f77515098f9d334498cedcfff3132
test-bench-deps: {}
maintainer: partners@seereason.com
synopsis: Use boomerang for type-safe URL parsers/printers
changelog: ''
basic-deps:
base: '>=4.9 && <5'
text: '>=0.11 && <2.1'
boomerang: '>=1.4 && <1.5'
parsec: ==3.1.*
web-routes: '>=0.26 && <0.28'
mtl: <2.3
all-versions:
- 0.25.0
- 0.25.1
- 0.26.0
- 0.27.0
- 0.27.1
- 0.28.0
- 0.28.1
- 0.28.2
- 0.28.3
- 0.28.4
- 0.28.4.2
- 0.28.4.3
author: jeremy@seereason.com
latest: 0.28.4.3
description-type: haddock
description: This module add support for creating url parsers/printers using a single
unified grammar specification
license-name: BSD-3-Clause
| homepage: ''
changelog-type: ''
- hash: 5885435f8527a056d820630e26f76567d4106c8e13fe67a0bc191149dc9f4242
+ hash: dd466f0241c0337c7c694a9e4f5871f3764f77515098f9d334498cedcfff3132
test-bench-deps: {}
maintainer: partners@seereason.com
synopsis: Use boomerang for type-safe URL parsers/printers
changelog: ''
basic-deps:
- base: ! '>=4 && <5'
? --
+ base: '>=4.9 && <5'
? ++
- text: ! '>=0.11 && <1.3'
? -- --
+ text: '>=0.11 && <2.1'
? ++
- boomerang: ! '>=1.4 && <1.5'
? --
+ boomerang: '>=1.4 && <1.5'
parsec: ==3.1.*
- web-routes: ! '>=0.26'
? --
+ web-routes: '>=0.26 && <0.28'
? +++++++++
- mtl: -any
+ mtl: <2.3
all-versions:
- 0.25.0
- 0.25.1
- 0.26.0
- 0.27.0
- 0.27.1
- 0.28.0
- 0.28.1
- 0.28.2
- 0.28.3
- 0.28.4
- 0.28.4.2
+ - 0.28.4.3
author: jeremy@seereason.com
- latest: 0.28.4.2
? ^
+ latest: 0.28.4.3
? ^
description-type: haddock
description: This module add support for creating url parsers/printers using a single
unified grammar specification
license-name: BSD-3-Clause | 15 | 0.46875 | 8 | 7 |
d1378799a32cafd23f04221286c0198203d39618 | src/main/resources/static/js/routes.js | src/main/resources/static/js/routes.js | angular.module('Mccy.routes', [
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/view', {
templateUrl: 'views/view-containers.html',
controller: 'ViewContainersCtrl'
})
.when('/new-server', {
templateUrl: 'views/create-container.html',
controller: 'NewContainerCtrl'
})
.when('/upload-mod', {
templateUrl: 'views/upload-mod.html',
controller: 'UploadModCtrl'
})
.when('/manage-mods', {
templateUrl: 'views/manage-mods.html',
controller: 'ManageModsCtrl'
})
.otherwise('/view')
})
.constant('MccyViews', [
{
view: '/view',
settings: {
label: 'Current Containers',
icon: 'icon fa fa-heartbeat'
}
},
{
view: '/new-server',
settings: {
label: 'Create Container',
icon: 'icon fa fa-magic'
}
},
{
view: '/upload-mod',
settings: {
label: 'Upload Mods',
icon: 'icon fa fa-upload'
}
},
{
view: '/manage-mods',
settings: {
label: 'Manage Mods',
icon: 'icon fa fa-flask'
}
}
])
;
| angular.module('Mccy.routes', [
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/view', {
templateUrl: 'views/view-containers.html',
controller: 'ViewContainersCtrl'
})
.when('/new-server', {
templateUrl: 'views/create-container.html',
controller: 'NewContainerCtrl'
})
.when('/upload-mod', {
templateUrl: 'views/upload-mod.html',
controller: 'UploadModCtrl'
})
.when('/manage-mods', {
templateUrl: 'views/manage-mods.html',
controller: 'ManageModsCtrl'
})
.otherwise('/view')
})
.constant('MccyViews', [
{
view: '/view',
settings: {
label: 'Current Containers',
icon: 'icon fa fa-heartbeat'
}
},
{
view: '/new-server',
settings: {
label: 'Create Container',
icon: 'icon fa fa-magic'
}
},
{
view: '/upload-mod',
settings: {
label: 'Upload Mods',
icon: 'icon fa fa-upload'
}
},
{
view: '/manage-mods',
settings: {
label: 'Manage Mods',
icon: 'icon fa fa-flask'
}
}
])
;
| Revert tabs to spaces due to accidental change | Revert tabs to spaces due to accidental change
| JavaScript | apache-2.0 | itzg/minecraft-container-yard,itzg/minecraft-container-yard,moorkop/mccy-engine,itzg/minecraft-container-yard,itzg/minecraft-container-yard,moorkop/mccy-engine,moorkop/mccy-engine,moorkop/mccy-engine | javascript | ## Code Before:
angular.module('Mccy.routes', [
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/view', {
templateUrl: 'views/view-containers.html',
controller: 'ViewContainersCtrl'
})
.when('/new-server', {
templateUrl: 'views/create-container.html',
controller: 'NewContainerCtrl'
})
.when('/upload-mod', {
templateUrl: 'views/upload-mod.html',
controller: 'UploadModCtrl'
})
.when('/manage-mods', {
templateUrl: 'views/manage-mods.html',
controller: 'ManageModsCtrl'
})
.otherwise('/view')
})
.constant('MccyViews', [
{
view: '/view',
settings: {
label: 'Current Containers',
icon: 'icon fa fa-heartbeat'
}
},
{
view: '/new-server',
settings: {
label: 'Create Container',
icon: 'icon fa fa-magic'
}
},
{
view: '/upload-mod',
settings: {
label: 'Upload Mods',
icon: 'icon fa fa-upload'
}
},
{
view: '/manage-mods',
settings: {
label: 'Manage Mods',
icon: 'icon fa fa-flask'
}
}
])
;
## Instruction:
Revert tabs to spaces due to accidental change
## Code After:
angular.module('Mccy.routes', [
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/view', {
templateUrl: 'views/view-containers.html',
controller: 'ViewContainersCtrl'
})
.when('/new-server', {
templateUrl: 'views/create-container.html',
controller: 'NewContainerCtrl'
})
.when('/upload-mod', {
templateUrl: 'views/upload-mod.html',
controller: 'UploadModCtrl'
})
.when('/manage-mods', {
templateUrl: 'views/manage-mods.html',
controller: 'ManageModsCtrl'
})
.otherwise('/view')
})
.constant('MccyViews', [
{
view: '/view',
settings: {
label: 'Current Containers',
icon: 'icon fa fa-heartbeat'
}
},
{
view: '/new-server',
settings: {
label: 'Create Container',
icon: 'icon fa fa-magic'
}
},
{
view: '/upload-mod',
settings: {
label: 'Upload Mods',
icon: 'icon fa fa-upload'
}
},
{
view: '/manage-mods',
settings: {
label: 'Manage Mods',
icon: 'icon fa fa-flask'
}
}
])
;
| angular.module('Mccy.routes', [
- 'ngRoute'
? ^
+ 'ngRoute'
? ^^^^
])
.config(function ($routeProvider) {
- $routeProvider
? ^
+ $routeProvider
? ^^^^
- .when('/view', {
? ^
+ .when('/view', {
? ^^^^
- templateUrl: 'views/view-containers.html',
? ^^
+ templateUrl: 'views/view-containers.html',
? ^^^^^^^^
- controller: 'ViewContainersCtrl'
? ^^
+ controller: 'ViewContainersCtrl'
? ^^^^^^^^
- })
+ })
- .when('/new-server', {
? ^
+ .when('/new-server', {
? ^^^^
- templateUrl: 'views/create-container.html',
? ^^
+ templateUrl: 'views/create-container.html',
? ^^^^^^^^
- controller: 'NewContainerCtrl'
? ^^
+ controller: 'NewContainerCtrl'
? ^^^^^^^^
- })
+ })
- .when('/upload-mod', {
? ^
+ .when('/upload-mod', {
? ^^^^
- templateUrl: 'views/upload-mod.html',
? ^^
+ templateUrl: 'views/upload-mod.html',
? ^^^^^^^^
- controller: 'UploadModCtrl'
? ^^
+ controller: 'UploadModCtrl'
? ^^^^^^^^
- })
+ })
- .when('/manage-mods', {
? ^
+ .when('/manage-mods', {
? ^^^^
- templateUrl: 'views/manage-mods.html',
? ^^
+ templateUrl: 'views/manage-mods.html',
? ^^^^^^^^
- controller: 'ManageModsCtrl'
? ^^
+ controller: 'ManageModsCtrl'
? ^^^^^^^^
- })
+ })
- .otherwise('/view')
? ^
+ .otherwise('/view')
? ^^^^
})
.constant('MccyViews', [
- {
- view: '/view',
- settings: {
+ {
+ view: '/view',
+ settings: {
- label: 'Current Containers',
? ^^^
+ label: 'Current Containers',
? ^^^^^^^^^^^^
- icon: 'icon fa fa-heartbeat'
? ^^^
+ icon: 'icon fa fa-heartbeat'
? ^^^^^^^^^^^^
- }
- },
- {
+ }
+ },
+ {
- view: '/new-server',
? ^^
+ view: '/new-server',
? ^^^^^^^^
- settings: {
+ settings: {
- label: 'Create Container',
? ^^^
+ label: 'Create Container',
? ^^^^^^^^^^^^
- icon: 'icon fa fa-magic'
? ^^^
+ icon: 'icon fa fa-magic'
? ^^^^^^^^^^^^
- }
- },
- {
+ }
+ },
+ {
- view: '/upload-mod',
? ^^
+ view: '/upload-mod',
? ^^^^^^^^
- settings: {
- label: 'Upload Mods',
+ settings: {
+ label: 'Upload Mods',
- icon: 'icon fa fa-upload'
? ^^^
+ icon: 'icon fa fa-upload'
? ^^^^^^^^^^^^
- }
- },
- {
+ }
+ },
+ {
- view: '/manage-mods',
? ^^
+ view: '/manage-mods',
? ^^^^^^^^
- settings: {
- label: 'Manage Mods',
+ settings: {
+ label: 'Manage Mods',
- icon: 'icon fa fa-flask'
? ^^^
+ icon: 'icon fa fa-flask'
? ^^^^^^^^^^^^
- }
- }
+ }
+ }
])
; | 94 | 1.678571 | 47 | 47 |
b9842688230eb59ef3d659f42576c8ef717ac257 | cineapp/templates/add_movie_wizard.html | cineapp/templates/add_movie_wizard.html | {% extends "base.html" %}
{% block content %}
<div class="container">
<div class="text-center">
<h1>{{ header_text }}</h1>
</div>
{%from "_formhelpers.html" import render_field %}
<form action="{{ url_for( 'select_' + endpoint + '_movie') }}" method="post" name="searchmovie">
{{ search_form.hidden_tag() }}
<div class="input-group">
{{ render_field(search_form.search,label_visible=false,message=False,placeholder="Fast and furious 7, Les Tuche") }}
<div class="input-group-btn">
{{ search_form.submit_search(class="btn btn-success center-block") }}
</div>
</div>
</form>
<div id="container_overlay">
<div id="spinner" class="spinner"/>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("form input[type=submit]").click(function() {
$(":text").prop("readonly", true);
$(":submit").prop("disabled", true);
$('#container_overlay').show();
});
});
</script>
{% endblock %}
| {% extends "base.html" %}
{% block content %}
<div class="container">
<div class="text-center">
<h1>{{ header_text }}</h1>
</div>
{%from "_formhelpers.html" import render_field %}
<form action="{{ url_for( 'select_' + endpoint + '_movie') }}" method="post" name="searchmovie">
{{ search_form.hidden_tag() }}
<div class="input-group">
{{ render_field(search_form.search,label_visible=false,message=False,placeholder="Fast and furious 7, Les Tuche") }}
<div class="input-group-btn">
{{ search_form.submit_search(class="btn btn-success center-block") }}
</div>
</div>
</form>
<div id="container_overlay">
<div id="spinner" class="spinner"/>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("form input[type=submit]").click(function() {
$(":text").prop("readonly", true);
$(":submit").prop("disabled", true);
$('#container_overlay').show();
$(this).parents('form').submit()
});
});
</script>
{% endblock %}
| Fix the spinning wheel with the Chrome browser | Fix the spinning wheel with the Chrome browser
If we disable the submit button, the form is not posted with Chrome mobile. This
workaround allows disabling the button and post the form correctly.
| HTML | mit | ptitoliv/cineapp,ptitoliv/cineapp,ptitoliv/cineapp | html | ## Code Before:
{% extends "base.html" %}
{% block content %}
<div class="container">
<div class="text-center">
<h1>{{ header_text }}</h1>
</div>
{%from "_formhelpers.html" import render_field %}
<form action="{{ url_for( 'select_' + endpoint + '_movie') }}" method="post" name="searchmovie">
{{ search_form.hidden_tag() }}
<div class="input-group">
{{ render_field(search_form.search,label_visible=false,message=False,placeholder="Fast and furious 7, Les Tuche") }}
<div class="input-group-btn">
{{ search_form.submit_search(class="btn btn-success center-block") }}
</div>
</div>
</form>
<div id="container_overlay">
<div id="spinner" class="spinner"/>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("form input[type=submit]").click(function() {
$(":text").prop("readonly", true);
$(":submit").prop("disabled", true);
$('#container_overlay').show();
});
});
</script>
{% endblock %}
## Instruction:
Fix the spinning wheel with the Chrome browser
If we disable the submit button, the form is not posted with Chrome mobile. This
workaround allows disabling the button and post the form correctly.
## Code After:
{% extends "base.html" %}
{% block content %}
<div class="container">
<div class="text-center">
<h1>{{ header_text }}</h1>
</div>
{%from "_formhelpers.html" import render_field %}
<form action="{{ url_for( 'select_' + endpoint + '_movie') }}" method="post" name="searchmovie">
{{ search_form.hidden_tag() }}
<div class="input-group">
{{ render_field(search_form.search,label_visible=false,message=False,placeholder="Fast and furious 7, Les Tuche") }}
<div class="input-group-btn">
{{ search_form.submit_search(class="btn btn-success center-block") }}
</div>
</div>
</form>
<div id="container_overlay">
<div id="spinner" class="spinner"/>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("form input[type=submit]").click(function() {
$(":text").prop("readonly", true);
$(":submit").prop("disabled", true);
$('#container_overlay').show();
$(this).parents('form').submit()
});
});
</script>
{% endblock %}
| {% extends "base.html" %}
{% block content %}
<div class="container">
<div class="text-center">
<h1>{{ header_text }}</h1>
</div>
{%from "_formhelpers.html" import render_field %}
<form action="{{ url_for( 'select_' + endpoint + '_movie') }}" method="post" name="searchmovie">
{{ search_form.hidden_tag() }}
<div class="input-group">
{{ render_field(search_form.search,label_visible=false,message=False,placeholder="Fast and furious 7, Les Tuche") }}
<div class="input-group-btn">
{{ search_form.submit_search(class="btn btn-success center-block") }}
</div>
</div>
</form>
<div id="container_overlay">
<div id="spinner" class="spinner"/>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("form input[type=submit]").click(function() {
$(":text").prop("readonly", true);
$(":submit").prop("disabled", true);
$('#container_overlay').show();
+ $(this).parents('form').submit()
});
});
</script>
{% endblock %} | 1 | 0.032258 | 1 | 0 |
e2ce9ad697cd686e91b546f6f3aa7b24b5e9266f | masters/master.tryserver.chromium.angle/master_site_config.py | masters/master.tryserver.chromium.angle/master_site_config.py |
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServerANGLE(Master.Master4a):
project_name = 'ANGLE Try Server'
master_port = 21403
slave_port = 31403
master_port_alt = 41403
buildbot_url = 'http://build.chromium.org/p/tryserver.chromium.angle/'
gerrit_host = 'https://chromium-review.googlesource.com'
|
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServerANGLE(Master.Master4a):
project_name = 'ANGLE Try Server'
master_port = 21403
slave_port = 31403
master_port_alt = 41403
buildbot_url = 'http://build.chromium.org/p/tryserver.chromium.angle/'
gerrit_host = 'https://chromium-review.googlesource.com'
service_account_file = 'service-account-chromium-tryserver.json'
buildbucket_bucket = 'master.tryserver.chromium.linux'
| Add buildbucket service account to Angle master. | Add buildbucket service account to Angle master.
BUG=577560
TBR=nodir@chromium.org
Review URL: https://codereview.chromium.org/1624703003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@298368 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | python | ## Code Before:
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServerANGLE(Master.Master4a):
project_name = 'ANGLE Try Server'
master_port = 21403
slave_port = 31403
master_port_alt = 41403
buildbot_url = 'http://build.chromium.org/p/tryserver.chromium.angle/'
gerrit_host = 'https://chromium-review.googlesource.com'
## Instruction:
Add buildbucket service account to Angle master.
BUG=577560
TBR=nodir@chromium.org
Review URL: https://codereview.chromium.org/1624703003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@298368 0039d316-1c4b-4281-b951-d872f2087c98
## Code After:
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServerANGLE(Master.Master4a):
project_name = 'ANGLE Try Server'
master_port = 21403
slave_port = 31403
master_port_alt = 41403
buildbot_url = 'http://build.chromium.org/p/tryserver.chromium.angle/'
gerrit_host = 'https://chromium-review.googlesource.com'
service_account_file = 'service-account-chromium-tryserver.json'
buildbucket_bucket = 'master.tryserver.chromium.linux'
|
"""ActiveMaster definition."""
from config_bootstrap import Master
class TryServerANGLE(Master.Master4a):
project_name = 'ANGLE Try Server'
master_port = 21403
slave_port = 31403
master_port_alt = 41403
buildbot_url = 'http://build.chromium.org/p/tryserver.chromium.angle/'
gerrit_host = 'https://chromium-review.googlesource.com'
+ service_account_file = 'service-account-chromium-tryserver.json'
+ buildbucket_bucket = 'master.tryserver.chromium.linux' | 2 | 0.166667 | 2 | 0 |
c2f8fe3c081a987c212ce6958dec9a3f72225498 | .github/ISSUE_TEMPLATE/message-rfp.md | .github/ISSUE_TEMPLATE/message-rfp.md | ---
name: Message RFP
about: Suggest a message or messages be added to/changed in the protocol
title: ''
labels: RFP - Messages
assignees: ''
---
**Name of Outgoing Message, if any:**
**Name of Incoming Message, if any:**
**Describe message usage scenario**
A clear and concise description of how you see the message being used.
**Additional context**
Add any other context or screenshots about the feature request here.
| ---
name: Message RFP
about: Suggest a message or messages be added to/changed in the protocol
title: ''
labels: RFP - Messages
assignees: ''
---
**Name of Outgoing Message, if any:**
**Name of Incoming Message, if any:**
**Message Fields:**
- Message Name
- Message Field: Type (number, string, array, object, etc), Description
**Describe message usage scenario**
A clear and concise description of how you see the message being used.
**Additional context**
Add any other context or screenshots about the feature request here.
| Add message fields to message rfp template | Add message fields to message rfp template | Markdown | bsd-3-clause | metafetish/buttplug | markdown | ## Code Before:
---
name: Message RFP
about: Suggest a message or messages be added to/changed in the protocol
title: ''
labels: RFP - Messages
assignees: ''
---
**Name of Outgoing Message, if any:**
**Name of Incoming Message, if any:**
**Describe message usage scenario**
A clear and concise description of how you see the message being used.
**Additional context**
Add any other context or screenshots about the feature request here.
## Instruction:
Add message fields to message rfp template
## Code After:
---
name: Message RFP
about: Suggest a message or messages be added to/changed in the protocol
title: ''
labels: RFP - Messages
assignees: ''
---
**Name of Outgoing Message, if any:**
**Name of Incoming Message, if any:**
**Message Fields:**
- Message Name
- Message Field: Type (number, string, array, object, etc), Description
**Describe message usage scenario**
A clear and concise description of how you see the message being used.
**Additional context**
Add any other context or screenshots about the feature request here.
| ---
name: Message RFP
about: Suggest a message or messages be added to/changed in the protocol
title: ''
labels: RFP - Messages
assignees: ''
---
**Name of Outgoing Message, if any:**
**Name of Incoming Message, if any:**
+ **Message Fields:**
+
+ - Message Name
+ - Message Field: Type (number, string, array, object, etc), Description
+
**Describe message usage scenario**
A clear and concise description of how you see the message being used.
**Additional context**
Add any other context or screenshots about the feature request here. | 5 | 0.277778 | 5 | 0 |
800b9faf318bd5fd403ae9beef8bddb35e82802a | setup.py | setup.py |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('fcmcmp/__meta__.py') as file:
exec(file.read())
with open('README.rst') as file:
readme = file.read()
setup(
name='fcmcmp',
version=__version__,
author=__author__,
author_email=__email__,
description="A lightweight, flexible, and modern framework for annotating flow cytometry data.",
long_description=readme,
url='https://github.com/kalekundert/fcmcmp',
packages=[
'fcmcmp',
],
include_package_data=True,
install_requires=[
'fcsparser',
'pyyaml',
],
license='MIT',
zip_safe=False,
keywords=[
'fcmcmp',
],
)
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('fcmcmp/__meta__.py') as file:
exec(file.read())
with open('README.rst') as file:
readme = file.read()
setup(
name='fcmcmp',
version=__version__,
author=__author__,
author_email=__email__,
description="A lightweight, flexible, and modern framework for annotating flow cytometry data.",
long_description=readme,
url='https://github.com/kalekundert/fcmcmp',
packages=[
'fcmcmp',
],
include_package_data=True,
install_requires=[
'fcsparser',
'pyyaml',
'pathlib',
],
license='MIT',
zip_safe=False,
keywords=[
'fcmcmp',
],
)
| Add pathlib as a dependency. | Add pathlib as a dependency.
This is only required for python<=3.2, after which pathlib is included
in the standard library.
| Python | mit | kalekundert/fcmcmp | python | ## Code Before:
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('fcmcmp/__meta__.py') as file:
exec(file.read())
with open('README.rst') as file:
readme = file.read()
setup(
name='fcmcmp',
version=__version__,
author=__author__,
author_email=__email__,
description="A lightweight, flexible, and modern framework for annotating flow cytometry data.",
long_description=readme,
url='https://github.com/kalekundert/fcmcmp',
packages=[
'fcmcmp',
],
include_package_data=True,
install_requires=[
'fcsparser',
'pyyaml',
],
license='MIT',
zip_safe=False,
keywords=[
'fcmcmp',
],
)
## Instruction:
Add pathlib as a dependency.
This is only required for python<=3.2, after which pathlib is included
in the standard library.
## Code After:
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('fcmcmp/__meta__.py') as file:
exec(file.read())
with open('README.rst') as file:
readme = file.read()
setup(
name='fcmcmp',
version=__version__,
author=__author__,
author_email=__email__,
description="A lightweight, flexible, and modern framework for annotating flow cytometry data.",
long_description=readme,
url='https://github.com/kalekundert/fcmcmp',
packages=[
'fcmcmp',
],
include_package_data=True,
install_requires=[
'fcsparser',
'pyyaml',
'pathlib',
],
license='MIT',
zip_safe=False,
keywords=[
'fcmcmp',
],
)
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('fcmcmp/__meta__.py') as file:
exec(file.read())
with open('README.rst') as file:
readme = file.read()
setup(
name='fcmcmp',
version=__version__,
author=__author__,
author_email=__email__,
description="A lightweight, flexible, and modern framework for annotating flow cytometry data.",
long_description=readme,
url='https://github.com/kalekundert/fcmcmp',
packages=[
'fcmcmp',
],
include_package_data=True,
install_requires=[
'fcsparser',
'pyyaml',
+ 'pathlib',
],
license='MIT',
zip_safe=False,
keywords=[
'fcmcmp',
],
) | 1 | 0.030303 | 1 | 0 |
c612b7c9930b9dae1482bb2ac4b0f31dbe859054 | tests/integration/BaseTest.php | tests/integration/BaseTest.php | <?php
class BaseTest extends PHPUnit_Framework_TestCase {
/**
* @var \BulkSmsCenter\Auth
*/
protected $auth;
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
protected $mockClient;
public function setUp()
{
$this->auth = new \BulkSmsCenter\Auth('YOUR_USERNAME','YOUR_PASSWORD');
$this->mockClient = $this->getMockBuilder("\BulkSmsCenter\HttpClient")->getMock();
}
public function testConstructor()
{
$client = new \BulkSmsCenter\Client();
$this->assertInstanceOf('BulkSmsCenter\Message',$client->getMessage());
}
public function testHttpClientMock()
{
$this->mockClient->expects($this->atLeastOnce())->method('setUserAgent');
$client = new \BulkSmsCenter\Client($this->auth,$this->mockClient);
}
}
| <?php
class BaseTest extends PHPUnit_Framework_TestCase {
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
protected $mockAuth;
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
protected $mockClient;
public function setUp()
{
$this->mockAuth = $this->getMockBuilder("\BulkSmsCenter\Auth")->setConstructorArgs([
'YOUR_USERNAME',
'YOUR_PASSWORD',
])->getMock();
$this->mockClient = $this->getMockBuilder("\BulkSmsCenter\HttpClient")->getMock();
}
public function testConstructor()
{
$client = new \BulkSmsCenter\Client();
$this->assertInstanceOf('BulkSmsCenter\Message',$client->getMessage());
}
public function testHttpClientMock()
{
$this->mockClient->expects($this->atLeastOnce())->method('setUserAgent');
$client = new \BulkSmsCenter\Client($this->auth,$this->mockClient);
}
}
| Use a mock for Auth object | Use a mock for Auth object
| PHP | mit | sevenymedia/bulksmscenter-http-api,sevenymedia/bulksmscenter-http-api | php | ## Code Before:
<?php
class BaseTest extends PHPUnit_Framework_TestCase {
/**
* @var \BulkSmsCenter\Auth
*/
protected $auth;
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
protected $mockClient;
public function setUp()
{
$this->auth = new \BulkSmsCenter\Auth('YOUR_USERNAME','YOUR_PASSWORD');
$this->mockClient = $this->getMockBuilder("\BulkSmsCenter\HttpClient")->getMock();
}
public function testConstructor()
{
$client = new \BulkSmsCenter\Client();
$this->assertInstanceOf('BulkSmsCenter\Message',$client->getMessage());
}
public function testHttpClientMock()
{
$this->mockClient->expects($this->atLeastOnce())->method('setUserAgent');
$client = new \BulkSmsCenter\Client($this->auth,$this->mockClient);
}
}
## Instruction:
Use a mock for Auth object
## Code After:
<?php
class BaseTest extends PHPUnit_Framework_TestCase {
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
protected $mockAuth;
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
protected $mockClient;
public function setUp()
{
$this->mockAuth = $this->getMockBuilder("\BulkSmsCenter\Auth")->setConstructorArgs([
'YOUR_USERNAME',
'YOUR_PASSWORD',
])->getMock();
$this->mockClient = $this->getMockBuilder("\BulkSmsCenter\HttpClient")->getMock();
}
public function testConstructor()
{
$client = new \BulkSmsCenter\Client();
$this->assertInstanceOf('BulkSmsCenter\Message',$client->getMessage());
}
public function testHttpClientMock()
{
$this->mockClient->expects($this->atLeastOnce())->method('setUserAgent');
$client = new \BulkSmsCenter\Client($this->auth,$this->mockClient);
}
}
| <?php
class BaseTest extends PHPUnit_Framework_TestCase {
/**
- * @var \BulkSmsCenter\Auth
+ * @var PHPUnit_Framework_MockObject_MockObject
*/
- protected $auth;
? ^
+ protected $mockAuth;
? ^^^^^
/**
* @var PHPUnit_Framework_MockObject_MockObject
*/
protected $mockClient;
public function setUp()
{
- $this->auth = new \BulkSmsCenter\Auth('YOUR_USERNAME','YOUR_PASSWORD');
+ $this->mockAuth = $this->getMockBuilder("\BulkSmsCenter\Auth")->setConstructorArgs([
+ 'YOUR_USERNAME',
+ 'YOUR_PASSWORD',
+ ])->getMock();
$this->mockClient = $this->getMockBuilder("\BulkSmsCenter\HttpClient")->getMock();
}
public function testConstructor()
{
$client = new \BulkSmsCenter\Client();
$this->assertInstanceOf('BulkSmsCenter\Message',$client->getMessage());
}
public function testHttpClientMock()
{
$this->mockClient->expects($this->atLeastOnce())->method('setUserAgent');
$client = new \BulkSmsCenter\Client($this->auth,$this->mockClient);
}
} | 9 | 0.272727 | 6 | 3 |
45b90c1265f2bd840d48bfc58abbe9d08d39fac0 | setup.cfg | setup.cfg | [bumpversion]
current_version = 0.1.2
commit = True
tag = True
[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
[bumpversion:file:webhook_logger/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
[bdist_wheel]
universal = 1
[flake8]
exclude = docs
| [bumpversion]
current_version = 0.1.2
commit = True
tag = True
[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
[bumpversion:file:webhook_logger/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
[bdist_wheel]
universal = 1
[flake8]
exclude = docs
max-line-length = 119
| Set max line length in Flake8 check | Set max line length in Flake8 check
| INI | mit | founders4schools/python-webhook-logger | ini | ## Code Before:
[bumpversion]
current_version = 0.1.2
commit = True
tag = True
[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
[bumpversion:file:webhook_logger/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
[bdist_wheel]
universal = 1
[flake8]
exclude = docs
## Instruction:
Set max line length in Flake8 check
## Code After:
[bumpversion]
current_version = 0.1.2
commit = True
tag = True
[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
[bumpversion:file:webhook_logger/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
[bdist_wheel]
universal = 1
[flake8]
exclude = docs
max-line-length = 119
| [bumpversion]
current_version = 0.1.2
commit = True
tag = True
[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
[bumpversion:file:webhook_logger/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
[bdist_wheel]
universal = 1
[flake8]
exclude = docs
+ max-line-length = 119
| 1 | 0.052632 | 1 | 0 |
f38ad762c4cd17e11d9be35dab149d9b9d581166 | templates/exporter-config.yaml | templates/exporter-config.yaml | {{- if .Values.prometheusExporter.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: '{{ include "ambassador.fullname" . }}-exporter-config'
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ include "ambassador.managedBy" . }}
data:
exporterConfiguration:
{{- if .Values.prometheusExporter.configuration }} |
{{- .Values.prometheusExporter.configuration | nindent 4 }}
{{- else }} ''
{{- end }}
{{- end }}
| {{- if .Values.prometheusExporter.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: '{{ include "ambassador.fullname" . }}-exporter-config'
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.deploymentTool }}
app.kubernetes.io/managed-by: {{ .Values.deploymentTool }}
{{- else }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
data:
exporterConfiguration:
{{- if .Values.prometheusExporter.configuration }} |
{{- .Values.prometheusExporter.configuration | nindent 4 }}
{{- else }} ''
{{- end }}
{{- end }}
| Fix managedBy label in exporter | Fix managedBy label in exporter
Signed-off-by: Noah Krause <8c0b8c0be5b8c68ce7dec81b6dc58293d67c9025@gmail.com>
| YAML | apache-2.0 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | yaml | ## Code Before:
{{- if .Values.prometheusExporter.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: '{{ include "ambassador.fullname" . }}-exporter-config'
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ include "ambassador.managedBy" . }}
data:
exporterConfiguration:
{{- if .Values.prometheusExporter.configuration }} |
{{- .Values.prometheusExporter.configuration | nindent 4 }}
{{- else }} ''
{{- end }}
{{- end }}
## Instruction:
Fix managedBy label in exporter
Signed-off-by: Noah Krause <8c0b8c0be5b8c68ce7dec81b6dc58293d67c9025@gmail.com>
## Code After:
{{- if .Values.prometheusExporter.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: '{{ include "ambassador.fullname" . }}-exporter-config'
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.deploymentTool }}
app.kubernetes.io/managed-by: {{ .Values.deploymentTool }}
{{- else }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
data:
exporterConfiguration:
{{- if .Values.prometheusExporter.configuration }} |
{{- .Values.prometheusExporter.configuration | nindent 4 }}
{{- else }} ''
{{- end }}
{{- end }}
| {{- if .Values.prometheusExporter.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: '{{ include "ambassador.fullname" . }}-exporter-config'
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
- app.kubernetes.io/managed-by: {{ include "ambassador.managedBy" . }}
+ {{- if .Values.deploymentTool }}
+ app.kubernetes.io/managed-by: {{ .Values.deploymentTool }}
+ {{- else }}
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
+ {{- end }}
data:
exporterConfiguration:
{{- if .Values.prometheusExporter.configuration }} |
{{- .Values.prometheusExporter.configuration | nindent 4 }}
{{- else }} ''
{{- end }}
{{- end }} | 6 | 0.315789 | 5 | 1 |
fefbdc6e5e030c2a31d52bf8c310199b43ad2b92 | app/views/films/index.html.erb | app/views/films/index.html.erb | <h1>Films</h1>
<% @films.each do |film| %>
<div class="film-container">
<div class="film-data">
<p><%= film.title %></p>
<p><%= film.year %></p>
<p><%= film.director %></p>
<p><%= film.runtime %></p>
<p><%= film.description %></p>
</div>
<div class="film-nav">
<p><%= link_to 'Show', film_path(film) %></p>
</div>
</div>
<% end %> | <h1>Films</h1>
<% @films.each do |film| %>
<div class="film-container">
<div class="film-data">
<p><%= film.title %></p>
<p><strong>Year: </strong><%= @film.year %></p>
<p><strong>Directed by:</strong> <%= @film.director %></p>
<p><strong>Runtime:</strong> <%= @film.runtime %></p>
<p><strong>Description:</strong> <%= @film.description %></p>
</div>
<div class="film-nav">
<p><%= link_to 'Show', film_path(film) %></p>
</div>
</div>
<% end %> | Add lables to to film data on films/index view | Add lables to to film data on films/index view
| HTML+ERB | mit | JacobCrofts/wintergarten,JacobCrofts/wintergarten,JacobCrofts/wintergarten | html+erb | ## Code Before:
<h1>Films</h1>
<% @films.each do |film| %>
<div class="film-container">
<div class="film-data">
<p><%= film.title %></p>
<p><%= film.year %></p>
<p><%= film.director %></p>
<p><%= film.runtime %></p>
<p><%= film.description %></p>
</div>
<div class="film-nav">
<p><%= link_to 'Show', film_path(film) %></p>
</div>
</div>
<% end %>
## Instruction:
Add lables to to film data on films/index view
## Code After:
<h1>Films</h1>
<% @films.each do |film| %>
<div class="film-container">
<div class="film-data">
<p><%= film.title %></p>
<p><strong>Year: </strong><%= @film.year %></p>
<p><strong>Directed by:</strong> <%= @film.director %></p>
<p><strong>Runtime:</strong> <%= @film.runtime %></p>
<p><strong>Description:</strong> <%= @film.description %></p>
</div>
<div class="film-nav">
<p><%= link_to 'Show', film_path(film) %></p>
</div>
</div>
<% end %> | <h1>Films</h1>
<% @films.each do |film| %>
<div class="film-container">
<div class="film-data">
<p><%= film.title %></p>
- <p><%= film.year %></p>
- <p><%= film.director %></p>
- <p><%= film.runtime %></p>
- <p><%= film.description %></p>
+ <p><strong>Year: </strong><%= @film.year %></p>
+ <p><strong>Directed by:</strong> <%= @film.director %></p>
+ <p><strong>Runtime:</strong> <%= @film.runtime %></p>
+ <p><strong>Description:</strong> <%= @film.description %></p>
</div>
<div class="film-nav">
<p><%= link_to 'Show', film_path(film) %></p>
</div>
</div>
<% end %> | 8 | 0.5 | 4 | 4 |
6c278ec266143c4fdbf3e4d8e4b740d902decc59 | lib/rorvswild/plugin/action_view.rb | lib/rorvswild/plugin/action_view.rb | module RorVsWild
module Plugin
class ActionView
def self.setup
return if @installed
return unless defined?(::ActiveSupport::Notifications.subscribe)
ActiveSupport::Notifications.subscribe("render_partial.action_view", new)
ActiveSupport::Notifications.subscribe("render_template.action_view", new)
@installed = true
end
def start(name, id, payload)
RorVsWild::Section.start
end
def finish(name, id, payload)
RorVsWild::Section.stop do |section|
section.kind = "view".freeze
section.command = RorVsWild.agent.relative_path(payload[:identifier])
end
end
end
end
end
| module RorVsWild
module Plugin
class ActionView
def self.setup
return if @installed
return unless defined?(::ActiveSupport::Notifications.subscribe)
ActiveSupport::Notifications.subscribe("render_partial.action_view", new)
ActiveSupport::Notifications.subscribe("render_template.action_view", new)
@installed = true
end
def start(name, id, payload)
RorVsWild::Section.start
end
def finish(name, id, payload)
RorVsWild::Section.stop do |section|
section.kind = "view".freeze
section.command = RorVsWild.agent.relative_path(payload[:identifier])
section.file = section.command
section.line = 1
end
end
end
end
end
| Replace view file by relative path. | Replace view file by relative path.
| Ruby | mit | BaseSecrete/rorvswild,alexisbernard/rorvswild,BaseSecrete/rorvswild,BaseSecrete/rorvswild | ruby | ## Code Before:
module RorVsWild
module Plugin
class ActionView
def self.setup
return if @installed
return unless defined?(::ActiveSupport::Notifications.subscribe)
ActiveSupport::Notifications.subscribe("render_partial.action_view", new)
ActiveSupport::Notifications.subscribe("render_template.action_view", new)
@installed = true
end
def start(name, id, payload)
RorVsWild::Section.start
end
def finish(name, id, payload)
RorVsWild::Section.stop do |section|
section.kind = "view".freeze
section.command = RorVsWild.agent.relative_path(payload[:identifier])
end
end
end
end
end
## Instruction:
Replace view file by relative path.
## Code After:
module RorVsWild
module Plugin
class ActionView
def self.setup
return if @installed
return unless defined?(::ActiveSupport::Notifications.subscribe)
ActiveSupport::Notifications.subscribe("render_partial.action_view", new)
ActiveSupport::Notifications.subscribe("render_template.action_view", new)
@installed = true
end
def start(name, id, payload)
RorVsWild::Section.start
end
def finish(name, id, payload)
RorVsWild::Section.stop do |section|
section.kind = "view".freeze
section.command = RorVsWild.agent.relative_path(payload[:identifier])
section.file = section.command
section.line = 1
end
end
end
end
end
| module RorVsWild
module Plugin
class ActionView
def self.setup
return if @installed
return unless defined?(::ActiveSupport::Notifications.subscribe)
ActiveSupport::Notifications.subscribe("render_partial.action_view", new)
ActiveSupport::Notifications.subscribe("render_template.action_view", new)
@installed = true
end
def start(name, id, payload)
RorVsWild::Section.start
end
def finish(name, id, payload)
RorVsWild::Section.stop do |section|
section.kind = "view".freeze
section.command = RorVsWild.agent.relative_path(payload[:identifier])
+ section.file = section.command
+ section.line = 1
end
end
end
end
end | 2 | 0.083333 | 2 | 0 |
d11071ab41b8dd72e1579fbe0cf5c9c780b02561 | utils/wp-completion.bash | utils/wp-completion.bash |
_wp() {
local cur prev opts
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ 'wp' = $prev ]]; then
opts=$(wp --completions | cut -d ' ' -f 1 | tr '\n' ' ')
else
opts=$(wp --completions | grep ^$prev | cut -d ' ' -f 2- | tr '\n' ' ')
fi
COMPREPLY=( $(compgen -W "$opts" -- $cur) )
}
complete -F _wp wp
|
_wp() {
local cur prev opts
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ 'wp' = $prev ]]; then
opts=$(wp --completions | cut -d ' ' -f 1 | tr '\n' ' ')
else
opts=$(wp --completions | grep ^$prev | cut -d ' ' -f 2- | tr '\n' ' ')
fi
if [[ 'create' = $prev ]]; then
COMPREPLY=( $(compgen -f "$cur") )
else
COMPREPLY=( $(compgen -W "$opts" -- $cur) )
fi
}
complete -F _wp wp
| Add filename completion for `wp post create` command | Add filename completion for `wp post create` command
Uses bash default filename completion for `wp post create`
| Shell | mit | xwp/wp-cli,gedex/wp-cli,heiglandreas/wp-cli,blueblazeassociates/wp-cli,GaryJones/wp-cli,blueblazeassociates/wp-cli,pressednet/wp-cli,spiritedmedia/wp-cli,duncanjbrown/wp-cli,gitlost/wp-cli,spiritedmedia/wp-cli,JohnDittmar/wp-cli,borekb/wp-cli,gitlost/wp-cli,2ndkauboy/wp-cli,JohnDittmar/wp-cli,Yas3r/wp-cli,2ndkauboy/wp-cli,ahmadawais/wp-cli,nyordanov/wp-cli,rohmann/wp-cli,trepmal/wp-cli,pressednet/wp-cli,rodrigoprimo/wp-cli,rohmann/wp-cli,macbookandrew/wp-cli,spiritedmedia/wp-cli,aaemnnosttv/wp-cli,macbookandrew/wp-cli,2ndkauboy/wp-cli,xwp/wp-cli,dpq/wp-cli,heiglandreas/wp-cli,nyordanov/wp-cli,trepmal/wp-cli,rohmann/wp-cli,duncanjbrown/wp-cli,ahmadawais/wp-cli,JohnDittmar/wp-cli,shawnhooper/wp-cli,boonebgorges/wp-cli,miya0001/wp-cli,duncanjbrown/wp-cli,anttiviljami/wp-cli,here/wp-cli,rodrigoprimo/wp-cli,pressednet/wp-cli,borekb/wp-cli,a7127cff69cab32e5c4723e8446e21c4b7325dc/wp-cli,xwp/wp-cli,here/wp-cli,staylor/wp-cli,dpq/wp-cli,GaryJones/wp-cli,GaryJones/wp-cli,gitlost/wp-cli,Yas3r/wp-cli,boonebgorges/wp-cli,Yas3r/wp-cli,shawnhooper/wp-cli,blueblazeassociates/wp-cli,aaemnnosttv/wp-cli,rodrigoprimo/wp-cli,miya0001/wp-cli,aaemnnosttv/wp-cli,staylor/wp-cli,trepmal/wp-cli,borekb/wp-cli,shawnhooper/wp-cli,staylor/wp-cli,a7127cff69cab32e5c4723e8446e21c4b7325dc/wp-cli,dpq/wp-cli,macbookandrew/wp-cli,ahmadawais/wp-cli,anttiviljami/wp-cli,gedex/wp-cli,a7127cff69cab32e5c4723e8446e21c4b7325dc/wp-cli,anttiviljami/wp-cli,boonebgorges/wp-cli,gedex/wp-cli,miya0001/wp-cli,nyordanov/wp-cli | shell | ## Code Before:
_wp() {
local cur prev opts
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ 'wp' = $prev ]]; then
opts=$(wp --completions | cut -d ' ' -f 1 | tr '\n' ' ')
else
opts=$(wp --completions | grep ^$prev | cut -d ' ' -f 2- | tr '\n' ' ')
fi
COMPREPLY=( $(compgen -W "$opts" -- $cur) )
}
complete -F _wp wp
## Instruction:
Add filename completion for `wp post create` command
Uses bash default filename completion for `wp post create`
## Code After:
_wp() {
local cur prev opts
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ 'wp' = $prev ]]; then
opts=$(wp --completions | cut -d ' ' -f 1 | tr '\n' ' ')
else
opts=$(wp --completions | grep ^$prev | cut -d ' ' -f 2- | tr '\n' ' ')
fi
if [[ 'create' = $prev ]]; then
COMPREPLY=( $(compgen -f "$cur") )
else
COMPREPLY=( $(compgen -W "$opts" -- $cur) )
fi
}
complete -F _wp wp
|
_wp() {
local cur prev opts
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ 'wp' = $prev ]]; then
opts=$(wp --completions | cut -d ' ' -f 1 | tr '\n' ' ')
else
opts=$(wp --completions | grep ^$prev | cut -d ' ' -f 2- | tr '\n' ' ')
fi
+ if [[ 'create' = $prev ]]; then
+ COMPREPLY=( $(compgen -f "$cur") )
+ else
- COMPREPLY=( $(compgen -W "$opts" -- $cur) )
+ COMPREPLY=( $(compgen -W "$opts" -- $cur) )
? +
+ fi
}
complete -F _wp wp | 6 | 0.375 | 5 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.