commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 5
4.84k
| subject
stringlengths 15
778
| message
stringlengths 16
6.86k
| lang
stringlengths 1
30
| license
stringclasses 13
values | repos
stringlengths 5
116k
| config
stringlengths 1
30
| content
stringlengths 105
8.72k
|
---|---|---|---|---|---|---|---|---|---|---|---|
fbc9076f656f4362afdfd45298ab2f16c6f5a53c | src/models/torrents.coffee | src/models/torrents.coffee | Schema = mongoose.Schema
ObjectId = Schema.ObjectId
Comment = new Schema {
body : String,
author_id : ObjectId,
date : Date
}
File = new Schema {
path : String,
size : Number
}
Torrent = new Schema {
uploader : String,
title : String,
size : Number,
dateUploaded : {type: Date, default: new Date},
files : [File],
description : String,
comments : [Comment],
category : String,
infohash : {type: String, index: {unique:true}}
permalink : {type: String, index: {unique:true}}
}
Torrent.method 'generatePermalink', (callback) ->
baseurl = @title.substring(0, 75).replace(' ', '_')
# check for collisions
checkFunc = (base, endno) =>
if endno > 0
url = base + '-' + endno
else
url = base
(mongoose.model 'Torrent').findOne {'permalink' : url}, (err, doc) =>
if doc
checkFunc base, endno+1
else
@permalink = url
callback ''
checkFunc baseurl, 0
TorrentModel = mongoose.model 'Torrent', Torrent
exports.Torrent = TorrentModel
| Schema = mongoose.Schema
ObjectId = Schema.ObjectId
Comment = new Schema {
body : String,
author_id : ObjectId,
date : Date
}
File = new Schema {
path : String,
size : Number
}
Torrent = new Schema {
uploader : String,
title : String,
size : Number,
dateUploaded : {type: Date, default: new Date},
files : [File],
description : String,
comments : [Comment],
category : String,
infohash : {type: String, index: {unique:true}}
permalink : {type: String, index: {unique:true}}
}
Torrent.method 'generatePermalink', (callback) ->
re = new RegExp(' ', 'g')
baseurl = @title.substring(0, 75).replace(re, '_')
# check for collisions
checkFunc = (base, endno) =>
if endno > 0
url = base + '-' + endno
else
url = base
(mongoose.model 'Torrent').findOne {'permalink' : url}, (err, doc) =>
if doc
checkFunc base, endno+1
else
@permalink = url
callback ''
checkFunc baseurl, 0
TorrentModel = mongoose.model 'Torrent', Torrent
exports.Torrent = TorrentModel
| Fix permalink url for /g replacing of space | Fix permalink url for /g replacing of space
| CoffeeScript | bsd-3-clause | mileswu/nyaa2 | coffeescript | ## Code Before:
Schema = mongoose.Schema
ObjectId = Schema.ObjectId
Comment = new Schema {
body : String,
author_id : ObjectId,
date : Date
}
File = new Schema {
path : String,
size : Number
}
Torrent = new Schema {
uploader : String,
title : String,
size : Number,
dateUploaded : {type: Date, default: new Date},
files : [File],
description : String,
comments : [Comment],
category : String,
infohash : {type: String, index: {unique:true}}
permalink : {type: String, index: {unique:true}}
}
Torrent.method 'generatePermalink', (callback) ->
baseurl = @title.substring(0, 75).replace(' ', '_')
# check for collisions
checkFunc = (base, endno) =>
if endno > 0
url = base + '-' + endno
else
url = base
(mongoose.model 'Torrent').findOne {'permalink' : url}, (err, doc) =>
if doc
checkFunc base, endno+1
else
@permalink = url
callback ''
checkFunc baseurl, 0
TorrentModel = mongoose.model 'Torrent', Torrent
exports.Torrent = TorrentModel
## Instruction:
Fix permalink url for /g replacing of space
## Code After:
Schema = mongoose.Schema
ObjectId = Schema.ObjectId
Comment = new Schema {
body : String,
author_id : ObjectId,
date : Date
}
File = new Schema {
path : String,
size : Number
}
Torrent = new Schema {
uploader : String,
title : String,
size : Number,
dateUploaded : {type: Date, default: new Date},
files : [File],
description : String,
comments : [Comment],
category : String,
infohash : {type: String, index: {unique:true}}
permalink : {type: String, index: {unique:true}}
}
Torrent.method 'generatePermalink', (callback) ->
re = new RegExp(' ', 'g')
baseurl = @title.substring(0, 75).replace(re, '_')
# check for collisions
checkFunc = (base, endno) =>
if endno > 0
url = base + '-' + endno
else
url = base
(mongoose.model 'Torrent').findOne {'permalink' : url}, (err, doc) =>
if doc
checkFunc base, endno+1
else
@permalink = url
callback ''
checkFunc baseurl, 0
TorrentModel = mongoose.model 'Torrent', Torrent
exports.Torrent = TorrentModel
|
d842003d25f384d71fca32883dc1a1555245666b | autoload/importjs.vim | autoload/importjs.vim | function importjs#ImportJSImport()
ruby $import_js.import
endfunction
endfunction
function importjs#ImportJSGoTo()
ruby $import_js.goto
endfunction
function importjs#ImportJSRemoveUnusedImports()
ruby $import_js.remove_unused_imports
endfunction
function importjs#ImportJSFixImports()
ruby $import_js.fix_imports
endfunction
" WideMsg() prints [long] message up to (&columns-1) length
" guaranteed without "Press Enter" prompt.
" http://vim.wikia.com/wiki/How_to_print_full_screen_width_messages
function! importjs#WideMsg(msg)
let x=&ruler | let y=&showcmd
set noruler noshowcmd
redraw
echo a:msg
let &ruler=x | let &showcmd=y
endfun
ruby << EOF
begin
require 'import_js'
$import_js = ImportJS::Importer.new
rescue LoadError
load_path_modified = false
::VIM::evaluate('&runtimepath').to_s.split(',').each do |path|
lib = "#{path}/lib"
if !$LOAD_PATH.include?(lib) and File.exist?(lib)
$LOAD_PATH << lib
load_path_modified = true
end
end
retry if load_path_modified
end
EOF
| function importjs#ImportJSImport()
ruby $import_js.import
endfunction
function importjs#ImportJSGoTo()
ruby $import_js.goto
endfunction
function importjs#ImportJSRemoveUnusedImports()
ruby $import_js.remove_unused_imports
endfunction
function importjs#ImportJSFixImports()
ruby $import_js.fix_imports
endfunction
" WideMsg() prints [long] message up to (&columns-1) length
" guaranteed without "Press Enter" prompt.
" http://vim.wikia.com/wiki/How_to_print_full_screen_width_messages
function! importjs#WideMsg(msg)
let x=&ruler | let y=&showcmd
set noruler noshowcmd
redraw
echo a:msg
let &ruler=x | let &showcmd=y
endfun
ruby << EOF
begin
require 'import_js'
$import_js = ImportJS::Importer.new
rescue LoadError
load_path_modified = false
::VIM::evaluate('&runtimepath').to_s.split(',').each do |path|
lib = "#{path}/lib"
if !$LOAD_PATH.include?(lib) and File.exist?(lib)
$LOAD_PATH << lib
load_path_modified = true
end
end
retry if load_path_modified
end
EOF
| Remove extraneous endfunction from vim autoload | Remove extraneous endfunction from vim autoload
I noticed an error in Vim when using ImportJS for the first time on
load:
> endfunction not inside a function
I traced it down to this extraneous endfunction.
| VimL | mit | Galooshi/import-js,trotzig/import-js,lencioni/import-js,trotzig/import-js,trotzig/import-js,lencioni/import-js,lencioni/import-js | viml | ## Code Before:
function importjs#ImportJSImport()
ruby $import_js.import
endfunction
endfunction
function importjs#ImportJSGoTo()
ruby $import_js.goto
endfunction
function importjs#ImportJSRemoveUnusedImports()
ruby $import_js.remove_unused_imports
endfunction
function importjs#ImportJSFixImports()
ruby $import_js.fix_imports
endfunction
" WideMsg() prints [long] message up to (&columns-1) length
" guaranteed without "Press Enter" prompt.
" http://vim.wikia.com/wiki/How_to_print_full_screen_width_messages
function! importjs#WideMsg(msg)
let x=&ruler | let y=&showcmd
set noruler noshowcmd
redraw
echo a:msg
let &ruler=x | let &showcmd=y
endfun
ruby << EOF
begin
require 'import_js'
$import_js = ImportJS::Importer.new
rescue LoadError
load_path_modified = false
::VIM::evaluate('&runtimepath').to_s.split(',').each do |path|
lib = "#{path}/lib"
if !$LOAD_PATH.include?(lib) and File.exist?(lib)
$LOAD_PATH << lib
load_path_modified = true
end
end
retry if load_path_modified
end
EOF
## Instruction:
Remove extraneous endfunction from vim autoload
I noticed an error in Vim when using ImportJS for the first time on
load:
> endfunction not inside a function
I traced it down to this extraneous endfunction.
## Code After:
function importjs#ImportJSImport()
ruby $import_js.import
endfunction
function importjs#ImportJSGoTo()
ruby $import_js.goto
endfunction
function importjs#ImportJSRemoveUnusedImports()
ruby $import_js.remove_unused_imports
endfunction
function importjs#ImportJSFixImports()
ruby $import_js.fix_imports
endfunction
" WideMsg() prints [long] message up to (&columns-1) length
" guaranteed without "Press Enter" prompt.
" http://vim.wikia.com/wiki/How_to_print_full_screen_width_messages
function! importjs#WideMsg(msg)
let x=&ruler | let y=&showcmd
set noruler noshowcmd
redraw
echo a:msg
let &ruler=x | let &showcmd=y
endfun
ruby << EOF
begin
require 'import_js'
$import_js = ImportJS::Importer.new
rescue LoadError
load_path_modified = false
::VIM::evaluate('&runtimepath').to_s.split(',').each do |path|
lib = "#{path}/lib"
if !$LOAD_PATH.include?(lib) and File.exist?(lib)
$LOAD_PATH << lib
load_path_modified = true
end
end
retry if load_path_modified
end
EOF
|
6a28a82e26631c94f3c45a04e9a4baa84d190b47 | src/components/table/draggable-table-cell/draggable-table-cell.scss | src/components/table/draggable-table-cell/draggable-table-cell.scss | .draggable-table-cell {
width: 21px;
}
.draggable-table-cell__icon {
cursor: move; /* fallback if grab cursor is unsupported */
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}
.draggable-table-cell__icon:active {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
| // Remove the padding from the table cell
// and apply it to the drag icon instead.
// This gives us a bigger 'click' area on
// the drag icon for both mouse and touch.
.draggable-table-cell {
padding: 0;
width: 21px;
&.carbon-table-cell:first-child {
padding-left: 0;
}
}
.draggable-table-cell__icon {
cursor: move;
padding: 8.5px 14px;
.carbon-table-row--dragging &,
.carbon-table-row--dragged {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
}
| Increase padding on the drag icon | Increase padding on the drag icon
Remove the padding from the `.draggable-table-cell` and apply it to the drag
icon instead.
| SCSS | apache-2.0 | Sage/carbon,Sage/carbon,Sage/carbon | scss | ## Code Before:
.draggable-table-cell {
width: 21px;
}
.draggable-table-cell__icon {
cursor: move; /* fallback if grab cursor is unsupported */
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}
.draggable-table-cell__icon:active {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
## Instruction:
Increase padding on the drag icon
Remove the padding from the `.draggable-table-cell` and apply it to the drag
icon instead.
## Code After:
// Remove the padding from the table cell
// and apply it to the drag icon instead.
// This gives us a bigger 'click' area on
// the drag icon for both mouse and touch.
.draggable-table-cell {
padding: 0;
width: 21px;
&.carbon-table-cell:first-child {
padding-left: 0;
}
}
.draggable-table-cell__icon {
cursor: move;
padding: 8.5px 14px;
.carbon-table-row--dragging &,
.carbon-table-row--dragged {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
}
|
11bcac9204505162407a754d5be445eba96a58f5 | templates/events/_event_li.html | templates/events/_event_li.html | {% load i18n %}
<li>
{% ifchanged %}
<div class="date">{% trans "day" %} {{o.when|date:"l, d/m/Y"}} </div>
{% endifchanged %}
<p>
<span class="time">{{o.when|date:"H:i"}}</span> -
<span class="title">{{o.what}}</span>
</p>
</li>
| {% load i18n %}
<li>
{% ifchanged %}
<div class="item-context">{% trans "day" %} {{o.when|date:"l, d/m/Y"}} </div>
{% endifchanged %}
<p>
<span class="time">{{o.when|date:"H:i"}}</span> -
<span class="title">{{o.what}}</span>
</p>
</li>
| Use item-context for event date | Use item-context for event date
| HTML | bsd-3-clause | OriHoch/Open-Knesset,alonisser/Open-Knesset,daonb/Open-Knesset,Shrulik/Open-Knesset,jspan/Open-Knesset,MeirKriheli/Open-Knesset,habeanf/Open-Knesset,daonb/Open-Knesset,jspan/Open-Knesset,navotsil/Open-Knesset,ofri/Open-Knesset,navotsil/Open-Knesset,OriHoch/Open-Knesset,DanaOshri/Open-Knesset,alonisser/Open-Knesset,noamelf/Open-Knesset,ofri/Open-Knesset,noamelf/Open-Knesset,MeirKriheli/Open-Knesset,OriHoch/Open-Knesset,habeanf/Open-Knesset,ofri/Open-Knesset,jspan/Open-Knesset,DanaOshri/Open-Knesset,alonisser/Open-Knesset,Shrulik/Open-Knesset,noamelf/Open-Knesset,jspan/Open-Knesset,DanaOshri/Open-Knesset,OriHoch/Open-Knesset,DanaOshri/Open-Knesset,otadmor/Open-Knesset,MeirKriheli/Open-Knesset,alonisser/Open-Knesset,navotsil/Open-Knesset,ofri/Open-Knesset,noamelf/Open-Knesset,habeanf/Open-Knesset,otadmor/Open-Knesset,daonb/Open-Knesset,Shrulik/Open-Knesset,Shrulik/Open-Knesset,MeirKriheli/Open-Knesset,daonb/Open-Knesset,navotsil/Open-Knesset,habeanf/Open-Knesset,otadmor/Open-Knesset,otadmor/Open-Knesset | html | ## Code Before:
{% load i18n %}
<li>
{% ifchanged %}
<div class="date">{% trans "day" %} {{o.when|date:"l, d/m/Y"}} </div>
{% endifchanged %}
<p>
<span class="time">{{o.when|date:"H:i"}}</span> -
<span class="title">{{o.what}}</span>
</p>
</li>
## Instruction:
Use item-context for event date
## Code After:
{% load i18n %}
<li>
{% ifchanged %}
<div class="item-context">{% trans "day" %} {{o.when|date:"l, d/m/Y"}} </div>
{% endifchanged %}
<p>
<span class="time">{{o.when|date:"H:i"}}</span> -
<span class="title">{{o.what}}</span>
</p>
</li>
|
b17df33151cbf59c99262d2c164b7ed9765b89a3 | lib/neography/property_container.rb | lib/neography/property_container.rb | module Neography
class PropertyContainer < OpenStruct
attr_reader :neo_id
def initialize(hash=nil)
@table = {}
if hash
@neo_id = hash["self"].split('/').last
for k,v in hash["data"]
@table[k.to_sym] = v
new_ostruct_member(k)
end
end
end
# the arguments are either a Rest instance, or something else
def self.split_args(*args)
db = other = nil
args.each do |arg|
case arg
when Rest
db = arg
else
other = arg
end
end
db ||= Neography::Rest.new
[ db, other ]
end
end
end
| module Neography
class PropertyContainer < OpenStruct
attr_reader :neo_id
def initialize(hash=nil)
@table = {}
if hash
@neo_id = hash["self"].split('/').last
for k,v in hash["data"]
@table[k.to_sym] = v
new_ostruct_member(k)
end
end
end
end
end
| Remove helper method used by deprecated code. | Remove helper method used by deprecated code.
| Ruby | mit | Autrement/neography,andycamp/neography,agarbuno/neography,maxdemarzi/neography | ruby | ## Code Before:
module Neography
class PropertyContainer < OpenStruct
attr_reader :neo_id
def initialize(hash=nil)
@table = {}
if hash
@neo_id = hash["self"].split('/').last
for k,v in hash["data"]
@table[k.to_sym] = v
new_ostruct_member(k)
end
end
end
# the arguments are either a Rest instance, or something else
def self.split_args(*args)
db = other = nil
args.each do |arg|
case arg
when Rest
db = arg
else
other = arg
end
end
db ||= Neography::Rest.new
[ db, other ]
end
end
end
## Instruction:
Remove helper method used by deprecated code.
## Code After:
module Neography
class PropertyContainer < OpenStruct
attr_reader :neo_id
def initialize(hash=nil)
@table = {}
if hash
@neo_id = hash["self"].split('/').last
for k,v in hash["data"]
@table[k.to_sym] = v
new_ostruct_member(k)
end
end
end
end
end
|
511a457c5822a5388d2910ddb6164510d81a08f2 | README.md | README.md | A JavaScript + HTML5 demonstration of Wiedemann 99 Car Following Model
Try out the demo (hosted on Dropbox):
[w99-demo](https://dl.dropboxusercontent.com/u/98169416/w99-demo/demo.html)
| A JavaScript + HTML5 demonstration of Wiedemann 99 Car Following Model
Try out the [demo](https://glgh.github.io/)!
| Update readme - page now hosted on github | Update readme - page now hosted on github
| Markdown | mit | glgh/w99-demo,glgh/w99-demo | markdown | ## Code Before:
A JavaScript + HTML5 demonstration of Wiedemann 99 Car Following Model
Try out the demo (hosted on Dropbox):
[w99-demo](https://dl.dropboxusercontent.com/u/98169416/w99-demo/demo.html)
## Instruction:
Update readme - page now hosted on github
## Code After:
A JavaScript + HTML5 demonstration of Wiedemann 99 Car Following Model
Try out the [demo](https://glgh.github.io/)!
|
e50a38e9d257067149e62695c6437754fa625562 | .github/workflows/stale.yml | .github/workflows/stale.yml | name: Mark stale issues and pull requests
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'As this issue has received no new activity, it has been marked as stale'
stale-pr-message: 'As this pull request has received no new activity, it has been marked as stale'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
exempt-issue-labels: 'Up for Grabs'
| name: Mark stale issues and pull requests
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'As this issue has received no new activity, it has been marked as stale'
stale-pr-message: 'As this pull request has received no new activity, it has been marked as stale'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
exempt-issue-labels: 'Up for Grabs,Blocked'
exempt-pr-labels: 'Work in progress'
| Expand list of exempt labels | Expand list of exempt labels | YAML | bsd-3-clause | zarlo/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos | yaml | ## Code Before:
name: Mark stale issues and pull requests
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'As this issue has received no new activity, it has been marked as stale'
stale-pr-message: 'As this pull request has received no new activity, it has been marked as stale'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
exempt-issue-labels: 'Up for Grabs'
## Instruction:
Expand list of exempt labels
## Code After:
name: Mark stale issues and pull requests
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'As this issue has received no new activity, it has been marked as stale'
stale-pr-message: 'As this pull request has received no new activity, it has been marked as stale'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
exempt-issue-labels: 'Up for Grabs,Blocked'
exempt-pr-labels: 'Work in progress'
|
080e6979c34a062946b7001b8bf8ca7cc34b8534 | Compiler/Platforms/JavaScriptAppAndroid/JsAndroidResources/buildGradle.txt | Compiler/Platforms/JavaScriptAppAndroid/JsAndroidResources/buildGradle.txt | // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}
allprojects {
repositories {
mavenCentral()
google()
}
}
| // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}
allprojects {
repositories {
mavenCentral()
google()
}
}
| Fix sporadic android build error. | Fix sporadic android build error.
| Text | mit | blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon | text | ## Code Before:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}
allprojects {
repositories {
mavenCentral()
google()
}
}
## Instruction:
Fix sporadic android build error.
## Code After:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}
allprojects {
repositories {
mavenCentral()
google()
}
}
|
5496a013a2cc4d20db2dabf917afcdff2702d4e8 | README.md | README.md |
<h2> About Module </h2>
This module is for iOS 64bit supporting. It is copied part of the functions from <a href="https://github.com/raymondkam/ios-parse-titanium-module">Raymond</a> and <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a> with 2 new functions as below
<b>-(void)registerForSinglePushChannel</b>
subscribe to single channel with no need to unsuncribe from current channel first. ONLY the new channel passed to this function will exist after execution.
<b>-(void)unsubscribeFromAllChannels</b>
unsubscribe from all channels with no need to get current subscribtions.
<h2>Parse Framework</h2>
Verison 1.7.2
<h2>Limitation</h2>
ONLY part of the functions from the <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a>'s version have been implemented. Specifically, only functions regarding Objects and Push notification implemented in this module.
|
<h2> About Module </h2>
This module is for iOS 64bit supporting. It is copied part of the functions from <a href="https://github.com/raymondkam/ios-parse-titanium-module">Raymond</a> and <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a> with 2 new functions as below
<b>-(void)registerForSinglePushChannel</b>
subscribe to single channel with no need to unsuncribe from current channel first. ONLY the new channel passed to this function will exist after execution.
<b>-(void)unsubscribeFromAllChannels</b>
unsubscribe from all channels with no need to get current subscribtions.
<h2>Parse Framework</h2>
Verison 1.7.2
<h2>Limitation</h2>
ONLY part of the functions from the <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a>'s version have been implemented. Specifically, only functions regarding Objects and Push notification implemented in this module.
<h2> Start to build </h2>
In order to compile and build in your own Titanium/Appcelerator environment. Please make sure the settings in this file (ios64-parse-titanium/iphone/titanium.xcconfig) is correct.
2 values are important in this file, TITANIUM_SDK_VERSION and TITANIUM_SDK.
If you are not sure what value is correct. The simple way to get the correct setting is this. Creating a brand new ios Module in Titanium/Appcelerator studio with menu File -> New -> Mobile Module Project. Make sure select ios Module. Follow this step and let the studio created a module automatically. Copy the content of file "iphone/titanium.xcconfig" in this new into the same file in parse module. Then it is good to compile. | Add instruction regarding how to compile. Can use this to upgrade to Appcelerator (SDK 5.0.2). | Add instruction regarding how to compile. Can use this to upgrade to Appcelerator (SDK 5.0.2).
| Markdown | mit | E2010/ios64-parse-titanium,E2010/ios64-parse-titanium | markdown | ## Code Before:
<h2> About Module </h2>
This module is for iOS 64bit supporting. It is copied part of the functions from <a href="https://github.com/raymondkam/ios-parse-titanium-module">Raymond</a> and <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a> with 2 new functions as below
<b>-(void)registerForSinglePushChannel</b>
subscribe to single channel with no need to unsuncribe from current channel first. ONLY the new channel passed to this function will exist after execution.
<b>-(void)unsubscribeFromAllChannels</b>
unsubscribe from all channels with no need to get current subscribtions.
<h2>Parse Framework</h2>
Verison 1.7.2
<h2>Limitation</h2>
ONLY part of the functions from the <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a>'s version have been implemented. Specifically, only functions regarding Objects and Push notification implemented in this module.
## Instruction:
Add instruction regarding how to compile. Can use this to upgrade to Appcelerator (SDK 5.0.2).
## Code After:
<h2> About Module </h2>
This module is for iOS 64bit supporting. It is copied part of the functions from <a href="https://github.com/raymondkam/ios-parse-titanium-module">Raymond</a> and <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a> with 2 new functions as below
<b>-(void)registerForSinglePushChannel</b>
subscribe to single channel with no need to unsuncribe from current channel first. ONLY the new channel passed to this function will exist after execution.
<b>-(void)unsubscribeFromAllChannels</b>
unsubscribe from all channels with no need to get current subscribtions.
<h2>Parse Framework</h2>
Verison 1.7.2
<h2>Limitation</h2>
ONLY part of the functions from the <a href="https://github.com/ewindso/ios-parse-titanium-module"> ewindso </a>'s version have been implemented. Specifically, only functions regarding Objects and Push notification implemented in this module.
<h2> Start to build </h2>
In order to compile and build in your own Titanium/Appcelerator environment. Please make sure the settings in this file (ios64-parse-titanium/iphone/titanium.xcconfig) is correct.
2 values are important in this file, TITANIUM_SDK_VERSION and TITANIUM_SDK.
If you are not sure what value is correct. The simple way to get the correct setting is this. Creating a brand new ios Module in Titanium/Appcelerator studio with menu File -> New -> Mobile Module Project. Make sure select ios Module. Follow this step and let the studio created a module automatically. Copy the content of file "iphone/titanium.xcconfig" in this new into the same file in parse module. Then it is good to compile. |
fe89ffb3f102de8113f5d768dbf7fc5fecd757cd | app/views/gifts/_form.html.erb | app/views/gifts/_form.html.erb | <% view_user = User.view_user(session) %>
<% hide_things = @gift.list.users.include? current_user %>
<div class="form">
<%= form_for @gift do |f| %>
<%= f.hidden_field :list_id, :value => @gift.list_id %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :starred %>
<span class="label label-default">really want</span>
</label>
</h3>
</div>
<% if not hide_things %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :hidden %>
<span class="label label-default">hidden</span>
</label>
</h3>
</div>
<% end %>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">description</span>
<%= f.text_field :description, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">link</span>
<%= f.text_field :link, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<%= f.submit :class => "btn-lg btn-success" %>
</div>
<% end %>
</div>
| <% view_user = User.view_user(session) %>
<% hide_things = @gift.list.users.include? current_user %>
<div class="form">
<%= form_for @gift do |f| %>
<%= f.hidden_field :list_id, :value => @gift.list_id %>
<%= f.hidden_field :added_by_user_id, :value => current_user.id %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :starred %>
<span class="label label-default">really want</span>
</label>
</h3>
</div>
<% if not hide_things %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :hidden %>
<span class="label label-default">hidden</span>
</label>
</h3>
</div>
<% end %>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">description</span>
<%= f.text_field :description, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">link</span>
<%= f.text_field :link, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<%= f.submit :class => "btn-lg btn-success" %>
</div>
<% end %>
</div>
| Include added_by_user_id in new gifts. | Include added_by_user_id in new gifts.
| HTML+ERB | apache-2.0 | aligature/wishlist,aligature/wishlist,aligature/wishlist | html+erb | ## Code Before:
<% view_user = User.view_user(session) %>
<% hide_things = @gift.list.users.include? current_user %>
<div class="form">
<%= form_for @gift do |f| %>
<%= f.hidden_field :list_id, :value => @gift.list_id %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :starred %>
<span class="label label-default">really want</span>
</label>
</h3>
</div>
<% if not hide_things %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :hidden %>
<span class="label label-default">hidden</span>
</label>
</h3>
</div>
<% end %>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">description</span>
<%= f.text_field :description, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">link</span>
<%= f.text_field :link, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<%= f.submit :class => "btn-lg btn-success" %>
</div>
<% end %>
</div>
## Instruction:
Include added_by_user_id in new gifts.
## Code After:
<% view_user = User.view_user(session) %>
<% hide_things = @gift.list.users.include? current_user %>
<div class="form">
<%= form_for @gift do |f| %>
<%= f.hidden_field :list_id, :value => @gift.list_id %>
<%= f.hidden_field :added_by_user_id, :value => current_user.id %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :starred %>
<span class="label label-default">really want</span>
</label>
</h3>
</div>
<% if not hide_things %>
<div class="checkbox">
<h3>
<label>
<%= f.check_box :hidden %>
<span class="label label-default">hidden</span>
</label>
</h3>
</div>
<% end %>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">description</span>
<%= f.text_field :description, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<div class="input-group input-group-lg">
<span class="input-group-addon">link</span>
<%= f.text_field :link, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<%= f.submit :class => "btn-lg btn-success" %>
</div>
<% end %>
</div>
|
8daa7a5218008af3232b99b90c3b822cbd00ed1a | docker/.aliases.sh | docker/.aliases.sh | alias attach="docker attach"
alias dc="docker"
alias doc="docker"
alias img="clear; docker images; echo; docker ps -a"
alias pause="docker pause"
alias psa="clear; docker ps --all --format \"table {{.Image}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}\"; echo; docker images"
alias rmi="clear; docker rmi"
alias stop="docker stop"
| alias attach="docker attach"
alias dc="docker"
alias doc="docker"
alias img="clear; docker images; echo; docker ps -a"
alias pause="docker pause"
alias prune="docker image prune"
alias psa="clear; docker ps --all --format \"table {{.Image}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}\"; echo; docker images"
alias rmi="clear; docker rmi"
alias stop="docker stop"
| Add alias prune for docker | Add alias prune for docker
| Shell | unlicense | zborboa-g/dot-star,dot-star/dot-star | shell | ## Code Before:
alias attach="docker attach"
alias dc="docker"
alias doc="docker"
alias img="clear; docker images; echo; docker ps -a"
alias pause="docker pause"
alias psa="clear; docker ps --all --format \"table {{.Image}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}\"; echo; docker images"
alias rmi="clear; docker rmi"
alias stop="docker stop"
## Instruction:
Add alias prune for docker
## Code After:
alias attach="docker attach"
alias dc="docker"
alias doc="docker"
alias img="clear; docker images; echo; docker ps -a"
alias pause="docker pause"
alias prune="docker image prune"
alias psa="clear; docker ps --all --format \"table {{.Image}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}\"; echo; docker images"
alias rmi="clear; docker rmi"
alias stop="docker stop"
|
072d5634a14559128d4132b018cb54c01fab7bf7 | app/assets/stylesheets/components/cms/_media.scss | app/assets/stylesheets/components/cms/_media.scss | img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
.video-wrapper {
//http://alistapart.com/article/creating-intrinsic-ratios-for-video
clear: both;
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
margin: $baseline-unit*4 0;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
| img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
| Remove video wrapper from CMS did | Remove video wrapper from CMS did
| SCSS | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | scss | ## Code Before:
img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
.video-wrapper {
//http://alistapart.com/article/creating-intrinsic-ratios-for-video
clear: both;
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
margin: $baseline-unit*4 0;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
## Instruction:
Remove video wrapper from CMS did
## Code After:
img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
|
cbe41c6547b586291c647fdf4a2a8a7e2e708516 | tsconfig.ngc.json | tsconfig.ngc.json | {
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"outDir": "./dist",
"rootDir": "./tmp",
"noImplicitAny": true,
"allowUnusedLabels": false,
"noImplicitReturns": true,
"declaration": true,
"removeComments": true
},
"include": [
"./tmp"
],
"angularCompilerOptions": {
"strictMetadataEmit": true,
"skipTemplateCodegen": true
}
}
| {
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es2015",
"target": "es2015",
"outDir": "./dist",
"rootDir": "./tmp",
"noImplicitAny": true,
"allowUnusedLabels": false,
"noImplicitReturns": true,
"declaration": true,
"removeComments": true,
"sourceMap": true,
"inlineSources": true,
"importHelpers": true,
"types": [],
"lib": [
"dom",
"es2015"
]
},
"include": [
"./tmp"
],
"angularCompilerOptions": {
"strictMetadataEmit": true,
"skipTemplateCodegen": true,
"annotateForClosureCompiler": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
| Adjust compilerOptions to match ng-cli defaults and make the code tree-shakable | Adjust compilerOptions to match ng-cli defaults and make the code tree-shakable
| JSON | mit | mpalourdio/ng-http-loader,mpalourdio/ng-http-loader,mpalourdio/ng-http-loader | json | ## Code Before:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"outDir": "./dist",
"rootDir": "./tmp",
"noImplicitAny": true,
"allowUnusedLabels": false,
"noImplicitReturns": true,
"declaration": true,
"removeComments": true
},
"include": [
"./tmp"
],
"angularCompilerOptions": {
"strictMetadataEmit": true,
"skipTemplateCodegen": true
}
}
## Instruction:
Adjust compilerOptions to match ng-cli defaults and make the code tree-shakable
## Code After:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es2015",
"target": "es2015",
"outDir": "./dist",
"rootDir": "./tmp",
"noImplicitAny": true,
"allowUnusedLabels": false,
"noImplicitReturns": true,
"declaration": true,
"removeComments": true,
"sourceMap": true,
"inlineSources": true,
"importHelpers": true,
"types": [],
"lib": [
"dom",
"es2015"
]
},
"include": [
"./tmp"
],
"angularCompilerOptions": {
"strictMetadataEmit": true,
"skipTemplateCodegen": true,
"annotateForClosureCompiler": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
|
e67dff79dd33f80c6a24ad3346ad5c16ca3a18a1 | lib/adapters/irc/message.rb | lib/adapters/irc/message.rb | class Bot::Adapter::Irc::Message < Bot::Core::Message
attr_accessor :adapter
attr_accessor :sender
attr_accessor :real_name
attr_accessor :hostname
attr_accessor :type
attr_accessor :channel
attr_accessor :text
attr_accessor :raw
attr_accessor :time
attr_accessor :origin
def initialize
yield self if block_given?
@adapter = :irc
@time = Time.now
end
def reply(text)
@origin.send "PRIVMSG #{@channel} :#{text}"
end
def args
# Extra space if called by name (!ping vs BotName: ping).
# Assumes text is a String, wrap in array anyway if cannot split
if /^#{Bot::SHORT_TRIGGER}([^ ]*)/i === @text
[@text.split(' ')[1..-1]].flatten
else
[@text.split(' ')[2..-1]].flatten
end
end
def mode
args[0]
end
end | class Bot::Adapter::Irc::Message < Bot::Core::Message
attr_accessor :adapter
attr_accessor :sender
attr_accessor :real_name
attr_accessor :hostname
attr_accessor :type
attr_accessor :channel
attr_accessor :text
attr_accessor :raw
attr_accessor :time
attr_accessor :origin
def initialize
yield self if block_given?
@adapter = :irc
@time = Time.now
end
def reply(text)
text.split("\n").each do |line|
@origin.send "PRIVMSG #{@channel} :#{line}"
end
end
def args
# Extra space if called by name (!ping vs BotName: ping).
# Assumes text is a String, wrap in array anyway if cannot split
if /^#{Bot::SHORT_TRIGGER}([^ ]*)/i === @text
[@text.split(' ')[1..-1]].flatten
else
[@text.split(' ')[2..-1]].flatten
end
end
def mode
args[0]
end
end | Add newline support for IRC | Add newline support for IRC
| Ruby | mit | gyng/betabot,gyng/Hudda,gyng/betabot,gyng/betabot,gyng/Hudda | ruby | ## Code Before:
class Bot::Adapter::Irc::Message < Bot::Core::Message
attr_accessor :adapter
attr_accessor :sender
attr_accessor :real_name
attr_accessor :hostname
attr_accessor :type
attr_accessor :channel
attr_accessor :text
attr_accessor :raw
attr_accessor :time
attr_accessor :origin
def initialize
yield self if block_given?
@adapter = :irc
@time = Time.now
end
def reply(text)
@origin.send "PRIVMSG #{@channel} :#{text}"
end
def args
# Extra space if called by name (!ping vs BotName: ping).
# Assumes text is a String, wrap in array anyway if cannot split
if /^#{Bot::SHORT_TRIGGER}([^ ]*)/i === @text
[@text.split(' ')[1..-1]].flatten
else
[@text.split(' ')[2..-1]].flatten
end
end
def mode
args[0]
end
end
## Instruction:
Add newline support for IRC
## Code After:
class Bot::Adapter::Irc::Message < Bot::Core::Message
attr_accessor :adapter
attr_accessor :sender
attr_accessor :real_name
attr_accessor :hostname
attr_accessor :type
attr_accessor :channel
attr_accessor :text
attr_accessor :raw
attr_accessor :time
attr_accessor :origin
def initialize
yield self if block_given?
@adapter = :irc
@time = Time.now
end
def reply(text)
text.split("\n").each do |line|
@origin.send "PRIVMSG #{@channel} :#{line}"
end
end
def args
# Extra space if called by name (!ping vs BotName: ping).
# Assumes text is a String, wrap in array anyway if cannot split
if /^#{Bot::SHORT_TRIGGER}([^ ]*)/i === @text
[@text.split(' ')[1..-1]].flatten
else
[@text.split(' ')[2..-1]].flatten
end
end
def mode
args[0]
end
end |
bd31728db7ca7a72c0132bad61744cdcafde418b | .github/workflows/ci.yml | .github/workflows/ci.yml | name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build
- name: Run tests
run: swift test
| name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
xcodebuild -project UIFontComplete.xcodeproj -target UIFontComplete-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13,OS=16'
xcodebuild -project UIFontComplete.xcodeproj -target UIFontComplete-tvOS -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV,OS=16'
| Update to use Xcodebuild for tests | Update to use Xcodebuild for tests | YAML | mit | Nirma/UIFontComplete,Nirma/UIFontComplete | yaml | ## Code Before:
name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build
- name: Run tests
run: swift test
## Instruction:
Update to use Xcodebuild for tests
## Code After:
name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
xcodebuild -project UIFontComplete.xcodeproj -target UIFontComplete-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13,OS=16'
xcodebuild -project UIFontComplete.xcodeproj -target UIFontComplete-tvOS -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV,OS=16'
|
413070c34b5b823971c3d9699af5d33810eb4039 | src/test/java/ScrabbleTest.java | src/test/java/ScrabbleTest.java | import org.junit.*;
import static org.junit.Assert.*;
import java.util.ArrayList;
public class ScrabbleTest {
@Test
public void scrabbleScore_returnsAScrabbleScoreForALetter_1() {
Scrabble app = new Scrabble();
Integer score = 1;
assertEquals(score, app.scrabbleScore("a"));
}
// @Test
// public void scrabbleScore_returnsAString_a() {
// Scrabble app = new Scrabble();
// String letter = "a";
// assertEquals(letter, app.scrabbleScore("a"));
// }
// @Test
// public void scrabbleScore_returnsAnArrayList_aa() {
// Scrabble app = new Scrabble();
// ArrayList<String> expectedArray = new ArrayList<String>();
// expectedArray.add("a");
// expectedArray.add("a");
// assertEquals(expectedArray, app.scrabbleScore("aa"));
// }
@Test
public void scrabbleScore_returnsTotalScore_2() {
Scrabble app = new Scrabble();
Integer total = 2;
assertEquals(total, app.scrabbleScore("aa"));
}
@Test
public void scrabbleScore_returnsDifferentTotalScore_5() {
Scrabble app = new Scrabble();
Integer total = 5;
assertEquals(total, app.scrabbleScore("cat"));
}
@Test
public void scrabbleScore_returnsTotalForTwoWords_9() {
Scrabble app = new Scrabble();
Integer total = 9;
assertEquals(total, app.scrabbleScore("Cat dog"));
}
}
| import org.junit.*;
import static org.junit.Assert.*;
import java.util.ArrayList;
public class ScrabbleTest {
@Test
public void scrabbleScore_returnsAScrabbleScoreForALetter_1() {
Scrabble app = new Scrabble();
Integer score = 1;
assertEquals(score, app.scrabbleScore("a"));
}
@Test
public void scrabbleScore_returnsTotalScore_2() {
Scrabble app = new Scrabble();
Integer total = 2;
assertEquals(total, app.scrabbleScore("aa"));
}
@Test
public void scrabbleScore_returnsDifferentTotalScore_5() {
Scrabble app = new Scrabble();
Integer total = 5;
assertEquals(total, app.scrabbleScore("cat"));
}
@Test
public void scrabbleScore_returnsTotalForTwoWords_10() {
Scrabble app = new Scrabble();
Integer total = 10;
assertEquals(total, app.scrabbleScore("Cat dog"));
}
}
| Add new test with multiple words to pass, clean up comments in test. | Add new test with multiple words to pass, clean up comments in test.
| Java | mit | kcmdouglas/Scrabble,kcmdouglas/Scrabble,kcmdouglas/Scrabble | java | ## Code Before:
import org.junit.*;
import static org.junit.Assert.*;
import java.util.ArrayList;
public class ScrabbleTest {
@Test
public void scrabbleScore_returnsAScrabbleScoreForALetter_1() {
Scrabble app = new Scrabble();
Integer score = 1;
assertEquals(score, app.scrabbleScore("a"));
}
// @Test
// public void scrabbleScore_returnsAString_a() {
// Scrabble app = new Scrabble();
// String letter = "a";
// assertEquals(letter, app.scrabbleScore("a"));
// }
// @Test
// public void scrabbleScore_returnsAnArrayList_aa() {
// Scrabble app = new Scrabble();
// ArrayList<String> expectedArray = new ArrayList<String>();
// expectedArray.add("a");
// expectedArray.add("a");
// assertEquals(expectedArray, app.scrabbleScore("aa"));
// }
@Test
public void scrabbleScore_returnsTotalScore_2() {
Scrabble app = new Scrabble();
Integer total = 2;
assertEquals(total, app.scrabbleScore("aa"));
}
@Test
public void scrabbleScore_returnsDifferentTotalScore_5() {
Scrabble app = new Scrabble();
Integer total = 5;
assertEquals(total, app.scrabbleScore("cat"));
}
@Test
public void scrabbleScore_returnsTotalForTwoWords_9() {
Scrabble app = new Scrabble();
Integer total = 9;
assertEquals(total, app.scrabbleScore("Cat dog"));
}
}
## Instruction:
Add new test with multiple words to pass, clean up comments in test.
## Code After:
import org.junit.*;
import static org.junit.Assert.*;
import java.util.ArrayList;
public class ScrabbleTest {
@Test
public void scrabbleScore_returnsAScrabbleScoreForALetter_1() {
Scrabble app = new Scrabble();
Integer score = 1;
assertEquals(score, app.scrabbleScore("a"));
}
@Test
public void scrabbleScore_returnsTotalScore_2() {
Scrabble app = new Scrabble();
Integer total = 2;
assertEquals(total, app.scrabbleScore("aa"));
}
@Test
public void scrabbleScore_returnsDifferentTotalScore_5() {
Scrabble app = new Scrabble();
Integer total = 5;
assertEquals(total, app.scrabbleScore("cat"));
}
@Test
public void scrabbleScore_returnsTotalForTwoWords_10() {
Scrabble app = new Scrabble();
Integer total = 10;
assertEquals(total, app.scrabbleScore("Cat dog"));
}
}
|
29fa35d8ff6fa26e676c693ea17faeb03440d116 | scripts/3b-show-features.py | scripts/3b-show-features.py |
import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")
import argparse
import commands
import cv2
import fnmatch
import os.path
sys.path.append('../lib')
import ProjectMgr
# for all the images in the project image_dir, detect features using the
# specified method and parameters
parser = argparse.ArgumentParser(description='Load the project\'s images.')
parser.add_argument('--project', required=True, help='project directory')
args = parser.parse_args()
print args
proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()
proj.load_features()
proj.show_features()
|
import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")
import argparse
import commands
import cv2
import fnmatch
import os.path
sys.path.append('../lib')
import ProjectMgr
# for all the images in the project image_dir, detect features using the
# specified method and parameters
parser = argparse.ArgumentParser(description='Load the project\'s images.')
parser.add_argument('--project', required=True, help='project directory')
parser.add_argument('--image', help='show specific image')
args = parser.parse_args()
print args
proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()
proj.load_features()
if args.image:
image = proj.findImageByName(args.image)
proj.show_features_image(image)
else:
proj.show_features_images()
| Support showing features for a single image. | Support showing features for a single image.
Former-commit-id: 4143a53dae02b9ece391f65a47c060bbcfd0b7a8 | Python | mit | UASLab/ImageAnalysis | python | ## Code Before:
import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")
import argparse
import commands
import cv2
import fnmatch
import os.path
sys.path.append('../lib')
import ProjectMgr
# for all the images in the project image_dir, detect features using the
# specified method and parameters
parser = argparse.ArgumentParser(description='Load the project\'s images.')
parser.add_argument('--project', required=True, help='project directory')
args = parser.parse_args()
print args
proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()
proj.load_features()
proj.show_features()
## Instruction:
Support showing features for a single image.
Former-commit-id: 4143a53dae02b9ece391f65a47c060bbcfd0b7a8
## Code After:
import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")
import argparse
import commands
import cv2
import fnmatch
import os.path
sys.path.append('../lib')
import ProjectMgr
# for all the images in the project image_dir, detect features using the
# specified method and parameters
parser = argparse.ArgumentParser(description='Load the project\'s images.')
parser.add_argument('--project', required=True, help='project directory')
parser.add_argument('--image', help='show specific image')
args = parser.parse_args()
print args
proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()
proj.load_features()
if args.image:
image = proj.findImageByName(args.image)
proj.show_features_image(image)
else:
proj.show_features_images()
|
71281b5960e6bd7078f861eb8e88841778b6ab09 | README.md | README.md |
The number 71 in Clojure
## Obtention
`[com.gfredericks/seventy-one "0.1.0"]`
## Usage
``` clojure
(require '[com.gfredericks.seventy-one :refer [seventy-one]])
(defn business-logic
[customer-count]
;; add 71 to customer-count
(+ customer-count seventy-one))
```
## License
Copyright © 2015 Gary Fredericks
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
|
The number 71 in Clojure
## Obtention
`[com.gfredericks/seventy-one "0.1.0"]`
## Usage
``` clojure
(require '[com.gfredericks.seventy-one :refer [seventy-one]])
(defn business-logic
[customer-count]
;; add 71 to customer-count
(+ customer-count seventy-one))
```
## Documentation
Codox docs are [here](http://gfredericks.github.io/seventy-one/).
## License
Copyright © 2015 Gary Fredericks
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
| Add link to codox docs | Add link to codox docs | Markdown | epl-1.0 | gfredericks/seventy-one,fdserr/seventy-one | markdown | ## Code Before:
The number 71 in Clojure
## Obtention
`[com.gfredericks/seventy-one "0.1.0"]`
## Usage
``` clojure
(require '[com.gfredericks.seventy-one :refer [seventy-one]])
(defn business-logic
[customer-count]
;; add 71 to customer-count
(+ customer-count seventy-one))
```
## License
Copyright © 2015 Gary Fredericks
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
## Instruction:
Add link to codox docs
## Code After:
The number 71 in Clojure
## Obtention
`[com.gfredericks/seventy-one "0.1.0"]`
## Usage
``` clojure
(require '[com.gfredericks.seventy-one :refer [seventy-one]])
(defn business-logic
[customer-count]
;; add 71 to customer-count
(+ customer-count seventy-one))
```
## Documentation
Codox docs are [here](http://gfredericks.github.io/seventy-one/).
## License
Copyright © 2015 Gary Fredericks
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
|
a81ffde9d34ee0aa09d40e8bcdd5e5428457095d | templates/portal_wrapper.html | templates/portal_wrapper.html | <div class="container">
<div class="pull-left nav-logos">
<!-- Probably need to use absolute links for images -->
<a href="http://truenth-demo.cirg.washington.edu"><img src="{{PORTAL}}{{logo_truenth}}" /></a>
<a href="http://us.movember.com"><img src="{{PORTAL}}{{logo_movember}}" /></a>
</div>
<div class="pull-right nav-links">
<a href="#" class="btn btn-default">About</a>
<a href="#" class="btn btn-default">Help</a>
<a href="#" class="btn btn-default">My Profile</a>
<a href="index.html" class="btn btn-default">Log Out</a>
<form class="navbar-form" role="search">
<div class="form-group">
<div class="hide-initial" id="search-box">
<input type="text" class="form-control" placeholder="Search">
</div>
</div>
<button type="submit" class="btn btn-default show-search"><i class="fa fa-search"></i></button>
</form>
</div>
</div> | <div class="container">
<div class="pull-left nav-logos">
<!-- Probably need to use absolute links for images -->
<a href="http://truenth-demo.cirg.washington.edu"><img src="{{PORTAL}}{{logo_truenth}}" /></a>
<a href="http://us.movember.com"><img src="{{PORTAL}}{{logo_movember}}" /></a>
</div>
<div class="pull-right nav-links">
<a href="#" class="btn btn-default">About</a>
<a href="#" class="btn btn-default">Help</a>
<a href="#" class="btn btn-default">My Profile</a>
<a href="{{PORTAL}}/logout" class="btn btn-default">Log Out</a>
<form class="navbar-form" role="search">
<div class="form-group">
<div class="hide-initial" id="search-box">
<input type="text" class="form-control" placeholder="Search">
</div>
</div>
<button type="submit" class="btn btn-default show-search"><i class="fa fa-search"></i></button>
</form>
</div>
</div> | Make portal-wrapper logout button functional | Make portal-wrapper logout button functional
| HTML | bsd-3-clause | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | html | ## Code Before:
<div class="container">
<div class="pull-left nav-logos">
<!-- Probably need to use absolute links for images -->
<a href="http://truenth-demo.cirg.washington.edu"><img src="{{PORTAL}}{{logo_truenth}}" /></a>
<a href="http://us.movember.com"><img src="{{PORTAL}}{{logo_movember}}" /></a>
</div>
<div class="pull-right nav-links">
<a href="#" class="btn btn-default">About</a>
<a href="#" class="btn btn-default">Help</a>
<a href="#" class="btn btn-default">My Profile</a>
<a href="index.html" class="btn btn-default">Log Out</a>
<form class="navbar-form" role="search">
<div class="form-group">
<div class="hide-initial" id="search-box">
<input type="text" class="form-control" placeholder="Search">
</div>
</div>
<button type="submit" class="btn btn-default show-search"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
## Instruction:
Make portal-wrapper logout button functional
## Code After:
<div class="container">
<div class="pull-left nav-logos">
<!-- Probably need to use absolute links for images -->
<a href="http://truenth-demo.cirg.washington.edu"><img src="{{PORTAL}}{{logo_truenth}}" /></a>
<a href="http://us.movember.com"><img src="{{PORTAL}}{{logo_movember}}" /></a>
</div>
<div class="pull-right nav-links">
<a href="#" class="btn btn-default">About</a>
<a href="#" class="btn btn-default">Help</a>
<a href="#" class="btn btn-default">My Profile</a>
<a href="{{PORTAL}}/logout" class="btn btn-default">Log Out</a>
<form class="navbar-form" role="search">
<div class="form-group">
<div class="hide-initial" id="search-box">
<input type="text" class="form-control" placeholder="Search">
</div>
</div>
<button type="submit" class="btn btn-default show-search"><i class="fa fa-search"></i></button>
</form>
</div>
</div> |
82756e5314c2768bb3acf03cf542929d23b73f82 | bot/logger/message_sender/synchronized.py | bot/logger/message_sender/synchronized.py | import threading
from bot.logger.message_sender import MessageSender, IntermediateMessageSender
class SynchronizedMessageSender(IntermediateMessageSender):
"""
Thread-safe message sender.
Wrap your `MessageSender` with this class and its :func:`send` function will be called in a synchronized way,
only by one thread at the same time.
"""
def __init__(self, sender: MessageSender):
super().__init__(sender)
self.lock = threading.Lock()
def send(self, text):
with self.lock:
self.sender.send(text)
| import threading
from bot.logger.message_sender import MessageSender, IntermediateMessageSender
class SynchronizedMessageSender(IntermediateMessageSender):
"""
Thread-safe message sender.
Wrap your `MessageSender` with this class and its :func:`send` function will be called in a synchronized way,
only by one thread at the same time.
"""
def __init__(self, sender: MessageSender):
super().__init__(sender)
# Using a reentrant lock to play safe in case the send function somewhat invokes this send function again
# maybe because a send triggers another send on the same message sender.
# Note that if this send throws an exception the lock is released when dealing with it from outside,
# so this is not a problem.
# But if the exception is handled inside this send call, the lock is still hold.
self.lock = threading.RLock()
def send(self, text):
with self.lock:
self.sender.send(text)
| Use reentrant lock on SynchronizedMessageSender | Use reentrant lock on SynchronizedMessageSender
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | python | ## Code Before:
import threading
from bot.logger.message_sender import MessageSender, IntermediateMessageSender
class SynchronizedMessageSender(IntermediateMessageSender):
"""
Thread-safe message sender.
Wrap your `MessageSender` with this class and its :func:`send` function will be called in a synchronized way,
only by one thread at the same time.
"""
def __init__(self, sender: MessageSender):
super().__init__(sender)
self.lock = threading.Lock()
def send(self, text):
with self.lock:
self.sender.send(text)
## Instruction:
Use reentrant lock on SynchronizedMessageSender
## Code After:
import threading
from bot.logger.message_sender import MessageSender, IntermediateMessageSender
class SynchronizedMessageSender(IntermediateMessageSender):
"""
Thread-safe message sender.
Wrap your `MessageSender` with this class and its :func:`send` function will be called in a synchronized way,
only by one thread at the same time.
"""
def __init__(self, sender: MessageSender):
super().__init__(sender)
# Using a reentrant lock to play safe in case the send function somewhat invokes this send function again
# maybe because a send triggers another send on the same message sender.
# Note that if this send throws an exception the lock is released when dealing with it from outside,
# so this is not a problem.
# But if the exception is handled inside this send call, the lock is still hold.
self.lock = threading.RLock()
def send(self, text):
with self.lock:
self.sender.send(text)
|
24516bac068f482306d04fa759765f8bdf86f2e0 | _posts/2014-01-31-old-out-new-in.md | _posts/2014-01-31-old-out-new-in.md | ---
layout: post
title: "江城子·辞旧迎新"
date: 2014-01-31 00:32:21
category: poet
---
小城清夜入眠迟
所思谁,几人知
终于若此,今后再无时
可笑残心燃未尽,歌一曲,乱填词
| ---
layout: post
title: "江城子·辞旧迎新"
date: 2014-01-31 00:32:21
category: poet
excerpt_separator: ""
---
小城清夜入眠迟
所思谁,几人知
终于若此,今后再无时
可笑残心燃未尽,歌一曲,乱填词
| Remove excerpt for post: old out new in. | Remove excerpt for post: old out new in.
| Markdown | mit | zealotrush/zealotrush.github.io,zealotrush/zealotrush.github.io,zealotrush/zealotrush.github.io | markdown | ## Code Before:
---
layout: post
title: "江城子·辞旧迎新"
date: 2014-01-31 00:32:21
category: poet
---
小城清夜入眠迟
所思谁,几人知
终于若此,今后再无时
可笑残心燃未尽,歌一曲,乱填词
## Instruction:
Remove excerpt for post: old out new in.
## Code After:
---
layout: post
title: "江城子·辞旧迎新"
date: 2014-01-31 00:32:21
category: poet
excerpt_separator: ""
---
小城清夜入眠迟
所思谁,几人知
终于若此,今后再无时
可笑残心燃未尽,歌一曲,乱填词
|
6c09e6b672490439da83caf92048b8873affb4ae | src/java/apiview-java-processor/src/main/java/com/azure/tools/apiview/processor/diagnostics/rules/PackageNameDiagnosticRule.java | src/java/apiview-java-processor/src/main/java/com/azure/tools/apiview/processor/diagnostics/rules/PackageNameDiagnosticRule.java | package com.azure.tools.apiview.processor.diagnostics.rules;
import com.azure.tools.apiview.processor.diagnostics.DiagnosticRule;
import com.azure.tools.apiview.processor.model.APIListing;
import com.azure.tools.apiview.processor.model.Diagnostic;
import com.github.javaparser.ast.CompilationUnit;
import java.util.regex.Pattern;
import static com.azure.tools.apiview.processor.analysers.util.ASTUtils.*;
public class PackageNameDiagnosticRule implements DiagnosticRule {
final static Pattern regex = Pattern.compile("^com.azure.[a-z0-9]*(\\.[a-z0-9]+)+[0-9a-z]$");
@Override
public void scan(final CompilationUnit cu, final APIListing listing) {
getPackageName(cu).ifPresent(packageName -> {
// we need to map the issue to the class id, because package text isn't printed in the APIView output
getClassName(cu).map(listing.getKnownTypes()::get).ifPresent(typeId -> {
if (!regex.matcher(packageName).matches()) {
listing.addDiagnostic(new Diagnostic(typeId,
"Package name must start with 'com.azure', and it must be lower-case, with no underscores or hyphens."));
}
});
});
}
}
| package com.azure.tools.apiview.processor.diagnostics.rules;
import com.azure.tools.apiview.processor.diagnostics.DiagnosticRule;
import com.azure.tools.apiview.processor.model.APIListing;
import com.azure.tools.apiview.processor.model.Diagnostic;
import com.github.javaparser.ast.CompilationUnit;
import java.util.regex.Pattern;
import static com.azure.tools.apiview.processor.analysers.util.ASTUtils.*;
public class PackageNameDiagnosticRule implements DiagnosticRule {
final static Pattern regex = Pattern.compile("^com.azure(\\.[a-z0-9]+)+$");
@Override
public void scan(final CompilationUnit cu, final APIListing listing) {
getPackageName(cu).ifPresent(packageName -> {
// we need to map the issue to the class id, because package text isn't printed in the APIView output
getClassName(cu).map(listing.getKnownTypes()::get).ifPresent(typeId -> {
if (!regex.matcher(packageName).matches()) {
listing.addDiagnostic(new Diagnostic(typeId,
"Package name must start with 'com.azure', and it must be lower-case, with no underscores or hyphens."));
}
});
});
}
}
| Fix regex for package naming diagnostic | Fix regex for package naming diagnostic
| Java | mit | tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools | java | ## Code Before:
package com.azure.tools.apiview.processor.diagnostics.rules;
import com.azure.tools.apiview.processor.diagnostics.DiagnosticRule;
import com.azure.tools.apiview.processor.model.APIListing;
import com.azure.tools.apiview.processor.model.Diagnostic;
import com.github.javaparser.ast.CompilationUnit;
import java.util.regex.Pattern;
import static com.azure.tools.apiview.processor.analysers.util.ASTUtils.*;
public class PackageNameDiagnosticRule implements DiagnosticRule {
final static Pattern regex = Pattern.compile("^com.azure.[a-z0-9]*(\\.[a-z0-9]+)+[0-9a-z]$");
@Override
public void scan(final CompilationUnit cu, final APIListing listing) {
getPackageName(cu).ifPresent(packageName -> {
// we need to map the issue to the class id, because package text isn't printed in the APIView output
getClassName(cu).map(listing.getKnownTypes()::get).ifPresent(typeId -> {
if (!regex.matcher(packageName).matches()) {
listing.addDiagnostic(new Diagnostic(typeId,
"Package name must start with 'com.azure', and it must be lower-case, with no underscores or hyphens."));
}
});
});
}
}
## Instruction:
Fix regex for package naming diagnostic
## Code After:
package com.azure.tools.apiview.processor.diagnostics.rules;
import com.azure.tools.apiview.processor.diagnostics.DiagnosticRule;
import com.azure.tools.apiview.processor.model.APIListing;
import com.azure.tools.apiview.processor.model.Diagnostic;
import com.github.javaparser.ast.CompilationUnit;
import java.util.regex.Pattern;
import static com.azure.tools.apiview.processor.analysers.util.ASTUtils.*;
public class PackageNameDiagnosticRule implements DiagnosticRule {
final static Pattern regex = Pattern.compile("^com.azure(\\.[a-z0-9]+)+$");
@Override
public void scan(final CompilationUnit cu, final APIListing listing) {
getPackageName(cu).ifPresent(packageName -> {
// we need to map the issue to the class id, because package text isn't printed in the APIView output
getClassName(cu).map(listing.getKnownTypes()::get).ifPresent(typeId -> {
if (!regex.matcher(packageName).matches()) {
listing.addDiagnostic(new Diagnostic(typeId,
"Package name must start with 'com.azure', and it must be lower-case, with no underscores or hyphens."));
}
});
});
}
}
|
4ab11b2fde9b08ab8295defb0b88a3be81b8d978 | README.rdoc | README.rdoc | = PdFer
This project rocks and uses MIT-LICENSE. | = PdFer
{<img src="https://travis-ci.org/NanoXD/PDFer.png?branch=master" alt="Build Status" />}[https://travis-ci.org/NanoXD/PDFer]
This project rocks and uses MIT-LICENSE.
| Add Travis badge to Readme | Add Travis badge to Readme | RDoc | mit | nanoxd/PDFer,nanoxd/PDFer | rdoc | ## Code Before:
= PdFer
This project rocks and uses MIT-LICENSE.
## Instruction:
Add Travis badge to Readme
## Code After:
= PdFer
{<img src="https://travis-ci.org/NanoXD/PDFer.png?branch=master" alt="Build Status" />}[https://travis-ci.org/NanoXD/PDFer]
This project rocks and uses MIT-LICENSE.
|
6849f617e991e8a46eebf746df43032175f263b3 | CMakeLists.txt | CMakeLists.txt | cmake_minimum_required (VERSION 2.6)
project (OPENCL_ICD_LOADER)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (OPENCL_ICD_LOADER_SOURCES icd.c icd_dispatch.c)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_linux.c icd_exports.map)
else ()
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_windows.c OpenCL.def)
include_directories ($ENV{DXSDK_DIR}/Include)
endif ()
# Change this to point to a directory containing OpenCL header directory "CL"
# OR copy OpenCL headers to ./inc/CL/
include_directories (./inc)
add_library (OpenCL SHARED ${OPENCL_ICD_LOADER_SOURCES})
set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-pthread -Wl,--version-script -Wl,${CMAKE_SOURCE_DIR}/icd_exports.map")
endif ()
target_link_libraries (OpenCL ${CMAKE_DL_LIBS})
enable_testing()
add_subdirectory (test)
| cmake_minimum_required (VERSION 2.6)
project (OPENCL_ICD_LOADER)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (OPENCL_ICD_LOADER_SOURCES icd.c icd_dispatch.c)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_linux.c icd_exports.map)
else ()
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_windows.c OpenCL.def)
include_directories ($ENV{DXSDK_DIR}/Include)
endif ()
# Change this to point to a directory containing OpenCL header directory "CL"
# OR copy OpenCL headers to ./inc/CL/
if (NOT DEFINED OPENCL_INCLUDE_DIRS)
set (OPENCL_INCLUDE_DIRS ./inc)
endif ()
include_directories (${OPENCL_INCLUDE_DIRS})
add_library (OpenCL SHARED ${OPENCL_ICD_LOADER_SOURCES})
set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-pthread -Wl,--version-script -Wl,${CMAKE_CURRENT_SOURCE_DIR}/icd_exports.map")
endif ()
target_link_libraries (OpenCL ${CMAKE_DL_LIBS})
enable_testing()
add_subdirectory (test)
| Allow building ICD loader as a CMake subproject. | Allow building ICD loader as a CMake subproject.
Tweaked CMakeLists.txt to make it possible to build OpenCL-ICD-Loader as a
subproject.
| Text | apache-2.0 | KhronosGroup/OpenCL-ICD-Loader,KhronosGroup/OpenCL-ICD-Loader | text | ## Code Before:
cmake_minimum_required (VERSION 2.6)
project (OPENCL_ICD_LOADER)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (OPENCL_ICD_LOADER_SOURCES icd.c icd_dispatch.c)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_linux.c icd_exports.map)
else ()
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_windows.c OpenCL.def)
include_directories ($ENV{DXSDK_DIR}/Include)
endif ()
# Change this to point to a directory containing OpenCL header directory "CL"
# OR copy OpenCL headers to ./inc/CL/
include_directories (./inc)
add_library (OpenCL SHARED ${OPENCL_ICD_LOADER_SOURCES})
set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-pthread -Wl,--version-script -Wl,${CMAKE_SOURCE_DIR}/icd_exports.map")
endif ()
target_link_libraries (OpenCL ${CMAKE_DL_LIBS})
enable_testing()
add_subdirectory (test)
## Instruction:
Allow building ICD loader as a CMake subproject.
Tweaked CMakeLists.txt to make it possible to build OpenCL-ICD-Loader as a
subproject.
## Code After:
cmake_minimum_required (VERSION 2.6)
project (OPENCL_ICD_LOADER)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (OPENCL_ICD_LOADER_SOURCES icd.c icd_dispatch.c)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_linux.c icd_exports.map)
else ()
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_windows.c OpenCL.def)
include_directories ($ENV{DXSDK_DIR}/Include)
endif ()
# Change this to point to a directory containing OpenCL header directory "CL"
# OR copy OpenCL headers to ./inc/CL/
if (NOT DEFINED OPENCL_INCLUDE_DIRS)
set (OPENCL_INCLUDE_DIRS ./inc)
endif ()
include_directories (${OPENCL_INCLUDE_DIRS})
add_library (OpenCL SHARED ${OPENCL_ICD_LOADER_SOURCES})
set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-pthread -Wl,--version-script -Wl,${CMAKE_CURRENT_SOURCE_DIR}/icd_exports.map")
endif ()
target_link_libraries (OpenCL ${CMAKE_DL_LIBS})
enable_testing()
add_subdirectory (test)
|
4cf92d8b62bcb69f6b4ced83f0bab78c41f346b1 | public/less/_readme.less | public/less/_readme.less | .readme {
line-height: 1.4em;
h1:first-child {
margin-top: 5px;
font-size: 2.5em;
}
h1, h2, h3, h4, h5 {
text-align: left;
font-family: @page-sans-serif-fonts;
line-height: 1em;
}
} | .readme {
line-height: 1.4em;
h1:first-child {
margin-top: 5px;
font-size: 2.5em;
}
h1, h2, h3, h4, h5 {
text-align: left;
font-family: @page-sans-serif-fonts;
line-height: 1em;
}
img {
max-width: 100%;
}
} | Add max-width for images in readme. | Add max-width for images in readme.
| Less | mit | rogeliog/react-components,vizavi21/react-components,rexxars/react-components,rexxars/react-components,vizavi21/react-components,rogeliog/react-components,vaffel/react-components,vaffel/react-components | less | ## Code Before:
.readme {
line-height: 1.4em;
h1:first-child {
margin-top: 5px;
font-size: 2.5em;
}
h1, h2, h3, h4, h5 {
text-align: left;
font-family: @page-sans-serif-fonts;
line-height: 1em;
}
}
## Instruction:
Add max-width for images in readme.
## Code After:
.readme {
line-height: 1.4em;
h1:first-child {
margin-top: 5px;
font-size: 2.5em;
}
h1, h2, h3, h4, h5 {
text-align: left;
font-family: @page-sans-serif-fonts;
line-height: 1em;
}
img {
max-width: 100%;
}
} |
6f3d1778bc4c47c0fc72904f2ad07145b9b81f5b | app/views/spree/admin/shared/_showcase_submenu.html.erb | app/views/spree/admin/shared/_showcase_submenu.html.erb | <% content_for :sub_menu do %>
<ul id="sub_nav" data-hook="admin_showcase_sub_tabs">
<%= tab :slides, :match_path => '/slides' %>
<%= tab :showcase_settings, :match_path => '/showcase_settings' %>
</ul>
<% end %> | <% content_for :sub_menu do %>
<ul id="sub_nav" class="inline-menu" data-hook="admin_showcase_sub_tabs">
<%= tab :slides, :match_path => '/slides' %>
<%= tab :showcase_settings, :match_path => '/showcase_settings' %>
</ul>
<% end %> | Fix CSS problems in admin subnav by adding class inline-menu | Fix CSS problems in admin subnav by adding class inline-menu
| HTML+ERB | bsd-3-clause | daemonsy/spree_showcase,daemonsy/spree_showcase,mileer/spree_showcase,mileer/spree_showcase,daemonsy/spree_showcase | html+erb | ## Code Before:
<% content_for :sub_menu do %>
<ul id="sub_nav" data-hook="admin_showcase_sub_tabs">
<%= tab :slides, :match_path => '/slides' %>
<%= tab :showcase_settings, :match_path => '/showcase_settings' %>
</ul>
<% end %>
## Instruction:
Fix CSS problems in admin subnav by adding class inline-menu
## Code After:
<% content_for :sub_menu do %>
<ul id="sub_nav" class="inline-menu" data-hook="admin_showcase_sub_tabs">
<%= tab :slides, :match_path => '/slides' %>
<%= tab :showcase_settings, :match_path => '/showcase_settings' %>
</ul>
<% end %> |
92ca74258f0028bf3b12a84a7f7741f7b72ec45d | db/migrations/migration2.py | db/migrations/migration2.py | import sqlite3
from config import DATA_FOLDER
def migrate(database_path):
print "migrating to db version 2"
conn = sqlite3.connect(database_path)
conn.text_factory = str
cursor = conn.cursor()
# read hashmap from db
cursor.execute('''SELECT * FROM hashmap''')
mappings = cursor.fetchall()
for mapping in mappings:
if DATA_FOLDER not in mapping[1]:
raise Exception("To complete migration 2 please run openbazaard at least once using the original "
"data folder location before moving it to a different location.")
path = mapping[1][len(DATA_FOLDER):]
cursor.execute('''INSERT OR REPLACE INTO hashmap(hash, filepath)
VALUES (?,?)''', (mapping[0], path))
# update version
cursor.execute('''PRAGMA user_version = 2''')
conn.commit()
conn.close()
| import sqlite3
from config import DATA_FOLDER
def migrate(database_path):
print "migrating to db version 2"
conn = sqlite3.connect(database_path)
conn.text_factory = str
cursor = conn.cursor()
# read hashmap from db
cursor.execute('''SELECT * FROM hashmap''')
mappings = cursor.fetchall()
for mapping in mappings:
if DATA_FOLDER in mapping[1]:
path = mapping[1][len(DATA_FOLDER):]
cursor.execute('''INSERT OR REPLACE INTO hashmap(hash, filepath)
VALUES (?,?)''', (mapping[0], path))
# update version
cursor.execute('''PRAGMA user_version = 2''')
conn.commit()
conn.close()
| Remove exception in migration Some users moved their data folder despite the code not permitting it yet. This migration will fail for those users, but they will still be able to run the app. | Remove exception in migration
Some users moved their data folder despite the code not permitting it yet.
This migration will fail for those users, but they will still be able to run
the app.
| Python | mit | OpenBazaar/Network,OpenBazaar/OpenBazaar-Server,tomgalloway/OpenBazaar-Server,saltduck/OpenBazaar-Server,tomgalloway/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,saltduck/OpenBazaar-Server,cpacia/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,OpenBazaar/Network,OpenBazaar/OpenBazaar-Server,saltduck/OpenBazaar-Server,OpenBazaar/Network,cpacia/OpenBazaar-Server,OpenBazaar/OpenBazaar-Server,cpacia/OpenBazaar-Server,tomgalloway/OpenBazaar-Server,tyler-smith/OpenBazaar-Server | python | ## Code Before:
import sqlite3
from config import DATA_FOLDER
def migrate(database_path):
print "migrating to db version 2"
conn = sqlite3.connect(database_path)
conn.text_factory = str
cursor = conn.cursor()
# read hashmap from db
cursor.execute('''SELECT * FROM hashmap''')
mappings = cursor.fetchall()
for mapping in mappings:
if DATA_FOLDER not in mapping[1]:
raise Exception("To complete migration 2 please run openbazaard at least once using the original "
"data folder location before moving it to a different location.")
path = mapping[1][len(DATA_FOLDER):]
cursor.execute('''INSERT OR REPLACE INTO hashmap(hash, filepath)
VALUES (?,?)''', (mapping[0], path))
# update version
cursor.execute('''PRAGMA user_version = 2''')
conn.commit()
conn.close()
## Instruction:
Remove exception in migration
Some users moved their data folder despite the code not permitting it yet.
This migration will fail for those users, but they will still be able to run
the app.
## Code After:
import sqlite3
from config import DATA_FOLDER
def migrate(database_path):
print "migrating to db version 2"
conn = sqlite3.connect(database_path)
conn.text_factory = str
cursor = conn.cursor()
# read hashmap from db
cursor.execute('''SELECT * FROM hashmap''')
mappings = cursor.fetchall()
for mapping in mappings:
if DATA_FOLDER in mapping[1]:
path = mapping[1][len(DATA_FOLDER):]
cursor.execute('''INSERT OR REPLACE INTO hashmap(hash, filepath)
VALUES (?,?)''', (mapping[0], path))
# update version
cursor.execute('''PRAGMA user_version = 2''')
conn.commit()
conn.close()
|
78816ad434b8c60184cf2a46a8c7f17e40f56e99 | compression.go | compression.go | package main
import (
_ "github.com/itchio/wharf/compressors/cbrotli"
_ "github.com/itchio/wharf/decompressors/cbrotli"
)
| package main
import (
_ "github.com/itchio/wharf/compressors/cbrotli"
_ "github.com/itchio/wharf/decompressors/cbrotli"
_ "github.com/itchio/wharf/compressors/gzip"
_ "github.com/itchio/wharf/decompressors/gzip"
)
| Add gzip compressor/decompressor, doesn't seem to make binary any bigger (probably already included somewhere) | Add gzip compressor/decompressor, doesn't seem to make binary any bigger (probably already included somewhere)
| Go | mit | itchio/butler,itchio/butler,itchio/butler | go | ## Code Before:
package main
import (
_ "github.com/itchio/wharf/compressors/cbrotli"
_ "github.com/itchio/wharf/decompressors/cbrotli"
)
## Instruction:
Add gzip compressor/decompressor, doesn't seem to make binary any bigger (probably already included somewhere)
## Code After:
package main
import (
_ "github.com/itchio/wharf/compressors/cbrotli"
_ "github.com/itchio/wharf/decompressors/cbrotli"
_ "github.com/itchio/wharf/compressors/gzip"
_ "github.com/itchio/wharf/decompressors/gzip"
)
|
d7025f92a240284d130ce455b6975ede42d0228e | chalice/cli/filewatch/eventbased.py | chalice/cli/filewatch/eventbased.py | import threading # noqa
from typing import Callable, Optional # noqa
import watchdog.observers
from watchdog.events import FileSystemEventHandler
from watchdog.events import FileSystemEvent # noqa
from chalice.cli.filewatch import FileWatcher, WorkerProcess
class WatchdogWorkerProcess(WorkerProcess):
"""Worker that runs the chalice dev server."""
def _start_file_watcher(self, project_dir):
# type: (str) -> None
restart_callback = WatchdogRestarter(self._restart_event)
watcher = WatchdogFileWatcher()
watcher.watch_for_file_changes(
project_dir, restart_callback)
class WatchdogFileWatcher(FileWatcher):
def watch_for_file_changes(self, root_dir, callback):
# type: (str, Callable[[], None]) -> None
observer = watchdog.observers.Observer()
observer.schedule(callback, root_dir, recursive=True)
observer.start()
class WatchdogRestarter(FileSystemEventHandler):
def __init__(self, restart_event):
# type: (threading.Event) -> None
# The reason we're using threading
self.restart_event = restart_event
def on_any_event(self, event):
# type: (FileSystemEvent) -> None
# If we modify a file we'll get a FileModifiedEvent
# as well as a DirectoryModifiedEvent.
# We only care about reloading is a file is modified.
if event.is_directory:
return
self()
def __call__(self):
# type: () -> None
self.restart_event.set()
| import threading # noqa
from typing import Callable, Optional # noqa
import watchdog.observers # pylint: disable=import-error
from watchdog import events # pylint: disable=import-error
from chalice.cli.filewatch import FileWatcher, WorkerProcess
class WatchdogWorkerProcess(WorkerProcess):
"""Worker that runs the chalice dev server."""
def _start_file_watcher(self, project_dir):
# type: (str) -> None
restart_callback = WatchdogRestarter(self._restart_event)
watcher = WatchdogFileWatcher()
watcher.watch_for_file_changes(
project_dir, restart_callback)
class WatchdogFileWatcher(FileWatcher):
def watch_for_file_changes(self, root_dir, callback):
# type: (str, Callable[[], None]) -> None
observer = watchdog.observers.Observer()
observer.schedule(callback, root_dir, recursive=True)
observer.start()
class WatchdogRestarter(events.FileSystemEventHandler):
def __init__(self, restart_event):
# type: (threading.Event) -> None
# The reason we're using threading
self.restart_event = restart_event
def on_any_event(self, event):
# type: (events.FileSystemEvent) -> None
# If we modify a file we'll get a FileModifiedEvent
# as well as a DirectoryModifiedEvent.
# We only care about reloading is a file is modified.
if event.is_directory:
return
self()
def __call__(self):
# type: () -> None
self.restart_event.set()
| Make prcheck pass without needing cond deps | Make prcheck pass without needing cond deps
| Python | apache-2.0 | awslabs/chalice | python | ## Code Before:
import threading # noqa
from typing import Callable, Optional # noqa
import watchdog.observers
from watchdog.events import FileSystemEventHandler
from watchdog.events import FileSystemEvent # noqa
from chalice.cli.filewatch import FileWatcher, WorkerProcess
class WatchdogWorkerProcess(WorkerProcess):
"""Worker that runs the chalice dev server."""
def _start_file_watcher(self, project_dir):
# type: (str) -> None
restart_callback = WatchdogRestarter(self._restart_event)
watcher = WatchdogFileWatcher()
watcher.watch_for_file_changes(
project_dir, restart_callback)
class WatchdogFileWatcher(FileWatcher):
def watch_for_file_changes(self, root_dir, callback):
# type: (str, Callable[[], None]) -> None
observer = watchdog.observers.Observer()
observer.schedule(callback, root_dir, recursive=True)
observer.start()
class WatchdogRestarter(FileSystemEventHandler):
def __init__(self, restart_event):
# type: (threading.Event) -> None
# The reason we're using threading
self.restart_event = restart_event
def on_any_event(self, event):
# type: (FileSystemEvent) -> None
# If we modify a file we'll get a FileModifiedEvent
# as well as a DirectoryModifiedEvent.
# We only care about reloading is a file is modified.
if event.is_directory:
return
self()
def __call__(self):
# type: () -> None
self.restart_event.set()
## Instruction:
Make prcheck pass without needing cond deps
## Code After:
import threading # noqa
from typing import Callable, Optional # noqa
import watchdog.observers # pylint: disable=import-error
from watchdog import events # pylint: disable=import-error
from chalice.cli.filewatch import FileWatcher, WorkerProcess
class WatchdogWorkerProcess(WorkerProcess):
"""Worker that runs the chalice dev server."""
def _start_file_watcher(self, project_dir):
# type: (str) -> None
restart_callback = WatchdogRestarter(self._restart_event)
watcher = WatchdogFileWatcher()
watcher.watch_for_file_changes(
project_dir, restart_callback)
class WatchdogFileWatcher(FileWatcher):
def watch_for_file_changes(self, root_dir, callback):
# type: (str, Callable[[], None]) -> None
observer = watchdog.observers.Observer()
observer.schedule(callback, root_dir, recursive=True)
observer.start()
class WatchdogRestarter(events.FileSystemEventHandler):
def __init__(self, restart_event):
# type: (threading.Event) -> None
# The reason we're using threading
self.restart_event = restart_event
def on_any_event(self, event):
# type: (events.FileSystemEvent) -> None
# If we modify a file we'll get a FileModifiedEvent
# as well as a DirectoryModifiedEvent.
# We only care about reloading is a file is modified.
if event.is_directory:
return
self()
def __call__(self):
# type: () -> None
self.restart_event.set()
|
2f862e808ce472aba91a1ce7560e3eb023025049 | templates/add-service/web-express-es6/service.yml | templates/add-service/web-express-es6/service.yml | name: _____service-name_____
description: _____description_____
startup:
command: node app
online-text: all systems go
messages:
sends:
receives:
| name: _____service-name_____
description: _____description_____
setup: npm install --loglevel error --depth 0
startup:
command: node app
online-text: all systems go
messages:
sends:
receives:
| Add setup configuration to ES6 template | Add setup configuration to ES6 template | YAML | mit | Originate/exosphere,Originate/exosphere,Originate/exosphere,Originate/exosphere | yaml | ## Code Before:
name: _____service-name_____
description: _____description_____
startup:
command: node app
online-text: all systems go
messages:
sends:
receives:
## Instruction:
Add setup configuration to ES6 template
## Code After:
name: _____service-name_____
description: _____description_____
setup: npm install --loglevel error --depth 0
startup:
command: node app
online-text: all systems go
messages:
sends:
receives:
|
d4f81bf1559271e465bd492a12a66f2cc1aa6f3c | app/models/restricted_hour.rb | app/models/restricted_hour.rb | class RestrictedHour < ActiveRecord::Base
belongs_to :restaurant
end
| class RestrictedHour < ActiveRecord::Base
belongs_to :restaurant
validates :from_datetime, presence: true
validates :to_datetime, presence: true
end
| Add validation to restricted hours | Add validation to restricted hours
| Ruby | mit | plug-hackathon/chefstable-backend,plug-hackathon/chefstable-backend,plug-hackathon/chefstable-backend | ruby | ## Code Before:
class RestrictedHour < ActiveRecord::Base
belongs_to :restaurant
end
## Instruction:
Add validation to restricted hours
## Code After:
class RestrictedHour < ActiveRecord::Base
belongs_to :restaurant
validates :from_datetime, presence: true
validates :to_datetime, presence: true
end
|
0b1d84391933fc86d2ee456b607482a474e61f84 | src/main/java/de/paymill/net/Filter.java | src/main/java/de/paymill/net/Filter.java | package de.paymill.net;
import java.util.HashMap;
import java.util.Map;
/**
* A thin wrapper around a map object for declaring a list filter when querying
* the webservice.
*/
public class Filter {
private Map<String, Object> data;
public Filter() {
data = new HashMap<String, Object>();
}
/**
* Adds a new filter criteria.
*
* @param key
* @param filter
*/
public void add(String key, Object filter) {
data.put(key, filter);
}
public Map<String, Object> toMap() {
return new HashMap<String, Object>(data);
}
}
| package de.paymill.net;
import java.util.HashMap;
import java.util.Map;
/**
* A thin wrapper around a map object for declaring a list filter when querying
* the webservice.
*/
public class Filter {
private Map<String, Object> data;
public Filter() {
data = new HashMap<String, Object>();
}
public Filter(Map<String, Object> data) {
data = new HashMap<String, Object>(data);
}
/**
* Adds a new filter criteria.
*
* @param key
* @param filter
* @return this filter. Allows for method chaining.
*/
public Filter add(String key, Object filter) {
data.put(key, filter);
return this;
}
public Map<String, Object> toMap() {
return new HashMap<String, Object>(data);
}
}
| Return instance from add for chaining. Add constructor that takes a map. | Return instance from add for chaining. Add constructor that takes a map.
I let the add method return "this" soo that we can chain method calls. Like ```new Filter().add("some", "value").add("another", "value")
I added a constructor that takes a filter map and uses a copy of that for the initial data. | Java | mit | vladaspasic/paymill-java,paymill/paymill-java | java | ## Code Before:
package de.paymill.net;
import java.util.HashMap;
import java.util.Map;
/**
* A thin wrapper around a map object for declaring a list filter when querying
* the webservice.
*/
public class Filter {
private Map<String, Object> data;
public Filter() {
data = new HashMap<String, Object>();
}
/**
* Adds a new filter criteria.
*
* @param key
* @param filter
*/
public void add(String key, Object filter) {
data.put(key, filter);
}
public Map<String, Object> toMap() {
return new HashMap<String, Object>(data);
}
}
## Instruction:
Return instance from add for chaining. Add constructor that takes a map.
I let the add method return "this" soo that we can chain method calls. Like ```new Filter().add("some", "value").add("another", "value")
I added a constructor that takes a filter map and uses a copy of that for the initial data.
## Code After:
package de.paymill.net;
import java.util.HashMap;
import java.util.Map;
/**
* A thin wrapper around a map object for declaring a list filter when querying
* the webservice.
*/
public class Filter {
private Map<String, Object> data;
public Filter() {
data = new HashMap<String, Object>();
}
public Filter(Map<String, Object> data) {
data = new HashMap<String, Object>(data);
}
/**
* Adds a new filter criteria.
*
* @param key
* @param filter
* @return this filter. Allows for method chaining.
*/
public Filter add(String key, Object filter) {
data.put(key, filter);
return this;
}
public Map<String, Object> toMap() {
return new HashMap<String, Object>(data);
}
}
|
a4fbdf2d677fb0d847243dc0e2d679e5fa44ea31 | lib/mumukit/auth/user.rb | lib/mumukit/auth/user.rb | require 'auth0'
class Mumukit::Auth::User
attr_accessor :social_id, :user
def initialize(social_id)
@social_id = social_id
@user = client.user @social_id
end
def update_metadata(data)
client.update_user_metadata social_id, metadata.merge(data)
end
def metadata
metadata = {}
apps.each do |app|
metadata[app] = @user[app] if @user[app].present?
end
metadata
end
def apps
['bibliotheca', 'classroom', 'admin', 'atheneum']
end
def client
Auth0Client.new(
:client_id => ENV['MUMUKI_AUTH0_CLIENT_ID'],
:client_secret => ENV['MUMUKI_AUTH0_CLIENT_SECRET'],
:domain => "mumuki.auth0.com"
)
end
end | require 'auth0'
class Mumukit::Auth::User
attr_accessor :social_id, :user, :metadata
def initialize(social_id)
@social_id = social_id
@user = client.user @social_id
@metadata = get_metadata || {}
end
def update_permissions(key, permission)
client.update_user_metadata social_id, add_permission(key, permission)
end
def get_metadata
apps.select { |app| @user[app].present? }.map { |app| { "#{app}" => @user[app] } }.reduce({}, :merge)
end
def add_permission(key, permission)
if @metadata[key].present?
@metadata[key]['permissions'] += ":#{permission}"
else
@metadata.merge!("#{key}" => { 'permissions' => permission })
end
@metadata
end
def apps
['bibliotheca', 'classroom', 'admin', 'atheneum']
end
def client
Auth0Client.new(
:client_id => ENV['MUMUKI_AUTH0_CLIENT_ID'],
:client_secret => ENV['MUMUKI_AUTH0_CLIENT_SECRET'],
:domain => "mumuki.auth0.com"
)
end
end | Refactor to support when no permissions | Refactor to support when no permissions
| Ruby | mit | mumuki/mumukit-auth,mumuki/mumukit-auth | ruby | ## Code Before:
require 'auth0'
class Mumukit::Auth::User
attr_accessor :social_id, :user
def initialize(social_id)
@social_id = social_id
@user = client.user @social_id
end
def update_metadata(data)
client.update_user_metadata social_id, metadata.merge(data)
end
def metadata
metadata = {}
apps.each do |app|
metadata[app] = @user[app] if @user[app].present?
end
metadata
end
def apps
['bibliotheca', 'classroom', 'admin', 'atheneum']
end
def client
Auth0Client.new(
:client_id => ENV['MUMUKI_AUTH0_CLIENT_ID'],
:client_secret => ENV['MUMUKI_AUTH0_CLIENT_SECRET'],
:domain => "mumuki.auth0.com"
)
end
end
## Instruction:
Refactor to support when no permissions
## Code After:
require 'auth0'
class Mumukit::Auth::User
attr_accessor :social_id, :user, :metadata
def initialize(social_id)
@social_id = social_id
@user = client.user @social_id
@metadata = get_metadata || {}
end
def update_permissions(key, permission)
client.update_user_metadata social_id, add_permission(key, permission)
end
def get_metadata
apps.select { |app| @user[app].present? }.map { |app| { "#{app}" => @user[app] } }.reduce({}, :merge)
end
def add_permission(key, permission)
if @metadata[key].present?
@metadata[key]['permissions'] += ":#{permission}"
else
@metadata.merge!("#{key}" => { 'permissions' => permission })
end
@metadata
end
def apps
['bibliotheca', 'classroom', 'admin', 'atheneum']
end
def client
Auth0Client.new(
:client_id => ENV['MUMUKI_AUTH0_CLIENT_ID'],
:client_secret => ENV['MUMUKI_AUTH0_CLIENT_SECRET'],
:domain => "mumuki.auth0.com"
)
end
end |
5a92b2d340c78f0a58f059543b38efc8cb0e84f6 | PocketForecast/AppDelegate.swift | PocketForecast/AppDelegate.swift | ////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2013, Jasper Blues & Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var cityDao: CityDao?
var rootViewController: RootViewController?
private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
ICLoader.setImageName("cloud_icon.png")
ICLoader.setLabelFontName(UIFont.applicationFontOfSize(size: 10).fontName)
UIApplication.shared.setStatusBarStyle(.lightContent, animated: true)
UINavigationBar.appearance().titleTextAttributes = [
NSFontAttributeName : UIFont.applicationFontOfSize(size: 20),
NSForegroundColorAttributeName : UIColor.white
]
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = self.rootViewController
self.window?.makeKeyAndVisible()
let selectedCity : String! = cityDao!.loadSelectedCity()
if (selectedCity == nil) {
rootViewController?.showCitiesListController()
}
return true
}
}
| ////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2013, Jasper Blues & Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var cityDao: CityDao?
var rootViewController: RootViewController?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
ICLoader.setImageName("cloud_icon.png")
ICLoader.setLabelFontName(UIFont.applicationFontOfSize(size: 10).fontName)
UIApplication.shared.setStatusBarStyle(.lightContent, animated: true)
UINavigationBar.appearance().titleTextAttributes = [
NSFontAttributeName : UIFont.applicationFontOfSize(size: 20),
NSForegroundColorAttributeName : UIColor.white
]
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = self.rootViewController
self.window?.makeKeyAndVisible()
let selectedCity : String! = cityDao!.loadSelectedCity()
if (selectedCity == nil) {
rootViewController?.showCitiesListController()
}
return true
}
}
| Update application didiFinishLaunching method with Swift 3 syntax | Update application didiFinishLaunching method with Swift 3 syntax
| Swift | apache-2.0 | appsquickly/Typhoon-Swift-Example,appsquickly/Typhoon-Swift-Example | swift | ## Code Before:
////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2013, Jasper Blues & Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var cityDao: CityDao?
var rootViewController: RootViewController?
private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
ICLoader.setImageName("cloud_icon.png")
ICLoader.setLabelFontName(UIFont.applicationFontOfSize(size: 10).fontName)
UIApplication.shared.setStatusBarStyle(.lightContent, animated: true)
UINavigationBar.appearance().titleTextAttributes = [
NSFontAttributeName : UIFont.applicationFontOfSize(size: 20),
NSForegroundColorAttributeName : UIColor.white
]
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = self.rootViewController
self.window?.makeKeyAndVisible()
let selectedCity : String! = cityDao!.loadSelectedCity()
if (selectedCity == nil) {
rootViewController?.showCitiesListController()
}
return true
}
}
## Instruction:
Update application didiFinishLaunching method with Swift 3 syntax
## Code After:
////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2013, Jasper Blues & Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var cityDao: CityDao?
var rootViewController: RootViewController?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
ICLoader.setImageName("cloud_icon.png")
ICLoader.setLabelFontName(UIFont.applicationFontOfSize(size: 10).fontName)
UIApplication.shared.setStatusBarStyle(.lightContent, animated: true)
UINavigationBar.appearance().titleTextAttributes = [
NSFontAttributeName : UIFont.applicationFontOfSize(size: 20),
NSForegroundColorAttributeName : UIColor.white
]
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = self.rootViewController
self.window?.makeKeyAndVisible()
let selectedCity : String! = cityDao!.loadSelectedCity()
if (selectedCity == nil) {
rootViewController?.showCitiesListController()
}
return true
}
}
|
b63d8d2609985c26835c3890a3a929af6a4a6d1e | lib/Basic/OpenMPKinds.cpp | lib/Basic/OpenMPKinds.cpp | //===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
/// \file
/// \brief This file implements the OpenMP enum and support functions.
///
//===----------------------------------------------------------------------===//
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Lex/Token.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
using namespace clang;
OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) {
return llvm::StringSwitch<OpenMPDirectiveKind>(Str)
#define OPENMP_DIRECTIVE(Name) \
.Case(#Name, OMPD_##Name)
#include "clang/Basic/OpenMPKinds.def"
.Default(OMPD_unknown);
}
const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) {
assert(Kind < NUM_OPENMP_DIRECTIVES);
switch (Kind) {
case OMPD_unknown:
return ("unknown");
#define OPENMP_DIRECTIVE(Name) \
case OMPD_##Name : return #Name;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
}
llvm_unreachable("Invalid OpenMP directive kind");
}
| //===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
/// \file
/// \brief This file implements the OpenMP enum and support functions.
///
//===----------------------------------------------------------------------===//
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/IdentifierTable.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
using namespace clang;
OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) {
return llvm::StringSwitch<OpenMPDirectiveKind>(Str)
#define OPENMP_DIRECTIVE(Name) \
.Case(#Name, OMPD_##Name)
#include "clang/Basic/OpenMPKinds.def"
.Default(OMPD_unknown);
}
const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) {
assert(Kind < NUM_OPENMP_DIRECTIVES);
switch (Kind) {
case OMPD_unknown:
return ("unknown");
#define OPENMP_DIRECTIVE(Name) \
case OMPD_##Name : return #Name;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
}
llvm_unreachable("Invalid OpenMP directive kind");
}
| Fix a layering violation introduced in r177705. | Fix a layering violation introduced in r177705.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@177922 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang | c++ | ## Code Before:
//===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
/// \file
/// \brief This file implements the OpenMP enum and support functions.
///
//===----------------------------------------------------------------------===//
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Lex/Token.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
using namespace clang;
OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) {
return llvm::StringSwitch<OpenMPDirectiveKind>(Str)
#define OPENMP_DIRECTIVE(Name) \
.Case(#Name, OMPD_##Name)
#include "clang/Basic/OpenMPKinds.def"
.Default(OMPD_unknown);
}
const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) {
assert(Kind < NUM_OPENMP_DIRECTIVES);
switch (Kind) {
case OMPD_unknown:
return ("unknown");
#define OPENMP_DIRECTIVE(Name) \
case OMPD_##Name : return #Name;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
}
llvm_unreachable("Invalid OpenMP directive kind");
}
## Instruction:
Fix a layering violation introduced in r177705.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@177922 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
//===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
/// \file
/// \brief This file implements the OpenMP enum and support functions.
///
//===----------------------------------------------------------------------===//
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/IdentifierTable.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
using namespace clang;
OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) {
return llvm::StringSwitch<OpenMPDirectiveKind>(Str)
#define OPENMP_DIRECTIVE(Name) \
.Case(#Name, OMPD_##Name)
#include "clang/Basic/OpenMPKinds.def"
.Default(OMPD_unknown);
}
const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) {
assert(Kind < NUM_OPENMP_DIRECTIVES);
switch (Kind) {
case OMPD_unknown:
return ("unknown");
#define OPENMP_DIRECTIVE(Name) \
case OMPD_##Name : return #Name;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
}
llvm_unreachable("Invalid OpenMP directive kind");
}
|
d1535e10ef66a77d8a4551fef99863ef93d990fb | cookbooks/oxidized/templates/default/config.erb | cookbooks/oxidized/templates/default/config.erb | ---
# DO NOT EDIT - This file is being maintained by Chef
rest: false
vars:
remove_secret: true
pid: "/run/oxidized/oxidized.pid"
crash:
directory: /var/lib/oxidized/crashes
input:
default: ssh
output:
default: git
git:
single_repo: true
user: oxidized
email: [email protected]
repo: "/var/lib/oxidized/configs.git"
hooks:
push_to_remote:
type: githubrepo
events: [post_store]
remote_repo: [email protected]:openstreetmap/oxidized-configs.git
privatekey: /opt/oxidized/.ssh/id_ed25519
source:
default: csv
csv:
file: "/etc/oxidized/routers.db"
delimiter: !ruby/regexp /:/
map:
name: 0
model: 1
input: 2
username: 3
password: 4
model_map:
juniper: junos
apc: apc_aos
ciscocmb: ciscosmb
| ---
# DO NOT EDIT - This file is being maintained by Chef
rest: false
timeout: 60
vars:
remove_secret: true
pid: "/run/oxidized/oxidized.pid"
crash:
directory: /var/lib/oxidized/crashes
input:
default: ssh
output:
default: git
git:
single_repo: true
user: oxidized
email: [email protected]
repo: "/var/lib/oxidized/configs.git"
hooks:
push_to_remote:
type: githubrepo
events: [post_store]
remote_repo: [email protected]:openstreetmap/oxidized-configs.git
privatekey: /opt/oxidized/.ssh/id_ed25519
source:
default: csv
csv:
file: "/etc/oxidized/routers.db"
delimiter: !ruby/regexp /:/
map:
name: 0
model: 1
input: 2
username: 3
password: 4
model_map:
juniper: junos
apc: apc_aos
ciscocmb: ciscosmb
| Increase timeout to avoid triggering on slow device | oxidized: Increase timeout to avoid triggering on slow device
| HTML+ERB | apache-2.0 | tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,openstreetmap/chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,openstreetmap/chef,openstreetmap/chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,openstreetmap/chef,openstreetmap/chef,tomhughes/openstreetmap-chef,openstreetmap/chef,openstreetmap/chef,openstreetmap/chef,tomhughes/openstreetmap-chef | html+erb | ## Code Before:
---
# DO NOT EDIT - This file is being maintained by Chef
rest: false
vars:
remove_secret: true
pid: "/run/oxidized/oxidized.pid"
crash:
directory: /var/lib/oxidized/crashes
input:
default: ssh
output:
default: git
git:
single_repo: true
user: oxidized
email: [email protected]
repo: "/var/lib/oxidized/configs.git"
hooks:
push_to_remote:
type: githubrepo
events: [post_store]
remote_repo: [email protected]:openstreetmap/oxidized-configs.git
privatekey: /opt/oxidized/.ssh/id_ed25519
source:
default: csv
csv:
file: "/etc/oxidized/routers.db"
delimiter: !ruby/regexp /:/
map:
name: 0
model: 1
input: 2
username: 3
password: 4
model_map:
juniper: junos
apc: apc_aos
ciscocmb: ciscosmb
## Instruction:
oxidized: Increase timeout to avoid triggering on slow device
## Code After:
---
# DO NOT EDIT - This file is being maintained by Chef
rest: false
timeout: 60
vars:
remove_secret: true
pid: "/run/oxidized/oxidized.pid"
crash:
directory: /var/lib/oxidized/crashes
input:
default: ssh
output:
default: git
git:
single_repo: true
user: oxidized
email: [email protected]
repo: "/var/lib/oxidized/configs.git"
hooks:
push_to_remote:
type: githubrepo
events: [post_store]
remote_repo: [email protected]:openstreetmap/oxidized-configs.git
privatekey: /opt/oxidized/.ssh/id_ed25519
source:
default: csv
csv:
file: "/etc/oxidized/routers.db"
delimiter: !ruby/regexp /:/
map:
name: 0
model: 1
input: 2
username: 3
password: 4
model_map:
juniper: junos
apc: apc_aos
ciscocmb: ciscosmb
|
94f8b294ad37894fb17ec832103924871d1307b9 | packages/da/datarobot.yaml | packages/da/datarobot.yaml | homepage: https://github.com/orbital/datarobot#readme
changelog-type: ''
hash: 05f8db15ccddc3324d2c56f782d5e90f5b5bf840dd346e0bc104232bf3f750e1
test-bench-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
datarobot: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
maintainer: [email protected]
synopsis: Client for DataRobot API
changelog: ''
basic-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
all-versions:
- '0.1.0'
author: Sean Hess
latest: '0.1.0'
description-type: haddock
description: Client for DataRobot API
license-name: BSD3
| homepage: https://github.com/orbital/datarobot-haskell#readme
changelog-type: ''
hash: 4b2c939d5ed8e5ba82fd44d51fd8ee74a45e289f5043dc00f87b996f8b523dd6
test-bench-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
datarobot: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
maintainer: [email protected]
synopsis: Client for DataRobot API
changelog: ''
basic-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
all-versions:
- '0.1.0'
- '0.1.1'
author: Sean Hess
latest: '0.1.1'
description-type: haddock
description: Client for DataRobot API
license-name: BSD3
| Update from Hackage at 2017-08-22T20:55:49Z | Update from Hackage at 2017-08-22T20:55:49Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/orbital/datarobot#readme
changelog-type: ''
hash: 05f8db15ccddc3324d2c56f782d5e90f5b5bf840dd346e0bc104232bf3f750e1
test-bench-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
datarobot: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
maintainer: [email protected]
synopsis: Client for DataRobot API
changelog: ''
basic-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
all-versions:
- '0.1.0'
author: Sean Hess
latest: '0.1.0'
description-type: haddock
description: Client for DataRobot API
license-name: BSD3
## Instruction:
Update from Hackage at 2017-08-22T20:55:49Z
## Code After:
homepage: https://github.com/orbital/datarobot-haskell#readme
changelog-type: ''
hash: 4b2c939d5ed8e5ba82fd44d51fd8ee74a45e289f5043dc00f87b996f8b523dd6
test-bench-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
datarobot: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
maintainer: [email protected]
synopsis: Client for DataRobot API
changelog: ''
basic-deps:
exceptions: -any
bytestring: -any
base: ! '>=4.7 && <5'
unordered-containers: -any
text: -any
wreq: -any
network-uri: -any
scientific: -any
string-conversions: -any
microlens: -any
aeson: -any
safe: -any
vector: -any
all-versions:
- '0.1.0'
- '0.1.1'
author: Sean Hess
latest: '0.1.1'
description-type: haddock
description: Client for DataRobot API
license-name: BSD3
|
8b55331a4e9f444f7856ea2e119ee2826e06ba1d | ykman-gui/qml/Header.qml | ykman-gui/qml/Header.qml | import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
ColumnLayout {
id: header
spacing: 0
height: 48
Layout.maximumHeight: 48
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Rectangle {
id: background
Layout.minimumHeight: 45
Layout.fillWidth: true
Layout.fillHeight: true
color: "#ffffff"
Image {
id: logo
width: 100
height: 28
fillMode: Image.PreserveAspectCrop
anchors.left: parent.left
anchors.leftMargin: 12
anchors.bottomMargin: 5
anchors.bottom: parent.bottom
source: "../images/yubico-logo.svg"
}
}
Rectangle {
id: headerBorder
Layout.minimumHeight: 3
Layout.maximumHeight: 3
Layout.fillWidth: true
Layout.fillHeight: true
color: "#9aca3c"
}
}
| import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
ColumnLayout {
id: header
spacing: 0
height: 48
Layout.maximumHeight: 48
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Rectangle {
id: background
Layout.minimumHeight: 45
Layout.fillWidth: true
Layout.fillHeight: true
color: "#ffffff"
Image {
id: logo
width: 100
height: 28
fillMode: Image.PreserveAspectCrop
anchors.left: parent.left
anchors.leftMargin: 12
anchors.bottomMargin: 5
anchors.bottom: parent.bottom
source: "../images/yubico-logo.svg"
}
Label {
text: qsTr("<a href='https://www.yubico.com/kb' style='color:#284c61;text-decoration:none'>help</a>")
textFormat: Text.RichText
anchors.right: parent.right
anchors.rightMargin: 12
anchors.bottomMargin: 5
anchors.bottom: parent.bottom
onLinkActivated: Qt.openUrlExternally(link)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}
Rectangle {
id: headerBorder
Layout.minimumHeight: 3
Layout.maximumHeight: 3
Layout.fillWidth: true
Layout.fillHeight: true
color: "#9aca3c"
}
}
| Add help link in header | Add help link in header
| QML | bsd-2-clause | Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt | qml | ## Code Before:
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
ColumnLayout {
id: header
spacing: 0
height: 48
Layout.maximumHeight: 48
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Rectangle {
id: background
Layout.minimumHeight: 45
Layout.fillWidth: true
Layout.fillHeight: true
color: "#ffffff"
Image {
id: logo
width: 100
height: 28
fillMode: Image.PreserveAspectCrop
anchors.left: parent.left
anchors.leftMargin: 12
anchors.bottomMargin: 5
anchors.bottom: parent.bottom
source: "../images/yubico-logo.svg"
}
}
Rectangle {
id: headerBorder
Layout.minimumHeight: 3
Layout.maximumHeight: 3
Layout.fillWidth: true
Layout.fillHeight: true
color: "#9aca3c"
}
}
## Instruction:
Add help link in header
## Code After:
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
ColumnLayout {
id: header
spacing: 0
height: 48
Layout.maximumHeight: 48
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Rectangle {
id: background
Layout.minimumHeight: 45
Layout.fillWidth: true
Layout.fillHeight: true
color: "#ffffff"
Image {
id: logo
width: 100
height: 28
fillMode: Image.PreserveAspectCrop
anchors.left: parent.left
anchors.leftMargin: 12
anchors.bottomMargin: 5
anchors.bottom: parent.bottom
source: "../images/yubico-logo.svg"
}
Label {
text: qsTr("<a href='https://www.yubico.com/kb' style='color:#284c61;text-decoration:none'>help</a>")
textFormat: Text.RichText
anchors.right: parent.right
anchors.rightMargin: 12
anchors.bottomMargin: 5
anchors.bottom: parent.bottom
onLinkActivated: Qt.openUrlExternally(link)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}
Rectangle {
id: headerBorder
Layout.minimumHeight: 3
Layout.maximumHeight: 3
Layout.fillWidth: true
Layout.fillHeight: true
color: "#9aca3c"
}
}
|
726bcab4be6ab46dc062642f468289f1da16d2a2 | templates/contest/contest-list-tabs.jade | templates/contest/contest-list-tabs.jade | - load i18n
.page-title: .tabs
h2(style='color:#393630; display: inline-block') {% trans title %}
span.spacer
if tab == 'calendar'
div(style='font-size: 1.6em; margin-top: 0.3em')
if prev_month
a(href='{% url "contest_calendar" prev_month.year prev_month.month %}') « {% trans "Prev" %}
= ' '
if next_month
a(href='{% url "contest_calendar" next_month.year next_month.month %}') {% trans "Next" %} »
span.spacer
ul
li(class=('active' if tab == 'list' else '')): a(href='{% url "contest_list" %}') {% trans "List" %}
li(class=('active' if tab == 'calendar' else '')): a(href='{% url "contest_calendar" now.year now.month %}') {% trans "Calendar" %}
if perms.judge.change_contest
li: a(href='{% url "admin:judge_contest_changelist" %}') {% trans "Admin" %}
| - load i18n
.page-title: .tabs
h2(style='color:#393630; display: inline-block') {% trans title %}
span.spacer
if tab == 'calendar'
div(style='font-size: 1.6em; margin-top: 0.3em')
if prev_month
a(href='{% url "contest_calendar" prev_month.year prev_month.month %}') « {% trans "Prev" %}
= ' '
if next_month
a(href='{% url "contest_calendar" next_month.year next_month.month %}') {% trans "Next" %} »
span.spacer
ul
li.tab(class=('active' if tab == 'list' else '')): a(href='{% url "contest_list" %}') #[i.tab-icon.fa.fa-list] {% trans "List" %}
li.tab(class=('active' if tab == 'calendar' else '')): a(href='{% url "contest_calendar" now.year now.month %}') #[i.tab-icon.fa.fa-calendar] {% trans "Calendar" %}
if perms.judge.change_contest
li.tab: a(href='{% url "admin:judge_contest_changelist" %}') #[i.tab-icon.fa.fa-edit] {% trans "Admin" %}
| Add icons to contest list tabs | Add icons to contest list tabs
| Jade | agpl-3.0 | monouno/site,DMOJ/site,DMOJ/site,DMOJ/site,monouno/site,monouno/site,monouno/site,monouno/site,DMOJ/site | jade | ## Code Before:
- load i18n
.page-title: .tabs
h2(style='color:#393630; display: inline-block') {% trans title %}
span.spacer
if tab == 'calendar'
div(style='font-size: 1.6em; margin-top: 0.3em')
if prev_month
a(href='{% url "contest_calendar" prev_month.year prev_month.month %}') « {% trans "Prev" %}
= ' '
if next_month
a(href='{% url "contest_calendar" next_month.year next_month.month %}') {% trans "Next" %} »
span.spacer
ul
li(class=('active' if tab == 'list' else '')): a(href='{% url "contest_list" %}') {% trans "List" %}
li(class=('active' if tab == 'calendar' else '')): a(href='{% url "contest_calendar" now.year now.month %}') {% trans "Calendar" %}
if perms.judge.change_contest
li: a(href='{% url "admin:judge_contest_changelist" %}') {% trans "Admin" %}
## Instruction:
Add icons to contest list tabs
## Code After:
- load i18n
.page-title: .tabs
h2(style='color:#393630; display: inline-block') {% trans title %}
span.spacer
if tab == 'calendar'
div(style='font-size: 1.6em; margin-top: 0.3em')
if prev_month
a(href='{% url "contest_calendar" prev_month.year prev_month.month %}') « {% trans "Prev" %}
= ' '
if next_month
a(href='{% url "contest_calendar" next_month.year next_month.month %}') {% trans "Next" %} »
span.spacer
ul
li.tab(class=('active' if tab == 'list' else '')): a(href='{% url "contest_list" %}') #[i.tab-icon.fa.fa-list] {% trans "List" %}
li.tab(class=('active' if tab == 'calendar' else '')): a(href='{% url "contest_calendar" now.year now.month %}') #[i.tab-icon.fa.fa-calendar] {% trans "Calendar" %}
if perms.judge.change_contest
li.tab: a(href='{% url "admin:judge_contest_changelist" %}') #[i.tab-icon.fa.fa-edit] {% trans "Admin" %}
|
1053aefc6eeb04429d9b51a61b46141fa21ce886 | README.md | README.md |
[![GitHub version](https://badge.fury.io/gh/floating-cat%2FS1-Next.svg)](http://badge.fury.io/gh/floating-cat%2FS1-Next)
This is the Android Client for [STAGE1](http://bbs.saraba1st.com/2b/forum.php).
## License
[Apache License, Version 2.0](LICENSE.txt)
## Third-party Licenses
See [Licenses](app/src/main/assets/text/license)
## Alternatives
- [Stage1](https://play.google.com/store/apps/details?id=com.motion.stage1) – Android
- [Stage1st Go](https://play.google.com/store/apps/details?id=org.succlz123.s1go.app) – Android
- [S1 Pluto](https://itunes.apple.com/cn/app/s1-pluto/id889820003) – iOS
- [Stage1st Reader](https://itunes.apple.com/cn/app/stage1st-reader/id509916119) – iOS
- [S1 Nyan](https://www.windowsphone.com/zh-cn/store/app/s1-nyan/61790166-792c-493b-bcc2-a2f1506292f5) – WP
|
[![GitHub version](https://badge.fury.io/gh/floating-cat%2FS1-Next.svg)](http://badge.fury.io/gh/floating-cat%2FS1-Next) [![Build Status](https://travis-ci.org/floating-cat/S1-Next.svg?branch=master)](https://travis-ci.org/floating-cat/S1-Next)
This is the Android Client for [STAGE1](http://bbs.saraba1st.com/2b/forum.php).
## License
[Apache License, Version 2.0](LICENSE.txt)
## Third-party Licenses
See [Licenses](app/src/main/assets/text/license)
## Alternatives
- [Stage1](https://play.google.com/store/apps/details?id=com.motion.stage1) – Android
- [Stage1st Go](https://play.google.com/store/apps/details?id=org.succlz123.s1go.app) – Android
- [S1 Pluto](https://itunes.apple.com/cn/app/s1-pluto/id889820003) – iOS
- [Stage1st Reader](https://itunes.apple.com/cn/app/stage1st-reader/id509916119) – iOS
- [S1 Nyan](https://www.windowsphone.com/zh-cn/store/app/s1-nyan/61790166-792c-493b-bcc2-a2f1506292f5) – WP
| Add Travis CI status image | Add Travis CI status image
| Markdown | apache-2.0 | ykrank/S1-Next,suafeng/S1-Next,ykrank/S1-Next,superpig11/S1-Next,floating-cat/S1-Next,ykrank/S1-Next,gy6221/S1-Next | markdown | ## Code Before:
[![GitHub version](https://badge.fury.io/gh/floating-cat%2FS1-Next.svg)](http://badge.fury.io/gh/floating-cat%2FS1-Next)
This is the Android Client for [STAGE1](http://bbs.saraba1st.com/2b/forum.php).
## License
[Apache License, Version 2.0](LICENSE.txt)
## Third-party Licenses
See [Licenses](app/src/main/assets/text/license)
## Alternatives
- [Stage1](https://play.google.com/store/apps/details?id=com.motion.stage1) – Android
- [Stage1st Go](https://play.google.com/store/apps/details?id=org.succlz123.s1go.app) – Android
- [S1 Pluto](https://itunes.apple.com/cn/app/s1-pluto/id889820003) – iOS
- [Stage1st Reader](https://itunes.apple.com/cn/app/stage1st-reader/id509916119) – iOS
- [S1 Nyan](https://www.windowsphone.com/zh-cn/store/app/s1-nyan/61790166-792c-493b-bcc2-a2f1506292f5) – WP
## Instruction:
Add Travis CI status image
## Code After:
[![GitHub version](https://badge.fury.io/gh/floating-cat%2FS1-Next.svg)](http://badge.fury.io/gh/floating-cat%2FS1-Next) [![Build Status](https://travis-ci.org/floating-cat/S1-Next.svg?branch=master)](https://travis-ci.org/floating-cat/S1-Next)
This is the Android Client for [STAGE1](http://bbs.saraba1st.com/2b/forum.php).
## License
[Apache License, Version 2.0](LICENSE.txt)
## Third-party Licenses
See [Licenses](app/src/main/assets/text/license)
## Alternatives
- [Stage1](https://play.google.com/store/apps/details?id=com.motion.stage1) – Android
- [Stage1st Go](https://play.google.com/store/apps/details?id=org.succlz123.s1go.app) – Android
- [S1 Pluto](https://itunes.apple.com/cn/app/s1-pluto/id889820003) – iOS
- [Stage1st Reader](https://itunes.apple.com/cn/app/stage1st-reader/id509916119) – iOS
- [S1 Nyan](https://www.windowsphone.com/zh-cn/store/app/s1-nyan/61790166-792c-493b-bcc2-a2f1506292f5) – WP
|
f3a3a9eba27ae55dd1ae5f3c13457b57abb3972e | .travis.yml | .travis.yml | language: node_js
sudo: false
services:
- mysql
- postgresql
node_js:
- 8.4.0
- 8.9.0
- 9.0.0
- 10.16.3
- 12.18.4
- 12.20.0
before_script:
- npm install -g mocha
- mysql -e "create database IF NOT EXISTS test;" -uroot
- psql -c 'create database test;' -U postgres
script: npm test
| language: node_js
sudo: false
services:
- mysql
- postgresql
node_js:
- 10.16.3
- 12.18.4
- 12.20.0
before_script:
- npm install -g mocha
- mysql -e "create database IF NOT EXISTS test;" -uroot
- psql -c 'create database test;' -U postgres
script: npm test
| Drop support for old node versions | Drop support for old node versions
| YAML | mit | jakubknejzlik/js-core-data | yaml | ## Code Before:
language: node_js
sudo: false
services:
- mysql
- postgresql
node_js:
- 8.4.0
- 8.9.0
- 9.0.0
- 10.16.3
- 12.18.4
- 12.20.0
before_script:
- npm install -g mocha
- mysql -e "create database IF NOT EXISTS test;" -uroot
- psql -c 'create database test;' -U postgres
script: npm test
## Instruction:
Drop support for old node versions
## Code After:
language: node_js
sudo: false
services:
- mysql
- postgresql
node_js:
- 10.16.3
- 12.18.4
- 12.20.0
before_script:
- npm install -g mocha
- mysql -e "create database IF NOT EXISTS test;" -uroot
- psql -c 'create database test;' -U postgres
script: npm test
|
72eefc9a6cba25a9191b878924acf95e4edf849f | README.md | README.md |
A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)).
## But how?
Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable.
How could you test this and ensure parity with your previous implementation, under load, with production data?
Run it in production!
```python
import laboratory
experiment = laboratory.Experiment()
with experiment.control() as c:
c.record(get_objects_from_database())
with experiment.candidate() as c:
c.record(get_objects_from_cache())
objects = experiment.run()
```
Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control
and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability.
Laboratory will always return the result of the control block.
|
A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)).
## Why?
See Github's blog post - http://githubengineering.com/scientist/
## But how?
Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable.
How could you test this and ensure parity with your previous implementation, under load, with production data?
Run it in production!
```python
import laboratory
experiment = laboratory.Experiment()
with experiment.control() as c:
c.record(get_objects_from_database())
with experiment.candidate() as c:
c.record(get_objects_from_cache())
objects = experiment.run()
```
Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control
and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability.
Laboratory will always return the result of the control block.
| Add link to Github's blog post | Add link to Github's blog post
| Markdown | mit | joealcorn/laboratory,shaunvxc/laboratory | markdown | ## Code Before:
A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)).
## But how?
Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable.
How could you test this and ensure parity with your previous implementation, under load, with production data?
Run it in production!
```python
import laboratory
experiment = laboratory.Experiment()
with experiment.control() as c:
c.record(get_objects_from_database())
with experiment.candidate() as c:
c.record(get_objects_from_cache())
objects = experiment.run()
```
Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control
and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability.
Laboratory will always return the result of the control block.
## Instruction:
Add link to Github's blog post
## Code After:
A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)).
## Why?
See Github's blog post - http://githubengineering.com/scientist/
## But how?
Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable.
How could you test this and ensure parity with your previous implementation, under load, with production data?
Run it in production!
```python
import laboratory
experiment = laboratory.Experiment()
with experiment.control() as c:
c.record(get_objects_from_database())
with experiment.candidate() as c:
c.record(get_objects_from_cache())
objects = experiment.run()
```
Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control
and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability.
Laboratory will always return the result of the control block.
|
0df3b07511f08303d03a2b7907a0c9b440591b56 | index.js | index.js | (function(global, f){
'use strict';
/*istanbul ignore next*/
if(module && typeof module.exports !== 'undefined'){
module.exports = f(
require('fluture'),
require('sanctuary-def'),
require('sanctuary-type-identifiers')
);
}else{
global.concurrify = f(
global.Fluture,
global.sanctuaryDef,
global.sanctuaryTypeIdentifiers
);
}
}(/*istanbul ignore next*/(global || window || this), function(Future, $, type){
'use strict';
// $$type :: String
var $$type = '@@type';
// FutureType :: (Type, Type) -> Type
var FutureType = $.BinaryType(
type.parse(Future[$$type]).name,
'https://github.com/fluture-js/Fluture#readme',
Future.isFuture,
Future.extractLeft,
Future.extractRight
);
// ConcurrentFutureType :: (Type, Type) -> Type
var ConcurrentFutureType = $.BinaryType(
type.parse(Future.Par[$$type]).name,
'https://github.com/fluture-js/Fluture#concurrentfuture',
function(x){ return type(x) === Future.Par[$$type] },
function(f){ return Future.seq(f).extractLeft() },
function(f){ return Future.seq(f).extractRight() }
);
return {
FutureType: FutureType,
ConcurrentFutureType: ConcurrentFutureType
};
}));
| (function(global, f){
'use strict';
/*istanbul ignore next*/
if(module && typeof module.exports !== 'undefined'){
module.exports = f(
require('fluture'),
require('sanctuary-def'),
require('sanctuary-type-identifiers')
);
}else{
global.flutureSanctuaryTypes = f(
global.Fluture,
global.sanctuaryDef,
global.sanctuaryTypeIdentifiers
);
}
}(/*istanbul ignore next*/(global || window || this), function(Future, $, type){
'use strict';
// $$type :: String
var $$type = '@@type';
// FutureType :: (Type, Type) -> Type
var FutureType = $.BinaryType(
type.parse(Future[$$type]).name,
'https://github.com/fluture-js/Fluture#readme',
Future.isFuture,
Future.extractLeft,
Future.extractRight
);
// ConcurrentFutureType :: (Type, Type) -> Type
var ConcurrentFutureType = $.BinaryType(
type.parse(Future.Par[$$type]).name,
'https://github.com/fluture-js/Fluture#concurrentfuture',
function(x){ return type(x) === Future.Par[$$type] },
function(f){ return Future.seq(f).extractLeft() },
function(f){ return Future.seq(f).extractRight() }
);
return {
FutureType: FutureType,
ConcurrentFutureType: ConcurrentFutureType
};
}));
| Correct IIFE global variable name | Correct IIFE global variable name
| JavaScript | mit | fluture-js/fluture-sanctuary-types,fluture-js/fluture-sanctuary-types | javascript | ## Code Before:
(function(global, f){
'use strict';
/*istanbul ignore next*/
if(module && typeof module.exports !== 'undefined'){
module.exports = f(
require('fluture'),
require('sanctuary-def'),
require('sanctuary-type-identifiers')
);
}else{
global.concurrify = f(
global.Fluture,
global.sanctuaryDef,
global.sanctuaryTypeIdentifiers
);
}
}(/*istanbul ignore next*/(global || window || this), function(Future, $, type){
'use strict';
// $$type :: String
var $$type = '@@type';
// FutureType :: (Type, Type) -> Type
var FutureType = $.BinaryType(
type.parse(Future[$$type]).name,
'https://github.com/fluture-js/Fluture#readme',
Future.isFuture,
Future.extractLeft,
Future.extractRight
);
// ConcurrentFutureType :: (Type, Type) -> Type
var ConcurrentFutureType = $.BinaryType(
type.parse(Future.Par[$$type]).name,
'https://github.com/fluture-js/Fluture#concurrentfuture',
function(x){ return type(x) === Future.Par[$$type] },
function(f){ return Future.seq(f).extractLeft() },
function(f){ return Future.seq(f).extractRight() }
);
return {
FutureType: FutureType,
ConcurrentFutureType: ConcurrentFutureType
};
}));
## Instruction:
Correct IIFE global variable name
## Code After:
(function(global, f){
'use strict';
/*istanbul ignore next*/
if(module && typeof module.exports !== 'undefined'){
module.exports = f(
require('fluture'),
require('sanctuary-def'),
require('sanctuary-type-identifiers')
);
}else{
global.flutureSanctuaryTypes = f(
global.Fluture,
global.sanctuaryDef,
global.sanctuaryTypeIdentifiers
);
}
}(/*istanbul ignore next*/(global || window || this), function(Future, $, type){
'use strict';
// $$type :: String
var $$type = '@@type';
// FutureType :: (Type, Type) -> Type
var FutureType = $.BinaryType(
type.parse(Future[$$type]).name,
'https://github.com/fluture-js/Fluture#readme',
Future.isFuture,
Future.extractLeft,
Future.extractRight
);
// ConcurrentFutureType :: (Type, Type) -> Type
var ConcurrentFutureType = $.BinaryType(
type.parse(Future.Par[$$type]).name,
'https://github.com/fluture-js/Fluture#concurrentfuture',
function(x){ return type(x) === Future.Par[$$type] },
function(f){ return Future.seq(f).extractLeft() },
function(f){ return Future.seq(f).extractRight() }
);
return {
FutureType: FutureType,
ConcurrentFutureType: ConcurrentFutureType
};
}));
|
3cb6b18a6ab5652568c94103c966c0e7ba324d27 | spec/digitalocean_spec.rb | spec/digitalocean_spec.rb | require 'spec_helper'
describe Digitalocean do
subject(:digitalocean) { described_class }
describe "defaults" do
before do
digitalocean.client_id = nil
digitalocean.api_key = nil
end
its(:api_endpoint) { should eq "https://api.digitalocean.com" }
its(:client_id) { should eq "client_id_required" }
its(:api_key) { should eq "api_key_required" }
it { digitalocean::VERSION.should eq "1.0.6" }
end
describe "setting values" do
let(:client_id) { "1234" }
let(:api_key) { "adf3434938492fjkdfj" }
before do
digitalocean.client_id = client_id
digitalocean.api_key = api_key
end
its(:client_id) { should eq client_id }
its(:api_key) { should eq api_key }
end
end
| require 'spec_helper'
describe Digitalocean do
subject(:digitalocean) { described_class }
before do
digitalocean.client_id = client_id
digitalocean.api_key = api_key
end
describe "defaults" do
let(:client_id) { nil }
let(:api_key) { nil}
its(:api_endpoint) { should eq "https://api.digitalocean.com" }
its(:client_id) { should eq "client_id_required" }
its(:api_key) { should eq "api_key_required" }
it { digitalocean::VERSION.should eq "1.0.6" }
end
describe "setting values" do
let(:client_id) { "1234" }
let(:api_key) { "adf3434938492fjkdfj" }
its(:client_id) { should eq client_id }
its(:api_key) { should eq api_key }
end
end
| Use the power of let. DRY. | Use the power of let. DRY.
| Ruby | mit | beni55/digitalocean,ngpestelos/digitalocean,merqlove/digitalocean_c,motdotla/digitalocean | ruby | ## Code Before:
require 'spec_helper'
describe Digitalocean do
subject(:digitalocean) { described_class }
describe "defaults" do
before do
digitalocean.client_id = nil
digitalocean.api_key = nil
end
its(:api_endpoint) { should eq "https://api.digitalocean.com" }
its(:client_id) { should eq "client_id_required" }
its(:api_key) { should eq "api_key_required" }
it { digitalocean::VERSION.should eq "1.0.6" }
end
describe "setting values" do
let(:client_id) { "1234" }
let(:api_key) { "adf3434938492fjkdfj" }
before do
digitalocean.client_id = client_id
digitalocean.api_key = api_key
end
its(:client_id) { should eq client_id }
its(:api_key) { should eq api_key }
end
end
## Instruction:
Use the power of let. DRY.
## Code After:
require 'spec_helper'
describe Digitalocean do
subject(:digitalocean) { described_class }
before do
digitalocean.client_id = client_id
digitalocean.api_key = api_key
end
describe "defaults" do
let(:client_id) { nil }
let(:api_key) { nil}
its(:api_endpoint) { should eq "https://api.digitalocean.com" }
its(:client_id) { should eq "client_id_required" }
its(:api_key) { should eq "api_key_required" }
it { digitalocean::VERSION.should eq "1.0.6" }
end
describe "setting values" do
let(:client_id) { "1234" }
let(:api_key) { "adf3434938492fjkdfj" }
its(:client_id) { should eq client_id }
its(:api_key) { should eq api_key }
end
end
|
786f0d814c80595c24b59de204eff3fd6f323591 | .github/workflows/ci.yml | .github/workflows/ci.yml | name: Run Tests
on: push
jobs:
tox:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: pip install -r CI/install/requirements.txt
- run: tox
| name: Run Tests
on: push
jobs:
tox:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: pip install -r CI/install/requirements.txt
# s6 can't be built on newer versions of Ubuntu with the version of s6 on
# PyPI, and we can't get access to the s6 name on PyPI to fix it.
#
# For now we manually built and uploaded some wheels here just to
# get CI working. The wheel is built for Ubuntu 20.04.
- run: PIP_FIND_LINKS=https://yelp-travis-artifacts.s3.amazonaws.com/pgctl/index.html tox
| Work around s6 not being buildable on Ubuntu 20.04 | Work around s6 not being buildable on Ubuntu 20.04
| YAML | mit | Yelp/pgctl,Yelp/pgctl,Yelp/pgctl | yaml | ## Code Before:
name: Run Tests
on: push
jobs:
tox:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: pip install -r CI/install/requirements.txt
- run: tox
## Instruction:
Work around s6 not being buildable on Ubuntu 20.04
## Code After:
name: Run Tests
on: push
jobs:
tox:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: pip install -r CI/install/requirements.txt
# s6 can't be built on newer versions of Ubuntu with the version of s6 on
# PyPI, and we can't get access to the s6 name on PyPI to fix it.
#
# For now we manually built and uploaded some wheels here just to
# get CI working. The wheel is built for Ubuntu 20.04.
- run: PIP_FIND_LINKS=https://yelp-travis-artifacts.s3.amazonaws.com/pgctl/index.html tox
|
c042fd454f06a8b12bf546c023c211b4da0d355d | _includes/people/via_allegra.html | _includes/people/via_allegra.html | <p id="via_allegra" data-toggle="tooltip" title="<img src='{{site.filesurl}}/people/via_allegra.jpg' alt='Allegra Via' />">
<span class="person">Allegra Via</span> is a physicist and a
scientific researcher at the National Research Council (CNR) and
Sapienza University of Rome (IT). Her main research interests
include protein structural bioinformatics, protein function
prediction and analysis, and protein interactions. She has a long
track record of training and academic teaching (Python
programming, Bioinformatics, Biochemistry) and, since 2015, she is
the ELIXIR Italy Training Coordinator. As such, she is involved
in the design, organisation and delivery of bioinformatics
training courses, Train-The-Trainer activities, and collaborations
on many training-related initiatives with other ELIXIR's nodes.
</p>
| <p id="via_allegra" data-toggle="tooltip" title="<img src='{{site.filesurl}}/people/via_allegra.jpg' alt='Allegra Via' />">
<span class="person">Allegra Via</span> is a physicist and a
scientific researcher at the National Research Council (CNR) and
Sapienza University of Rome (IT). Her main research interests
include protein structural bioinformatics, protein function
prediction and analysis, and protein interactions. She has a long
track record of training and academic teaching (Python
programming, Bioinformatics, Biochemistry) and, since 2015, she is
the ELIXIR Italy Training Coordinator. As such, she is involved
in the design, organisation and delivery of bioinformatics
training courses, Train-The-Trainer activities, and collaborations
on many training-related initiatives with other ELIXIR's nodes.
<br/>
<strong>Instructor Trainer</strong>
</p>
| Add instructor trainer Allegra Via | Add instructor trainer Allegra Via | HTML | mit | rgaiacs/swc-website,gvwilson/website,k8hertweck/website,k8hertweck/website,k8hertweck/website,ErinBecker/website,gvwilson/website,swcarpentry/website,ErinBecker/website,gvwilson/website,rgaiacs/swc-website,rgaiacs/swc-website,ErinBecker/website,rgaiacs/swc-website,swcarpentry/website,swcarpentry/website,ErinBecker/website,swcarpentry/website,k8hertweck/website,ErinBecker/website,rgaiacs/swc-website,swcarpentry/website,gvwilson/website,gvwilson/website,k8hertweck/website | html | ## Code Before:
<p id="via_allegra" data-toggle="tooltip" title="<img src='{{site.filesurl}}/people/via_allegra.jpg' alt='Allegra Via' />">
<span class="person">Allegra Via</span> is a physicist and a
scientific researcher at the National Research Council (CNR) and
Sapienza University of Rome (IT). Her main research interests
include protein structural bioinformatics, protein function
prediction and analysis, and protein interactions. She has a long
track record of training and academic teaching (Python
programming, Bioinformatics, Biochemistry) and, since 2015, she is
the ELIXIR Italy Training Coordinator. As such, she is involved
in the design, organisation and delivery of bioinformatics
training courses, Train-The-Trainer activities, and collaborations
on many training-related initiatives with other ELIXIR's nodes.
</p>
## Instruction:
Add instructor trainer Allegra Via
## Code After:
<p id="via_allegra" data-toggle="tooltip" title="<img src='{{site.filesurl}}/people/via_allegra.jpg' alt='Allegra Via' />">
<span class="person">Allegra Via</span> is a physicist and a
scientific researcher at the National Research Council (CNR) and
Sapienza University of Rome (IT). Her main research interests
include protein structural bioinformatics, protein function
prediction and analysis, and protein interactions. She has a long
track record of training and academic teaching (Python
programming, Bioinformatics, Biochemistry) and, since 2015, she is
the ELIXIR Italy Training Coordinator. As such, she is involved
in the design, organisation and delivery of bioinformatics
training courses, Train-The-Trainer activities, and collaborations
on many training-related initiatives with other ELIXIR's nodes.
<br/>
<strong>Instructor Trainer</strong>
</p>
|
1c99fb0983110732b5619d8285941257959938d1 | public/components/notification_center/index.less | public/components/notification_center/index.less | notification-center {
position: fixed;
right: 0;
width: 500px;
max-width: ~'calc(100% - 53px)';
height: 100%;
background-color: #fff;
border-left: 1px solid #6EADC1;
box-shadow: 0 5px 22px rgba(0, 0, 0, 0.25);
z-index: 100;
.kuiEventBody__message {
p:last-child {
margin: 0;
};
};
.notification-stack {
&:last-child {
padding-bottom: 0;
};
pre {
margin: 0;
};
};
};
| notification-center {
position: fixed;
right: 0;
width: 500px;
max-width: ~'calc(100% - 53px)';
height: 100%;
background-color: #fff;
border-left: 1px solid #6EADC1;
box-shadow: 0 5px 22px rgba(0, 0, 0, 0.25);
overflow-y: scroll;
z-index: 100;
.kuiEventBody__message {
p:last-child {
margin: 0;
};
};
.notification-stack {
&:last-child {
padding-bottom: 0;
};
pre {
margin: 0;
};
};
};
| Fix overflow works to scroll | Fix overflow works to scroll
| Less | mit | sw-jung/kibana_notification_center,sw-jung/kibana_notification_center | less | ## Code Before:
notification-center {
position: fixed;
right: 0;
width: 500px;
max-width: ~'calc(100% - 53px)';
height: 100%;
background-color: #fff;
border-left: 1px solid #6EADC1;
box-shadow: 0 5px 22px rgba(0, 0, 0, 0.25);
z-index: 100;
.kuiEventBody__message {
p:last-child {
margin: 0;
};
};
.notification-stack {
&:last-child {
padding-bottom: 0;
};
pre {
margin: 0;
};
};
};
## Instruction:
Fix overflow works to scroll
## Code After:
notification-center {
position: fixed;
right: 0;
width: 500px;
max-width: ~'calc(100% - 53px)';
height: 100%;
background-color: #fff;
border-left: 1px solid #6EADC1;
box-shadow: 0 5px 22px rgba(0, 0, 0, 0.25);
overflow-y: scroll;
z-index: 100;
.kuiEventBody__message {
p:last-child {
margin: 0;
};
};
.notification-stack {
&:last-child {
padding-bottom: 0;
};
pre {
margin: 0;
};
};
};
|
7ae7d98acee75625a8eaaa9074b0bc66deda76bd | main.c | main.c | //
// Created by wan on 1/2/16.
//
#include <stdio.h>
int main(void) {
printf("Input:");
int a;
scanf("%d", &a);
if (2016 % a != 0) {
printf("No way. Exit.\n");
return 0;
}
int s = 2016;
printf("2016 = ");
int flag = 0, b;
for (b = 1111; b >= 1; b /= 10) {
int t = a * b;
for (;;) {
if (s >= t) {
if (flag == 0)
flag = 1;
else
printf(" + ");
printf("%d", t);
s -= t;
}
else
break;
}
}
printf("\n");
return 0;
}
| //
// Created by Hexapetalous on 1/1/16.
//
#include <stdio.h>
int main(void) {
printf("Input[1]:");
int a;
scanf("%d", &a);
printf("Input[2]:");
int z;
scanf("%d", &z);
if (z % a != 0) {
printf("No way. Exit.\n");
return 0;
}
int s = z;
printf("%d = ", z);
int flag = 0, b;
for (b = 1; b < s; b = b * 10 + 1)
;
for (b /= 10; b >= 1; b /= 10) {
int t = a * b;
for (; s >= t;) {
if (flag == 0)
flag = 1;
else
printf(" + ");
printf("%d", t);
s -= t;
}
}
printf("\n");
return 0;
}
| Support to division every number. | Support to division every number.
| C | mit | hxptls/P0000,hxptls/P0000 | c | ## Code Before:
//
// Created by wan on 1/2/16.
//
#include <stdio.h>
int main(void) {
printf("Input:");
int a;
scanf("%d", &a);
if (2016 % a != 0) {
printf("No way. Exit.\n");
return 0;
}
int s = 2016;
printf("2016 = ");
int flag = 0, b;
for (b = 1111; b >= 1; b /= 10) {
int t = a * b;
for (;;) {
if (s >= t) {
if (flag == 0)
flag = 1;
else
printf(" + ");
printf("%d", t);
s -= t;
}
else
break;
}
}
printf("\n");
return 0;
}
## Instruction:
Support to division every number.
## Code After:
//
// Created by Hexapetalous on 1/1/16.
//
#include <stdio.h>
int main(void) {
printf("Input[1]:");
int a;
scanf("%d", &a);
printf("Input[2]:");
int z;
scanf("%d", &z);
if (z % a != 0) {
printf("No way. Exit.\n");
return 0;
}
int s = z;
printf("%d = ", z);
int flag = 0, b;
for (b = 1; b < s; b = b * 10 + 1)
;
for (b /= 10; b >= 1; b /= 10) {
int t = a * b;
for (; s >= t;) {
if (flag == 0)
flag = 1;
else
printf(" + ");
printf("%d", t);
s -= t;
}
}
printf("\n");
return 0;
}
|
3e777a7e15d99a63c8c8479f5d33d51582920e78 | myuw/templates/handlebars/card/registration/est_reg_date.html | myuw/templates/handlebars/card/registration/est_reg_date.html | {% load templatetag_handlebars %}
{% tplhandlebars "notice_est_reg_date_tmpl" %}
<div class="card-badge-container est-reg-date-panel">
<div class="card-badge est-reg-date-container clearfix">
<div class="est-reg-date" aria-labelledby="est_reg_date">
{{ #each est_reg_date }}
<span class="sr-only est_reg_date">Estimated Registration Date:
{{{ toFriendlyDateVerbose date }}}</span>
<div class="pull-left" style="display:inline-block;">
<h4 class="card-badge-label">Est. Registration Date
<!-- <br /><span class="" style="font-size:75%; font-weight:normal; font-style:italic;">(Estimated)</span>-->
</h4>
</div>
<div class="pull-right">
<div class="card-badge-value">{{{ toFriendlyDate date }}}<br/><span class="est-reg-time">at 6:00 AM</span></div>
</div>
{{ /each }}
</div>
</div>
</div>
{% endtplhandlebars %}
| {% load templatetag_handlebars %}
{% tplhandlebars "notice_est_reg_date_tmpl" %}
<div class="card-badge-container">
<div class="card-badge est-reg-date-container clearfix">
<div class="est-reg-date" aria-labelledby="est_reg_date">
{{ #each est_reg_date }}
<span class="sr-only est_reg_date">Estimated Registration Date:
{{{ toFriendlyDateVerbose date }}}</span>
<div class="pull-left" style="display:inline-block;">
<h4 class="card-badge-label">Est. Registration Date
<!-- <br /><span class="" style="font-size:75%; font-weight:normal; font-style:italic;">(Estimated)</span>-->
</h4>
</div>
<div class="pull-right">
<div class="card-badge-value">{{{ toFriendlyDate date }}}<br/><span class="est-reg-time">at 6:00 AM</span></div>
</div>
{{ /each }}
</div>
</div>
</div>
{% endtplhandlebars %}
| Remove the un-exist est-reg-date-panel class. | Remove the un-exist est-reg-date-panel class.
| HTML | apache-2.0 | uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw | html | ## Code Before:
{% load templatetag_handlebars %}
{% tplhandlebars "notice_est_reg_date_tmpl" %}
<div class="card-badge-container est-reg-date-panel">
<div class="card-badge est-reg-date-container clearfix">
<div class="est-reg-date" aria-labelledby="est_reg_date">
{{ #each est_reg_date }}
<span class="sr-only est_reg_date">Estimated Registration Date:
{{{ toFriendlyDateVerbose date }}}</span>
<div class="pull-left" style="display:inline-block;">
<h4 class="card-badge-label">Est. Registration Date
<!-- <br /><span class="" style="font-size:75%; font-weight:normal; font-style:italic;">(Estimated)</span>-->
</h4>
</div>
<div class="pull-right">
<div class="card-badge-value">{{{ toFriendlyDate date }}}<br/><span class="est-reg-time">at 6:00 AM</span></div>
</div>
{{ /each }}
</div>
</div>
</div>
{% endtplhandlebars %}
## Instruction:
Remove the un-exist est-reg-date-panel class.
## Code After:
{% load templatetag_handlebars %}
{% tplhandlebars "notice_est_reg_date_tmpl" %}
<div class="card-badge-container">
<div class="card-badge est-reg-date-container clearfix">
<div class="est-reg-date" aria-labelledby="est_reg_date">
{{ #each est_reg_date }}
<span class="sr-only est_reg_date">Estimated Registration Date:
{{{ toFriendlyDateVerbose date }}}</span>
<div class="pull-left" style="display:inline-block;">
<h4 class="card-badge-label">Est. Registration Date
<!-- <br /><span class="" style="font-size:75%; font-weight:normal; font-style:italic;">(Estimated)</span>-->
</h4>
</div>
<div class="pull-right">
<div class="card-badge-value">{{{ toFriendlyDate date }}}<br/><span class="est-reg-time">at 6:00 AM</span></div>
</div>
{{ /each }}
</div>
</div>
</div>
{% endtplhandlebars %}
|
84bada1b92e18dad8499964ddf8a4f8120a9cc9e | vsut/case.py | vsut/case.py | class TestCase:
def assertEqual(value, expected):
if value != expected:
raise CaseFailed("{0} != {1}")
def assertTrue(value):
assertEqual(value, True)
def assertFalse(value):
assertEqual(value, False)
class CaseFailed(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return message
| class TestCase:
def assertEqual(self, value, expected):
if value != expected:
raise CaseFailed("{0} != {1}".format(value, expected))
def assertTrue(self, value):
assertEqual(value, True)
def assertFalse(self, value):
assertEqual(value, False)
class CaseFailed(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
| Fix missing self in class methods and wrong formatting | Fix missing self in class methods and wrong formatting
| Python | mit | zillolo/vsut-python | python | ## Code Before:
class TestCase:
def assertEqual(value, expected):
if value != expected:
raise CaseFailed("{0} != {1}")
def assertTrue(value):
assertEqual(value, True)
def assertFalse(value):
assertEqual(value, False)
class CaseFailed(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return message
## Instruction:
Fix missing self in class methods and wrong formatting
## Code After:
class TestCase:
def assertEqual(self, value, expected):
if value != expected:
raise CaseFailed("{0} != {1}".format(value, expected))
def assertTrue(self, value):
assertEqual(value, True)
def assertFalse(self, value):
assertEqual(value, False)
class CaseFailed(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
|
f25f08625d369d7737516971256140af26015235 | astropy/timeseries/io/__init__.py | astropy/timeseries/io/__init__.py |
from . import kepler
|
from .kepler import *
| Make sure I/O functions appear in API docs | Make sure I/O functions appear in API docs
| Python | bsd-3-clause | bsipocz/astropy,dhomeier/astropy,StuartLittlefair/astropy,MSeifert04/astropy,bsipocz/astropy,mhvk/astropy,dhomeier/astropy,stargaser/astropy,lpsinger/astropy,pllim/astropy,lpsinger/astropy,StuartLittlefair/astropy,mhvk/astropy,stargaser/astropy,MSeifert04/astropy,MSeifert04/astropy,larrybradley/astropy,dhomeier/astropy,saimn/astropy,saimn/astropy,saimn/astropy,astropy/astropy,bsipocz/astropy,StuartLittlefair/astropy,bsipocz/astropy,larrybradley/astropy,lpsinger/astropy,saimn/astropy,dhomeier/astropy,dhomeier/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,stargaser/astropy,mhvk/astropy,lpsinger/astropy,larrybradley/astropy,larrybradley/astropy,lpsinger/astropy,pllim/astropy,mhvk/astropy,astropy/astropy,astropy/astropy,astropy/astropy,StuartLittlefair/astropy,saimn/astropy,astropy/astropy,MSeifert04/astropy,stargaser/astropy,larrybradley/astropy,aleksandr-bakanov/astropy,pllim/astropy,pllim/astropy,aleksandr-bakanov/astropy,pllim/astropy,aleksandr-bakanov/astropy,mhvk/astropy | python | ## Code Before:
from . import kepler
## Instruction:
Make sure I/O functions appear in API docs
## Code After:
from .kepler import *
|
2da1c3f258dfe2d8eac26cc82390b9f4f4c1265b | frontends/default/views/_form_association_header.rhtml | frontends/default/views/_form_association_header.rhtml | <thead>
<tr>
<%
active_scaffold_config_for(@record.class).subform.columns.each :for => @record, :flatten => true do |column|
next unless in_subform?(column, parent_record)
-%>
<th><%= column.label %></th>
<% end -%>
</tr>
</thead> | <thead>
<tr>
<%
active_scaffold_config_for(@record.class).subform.columns.each :for => @record, :flatten => true do |column|
next unless in_subform?(column, parent_record) and column_renders_as(column) != :hidden
-%>
<th><%= column.label %></th>
<% end -%>
</tr>
</thead> | Hide hidden column header labels - like lock_version - in sub-forms. | Hide hidden column header labels - like lock_version - in sub-forms. | RHTML | mit | PiRSquared17/activescaffold,PiRSquared17/activescaffold,PiRSquared17/activescaffold | rhtml | ## Code Before:
<thead>
<tr>
<%
active_scaffold_config_for(@record.class).subform.columns.each :for => @record, :flatten => true do |column|
next unless in_subform?(column, parent_record)
-%>
<th><%= column.label %></th>
<% end -%>
</tr>
</thead>
## Instruction:
Hide hidden column header labels - like lock_version - in sub-forms.
## Code After:
<thead>
<tr>
<%
active_scaffold_config_for(@record.class).subform.columns.each :for => @record, :flatten => true do |column|
next unless in_subform?(column, parent_record) and column_renders_as(column) != :hidden
-%>
<th><%= column.label %></th>
<% end -%>
</tr>
</thead> |
9a1d3573bf741b605ced294a51a9f54207b07dea | lib/custom/pdftk.rb | lib/custom/pdftk.rb | class Pdftk < BaseCustom
def path
"#{build_path}/vendor/#{name}"
end
def name
"pdftk"
end
def source_url
"http://s3.amazonaws.com/source_url_here"
end
def used?
File.exist?("#{build_path}/bin/pdftk") && File.exist?("#{build_path}/bin/lib/libgcj.so.12")
end
def compile
write_stdout "compiling #{name}"
#download the source and extract
%x{ mkdir -p #{path} && curl --silent #{source_url} -o - | tar -xz -C #{path} -f - }
write_stdout "complete compiling #{name}"
end
def cleanup!
end
def prepare
File.delete("#{build_path}/bin/lib/libgcj.so.12") if File.exist?("#{build_path}/bin/libgcj.so.12")
File.delete("#{build_path}/bin/pdftk") if File.exist?("#{build_path}/bin/pdftk")
end
end | class Pdftk < BaseCustom
def path
"#{build_path}/vendor/#{name}"
end
def name
"pdftk"
end
def source_url
"https://s3-eu-west-1.amazonaws.com/opg-lpa-test/pdftk.tar.gz"
end
def used?
File.exist?("#{build_path}/bin/pdftk") && File.exist?("#{build_path}/bin/lib/libgcj.so.12")
end
def compile
write_stdout "compiling #{name}"
#download the source and extract
%x{ mkdir -p #{path} && curl --silent #{source_url} -o - | tar -xz -C #{path} -f - }
write_stdout "complete compiling #{name}"
end
def cleanup!
end
def prepare
File.delete("#{build_path}/bin/lib/libgcj.so.12") if File.exist?("#{build_path}/bin/libgcj.so.12")
File.delete("#{build_path}/bin/pdftk") if File.exist?("#{build_path}/bin/pdftk")
end
end
| Add pdtkf source S3 url | Add pdtkf source S3 url
| Ruby | mit | hrishimittal/heroku-buildpack-ruby-pdftk,hrishimittal/heroku-buildpack-ruby-pdftk,hrishimittal/heroku-buildpack-ruby-pdftk | ruby | ## Code Before:
class Pdftk < BaseCustom
def path
"#{build_path}/vendor/#{name}"
end
def name
"pdftk"
end
def source_url
"http://s3.amazonaws.com/source_url_here"
end
def used?
File.exist?("#{build_path}/bin/pdftk") && File.exist?("#{build_path}/bin/lib/libgcj.so.12")
end
def compile
write_stdout "compiling #{name}"
#download the source and extract
%x{ mkdir -p #{path} && curl --silent #{source_url} -o - | tar -xz -C #{path} -f - }
write_stdout "complete compiling #{name}"
end
def cleanup!
end
def prepare
File.delete("#{build_path}/bin/lib/libgcj.so.12") if File.exist?("#{build_path}/bin/libgcj.so.12")
File.delete("#{build_path}/bin/pdftk") if File.exist?("#{build_path}/bin/pdftk")
end
end
## Instruction:
Add pdtkf source S3 url
## Code After:
class Pdftk < BaseCustom
def path
"#{build_path}/vendor/#{name}"
end
def name
"pdftk"
end
def source_url
"https://s3-eu-west-1.amazonaws.com/opg-lpa-test/pdftk.tar.gz"
end
def used?
File.exist?("#{build_path}/bin/pdftk") && File.exist?("#{build_path}/bin/lib/libgcj.so.12")
end
def compile
write_stdout "compiling #{name}"
#download the source and extract
%x{ mkdir -p #{path} && curl --silent #{source_url} -o - | tar -xz -C #{path} -f - }
write_stdout "complete compiling #{name}"
end
def cleanup!
end
def prepare
File.delete("#{build_path}/bin/lib/libgcj.so.12") if File.exist?("#{build_path}/bin/libgcj.so.12")
File.delete("#{build_path}/bin/pdftk") if File.exist?("#{build_path}/bin/pdftk")
end
end
|
22c37029e9fcc9ed724314f2f9308e8e29f227ca | package/dataset-KITTI-full/.cm/meta.json | package/dataset-KITTI-full/.cm/meta.json | {
"check_exit_status": "yes",
"customize": {
"extra_dir": "",
"no_os_in_suggested_path": "yes",
"no_ver_in_suggested_path": "yes",
"force_ask_path":"yes",
"install_env": {
"IMAGE_DIR": "image_2",
"LABELS_DIR": "labels_2",
"KITTI_IMAGES_ARCHIVE": "data_object_image_2.zip",
"KITTI_LABELS_ARCHIVE": "data_object_label_2.zip",
"KITTI_IMAGES_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_image_2.zip",
"KITTI_LABELS_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_label_2.zip"
},
"version": "2012"
},
"deps": {},
"need_cpu_info": "no",
"end_full_path": {
"linux": "training/image_2/000000.png",
"win": "training/image_2/000000.png"
},
"process_script": "install",
"soft_uoa": "dd47415baf24025e",
"suggested_path": "KITTI-full",
"tags": [
"dataset",
"kitti",
"KITTI",
"val",
"KITTIfull"
]
}
| {
"check_exit_status": "yes",
"customize": {
"extra_dir": "",
"no_os_in_suggested_path": "yes",
"no_ver_in_suggested_path": "yes",
"force_ask_path":"yes",
"install_env": {
"IMAGE_DIR": "training/image_2",
"LABELS_DIR": "training/label_2",
"KITTI_IMAGES_ARCHIVE": "data_object_image_2.zip",
"KITTI_LABELS_ARCHIVE": "data_object_label_2.zip",
"KITTI_IMAGES_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_image_2.zip",
"KITTI_LABELS_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_label_2.zip"
},
"version": "2012"
},
"deps": {},
"need_cpu_info": "no",
"end_full_path": {
"linux": "training/image_2/000000.png",
"win": "training/image_2/000000.png"
},
"process_script": "install",
"soft_uoa": "dd47415baf24025e",
"suggested_path": "KITTI-full",
"tags": [
"dataset",
"kitti",
"KITTI",
"val",
"KITTIfull"
]
}
| Fix dirs for KITTIfull package | Fix dirs for KITTIfull package
| JSON | bsd-3-clause | dsavenko/ck-tensorflow,dsavenko/ck-tensorflow,dsavenko/ck-tensorflow | json | ## Code Before:
{
"check_exit_status": "yes",
"customize": {
"extra_dir": "",
"no_os_in_suggested_path": "yes",
"no_ver_in_suggested_path": "yes",
"force_ask_path":"yes",
"install_env": {
"IMAGE_DIR": "image_2",
"LABELS_DIR": "labels_2",
"KITTI_IMAGES_ARCHIVE": "data_object_image_2.zip",
"KITTI_LABELS_ARCHIVE": "data_object_label_2.zip",
"KITTI_IMAGES_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_image_2.zip",
"KITTI_LABELS_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_label_2.zip"
},
"version": "2012"
},
"deps": {},
"need_cpu_info": "no",
"end_full_path": {
"linux": "training/image_2/000000.png",
"win": "training/image_2/000000.png"
},
"process_script": "install",
"soft_uoa": "dd47415baf24025e",
"suggested_path": "KITTI-full",
"tags": [
"dataset",
"kitti",
"KITTI",
"val",
"KITTIfull"
]
}
## Instruction:
Fix dirs for KITTIfull package
## Code After:
{
"check_exit_status": "yes",
"customize": {
"extra_dir": "",
"no_os_in_suggested_path": "yes",
"no_ver_in_suggested_path": "yes",
"force_ask_path":"yes",
"install_env": {
"IMAGE_DIR": "training/image_2",
"LABELS_DIR": "training/label_2",
"KITTI_IMAGES_ARCHIVE": "data_object_image_2.zip",
"KITTI_LABELS_ARCHIVE": "data_object_label_2.zip",
"KITTI_IMAGES_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_image_2.zip",
"KITTI_LABELS_URL":"http://kitti.is.tue.mpg.de/kitti/data_object_label_2.zip"
},
"version": "2012"
},
"deps": {},
"need_cpu_info": "no",
"end_full_path": {
"linux": "training/image_2/000000.png",
"win": "training/image_2/000000.png"
},
"process_script": "install",
"soft_uoa": "dd47415baf24025e",
"suggested_path": "KITTI-full",
"tags": [
"dataset",
"kitti",
"KITTI",
"val",
"KITTIfull"
]
}
|
eb1be60cf68580135e06a641251f1770a26e4247 | javascripts/concat/frontpage.js | javascripts/concat/frontpage.js | // $('.owl-carousel').owlCarousel({
// items:1,
// lazyLoad:true,
// loop:true,
// margin:0
// });
$(document).ready(function(){
$('.frontpage-slider').slick({
// Find options here: http://kenwheeler.github.io/slick/
});
});
| // $('.owl-carousel').owlCarousel({
// items:1,
// lazyLoad:true,
// loop:true,
// margin:0
// });
$(document).ready(function(){
$('.frontpage-slider').slick({
// Find options here: http://kenwheeler.github.io/slick/
});
});
// Remove all empty <p> tags
$(document).ready(function(){
$('p').each(function() {
var $this = $(this);
if($this.html().replace(/\s| /g, '').length == 0)
$this.remove();
});
});
| Add js to remove all empty paragraph tags | Add js to remove all empty paragraph tags
| JavaScript | mit | Jursdotme/secondthought,Jursdotme/secondthought,Jursdotme/secondthought | javascript | ## Code Before:
// $('.owl-carousel').owlCarousel({
// items:1,
// lazyLoad:true,
// loop:true,
// margin:0
// });
$(document).ready(function(){
$('.frontpage-slider').slick({
// Find options here: http://kenwheeler.github.io/slick/
});
});
## Instruction:
Add js to remove all empty paragraph tags
## Code After:
// $('.owl-carousel').owlCarousel({
// items:1,
// lazyLoad:true,
// loop:true,
// margin:0
// });
$(document).ready(function(){
$('.frontpage-slider').slick({
// Find options here: http://kenwheeler.github.io/slick/
});
});
// Remove all empty <p> tags
$(document).ready(function(){
$('p').each(function() {
var $this = $(this);
if($this.html().replace(/\s| /g, '').length == 0)
$this.remove();
});
});
|
4abdd29e519a830747372c09a07d21898e222b48 | .travis.yml | .travis.yml | ---
language: c
compiler:
- clang
- gcc
matrix:
include:
- os: linux
dist: trusty
sudo: false
- os: osx
osx_image: xcode8.2
addons:
apt:
packages:
- python-docutils
- nghttp2
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docutils; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install nghttp2 ; fi
- ./autogen.sh
- ./configure
script: make -j3 check VERBOSE=1
| ---
language: c
compiler:
- clang
- gcc
os:
- linux
- osx
matrix:
include:
- os: linux
dist: trusty
sudo: false
- os: osx
osx_image: xcode8.2
addons:
apt:
packages:
- python-docutils
- nghttp2
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docutils; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install nghttp2 ; fi
- ./autogen.sh
- ./configure
script: make -j3 check VERBOSE=1
| Add these back - they are needed | Add these back - they are needed
| YAML | bsd-2-clause | feld/Varnish-Cache,feld/Varnish-Cache,gquintard/Varnish-Cache,feld/Varnish-Cache,feld/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache,feld/Varnish-Cache | yaml | ## Code Before:
---
language: c
compiler:
- clang
- gcc
matrix:
include:
- os: linux
dist: trusty
sudo: false
- os: osx
osx_image: xcode8.2
addons:
apt:
packages:
- python-docutils
- nghttp2
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docutils; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install nghttp2 ; fi
- ./autogen.sh
- ./configure
script: make -j3 check VERBOSE=1
## Instruction:
Add these back - they are needed
## Code After:
---
language: c
compiler:
- clang
- gcc
os:
- linux
- osx
matrix:
include:
- os: linux
dist: trusty
sudo: false
- os: osx
osx_image: xcode8.2
addons:
apt:
packages:
- python-docutils
- nghttp2
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install docutils; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install nghttp2 ; fi
- ./autogen.sh
- ./configure
script: make -j3 check VERBOSE=1
|
cda43e404fc775355becb7a7899f0e2c19b12db9 | files/pak/index.md | files/pak/index.md | ---
title: PAK Files
subtitle: Eyedentity Package Files (.pak)
layout: default
permalink: /files/pak/
repolink: /blob/gh-pages/files/pak/index.md
---
### Purpose
PAK files are the primary container format for Dragon Nest, containing almost all of the asset files for the game.
### Examples
Resource00.pak through Resource13.pak in the Dragon Nest installation directory.
### General Format Overview
The PAK file structure consists of a header, containing the number of subfiles and the location of the index table; subfile data blocks, containing the compressed subfile data; and the index. The index may be located anywhere in the file after the header, but is usually the last section in the file.
### Pak Format
#### Header
{% include table.html data=site.data.pak.header %}
#### File Index Table
{% include table.html data=site.data.pak.fileindextable %}
#### File Index Table Entry
{% include table.html data=site.data.pak.fileindexentry %}
| ---
title: PAK Files
subtitle: Eyedentity Package Files (.pak)
layout: default
permalink: /files/pak/
repolink: /blob/gh-pages/files/pak/index.md
---
### Purpose
PAK files are the primary container format for Dragon Nest, containing almost all of the asset files for the game.
### Examples
Resource00.pak through Resource13.pak in the Dragon Nest installation directory.
### General Format Overview
The PAK file structure consists of a header, containing the number of subfiles and the location of the index table; subfile data blocks, containing the compressed subfile data; and the index. The index may be located anywhere in the file after the header, but is usually the last section in the file.
### Pak Format
#### Header
{% include table.html data=site.data.pak.header %}
#### File Index Table
{% include table.html data=site.data.pak.fileindextable %}
#### File Index Table Entry
{% include table.html data=site.data.pak.fileindexentry %}
#### File Data
File data is compressed using [DEFLATE](https://en.wikipedia.org/wiki/DEFLATE).
| Add section on file data compression | Add section on file data compression
| Markdown | mit | vincentzhang96/DragonNestFileFormats,vincentzhang96/DragonNestFileFormats | markdown | ## Code Before:
---
title: PAK Files
subtitle: Eyedentity Package Files (.pak)
layout: default
permalink: /files/pak/
repolink: /blob/gh-pages/files/pak/index.md
---
### Purpose
PAK files are the primary container format for Dragon Nest, containing almost all of the asset files for the game.
### Examples
Resource00.pak through Resource13.pak in the Dragon Nest installation directory.
### General Format Overview
The PAK file structure consists of a header, containing the number of subfiles and the location of the index table; subfile data blocks, containing the compressed subfile data; and the index. The index may be located anywhere in the file after the header, but is usually the last section in the file.
### Pak Format
#### Header
{% include table.html data=site.data.pak.header %}
#### File Index Table
{% include table.html data=site.data.pak.fileindextable %}
#### File Index Table Entry
{% include table.html data=site.data.pak.fileindexentry %}
## Instruction:
Add section on file data compression
## Code After:
---
title: PAK Files
subtitle: Eyedentity Package Files (.pak)
layout: default
permalink: /files/pak/
repolink: /blob/gh-pages/files/pak/index.md
---
### Purpose
PAK files are the primary container format for Dragon Nest, containing almost all of the asset files for the game.
### Examples
Resource00.pak through Resource13.pak in the Dragon Nest installation directory.
### General Format Overview
The PAK file structure consists of a header, containing the number of subfiles and the location of the index table; subfile data blocks, containing the compressed subfile data; and the index. The index may be located anywhere in the file after the header, but is usually the last section in the file.
### Pak Format
#### Header
{% include table.html data=site.data.pak.header %}
#### File Index Table
{% include table.html data=site.data.pak.fileindextable %}
#### File Index Table Entry
{% include table.html data=site.data.pak.fileindexentry %}
#### File Data
File data is compressed using [DEFLATE](https://en.wikipedia.org/wiki/DEFLATE).
|
e1b05228ba15e6350ca41eedb836ca2c8ece5917 | app/models/social/instagram_hashtag.rb | app/models/social/instagram_hashtag.rb | module Social
class InstagramHashtag < ActiveRecord::Base
attr_accessible :hashtag
has_many :photos,
:dependent => :destroy,
:class_name => "Social::InstagramPhoto"
validates :hashtag,
:presence => true,
:uniqueness => true
after_save :update_photos
def update_photos
InstagramPhoto.get_hashtag_photos(self)
end
def self.refresh_hashtag_photos
InstagramHashtag.all.each do |instagram_hashtag|
InstagramPhoto.get_hashtag_photos(instagram_hashtag)
end
end
end
end
| module Social
class InstagramHashtag < ActiveRecord::Base
attr_accessible :hashtag
has_many :photos,
:dependent => :destroy,
:class_name => "Social::InstagramPhoto"
validates :hashtag,
:presence => true,
:uniqueness => true
after_save :update_photos
def update_photos
InstagramPhoto.get_hashtag_photos(self)
end
def self.refresh_hashtag_photos
InstagramHashtag.all.each do |instagram_hashtag|
InstagramPhoto.get_hashtag_photos(instagram_hashtag)
end
end
def to_s
self.hashtag
end
end
end
| Add to_s method for printing the name of the hashtag | Add to_s method for printing the name of the hashtag
| Ruby | mit | madetech/made-social-engine,madetech/made-social-engine,madetech/made-social-engine | ruby | ## Code Before:
module Social
class InstagramHashtag < ActiveRecord::Base
attr_accessible :hashtag
has_many :photos,
:dependent => :destroy,
:class_name => "Social::InstagramPhoto"
validates :hashtag,
:presence => true,
:uniqueness => true
after_save :update_photos
def update_photos
InstagramPhoto.get_hashtag_photos(self)
end
def self.refresh_hashtag_photos
InstagramHashtag.all.each do |instagram_hashtag|
InstagramPhoto.get_hashtag_photos(instagram_hashtag)
end
end
end
end
## Instruction:
Add to_s method for printing the name of the hashtag
## Code After:
module Social
class InstagramHashtag < ActiveRecord::Base
attr_accessible :hashtag
has_many :photos,
:dependent => :destroy,
:class_name => "Social::InstagramPhoto"
validates :hashtag,
:presence => true,
:uniqueness => true
after_save :update_photos
def update_photos
InstagramPhoto.get_hashtag_photos(self)
end
def self.refresh_hashtag_photos
InstagramHashtag.all.each do |instagram_hashtag|
InstagramPhoto.get_hashtag_photos(instagram_hashtag)
end
end
def to_s
self.hashtag
end
end
end
|
a5fa87d1dac36ae8a1e0939aaf7835aa39d5c153 | jsonapi.py | jsonapi.py | from flask import Blueprint
# Set up api Blueprint
api = Blueprint('api', __name__)
# API Post Route
@api.route('/create', methods=['GET', 'POST'])
def api_create():
return "Create JSON Blueprint!"
| from flask import Blueprint, jsonify, request
import MySQLdb, dbc
# Set up api Blueprint
api = Blueprint('api', __name__)
# API Post Route
@api.route('/create', methods=['GET', 'POST'])
def api_create():
# Get URL and password from POST Request
URL = request.form.get('url')
password = request.form.get('password')
custom = request.form.get('custom')
# Check if custom alias is set, if not, generate one
if custom == '':
alias = gen_rand_alias(10)
else:
alias = custom
# If password is incorrect, Rick Roll
if password not in dbc.passwords or password is None:
return jsonify(error="Password was not recognized.")
# Create database connection
db = MySQLdb.connect(host=dbc.server, user=dbc.user, passwd=dbc.passwd, db=dbc.db)
cursor = db.cursor()
# Insert Redirect URL and Alias into database
cursor.execute("INSERT INTO " + dbc.urltbl + " (url, alias) VALUES (\'" + URL + "\', \'" + alias + "\');")
# Commit to database and close connections
db.commit()
cursor.close()
db.close()
return jsonify(url="http://frst.xyz/" + alias)
| Add jsonify to api returns | Add jsonify to api returns | Python | apache-2.0 | kylefrost/frst.xyz,kylefrost/frst.xyz | python | ## Code Before:
from flask import Blueprint
# Set up api Blueprint
api = Blueprint('api', __name__)
# API Post Route
@api.route('/create', methods=['GET', 'POST'])
def api_create():
return "Create JSON Blueprint!"
## Instruction:
Add jsonify to api returns
## Code After:
from flask import Blueprint, jsonify, request
import MySQLdb, dbc
# Set up api Blueprint
api = Blueprint('api', __name__)
# API Post Route
@api.route('/create', methods=['GET', 'POST'])
def api_create():
# Get URL and password from POST Request
URL = request.form.get('url')
password = request.form.get('password')
custom = request.form.get('custom')
# Check if custom alias is set, if not, generate one
if custom == '':
alias = gen_rand_alias(10)
else:
alias = custom
# If password is incorrect, Rick Roll
if password not in dbc.passwords or password is None:
return jsonify(error="Password was not recognized.")
# Create database connection
db = MySQLdb.connect(host=dbc.server, user=dbc.user, passwd=dbc.passwd, db=dbc.db)
cursor = db.cursor()
# Insert Redirect URL and Alias into database
cursor.execute("INSERT INTO " + dbc.urltbl + " (url, alias) VALUES (\'" + URL + "\', \'" + alias + "\');")
# Commit to database and close connections
db.commit()
cursor.close()
db.close()
return jsonify(url="http://frst.xyz/" + alias)
|
f951126b7b80240fa6aa64cad959bc5763f618d2 | client/src/app/features/last-post/last-post.component.html | client/src/app/features/last-post/last-post.component.html | <div fxLayout="row" fxLayoutAlign="center" *ngIf="!lastPost.responseCode">
<div fxFlex="60">
<mat-card>
<mat-card-content class="progress">
<mat-progress-bar color="primary" mode="indeterminate" value="50" bufferValue="75"></mat-progress-bar>
</mat-card-content>
</mat-card>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="center" *ngIf="lastPost.responseCode">
<div fxFlex="60">
<mat-card class="card">
<mat-card-header>
<mat-card-title *ngIf="lastPost.responseCode.includes('200')">
date: {{ lastPost.date | date: 'shortDate' }} | likes: {{ lastPost.likes }}
</mat-card-title>
<mat-card-title *ngIf="!lastPost.responseCode.includes('200')">
Please try again later. There are currently some errors.<br />
Response code: {{ lastPost.responseCode }}.
</mat-card-title>
</mat-card-header>
<img *ngIf="lastPost.responseCode.includes('200')" mat-card-image src="{{lastPost.picture}}">
</mat-card>
</div>
</div>
| <div fxLayout="row" fxLayoutAlign="center">
<div fxFlex="60">
<mat-card *ngIf="!lastPost.responseCode">
<mat-card-content class="progress">
<mat-progress-bar color="primary" mode="indeterminate" value="50" bufferValue="75"></mat-progress-bar>
</mat-card-content>
</mat-card>
<mat-card *ngIf="lastPost.responseCode">
<mat-card-header>
<mat-card-title *ngIf="lastPost.responseCode.includes('200')">
date: {{ lastPost.date | date: 'shortDate' }} | likes: {{ lastPost.likes }}
</mat-card-title>
<mat-card-title *ngIf="!lastPost.responseCode.includes('200')">
Please try again later. There are currently some errors.<br />
Response code: {{ lastPost.responseCode }}.
</mat-card-title>
</mat-card-header>
<img *ngIf="lastPost.responseCode.includes('200')" mat-card-image src="{{lastPost.picture}}">
</mat-card>
</div>
</div>
| Check responseCode in mat-card not in div | Check responseCode in mat-card not in div
| HTML | mit | inpercima/publicmedia,inpercima/publicmedia,inpercima/publicmedia,inpercima/publicmedia | html | ## Code Before:
<div fxLayout="row" fxLayoutAlign="center" *ngIf="!lastPost.responseCode">
<div fxFlex="60">
<mat-card>
<mat-card-content class="progress">
<mat-progress-bar color="primary" mode="indeterminate" value="50" bufferValue="75"></mat-progress-bar>
</mat-card-content>
</mat-card>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="center" *ngIf="lastPost.responseCode">
<div fxFlex="60">
<mat-card class="card">
<mat-card-header>
<mat-card-title *ngIf="lastPost.responseCode.includes('200')">
date: {{ lastPost.date | date: 'shortDate' }} | likes: {{ lastPost.likes }}
</mat-card-title>
<mat-card-title *ngIf="!lastPost.responseCode.includes('200')">
Please try again later. There are currently some errors.<br />
Response code: {{ lastPost.responseCode }}.
</mat-card-title>
</mat-card-header>
<img *ngIf="lastPost.responseCode.includes('200')" mat-card-image src="{{lastPost.picture}}">
</mat-card>
</div>
</div>
## Instruction:
Check responseCode in mat-card not in div
## Code After:
<div fxLayout="row" fxLayoutAlign="center">
<div fxFlex="60">
<mat-card *ngIf="!lastPost.responseCode">
<mat-card-content class="progress">
<mat-progress-bar color="primary" mode="indeterminate" value="50" bufferValue="75"></mat-progress-bar>
</mat-card-content>
</mat-card>
<mat-card *ngIf="lastPost.responseCode">
<mat-card-header>
<mat-card-title *ngIf="lastPost.responseCode.includes('200')">
date: {{ lastPost.date | date: 'shortDate' }} | likes: {{ lastPost.likes }}
</mat-card-title>
<mat-card-title *ngIf="!lastPost.responseCode.includes('200')">
Please try again later. There are currently some errors.<br />
Response code: {{ lastPost.responseCode }}.
</mat-card-title>
</mat-card-header>
<img *ngIf="lastPost.responseCode.includes('200')" mat-card-image src="{{lastPost.picture}}">
</mat-card>
</div>
</div>
|
9a70f30cce7bdf4ab84c9cddecc05e5a92c24e6d | README.md | README.md | EhannWebServiceBundle
=====================
This bundle provides a way to automatically serialize and deserialize request parameters.
| EhannWebServiceBundle
=====================
[![Build Status](https://travis-ci.org/ethanhann/EhannWebServiceBundle.svg?branch=master)](https://travis-ci.org/ethanhann/EhannWebServiceBundle)
This bundle provides a way to automatically serialize and deserialize request parameters.
| Add Travis build status indicator | Add Travis build status indicator
| Markdown | mit | ethanhann/EhannWebServiceBundle | markdown | ## Code Before:
EhannWebServiceBundle
=====================
This bundle provides a way to automatically serialize and deserialize request parameters.
## Instruction:
Add Travis build status indicator
## Code After:
EhannWebServiceBundle
=====================
[![Build Status](https://travis-ci.org/ethanhann/EhannWebServiceBundle.svg?branch=master)](https://travis-ci.org/ethanhann/EhannWebServiceBundle)
This bundle provides a way to automatically serialize and deserialize request parameters.
|
301f23067dde512f56ba5bf2201b666d125ffc96 | setup.py | setup.py | import sys
import os
from cx_Freeze import setup, Executable
paths = []
paths.extend(sys.path)
paths.append('whacked4')
build_exe_options = {
'packages': [],
'path': paths,
'include_files': ['res', 'cfg', 'docs', 'LICENSE', 'README.md'],
'optimize': 2,
'include_msvcr': True
}
build_exe_options['path'].append('src')
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
exe = Executable(
'src/main.py',
base=base,
targetName=os.environ['app_name_lower'] + '.exe',
icon='res/icon-hatchet.ico'
)
setup(
name = os.environ['app_title'],
version = os.environ['app_version_value'],
description = os.environ['app_description'],
options = {'build_exe': build_exe_options},
executables = [exe]
)
| import sys
import os
from cx_Freeze import setup, Executable
paths = []
paths.extend(sys.path)
paths.append('src')
build_exe_options = {
'path': paths,
'packages': ['whacked4'],
'include_files': ['res', 'cfg', 'docs', 'LICENSE', 'README.md'],
'optimize': 2,
'include_msvcr': True
}
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
exe = Executable(
'src/main.py',
base=base,
targetName=os.environ['app_name_lower'] + '.exe',
icon='res/icon-hatchet.ico'
)
setup(
name = os.environ['app_title'],
version = os.environ['app_version_value'],
description = os.environ['app_description'],
options = {'build_exe': build_exe_options},
executables = [exe]
)
| Update distutils script. Release builds still twice the size though... | Update distutils script. Release builds still twice the size though...
| Python | bsd-2-clause | GitExl/WhackEd4,GitExl/WhackEd4 | python | ## Code Before:
import sys
import os
from cx_Freeze import setup, Executable
paths = []
paths.extend(sys.path)
paths.append('whacked4')
build_exe_options = {
'packages': [],
'path': paths,
'include_files': ['res', 'cfg', 'docs', 'LICENSE', 'README.md'],
'optimize': 2,
'include_msvcr': True
}
build_exe_options['path'].append('src')
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
exe = Executable(
'src/main.py',
base=base,
targetName=os.environ['app_name_lower'] + '.exe',
icon='res/icon-hatchet.ico'
)
setup(
name = os.environ['app_title'],
version = os.environ['app_version_value'],
description = os.environ['app_description'],
options = {'build_exe': build_exe_options},
executables = [exe]
)
## Instruction:
Update distutils script. Release builds still twice the size though...
## Code After:
import sys
import os
from cx_Freeze import setup, Executable
paths = []
paths.extend(sys.path)
paths.append('src')
build_exe_options = {
'path': paths,
'packages': ['whacked4'],
'include_files': ['res', 'cfg', 'docs', 'LICENSE', 'README.md'],
'optimize': 2,
'include_msvcr': True
}
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
exe = Executable(
'src/main.py',
base=base,
targetName=os.environ['app_name_lower'] + '.exe',
icon='res/icon-hatchet.ico'
)
setup(
name = os.environ['app_title'],
version = os.environ['app_version_value'],
description = os.environ['app_description'],
options = {'build_exe': build_exe_options},
executables = [exe]
)
|
e44059cee594dac375d9affaa372fed008d61025 | scct/src/test/scala/reaktor/scct/report/BinaryReporterSpec.scala | scct/src/test/scala/reaktor/scct/report/BinaryReporterSpec.scala | package reaktor.scct.report
import org.specs.Specification
import java.io.File
class BinaryReporterSpec extends Specification {
import reaktor.scct.CoveredBlockGenerator._
"Readin and riting" in {
val tmp = new File(System.getProperty("java.io.tmpdir", "/tmp"))
val projectData = ProjectData("myProject", new File("/baseDir"), new File("/sourceDir"), blocks(true, false))
BinaryReporter.report(projectData, tmp)
val result = BinaryReporter.read(tmp)
result.projectId mustEqual "myProject"
result.baseDir.getAbsolutePath mustEqual "/baseDir"
result.sourceDir.getAbsolutePath mustEqual "/sourceDir"
result.data must haveSize(2)
result.data(0).id mustEqual "1"
result.data(0).count mustEqual 1
result.data(1).count mustEqual 0
}
}
| package reaktor.scct.report
import org.specs.Specification
import java.io.File
class BinaryReporterSpec extends Specification {
import reaktor.scct.CoveredBlockGenerator._
"Readin and riting" in {
val tmp = new File(System.getProperty("java.io.tmpdir", "/tmp"))
val projectData = ProjectData("myProject", new File("/baseDir"), new File("/sourceDir"), blocks(true, false))
BinaryReporter.report(projectData, tmp)
val result = BinaryReporter.read(new File(tmp, BinaryReporter.dataFile))
result.projectId mustEqual "myProject"
result.baseDir.getAbsolutePath mustEqual "/baseDir"
result.sourceDir.getAbsolutePath mustEqual "/sourceDir"
result.data must haveSize(2)
result.data(0).id mustEqual "1"
result.data(0).count mustEqual 1
result.data(1).count mustEqual 0
}
}
| Fix test: BinaryReporter.read is given File pointing to exact coverage-result.data. | Fix test: BinaryReporter.read is given File pointing to exact coverage-result.data.
| Scala | apache-2.0 | mtkopone/scct,RadoBuransky/scalac-scoverage-plugin,ssidorenko/scalac-scoverage-plugin,rorygraves/scalac-scoverage-plugin,filipmatusak/scalac-scoverage-plugin,scoverage/scalac-scoverage-plugin,scoverage/scalac-scoverage-plugin,gslowikowski/scalac-scoverage-plugin,ahirreddy/scalac-scoverage-plugin,xudongzheng1225/scalac-scoverage-plugin,RichardBradley/scalac-scoverage-plugin | scala | ## Code Before:
package reaktor.scct.report
import org.specs.Specification
import java.io.File
class BinaryReporterSpec extends Specification {
import reaktor.scct.CoveredBlockGenerator._
"Readin and riting" in {
val tmp = new File(System.getProperty("java.io.tmpdir", "/tmp"))
val projectData = ProjectData("myProject", new File("/baseDir"), new File("/sourceDir"), blocks(true, false))
BinaryReporter.report(projectData, tmp)
val result = BinaryReporter.read(tmp)
result.projectId mustEqual "myProject"
result.baseDir.getAbsolutePath mustEqual "/baseDir"
result.sourceDir.getAbsolutePath mustEqual "/sourceDir"
result.data must haveSize(2)
result.data(0).id mustEqual "1"
result.data(0).count mustEqual 1
result.data(1).count mustEqual 0
}
}
## Instruction:
Fix test: BinaryReporter.read is given File pointing to exact coverage-result.data.
## Code After:
package reaktor.scct.report
import org.specs.Specification
import java.io.File
class BinaryReporterSpec extends Specification {
import reaktor.scct.CoveredBlockGenerator._
"Readin and riting" in {
val tmp = new File(System.getProperty("java.io.tmpdir", "/tmp"))
val projectData = ProjectData("myProject", new File("/baseDir"), new File("/sourceDir"), blocks(true, false))
BinaryReporter.report(projectData, tmp)
val result = BinaryReporter.read(new File(tmp, BinaryReporter.dataFile))
result.projectId mustEqual "myProject"
result.baseDir.getAbsolutePath mustEqual "/baseDir"
result.sourceDir.getAbsolutePath mustEqual "/sourceDir"
result.data must haveSize(2)
result.data(0).id mustEqual "1"
result.data(0).count mustEqual 1
result.data(1).count mustEqual 0
}
}
|
2dcd216fea2261894c9fec0550285282e0b38b2f | addon/adapter.js | addon/adapter.js | import Ember from "ember";
import DS from "ember-data";
const {
get,
inject: { service }
} = Ember;
export default DS.JSONAPIAdapter.extend({
namespace: 'api',
drupalMapper: service(),
pathForType(modelName) {
let drupalMapper = get(this, 'drupalMapper'),
entity = drupalMapper.entityFor(modelName),
bundle = drupalMapper.bundleFor(modelName);
return entity + '/' + bundle;
},
buildQuery(snapshot) {
let query = this._super(...arguments);
query._format = 'api_json';
return query;
},
query(store, type, query) {
let drupalQuery = { filter: {} },
queryFields = Object.keys(query),
mapper = get(this, 'drupalMapper');
queryFields.forEach((field) => {
let fieldName = mapper.fieldName(type.modelName, field);
drupalQuery.filter[fieldName] = drupalQuery.filter[fieldName] || {};
drupalQuery.filter[fieldName]['value'] = query[field];
});
var url = this.buildURL(type.modelName, null, null, 'query', drupalQuery);
if (this.sortQueryParams) {
query = this.sortQueryParams(drupalQuery);
}
return this.ajax(url, 'GET', { data: query });
},
}); | import Ember from "ember";
import DS from "ember-data";
const {
get,
inject: { service }
} = Ember;
export default DS.JSONAPIAdapter.extend({
namespace: 'api',
drupalMapper: service(),
pathForType(modelName) {
let drupalMapper = get(this, 'drupalMapper'),
entity = drupalMapper.entityFor(modelName),
bundle = drupalMapper.bundleFor(modelName);
return entity + '/' + bundle;
},
buildQuery(snapshot) {
let query = this._super(...arguments);
query._format = 'api_json';
return query;
},
query(store, type, query) {
let drupalQuery = { filter: {} },
queryFields = Object.keys(query),
mapper = get(this, 'drupalMapper');
queryFields.forEach((field) => {
let fieldName = mapper.fieldName(type.modelName, field);
drupalQuery.filter[fieldName] = drupalQuery.filter[fieldName] || {};
drupalQuery.filter[fieldName]['value'] = query[field];
});
var url = this.buildURL(type.modelName, null, null, 'query', drupalQuery);
if (this.sortQueryParams) {
query = this.sortQueryParams(drupalQuery);
}
query._format = 'api_json';
return this.ajax(url, 'GET', { data: query });
},
}); | Add _format when constructing store.query request | Add _format when constructing store.query request
| JavaScript | mit | boztek/ember-data-drupal,boztek/ember-data-drupal | javascript | ## Code Before:
import Ember from "ember";
import DS from "ember-data";
const {
get,
inject: { service }
} = Ember;
export default DS.JSONAPIAdapter.extend({
namespace: 'api',
drupalMapper: service(),
pathForType(modelName) {
let drupalMapper = get(this, 'drupalMapper'),
entity = drupalMapper.entityFor(modelName),
bundle = drupalMapper.bundleFor(modelName);
return entity + '/' + bundle;
},
buildQuery(snapshot) {
let query = this._super(...arguments);
query._format = 'api_json';
return query;
},
query(store, type, query) {
let drupalQuery = { filter: {} },
queryFields = Object.keys(query),
mapper = get(this, 'drupalMapper');
queryFields.forEach((field) => {
let fieldName = mapper.fieldName(type.modelName, field);
drupalQuery.filter[fieldName] = drupalQuery.filter[fieldName] || {};
drupalQuery.filter[fieldName]['value'] = query[field];
});
var url = this.buildURL(type.modelName, null, null, 'query', drupalQuery);
if (this.sortQueryParams) {
query = this.sortQueryParams(drupalQuery);
}
return this.ajax(url, 'GET', { data: query });
},
});
## Instruction:
Add _format when constructing store.query request
## Code After:
import Ember from "ember";
import DS from "ember-data";
const {
get,
inject: { service }
} = Ember;
export default DS.JSONAPIAdapter.extend({
namespace: 'api',
drupalMapper: service(),
pathForType(modelName) {
let drupalMapper = get(this, 'drupalMapper'),
entity = drupalMapper.entityFor(modelName),
bundle = drupalMapper.bundleFor(modelName);
return entity + '/' + bundle;
},
buildQuery(snapshot) {
let query = this._super(...arguments);
query._format = 'api_json';
return query;
},
query(store, type, query) {
let drupalQuery = { filter: {} },
queryFields = Object.keys(query),
mapper = get(this, 'drupalMapper');
queryFields.forEach((field) => {
let fieldName = mapper.fieldName(type.modelName, field);
drupalQuery.filter[fieldName] = drupalQuery.filter[fieldName] || {};
drupalQuery.filter[fieldName]['value'] = query[field];
});
var url = this.buildURL(type.modelName, null, null, 'query', drupalQuery);
if (this.sortQueryParams) {
query = this.sortQueryParams(drupalQuery);
}
query._format = 'api_json';
return this.ajax(url, 'GET', { data: query });
},
}); |
8c50a8fe364caf922b4bbcde8d366581e6717804 | src/tightdb/util/terminate.cpp | src/tightdb/util/terminate.cpp |
using namespace std;
namespace tightdb {
namespace util {
TIGHTDB_NORETURN void terminate(string message, const char* file, long line) TIGHTDB_NOEXCEPT
{
cerr << file << ":" << line << ": " << message << endl;
abort();
}
} // namespace util
} // namespace tightdb
|
using namespace std;
namespace tightdb {
namespace util {
TIGHTDB_NORETURN void terminate(string message, const char* file, long line) TIGHTDB_NOEXCEPT
{
cerr << file << ":" << line << ": " << message << endl;
#ifdef __APPLE__
void* callstack[128];
int frames = backtrace(callstack, 128);
char** strs = backtrace_symbols(callstack, frames);
for (int i = 0; i < frames; ++i) {
cerr << strs[i] << endl;
}
free(strs);
#endif
abort();
}
} // namespace util
} // namespace tightdb
| Print a backtrace before terminating on supported platforms | Print a backtrace before terminating on supported platforms
| C++ | apache-2.0 | realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core | c++ | ## Code Before:
using namespace std;
namespace tightdb {
namespace util {
TIGHTDB_NORETURN void terminate(string message, const char* file, long line) TIGHTDB_NOEXCEPT
{
cerr << file << ":" << line << ": " << message << endl;
abort();
}
} // namespace util
} // namespace tightdb
## Instruction:
Print a backtrace before terminating on supported platforms
## Code After:
using namespace std;
namespace tightdb {
namespace util {
TIGHTDB_NORETURN void terminate(string message, const char* file, long line) TIGHTDB_NOEXCEPT
{
cerr << file << ":" << line << ": " << message << endl;
#ifdef __APPLE__
void* callstack[128];
int frames = backtrace(callstack, 128);
char** strs = backtrace_symbols(callstack, frames);
for (int i = 0; i < frames; ++i) {
cerr << strs[i] << endl;
}
free(strs);
#endif
abort();
}
} // namespace util
} // namespace tightdb
|
d360a14607b5480225d225d1e9237839cc31e545 | buildscripts/aftertest.ps1 | buildscripts/aftertest.ps1 | MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:SONARQUBE_TOKEN" | MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:SONARQUBE_TOKEN"
pip install codecov
codecov -f "coverage.xml" -t $env:CODECOV_TOKEN | Add codecov to the build | Add codecov to the build
| PowerShell | mit | mchaloupka/DotNetR2RMLStore,mchaloupka/EVI | powershell | ## Code Before:
MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:SONARQUBE_TOKEN"
## Instruction:
Add codecov to the build
## Code After:
MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:SONARQUBE_TOKEN"
pip install codecov
codecov -f "coverage.xml" -t $env:CODECOV_TOKEN |
8f8f1fea8c26d707500cfa784c3615ae46ae1e52 | ain7/templates/manage/errors_index.html | ain7/templates/manage/errors_index.html | {% extends "manage/base.html" %}
{% load i18n %}
{% load static from staticfiles %}
{% load el_pagination_tags %}
{% block content-left %}
{% if errors %}
{% paginate errors %}
<h2>{% trans "Errors"%}</h2>
<ul>
{% for error in errors %}
<li>
<a href="{% url "ain7.manage.views.error_details" error.id %}">
#{{ error.id }}</a>
<a href="{% url "ain7.manage.views.error_swap" error.id %}">
</a>
{{ error.title }}
{% if error.fixed %}
<img src="{% static "skins/default/images/icon_savelink.gif" %}" alt="ok"/>
{% endif %}
</li>
{% endfor %}
</ul>
<p class="text-center">{% show_pages %}</p>
{% endif %}
{% endblock %}
| {% extends "manage/base.html" %}
{% load i18n %}
{% load static from staticfiles %}
{% load el_pagination_tags %}
{% block content-left %}
{% if errors %}
{% paginate errors %}
<h2>{% trans "Errors"%}</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{% trans "Id" %}</th><th>{% trans "Title" %}</th><th>{% trans "User" %}</th><th>{% trans "Date" %}</th>
</tr>
</thead>
<tbody>
{% for error in errors %}
<tr>
<td><a href="{% url "ain7.manage.views.error_details" error.id %}">#{{ error.id }}</a></td>
<td>{{ error.title }}</td>
<td>{% if error.user %}<a href="{% url "ain7.annuaire.views.details" error.user.person.pk %}">{{ error.user.person }}</a>{% endif %}</td>
<td>{{ error.date|date:"d F Y H:i:s" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p class="text-center">{% show_pages %}</p>
{% endif %}
{% endblock %}
| Move to a tabular views for errors | Move to a tabular views for errors
| HTML | lgpl-2.1 | ain7/www.ain7.org,ain7/www.ain7.org,ain7/www.ain7.org,ain7/www.ain7.org | html | ## Code Before:
{% extends "manage/base.html" %}
{% load i18n %}
{% load static from staticfiles %}
{% load el_pagination_tags %}
{% block content-left %}
{% if errors %}
{% paginate errors %}
<h2>{% trans "Errors"%}</h2>
<ul>
{% for error in errors %}
<li>
<a href="{% url "ain7.manage.views.error_details" error.id %}">
#{{ error.id }}</a>
<a href="{% url "ain7.manage.views.error_swap" error.id %}">
</a>
{{ error.title }}
{% if error.fixed %}
<img src="{% static "skins/default/images/icon_savelink.gif" %}" alt="ok"/>
{% endif %}
</li>
{% endfor %}
</ul>
<p class="text-center">{% show_pages %}</p>
{% endif %}
{% endblock %}
## Instruction:
Move to a tabular views for errors
## Code After:
{% extends "manage/base.html" %}
{% load i18n %}
{% load static from staticfiles %}
{% load el_pagination_tags %}
{% block content-left %}
{% if errors %}
{% paginate errors %}
<h2>{% trans "Errors"%}</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{% trans "Id" %}</th><th>{% trans "Title" %}</th><th>{% trans "User" %}</th><th>{% trans "Date" %}</th>
</tr>
</thead>
<tbody>
{% for error in errors %}
<tr>
<td><a href="{% url "ain7.manage.views.error_details" error.id %}">#{{ error.id }}</a></td>
<td>{{ error.title }}</td>
<td>{% if error.user %}<a href="{% url "ain7.annuaire.views.details" error.user.person.pk %}">{{ error.user.person }}</a>{% endif %}</td>
<td>{{ error.date|date:"d F Y H:i:s" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p class="text-center">{% show_pages %}</p>
{% endif %}
{% endblock %}
|
85de3272aa153329c2e2bc949bdcfe2e9c6ba243 | README.md | README.md |
TODO: Write a gem description
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mixed_content_scanner'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install mixed_content_scanner
## Usage
TODO: Write usage instructions here
## Contributing
1. Fork it ( https://github.com/[my-github-username]/mixed_content_scanner/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
|
This tool is designed to quickly identify any mixed content a page contains in
order to serve a secure page without any security warnings.
## Installation
Via RubyGems:
```bash
$ gem install mixed_content_scanner
```
## Usage
The tool accepts a single parmeter which is the URL you wish to scan for mixed
content.
## Tests
To ensure I don't break changes in future releases, be sure to include tests
with all changes (the exception here is for documentation changes). The test
suite of choice is minitest.
Running tests can be done using `rake test`.
## Contributing
1. Fork it (https://github.com/jacobbednarz/mixed_content_scanner/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
| Build out the initial docs | Build out the initial docs
| Markdown | mit | jacobbednarz/mixed-content-scanner | markdown | ## Code Before:
TODO: Write a gem description
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mixed_content_scanner'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install mixed_content_scanner
## Usage
TODO: Write usage instructions here
## Contributing
1. Fork it ( https://github.com/[my-github-username]/mixed_content_scanner/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Instruction:
Build out the initial docs
## Code After:
This tool is designed to quickly identify any mixed content a page contains in
order to serve a secure page without any security warnings.
## Installation
Via RubyGems:
```bash
$ gem install mixed_content_scanner
```
## Usage
The tool accepts a single parmeter which is the URL you wish to scan for mixed
content.
## Tests
To ensure I don't break changes in future releases, be sure to include tests
with all changes (the exception here is for documentation changes). The test
suite of choice is minitest.
Running tests can be done using `rake test`.
## Contributing
1. Fork it (https://github.com/jacobbednarz/mixed_content_scanner/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
|
21bd8d48e958d8a2dbcc397419431b0576d529f7 | .travis.yml | .travis.yml | sudo: required
language: ruby
rvm:
- 2.3.0
before_install:
- sudo apt-get update -qq
- sudo apt-get install build-essential cmake -y
- wget https://github.com/librsync/librsync/archive/v1.0.1.tar.gz
- tar -xzvf v1.0.1.tar.gz
- cd v1.0.1 && cmake . && make && sudo make install
- gem install bundler -v 1.12.5
install:
- bundle install --jobs=3 --retry=3
- bundle exec rake compile
| sudo: required
language: ruby
rvm:
- 2.3.0
before_install:
- sudo apt-get update -qq
- sudo apt-get install build-essential cmake libpopt-dev libbz2-dev -y
- wget https://github.com/librsync/librsync/archive/v1.0.1.tar.gz
- tar -xzvf v1.0.1.tar.gz
- cd librsync-1.0.1 && cmake . && make && sudo make install
- gem install bundler -v 1.12.5
install:
- bundle install --jobs=3 --retry=3
- bundle exec rake compile
| Update packages and folder name | Update packages and folder name
| YAML | mit | daveallie/lib_ruby_diff,daveallie/lib_ruby_diff,daveallie/lib_ruby_diff | yaml | ## Code Before:
sudo: required
language: ruby
rvm:
- 2.3.0
before_install:
- sudo apt-get update -qq
- sudo apt-get install build-essential cmake -y
- wget https://github.com/librsync/librsync/archive/v1.0.1.tar.gz
- tar -xzvf v1.0.1.tar.gz
- cd v1.0.1 && cmake . && make && sudo make install
- gem install bundler -v 1.12.5
install:
- bundle install --jobs=3 --retry=3
- bundle exec rake compile
## Instruction:
Update packages and folder name
## Code After:
sudo: required
language: ruby
rvm:
- 2.3.0
before_install:
- sudo apt-get update -qq
- sudo apt-get install build-essential cmake libpopt-dev libbz2-dev -y
- wget https://github.com/librsync/librsync/archive/v1.0.1.tar.gz
- tar -xzvf v1.0.1.tar.gz
- cd librsync-1.0.1 && cmake . && make && sudo make install
- gem install bundler -v 1.12.5
install:
- bundle install --jobs=3 --retry=3
- bundle exec rake compile
|
1b316c8a5f982728d18099981a009d8b227d4e65 | resources/views/error.twig | resources/views/error.twig | {% extends 'layout.twig' %}
{% block main %}
<main class="main error-page">
<h2 class="error-page--title">Błąd {{ error }}</h2>
<img src="{{ xkcdImage.img }}" alt="Komiks z xkcd - {{ xkcdImage.alt }}" class="error-page--image">
</main>
{% endblock %}
| {% extends 'layout.twig' %}
{% block main %}
<main class="main error-page">
<h2 class="error-page--title">Błąd {{ error }}</h2>
<a href="https://xkcd.org/{{ xkcdImage.num }}">
<img src="{{ xkcdImage.img }}" alt="Komiks z xkcd - {{ xkcdImage.alt }}" class="error-page--image">
</a>
</main>
{% endblock %}
| Add link on xkcd comic pointing to their site | Add link on xkcd comic pointing to their site
| Twig | mit | nastoletni/code,nastoletni/code,nastoletni/code | twig | ## Code Before:
{% extends 'layout.twig' %}
{% block main %}
<main class="main error-page">
<h2 class="error-page--title">Błąd {{ error }}</h2>
<img src="{{ xkcdImage.img }}" alt="Komiks z xkcd - {{ xkcdImage.alt }}" class="error-page--image">
</main>
{% endblock %}
## Instruction:
Add link on xkcd comic pointing to their site
## Code After:
{% extends 'layout.twig' %}
{% block main %}
<main class="main error-page">
<h2 class="error-page--title">Błąd {{ error }}</h2>
<a href="https://xkcd.org/{{ xkcdImage.num }}">
<img src="{{ xkcdImage.img }}" alt="Komiks z xkcd - {{ xkcdImage.alt }}" class="error-page--image">
</a>
</main>
{% endblock %}
|
4c7ffd58ed33f501adcfd21830c5bc6fff11891a | README.md | README.md | If you do not already have an account on Tenon.io, you need one to use this. Head over to [https://tenon.io/register.php](https://tenon.io/register.php).
Once you're registered and confirmed, get your API key at [http://tenon.io/apikey.php](http://tenon.io/apikey.php)
## Installation
Install this just as you would any other Drupal Module: [https://www.drupal.org/documentation/install/modules-themes/modules-7](https://www.drupal.org/documentation/install/modules-themes/modules-7)
## Configuration
Navigate to your site's Settings area where you'll find a link to "Tenon.io settings". Enter your API key in the settings screen.
There are also some advanced API settings available. You can learn more about what they are and how they work by viewing [Tenon's documentation](http://tenon.io/documentation/understanding-request-parameters.php)
## Use it
This module adds a new menu option named "Accessibility Check". When you click it, the Module will send the page you're currently viewing to Tenon's API to check it for accessibility.
When the page has been checked, you'll see a summary of how many issues are on the page and a link that says "View full report". Activate that link to see the detailed report for the page. |
Note: This module supports both Drupal and Open Scholar
## Get a Tenon.io account before continuing
If you do not already have an account on Tenon.io, you need one to use this. Head over to [https://tenon.io/register.php](https://tenon.io/register.php).
Once you're registered and confirmed, get your API key at [http://tenon.io/apikey.php](http://tenon.io/apikey.php)
## Installation
Install this just as you would any other Drupal Module: [https://www.drupal.org/documentation/install/modules-themes/modules-7](https://www.drupal.org/documentation/install/modules-themes/modules-7)
## Configuration
Navigate to your site's Settings area where you'll find a link to "Tenon.io settings". Enter your API key in the settings screen.
There are also some advanced API settings available. You can learn more about what they are and how they work by viewing [Tenon's documentation](http://tenon.io/documentation/understanding-request-parameters.php)
## Use it
This module adds a new menu option named "Accessibility Check". When you click it, the Module will send the page you're currently viewing to Tenon's API to check it for accessibility.
When the page has been checked, you'll see a summary of how many issues are on the page and a link that says "View full report". Activate that link to see the detailed report for the page.
| Clarify that this works on both Drupal itself as well as Open Scholar | Clarify that this works on both Drupal itself as well as Open Scholar | Markdown | mit | tenon-io/tenon-open-scholar,tenon-io/tenon-open-scholar | markdown | ## Code Before:
If you do not already have an account on Tenon.io, you need one to use this. Head over to [https://tenon.io/register.php](https://tenon.io/register.php).
Once you're registered and confirmed, get your API key at [http://tenon.io/apikey.php](http://tenon.io/apikey.php)
## Installation
Install this just as you would any other Drupal Module: [https://www.drupal.org/documentation/install/modules-themes/modules-7](https://www.drupal.org/documentation/install/modules-themes/modules-7)
## Configuration
Navigate to your site's Settings area where you'll find a link to "Tenon.io settings". Enter your API key in the settings screen.
There are also some advanced API settings available. You can learn more about what they are and how they work by viewing [Tenon's documentation](http://tenon.io/documentation/understanding-request-parameters.php)
## Use it
This module adds a new menu option named "Accessibility Check". When you click it, the Module will send the page you're currently viewing to Tenon's API to check it for accessibility.
When the page has been checked, you'll see a summary of how many issues are on the page and a link that says "View full report". Activate that link to see the detailed report for the page.
## Instruction:
Clarify that this works on both Drupal itself as well as Open Scholar
## Code After:
Note: This module supports both Drupal and Open Scholar
## Get a Tenon.io account before continuing
If you do not already have an account on Tenon.io, you need one to use this. Head over to [https://tenon.io/register.php](https://tenon.io/register.php).
Once you're registered and confirmed, get your API key at [http://tenon.io/apikey.php](http://tenon.io/apikey.php)
## Installation
Install this just as you would any other Drupal Module: [https://www.drupal.org/documentation/install/modules-themes/modules-7](https://www.drupal.org/documentation/install/modules-themes/modules-7)
## Configuration
Navigate to your site's Settings area where you'll find a link to "Tenon.io settings". Enter your API key in the settings screen.
There are also some advanced API settings available. You can learn more about what they are and how they work by viewing [Tenon's documentation](http://tenon.io/documentation/understanding-request-parameters.php)
## Use it
This module adds a new menu option named "Accessibility Check". When you click it, the Module will send the page you're currently viewing to Tenon's API to check it for accessibility.
When the page has been checked, you'll see a summary of how many issues are on the page and a link that says "View full report". Activate that link to see the detailed report for the page.
|
37fc5de8b46b8e51bb6fb535f77576051b53b953 | writegif.js | writegif.js | var GifEncoder = require("gif-encoder")
var concat = require("terminus").concat
module.exports = writegif
// something with GifEncoder isn't correctly resetting the
// state of backpressure it seems like?
var hwm = 128 * 100 * 1024 // HUGE
// default = 10, 200 is maybe a bit smaller sometimes
var quality = 200
function writegif(image, callback) {
var out = concat(function (buffer) {
callback(null, buffer)
})
var gif = new GifEncoder(image.width, image.height, {highWaterMark: hwm})
gif.pipe(out)
gif.writeHeader()
gif.setQuality(quality)
if (image.frames.length > 1) {
gif.setRepeat(0)
}
image.frames.forEach(function (frame) {
if (frame.delay) {
gif.setDelay(frame.delay)
}
gif.addFrame(frame.data)
})
gif.finish()
}
| var GifEncoder = require("gif-encoder")
var concat = require("terminus").concat
module.exports = writegif
// something with GifEncoder isn't correctly resetting the
// state of backpressure it seems like?
var hwm = 128 * 100 * 1024 // HUGE
function writegif(image, opts, callback) {
if (!callback) { callback = opts; opts = {}; }
var out = concat(function (buffer) {
callback(null, buffer)
})
var gif = new GifEncoder(image.width, image.height, {highWaterMark: hwm})
gif.pipe(out)
gif.writeHeader()
// default = 10, 200 is maybe a bit smaller sometimes
gif.setQuality(opts.quality || 200)
if (image.frames.length > 1) {
gif.setRepeat(0)
}
image.frames.forEach(function (frame) {
if (frame.delay) {
gif.setDelay(frame.delay)
}
gif.addFrame(frame.data)
})
gif.finish()
}
| Allow quality to be configurable | Allow quality to be configurable
In images with few colors (such as a 4-color palette), a high value would remove most of the detail, resulting in a nearly flat/blank image. | JavaScript | mit | revisitors/writegif | javascript | ## Code Before:
var GifEncoder = require("gif-encoder")
var concat = require("terminus").concat
module.exports = writegif
// something with GifEncoder isn't correctly resetting the
// state of backpressure it seems like?
var hwm = 128 * 100 * 1024 // HUGE
// default = 10, 200 is maybe a bit smaller sometimes
var quality = 200
function writegif(image, callback) {
var out = concat(function (buffer) {
callback(null, buffer)
})
var gif = new GifEncoder(image.width, image.height, {highWaterMark: hwm})
gif.pipe(out)
gif.writeHeader()
gif.setQuality(quality)
if (image.frames.length > 1) {
gif.setRepeat(0)
}
image.frames.forEach(function (frame) {
if (frame.delay) {
gif.setDelay(frame.delay)
}
gif.addFrame(frame.data)
})
gif.finish()
}
## Instruction:
Allow quality to be configurable
In images with few colors (such as a 4-color palette), a high value would remove most of the detail, resulting in a nearly flat/blank image.
## Code After:
var GifEncoder = require("gif-encoder")
var concat = require("terminus").concat
module.exports = writegif
// something with GifEncoder isn't correctly resetting the
// state of backpressure it seems like?
var hwm = 128 * 100 * 1024 // HUGE
function writegif(image, opts, callback) {
if (!callback) { callback = opts; opts = {}; }
var out = concat(function (buffer) {
callback(null, buffer)
})
var gif = new GifEncoder(image.width, image.height, {highWaterMark: hwm})
gif.pipe(out)
gif.writeHeader()
// default = 10, 200 is maybe a bit smaller sometimes
gif.setQuality(opts.quality || 200)
if (image.frames.length > 1) {
gif.setRepeat(0)
}
image.frames.forEach(function (frame) {
if (frame.delay) {
gif.setDelay(frame.delay)
}
gif.addFrame(frame.data)
})
gif.finish()
}
|
afc36890328acf21bb0653a04c0b615400f550a2 | src/GeneaLabs/Bones/Flash/FlashNotifier.php | src/GeneaLabs/Bones/Flash/FlashNotifier.php | <?php namespace GeneaLabs\Bones\Flash;
use Illuminate\Session\Store;
class FlashNotifier
{
private $session;
public function __construct(Store $session)
{
$this->session = $session;
}
public function success($message)
{
$this->message($message, 'success');
}
public function info($message)
{
$this->message($message);
}
public function warning($message)
{
$this->message($message, 'warning');
}
public function danger($message)
{
$this->message($message, 'danger');
}
public function modal($message)
{
$this->message($message);
$this->session->flash('flashNotification.modal', true);
}
private function message($message, $level = 'info')
{
$this->session->flash('flashNotification.message', $message);
$this->session->flash('flashNotification.level', $level);
}
}
| <?php namespace GeneaLabs\Bones\Flash;
final class FlashNotifier
{
public function success($message)
{
$this->message($message, 'success');
}
public function info($message)
{
$this->message($message);
}
public function warning($message)
{
$this->message($message, 'warning');
}
public function danger($message)
{
$this->message($message, 'danger');
}
public function modal($message)
{
$this->message($message);
Session::put('flashNotification.modal', true);
}
private function message($message, $level = 'info')
{
Session::put('flashNotification.message', $message);
Session::put('flashNotification.level', $level);
}
}
| Use session::put instead of flash, to preserve the session past multiple redirects until displayed | Use session::put instead of flash, to preserve the session past multiple redirects until displayed | PHP | mit | GeneaLabs/bones-flash,GeneaLabs/bones-flash | php | ## Code Before:
<?php namespace GeneaLabs\Bones\Flash;
use Illuminate\Session\Store;
class FlashNotifier
{
private $session;
public function __construct(Store $session)
{
$this->session = $session;
}
public function success($message)
{
$this->message($message, 'success');
}
public function info($message)
{
$this->message($message);
}
public function warning($message)
{
$this->message($message, 'warning');
}
public function danger($message)
{
$this->message($message, 'danger');
}
public function modal($message)
{
$this->message($message);
$this->session->flash('flashNotification.modal', true);
}
private function message($message, $level = 'info')
{
$this->session->flash('flashNotification.message', $message);
$this->session->flash('flashNotification.level', $level);
}
}
## Instruction:
Use session::put instead of flash, to preserve the session past multiple redirects until displayed
## Code After:
<?php namespace GeneaLabs\Bones\Flash;
final class FlashNotifier
{
public function success($message)
{
$this->message($message, 'success');
}
public function info($message)
{
$this->message($message);
}
public function warning($message)
{
$this->message($message, 'warning');
}
public function danger($message)
{
$this->message($message, 'danger');
}
public function modal($message)
{
$this->message($message);
Session::put('flashNotification.modal', true);
}
private function message($message, $level = 'info')
{
Session::put('flashNotification.message', $message);
Session::put('flashNotification.level', $level);
}
}
|
a274e4063f85f30dd54f09936f2d57fcaad5e9f6 | packages/example-usecase/locale/_build/src/Usecases/ElementAttributes.json | packages/example-usecase/locale/_build/src/Usecases/ElementAttributes.json | {
"Read <0>more</0>": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
15
]
]
},
"Full content of {articleName}": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
null
],
[
"src/Usecases/ElementAttributes.js",
null
],
[
"src/Usecases/ElementAttributes.js",
null
],
[
"src/Usecases/ElementAttributes.js",
null
]
]
}
} | {
"Read <0>more</0>": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
15
]
]
},
"Full content of {articleName}": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
15
],
[
"src/Usecases/ElementAttributes.js",
15
],
[
"src/Usecases/ElementAttributes.js",
15
],
[
"src/Usecases/ElementAttributes.js",
15
]
]
}
} | Fix line numbers after upgraded extract plugin] | test: Fix line numbers after upgraded extract plugin]
affects: example-usecase
| JSON | mit | lingui/js-lingui,lingui/js-lingui | json | ## Code Before:
{
"Read <0>more</0>": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
15
]
]
},
"Full content of {articleName}": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
null
],
[
"src/Usecases/ElementAttributes.js",
null
],
[
"src/Usecases/ElementAttributes.js",
null
],
[
"src/Usecases/ElementAttributes.js",
null
]
]
}
}
## Instruction:
test: Fix line numbers after upgraded extract plugin]
affects: example-usecase
## Code After:
{
"Read <0>more</0>": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
15
]
]
},
"Full content of {articleName}": {
"origin": [
[
"src/Usecases/ElementAttributes.js",
15
],
[
"src/Usecases/ElementAttributes.js",
15
],
[
"src/Usecases/ElementAttributes.js",
15
],
[
"src/Usecases/ElementAttributes.js",
15
]
]
}
} |
0de865e5ce284d741520e7e097c6b6ff037e4b16 | server/knex/migrations/20190507000000_mysql_foreignp2.js | server/knex/migrations/20190507000000_mysql_foreignp2.js | var nconf = require('nconf');
var conf_file = './config/config.json';
var dbtype = nconf.get('database:type')
exports.up = function(db, Promise) {
if (dbtype == 'mysql'){
return Promise.all([
// This is here to fix original broken mysql installs - probably not required going forward.
db.schema.table('messages', function (table) {
table.integer('alias_id').unsigned().references('id').inTable('capcodes').onUpdate('CASCADE').onDelete('CASCADE');
})
//end broken MySQL Fix
])
} else {
return Promise.resolve('Not Required')
}
};
exports.down = function(db, Promise) {
};
| var nconf = require('nconf');
var conf_file = './config/config.json';
var dbtype = nconf.get('database:type')
exports.up = function(db, Promise) {
if (dbtype == 'mysql'){
return Promise.all([
// This is here to fix original broken mysql installs - probably not required going forward.
db.schema.table('messages', function (table) {
table.integer('alias_id').unsigned().references('id').inTable('capcodes').onUpdate('CASCADE').onDelete('CASCADE');
}),
db.schema.alterTable('capccodes', function (table) {
table.increments('id').primary().unique().notNullable().alter();
})
//end broken MySQL Fix
])
} else {
return Promise.resolve('Not Required')
}
};
exports.down = function(db, Promise) {
};
| Add coversion of id column | Add coversion of id column
| JavaScript | unlicense | davidmckenzie/pagermon,davidmckenzie/pagermon,davidmckenzie/pagermon,davidmckenzie/pagermon | javascript | ## Code Before:
var nconf = require('nconf');
var conf_file = './config/config.json';
var dbtype = nconf.get('database:type')
exports.up = function(db, Promise) {
if (dbtype == 'mysql'){
return Promise.all([
// This is here to fix original broken mysql installs - probably not required going forward.
db.schema.table('messages', function (table) {
table.integer('alias_id').unsigned().references('id').inTable('capcodes').onUpdate('CASCADE').onDelete('CASCADE');
})
//end broken MySQL Fix
])
} else {
return Promise.resolve('Not Required')
}
};
exports.down = function(db, Promise) {
};
## Instruction:
Add coversion of id column
## Code After:
var nconf = require('nconf');
var conf_file = './config/config.json';
var dbtype = nconf.get('database:type')
exports.up = function(db, Promise) {
if (dbtype == 'mysql'){
return Promise.all([
// This is here to fix original broken mysql installs - probably not required going forward.
db.schema.table('messages', function (table) {
table.integer('alias_id').unsigned().references('id').inTable('capcodes').onUpdate('CASCADE').onDelete('CASCADE');
}),
db.schema.alterTable('capccodes', function (table) {
table.increments('id').primary().unique().notNullable().alter();
})
//end broken MySQL Fix
])
} else {
return Promise.resolve('Not Required')
}
};
exports.down = function(db, Promise) {
};
|
17cd6b2d275a9d50af6c6760e76c68ee03a5cc24 | lib/puffery/builder/expanded_ad.rb | lib/puffery/builder/expanded_ad.rb | module Puffery
module Builder
class ExpandedAd < Base
# A list of the limits can be found here:
# https://developers.google.com/adwords/api/docs/guides/expanded-text-ads
attribute :headline1, max_chars: 30
attribute :headline2, max_chars: 30
attribute :description, max_chars: 80
attribute :path1
attribute :path2
attribute :url, max_bytesize: 1024
def validate
validate_presence_of(:headline1, :headlin2, :description,
:path1, :url)
end
end
end
end
| module Puffery
module Builder
class ExpandedAd < Base
# A list of the limits can be found here:
# https://developers.google.com/adwords/api/docs/guides/expanded-text-ads
attribute :headline1, max_chars: 30
attribute :headline2, max_chars: 30
attribute :description, max_chars: 80
attribute :path1, max_chars: 15
attribute :path2, max_chars: 15
attribute :url, max_bytesize: 1024
def validate
validate_presence_of(:headline1, :headlin2, :description,
:path1, :url)
end
end
end
end
| Set max_chars 15 for path1 and path2 | Set max_chars 15 for path1 and path2
| Ruby | mit | voke/puffery | ruby | ## Code Before:
module Puffery
module Builder
class ExpandedAd < Base
# A list of the limits can be found here:
# https://developers.google.com/adwords/api/docs/guides/expanded-text-ads
attribute :headline1, max_chars: 30
attribute :headline2, max_chars: 30
attribute :description, max_chars: 80
attribute :path1
attribute :path2
attribute :url, max_bytesize: 1024
def validate
validate_presence_of(:headline1, :headlin2, :description,
:path1, :url)
end
end
end
end
## Instruction:
Set max_chars 15 for path1 and path2
## Code After:
module Puffery
module Builder
class ExpandedAd < Base
# A list of the limits can be found here:
# https://developers.google.com/adwords/api/docs/guides/expanded-text-ads
attribute :headline1, max_chars: 30
attribute :headline2, max_chars: 30
attribute :description, max_chars: 80
attribute :path1, max_chars: 15
attribute :path2, max_chars: 15
attribute :url, max_bytesize: 1024
def validate
validate_presence_of(:headline1, :headlin2, :description,
:path1, :url)
end
end
end
end
|
6f5909d499252c5cd9f6d93b98bfb5bc75226be2 | README.md | README.md |
Yago is an attempt to create an ORM for Go.
## Features
- SQLAlchemy inspired
- based on the 'qb' database toolkit (https://github.com/aacanakin/qb),
- based on non-empty interface and code generation as 'reform' does
(https://github.com/go-reform/reform/)
## Current state:
- Very experimental.
- Current focus is on finding the right API.
In no way using this code in production is a good idea.
Feel free to come and discuss the design, propose patches...
|
[![Go Report Card](https://goreportcard.com/badge/github.com/orus-io/yago)](https://goreportcard.com/report/github.com/orus-io/yago)
Yago is an attempt to create an ORM for Go.
## Features
- SQLAlchemy inspired
- based on the 'qb' database toolkit (https://github.com/aacanakin/qb),
- based on non-empty interface and code generation as 'reform' does
(https://github.com/go-reform/reform/)
## Current state:
- Very experimental.
- Current focus is on finding the right API.
In no way using this code in production is a good idea.
Feel free to come and discuss the design, propose patches...
| Add a Go Report Card | [readme] Add a Go Report Card
| Markdown | mit | orus-io/yago | markdown | ## Code Before:
Yago is an attempt to create an ORM for Go.
## Features
- SQLAlchemy inspired
- based on the 'qb' database toolkit (https://github.com/aacanakin/qb),
- based on non-empty interface and code generation as 'reform' does
(https://github.com/go-reform/reform/)
## Current state:
- Very experimental.
- Current focus is on finding the right API.
In no way using this code in production is a good idea.
Feel free to come and discuss the design, propose patches...
## Instruction:
[readme] Add a Go Report Card
## Code After:
[![Go Report Card](https://goreportcard.com/badge/github.com/orus-io/yago)](https://goreportcard.com/report/github.com/orus-io/yago)
Yago is an attempt to create an ORM for Go.
## Features
- SQLAlchemy inspired
- based on the 'qb' database toolkit (https://github.com/aacanakin/qb),
- based on non-empty interface and code generation as 'reform' does
(https://github.com/go-reform/reform/)
## Current state:
- Very experimental.
- Current focus is on finding the right API.
In no way using this code in production is a good idea.
Feel free to come and discuss the design, propose patches...
|
3b14ed7d9ec092baaf10c9f81955dda28508db35 | tests/test_basics.py | tests/test_basics.py | import unittest
from phaseplot import phase_portrait
import matplotlib
class TestBasics(unittest.TestCase):
"""A collection of basic tests with no particular theme"""
def test_retval(self):
"""phase_portrait returns an AxesImage instance"""
def somefun(z): return z*z + 1
retval = phase_portrait(somefun)
self.assertIsInstance(retval, matplotlib.image.AxesImage)
| import unittest
from phaseplot import phase_portrait
import matplotlib
from matplotlib import pyplot as plt
class TestBasics(unittest.TestCase):
"""A collection of basic tests with no particular theme"""
def test_retval(self):
"""phase_portrait returns an AxesImage instance"""
def somefun(z): return z*z + 1
retval = phase_portrait(somefun)
self.assertIsInstance(retval, matplotlib.image.AxesImage)
def test_extent(self):
"""Test that the 'box' argument matches extent"""
# See also: issue #1
ai = phase_portrait(lambda(z) : z, box = [-1,1,-1,1])
# extent = (left, right, bottom, top)
extent = ai.get_extent()
self.assertEqual( extent, (-1, 1, -1, 1) )
ai = phase_portrait(lambda(z) : z, box = [-1,2,-3,4])
# extent = (left, right, bottom, top)
extent = ai.get_extent()
self.assertEqual( extent, (-1, 2, -3, 4) )
| Add test for correct image extent | Add test for correct image extent
| Python | mit | rluce/python-phaseplot | python | ## Code Before:
import unittest
from phaseplot import phase_portrait
import matplotlib
class TestBasics(unittest.TestCase):
"""A collection of basic tests with no particular theme"""
def test_retval(self):
"""phase_portrait returns an AxesImage instance"""
def somefun(z): return z*z + 1
retval = phase_portrait(somefun)
self.assertIsInstance(retval, matplotlib.image.AxesImage)
## Instruction:
Add test for correct image extent
## Code After:
import unittest
from phaseplot import phase_portrait
import matplotlib
from matplotlib import pyplot as plt
class TestBasics(unittest.TestCase):
"""A collection of basic tests with no particular theme"""
def test_retval(self):
"""phase_portrait returns an AxesImage instance"""
def somefun(z): return z*z + 1
retval = phase_portrait(somefun)
self.assertIsInstance(retval, matplotlib.image.AxesImage)
def test_extent(self):
"""Test that the 'box' argument matches extent"""
# See also: issue #1
ai = phase_portrait(lambda(z) : z, box = [-1,1,-1,1])
# extent = (left, right, bottom, top)
extent = ai.get_extent()
self.assertEqual( extent, (-1, 1, -1, 1) )
ai = phase_portrait(lambda(z) : z, box = [-1,2,-3,4])
# extent = (left, right, bottom, top)
extent = ai.get_extent()
self.assertEqual( extent, (-1, 2, -3, 4) )
|
add1b61b67d77f593c98f5656cd08a4042da5b43 | src/MetaViewComposer.php | src/MetaViewComposer.php | <?php
namespace Metrique\Meta;
use Illuminate\Contracts\View\View;
use Metrique\Meta\Contracts\MetaRepositoryInterface as MetaRepository;
class MetaViewComposer
{
/**
* The meta repository implementation.
*
* @var MetaRepository
*/
protected $meta;
/**
* Create a new profile composer.
*
* @param UserRepository $users
* @return void
*/
public function __construct(MetaRepository $meta)
{
// Dependencies automatically resolved by service container...
$this->meta = $meta;
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with('meta', $this->meta);
}
} | <?php
namespace Metrique\Meta;
use Illuminate\Contracts\View\View;
use Metrique\Meta\Contracts\MetaRepositoryInterface as Repository;
class MetaViewComposer
{
/**
* The meta repository implementation.
*
* @var Repository
*/
protected $meta;
/**
* Create a new profile composer.
*
* @param Repository $meta
* @return void
*/
public function __construct(Repository $meta)
{
// Dependencies automatically resolved by service container...
$this->meta = $meta;
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with('meta', $this->meta);
}
} | Fix name is already in use on php5.5.9 | Fix name is already in use on php5.5.9
| PHP | mit | Metrique/laravel-meta | php | ## Code Before:
<?php
namespace Metrique\Meta;
use Illuminate\Contracts\View\View;
use Metrique\Meta\Contracts\MetaRepositoryInterface as MetaRepository;
class MetaViewComposer
{
/**
* The meta repository implementation.
*
* @var MetaRepository
*/
protected $meta;
/**
* Create a new profile composer.
*
* @param UserRepository $users
* @return void
*/
public function __construct(MetaRepository $meta)
{
// Dependencies automatically resolved by service container...
$this->meta = $meta;
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with('meta', $this->meta);
}
}
## Instruction:
Fix name is already in use on php5.5.9
## Code After:
<?php
namespace Metrique\Meta;
use Illuminate\Contracts\View\View;
use Metrique\Meta\Contracts\MetaRepositoryInterface as Repository;
class MetaViewComposer
{
/**
* The meta repository implementation.
*
* @var Repository
*/
protected $meta;
/**
* Create a new profile composer.
*
* @param Repository $meta
* @return void
*/
public function __construct(Repository $meta)
{
// Dependencies automatically resolved by service container...
$this->meta = $meta;
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$view->with('meta', $this->meta);
}
} |
1c5e8d8fc4a0e7f4d47f6e1dc8c872b0b1a0f31b | lib/make_html_4_compliant.rb | lib/make_html_4_compliant.rb |
ActionView::Helpers::TagHelper.module_eval do
def tag(name, options = nil, open = false, escape = true)
"<#{name}#{tag_options(options, escape) if options}" + (open ? ">" : ">")
end
end
|
ActionView::Helpers::TagHelper.module_eval do
def tag(name, options = nil, open = false, escape = true)
"<#{name}#{tag_options(options, escape) if options}#{open ? ">" : ">"}".html_safe
end
end
| Bring tag monkeypatch up to date with latest rails 2.3 | Bring tag monkeypatch up to date with latest rails 2.3
| Ruby | agpl-3.0 | nzherald/alaveteli,petterreinholdtsen/alaveteli,obshtestvo/alaveteli-bulgaria,hasadna/alaveteli,TEDICpy/QueremoSaber,hasadna/alaveteli,andreicristianpetcu/alaveteli_old,10layer/alaveteli,andreicristianpetcu/alaveteli_old,TEDICpy/QueremoSaber,nzherald/alaveteli,andreicristianpetcu/alaveteli,TEDICpy/QueremoSaber,4bic/alaveteli,datauy/alaveteli,Br3nda/alaveteli,andreicristianpetcu/alaveteli_old,andreicristianpetcu/alaveteli_old,TEDICpy/QueremoSaber,datauy/alaveteli,codeforcroatia/alaveteli,4bic/alaveteli,andreicristianpetcu/alaveteli,obshtestvo/alaveteli-bulgaria,nzherald/alaveteli,codeforcroatia/alaveteli,andreicristianpetcu/alaveteli,andreicristianpetcu/alaveteli,petterreinholdtsen/alaveteli,obshtestvo/alaveteli-bulgaria,nzherald/alaveteli,petterreinholdtsen/alaveteli,hasadna/alaveteli,4bic/alaveteli,4bic/alaveteli,petterreinholdtsen/alaveteli,Br3nda/alaveteli,petterreinholdtsen/alaveteli,10layer/alaveteli,codeforcroatia/alaveteli,obshtestvo/alaveteli-bulgaria,obshtestvo/alaveteli-bulgaria,codeforcroatia/alaveteli,Br3nda/alaveteli,hasadna/alaveteli,datauy/alaveteli,4bic/alaveteli,nzherald/alaveteli,andreicristianpetcu/alaveteli,andreicristianpetcu/alaveteli_old,hasadna/alaveteli,Br3nda/alaveteli,10layer/alaveteli,hasadna/alaveteli,Br3nda/alaveteli,TEDICpy/QueremoSaber | ruby | ## Code Before:
ActionView::Helpers::TagHelper.module_eval do
def tag(name, options = nil, open = false, escape = true)
"<#{name}#{tag_options(options, escape) if options}" + (open ? ">" : ">")
end
end
## Instruction:
Bring tag monkeypatch up to date with latest rails 2.3
## Code After:
ActionView::Helpers::TagHelper.module_eval do
def tag(name, options = nil, open = false, escape = true)
"<#{name}#{tag_options(options, escape) if options}#{open ? ">" : ">"}".html_safe
end
end
|
8e79119c790b984126eb0021d3b40390eb350154 | lib/autocomplete-emojis.coffee | lib/autocomplete-emojis.coffee | provider = require('./emojis-provider')
module.exports =
configDefaults:
enableUnicodeEmojis: true
enableMarkdownEmojis: true
activate: ->
provider.loadProperties()
atom.commands.add 'atom-workspace',
'autocomplete-emojis:show-cheat-sheet': ->
require('./emoji-cheat-sheet').show()
getProvider: -> provider
| provider = require('./emojis-provider')
module.exports =
config:
enableUnicodeEmojis:
type: 'boolean'
default: true
enableMarkdownEmojis:
type: 'boolean'
default: true
activate: ->
provider.loadProperties()
atom.commands.add 'atom-workspace',
'autocomplete-emojis:show-cheat-sheet': ->
require('./emoji-cheat-sheet').show()
getProvider: -> provider
| Change code for configuration to use config schema | Change code for configuration to use config schema
| CoffeeScript | mit | atom/autocomplete-emojis,atom/autocomplete-emojis | coffeescript | ## Code Before:
provider = require('./emojis-provider')
module.exports =
configDefaults:
enableUnicodeEmojis: true
enableMarkdownEmojis: true
activate: ->
provider.loadProperties()
atom.commands.add 'atom-workspace',
'autocomplete-emojis:show-cheat-sheet': ->
require('./emoji-cheat-sheet').show()
getProvider: -> provider
## Instruction:
Change code for configuration to use config schema
## Code After:
provider = require('./emojis-provider')
module.exports =
config:
enableUnicodeEmojis:
type: 'boolean'
default: true
enableMarkdownEmojis:
type: 'boolean'
default: true
activate: ->
provider.loadProperties()
atom.commands.add 'atom-workspace',
'autocomplete-emojis:show-cheat-sheet': ->
require('./emoji-cheat-sheet').show()
getProvider: -> provider
|
32c6c1747b798b03a8d200dbf5dc3b84fd7fa487 | index.js | index.js | /* eslint-disable */
'use strict';
module.exports = {
name: 'ember-flatpickr',
included: function(app) {
let cssPath = 'themes/';
if(app.options && app.options.flatpickr && app.options.flatpickr.theme) {
cssPath += app.options.flatpickr.theme;
}
else {
cssPath += 'dark';
}
cssPath += '.css';
this.theme = cssPath;
this._super.included.apply(this, arguments);
},
options: {
nodeAssets: {
flatpickr: function() {
if (!process.env.EMBER_CLI_FASTBOOT) {
return {
srcDir: 'dist',
import: [
'flatpickr.js',
this.theme
]
};
}
}
}
}
};
| /* eslint-disable */
'use strict';
module.exports = {
name: 'ember-flatpickr',
included: function(app) {
let cssPath = 'themes/';
if (app.options && app.options.flatpickr && app.options.flatpickr.theme) {
cssPath += app.options.flatpickr.theme;
}
else {
cssPath += 'dark';
}
cssPath += '.css';
this.theme = cssPath;
this._super.included.apply(this, arguments);
},
options: {
nodeAssets: {
flatpickr: function() {
return {
enabled: !process.env.EMBER_CLI_FASTBOOT,
srcDir: 'dist',
import: [
'flatpickr.js',
this.theme
]
};
}
}
}
};
| Fix node assets with fastboot | Fix node assets with fastboot
| JavaScript | mit | shipshapecode/ember-flatpickr,shipshapecode/ember-flatpickr,shipshapecode/ember-flatpickr | javascript | ## Code Before:
/* eslint-disable */
'use strict';
module.exports = {
name: 'ember-flatpickr',
included: function(app) {
let cssPath = 'themes/';
if(app.options && app.options.flatpickr && app.options.flatpickr.theme) {
cssPath += app.options.flatpickr.theme;
}
else {
cssPath += 'dark';
}
cssPath += '.css';
this.theme = cssPath;
this._super.included.apply(this, arguments);
},
options: {
nodeAssets: {
flatpickr: function() {
if (!process.env.EMBER_CLI_FASTBOOT) {
return {
srcDir: 'dist',
import: [
'flatpickr.js',
this.theme
]
};
}
}
}
}
};
## Instruction:
Fix node assets with fastboot
## Code After:
/* eslint-disable */
'use strict';
module.exports = {
name: 'ember-flatpickr',
included: function(app) {
let cssPath = 'themes/';
if (app.options && app.options.flatpickr && app.options.flatpickr.theme) {
cssPath += app.options.flatpickr.theme;
}
else {
cssPath += 'dark';
}
cssPath += '.css';
this.theme = cssPath;
this._super.included.apply(this, arguments);
},
options: {
nodeAssets: {
flatpickr: function() {
return {
enabled: !process.env.EMBER_CLI_FASTBOOT,
srcDir: 'dist',
import: [
'flatpickr.js',
this.theme
]
};
}
}
}
};
|
3bb2b4ccd812264e1df5e65052fbafd68bd992d0 | lib/rodent/test_helpers.rb | lib/rodent/test_helpers.rb | module Rodent
module Test
module Helpers
def request(path, *args)
@rodent_response = api.route(path).call(*args)
end
def response
@rodent_response
end
end
end
end
| require 'multi_json'
module Rodent
module Test
module Helpers
def request(path, *args)
@rodent_response = MultiJson.load(api.route(path).call(*args))
end
def response
@rodent_response
end
end
end
end
| Convert response to json in test helper | Convert response to json in test helper
| Ruby | mit | kkdoo/rodent | ruby | ## Code Before:
module Rodent
module Test
module Helpers
def request(path, *args)
@rodent_response = api.route(path).call(*args)
end
def response
@rodent_response
end
end
end
end
## Instruction:
Convert response to json in test helper
## Code After:
require 'multi_json'
module Rodent
module Test
module Helpers
def request(path, *args)
@rodent_response = MultiJson.load(api.route(path).call(*args))
end
def response
@rodent_response
end
end
end
end
|
57b84b871331f9510f4da8b03bf57af9864e176d | README.txt | README.txt | safe_data 0.3
=============
safe_data provides convenient and efficient C++ data types that are
self-validating. Validates ranges, min/max, string length, container sizes,
etc. safe_data guarantees to hold valid data at all times.
Installation
------------
Before installing safe_data, you must have the C++ Boost Libraries installed.
Visit http://www.boost.org/ for more information.
After installing Boost, include this directory in your compiler's include
directory.
Once successfully configured, you should be able to use this statement to
include the files:
#include <safe_data/safe_data.hpp>
You can also compile and run test.cpp to make sure your compiler works with
safe_data.
Directions
----------
Review the code in example.cpp for general usage. The file test.cpp can be
referenced for more advanced features.
Current Release
---------------
The most current release can always be found at:
https://github.com/syvex/safe_data
| safe_data 0.4
=============
safe_data provides convenient and efficient C++ data types that are
self-validating. Validates ranges, min/max, string length, container sizes,
etc. safe_data guarantees to hold valid data at all times.
Installation
------------
Before installing safe_data, you must have the C++ Boost Libraries installed.
Visit http://www.boost.org/ for more information.
After installing Boost, include this directory in your compiler's include
directory.
Once successfully configured, you should be able to use this statement to
include the files:
#include <safe_data/safe_data.hpp>
Unit Tests
----------
The unit tests require Google Test (https://code.google.com/p/googletest/).
After compiling Google Test, run test.cpp to make sure your compiler works with
safe_data.
Directions
----------
Review the code in example.cpp for general usage. The file test.cpp can be
referenced for more advanced features.
Current Release
---------------
The most current release can always be found at:
https://github.com/syvex/safe_data
| Update read me for google test notes | Update read me for google test notes
| Text | bsd-3-clause | syvex/safe_data,syvex/safe_data | text | ## Code Before:
safe_data 0.3
=============
safe_data provides convenient and efficient C++ data types that are
self-validating. Validates ranges, min/max, string length, container sizes,
etc. safe_data guarantees to hold valid data at all times.
Installation
------------
Before installing safe_data, you must have the C++ Boost Libraries installed.
Visit http://www.boost.org/ for more information.
After installing Boost, include this directory in your compiler's include
directory.
Once successfully configured, you should be able to use this statement to
include the files:
#include <safe_data/safe_data.hpp>
You can also compile and run test.cpp to make sure your compiler works with
safe_data.
Directions
----------
Review the code in example.cpp for general usage. The file test.cpp can be
referenced for more advanced features.
Current Release
---------------
The most current release can always be found at:
https://github.com/syvex/safe_data
## Instruction:
Update read me for google test notes
## Code After:
safe_data 0.4
=============
safe_data provides convenient and efficient C++ data types that are
self-validating. Validates ranges, min/max, string length, container sizes,
etc. safe_data guarantees to hold valid data at all times.
Installation
------------
Before installing safe_data, you must have the C++ Boost Libraries installed.
Visit http://www.boost.org/ for more information.
After installing Boost, include this directory in your compiler's include
directory.
Once successfully configured, you should be able to use this statement to
include the files:
#include <safe_data/safe_data.hpp>
Unit Tests
----------
The unit tests require Google Test (https://code.google.com/p/googletest/).
After compiling Google Test, run test.cpp to make sure your compiler works with
safe_data.
Directions
----------
Review the code in example.cpp for general usage. The file test.cpp can be
referenced for more advanced features.
Current Release
---------------
The most current release can always be found at:
https://github.com/syvex/safe_data
|
e1a09de22ee6e7bf40f5e067d4632fdad56effa6 | data/src/main/java/com/edreams/android/workshops/kotlin/data/venues/mapper/VenueMapper.kt | data/src/main/java/com/edreams/android/workshops/kotlin/data/venues/mapper/VenueMapper.kt | package com.edreams.android.workshops.kotlin.data.venues.mapper
import com.edreams.android.workshops.kotlin.data.venues.cache.entity.VenueEntity
import com.edreams.android.workshops.kotlin.data.venues.remote.response.PhotoResponse
import com.edreams.android.workshops.kotlin.data.venues.remote.response.VenueResponse
import com.edreams.android.workshops.kotlin.domain.mapper.Mapper
import javax.inject.Inject
class VenueMapper @Inject constructor() : Mapper<VenueResponse, VenueEntity> {
override fun map(from: VenueResponse): VenueEntity = with(from) {
return VenueEntity(id,
name,
rating,
buildPhotoUrl(photos.groups[0].items[0]),
contact.formattedPhone,
location.distance,
location.formattedAddress.joinToString(","),
stats.checkinsCount,
tips?.get(0)?.text
)
}
private fun buildPhotoUrl(photo: PhotoResponse): String = with(photo) {
"$prefix${width}x$height$suffix"
}
} | package com.edreams.android.workshops.kotlin.data.venues.mapper
import com.edreams.android.workshops.kotlin.data.venues.cache.entity.VenueEntity
import com.edreams.android.workshops.kotlin.data.venues.remote.response.PhotoResponse
import com.edreams.android.workshops.kotlin.data.venues.remote.response.VenueResponse
import com.edreams.android.workshops.kotlin.domain.mapper.Mapper
import javax.inject.Inject
class VenueMapper @Inject constructor() : Mapper<VenueResponse, VenueEntity> {
override fun map(from: VenueResponse): VenueEntity = with(from) {
return VenueEntity(id,
name,
rating,
if (photos.groups.isNotEmpty()) buildPhotoUrl(photos.groups[0].items[0]) else "",
contact.formattedPhone,
location.distance,
location.formattedAddress.joinToString(","),
stats.checkinsCount,
tips?.get(0)?.text
)
}
private fun buildPhotoUrl(photo: PhotoResponse): String = with(photo) {
"$prefix${width}x$height$suffix"
}
} | Fix crash with emptu images lists | Fix crash with emptu images lists
| Kotlin | apache-2.0 | nico-gonzalez/K-Places,nico-gonzalez/K-Places | kotlin | ## Code Before:
package com.edreams.android.workshops.kotlin.data.venues.mapper
import com.edreams.android.workshops.kotlin.data.venues.cache.entity.VenueEntity
import com.edreams.android.workshops.kotlin.data.venues.remote.response.PhotoResponse
import com.edreams.android.workshops.kotlin.data.venues.remote.response.VenueResponse
import com.edreams.android.workshops.kotlin.domain.mapper.Mapper
import javax.inject.Inject
class VenueMapper @Inject constructor() : Mapper<VenueResponse, VenueEntity> {
override fun map(from: VenueResponse): VenueEntity = with(from) {
return VenueEntity(id,
name,
rating,
buildPhotoUrl(photos.groups[0].items[0]),
contact.formattedPhone,
location.distance,
location.formattedAddress.joinToString(","),
stats.checkinsCount,
tips?.get(0)?.text
)
}
private fun buildPhotoUrl(photo: PhotoResponse): String = with(photo) {
"$prefix${width}x$height$suffix"
}
}
## Instruction:
Fix crash with emptu images lists
## Code After:
package com.edreams.android.workshops.kotlin.data.venues.mapper
import com.edreams.android.workshops.kotlin.data.venues.cache.entity.VenueEntity
import com.edreams.android.workshops.kotlin.data.venues.remote.response.PhotoResponse
import com.edreams.android.workshops.kotlin.data.venues.remote.response.VenueResponse
import com.edreams.android.workshops.kotlin.domain.mapper.Mapper
import javax.inject.Inject
class VenueMapper @Inject constructor() : Mapper<VenueResponse, VenueEntity> {
override fun map(from: VenueResponse): VenueEntity = with(from) {
return VenueEntity(id,
name,
rating,
if (photos.groups.isNotEmpty()) buildPhotoUrl(photos.groups[0].items[0]) else "",
contact.formattedPhone,
location.distance,
location.formattedAddress.joinToString(","),
stats.checkinsCount,
tips?.get(0)?.text
)
}
private fun buildPhotoUrl(photo: PhotoResponse): String = with(photo) {
"$prefix${width}x$height$suffix"
}
} |
80a83e52bfc6aa51a4125258eeeac45e3b9b5a88 | requirements.txt | requirements.txt | argparse==1.2.1
arrow==0.4.2
Fabric==1.9.0
GitPython==0.3.5
mock==1.0.1
nose==1.3.0
pep8==1.5.7
pylint==1.3.0
requests==2.3.0
PyChef==0.2.3
keyring==8.5.1
virtualenv
pluggage
dockerstache>=0.0.9
pycrypto==2.6
| argparse==1.2.1
arrow==0.4.2
Fabric==1.11.1
GitPython==0.3.5
mock==1.0.1
nose==1.3.0
pep8==1.5.7
pylint==1.3.0
requests==2.3.0
PyChef==0.2.3
keyring==8.5.1
virtualenv
pluggage
dockerstache>=0.0.9
| Update Fabric dep to 0.11.1 remove pycrpto | Update Fabric dep to 0.11.1 remove pycrpto
| Text | apache-2.0 | evansde77/cirrus,evansde77/cirrus,evansde77/cirrus | text | ## Code Before:
argparse==1.2.1
arrow==0.4.2
Fabric==1.9.0
GitPython==0.3.5
mock==1.0.1
nose==1.3.0
pep8==1.5.7
pylint==1.3.0
requests==2.3.0
PyChef==0.2.3
keyring==8.5.1
virtualenv
pluggage
dockerstache>=0.0.9
pycrypto==2.6
## Instruction:
Update Fabric dep to 0.11.1 remove pycrpto
## Code After:
argparse==1.2.1
arrow==0.4.2
Fabric==1.11.1
GitPython==0.3.5
mock==1.0.1
nose==1.3.0
pep8==1.5.7
pylint==1.3.0
requests==2.3.0
PyChef==0.2.3
keyring==8.5.1
virtualenv
pluggage
dockerstache>=0.0.9
|
4b481684b18c0859994e97595fd3805a0c640d4b | pkgs/applications/video/subdl/default.nix | pkgs/applications/video/subdl/default.nix | { stdenv, fetchFromGitHub, python3 }:
stdenv.mkDerivation rec {
name = "subdl";
src = fetchFromGitHub {
owner = "alexanderwink";
repo = "subdl";
rev = "4cf5789b11f0ff3f863b704b336190bf968cd471";
sha256 = "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8";
};
meta = {
homepage = https://github.com/alexanderwink/subdl;
description = "A command-line tool to download subtitles from opensubtitles.org";
platforms = stdenv.lib.platforms.all;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.exfalso ];
};
buildInputs = [ python3 ];
installPhase = ''
install -vD subdl $out/bin/subdl
'';
}
| { stdenv, fetchFromGitHub, python3 }:
stdenv.mkDerivation rec {
name = "subdl-0.0pre.2017.11.06";
src = fetchFromGitHub {
owner = "alexanderwink";
repo = "subdl";
rev = "4cf5789b11f0ff3f863b704b336190bf968cd471";
sha256 = "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8";
};
meta = {
homepage = https://github.com/alexanderwink/subdl;
description = "A command-line tool to download subtitles from opensubtitles.org";
platforms = stdenv.lib.platforms.all;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.exfalso ];
};
buildInputs = [ python3 ];
installPhase = ''
install -vD subdl $out/bin/subdl
'';
}
| Add a date to name | Add a date to name | Nix | mit | NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs | nix | ## Code Before:
{ stdenv, fetchFromGitHub, python3 }:
stdenv.mkDerivation rec {
name = "subdl";
src = fetchFromGitHub {
owner = "alexanderwink";
repo = "subdl";
rev = "4cf5789b11f0ff3f863b704b336190bf968cd471";
sha256 = "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8";
};
meta = {
homepage = https://github.com/alexanderwink/subdl;
description = "A command-line tool to download subtitles from opensubtitles.org";
platforms = stdenv.lib.platforms.all;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.exfalso ];
};
buildInputs = [ python3 ];
installPhase = ''
install -vD subdl $out/bin/subdl
'';
}
## Instruction:
Add a date to name
## Code After:
{ stdenv, fetchFromGitHub, python3 }:
stdenv.mkDerivation rec {
name = "subdl-0.0pre.2017.11.06";
src = fetchFromGitHub {
owner = "alexanderwink";
repo = "subdl";
rev = "4cf5789b11f0ff3f863b704b336190bf968cd471";
sha256 = "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8";
};
meta = {
homepage = https://github.com/alexanderwink/subdl;
description = "A command-line tool to download subtitles from opensubtitles.org";
platforms = stdenv.lib.platforms.all;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.exfalso ];
};
buildInputs = [ python3 ];
installPhase = ''
install -vD subdl $out/bin/subdl
'';
}
|
d73a6986f2f4b1603e51a06d229cb3fa17784396 | packages/outputs/src/components/stream-text.md | packages/outputs/src/components/stream-text.md | The Jupyter kernel will return outputs that contain data from standard out or standard error using the `stream` message type. The data contained in this messages consists of a string containing the contents of the output. To render these types of outputs from the kernel in your own Jupyter front-end, you can use the `StreamText` component.
The `StreamText` component takes a `text` prop which contains the contents of the stream. The `name` prop, which can be one of `stdout` or `stderr` dictates whether the text stream originated from standard out or standard error respectively.
The `name` component is used to set the class of the `StreamText` component to `nteract-display-area-${name}` so that you can add custom styles to stream outputs.
```jsx
<StreamText name="stderr" text="hello world" />
``` | The Jupyter kernel will return outputs that contain data from standard out or standard error using the `stream` message type. The data contained in this messages consists of a string containing the contents of the output. To render these types of outputs from the kernel in your own Jupyter front-end, you can use the `StreamText` component.
The `StreamText` component takes a `text` prop which contains the contents of the stream. The `name` prop, which can be one of `stdout` or `stderr` dictates whether the text stream originated from standard out or standard error respectively.
```jsx
<StreamText name="stderr" text="hello world" />
```
| Remove description of StreamText classname | Remove description of StreamText classname
Co-Authored-By: captainsafia <[email protected]> | Markdown | bsd-3-clause | rgbkrk/nteract,nteract/composition,nteract/composition,nteract/nteract,nteract/nteract,nteract/nteract,nteract/composition,nteract/nteract,rgbkrk/nteract,rgbkrk/nteract,rgbkrk/nteract,rgbkrk/nteract,nteract/nteract | markdown | ## Code Before:
The Jupyter kernel will return outputs that contain data from standard out or standard error using the `stream` message type. The data contained in this messages consists of a string containing the contents of the output. To render these types of outputs from the kernel in your own Jupyter front-end, you can use the `StreamText` component.
The `StreamText` component takes a `text` prop which contains the contents of the stream. The `name` prop, which can be one of `stdout` or `stderr` dictates whether the text stream originated from standard out or standard error respectively.
The `name` component is used to set the class of the `StreamText` component to `nteract-display-area-${name}` so that you can add custom styles to stream outputs.
```jsx
<StreamText name="stderr" text="hello world" />
```
## Instruction:
Remove description of StreamText classname
Co-Authored-By: captainsafia <[email protected]>
## Code After:
The Jupyter kernel will return outputs that contain data from standard out or standard error using the `stream` message type. The data contained in this messages consists of a string containing the contents of the output. To render these types of outputs from the kernel in your own Jupyter front-end, you can use the `StreamText` component.
The `StreamText` component takes a `text` prop which contains the contents of the stream. The `name` prop, which can be one of `stdout` or `stderr` dictates whether the text stream originated from standard out or standard error respectively.
```jsx
<StreamText name="stderr" text="hello world" />
```
|
fe9dffd18315681c949ed6577e74f307747174f9 | .gitlab-ci.yml | .gitlab-ci.yml | include:
template: Dependency-Scanning.gitlab-ci.yml | before_script:
- apt-get install -y python-dev python-pip
include:
- template: Dependency-Scanning.gitlab-ci.yml
- template: SAST.gitlab-ci.yml | Install Python on GitLab and add SAST testing | Install Python on GitLab and add SAST testing
| YAML | mit | bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop | yaml | ## Code Before:
include:
template: Dependency-Scanning.gitlab-ci.yml
## Instruction:
Install Python on GitLab and add SAST testing
## Code After:
before_script:
- apt-get install -y python-dev python-pip
include:
- template: Dependency-Scanning.gitlab-ci.yml
- template: SAST.gitlab-ci.yml |
22e4870dd7dc099130cd19c41874e23f35cc9db0 | test/event_condition_test.cc | test/event_condition_test.cc |
namespace {
static bool g_event_handler_called = false;
static void Handle(struct event_base* base) {
g_event_handler_called = true;
event_base_loopexit(base, 0);
}
static void MyEventThread(struct event_base* base, evpp::PipeEventWatcher* ev) {
if (ev->Init()) {
ev->AsyncWait();
}
event_base_loop(base, 0);
}
}
TEST_UNIT(testPipeEventWatcher) {
struct event_base* base = event_base_new();
evpp::PipeEventWatcher ev(base, std::bind(&Handle, base));
std::thread th(MyEventThread, base, &ev);
::usleep(1000 * 100);
ev.Notify();
th.join();
event_base_free(base);
H_TEST_ASSERT(g_event_handler_called == true);
}
|
namespace {
static bool g_event_handler_called = false;
static void Handle(struct event_base* base) {
g_event_handler_called = true;
event_base_loopexit(base, 0);
}
static void MyEventThread(struct event_base* base, evpp::PipeEventWatcher* ev) {
if (ev->Init()) {
ev->AsyncWait();
}
event_base_loop(base, 0);
delete ev;// ȷʼͬһ߳
}
}
TEST_UNIT(testPipeEventWatcher) {
struct event_base* base = event_base_new();
evpp::PipeEventWatcher* ev = new evpp::PipeEventWatcher(base, std::bind(&Handle, base));
std::thread th(MyEventThread, base, ev);
::usleep(1000 * 100);
ev->Notify();
th.join();
event_base_free(base);
H_TEST_ASSERT(g_event_handler_called == true);
}
| Fix testPipeEventWatcher test case failed | Fix testPipeEventWatcher test case failed
| C++ | bsd-3-clause | Qihoo360/evpp,Qihoo360/evpp,Qihoo360/evpp,Qihoo360/evpp,Qihoo360/evpp | c++ | ## Code Before:
namespace {
static bool g_event_handler_called = false;
static void Handle(struct event_base* base) {
g_event_handler_called = true;
event_base_loopexit(base, 0);
}
static void MyEventThread(struct event_base* base, evpp::PipeEventWatcher* ev) {
if (ev->Init()) {
ev->AsyncWait();
}
event_base_loop(base, 0);
}
}
TEST_UNIT(testPipeEventWatcher) {
struct event_base* base = event_base_new();
evpp::PipeEventWatcher ev(base, std::bind(&Handle, base));
std::thread th(MyEventThread, base, &ev);
::usleep(1000 * 100);
ev.Notify();
th.join();
event_base_free(base);
H_TEST_ASSERT(g_event_handler_called == true);
}
## Instruction:
Fix testPipeEventWatcher test case failed
## Code After:
namespace {
static bool g_event_handler_called = false;
static void Handle(struct event_base* base) {
g_event_handler_called = true;
event_base_loopexit(base, 0);
}
static void MyEventThread(struct event_base* base, evpp::PipeEventWatcher* ev) {
if (ev->Init()) {
ev->AsyncWait();
}
event_base_loop(base, 0);
delete ev;// ȷʼͬһ߳
}
}
TEST_UNIT(testPipeEventWatcher) {
struct event_base* base = event_base_new();
evpp::PipeEventWatcher* ev = new evpp::PipeEventWatcher(base, std::bind(&Handle, base));
std::thread th(MyEventThread, base, ev);
::usleep(1000 * 100);
ev->Notify();
th.join();
event_base_free(base);
H_TEST_ASSERT(g_event_handler_called == true);
}
|
240048ebf64db8cb9d575b2dfeb8f2a758dc6de7 | README.md | README.md | Web Components scene collection with Polymer
# Components List
* **scene-stw**:
* [Doc](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/)
* [Demo](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/demo/)
* **scene-mountain**:
* **scene-mountain-range**
* **scene-moon**
* **scene-sun**
* **scene-group**
* **scene-tree**
* **scene-streetlight**
| Web Components scene collection with Polymer
# Components List
* **scene-stw**: Star Wars Text component. Also it possible change text by HTML/WebComponents
* [Doc](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/)
* [Demo](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/demo/)
* [Demo2](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/demo/demo2.html)
* **scene-mountain**:
* **scene-mountain-range**
* **scene-moon**
* **scene-sun**
* **scene-group**
* **scene-tree**
* **scene-streetlight**
| Add scene-stw description and demo2 link | Add scene-stw description and demo2 link | Markdown | mit | manufosela/polymer-scene | markdown | ## Code Before:
Web Components scene collection with Polymer
# Components List
* **scene-stw**:
* [Doc](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/)
* [Demo](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/demo/)
* **scene-mountain**:
* **scene-mountain-range**
* **scene-moon**
* **scene-sun**
* **scene-group**
* **scene-tree**
* **scene-streetlight**
## Instruction:
Add scene-stw description and demo2 link
## Code After:
Web Components scene collection with Polymer
# Components List
* **scene-stw**: Star Wars Text component. Also it possible change text by HTML/WebComponents
* [Doc](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/)
* [Demo](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/demo/)
* [Demo2](http://manufosela.es/examples/polymer/polymer-scene/scene-stw/demo/demo2.html)
* **scene-mountain**:
* **scene-mountain-range**
* **scene-moon**
* **scene-sun**
* **scene-group**
* **scene-tree**
* **scene-streetlight**
|
f5e5f7d6cdb9ce7c8203b7bfe2c5269a14813433 | tests/drivers/build_all/modem/src/main.c | tests/drivers/build_all/modem/src/main.c | /*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <sys/printk.h>
#include <device.h>
/*
* @file
* @brief Hello World demo
*/
void main(void)
{
printk("Hello World!\n");
}
#if DT_NODE_EXISTS(DT_INST(0, vnd_gpio))
/* Fake GPIO device, needed for building drivers that use DEVICE_DT_GET()
* to access GPIO controllers.
*/
DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
#endif
#if DT_NODE_EXISTS(DT_INST(0, vnd_serial))
/* Fake serial device, needed for building drivers that use DEVICE_DT_GET()
* to access serial bus.
*/
DEVICE_DT_DEFINE(DT_INST(0, vnd_serial), NULL, NULL, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
#endif
| /*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <sys/printk.h>
#include <device.h>
/*
* @file
* @brief Hello World demo
*/
void main(void)
{
printk("Hello World!\n");
}
#if DT_NODE_EXISTS(DT_INST(0, vnd_gpio))
/* Fake GPIO device, needed for building drivers that use DEVICE_DT_GET()
* to access GPIO controllers.
*/
DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
#endif
| Revert "tests: drivers: build_all: add fake serial device for modem tests" | Revert "tests: drivers: build_all: add fake serial device for modem tests"
This reverts commit 9e58a1e475473fcea1c3b0d05ac9c738141c821a.
This change is in conflict with commit 94f7ed356f0c ("drivers: serial:
add a dummy driver for vnd,serial"). As a result two equal serial
devices are defines, resulting in link error.
Signed-off-by: Marcin Niestroj <[email protected]>
| C | apache-2.0 | finikorg/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,galak/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr | c | ## Code Before:
/*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <sys/printk.h>
#include <device.h>
/*
* @file
* @brief Hello World demo
*/
void main(void)
{
printk("Hello World!\n");
}
#if DT_NODE_EXISTS(DT_INST(0, vnd_gpio))
/* Fake GPIO device, needed for building drivers that use DEVICE_DT_GET()
* to access GPIO controllers.
*/
DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
#endif
#if DT_NODE_EXISTS(DT_INST(0, vnd_serial))
/* Fake serial device, needed for building drivers that use DEVICE_DT_GET()
* to access serial bus.
*/
DEVICE_DT_DEFINE(DT_INST(0, vnd_serial), NULL, NULL, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
#endif
## Instruction:
Revert "tests: drivers: build_all: add fake serial device for modem tests"
This reverts commit 9e58a1e475473fcea1c3b0d05ac9c738141c821a.
This change is in conflict with commit 94f7ed356f0c ("drivers: serial:
add a dummy driver for vnd,serial"). As a result two equal serial
devices are defines, resulting in link error.
Signed-off-by: Marcin Niestroj <[email protected]>
## Code After:
/*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <sys/printk.h>
#include <device.h>
/*
* @file
* @brief Hello World demo
*/
void main(void)
{
printk("Hello World!\n");
}
#if DT_NODE_EXISTS(DT_INST(0, vnd_gpio))
/* Fake GPIO device, needed for building drivers that use DEVICE_DT_GET()
* to access GPIO controllers.
*/
DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
#endif
|
f9314d05a3ad138dc52444c585cba58d11ab1960 | recipes/default.rb | recipes/default.rb | app = search(:aws_opsworks_app).first
application app["shortname"] do
path "/srv/#{app['shortname']}"
packages ["git"]
repository app["app_source"]["url"]
nodejs do
npm false
entry_point "server.js"
end
end
| app = search(:aws_opsworks_app).first
execute "ssh-keyscan -H github.com >> /root/.ssh/known_hosts"
application "/srv/#{app['shortname']}" do
javascript "4"
file "/root/.ssh/id_rsa" do
content app["app_source"]["ssh_key"]
mode 0600
end
git "/srv/#{app['shortname']}" do
repository app["app_source"]["url"]
revision app["app_source"]["revision"]
end
npm_install
npm_start
end
| Use latest working recipe version | Use latest working recipe version
| Ruby | apache-2.0 | awslabs/opsworks-linux-demo-cookbook-nodejs | ruby | ## Code Before:
app = search(:aws_opsworks_app).first
application app["shortname"] do
path "/srv/#{app['shortname']}"
packages ["git"]
repository app["app_source"]["url"]
nodejs do
npm false
entry_point "server.js"
end
end
## Instruction:
Use latest working recipe version
## Code After:
app = search(:aws_opsworks_app).first
execute "ssh-keyscan -H github.com >> /root/.ssh/known_hosts"
application "/srv/#{app['shortname']}" do
javascript "4"
file "/root/.ssh/id_rsa" do
content app["app_source"]["ssh_key"]
mode 0600
end
git "/srv/#{app['shortname']}" do
repository app["app_source"]["url"]
revision app["app_source"]["revision"]
end
npm_install
npm_start
end
|
48f1f53149358cea7469d019aa988a4a0beed3a1 | roles/signal-desktop/tasks/main.yml | roles/signal-desktop/tasks/main.yml | ---
- name: Ensure signal-desktop is installed
become: yes
pacman:
state: latest
name: signal-desktop
tags:
- signal-desktop
- name: Ensure signal-desktop is autostarted on login and stayes in tray
copy:
dest: "{{ ansible_user_dir }}/.config/autostart/signal-desktop.desktop"
content: |
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=Signal (Tray)
GenericName=Messenger (tray mode)
Comment=Signal Private Messenger (Start in Tray)
Icon=signal
Exec=signal-desktop --start-in-tray
Categories=Network;Messenger;
StartupNotify=false
tags:
- signal-desktop
| ---
- name: Ensure signal-desktop is installed
become: yes
ansible.builtin.pacman:
state: latest
name: signal-desktop
tags:
- signal-desktop
- name: Ensure signal-desktop desktop entry is configured to use wayland
ansible.builtin.copy:
dest: "{{ ansible_user_dir }}/.local/share/applications/signal-desktop.desktop"
mode: 0640
content: |
[Desktop Entry]
Type=Application
Name=Signal
Comment=Signal - Private Messenger
Comment[de]=Signal - Sicherer Messenger
Icon=signal-desktop
Exec=signal-desktop --start-in-tray --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland -- %u
Terminal=false
Categories=Network;InstantMessaging;
StartupWMClass=Signal
MimeType=x-scheme-handler/sgnl;
Keywords=sgnl;chat;im;messaging;messenger;sms;security;privat;
X-GNOME-UsesNotifications=true
tags:
- signal-desktop
- wayland
- name: Ensure signal-desktop is autostarted on login and stayes in tray
ansible.builtin.copy:
src: "{{ ansible_user_dir }}/.local/share/applications/signal-desktop.desktop"
dest: "{{ ansible_user_dir }}/.config/autostart/signal-desktop.desktop"
state: link
tags:
- signal-desktop
| Update signal desktop role to support wayland better | Update signal desktop role to support wayland better
| YAML | mit | henrik-farre/ansible,henrik-farre/ansible,henrik-farre/ansible | yaml | ## Code Before:
---
- name: Ensure signal-desktop is installed
become: yes
pacman:
state: latest
name: signal-desktop
tags:
- signal-desktop
- name: Ensure signal-desktop is autostarted on login and stayes in tray
copy:
dest: "{{ ansible_user_dir }}/.config/autostart/signal-desktop.desktop"
content: |
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=Signal (Tray)
GenericName=Messenger (tray mode)
Comment=Signal Private Messenger (Start in Tray)
Icon=signal
Exec=signal-desktop --start-in-tray
Categories=Network;Messenger;
StartupNotify=false
tags:
- signal-desktop
## Instruction:
Update signal desktop role to support wayland better
## Code After:
---
- name: Ensure signal-desktop is installed
become: yes
ansible.builtin.pacman:
state: latest
name: signal-desktop
tags:
- signal-desktop
- name: Ensure signal-desktop desktop entry is configured to use wayland
ansible.builtin.copy:
dest: "{{ ansible_user_dir }}/.local/share/applications/signal-desktop.desktop"
mode: 0640
content: |
[Desktop Entry]
Type=Application
Name=Signal
Comment=Signal - Private Messenger
Comment[de]=Signal - Sicherer Messenger
Icon=signal-desktop
Exec=signal-desktop --start-in-tray --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland -- %u
Terminal=false
Categories=Network;InstantMessaging;
StartupWMClass=Signal
MimeType=x-scheme-handler/sgnl;
Keywords=sgnl;chat;im;messaging;messenger;sms;security;privat;
X-GNOME-UsesNotifications=true
tags:
- signal-desktop
- wayland
- name: Ensure signal-desktop is autostarted on login and stayes in tray
ansible.builtin.copy:
src: "{{ ansible_user_dir }}/.local/share/applications/signal-desktop.desktop"
dest: "{{ ansible_user_dir }}/.config/autostart/signal-desktop.desktop"
state: link
tags:
- signal-desktop
|
51c3ca44731b9a2f91c8cae26f3b7989028f2200 | l10n_ch_scan_bvr/views/partner_view.xml | l10n_ch_scan_bvr/views/partner_view.xml | <?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="partner_default_product_supplier_invoice" model="ir.ui.view">
<field name="name">partner.default.supplier.invoice.product.form.view</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="type">form</field>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<field name="credit_limit" position="after">
<field name="supplier_invoice_default_product"/>
</field>
</field>
</record>
</data>
</openerp>
| <?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="partner_default_product_supplier_invoice" model="ir.ui.view">
<field name="name">partner.default.supplier.invoice.product.form.view</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form" />
<field name="type">form</field>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<field name="credit_limit" position="after">
<field name="supplier_invoice_default_product"/>
</field>
</field>
</record>
</data>
</openerp>
| Fix view inheritance on res.partner | Fix view inheritance on res.partner
| XML | agpl-3.0 | open-net-sarl/l10n-switzerland,open-net-sarl/l10n-switzerland,BT-ojossen/l10n-switzerland,BT-ojossen/l10n-switzerland | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="partner_default_product_supplier_invoice" model="ir.ui.view">
<field name="name">partner.default.supplier.invoice.product.form.view</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="type">form</field>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<field name="credit_limit" position="after">
<field name="supplier_invoice_default_product"/>
</field>
</field>
</record>
</data>
</openerp>
## Instruction:
Fix view inheritance on res.partner
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="partner_default_product_supplier_invoice" model="ir.ui.view">
<field name="name">partner.default.supplier.invoice.product.form.view</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form" />
<field name="type">form</field>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<field name="credit_limit" position="after">
<field name="supplier_invoice_default_product"/>
</field>
</field>
</record>
</data>
</openerp>
|
51167144a5be785042ff15a9435f6ea8c75d6c53 | pages/_app.js | pages/_app.js | import '@/css/tailwind.css'
import '@/css/prism.css'
import { ThemeProvider } from 'next-themes'
import Head from 'next/head'
import siteMetadata from '@/data/siteMetadata'
import Analytics from '@/components/analytics'
import LayoutWrapper from '@/components/LayoutWrapper'
import { ClientReload } from '@/components/ClientReload'
const isDevelopment = process.env.NODE_ENV === 'development'
const isSocket = process.env.SOCKET
export default function App({ Component, pageProps }) {
return (
<ThemeProvider attribute="class" defaultTheme={siteMetadata.theme}>
<Head>
<meta content="width=device-width, initial-scale=1" name="viewport" />
</Head>
{isDevelopment && isSocket && <ClientReload />}
<Analytics />
<LayoutWrapper>
<Component {...pageProps} />
</LayoutWrapper>
</ThemeProvider>
)
}
| import '@/css/tailwind.css'
import '@/css/prism.css'
import { ThemeProvider } from 'next-themes'
import Head from 'next/head'
import moment from 'moment'
import siteMetadata from '@/data/siteMetadata'
import Analytics from '@/components/analytics'
import LayoutWrapper from '@/components/LayoutWrapper'
import { ClientReload } from '@/components/ClientReload'
const isDevelopment = process.env.NODE_ENV === 'development'
const isSocket = process.env.SOCKET
const { version } = require('../package.json')
const build = moment().format('YYYYMMDDHHmmss')
export default function App({ Component, pageProps }) {
return (
<ThemeProvider attribute="class" defaultTheme={siteMetadata.theme}>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="version" content={version + '.' + build} />
</Head>
{isDevelopment && isSocket && <ClientReload />}
<Analytics />
<LayoutWrapper>
<Component {...pageProps} />
</LayoutWrapper>
</ThemeProvider>
)
}
| Add meta version for build version | Add meta version for build version
| JavaScript | mit | ravuthz/ravuthz.github.io,ravuthz/ravuthz.github.io | javascript | ## Code Before:
import '@/css/tailwind.css'
import '@/css/prism.css'
import { ThemeProvider } from 'next-themes'
import Head from 'next/head'
import siteMetadata from '@/data/siteMetadata'
import Analytics from '@/components/analytics'
import LayoutWrapper from '@/components/LayoutWrapper'
import { ClientReload } from '@/components/ClientReload'
const isDevelopment = process.env.NODE_ENV === 'development'
const isSocket = process.env.SOCKET
export default function App({ Component, pageProps }) {
return (
<ThemeProvider attribute="class" defaultTheme={siteMetadata.theme}>
<Head>
<meta content="width=device-width, initial-scale=1" name="viewport" />
</Head>
{isDevelopment && isSocket && <ClientReload />}
<Analytics />
<LayoutWrapper>
<Component {...pageProps} />
</LayoutWrapper>
</ThemeProvider>
)
}
## Instruction:
Add meta version for build version
## Code After:
import '@/css/tailwind.css'
import '@/css/prism.css'
import { ThemeProvider } from 'next-themes'
import Head from 'next/head'
import moment from 'moment'
import siteMetadata from '@/data/siteMetadata'
import Analytics from '@/components/analytics'
import LayoutWrapper from '@/components/LayoutWrapper'
import { ClientReload } from '@/components/ClientReload'
const isDevelopment = process.env.NODE_ENV === 'development'
const isSocket = process.env.SOCKET
const { version } = require('../package.json')
const build = moment().format('YYYYMMDDHHmmss')
export default function App({ Component, pageProps }) {
return (
<ThemeProvider attribute="class" defaultTheme={siteMetadata.theme}>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="version" content={version + '.' + build} />
</Head>
{isDevelopment && isSocket && <ClientReload />}
<Analytics />
<LayoutWrapper>
<Component {...pageProps} />
</LayoutWrapper>
</ThemeProvider>
)
}
|
af4c5a72afb80ff59662cc6992ce3084fed75dfe | node/deduplicate.py | node/deduplicate.py |
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
if isinstance(seq, str):
return "".join(set(seq))
return [type(seq)(set(seq))] |
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 1
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
return inp*2
@Node.test_func([[1,2,3,1,1]], [[1,2,3]])
@Node.test_func(["hi!!!"], ["hi!"])
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
seen = set()
seen_add = seen.add
if isinstance(seq, str):
return "".join(x for x in seq if not (x in seen or seen_add(x)))
return[type(seq)([x for x in seq if not (x in seen or seen_add(x))])] | Fix dedupe not preserving order | Fix dedupe not preserving order
| Python | mit | muddyfish/PYKE,muddyfish/PYKE | python | ## Code Before:
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
if isinstance(seq, str):
return "".join(set(seq))
return [type(seq)(set(seq))]
## Instruction:
Fix dedupe not preserving order
## Code After:
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 1
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
return inp*2
@Node.test_func([[1,2,3,1,1]], [[1,2,3]])
@Node.test_func(["hi!!!"], ["hi!"])
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
seen = set()
seen_add = seen.add
if isinstance(seq, str):
return "".join(x for x in seq if not (x in seen or seen_add(x)))
return[type(seq)([x for x in seq if not (x in seen or seen_add(x))])] |
16641e56c6871d3d077c54cb08f7a6e15d80f41a | packages/accounts-password/email_templates.js | packages/accounts-password/email_templates.js | function greet(welcomeMsg) {
return function(user, url) {
var greeting = (user.profile && user.profile.name) ?
("Hello " + user.profile.name + ",") : "Hello,";
return `${greeting}
${welcomeMsg}, simply click the link below.
${url}
Thanks.
`;
};
}
/**
* @summary Options to customize emails sent from the Accounts system.
* @locus Server
* @importFromPackage accounts-base
*/
Accounts.emailTemplates = {
from: "Meteor Accounts <[email protected]>",
siteName: Meteor.absoluteUrl().replace(/^https?:\/\//, '').replace(/\/$/, ''),
resetPassword: {
subject: function(user) {
return "How to reset your password on " + Accounts.emailTemplates.siteName;
},
text: function(user, url) {
var greeting = (user.profile && user.profile.name) ?
("Hello " + user.profile.name + ",") : "Hello,";
return `${greeting}
To reset your password, simply click the link below.
${url}
Thanks.
`;
}
},
verifyEmail: {
subject: function(user) {
return "How to verify email address on " + Accounts.emailTemplates.siteName;
},
text: greet("To verify your account email")
},
enrollAccount: {
subject: function(user) {
return "An account has been created for you on " + Accounts.emailTemplates.siteName;
},
text: greet("To start using the service")
}
};
| function greet(welcomeMsg) {
return function(user, url) {
var greeting = (user.profile && user.profile.name) ?
("Hello " + user.profile.name + ",") : "Hello,";
return `${greeting}
${welcomeMsg}, simply click the link below.
${url}
Thanks.
`;
};
}
/**
* @summary Options to customize emails sent from the Accounts system.
* @locus Server
* @importFromPackage accounts-base
*/
Accounts.emailTemplates = {
from: "Meteor Accounts <[email protected]>",
siteName: Meteor.absoluteUrl().replace(/^https?:\/\//, '').replace(/\/$/, ''),
resetPassword: {
subject: function(user) {
return "How to reset your password on " + Accounts.emailTemplates.siteName;
},
text: greet("To reset your password")
},
verifyEmail: {
subject: function(user) {
return "How to verify email address on " + Accounts.emailTemplates.siteName;
},
text: greet("To verify your account email")
},
enrollAccount: {
subject: function(user) {
return "An account has been created for you on " + Accounts.emailTemplates.siteName;
},
text: greet("To start using the service")
}
};
| Refactor template of `resetPassword` email | Refactor template of `resetPassword` email | JavaScript | mit | Hansoft/meteor,mjmasn/meteor,Hansoft/meteor,mjmasn/meteor,Hansoft/meteor,mjmasn/meteor,mjmasn/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,mjmasn/meteor,mjmasn/meteor,Hansoft/meteor,mjmasn/meteor | javascript | ## Code Before:
function greet(welcomeMsg) {
return function(user, url) {
var greeting = (user.profile && user.profile.name) ?
("Hello " + user.profile.name + ",") : "Hello,";
return `${greeting}
${welcomeMsg}, simply click the link below.
${url}
Thanks.
`;
};
}
/**
* @summary Options to customize emails sent from the Accounts system.
* @locus Server
* @importFromPackage accounts-base
*/
Accounts.emailTemplates = {
from: "Meteor Accounts <[email protected]>",
siteName: Meteor.absoluteUrl().replace(/^https?:\/\//, '').replace(/\/$/, ''),
resetPassword: {
subject: function(user) {
return "How to reset your password on " + Accounts.emailTemplates.siteName;
},
text: function(user, url) {
var greeting = (user.profile && user.profile.name) ?
("Hello " + user.profile.name + ",") : "Hello,";
return `${greeting}
To reset your password, simply click the link below.
${url}
Thanks.
`;
}
},
verifyEmail: {
subject: function(user) {
return "How to verify email address on " + Accounts.emailTemplates.siteName;
},
text: greet("To verify your account email")
},
enrollAccount: {
subject: function(user) {
return "An account has been created for you on " + Accounts.emailTemplates.siteName;
},
text: greet("To start using the service")
}
};
## Instruction:
Refactor template of `resetPassword` email
## Code After:
function greet(welcomeMsg) {
return function(user, url) {
var greeting = (user.profile && user.profile.name) ?
("Hello " + user.profile.name + ",") : "Hello,";
return `${greeting}
${welcomeMsg}, simply click the link below.
${url}
Thanks.
`;
};
}
/**
* @summary Options to customize emails sent from the Accounts system.
* @locus Server
* @importFromPackage accounts-base
*/
Accounts.emailTemplates = {
from: "Meteor Accounts <[email protected]>",
siteName: Meteor.absoluteUrl().replace(/^https?:\/\//, '').replace(/\/$/, ''),
resetPassword: {
subject: function(user) {
return "How to reset your password on " + Accounts.emailTemplates.siteName;
},
text: greet("To reset your password")
},
verifyEmail: {
subject: function(user) {
return "How to verify email address on " + Accounts.emailTemplates.siteName;
},
text: greet("To verify your account email")
},
enrollAccount: {
subject: function(user) {
return "An account has been created for you on " + Accounts.emailTemplates.siteName;
},
text: greet("To start using the service")
}
};
|
d6ad0dd2638a61472e74d17737093415c798b3ca | cypress-testing/cypress/testing/website/events/events.js | cypress-testing/cypress/testing/website/events/events.js | /* eslint new-cap: [2, {capIsNewExceptions: ["Given", "When", "Then"]}]*/
/**
* Holds steps related to the events feature.
* @module website/events
*/
import {Given, When, Then} from 'cypress-cucumber-preprocessor/steps';
/**
* A step to navigate to the events page.
* @example
* Given I navigate to the events page
*/
const navigateToEventsPage = () => {
cy.visit({url: 'website/event/2016', method: 'GET'});
};
Given(`I navigate to the events page`, navigateToEventsPage);
/**
* A step to view a given event.
* @param {string} event - the name of event to view
* @example
* When viewing the event "Mystery Bus"
*/
const viewGivenEvent = (event) => {
cy.get('a').contains(event).click();
};
When(`viewing the event {string}`, viewGivenEvent);
/**
* A step to assert the event contains the given details.
* @param {string} expectedDetails - the expected details of the event
* @example
* Then I see details relating to "school buses"
*/
const assertEventDetails = (expectedDetails) => {
cy.get('p').contains(expectedDetails).should('be.visible');
};
Then(`I see details relating to {string}`, assertEventDetails);
| /* eslint new-cap: [2, {capIsNewExceptions: ["Given", "When", "Then"]}]*/
/**
* Holds steps related to the events feature.
* @module website/events
*/
import {Given, When, Then} from 'cypress-cucumber-preprocessor/steps';
/**
* The URL for the events page.
* @private
*/
const EVENTS_PAGE = 'website/event/';
/**
* A step to navigate to the events page.
* @example
* Given I navigate to the events page
*/
const navigateToEventsPage = () => {
// using 2016 since guaranteed about its events
cy.visit({url: EVENTS_PAGE + 2016, method: 'GET'});
};
Given(`I navigate to the events page`, navigateToEventsPage);
/**
* A step to view a given event.
* @param {string} event - the name of event to view
* @example
* When viewing the event "Mystery Bus"
*/
const viewGivenEvent = (event) => {
cy.get('a').contains(event).click();
};
When(`viewing the event {string}`, viewGivenEvent);
/**
* A step to assert the event contains the given details.
* @param {string} expectedDetails - the expected details of the event
* @example
* Then I see details relating to "school buses"
*/
const assertEventDetails = (expectedDetails) => {
cy.get('p').contains(expectedDetails).should('be.visible');
};
Then(`I see details relating to {string}`, assertEventDetails);
| Use a constant for URL | Use a constant for URL
Additionally, added a comment about why it is using 2016
| JavaScript | apache-2.0 | fras2560/mlsb-platform,fras2560/mlsb-platform,fras2560/mlsb-platform | javascript | ## Code Before:
/* eslint new-cap: [2, {capIsNewExceptions: ["Given", "When", "Then"]}]*/
/**
* Holds steps related to the events feature.
* @module website/events
*/
import {Given, When, Then} from 'cypress-cucumber-preprocessor/steps';
/**
* A step to navigate to the events page.
* @example
* Given I navigate to the events page
*/
const navigateToEventsPage = () => {
cy.visit({url: 'website/event/2016', method: 'GET'});
};
Given(`I navigate to the events page`, navigateToEventsPage);
/**
* A step to view a given event.
* @param {string} event - the name of event to view
* @example
* When viewing the event "Mystery Bus"
*/
const viewGivenEvent = (event) => {
cy.get('a').contains(event).click();
};
When(`viewing the event {string}`, viewGivenEvent);
/**
* A step to assert the event contains the given details.
* @param {string} expectedDetails - the expected details of the event
* @example
* Then I see details relating to "school buses"
*/
const assertEventDetails = (expectedDetails) => {
cy.get('p').contains(expectedDetails).should('be.visible');
};
Then(`I see details relating to {string}`, assertEventDetails);
## Instruction:
Use a constant for URL
Additionally, added a comment about why it is using 2016
## Code After:
/* eslint new-cap: [2, {capIsNewExceptions: ["Given", "When", "Then"]}]*/
/**
* Holds steps related to the events feature.
* @module website/events
*/
import {Given, When, Then} from 'cypress-cucumber-preprocessor/steps';
/**
* The URL for the events page.
* @private
*/
const EVENTS_PAGE = 'website/event/';
/**
* A step to navigate to the events page.
* @example
* Given I navigate to the events page
*/
const navigateToEventsPage = () => {
// using 2016 since guaranteed about its events
cy.visit({url: EVENTS_PAGE + 2016, method: 'GET'});
};
Given(`I navigate to the events page`, navigateToEventsPage);
/**
* A step to view a given event.
* @param {string} event - the name of event to view
* @example
* When viewing the event "Mystery Bus"
*/
const viewGivenEvent = (event) => {
cy.get('a').contains(event).click();
};
When(`viewing the event {string}`, viewGivenEvent);
/**
* A step to assert the event contains the given details.
* @param {string} expectedDetails - the expected details of the event
* @example
* Then I see details relating to "school buses"
*/
const assertEventDetails = (expectedDetails) => {
cy.get('p').contains(expectedDetails).should('be.visible');
};
Then(`I see details relating to {string}`, assertEventDetails);
|
1c7631529c4b13e61c7be63a325e69ba9e7e92e4 | docs/templates/docker.md | docs/templates/docker.md |
The following command download Auto-Keras docker image to your machine.
```
docker pull garawalid/autokeras:latest
```
Image releases are tagged using the following format:
| Tag | Description|
| ------------- |:-------------:|
|latest|Auto-Keras image|
|devel| Auto-Keras image that tracks Github repository|
## Start Auto-Keras Docker container
```
docker run -it --shm-size 2G garawalid/autokeras /bin/bash
```
In case you need more memory to run the container, change the value of `shm-size`. ([Docker run reference](https://docs.docker.com/engine/reference/run/#general-form))
## Run application :
To run a local script `file.py` using Auto-Keras within the container, mount the host directory `-v hostDir:/app`.
```
docker run -it -v hostDir:/app --shm-size 2G garawalid/autokeras python file.py
```
## Example :
Let's download the mnist example and run it within the container.
Download the example :
```
curl https://raw.githubusercontent.com/keras-team/autokeras/master/examples/mnist.py --output mnist.py
```
Run the mnist example :
```
docker run -it -v "$(pwd)":/app --shm-size 2G garawalid/autokeras python mnist.py
```
|
The following command download Auto-Keras docker image to your machine.
```
docker pull haifengjin/autokeras:latest
```
Image releases are tagged using the following format:
| Tag | Description|
| ------------- |:-------------:|
|latest|Auto-Keras image|
|devel| Auto-Keras image that tracks Github repository|
## Start Auto-Keras Docker container
```
docker run -it --shm-size 2G haifengjin/autokeras /bin/bash
```
In case you need more memory to run the container, change the value of `shm-size`. ([Docker run reference](https://docs.docker.com/engine/reference/run/#general-form))
## Run application :
To run a local script `file.py` using Auto-Keras within the container, mount the host directory `-v hostDir:/app`.
```
docker run -it -v hostDir:/app --shm-size 2G haifengjin/autokeras python file.py
```
## Example :
Let's download the mnist example and run it within the container.
Download the example :
```
curl https://raw.githubusercontent.com/keras-team/autokeras/master/examples/mnist.py --output mnist.py
```
Run the mnist example :
```
docker run -it -v "$(pwd)":/app --shm-size 2G haifengjin/autokeras python mnist.py
```
| Switch Docker example to haifengjin/autokeras | Switch Docker example to haifengjin/autokeras | Markdown | apache-2.0 | keras-team/autokeras,keras-team/autokeras,keras-team/autokeras | markdown | ## Code Before:
The following command download Auto-Keras docker image to your machine.
```
docker pull garawalid/autokeras:latest
```
Image releases are tagged using the following format:
| Tag | Description|
| ------------- |:-------------:|
|latest|Auto-Keras image|
|devel| Auto-Keras image that tracks Github repository|
## Start Auto-Keras Docker container
```
docker run -it --shm-size 2G garawalid/autokeras /bin/bash
```
In case you need more memory to run the container, change the value of `shm-size`. ([Docker run reference](https://docs.docker.com/engine/reference/run/#general-form))
## Run application :
To run a local script `file.py` using Auto-Keras within the container, mount the host directory `-v hostDir:/app`.
```
docker run -it -v hostDir:/app --shm-size 2G garawalid/autokeras python file.py
```
## Example :
Let's download the mnist example and run it within the container.
Download the example :
```
curl https://raw.githubusercontent.com/keras-team/autokeras/master/examples/mnist.py --output mnist.py
```
Run the mnist example :
```
docker run -it -v "$(pwd)":/app --shm-size 2G garawalid/autokeras python mnist.py
```
## Instruction:
Switch Docker example to haifengjin/autokeras
## Code After:
The following command download Auto-Keras docker image to your machine.
```
docker pull haifengjin/autokeras:latest
```
Image releases are tagged using the following format:
| Tag | Description|
| ------------- |:-------------:|
|latest|Auto-Keras image|
|devel| Auto-Keras image that tracks Github repository|
## Start Auto-Keras Docker container
```
docker run -it --shm-size 2G haifengjin/autokeras /bin/bash
```
In case you need more memory to run the container, change the value of `shm-size`. ([Docker run reference](https://docs.docker.com/engine/reference/run/#general-form))
## Run application :
To run a local script `file.py` using Auto-Keras within the container, mount the host directory `-v hostDir:/app`.
```
docker run -it -v hostDir:/app --shm-size 2G haifengjin/autokeras python file.py
```
## Example :
Let's download the mnist example and run it within the container.
Download the example :
```
curl https://raw.githubusercontent.com/keras-team/autokeras/master/examples/mnist.py --output mnist.py
```
Run the mnist example :
```
docker run -it -v "$(pwd)":/app --shm-size 2G haifengjin/autokeras python mnist.py
```
|