commit
stringlengths
40
40
old_file
stringlengths
4
184
new_file
stringlengths
4
184
old_contents
stringlengths
1
3.6k
new_contents
stringlengths
5
3.38k
subject
stringlengths
15
778
message
stringlengths
16
6.74k
lang
stringclasses
201 values
license
stringclasses
13 values
repos
stringlengths
6
116k
config
stringclasses
201 values
content
stringlengths
137
7.24k
diff
stringlengths
26
5.55k
diff_length
int64
1
123
relative_diff_length
float64
0.01
89
n_lines_added
int64
0
108
n_lines_deleted
int64
0
106
86eabdf9df970b1ae6554888ceb27cd9318fa62d
lib/tmuxinator/assets/template.erb
lib/tmuxinator/assets/template.erb
<%= tmux %> start-server\; has-session -t <%= name %> 2>/dev/null if [ "$?" -eq 1 ]; then cd <%= root || "." %> # Run pre command. <%= pre %> # Create the session and the first window. <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %> # Set the default path. <%= tmux %> set-option -t <%= name %> default-path <%= root -%> 1>/dev/null # Create other windows. <%- windows.drop(1).each do |window| -%> <%= window.tmux_new_window_command %> <%- end -%> <%- windows.each do |window| -%> # Window "<%= window.name %>" <%- unless window.panes? -%> <%= window.tmux_pre_window_command %> <%= window.tmux_main_command %> <%- else -%> <%- window.panes.each do |pane| -%> <%= pane.tmux_pre_window_command %> <%= pane.tmux_pre_command %> <%= pane.tmux_main_command %> <%- unless pane.last? -%> <%= pane.tmux_split_command %> <%- end -%> <%- end -%> <%= window.tmux_layout_command %> <%= window.tmux_select_first_pane %> <%- end -%> <%- end -%> <%= tmux %> select-window -t <%= base_index %> fi <%= tmux %> -u attach-session -t <%= name %>
<%= tmux %> start-server\; has-session -t <%= name %> 2>/dev/null if [ "$?" -eq 1 ]; then cd <%= root || "." %> # Run pre command. <%= pre %> # Create the session and the first window. <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %> # Set the default path. <%= tmux %> set-option -t <%= name %> default-path <%= root -%> 1>/dev/null # Create other windows. <%- windows.drop(1).each do |window| -%> <%= window.tmux_new_window_command %> <%- end -%> <%- windows.each do |window| -%> # Window "<%= window.name %>" <%- unless window.panes? -%> <%= window.tmux_pre_window_command %> <%= window.tmux_main_command %> <%- else -%> <%- window.panes.each do |pane| -%> <%= pane.tmux_pre_window_command %> <%= pane.tmux_pre_command %> <%= pane.tmux_main_command %> <%- unless pane.last? -%> <%= pane.tmux_split_command %> <%- end -%> <%= window.tmux_layout_command %> <%- end -%> <%= window.tmux_select_first_pane %> <%- end -%> <%- end -%> <%= tmux %> select-window -t <%= base_index %> fi <%= tmux %> -u attach-session -t <%= name %>
Set tmux layout after each pane creation
Set tmux layout after each pane creation The tmux layout need to be set after each pane creation in order to prevent the lack of space and a "create pane failed: pane too small" error
HTML+ERB
mit
adamstrickland/tmuxinator,marcinmagier/tmuxinator,andyw8/tmuxinator,jlipps/tmuxinator,jlipps/tmuxinator,marcinmagier/tmuxinator,sjfloat/tmuxinator,jasonchaffee/tmuxinator,andyw8/tmuxinator,adamstrickland/tmuxinator,guyhughes/tmuxinator,azat/tmuxinator,aMoniker/tmuxinator,danimad/tmuxinator,benizi/tmuxinator,magicalbanana/tmuxinator,cinaeco/tmuxinator,pczarn/tmuxinator,magicalbanana/tmuxinator,guyhughes/tmuxinator,ethagnawl/tmuxinator,guyhughes/tmuxinator,adamstrickland/tmuxinator,pczarn/tmuxinator,marwensaid/tmuxinator,J3RN/tmuxinator,aMoniker/tmuxinator,pczarn/tmuxinator,podung/tmuxinator,J3RN/tmuxinator,tmuxinator/tmuxinator,marwensaid/tmuxinator,jasonchaffee/tmuxinator,sjfloat/tmuxinator,sideci-sample/sideci-sample-tmuxinator,benizi/tmuxinator,aMoniker/tmuxinator,tmuxinator/tmuxinator,azat/tmuxinator,klaxalk/tmux,danimad/tmuxinator,podung/tmuxinator,ethagnawl/tmuxinator,benizi/tmuxinator,tmuxinator/tmuxinator,danimad/tmuxinator,marcinmagier/tmuxinator,sachin21/tmuxinator,klaxalk/tmux,podung/tmuxinator,sjfloat/tmuxinator,jasonchaffee/tmuxinator,klaxalk/tmux,marwensaid/tmuxinator,cinaeco/tmuxinator,magicalbanana/tmuxinator,sideci-sample/sideci-sample-tmuxinator,azat/tmuxinator,cinaeco/tmuxinator,ethagnawl/tmuxinator,sachin21/tmuxinator,J3RN/tmuxinator,klaxalk/tmux,sachin21/tmuxinator,jlipps/tmuxinator,klaxalk/tmux
html+erb
## Code Before: <%= tmux %> start-server\; has-session -t <%= name %> 2>/dev/null if [ "$?" -eq 1 ]; then cd <%= root || "." %> # Run pre command. <%= pre %> # Create the session and the first window. <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %> # Set the default path. <%= tmux %> set-option -t <%= name %> default-path <%= root -%> 1>/dev/null # Create other windows. <%- windows.drop(1).each do |window| -%> <%= window.tmux_new_window_command %> <%- end -%> <%- windows.each do |window| -%> # Window "<%= window.name %>" <%- unless window.panes? -%> <%= window.tmux_pre_window_command %> <%= window.tmux_main_command %> <%- else -%> <%- window.panes.each do |pane| -%> <%= pane.tmux_pre_window_command %> <%= pane.tmux_pre_command %> <%= pane.tmux_main_command %> <%- unless pane.last? -%> <%= pane.tmux_split_command %> <%- end -%> <%- end -%> <%= window.tmux_layout_command %> <%= window.tmux_select_first_pane %> <%- end -%> <%- end -%> <%= tmux %> select-window -t <%= base_index %> fi <%= tmux %> -u attach-session -t <%= name %> ## Instruction: Set tmux layout after each pane creation The tmux layout need to be set after each pane creation in order to prevent the lack of space and a "create pane failed: pane too small" error ## Code After: <%= tmux %> start-server\; has-session -t <%= name %> 2>/dev/null if [ "$?" -eq 1 ]; then cd <%= root || "." %> # Run pre command. <%= pre %> # Create the session and the first window. <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %> # Set the default path. <%= tmux %> set-option -t <%= name %> default-path <%= root -%> 1>/dev/null # Create other windows. <%- windows.drop(1).each do |window| -%> <%= window.tmux_new_window_command %> <%- end -%> <%- windows.each do |window| -%> # Window "<%= window.name %>" <%- unless window.panes? -%> <%= window.tmux_pre_window_command %> <%= window.tmux_main_command %> <%- else -%> <%- window.panes.each do |pane| -%> <%= pane.tmux_pre_window_command %> <%= pane.tmux_pre_command %> <%= pane.tmux_main_command %> <%- unless pane.last? -%> <%= pane.tmux_split_command %> <%- end -%> <%= window.tmux_layout_command %> <%- end -%> <%= window.tmux_select_first_pane %> <%- end -%> <%- end -%> <%= tmux %> select-window -t <%= base_index %> fi <%= tmux %> -u attach-session -t <%= name %>
<%= tmux %> start-server\; has-session -t <%= name %> 2>/dev/null if [ "$?" -eq 1 ]; then cd <%= root || "." %> # Run pre command. <%= pre %> # Create the session and the first window. <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %> # Set the default path. <%= tmux %> set-option -t <%= name %> default-path <%= root -%> 1>/dev/null # Create other windows. <%- windows.drop(1).each do |window| -%> - <%= window.tmux_new_window_command %> + <%= window.tmux_new_window_command %> ? ++ <%- end -%> <%- windows.each do |window| -%> # Window "<%= window.name %>" <%- unless window.panes? -%> - <%= window.tmux_pre_window_command %> + <%= window.tmux_pre_window_command %> ? ++++ - <%= window.tmux_main_command %> + <%= window.tmux_main_command %> ? ++++ <%- else -%> <%- window.panes.each do |pane| -%> - <%= pane.tmux_pre_window_command %> + <%= pane.tmux_pre_window_command %> ? ++++++ - <%= pane.tmux_pre_command %> + <%= pane.tmux_pre_command %> ? ++++++ - <%= pane.tmux_main_command %> + <%= pane.tmux_main_command %> ? ++++++ - + <%- unless pane.last? -%> - <%= pane.tmux_split_command %> + <%= pane.tmux_split_command %> ? ++++++ <%- end -%> + + <%= window.tmux_layout_command %> <%- end -%> - <%= window.tmux_layout_command %> - <%= window.tmux_select_first_pane %> + <%= window.tmux_select_first_pane %> ? ++++ <%- end -%> <%- end -%> <%= tmux %> select-window -t <%= base_index %> fi <%= tmux %> -u attach-session -t <%= name %>
21
0.456522
11
10
e6a90167aa29c126ce5d0398faedbbba582df7c3
lib/CodeGen/README.txt
lib/CodeGen/README.txt
IRgen optimization opportunities. //===---------------------------------------------------------------------===// The common pattern of -- short x; // or char, etc (x == 10) -- generates an zext/sext of x which can easily be avoided. //===---------------------------------------------------------------------===// Bitfields accesses can be shifted to simplify masking and sign extension. For example, if the bitfield width is 8 and it is appropriately aligned then is is a lot shorter to just load the char directly. //===---------------------------------------------------------------------===// It may be worth avoiding creation of alloca's for formal arguments for the common situation where the argument is never written to or has its address taken. The idea would be to begin generating code by using the argument directly and if its address is taken or it is stored to then generate the alloca and patch up the existing code. In theory, the same optimization could be a win for block local variables as long as the declaration dominates all statements in the block. //===---------------------------------------------------------------------===//
IRgen optimization opportunities. //===---------------------------------------------------------------------===// The common pattern of -- short x; // or char, etc (x == 10) -- generates an zext/sext of x which can easily be avoided. //===---------------------------------------------------------------------===// Bitfields accesses can be shifted to simplify masking and sign extension. For example, if the bitfield width is 8 and it is appropriately aligned then is is a lot shorter to just load the char directly. //===---------------------------------------------------------------------===// It may be worth avoiding creation of alloca's for formal arguments for the common situation where the argument is never written to or has its address taken. The idea would be to begin generating code by using the argument directly and if its address is taken or it is stored to then generate the alloca and patch up the existing code. In theory, the same optimization could be a win for block local variables as long as the declaration dominates all statements in the block. //===---------------------------------------------------------------------===// We should try and avoid generating basic blocks which only contain jumps. At -O0, this penalizes us all the way from IRgen (malloc & instruction overhead), all the way down through code generation and assembly time. On 176.gcc:expr.ll, it looks like over 12% of basic blocks are just direct branches. //===---------------------------------------------------------------------===// There are some more places where we could avoid generating unreachable code. For example: void f0(int a) { abort(); if (a) printf("hi"); } still generates a call to printf. This doesn't occur much in real code, but would still be nice to clean up. //===---------------------------------------------------------------------===//
Add some IRgen improvement notes.
Add some IRgen improvement notes. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@65146 91177308-0d34-0410-b5e6-96231b3b80d8
Text
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
text
## Code Before: IRgen optimization opportunities. //===---------------------------------------------------------------------===// The common pattern of -- short x; // or char, etc (x == 10) -- generates an zext/sext of x which can easily be avoided. //===---------------------------------------------------------------------===// Bitfields accesses can be shifted to simplify masking and sign extension. For example, if the bitfield width is 8 and it is appropriately aligned then is is a lot shorter to just load the char directly. //===---------------------------------------------------------------------===// It may be worth avoiding creation of alloca's for formal arguments for the common situation where the argument is never written to or has its address taken. The idea would be to begin generating code by using the argument directly and if its address is taken or it is stored to then generate the alloca and patch up the existing code. In theory, the same optimization could be a win for block local variables as long as the declaration dominates all statements in the block. //===---------------------------------------------------------------------===// ## Instruction: Add some IRgen improvement notes. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@65146 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: IRgen optimization opportunities. //===---------------------------------------------------------------------===// The common pattern of -- short x; // or char, etc (x == 10) -- generates an zext/sext of x which can easily be avoided. //===---------------------------------------------------------------------===// Bitfields accesses can be shifted to simplify masking and sign extension. For example, if the bitfield width is 8 and it is appropriately aligned then is is a lot shorter to just load the char directly. //===---------------------------------------------------------------------===// It may be worth avoiding creation of alloca's for formal arguments for the common situation where the argument is never written to or has its address taken. The idea would be to begin generating code by using the argument directly and if its address is taken or it is stored to then generate the alloca and patch up the existing code. In theory, the same optimization could be a win for block local variables as long as the declaration dominates all statements in the block. //===---------------------------------------------------------------------===// We should try and avoid generating basic blocks which only contain jumps. At -O0, this penalizes us all the way from IRgen (malloc & instruction overhead), all the way down through code generation and assembly time. On 176.gcc:expr.ll, it looks like over 12% of basic blocks are just direct branches. //===---------------------------------------------------------------------===// There are some more places where we could avoid generating unreachable code. For example: void f0(int a) { abort(); if (a) printf("hi"); } still generates a call to printf. This doesn't occur much in real code, but would still be nice to clean up. //===---------------------------------------------------------------------===//
IRgen optimization opportunities. //===---------------------------------------------------------------------===// The common pattern of -- short x; // or char, etc (x == 10) -- generates an zext/sext of x which can easily be avoided. //===---------------------------------------------------------------------===// Bitfields accesses can be shifted to simplify masking and sign extension. For example, if the bitfield width is 8 and it is appropriately aligned then is is a lot shorter to just load the char directly. //===---------------------------------------------------------------------===// It may be worth avoiding creation of alloca's for formal arguments for the common situation where the argument is never written to or has its address taken. The idea would be to begin generating code by using the argument directly and if its address is taken or it is stored to then generate the alloca and patch up the existing code. In theory, the same optimization could be a win for block local variables as long as the declaration dominates all statements in the block. //===---------------------------------------------------------------------===// + We should try and avoid generating basic blocks which only contain + jumps. At -O0, this penalizes us all the way from IRgen (malloc & + instruction overhead), all the way down through code generation and + assembly time. + + On 176.gcc:expr.ll, it looks like over 12% of basic blocks are just + direct branches. + + //===---------------------------------------------------------------------===// + + There are some more places where we could avoid generating unreachable code. For + example: + void f0(int a) { abort(); if (a) printf("hi"); } + still generates a call to printf. This doesn't occur much in real + code, but would still be nice to clean up. + + //===---------------------------------------------------------------------===//
17
0.53125
17
0
434dca3985c303967ed873349842f702aa3419d1
client/components/Text/Text.js
client/components/Text/Text.js
import cn from 'classnames' import React from 'react' import styles from './Text.css' export function Caption ({ children }) { return ( <div className={styles.caption}> {children} </div> ) } export function Headline ({ children }) { return ( <h3 className={styles.headline}> {children} </h3> ) } export function Hint ({ children, className }) { return ( <div className={cn(styles.hint, className)}> {children} </div> ) } export function PrimaryText ({ children, className }) { return ( <div className={cn(styles.primary, className)}> {children} </div> ) } export function SecondaryText ({ children, className }) { return ( <div className={cn(styles.secondary, className)}> {children} </div> ) } export function Title ({ children }) { return ( <div className={styles.title}> {children} </div> ) }
import cn from 'classnames' import React from 'react' import styles from './Text.css' export function Caption ({ children }) { return ( <div className={styles.caption}> {children} </div> ) } export function Headline ({ children }) { return ( <h3 className={styles.headline}> {children} </h3> ) } export function Hint ({ children, className }) { return ( <div className={cn(styles.hint, className)}> {children} </div> ) } export function PrimaryText ({ children, className }) { return ( <div className={cn(styles.primary, className)}> {children} </div> ) } export function SecondaryText ({ children, className }) { return ( <div className={cn(styles.secondary, className)}> {children} </div> ) } export function Title ({ children, className }) { return ( <div className={cn(styles.title, className)}> {children} </div> ) }
Add className to Title component
Add className to Title component
JavaScript
apache-2.0
cesarandreu/bshed,cesarandreu/bshed
javascript
## Code Before: import cn from 'classnames' import React from 'react' import styles from './Text.css' export function Caption ({ children }) { return ( <div className={styles.caption}> {children} </div> ) } export function Headline ({ children }) { return ( <h3 className={styles.headline}> {children} </h3> ) } export function Hint ({ children, className }) { return ( <div className={cn(styles.hint, className)}> {children} </div> ) } export function PrimaryText ({ children, className }) { return ( <div className={cn(styles.primary, className)}> {children} </div> ) } export function SecondaryText ({ children, className }) { return ( <div className={cn(styles.secondary, className)}> {children} </div> ) } export function Title ({ children }) { return ( <div className={styles.title}> {children} </div> ) } ## Instruction: Add className to Title component ## Code After: import cn from 'classnames' import React from 'react' import styles from './Text.css' export function Caption ({ children }) { return ( <div className={styles.caption}> {children} </div> ) } export function Headline ({ children }) { return ( <h3 className={styles.headline}> {children} </h3> ) } export function Hint ({ children, className }) { return ( <div className={cn(styles.hint, className)}> {children} </div> ) } export function PrimaryText ({ children, className }) { return ( <div className={cn(styles.primary, className)}> {children} </div> ) } export function SecondaryText ({ children, className }) { return ( <div className={cn(styles.secondary, className)}> {children} </div> ) } export function Title ({ children, className }) { return ( <div className={cn(styles.title, className)}> {children} </div> ) }
import cn from 'classnames' import React from 'react' import styles from './Text.css' export function Caption ({ children }) { return ( <div className={styles.caption}> {children} </div> ) } export function Headline ({ children }) { return ( <h3 className={styles.headline}> {children} </h3> ) } export function Hint ({ children, className }) { return ( <div className={cn(styles.hint, className)}> {children} </div> ) } export function PrimaryText ({ children, className }) { return ( <div className={cn(styles.primary, className)}> {children} </div> ) } export function SecondaryText ({ children, className }) { return ( <div className={cn(styles.secondary, className)}> {children} </div> ) } - export function Title ({ children }) { + export function Title ({ children, className }) { ? +++++++++++ return ( - <div className={styles.title}> + <div className={cn(styles.title, className)}> ? +++ ++++++++++++ {children} </div> ) }
4
0.078431
2
2
86d4ffb883dbb6b08b14d220c0d4d1ae483e5ad9
package.json
package.json
{ "name": "conductor", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "test": "node_modules/.bin/mocha --harmony --recursive tests" }, "author": "", "license": "MPL-2.0", "dependencies": { "async": "^1.4.2", "cradle": "^0.6.9", "jannah-client": "asynchq/jannah-client", "request": "^2.65.0" }, "devDependencies": { "mocha": "^2.3.3", "nock": "^2.15.0", "should": "^7.1.1" } }
{ "name": "conductor", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "test": "node_modules/.bin/mocha --harmony --recursive tests" }, "author": "", "license": "MPL-2.0", "dependencies": { "async": "^1.4.2", "cradle": "^0.6.9", "jannah-client": "asynchq/jannah-client", "request": "^2.65.0" }, "devDependencies": { "mocha": "^2.3.3", "mock-couch": "dainis/mock-couch#changes_for_follow", "nock": "^2.15.0", "should": "^7.1.1" } }
Use forked version of mock-couch while upstream hasn't accepted pull request
Use forked version of mock-couch while upstream hasn't accepted pull request
JSON
mpl-2.0
mozilla/compatipede,mozilla/compatipede,mozilla/compatipede
json
## Code Before: { "name": "conductor", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "test": "node_modules/.bin/mocha --harmony --recursive tests" }, "author": "", "license": "MPL-2.0", "dependencies": { "async": "^1.4.2", "cradle": "^0.6.9", "jannah-client": "asynchq/jannah-client", "request": "^2.65.0" }, "devDependencies": { "mocha": "^2.3.3", "nock": "^2.15.0", "should": "^7.1.1" } } ## Instruction: Use forked version of mock-couch while upstream hasn't accepted pull request ## Code After: { "name": "conductor", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "test": "node_modules/.bin/mocha --harmony --recursive tests" }, "author": "", "license": "MPL-2.0", "dependencies": { "async": "^1.4.2", "cradle": "^0.6.9", "jannah-client": "asynchq/jannah-client", "request": "^2.65.0" }, "devDependencies": { "mocha": "^2.3.3", "mock-couch": "dainis/mock-couch#changes_for_follow", "nock": "^2.15.0", "should": "^7.1.1" } }
{ "name": "conductor", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "test": "node_modules/.bin/mocha --harmony --recursive tests" }, "author": "", "license": "MPL-2.0", "dependencies": { "async": "^1.4.2", "cradle": "^0.6.9", "jannah-client": "asynchq/jannah-client", "request": "^2.65.0" }, "devDependencies": { "mocha": "^2.3.3", + "mock-couch": "dainis/mock-couch#changes_for_follow", "nock": "^2.15.0", "should": "^7.1.1" } }
1
0.045455
1
0
5552691dbd8b16842cd3a4b0907225dce7ecb35f
CHANGELOG.md
CHANGELOG.md
All notable changes to `cakephp-api-pagination` will be documented in this file. ## 0.0.4 - 2015-08-15 ### Added - More updates to the README/docs. - Renamed the `setVisible` method to` setVisibility`. - Started testing. - Filled in the changelog. ### Fixed - Fixed write/turn fatal error in PHP 5.4. ## 0.0.3 - 2015-07-27 ### Added - More usage docs. ### Fixed - Fix operator precedence for checking for ApiPagination-able requests. ## 0.0.2 - 2015-07-27 ### Added - A couple README updates. ### Fixed - Add "cakephp-plugin" type to composer.json so it actually installs as a CakePHP plugin. ## 0.0.1 - 2015-07-25 ### Added - Project skeleton and initial version of the ApiPagination component.
All notable changes to `cakephp-api-pagination` will be documented in this file. ## 0.0.5 - 2015-08-28 ### Added - Actual tests for ApiPaginationComponent's beforeRender of appropriate view var setting. ### Fixed - Updated link to have nice name in README. ### Removed - Removed an unused class that was being used in the test case. - Old bogus test code. ## 0.0.4 - 2015-08-15 ### Added - More updates to the README/docs. - Renamed the `setVisible` method to` setVisibility`. - Started testing. - Filled in the changelog. ### Fixed - Fixed write/turn fatal error in PHP 5.4. ## 0.0.3 - 2015-07-27 ### Added - More usage docs. ### Fixed - Fix operator precedence for checking for ApiPagination-able requests. ## 0.0.2 - 2015-07-27 ### Added - A couple README updates. ### Fixed - Add "cakephp-plugin" type to composer.json so it actually installs as a CakePHP plugin. ## 0.0.1 - 2015-07-25 ### Added - Project skeleton and initial version of the ApiPagination component.
Update changelog for 0.0.5 release
Update changelog for 0.0.5 release
Markdown
mit
bcrowe/cakephp-api-pagination
markdown
## Code Before: All notable changes to `cakephp-api-pagination` will be documented in this file. ## 0.0.4 - 2015-08-15 ### Added - More updates to the README/docs. - Renamed the `setVisible` method to` setVisibility`. - Started testing. - Filled in the changelog. ### Fixed - Fixed write/turn fatal error in PHP 5.4. ## 0.0.3 - 2015-07-27 ### Added - More usage docs. ### Fixed - Fix operator precedence for checking for ApiPagination-able requests. ## 0.0.2 - 2015-07-27 ### Added - A couple README updates. ### Fixed - Add "cakephp-plugin" type to composer.json so it actually installs as a CakePHP plugin. ## 0.0.1 - 2015-07-25 ### Added - Project skeleton and initial version of the ApiPagination component. ## Instruction: Update changelog for 0.0.5 release ## Code After: All notable changes to `cakephp-api-pagination` will be documented in this file. ## 0.0.5 - 2015-08-28 ### Added - Actual tests for ApiPaginationComponent's beforeRender of appropriate view var setting. ### Fixed - Updated link to have nice name in README. ### Removed - Removed an unused class that was being used in the test case. - Old bogus test code. ## 0.0.4 - 2015-08-15 ### Added - More updates to the README/docs. - Renamed the `setVisible` method to` setVisibility`. - Started testing. - Filled in the changelog. ### Fixed - Fixed write/turn fatal error in PHP 5.4. ## 0.0.3 - 2015-07-27 ### Added - More usage docs. ### Fixed - Fix operator precedence for checking for ApiPagination-able requests. ## 0.0.2 - 2015-07-27 ### Added - A couple README updates. ### Fixed - Add "cakephp-plugin" type to composer.json so it actually installs as a CakePHP plugin. ## 0.0.1 - 2015-07-25 ### Added - Project skeleton and initial version of the ApiPagination component.
All notable changes to `cakephp-api-pagination` will be documented in this file. + + ## 0.0.5 - 2015-08-28 + + ### Added + - Actual tests for ApiPaginationComponent's beforeRender of appropriate + view var setting. + + ### Fixed + - Updated link to have nice name in README. + + ### Removed + - Removed an unused class that was being used in the test case. + - Old bogus test code. ## 0.0.4 - 2015-08-15 ### Added - More updates to the README/docs. - Renamed the `setVisible` method to` setVisibility`. - Started testing. - Filled in the changelog. ### Fixed - Fixed write/turn fatal error in PHP 5.4. ## 0.0.3 - 2015-07-27 ### Added - More usage docs. ### Fixed - Fix operator precedence for checking for ApiPagination-able requests. ## 0.0.2 - 2015-07-27 ### Added - A couple README updates. ### Fixed - Add "cakephp-plugin" type to composer.json so it actually installs as a CakePHP plugin. ## 0.0.1 - 2015-07-25 ### Added - Project skeleton and initial version of the ApiPagination component.
13
0.382353
13
0
c13e00210eb1b377f37b8baea84913fc63db11f5
browser_windows.go
browser_windows.go
package browser func openBrowser(url string) error { return runCmd("cmd", "/c", "start", url) }
package browser import ( "strings" ) func openBrowser(url string) error { r := strings.NewReplacer("&", "^&") return runCmd("cmd", "/c", "start", r.Replace(url)) }
Fix Windows code to allow multiple GET parameters
Fix Windows code to allow multiple GET parameters
Go
bsd-2-clause
pkg/browser
go
## Code Before: package browser func openBrowser(url string) error { return runCmd("cmd", "/c", "start", url) } ## Instruction: Fix Windows code to allow multiple GET parameters ## Code After: package browser import ( "strings" ) func openBrowser(url string) error { r := strings.NewReplacer("&", "^&") return runCmd("cmd", "/c", "start", r.Replace(url)) }
package browser + import ( + "strings" + ) + func openBrowser(url string) error { + r := strings.NewReplacer("&", "^&") - return runCmd("cmd", "/c", "start", url) + return runCmd("cmd", "/c", "start", r.Replace(url)) ? ++++++++++ + }
7
1.4
6
1
78c19a634a06277e134c3af1024f9648bc3d3b26
kolibri/core/assets/src/api-resources/facilityTask.js
kolibri/core/assets/src/api-resources/facilityTask.js
import { Resource } from 'kolibri.lib.apiResource'; export default new Resource({ name: 'facilitytask', /** * @param {string} facility * @return {Promise} */ dataportalsync(facility) { return this.postListEndpoint('startdataportalsync', { facility }); }, /** * @return {Promise} */ dataportalbulksync() { return this.postListEndpoint('startdataportalbulksync'); }, deleteFinishedTasks() { return this.postListEndpoint('deletefinishedtasks'); }, });
import { Resource } from 'kolibri.lib.apiResource'; export default new Resource({ name: 'facilitytask', /** * @param {string} facility * @return {Promise} */ dataportalsync(facility) { return this.postListEndpoint('startdataportalsync', { facility }); }, /** * @return {Promise} */ dataportalbulksync() { return this.postListEndpoint('startdataportalbulksync'); }, /** * @return {Promise} */ deleteFinishedTasks() { return this.postListEndpoint('deletefinishedtasks'); }, /** * @param {string} facility * @return {Promise} */ deleteFacility(facility) { return this.postListEndpoint('deletefacility', { facility }); }, });
Add JS resource for new endpoint
Add JS resource for new endpoint
JavaScript
mit
mrpau/kolibri,indirectlylit/kolibri,mrpau/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri
javascript
## Code Before: import { Resource } from 'kolibri.lib.apiResource'; export default new Resource({ name: 'facilitytask', /** * @param {string} facility * @return {Promise} */ dataportalsync(facility) { return this.postListEndpoint('startdataportalsync', { facility }); }, /** * @return {Promise} */ dataportalbulksync() { return this.postListEndpoint('startdataportalbulksync'); }, deleteFinishedTasks() { return this.postListEndpoint('deletefinishedtasks'); }, }); ## Instruction: Add JS resource for new endpoint ## Code After: import { Resource } from 'kolibri.lib.apiResource'; export default new Resource({ name: 'facilitytask', /** * @param {string} facility * @return {Promise} */ dataportalsync(facility) { return this.postListEndpoint('startdataportalsync', { facility }); }, /** * @return {Promise} */ dataportalbulksync() { return this.postListEndpoint('startdataportalbulksync'); }, /** * @return {Promise} */ deleteFinishedTasks() { return this.postListEndpoint('deletefinishedtasks'); }, /** * @param {string} facility * @return {Promise} */ deleteFacility(facility) { return this.postListEndpoint('deletefacility', { facility }); }, });
import { Resource } from 'kolibri.lib.apiResource'; export default new Resource({ name: 'facilitytask', /** * @param {string} facility * @return {Promise} */ dataportalsync(facility) { return this.postListEndpoint('startdataportalsync', { facility }); }, /** * @return {Promise} */ dataportalbulksync() { return this.postListEndpoint('startdataportalbulksync'); }, + /** + * @return {Promise} + */ deleteFinishedTasks() { return this.postListEndpoint('deletefinishedtasks'); }, + + /** + * @param {string} facility + * @return {Promise} + */ + deleteFacility(facility) { + return this.postListEndpoint('deletefacility', { facility }); + }, });
11
0.458333
11
0
41d14466d99f554a0971ac44b7e6d98c595b9209
.smalltalk.ston
.smalltalk.ston
SmalltalkCISpec { #loading : [ SCIMetacelloLoadSpec { #baseline : 'OpenSqueakMap', #directory : 'packages', #load : [ 'TravisCI' ], #platforms : [ #squeak ] } ] }
SmalltalkCISpec { #loading : [ SCIMetacelloLoadSpec { #baseline : 'OpenSqueakMap', #directory : 'packages', #load : [ 'TravisCI' ], #platforms : [ #squeak ], #useLatestMetacello : true } ] }
Make sure travis gets to use the latest metacello
Make sure travis gets to use the latest metacello This hopefully fixes travis failing while trying to load the project
STON
mit
HPI-SWA-Teaching/SWT16-Project-04,HPI-SWA-Teaching/SWT16-Project-04
ston
## Code Before: SmalltalkCISpec { #loading : [ SCIMetacelloLoadSpec { #baseline : 'OpenSqueakMap', #directory : 'packages', #load : [ 'TravisCI' ], #platforms : [ #squeak ] } ] } ## Instruction: Make sure travis gets to use the latest metacello This hopefully fixes travis failing while trying to load the project ## Code After: SmalltalkCISpec { #loading : [ SCIMetacelloLoadSpec { #baseline : 'OpenSqueakMap', #directory : 'packages', #load : [ 'TravisCI' ], #platforms : [ #squeak ], #useLatestMetacello : true } ] }
SmalltalkCISpec { #loading : [ SCIMetacelloLoadSpec { #baseline : 'OpenSqueakMap', #directory : 'packages', #load : [ 'TravisCI' ], - #platforms : [ #squeak ] + #platforms : [ #squeak ], ? + + #useLatestMetacello : true } ] }
3
0.3
2
1
51701b35d9ef9401abf0d86fd5726e669326390d
scripts/nipy_4dto3D.py
scripts/nipy_4dto3D.py
''' Tiny script to write 4D files in any format that we read (nifti, analyze, MINC, at the moment, as nifti 3D files ''' import os import sys import nipy.io.imageformats as nii if __name__ == '__main__': try: fname = sys.argv[1] except IndexError: raise OSError('Expecting 4d image filename') img = nii.load(fname) imgs = nii.four_to_three(img) froot, ext = os.path.splitext(fname) if ext in ('.gz', '.bz2'): froot, ext = os.path.splitext(froot) for i, img3d in enumerate(imgs): fname3d = '%s_%04d.nii' % (froot, i) nii.save(img3d, fname3d)
''' Tiny script to write 4D files in any format that we read (nifti, analyze, MINC, at the moment, as nifti 3D files ''' import os import nipy.externals.argparse as argparse import nipy.io.imageformats as nii def main(): # create the parser parser = argparse.ArgumentParser() # add the arguments parser.add_argument('filename', type=str, help='4D image filename') # parse the command line args = parser.parse_args() img = nii.load(args.filename) imgs = nii.four_to_three(img) froot, ext = os.path.splitext(args.filename) if ext in ('.gz', '.bz2'): froot, ext = os.path.splitext(froot) for i, img3d in enumerate(imgs): fname3d = '%s_%04d.nii' % (froot, i) nii.save(img3d, fname3d) if __name__ == '__main__': main()
Use argparse for 4D to 3D
Use argparse for 4D to 3D
Python
bsd-3-clause
nipy/nipy-labs,arokem/nipy,bthirion/nipy,alexis-roche/register,arokem/nipy,alexis-roche/niseg,bthirion/nipy,alexis-roche/nipy,bthirion/nipy,nipy/nireg,alexis-roche/nireg,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/nipy,bthirion/nipy,alexis-roche/register,alexis-roche/nireg,nipy/nireg,alexis-roche/register,alexis-roche/niseg,alexis-roche/nipy,arokem/nipy,arokem/nipy
python
## Code Before: ''' Tiny script to write 4D files in any format that we read (nifti, analyze, MINC, at the moment, as nifti 3D files ''' import os import sys import nipy.io.imageformats as nii if __name__ == '__main__': try: fname = sys.argv[1] except IndexError: raise OSError('Expecting 4d image filename') img = nii.load(fname) imgs = nii.four_to_three(img) froot, ext = os.path.splitext(fname) if ext in ('.gz', '.bz2'): froot, ext = os.path.splitext(froot) for i, img3d in enumerate(imgs): fname3d = '%s_%04d.nii' % (froot, i) nii.save(img3d, fname3d) ## Instruction: Use argparse for 4D to 3D ## Code After: ''' Tiny script to write 4D files in any format that we read (nifti, analyze, MINC, at the moment, as nifti 3D files ''' import os import nipy.externals.argparse as argparse import nipy.io.imageformats as nii def main(): # create the parser parser = argparse.ArgumentParser() # add the arguments parser.add_argument('filename', type=str, help='4D image filename') # parse the command line args = parser.parse_args() img = nii.load(args.filename) imgs = nii.four_to_three(img) froot, ext = os.path.splitext(args.filename) if ext in ('.gz', '.bz2'): froot, ext = os.path.splitext(froot) for i, img3d in enumerate(imgs): fname3d = '%s_%04d.nii' % (froot, i) nii.save(img3d, fname3d) if __name__ == '__main__': main()
''' Tiny script to write 4D files in any format that we read (nifti, analyze, MINC, at the moment, as nifti 3D files ''' import os - import sys + import nipy.externals.argparse as argparse import nipy.io.imageformats as nii - if __name__ == '__main__': - try: - fname = sys.argv[1] - except IndexError: - raise OSError('Expecting 4d image filename') + def main(): + # create the parser + parser = argparse.ArgumentParser() + # add the arguments + parser.add_argument('filename', type=str, + help='4D image filename') + # parse the command line + args = parser.parse_args() - img = nii.load(fname) + img = nii.load(args.filename) ? +++++ +++ imgs = nii.four_to_three(img) - froot, ext = os.path.splitext(fname) + froot, ext = os.path.splitext(args.filename) ? +++++ +++ if ext in ('.gz', '.bz2'): froot, ext = os.path.splitext(froot) for i, img3d in enumerate(imgs): fname3d = '%s_%04d.nii' % (froot, i) nii.save(img3d, fname3d) + + + if __name__ == '__main__': + main() +
24
1.043478
16
8
ad0ccd8d258b94afeef7143b6189e1acb029ab3e
Skeerel/Util/Session.php
Skeerel/Util/Session.php
<?php /** * Created by Florian Pradines */ namespace Skeerel\Util; use Skeerel\Exception\IllegalArgumentException; use Skeerel\Exception\SessionNotStartedException; class Session { public static function isValidName($sessionName) { return is_string($sessionName) && preg_match('/^[a-zA-Z_-][a-zA-Z0-9_-]*$', $sessionName) === 1; } public static function isSessionStarted() { return function_exists('session_status') ? PHP_SESSION_ACTIVE === session_status() : !empty(session_id()); } public static function get($name) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } return $_SESSION[$name]; } public static function set($name, $value) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } if (!is_string($value)) { throw new IllegalArgumentException("the value of the session parameter must be a string"); } $_SESSION[$name] = $value; } }
<?php /** * Created by Florian Pradines */ namespace Skeerel\Util; use Skeerel\Exception\IllegalArgumentException; use Skeerel\Exception\SessionNotStartedException; class Session { public static function isValidName($sessionName) { return is_string($sessionName) && preg_match('/^[a-zA-Z_-][a-zA-Z0-9_-]*$', $sessionName) === 1; } public static function isSessionStarted() { if (function_exists('session_status')) { return PHP_SESSION_ACTIVE === session_status(); } // arbitrary expressions are only allowed since php 5.5 $sessionId = session_id(); return !empty($sessionId); } public static function get($name) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } return $_SESSION[$name]; } public static function set($name, $value) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } if (!is_string($value)) { throw new IllegalArgumentException("the value of the session parameter must be a string"); } $_SESSION[$name] = $value; } }
Fix for PHP < 5.5
Fix for PHP < 5.5
PHP
mit
ArcanSecurity/skeerel-php
php
## Code Before: <?php /** * Created by Florian Pradines */ namespace Skeerel\Util; use Skeerel\Exception\IllegalArgumentException; use Skeerel\Exception\SessionNotStartedException; class Session { public static function isValidName($sessionName) { return is_string($sessionName) && preg_match('/^[a-zA-Z_-][a-zA-Z0-9_-]*$', $sessionName) === 1; } public static function isSessionStarted() { return function_exists('session_status') ? PHP_SESSION_ACTIVE === session_status() : !empty(session_id()); } public static function get($name) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } return $_SESSION[$name]; } public static function set($name, $value) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } if (!is_string($value)) { throw new IllegalArgumentException("the value of the session parameter must be a string"); } $_SESSION[$name] = $value; } } ## Instruction: Fix for PHP < 5.5 ## Code After: <?php /** * Created by Florian Pradines */ namespace Skeerel\Util; use Skeerel\Exception\IllegalArgumentException; use Skeerel\Exception\SessionNotStartedException; class Session { public static function isValidName($sessionName) { return is_string($sessionName) && preg_match('/^[a-zA-Z_-][a-zA-Z0-9_-]*$', $sessionName) === 1; } public static function isSessionStarted() { if (function_exists('session_status')) { return PHP_SESSION_ACTIVE === session_status(); } // arbitrary expressions are only allowed since php 5.5 $sessionId = session_id(); return !empty($sessionId); } public static function get($name) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } return $_SESSION[$name]; } public static function set($name, $value) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } if (!is_string($value)) { throw new IllegalArgumentException("the value of the session parameter must be a string"); } $_SESSION[$name] = $value; } }
<?php /** * Created by Florian Pradines */ namespace Skeerel\Util; use Skeerel\Exception\IllegalArgumentException; use Skeerel\Exception\SessionNotStartedException; class Session { public static function isValidName($sessionName) { return is_string($sessionName) && preg_match('/^[a-zA-Z_-][a-zA-Z0-9_-]*$', $sessionName) === 1; } public static function isSessionStarted() { - return function_exists('session_status') ? PHP_SESSION_ACTIVE === session_status() : !empty(session_id()); + if (function_exists('session_status')) { + return PHP_SESSION_ACTIVE === session_status(); + } + + // arbitrary expressions are only allowed since php 5.5 + $sessionId = session_id(); + return !empty($sessionId); } public static function get($name) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } return $_SESSION[$name]; } public static function set($name, $value) { if (!self::isSessionStarted()) { throw new SessionNotStartedException(); } if (!self::isValidName($name)) { throw new IllegalArgumentException("the name of the session parameter must be a valid string name"); } if (!is_string($value)) { throw new IllegalArgumentException("the value of the session parameter must be a string"); } $_SESSION[$name] = $value; } }
8
0.163265
7
1
246668eab4e1a6c922781f02bca5962fd60de6b9
resources/views/tags/index.blade.php
resources/views/tags/index.blade.php
@extends('layout') @section('body') <div class="wrapper spacing-top-large spacing-bottom-large"> <div class="box"> <div class="section"> <div class="row"> <div class="column align-middle"> <span class="color-dark">@lang('general.tags')</span> </div> <div class="column align-middle text-align-right"> <a href="/tags/create">@lang('actions.create')</a> </div> </div> </div> <ul class="section"> @foreach ($tags as $tag) <li class="row"> <div class="column">{{ $tag->name }}</div> <div class="column"> <form class="action" method="POST" action="/tags/{{ $tag->id }}"> {{ method_field('delete') }} {{ csrf_field() }} <button>@lang('actions.delete')</button> </form> </div> </li> @endforeach </ul> </div> </div> @endsection
@extends('layout') @section('body') <div class="wrapper spacing-top-large spacing-bottom-large"> <div class="box"> <div class="section"> <div class="row"> <div class="column align-middle"> <span class="color-dark">@lang('general.tags')</span> </div> <div class="column align-middle text-align-right"> <a href="/tags/create">@lang('actions.create')</a> </div> </div> </div> @if (count($tags) > 0) <ul class="section"> @foreach ($tags as $tag) <li class="row"> <div class="column">{{ $tag->name }}</div> <div class="column"> <form class="action" method="POST" action="/tags/{{ $tag->id }}"> {{ method_field('delete') }} {{ csrf_field() }} <button>@lang('actions.delete')</button> </form> </div> </li> @endforeach </ul> @else <div class="section">You don't have any tags</div> @endif </div> </div> @endsection
Fix empty void when user has no tags for tags' index view
Fix empty void when user has no tags for tags' index view
PHP
mit
pix3ly/budget,pix3ly/budget
php
## Code Before: @extends('layout') @section('body') <div class="wrapper spacing-top-large spacing-bottom-large"> <div class="box"> <div class="section"> <div class="row"> <div class="column align-middle"> <span class="color-dark">@lang('general.tags')</span> </div> <div class="column align-middle text-align-right"> <a href="/tags/create">@lang('actions.create')</a> </div> </div> </div> <ul class="section"> @foreach ($tags as $tag) <li class="row"> <div class="column">{{ $tag->name }}</div> <div class="column"> <form class="action" method="POST" action="/tags/{{ $tag->id }}"> {{ method_field('delete') }} {{ csrf_field() }} <button>@lang('actions.delete')</button> </form> </div> </li> @endforeach </ul> </div> </div> @endsection ## Instruction: Fix empty void when user has no tags for tags' index view ## Code After: @extends('layout') @section('body') <div class="wrapper spacing-top-large spacing-bottom-large"> <div class="box"> <div class="section"> <div class="row"> <div class="column align-middle"> <span class="color-dark">@lang('general.tags')</span> </div> <div class="column align-middle text-align-right"> <a href="/tags/create">@lang('actions.create')</a> </div> </div> </div> @if (count($tags) > 0) <ul class="section"> @foreach ($tags as $tag) <li class="row"> <div class="column">{{ $tag->name }}</div> <div class="column"> <form class="action" method="POST" action="/tags/{{ $tag->id }}"> {{ method_field('delete') }} {{ csrf_field() }} <button>@lang('actions.delete')</button> </form> </div> </li> @endforeach </ul> @else <div class="section">You don't have any tags</div> @endif </div> </div> @endsection
@extends('layout') @section('body') <div class="wrapper spacing-top-large spacing-bottom-large"> <div class="box"> <div class="section"> <div class="row"> <div class="column align-middle"> <span class="color-dark">@lang('general.tags')</span> </div> <div class="column align-middle text-align-right"> <a href="/tags/create">@lang('actions.create')</a> </div> </div> </div> + @if (count($tags) > 0) - <ul class="section"> + <ul class="section"> ? ++++ - @foreach ($tags as $tag) + @foreach ($tags as $tag) ? ++++ - <li class="row"> + <li class="row"> ? ++++ - <div class="column">{{ $tag->name }}</div> + <div class="column">{{ $tag->name }}</div> ? ++++ - <div class="column"> + <div class="column"> ? ++++ - <form class="action" method="POST" action="/tags/{{ $tag->id }}"> + <form class="action" method="POST" action="/tags/{{ $tag->id }}"> ? ++++ - {{ method_field('delete') }} + {{ method_field('delete') }} ? ++++ - {{ csrf_field() }} + {{ csrf_field() }} ? ++++ - <button>@lang('actions.delete')</button> + <button>@lang('actions.delete')</button> ? ++++ - </form> + </form> ? ++++ + </div> - </div> ? ^ - + </li> ? ^ - </li> - @endforeach + @endforeach ? ++++ - </ul> + </ul> ? ++++ + @else + <div class="section">You don't have any tags</div> + @endif </div> </div> @endsection
32
1
18
14
a7bd2b9cb0bde3d598680bfa925abcd8073b2b12
.circleci/config.yml
.circleci/config.yml
version: 2 jobs: build: docker: - image: cibuilds/snapcraft:stable steps: - checkout - run: name: "Update apt" command: apt update - run: name: "Build Snap" command: snapcraft workflows: version: 2 main: jobs: - build
version: 2 jobs: build: docker: - image: cibuilds/snapcraft:stable steps: - checkout - run: name: "Update apt" command: apt update - run: name: "Build Snap" command: snapcraft - persist_to_workspace: root: . paths: - "*.snap" publish-edge: docker: - image: cibuilds/snapcraft:stable steps: - attach_workspace: at: . - run: name: "Publish to Store" command: | mkdir .snapcraft echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg snapcraft push *.snap --release edge publish-stable: docker: - image: cibuilds/snapcraft:stable steps: - attach_workspace: at: . - run: name: "Publish to Store" command: | mkdir .snapcraft echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg snapcraft push *.snap --release stable workflows: version: 2 main: jobs: - build - publish-edge: requires: - build filters: branches: only: master - publish-stable: requires: - build filters: branches: ignore: /.*/ tags: only: /^\d+\.\d+\.\d+$/
Manage the lifecycle of the snap
circleci: Manage the lifecycle of the snap * Publish master snaps to edge after build. * Publish tagged snaps to the stable channel after build.
YAML
lgpl-2.1
vathpela/fwupd,fwupd/fwupd,vathpela/fwupd,hughsie/fwupd,fwupd/fwupd,vathpela/fwupd,vathpela/fwupd,hughsie/fwupd,hughsie/fwupd,hughsie/fwupd,fwupd/fwupd,fwupd/fwupd
yaml
## Code Before: version: 2 jobs: build: docker: - image: cibuilds/snapcraft:stable steps: - checkout - run: name: "Update apt" command: apt update - run: name: "Build Snap" command: snapcraft workflows: version: 2 main: jobs: - build ## Instruction: circleci: Manage the lifecycle of the snap * Publish master snaps to edge after build. * Publish tagged snaps to the stable channel after build. ## Code After: version: 2 jobs: build: docker: - image: cibuilds/snapcraft:stable steps: - checkout - run: name: "Update apt" command: apt update - run: name: "Build Snap" command: snapcraft - persist_to_workspace: root: . paths: - "*.snap" publish-edge: docker: - image: cibuilds/snapcraft:stable steps: - attach_workspace: at: . - run: name: "Publish to Store" command: | mkdir .snapcraft echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg snapcraft push *.snap --release edge publish-stable: docker: - image: cibuilds/snapcraft:stable steps: - attach_workspace: at: . - run: name: "Publish to Store" command: | mkdir .snapcraft echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg snapcraft push *.snap --release stable workflows: version: 2 main: jobs: - build - publish-edge: requires: - build filters: branches: only: master - publish-stable: requires: - build filters: branches: ignore: /.*/ tags: only: /^\d+\.\d+\.\d+$/
version: 2 jobs: build: docker: - image: cibuilds/snapcraft:stable steps: - checkout - run: name: "Update apt" command: apt update - run: name: "Build Snap" command: snapcraft + - persist_to_workspace: + root: . + paths: + - "*.snap" + + publish-edge: + docker: + - image: cibuilds/snapcraft:stable + steps: + - attach_workspace: + at: . + - run: + name: "Publish to Store" + command: | + mkdir .snapcraft + echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg + snapcraft push *.snap --release edge + + publish-stable: + docker: + - image: cibuilds/snapcraft:stable + steps: + - attach_workspace: + at: . + - run: + name: "Publish to Store" + command: | + mkdir .snapcraft + echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg + snapcraft push *.snap --release stable workflows: version: 2 main: jobs: - build + - publish-edge: + requires: + - build + filters: + branches: + only: master + - publish-stable: + requires: + - build + filters: + branches: + ignore: /.*/ + tags: + only: /^\d+\.\d+\.\d+$/ +
45
2.368421
45
0
02be83fa617d6ce9f020a7d969fef601244e9095
.travis.yml
.travis.yml
language: java jdk: oraclejdk7 before_install: # Install base Android SDK - sudo apt-get update -qq - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 lib32z1 libreadline6-dev:i386 libncurses5-dev:i386; fi - wget -O android-sdk.tgz http://dl.google.com/android/android-sdk_r22.0.4-linux.tgz - tar xzf android-sdk.tgz - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools # Install required Android components. # Note that the command below only accepts the first license. This is actually convenient, since # it prevents the installation of the ATOM and MIPS emulator images. - echo yes | android update sdk --filter platform-tools,build-tools-18.0.0,android-17,android-16,extra-android-support,extra-google-m2repository,extra-android-m2repository --no-ui --force install: - ./gradlew tasks - mvn install script: - ./gradlew build - mvn install
language: java jdk: oraclejdk7 before_install: # Install base Android SDK - sudo apt-get update -qq - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 lib32z1 libreadline6-dev:i386 libncurses5-dev:i386; fi - wget -O android-sdk.tgz http://dl.google.com/android/android-sdk_r22.0.4-linux.tgz - tar xzf android-sdk.tgz - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools # Install required Android components. # Note that the command below only accepts the first license. This is actually convenient, since # it prevents the installation of the ATOM and MIPS emulator images. - echo yes | android update sdk --filter platform-tools,build-tools-18.0.0,android-17,android-16,extra-android-support,extra-google-m2repository,extra-android-m2repository --no-ui --force install: - TERM=dumb ./gradlew tasks - mvn install script: - TERM=dumb ./gradlew build - mvn install
Improve Gradle output on Travis.
Improve Gradle output on Travis.
YAML
apache-2.0
renekaigen/zxing-android-embedded,BugMaker/zxing-android-embedded,praveen062/zxing-android-embedded,jonzl/sample-zxing,BugMaker/zxing-android-embedded,binson1989/zxing-android-embedded,journeyapps/zxing-android-embedded,dimoge/zxing-android-embedded,ALenfant/zxing-android-embedded,dhosford/zxing-android-embedded,Promptus/zxing-android-minimal,WangXiaoxi/zxing-android-minimal,movedon2otherthings/zxing-android-embedded,0359xiaodong/zxing-android-embedded,WangXiaoxi/zxing-android-minimal,cnevinc/zxing-android-embedded,j-mateo/zxing-android-embedded,BBBInc/zxing-android-embedded,jonzl/sample-zxing,tsdl2013/zxing-android-embedded,BugMaker/zxing-android-embedded,jemsnaban/zxing-android-embedded,jeason789/test_embedded,Promptus/zxing-android-minimal,jonzl/sample-zxing,wudayu/zxing-android-embedded,youyi1314/zxing-android-embedded
yaml
## Code Before: language: java jdk: oraclejdk7 before_install: # Install base Android SDK - sudo apt-get update -qq - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 lib32z1 libreadline6-dev:i386 libncurses5-dev:i386; fi - wget -O android-sdk.tgz http://dl.google.com/android/android-sdk_r22.0.4-linux.tgz - tar xzf android-sdk.tgz - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools # Install required Android components. # Note that the command below only accepts the first license. This is actually convenient, since # it prevents the installation of the ATOM and MIPS emulator images. - echo yes | android update sdk --filter platform-tools,build-tools-18.0.0,android-17,android-16,extra-android-support,extra-google-m2repository,extra-android-m2repository --no-ui --force install: - ./gradlew tasks - mvn install script: - ./gradlew build - mvn install ## Instruction: Improve Gradle output on Travis. ## Code After: language: java jdk: oraclejdk7 before_install: # Install base Android SDK - sudo apt-get update -qq - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 lib32z1 libreadline6-dev:i386 libncurses5-dev:i386; fi - wget -O android-sdk.tgz http://dl.google.com/android/android-sdk_r22.0.4-linux.tgz - tar xzf android-sdk.tgz - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools # Install required Android components. # Note that the command below only accepts the first license. This is actually convenient, since # it prevents the installation of the ATOM and MIPS emulator images. - echo yes | android update sdk --filter platform-tools,build-tools-18.0.0,android-17,android-16,extra-android-support,extra-google-m2repository,extra-android-m2repository --no-ui --force install: - TERM=dumb ./gradlew tasks - mvn install script: - TERM=dumb ./gradlew build - mvn install
language: java jdk: oraclejdk7 before_install: # Install base Android SDK - sudo apt-get update -qq - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 lib32z1 libreadline6-dev:i386 libncurses5-dev:i386; fi - wget -O android-sdk.tgz http://dl.google.com/android/android-sdk_r22.0.4-linux.tgz - tar xzf android-sdk.tgz - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools # Install required Android components. # Note that the command below only accepts the first license. This is actually convenient, since # it prevents the installation of the ATOM and MIPS emulator images. - echo yes | android update sdk --filter platform-tools,build-tools-18.0.0,android-17,android-16,extra-android-support,extra-google-m2repository,extra-android-m2repository --no-ui --force install: - - ./gradlew tasks + - TERM=dumb ./gradlew tasks ? ++++++++++ - mvn install script: - - ./gradlew build + - TERM=dumb ./gradlew build ? ++++++++++ - mvn install
4
0.166667
2
2
7bf44a6b377643ebcc78be8caeaa2a82aa59bf05
.travis.yml
.travis.yml
language: java script: mvn clean verify jdk: - openjdk6 notifications: email: - dsmiley@mitre.org
language: java script: mvn -Dhttpclient.version=HTTPCLIENT_VERSION clean verify jdk: - openjdk6 env: - HTTPCLIENT_VERSION=4.1 - HTTPCLIENT_VERSION=4.2 - HTTPCLIENT_VERSION=4.3.4 notifications: email: - dsmiley@apache.org
Test with different HttpClient versions
TravisCI: Test with different HttpClient versions
YAML
apache-2.0
mitre/HTTP-Proxy-Servlet,jziub/HTTP-Proxy-Servlet,cthiebaud/HTTP-Proxy-Servlet,cr4igo/FirstSpirit-HTTP-Proxy-FSM,1990balaji/HTTP-Proxy-Servlet,cthiebaud/HTTP-Proxy-Servlet,rmohta/HTTP-Proxy-Servlet,hrbapna/HTTP-Proxy-Servlet,wchen057/HTTP-Proxy-Servlet,fdagostini/HTTP-Proxy-Servlet,jpenninkhof/HTTP-Proxy-Servlet
yaml
## Code Before: language: java script: mvn clean verify jdk: - openjdk6 notifications: email: - dsmiley@mitre.org ## Instruction: TravisCI: Test with different HttpClient versions ## Code After: language: java script: mvn -Dhttpclient.version=HTTPCLIENT_VERSION clean verify jdk: - openjdk6 env: - HTTPCLIENT_VERSION=4.1 - HTTPCLIENT_VERSION=4.2 - HTTPCLIENT_VERSION=4.3.4 notifications: email: - dsmiley@apache.org
language: java - script: mvn clean verify + + script: mvn -Dhttpclient.version=HTTPCLIENT_VERSION clean verify + jdk: - openjdk6 + + env: + - HTTPCLIENT_VERSION=4.1 + - HTTPCLIENT_VERSION=4.2 + - HTTPCLIENT_VERSION=4.3.4 + notifications: email: - - dsmiley@mitre.org ? ^^^^ + - dsmiley@apache.org ? ^^^^^
12
1.714286
10
2
c4093761ffcb8e814f2642189eac8e282c8b3878
.travis.yml
.travis.yml
language: node_js node_js: - "8" - "9" - "10" dist: trusty addons: chrome: stable deploy: - provider: npm api_key: $NPM_TOKEN on: tags: true repo: Cox-Automotive/alks.js email: $NPM_EMAIL
language: node_js node_js: - "8" - "9" - "10" dist: trusty addons: chrome: stable before_deploy: - npm install deploy: - provider: npm api_key: $NPM_TOKEN on: tags: true repo: Cox-Automotive/alks.js email: $NPM_EMAIL
Install dev deps to deploy
Install dev deps to deploy
YAML
mit
Cox-Automotive/alks.js,Cox-Automotive/alks.js,Cox-Automotive/alks.js
yaml
## Code Before: language: node_js node_js: - "8" - "9" - "10" dist: trusty addons: chrome: stable deploy: - provider: npm api_key: $NPM_TOKEN on: tags: true repo: Cox-Automotive/alks.js email: $NPM_EMAIL ## Instruction: Install dev deps to deploy ## Code After: language: node_js node_js: - "8" - "9" - "10" dist: trusty addons: chrome: stable before_deploy: - npm install deploy: - provider: npm api_key: $NPM_TOKEN on: tags: true repo: Cox-Automotive/alks.js email: $NPM_EMAIL
language: node_js node_js: - "8" - "9" - "10" dist: trusty addons: chrome: stable + before_deploy: + - npm install deploy: - provider: npm api_key: $NPM_TOKEN on: tags: true repo: Cox-Automotive/alks.js email: $NPM_EMAIL
2
0.125
2
0
3ed206b494fd55819b7c697e84f9090c60192e3c
_includes/tickets-helloasso.html
_includes/tickets-helloasso.html
<!-- Begin Tickets Section --> <section id="tickets" class="tickets image-section parallax" style="background-image: url({{ site.baseurl }}/img/sections-background/{{ site.ticketsBgImage }});"> <div class="overlay solid-overlay"></div> <div class="content-wrapper"> <div class="col-lg-8 col-md-10 col-lg-offset-2 col-md-offset-1"> <h3>{{ site.ticketsTitle }}</h3> <iframe id="haWidget"></iframe> <div style="width:100%;text-align:center;">Propulsé par <a href="https://www.helloasso.com" rel="nofollow">HelloAsso</a></div> </div> </div> <script> window.onload = function() { $("#haWidget").attr('src', "https://www.helloasso.com/associations/agile-cote-basque/evenements/agile-pays-basque-2017/widget"); }; </script> </section> <!-- End Tickets Section -->
<!-- Begin Tickets Section --> <section id="tickets" class="tickets image-section parallax" style="background-image: url({{ site.baseurl }}/img/sections-background/{{ site.ticketsBgImage }});"> <div class="overlay solid-overlay"></div> <div class="content-wrapper"> <div class="col-lg-8 col-md-10 col-lg-offset-2 col-md-offset-1"> <h3>{{ site.ticketsTitle }}</h3> <h4>Fermeture le 17 Septembre</h4> <iframe id="haWidget"></iframe> <div style="width:100%;text-align:center;">Propulsé par <a href="https://www.helloasso.com" rel="nofollow">HelloAsso</a></div> </div> </div> <script> window.onload = function() { $("#haWidget").attr('src', "https://www.helloasso.com/associations/agile-cote-basque/evenements/agile-pays-basque-2017/widget"); }; </script> </section> <!-- End Tickets Section -->
Add closed date to billeterie
Add closed date to billeterie
HTML
mit
agilepaysbasque/site-web,agilepaysbasque/site-web,agilepaysbasque/site-web,agilepaysbasque/site-web
html
## Code Before: <!-- Begin Tickets Section --> <section id="tickets" class="tickets image-section parallax" style="background-image: url({{ site.baseurl }}/img/sections-background/{{ site.ticketsBgImage }});"> <div class="overlay solid-overlay"></div> <div class="content-wrapper"> <div class="col-lg-8 col-md-10 col-lg-offset-2 col-md-offset-1"> <h3>{{ site.ticketsTitle }}</h3> <iframe id="haWidget"></iframe> <div style="width:100%;text-align:center;">Propulsé par <a href="https://www.helloasso.com" rel="nofollow">HelloAsso</a></div> </div> </div> <script> window.onload = function() { $("#haWidget").attr('src', "https://www.helloasso.com/associations/agile-cote-basque/evenements/agile-pays-basque-2017/widget"); }; </script> </section> <!-- End Tickets Section --> ## Instruction: Add closed date to billeterie ## Code After: <!-- Begin Tickets Section --> <section id="tickets" class="tickets image-section parallax" style="background-image: url({{ site.baseurl }}/img/sections-background/{{ site.ticketsBgImage }});"> <div class="overlay solid-overlay"></div> <div class="content-wrapper"> <div class="col-lg-8 col-md-10 col-lg-offset-2 col-md-offset-1"> <h3>{{ site.ticketsTitle }}</h3> <h4>Fermeture le 17 Septembre</h4> <iframe id="haWidget"></iframe> <div style="width:100%;text-align:center;">Propulsé par <a href="https://www.helloasso.com" rel="nofollow">HelloAsso</a></div> </div> </div> <script> window.onload = function() { $("#haWidget").attr('src', "https://www.helloasso.com/associations/agile-cote-basque/evenements/agile-pays-basque-2017/widget"); }; </script> </section> <!-- End Tickets Section -->
<!-- Begin Tickets Section --> <section id="tickets" class="tickets image-section parallax" style="background-image: url({{ site.baseurl }}/img/sections-background/{{ site.ticketsBgImage }});"> <div class="overlay solid-overlay"></div> <div class="content-wrapper"> <div class="col-lg-8 col-md-10 col-lg-offset-2 col-md-offset-1"> <h3>{{ site.ticketsTitle }}</h3> + <h4>Fermeture le 17 Septembre</h4> <iframe id="haWidget"></iframe> <div style="width:100%;text-align:center;">Propulsé par <a href="https://www.helloasso.com" rel="nofollow">HelloAsso</a></div> </div> </div> <script> window.onload = function() { $("#haWidget").attr('src', "https://www.helloasso.com/associations/agile-cote-basque/evenements/agile-pays-basque-2017/widget"); }; </script> </section> <!-- End Tickets Section -->
1
0.055556
1
0
81d580c36057575e788b6529f17a4189da62a22b
app/views/builds/_build.html.haml
app/views/builds/_build.html.haml
%tr.build.alert{class: build_status_alert_class(build)} %td.status = build.status %td.build-link = link_to project_build_path(build.project, build) do %strong #{build.short_sha} %td.build-message %span= truncate(build.git_commit_message, length: 50) %td.build-branch - unless @ref %span = link_to build.ref, project_path(@project, ref: build.ref) %td.duration - if build.duration #{distance_of_time_in_words build.duration} %td.timestamp - if build.finished_at %span #{time_ago_in_words build.finished_at} ago
%tr.build.alert{class: build_status_alert_class(build)} %td.status = build.status %td.build-link = link_to project_build_path(build.project, build, bid: build.id) do %strong #{build.short_sha} %td.build-message %span= truncate(build.git_commit_message, length: 50) %td.build-branch - unless @ref %span = link_to build.ref, project_path(@project, ref: build.ref) %td.duration - if build.duration #{distance_of_time_in_words build.duration} %td.timestamp - if build.finished_at %span #{time_ago_in_words build.finished_at} ago
Append the build-id to the build-link.
Append the build-id to the build-link. fixes #259
Haml
mit
gitlabhq/gitlab-ci,c-owens/gitlab-ci,svdata/gitlab-ci,yonglehou/gitlab-ci,akarokr/gitlab-ci,c-owens/gitlab-ci,svdata/gitlab-ci,fscherwi/gitlab-ci,svdata/gitlab-ci,c-owens/gitlab-ci,gitlabhq/gitlab-ci,gitlabhq/gitlab-ci,mfittko/gitlab-ci,AICIDNN/gitlab-ci,Bugagazavr/gitlab-ci,fscherwi/gitlab-ci,AICIDNN/gitlab-ci,ayufan/gitlab-ci,copystudy/gitlab-ci,yonglehou/gitlab-ci,ayufan/gitlab-ci,yonglehou/gitlab-ci,Bugagazavr/gitlab-ci,edgemaster/gitlab-ci,AICIDNN/gitlab-ci,c-owens/gitlab-ci,mfittko/gitlab-ci,copystudy/gitlab-ci,copystudy/gitlab-ci,akarokr/gitlab-ci,akarokr/gitlab-ci,akarokr/gitlab-ci,mfittko/gitlab-ci,Bugagazavr/gitlab-ci,edgemaster/gitlab-ci,edgemaster/gitlab-ci,fscherwi/gitlab-ci,fscherwi/gitlab-ci,gitlabhq/gitlab-ci,copystudy/gitlab-ci,AICIDNN/gitlab-ci,edgemaster/gitlab-ci
haml
## Code Before: %tr.build.alert{class: build_status_alert_class(build)} %td.status = build.status %td.build-link = link_to project_build_path(build.project, build) do %strong #{build.short_sha} %td.build-message %span= truncate(build.git_commit_message, length: 50) %td.build-branch - unless @ref %span = link_to build.ref, project_path(@project, ref: build.ref) %td.duration - if build.duration #{distance_of_time_in_words build.duration} %td.timestamp - if build.finished_at %span #{time_ago_in_words build.finished_at} ago ## Instruction: Append the build-id to the build-link. fixes #259 ## Code After: %tr.build.alert{class: build_status_alert_class(build)} %td.status = build.status %td.build-link = link_to project_build_path(build.project, build, bid: build.id) do %strong #{build.short_sha} %td.build-message %span= truncate(build.git_commit_message, length: 50) %td.build-branch - unless @ref %span = link_to build.ref, project_path(@project, ref: build.ref) %td.duration - if build.duration #{distance_of_time_in_words build.duration} %td.timestamp - if build.finished_at %span #{time_ago_in_words build.finished_at} ago
%tr.build.alert{class: build_status_alert_class(build)} %td.status = build.status %td.build-link - = link_to project_build_path(build.project, build) do + = link_to project_build_path(build.project, build, bid: build.id) do ? +++++++++++++++ %strong #{build.short_sha} %td.build-message %span= truncate(build.git_commit_message, length: 50) %td.build-branch - unless @ref %span = link_to build.ref, project_path(@project, ref: build.ref) %td.duration - if build.duration #{distance_of_time_in_words build.duration} %td.timestamp - if build.finished_at %span #{time_ago_in_words build.finished_at} ago
2
0.086957
1
1
743f4affcd89aa3d9fd37774e2e5f8e05525cb04
api/sync_wallet.py
api/sync_wallet.py
import urlparse import os, sys import json tools_dir = os.environ.get('TOOLSDIR') lib_path = os.path.abspath(tools_dir) sys.path.append(lib_path) from msc_apps import * data_dir_root = os.environ.get('DATADIR') def sync_wallet_response(request_dict): if not request_dict.has_key('type'): return (None, 'No field type in response dict '+str(request_dict)) req_type = request_dict['type'][0].upper() if req_type == "SYNCWALLET": response_data = syncWallets(request_dict['masterWallets'][0]) else: return (None, req_type + ' is not supported') response = { 'status': 'OK', 'data': response_data } return (json.dumps(response), None) def syncWallets(master_wallets_json): master_wallets = json.loads(master_wallets_json) for wallet in master_wallets: uuid = wallet['uuid'] filename = data_dir_root + '/wallets/' + uuid + '.json' with open(filename, 'w') as f: json.dump(wallet, f) return "OK" def sync_wallet_handler(environ, start_response): return general_handler(environ, start_response, sync_wallet_response)
import urlparse import os, sys import json tools_dir = os.environ.get('TOOLSDIR') lib_path = os.path.abspath(tools_dir) sys.path.append(lib_path) from msc_apps import * data_dir_root = os.environ.get('DATADIR') def sync_wallet_response(request_dict): if not request_dict.has_key('type'): return (None, 'No field type in response dict '+str(request_dict)) req_type = request_dict['type'][0].upper() if req_type == "SYNCWALLET": syncWallets(request_dict['masterWallets'][0]) else: return (None, req_type + ' is not supported') response = { 'status': 'OK' } return (json.dumps(response), None) def syncWallets(master_wallets_json): master_wallets = json.loads(master_wallets_json) for wallet in master_wallets: uuid = wallet['uuid'] filename = data_dir_root + '/wallets/' + uuid + '.json' with open(filename, 'w') as f: json.dump(wallet, f) return "OK" def sync_wallet_handler(environ, start_response): return general_handler(environ, start_response, sync_wallet_response)
Clean up return value for API
Clean up return value for API
Python
agpl-3.0
ripper234/omniwallet,maran/omniwallet,maran/omniwallet,Nevtep/omniwallet,FuzzyBearBTC/omniwallet,FuzzyBearBTC/omniwallet,achamely/omniwallet,curtislacy/omniwallet,habibmasuro/omniwallet,OmniLayer/omniwallet,ripper234/omniwallet,habibmasuro/omniwallet,ripper234/omniwallet,Nevtep/omniwallet,habibmasuro/omniwallet,curtislacy/omniwallet,OmniLayer/omniwallet,dexX7/omniwallet,arowser/omniwallet,habibmasuro/omniwallet,dexX7/omniwallet,Nevtep/omniwallet,VukDukic/omniwallet,arowser/omniwallet,achamely/omniwallet,FuzzyBearBTC/omniwallet,maran/omniwallet,VukDukic/omniwallet,OmniLayer/omniwallet,Nevtep/omniwallet,achamely/omniwallet,arowser/omniwallet,VukDukic/omniwallet,OmniLayer/omniwallet,achamely/omniwallet,dexX7/omniwallet,curtislacy/omniwallet
python
## Code Before: import urlparse import os, sys import json tools_dir = os.environ.get('TOOLSDIR') lib_path = os.path.abspath(tools_dir) sys.path.append(lib_path) from msc_apps import * data_dir_root = os.environ.get('DATADIR') def sync_wallet_response(request_dict): if not request_dict.has_key('type'): return (None, 'No field type in response dict '+str(request_dict)) req_type = request_dict['type'][0].upper() if req_type == "SYNCWALLET": response_data = syncWallets(request_dict['masterWallets'][0]) else: return (None, req_type + ' is not supported') response = { 'status': 'OK', 'data': response_data } return (json.dumps(response), None) def syncWallets(master_wallets_json): master_wallets = json.loads(master_wallets_json) for wallet in master_wallets: uuid = wallet['uuid'] filename = data_dir_root + '/wallets/' + uuid + '.json' with open(filename, 'w') as f: json.dump(wallet, f) return "OK" def sync_wallet_handler(environ, start_response): return general_handler(environ, start_response, sync_wallet_response) ## Instruction: Clean up return value for API ## Code After: import urlparse import os, sys import json tools_dir = os.environ.get('TOOLSDIR') lib_path = os.path.abspath(tools_dir) sys.path.append(lib_path) from msc_apps import * data_dir_root = os.environ.get('DATADIR') def sync_wallet_response(request_dict): if not request_dict.has_key('type'): return (None, 'No field type in response dict '+str(request_dict)) req_type = request_dict['type'][0].upper() if req_type == "SYNCWALLET": syncWallets(request_dict['masterWallets'][0]) else: return (None, req_type + ' is not supported') response = { 'status': 'OK' } return (json.dumps(response), None) def syncWallets(master_wallets_json): master_wallets = json.loads(master_wallets_json) for wallet in master_wallets: uuid = wallet['uuid'] filename = data_dir_root + '/wallets/' + uuid + '.json' with open(filename, 'w') as f: json.dump(wallet, f) return "OK" def sync_wallet_handler(environ, start_response): return general_handler(environ, start_response, sync_wallet_response)
import urlparse import os, sys import json tools_dir = os.environ.get('TOOLSDIR') lib_path = os.path.abspath(tools_dir) sys.path.append(lib_path) from msc_apps import * data_dir_root = os.environ.get('DATADIR') def sync_wallet_response(request_dict): if not request_dict.has_key('type'): return (None, 'No field type in response dict '+str(request_dict)) req_type = request_dict['type'][0].upper() if req_type == "SYNCWALLET": - response_data = syncWallets(request_dict['masterWallets'][0]) ? ---------------- + syncWallets(request_dict['masterWallets'][0]) else: return (None, req_type + ' is not supported') - response = { 'status': 'OK', 'data': response_data } + response = { 'status': 'OK' } return (json.dumps(response), None) def syncWallets(master_wallets_json): master_wallets = json.loads(master_wallets_json) for wallet in master_wallets: uuid = wallet['uuid'] filename = data_dir_root + '/wallets/' + uuid + '.json' with open(filename, 'w') as f: json.dump(wallet, f) return "OK" def sync_wallet_handler(environ, start_response): return general_handler(environ, start_response, sync_wallet_response)
4
0.105263
2
2
30293835db8a4a979c010072af66c37f5f7cfb75
Gruntfile.coffee
Gruntfile.coffee
module.exports = (grunt)-> require('grunt-recurse')(grunt, __dirname) grunt.expandFileArg = ( prefix = '.', base = '**', postfix = '*test.coffee' )-> part = (v)->"#{prefix}/#{v}#{postfix}" files = grunt.option('files') return part(base) unless files files.split(',').map (v)-> part(v) testFiles = grunt.expandFileArg('lib/') grunt.Config = mochaTest: server: options: reporter: 'spec' src: testFiles stassets: build: {} watch: server: files: testFiles tasks: [ 'testServer' ] options: spawn: false grunt.registerTask 'testServer', 'Test the server.', ['mochaTest:server'] grunt.registerTask 'server', 'Prepare the server.', [ 'testServer' # 'copy:server' ] grunt.registerTask 'default', ['server'] grunt.loadTasks './tasks' grunt.finalize()
module.exports = (grunt)-> require('grunt-recurse')(grunt, __dirname) grunt.expandFileArg = ( prefix = '.', base = '**', postfix = '*test.coffee' )-> part = (v)->"#{prefix}/#{v}#{postfix}" files = grunt.option('files') return part(base) unless files files.split(',').map (v)-> part(v) testFiles = grunt.expandFileArg('lib/') grunt.Config = release: {} mochaTest: server: options: reporter: 'spec' src: testFiles stassets: build: {} watch: server: files: testFiles tasks: [ 'testServer' ] options: spawn: false grunt.registerTask 'testServer', 'Test the server.', ['mochaTest:server'] grunt.registerTask 'server', 'Prepare the server.', [ 'testServer' # 'copy:server' ] grunt.registerTask 'default', ['server'] grunt.loadTasks './tasks' grunt.finalize()
Add stub config for grunt-release
Add stub config for grunt-release
CoffeeScript
isc
RupertJS/stassets,DavidSouther/stassets,DavidSouther/stassets,RupertJS/stassets,RupertJS/stassets,DavidSouther/stassets
coffeescript
## Code Before: module.exports = (grunt)-> require('grunt-recurse')(grunt, __dirname) grunt.expandFileArg = ( prefix = '.', base = '**', postfix = '*test.coffee' )-> part = (v)->"#{prefix}/#{v}#{postfix}" files = grunt.option('files') return part(base) unless files files.split(',').map (v)-> part(v) testFiles = grunt.expandFileArg('lib/') grunt.Config = mochaTest: server: options: reporter: 'spec' src: testFiles stassets: build: {} watch: server: files: testFiles tasks: [ 'testServer' ] options: spawn: false grunt.registerTask 'testServer', 'Test the server.', ['mochaTest:server'] grunt.registerTask 'server', 'Prepare the server.', [ 'testServer' # 'copy:server' ] grunt.registerTask 'default', ['server'] grunt.loadTasks './tasks' grunt.finalize() ## Instruction: Add stub config for grunt-release ## Code After: module.exports = (grunt)-> require('grunt-recurse')(grunt, __dirname) grunt.expandFileArg = ( prefix = '.', base = '**', postfix = '*test.coffee' )-> part = (v)->"#{prefix}/#{v}#{postfix}" files = grunt.option('files') return part(base) unless files files.split(',').map (v)-> part(v) testFiles = grunt.expandFileArg('lib/') grunt.Config = release: {} mochaTest: server: options: reporter: 'spec' src: testFiles stassets: build: {} watch: server: files: testFiles tasks: [ 'testServer' ] options: spawn: false grunt.registerTask 'testServer', 'Test the server.', ['mochaTest:server'] grunt.registerTask 'server', 'Prepare the server.', [ 'testServer' # 'copy:server' ] grunt.registerTask 'default', ['server'] grunt.loadTasks './tasks' grunt.finalize()
module.exports = (grunt)-> require('grunt-recurse')(grunt, __dirname) grunt.expandFileArg = ( prefix = '.', base = '**', postfix = '*test.coffee' )-> part = (v)->"#{prefix}/#{v}#{postfix}" files = grunt.option('files') return part(base) unless files files.split(',').map (v)-> part(v) testFiles = grunt.expandFileArg('lib/') grunt.Config = + release: {} mochaTest: server: options: reporter: 'spec' src: testFiles stassets: build: {} watch: server: files: testFiles tasks: [ 'testServer' ] options: spawn: false grunt.registerTask 'testServer', 'Test the server.', ['mochaTest:server'] grunt.registerTask 'server', 'Prepare the server.', [ 'testServer' # 'copy:server' ] grunt.registerTask 'default', ['server'] grunt.loadTasks './tasks' grunt.finalize()
1
0.022727
1
0
c0b74705d0c6310d5ff8537c29d75c486bd78bc3
docs/website/layouts/docs/byexamplelist.html
docs/website/layouts/docs/byexamplelist.html
{{ define "title"}} {{ .Title}} {{end}} {{ define "header"}} {{ partial "header" .}} {{end}} {{ define "main"}} {{$parentDir := .File.Dir}} {{$this := .Page}} {{ partial "sidebar" . }} <!-- {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} {{end}}--> <div id="main"> <div id="hero"> <h1>{{.Title}}</h1> </div> <div id="components"> <div class="row gutters"> <!-- only show pages where dir is the same as the _index.md --> {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} <div class="col col-4 item"> <a style="text-decoration:none"> <h4>{{ .Key }}<h4> </a> {{range .Pages}} <a href="{{ .Permalink }}" style="text-decoration:none; font-size:17px; color:#3794de; ">{{ .Title }}</a><br> {{ end }} </div> {{end}} </div> </div> </div> {{ end }} {{ define "footer"}} {{ partial "footer" .}} {{end}}
{{ define "title"}} {{ .Title}} {{end}} {{ define "header"}} {{ partial "header" .}} {{end}} {{ define "main"}} {{$parentDir := .File.Dir}} {{$this := .Page}} {{ partial "sidebar" . }} <!-- {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} {{end}}--> <div id="content" class="row align-right"> <div class="col col-2"></div> <div id="main" class="col col-9"> <div id="hero"> <h1>{{.Title}}</h1> </div> <div id="components"> <div class="row gutters"> <!-- only show pages where dir is the same as the _index.md --> {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} <div class="col col-4 item"> <a style="text-decoration:none"> <h4>{{ .Key }}<h4> </a> {{range .Pages}} <a href="{{ .Permalink }}" style="text-decoration:none; font-size:17px; color:#3794de; ">{{ .Title }}</a><br> {{ end }} </div> {{end}} </div> </div> </div> </div> {{ end }} {{ define "footer"}} {{ partial "footer" .}} {{end}}
Fix alignment of example list
Fix alignment of example list Previously, the sidebar was intersecting with the content
HTML
apache-2.0
ANZ-bank/Sysl,ANZ-bank/Sysl
html
## Code Before: {{ define "title"}} {{ .Title}} {{end}} {{ define "header"}} {{ partial "header" .}} {{end}} {{ define "main"}} {{$parentDir := .File.Dir}} {{$this := .Page}} {{ partial "sidebar" . }} <!-- {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} {{end}}--> <div id="main"> <div id="hero"> <h1>{{.Title}}</h1> </div> <div id="components"> <div class="row gutters"> <!-- only show pages where dir is the same as the _index.md --> {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} <div class="col col-4 item"> <a style="text-decoration:none"> <h4>{{ .Key }}<h4> </a> {{range .Pages}} <a href="{{ .Permalink }}" style="text-decoration:none; font-size:17px; color:#3794de; ">{{ .Title }}</a><br> {{ end }} </div> {{end}} </div> </div> </div> {{ end }} {{ define "footer"}} {{ partial "footer" .}} {{end}} ## Instruction: Fix alignment of example list Previously, the sidebar was intersecting with the content ## Code After: {{ define "title"}} {{ .Title}} {{end}} {{ define "header"}} {{ partial "header" .}} {{end}} {{ define "main"}} {{$parentDir := .File.Dir}} {{$this := .Page}} {{ partial "sidebar" . }} <!-- {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} {{end}}--> <div id="content" class="row align-right"> <div class="col col-2"></div> <div id="main" class="col col-9"> <div id="hero"> <h1>{{.Title}}</h1> </div> <div id="components"> <div class="row gutters"> <!-- only show pages where dir is the same as the _index.md --> {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} <div class="col col-4 item"> <a style="text-decoration:none"> <h4>{{ .Key }}<h4> </a> {{range .Pages}} <a href="{{ .Permalink }}" style="text-decoration:none; font-size:17px; color:#3794de; ">{{ .Title }}</a><br> {{ end }} </div> {{end}} </div> </div> </div> </div> {{ end }} {{ define "footer"}} {{ partial "footer" .}} {{end}}
{{ define "title"}} {{ .Title}} {{end}} {{ define "header"}} {{ partial "header" .}} {{end}} {{ define "main"}} {{$parentDir := .File.Dir}} {{$this := .Page}} {{ partial "sidebar" . }} <!-- {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} {{end}}--> - - <div id="main"> + <div id="content" class="row align-right"> + <div class="col col-2"></div> + <div id="main" class="col col-9"> <div id="hero"> <h1>{{.Title}}</h1> </div> <div id="components"> <div class="row gutters"> <!-- only show pages where dir is the same as the _index.md --> {{ $pages := where .Site.RegularPages ".File.Dir" $parentDir }} {{ range $pages.GroupByParam "Topic"}} <div class="col col-4 item"> <a style="text-decoration:none"> <h4>{{ .Key }}<h4> </a> {{range .Pages}} <a href="{{ .Permalink }}" style="text-decoration:none; font-size:17px; color:#3794de; ">{{ .Title }}</a><br> {{ end }} </div> {{end}} </div> </div> </div> + </div> {{ end }} {{ define "footer"}} {{ partial "footer" .}} {{end}}
6
0.139535
4
2
c309582fe8b86a26733f09deeb268da8de5fe873
ditto/static/tidy/js/comments/CommentForm.jsx
ditto/static/tidy/js/comments/CommentForm.jsx
import React from 'react'; export default class CommentForm extends React.Component { // TODO static propTypes render () { return ( <form onSubmit={this._onSubmit}> <div className="form-group"> <label forHtml="comment">Add Comment:</label> <textarea className="form-control" id="comment" ref="text"/> <input className="btn btn-success" type="submit" /> </div> </form> ); } _onSubmit = (e) => { e.preventDefault(); let value = React.findDOMNode(this.refs.text).value; this.props.onSubmit(value); } }
import React from 'react'; import Validate from '../lib/form/Validate.jsx'; export default class CommentForm extends React.Component { static propTypes = { onSubmit: React.PropTypes.func.isRequired, } state = { comment: "" } render () { return ( <form onSubmit={this._onSubmit}> <div className="form-group"> <Validate isRequired={true} id="comment"> <textarea className="form-control" ref="text" value={this.state.comment} onChange={v => this.setState({comment: v})} /> </Validate> <input className="btn btn-success" disabled={!this.state.comment} type="submit" /> </div> </form> ); } _onSubmit = (e) => { e.preventDefault(); this.props.onSubmit(this.state.comment); } }
Disable submit button until comment is entered
Disable submit button until comment is entered
JSX
bsd-3-clause
Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto
jsx
## Code Before: import React from 'react'; export default class CommentForm extends React.Component { // TODO static propTypes render () { return ( <form onSubmit={this._onSubmit}> <div className="form-group"> <label forHtml="comment">Add Comment:</label> <textarea className="form-control" id="comment" ref="text"/> <input className="btn btn-success" type="submit" /> </div> </form> ); } _onSubmit = (e) => { e.preventDefault(); let value = React.findDOMNode(this.refs.text).value; this.props.onSubmit(value); } } ## Instruction: Disable submit button until comment is entered ## Code After: import React from 'react'; import Validate from '../lib/form/Validate.jsx'; export default class CommentForm extends React.Component { static propTypes = { onSubmit: React.PropTypes.func.isRequired, } state = { comment: "" } render () { return ( <form onSubmit={this._onSubmit}> <div className="form-group"> <Validate isRequired={true} id="comment"> <textarea className="form-control" ref="text" value={this.state.comment} onChange={v => this.setState({comment: v})} /> </Validate> <input className="btn btn-success" disabled={!this.state.comment} type="submit" /> </div> </form> ); } _onSubmit = (e) => { e.preventDefault(); this.props.onSubmit(this.state.comment); } }
import React from 'react'; + import Validate from '../lib/form/Validate.jsx'; export default class CommentForm extends React.Component { - // TODO static propTypes ? -------- + static propTypes = { ? ++++ + onSubmit: React.PropTypes.func.isRequired, + } + state = { + comment: "" + } + render () { return ( <form onSubmit={this._onSubmit}> <div className="form-group"> - <label forHtml="comment">Add Comment:</label> - <textarea className="form-control" id="comment" ref="text"/> - <input className="btn btn-success" type="submit" /> + <Validate isRequired={true} id="comment"> + <textarea + className="form-control" + ref="text" + value={this.state.comment} + onChange={v => this.setState({comment: v})} + /> + </Validate> + <input + className="btn btn-success" + disabled={!this.state.comment} + type="submit" /> </div> </form> ); } _onSubmit = (e) => { e.preventDefault(); + this.props.onSubmit(this.state.comment); - let value = React.findDOMNode(this.refs.text).value; - this.props.onSubmit(value); } }
27
1.173913
21
6
a1638504e1dc02cce9bb7093270b12fd87cdd998
core-galleon-pack/src/main/resources/layers/standalone/secure-management/layer-spec.xml
core-galleon-pack/src/main/resources/layers/standalone/secure-management/layer-spec.xml
<?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="secure-management"> <dependencies> <layer name="management"/> <layer name="elytron"/> </dependencies> <feature spec="core-service.management.management-interface.http-interface"> <param name="socket-binding" value="management-http"/> <feature spec="core-service.management.management-interface.http-interface.http-upgrade"> <param name="sasl-authentication-factory" value="management-sasl-authentication"/> </feature> </feature> </layer-spec>
<?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="secure-management"> <dependencies> <layer name="management"/> <layer name="elytron"/> </dependencies> <feature spec="core-service.management.management-interface.http-interface"> <param name="socket-binding" value="management-http"/> <param name="http-authentication-factory" value="management-http-authentication"/> <feature spec="core-service.management.management-interface.http-interface.http-upgrade"> <param name="sasl-authentication-factory" value="management-sasl-authentication"/> </feature> </feature> </layer-spec>
Fix for WFCORE-4354, Layers, secure-management layer doesn't secure direct http access
Fix for WFCORE-4354, Layers, secure-management layer doesn't secure direct http access
XML
lgpl-2.1
yersan/wildfly-core,jfdenise/wildfly-core,darranl/wildfly-core,yersan/wildfly-core,aloubyansky/wildfly-core,bstansberry/wildfly-core,bstansberry/wildfly-core,jamezp/wildfly-core,luck3y/wildfly-core,aloubyansky/wildfly-core,soul2zimate/wildfly-core,jamezp/wildfly-core,jfdenise/wildfly-core,luck3y/wildfly-core,soul2zimate/wildfly-core,ivassile/wildfly-core,soul2zimate/wildfly-core,jamezp/wildfly-core,ivassile/wildfly-core,jfdenise/wildfly-core,luck3y/wildfly-core,yersan/wildfly-core,ivassile/wildfly-core,aloubyansky/wildfly-core,darranl/wildfly-core,bstansberry/wildfly-core,darranl/wildfly-core
xml
## Code Before: <?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="secure-management"> <dependencies> <layer name="management"/> <layer name="elytron"/> </dependencies> <feature spec="core-service.management.management-interface.http-interface"> <param name="socket-binding" value="management-http"/> <feature spec="core-service.management.management-interface.http-interface.http-upgrade"> <param name="sasl-authentication-factory" value="management-sasl-authentication"/> </feature> </feature> </layer-spec> ## Instruction: Fix for WFCORE-4354, Layers, secure-management layer doesn't secure direct http access ## Code After: <?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="secure-management"> <dependencies> <layer name="management"/> <layer name="elytron"/> </dependencies> <feature spec="core-service.management.management-interface.http-interface"> <param name="socket-binding" value="management-http"/> <param name="http-authentication-factory" value="management-http-authentication"/> <feature spec="core-service.management.management-interface.http-interface.http-upgrade"> <param name="sasl-authentication-factory" value="management-sasl-authentication"/> </feature> </feature> </layer-spec>
<?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="secure-management"> <dependencies> <layer name="management"/> <layer name="elytron"/> </dependencies> <feature spec="core-service.management.management-interface.http-interface"> <param name="socket-binding" value="management-http"/> + <param name="http-authentication-factory" value="management-http-authentication"/> <feature spec="core-service.management.management-interface.http-interface.http-upgrade"> <param name="sasl-authentication-factory" value="management-sasl-authentication"/> </feature> </feature> </layer-spec>
1
0.066667
1
0
327e3a796eb92d5cac4b3cd97c9b6fcd5f7d9e68
frontend/views/PageView.js
frontend/views/PageView.js
/** * View class for Pages * * @copyright 2014-today Justso GmbH, Frankfurt, Germany * @author j.schirrmacher@justso.de * * @package Generator */ define([ "jquery", "backbone" ], function($, Backbone) { return Backbone.View.extend({ tagName: 'li', className: "list-group-item", render: function(page) { this.$el.attr("id", page.cid); this.$el.html(_.template($("#PageEntry").html(), page.attributes)); return this.el; } }); });
/** * View class for Pages * * @copyright 2014-today Justso GmbH, Frankfurt, Germany * @author j.schirrmacher@justso.de * * @package Generator */ define([ "jquery", "backbone" ], function($, Backbone) { var compiled = _.template($("#PageEntry").html()); return Backbone.View.extend({ tagName: 'li', className: "list-group-item", render: function(page) { this.$el.attr("id", page.cid); this.$el.html(compiled(page.attributes)); return this.el; } }); });
Use precompiled template for pages as well
Use precompiled template for pages as well
JavaScript
mit
JustsoSoftware/JustTexts,JustsoSoftware/JustTexts,JustsoSoftware/JustTexts
javascript
## Code Before: /** * View class for Pages * * @copyright 2014-today Justso GmbH, Frankfurt, Germany * @author j.schirrmacher@justso.de * * @package Generator */ define([ "jquery", "backbone" ], function($, Backbone) { return Backbone.View.extend({ tagName: 'li', className: "list-group-item", render: function(page) { this.$el.attr("id", page.cid); this.$el.html(_.template($("#PageEntry").html(), page.attributes)); return this.el; } }); }); ## Instruction: Use precompiled template for pages as well ## Code After: /** * View class for Pages * * @copyright 2014-today Justso GmbH, Frankfurt, Germany * @author j.schirrmacher@justso.de * * @package Generator */ define([ "jquery", "backbone" ], function($, Backbone) { var compiled = _.template($("#PageEntry").html()); return Backbone.View.extend({ tagName: 'li', className: "list-group-item", render: function(page) { this.$el.attr("id", page.cid); this.$el.html(compiled(page.attributes)); return this.el; } }); });
/** * View class for Pages * * @copyright 2014-today Justso GmbH, Frankfurt, Germany * @author j.schirrmacher@justso.de * * @package Generator */ define([ "jquery", "backbone" ], function($, Backbone) { + var compiled = _.template($("#PageEntry").html()); + return Backbone.View.extend({ tagName: 'li', className: "list-group-item", render: function(page) { this.$el.attr("id", page.cid); - this.$el.html(_.template($("#PageEntry").html(), page.attributes)); + this.$el.html(compiled(page.attributes)); return this.el; } }); });
4
0.190476
3
1
6df3e9619f04092eb071aa15d22431460d40e2e4
src/Modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1
src/Modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1
@{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright=" Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" PowerShellVersion="3.0" CLRVersion="4.0" AliasesToExport = @() FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManCredSSP", "Get-WSManCredSSP", "Set-WSManQuickConfig", "Test-WSMan", "Invoke-WSManAction", "Connect-WSMan", "Disconnect-WSMan", "Get-WSManInstance", "Set-WSManInstance", "Remove-WSManInstance", "New-WSManInstance", "New-WSManSessionOption" NestedModules="Microsoft.WSMan.Management.dll" FormatsToProcess="WSMan.format.ps1xml" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390788' }
@{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright=" Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" PowerShellVersion="3.0" CLRVersion="4.0" AliasesToExport = @() FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManCredSSP", "Get-WSManCredSSP", "Set-WSManQuickConfig", "Test-WSMan", "Invoke-WSManAction", "Connect-WSMan", "Disconnect-WSMan", "Get-WSManInstance", "Set-WSManInstance", "Remove-WSManInstance", "New-WSManInstance", "New-WSManSessionOption" NestedModules="Microsoft.WSMan.Management.dll" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390788' }
Remove mention of format file since this is done in code now
Remove mention of format file since this is done in code now
PowerShell
mit
PaulHigin/PowerShell,daxian-dbw/PowerShell,KarolKaczmarek/PowerShell,bingbing8/PowerShell,JamesWTruher/PowerShell-1,daxian-dbw/PowerShell,JamesWTruher/PowerShell-1,kmosher/PowerShell,jsoref/PowerShell,kmosher/PowerShell,kmosher/PowerShell,daxian-dbw/PowerShell,PaulHigin/PowerShell,bmanikm/PowerShell,daxian-dbw/PowerShell,KarolKaczmarek/PowerShell,JamesWTruher/PowerShell-1,KarolKaczmarek/PowerShell,TravisEz13/PowerShell,jsoref/PowerShell,JamesWTruher/PowerShell-1,KarolKaczmarek/PowerShell,jsoref/PowerShell,TravisEz13/PowerShell,KarolKaczmarek/PowerShell,bmanikm/PowerShell,bingbing8/PowerShell,bmanikm/PowerShell,bingbing8/PowerShell,kmosher/PowerShell,jsoref/PowerShell,bingbing8/PowerShell,TravisEz13/PowerShell,TravisEz13/PowerShell,bingbing8/PowerShell,kmosher/PowerShell,PaulHigin/PowerShell,bmanikm/PowerShell,jsoref/PowerShell,PaulHigin/PowerShell,bmanikm/PowerShell
powershell
## Code Before: @{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright=" Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" PowerShellVersion="3.0" CLRVersion="4.0" AliasesToExport = @() FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManCredSSP", "Get-WSManCredSSP", "Set-WSManQuickConfig", "Test-WSMan", "Invoke-WSManAction", "Connect-WSMan", "Disconnect-WSMan", "Get-WSManInstance", "Set-WSManInstance", "Remove-WSManInstance", "New-WSManInstance", "New-WSManSessionOption" NestedModules="Microsoft.WSMan.Management.dll" FormatsToProcess="WSMan.format.ps1xml" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390788' } ## Instruction: Remove mention of format file since this is done in code now ## Code After: @{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright=" Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" PowerShellVersion="3.0" CLRVersion="4.0" AliasesToExport = @() FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManCredSSP", "Get-WSManCredSSP", "Set-WSManQuickConfig", "Test-WSMan", "Invoke-WSManAction", "Connect-WSMan", "Disconnect-WSMan", "Get-WSManInstance", "Set-WSManInstance", "Remove-WSManInstance", "New-WSManInstance", "New-WSManSessionOption" NestedModules="Microsoft.WSMan.Management.dll" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390788' }
@{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright=" Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" PowerShellVersion="3.0" CLRVersion="4.0" AliasesToExport = @() FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManCredSSP", "Get-WSManCredSSP", "Set-WSManQuickConfig", "Test-WSMan", "Invoke-WSManAction", "Connect-WSMan", "Disconnect-WSMan", "Get-WSManInstance", "Set-WSManInstance", "Remove-WSManInstance", "New-WSManInstance", "New-WSManSessionOption" NestedModules="Microsoft.WSMan.Management.dll" - FormatsToProcess="WSMan.format.ps1xml" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390788' }
1
0.066667
0
1
4903afcec3d22d046c39a5b565366dc13472c6fd
zosimus/chartchemy/utils.py
zosimus/chartchemy/utils.py
import simplejson from django.utils.html import escape def render_highcharts_options(render_to, categories, series, title, x_axis_title, y_axis_title, series_name): """Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object.""" # Escape all the character strings to make them HTML safe. render_to = escape(render_to) if render_to else render_to title = escape(title) if title else title x_axis_title = escape(x_axis_title) if x_axis_title else x_axis_title y_axis_title = escape(y_axis_title) if y_axis_title else y_axis_title # Categories (dimensions) come from the use. Escape them too. categories = [escape(c) for c in categories] hco = { "chart": { "renderTo": render_to, "type": 'column' }, "title": { "text": title }, "xAxis": { "title": { "text": x_axis_title }, "categories": categories }, "yAxis": { "title": { "text": y_axis_title, } }, "series": [{ "name": series_name, "data": series, }] } return simplejson.dumps(hco, use_decimal=True)
import simplejson from django.utils.html import escape def render_highcharts_options(render_to, categories, series, title, x_axis_title, y_axis_title, series_name): """Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object.""" # Escape all the character strings to make them HTML safe. render_to = escape(render_to.encode('ascii', 'ignore')) if render_to else 'render_to' title = escape(title.encode('ascii', 'ignore')) if title else 'title' x_axis_title = escape(x_axis_title.encode('ascii', 'ignore')) if x_axis_title else 'x axis' y_axis_title = escape(y_axis_title.encode('ascii', 'ignore')) if y_axis_title else 'y axis' # Categories (dimensions) come from the use. Escape them too. categories = [escape(c.encode('ascii', 'ignore')) for c in categories] hco = { "chart": { "renderTo": render_to, "type": 'column' }, "title": { "text": title }, "xAxis": { "title": { "text": x_axis_title }, "categories": categories }, "yAxis": { "title": { "text": y_axis_title, } }, "series": [{ "name": series_name, "data": series, }] } return simplejson.dumps(hco, use_decimal=True)
Fix unicode error in series
Fix unicode error in series
Python
bsd-2-clause
pgollakota/zosimus,pgollakota/zosimus
python
## Code Before: import simplejson from django.utils.html import escape def render_highcharts_options(render_to, categories, series, title, x_axis_title, y_axis_title, series_name): """Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object.""" # Escape all the character strings to make them HTML safe. render_to = escape(render_to) if render_to else render_to title = escape(title) if title else title x_axis_title = escape(x_axis_title) if x_axis_title else x_axis_title y_axis_title = escape(y_axis_title) if y_axis_title else y_axis_title # Categories (dimensions) come from the use. Escape them too. categories = [escape(c) for c in categories] hco = { "chart": { "renderTo": render_to, "type": 'column' }, "title": { "text": title }, "xAxis": { "title": { "text": x_axis_title }, "categories": categories }, "yAxis": { "title": { "text": y_axis_title, } }, "series": [{ "name": series_name, "data": series, }] } return simplejson.dumps(hco, use_decimal=True) ## Instruction: Fix unicode error in series ## Code After: import simplejson from django.utils.html import escape def render_highcharts_options(render_to, categories, series, title, x_axis_title, y_axis_title, series_name): """Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object.""" # Escape all the character strings to make them HTML safe. render_to = escape(render_to.encode('ascii', 'ignore')) if render_to else 'render_to' title = escape(title.encode('ascii', 'ignore')) if title else 'title' x_axis_title = escape(x_axis_title.encode('ascii', 'ignore')) if x_axis_title else 'x axis' y_axis_title = escape(y_axis_title.encode('ascii', 'ignore')) if y_axis_title else 'y axis' # Categories (dimensions) come from the use. Escape them too. categories = [escape(c.encode('ascii', 'ignore')) for c in categories] hco = { "chart": { "renderTo": render_to, "type": 'column' }, "title": { "text": title }, "xAxis": { "title": { "text": x_axis_title }, "categories": categories }, "yAxis": { "title": { "text": y_axis_title, } }, "series": [{ "name": series_name, "data": series, }] } return simplejson.dumps(hco, use_decimal=True)
import simplejson from django.utils.html import escape def render_highcharts_options(render_to, categories, series, title, x_axis_title, y_axis_title, series_name): """Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object.""" # Escape all the character strings to make them HTML safe. - render_to = escape(render_to) if render_to else render_to + render_to = escape(render_to.encode('ascii', 'ignore')) if render_to else 'render_to' ? ++++++++++++++++++++++++++ + + - title = escape(title) if title else title + title = escape(title.encode('ascii', 'ignore')) if title else 'title' ? ++++++++++++++++++++++++++ + + - x_axis_title = escape(x_axis_title) if x_axis_title else x_axis_title ? ^ ^^^^^^ + x_axis_title = escape(x_axis_title.encode('ascii', 'ignore')) if x_axis_title else 'x axis' ? ++++++++++++++++++++++++++ + ^ ^ - y_axis_title = escape(y_axis_title) if y_axis_title else y_axis_title ? ^ ^^^^^^ + y_axis_title = escape(y_axis_title.encode('ascii', 'ignore')) if y_axis_title else 'y axis' ? ++++++++++++++++++++++++++ + ^ ^ # Categories (dimensions) come from the use. Escape them too. - categories = [escape(c) for c in categories] + categories = [escape(c.encode('ascii', 'ignore')) for c in categories] ? ++++++++++++++++++++++++++ hco = { "chart": { "renderTo": render_to, "type": 'column' }, "title": { "text": title }, "xAxis": { "title": { "text": x_axis_title }, "categories": categories }, "yAxis": { "title": { "text": y_axis_title, } }, "series": [{ "name": series_name, "data": series, }] } return simplejson.dumps(hco, use_decimal=True)
10
0.243902
5
5
ee9d32426294d481ad272036737d040ff9ffbcbb
README.md
README.md
A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage
A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage [![Build Status](https://travis-ci.org/conveyal/gtfs-lib.svg?branch=master)](https://travis-ci.org/conveyal/gtfs-lib)
Add Travis CI build passing badge
Add Travis CI build passing badge
Markdown
bsd-2-clause
conveyal/gtfs-lib
markdown
## Code Before: A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage ## Instruction: Add Travis CI build passing badge ## Code After: A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage [![Build Status](https://travis-ci.org/conveyal/gtfs-lib.svg?branch=master)](https://travis-ci.org/conveyal/gtfs-lib)
A library for loading and saving GTFS feeds of arbitrary size with disk-backed storage + [![Build Status](https://travis-ci.org/conveyal/gtfs-lib.svg?branch=master)](https://travis-ci.org/conveyal/gtfs-lib)
1
1
1
0
fc0e2d217203072d67c9d78c2b783f1d83082dd2
app/models/user_identity.rb
app/models/user_identity.rb
class UserIdentity < ActiveRecord::Base belongs_to :user validates :provider, uniqueness: { scope: :user_id } end
class UserIdentity < ActiveRecord::Base belongs_to :user validates :provider, uniqueness: { scope: :user_id } validates :uid, uniqueness: { scope: :provider } end
Add validation for uid uniqness
Add validation for uid uniqness [GIOT-29]
Ruby
mpl-2.0
mlorb/scinote-web,Ducz0r/scinote-web,Ducz0r/scinote-web,mlorb/scinote-web,mlorb/scinote-web,Ducz0r/scinote-web
ruby
## Code Before: class UserIdentity < ActiveRecord::Base belongs_to :user validates :provider, uniqueness: { scope: :user_id } end ## Instruction: Add validation for uid uniqness [GIOT-29] ## Code After: class UserIdentity < ActiveRecord::Base belongs_to :user validates :provider, uniqueness: { scope: :user_id } validates :uid, uniqueness: { scope: :provider } end
class UserIdentity < ActiveRecord::Base belongs_to :user validates :provider, uniqueness: { scope: :user_id } + validates :uid, uniqueness: { scope: :provider } end
1
0.25
1
0
c604d30929cc60ac38bc10f764c582e9893805c6
scripts/merge-candidates.rb
scripts/merge-candidates.rb
require_relative "../models" def show_candidate(id) c = Candidate.get(id) template = "%6s\t%50s\t%20s\t%3s" puts template % [ c.id, c.forenames, c.surname ] ccy_template = "%20s\t%15s\t%20s\t%20s" c.candidacies.each do |ccy| puts template % [ ccy.election.body.name, ccy.election.d, ccy.district.name, ccy.party.name] end end winner = ARGV.shift loser = ARGV.shift puts "WINNER" show_candidate(winner) puts puts "LOSER" show_candidate(loser) puts "Are you sure you want to merge these two candidates? The loser will be deleted. (Y or N)" answer = gets.chomp.downcase unless answer == 'y' puts "Aborting. No changes made to the database." exit end # Transfer all the loser's candidacies to the winner repository(:default).adapter.select(" UPDATE candidacies SET candidate_id = #{winner} WHERE candidate_id = #{loser} ") # Delete the loser candidate Candidate.get(loser).destroy puts "Merge completed. Here is the merged candidate:" puts show_candidate(winner)
require_relative "../models" def show_candidate(id) c = Candidate.get(id) template = "%6s\t%50s\t%20s\t%3s" puts template % [ c.id, c.forenames, c.surname ] ccy_template = "%20s\t%15s\t%20s\t%20s" c.candidacies.each do |ccy| puts template % [ ccy.election.body.name, ccy.election.d, ccy.district.name, ccy.party.name] end end winner = ARGV.shift loser = ARGV.shift puts "WINNER" show_candidate(winner) puts puts "LOSER" show_candidate(loser) puts "Are you sure you want to merge these two candidates? The loser will be deleted. (Y or N)" answer = gets.chomp.downcase unless answer == 'y' puts "Aborting. No changes made to the database." exit end # Transfer all the loser's candidacies to the winner repository(:default).adapter.select(" UPDATE candidacies SET candidate_id = #{winner} WHERE candidate_id = #{loser} ") # Delete the loser candidate DeletedCandidate.create(:old_candidate_id => loser, :candidate_id => winner) Candidate.get(loser).destroy puts "Merge completed. Here is the merged candidate:" puts show_candidate(winner)
Create a DeletedCandidate for the merged candidate
Create a DeletedCandidate for the merged candidate
Ruby
agpl-3.0
adrianshort/suttonelections,adrianshort/suttonelections
ruby
## Code Before: require_relative "../models" def show_candidate(id) c = Candidate.get(id) template = "%6s\t%50s\t%20s\t%3s" puts template % [ c.id, c.forenames, c.surname ] ccy_template = "%20s\t%15s\t%20s\t%20s" c.candidacies.each do |ccy| puts template % [ ccy.election.body.name, ccy.election.d, ccy.district.name, ccy.party.name] end end winner = ARGV.shift loser = ARGV.shift puts "WINNER" show_candidate(winner) puts puts "LOSER" show_candidate(loser) puts "Are you sure you want to merge these two candidates? The loser will be deleted. (Y or N)" answer = gets.chomp.downcase unless answer == 'y' puts "Aborting. No changes made to the database." exit end # Transfer all the loser's candidacies to the winner repository(:default).adapter.select(" UPDATE candidacies SET candidate_id = #{winner} WHERE candidate_id = #{loser} ") # Delete the loser candidate Candidate.get(loser).destroy puts "Merge completed. Here is the merged candidate:" puts show_candidate(winner) ## Instruction: Create a DeletedCandidate for the merged candidate ## Code After: require_relative "../models" def show_candidate(id) c = Candidate.get(id) template = "%6s\t%50s\t%20s\t%3s" puts template % [ c.id, c.forenames, c.surname ] ccy_template = "%20s\t%15s\t%20s\t%20s" c.candidacies.each do |ccy| puts template % [ ccy.election.body.name, ccy.election.d, ccy.district.name, ccy.party.name] end end winner = ARGV.shift loser = ARGV.shift puts "WINNER" show_candidate(winner) puts puts "LOSER" show_candidate(loser) puts "Are you sure you want to merge these two candidates? The loser will be deleted. (Y or N)" answer = gets.chomp.downcase unless answer == 'y' puts "Aborting. No changes made to the database." exit end # Transfer all the loser's candidacies to the winner repository(:default).adapter.select(" UPDATE candidacies SET candidate_id = #{winner} WHERE candidate_id = #{loser} ") # Delete the loser candidate DeletedCandidate.create(:old_candidate_id => loser, :candidate_id => winner) Candidate.get(loser).destroy puts "Merge completed. Here is the merged candidate:" puts show_candidate(winner)
require_relative "../models" def show_candidate(id) c = Candidate.get(id) template = "%6s\t%50s\t%20s\t%3s" puts template % [ c.id, c.forenames, c.surname ] ccy_template = "%20s\t%15s\t%20s\t%20s" c.candidacies.each do |ccy| puts template % [ ccy.election.body.name, ccy.election.d, ccy.district.name, ccy.party.name] end end winner = ARGV.shift loser = ARGV.shift puts "WINNER" show_candidate(winner) puts puts "LOSER" show_candidate(loser) puts "Are you sure you want to merge these two candidates? The loser will be deleted. (Y or N)" answer = gets.chomp.downcase unless answer == 'y' puts "Aborting. No changes made to the database." exit end # Transfer all the loser's candidacies to the winner repository(:default).adapter.select(" UPDATE candidacies SET candidate_id = #{winner} WHERE candidate_id = #{loser} ") # Delete the loser candidate + DeletedCandidate.create(:old_candidate_id => loser, :candidate_id => winner) Candidate.get(loser).destroy puts "Merge completed. Here is the merged candidate:" puts show_candidate(winner)
1
0.020408
1
0
11f7c8a8d671e1e9d48c39c8876eee750e0406ec
.circleci/config.yml
.circleci/config.yml
version: 2 jobs: build: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e flake8 - run: tox -e isort - run: tox -e py2-tests - run: tox -e py3-tests - run: tox -e coverage workflows: version: 2 build: jobs: - build
version: 2 jobs: flake8: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e flake8 isort: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e isort tests: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e py2-tests - run: tox -e py3-tests - run: tox -e coverage workflows: version: 2 build: jobs: - flake8 - isort - tests
Divide circle ci into different jobs for better feedback on prs
chore: Divide circle ci into different jobs for better feedback on prs
YAML
mit
relekang/python-semantic-release,relekang/python-semantic-release
yaml
## Code Before: version: 2 jobs: build: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e flake8 - run: tox -e isort - run: tox -e py2-tests - run: tox -e py3-tests - run: tox -e coverage workflows: version: 2 build: jobs: - build ## Instruction: chore: Divide circle ci into different jobs for better feedback on prs ## Code After: version: 2 jobs: flake8: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e flake8 isort: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e isort tests: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e py2-tests - run: tox -e py3-tests - run: tox -e coverage workflows: version: 2 build: jobs: - flake8 - isort - tests
version: 2 jobs: - build: + flake8: docker: - image: circleci/python:3.6 steps: - checkout - run: sudo pip install tox - restore_cache: keys: - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} - run: tox --notest - save_cache: key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} paths: - .tox - run: tox -e flake8 + + isort: + docker: + - image: circleci/python:3.6 + + steps: + - checkout + - run: sudo pip install tox + - restore_cache: + keys: + - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} + - run: tox --notest + - save_cache: + key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} + paths: + - .tox - run: tox -e isort + + tests: + docker: + - image: circleci/python:3.6 + + steps: + - checkout + - run: sudo pip install tox + - restore_cache: + keys: + - v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} + - run: tox --notest + - save_cache: + key: v1-tox-{{ checksum "tox.ini" }}-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/dev.txt" }} + paths: + - .tox - run: tox -e py2-tests - run: tox -e py3-tests - run: tox -e coverage workflows: version: 2 build: jobs: - - build + - flake8 + - isort + - tests
38
1.266667
36
2
4c288518a673a0f5e92b00a6965d47af5ca73d73
index.js
index.js
var Disclosure = function(el) { var self = this; self.el = el; self.isActive = false; self.details = el.querySelectorAll('[data-details]'); el.addEventListener('click', function(e) { self.toggle(e) }); self.hide(); }; Disclosure.prototype.hide = function() { for (var i = 0; i < this.details.length; i++) { this.details[i].style.display = 'none'; } }; Disclosure.prototype.show = function() { for (var i = 0; i < el.details.length; i++) { this.details[i].style.display = 'block'; } }; Disclosure.prototype.toggle = function(e) { e.stopPropagation(); this.isActive = !this.isActive; if (this.isActive) { this.show() } else { this.hide() } }; module.exports = function(el) { return new Disclosure(el); };
var Disclosure = function(el) { var self = this; self.el = el; self.isActive = false; self.details = el.querySelectorAll('[data-details]'); el.addEventListener('click', function(e) { self.toggle(e) }); self.hide(); }; Disclosure.prototype.hide = function() { for (var i = 0; i < this.details.length; i++) { this.details[i].style.display = 'none'; } }; Disclosure.prototype.show = function() { for (var i = 0; i < el.details.length; i++) { this.details[i].style.display = 'block'; } }; Disclosure.prototype.toggle = function(e) { e.stopPropagation(); this.isActive = !this.isActive; if (this.isActive) { this.show() } else { this.hide() } }; module.exports = { create: function(el) { return new Disclosure(el); }, all: function() { var els = document.querySelectorAll("[data-disclose]"); for (var i = 0; i < els.length; i++) { new Disclosure(els[i]); } } };
Expand the api to have an all()
Expand the api to have an all()
JavaScript
mit
wunderlist/disclose
javascript
## Code Before: var Disclosure = function(el) { var self = this; self.el = el; self.isActive = false; self.details = el.querySelectorAll('[data-details]'); el.addEventListener('click', function(e) { self.toggle(e) }); self.hide(); }; Disclosure.prototype.hide = function() { for (var i = 0; i < this.details.length; i++) { this.details[i].style.display = 'none'; } }; Disclosure.prototype.show = function() { for (var i = 0; i < el.details.length; i++) { this.details[i].style.display = 'block'; } }; Disclosure.prototype.toggle = function(e) { e.stopPropagation(); this.isActive = !this.isActive; if (this.isActive) { this.show() } else { this.hide() } }; module.exports = function(el) { return new Disclosure(el); }; ## Instruction: Expand the api to have an all() ## Code After: var Disclosure = function(el) { var self = this; self.el = el; self.isActive = false; self.details = el.querySelectorAll('[data-details]'); el.addEventListener('click', function(e) { self.toggle(e) }); self.hide(); }; Disclosure.prototype.hide = function() { for (var i = 0; i < this.details.length; i++) { this.details[i].style.display = 'none'; } }; Disclosure.prototype.show = function() { for (var i = 0; i < el.details.length; i++) { this.details[i].style.display = 'block'; } }; Disclosure.prototype.toggle = function(e) { e.stopPropagation(); this.isActive = !this.isActive; if (this.isActive) { this.show() } else { this.hide() } }; module.exports = { create: function(el) { return new Disclosure(el); }, all: function() { var els = document.querySelectorAll("[data-disclose]"); for (var i = 0; i < els.length; i++) { new Disclosure(els[i]); } } };
var Disclosure = function(el) { var self = this; self.el = el; self.isActive = false; self.details = el.querySelectorAll('[data-details]'); el.addEventListener('click', function(e) { self.toggle(e) }); self.hide(); }; Disclosure.prototype.hide = function() { for (var i = 0; i < this.details.length; i++) { this.details[i].style.display = 'none'; } }; Disclosure.prototype.show = function() { for (var i = 0; i < el.details.length; i++) { this.details[i].style.display = 'block'; } }; Disclosure.prototype.toggle = function(e) { e.stopPropagation(); this.isActive = !this.isActive; if (this.isActive) { this.show() } else { this.hide() } }; - module.exports = function(el) { + module.exports = { + create: function(el) { - return new Disclosure(el); + return new Disclosure(el); ? ++ + }, + all: function() { + var els = document.querySelectorAll("[data-disclose]"); + for (var i = 0; i < els.length; i++) { + new Disclosure(els[i]); + } + } };
12
0.4
10
2
220b00b0ac3b1787ff933818ad5d3026f11471c4
src/app/shared/line-splitting.pipe.spec.ts
src/app/shared/line-splitting.pipe.spec.ts
import { AlbumDescriptionPipe } from './album-description.pipe'; describe('AlbumDescriptionPipe', () => { it('create an instance', () => { const pipe = new LineSplittingPipe(); expect(pipe).toBeTruthy(); }); });
import { AlbumDescriptionPipe } from './album-description.pipe'; describe('LineSplittingPipe', () => { it('create an instance', () => { const pipe = new LineSplittingPipe(); expect(pipe).toBeTruthy(); }); it('Splits lines with new line characters into an array', () => { const input = 'I like\nnew lines\nthere should be three'; const pipe = new LineSplittingPipe(); const output = pipe.transform(input, null); expect(output.length).toBe(3); expect(output[0]).toBe('I like'); expect(output[1]).toBe('new lines'); expect(output[2]).toBe('there should be three'); }); });
Add tests for line splitting pipe
Add tests for line splitting pipe
TypeScript
apache-2.0
jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog
typescript
## Code Before: import { AlbumDescriptionPipe } from './album-description.pipe'; describe('AlbumDescriptionPipe', () => { it('create an instance', () => { const pipe = new LineSplittingPipe(); expect(pipe).toBeTruthy(); }); }); ## Instruction: Add tests for line splitting pipe ## Code After: import { AlbumDescriptionPipe } from './album-description.pipe'; describe('LineSplittingPipe', () => { it('create an instance', () => { const pipe = new LineSplittingPipe(); expect(pipe).toBeTruthy(); }); it('Splits lines with new line characters into an array', () => { const input = 'I like\nnew lines\nthere should be three'; const pipe = new LineSplittingPipe(); const output = pipe.transform(input, null); expect(output.length).toBe(3); expect(output[0]).toBe('I like'); expect(output[1]).toBe('new lines'); expect(output[2]).toBe('there should be three'); }); });
import { AlbumDescriptionPipe } from './album-description.pipe'; - describe('AlbumDescriptionPipe', () => { ? ^ -------- ^ - + describe('LineSplittingPipe', () => { ? ^^^^^^ ^ + it('create an instance', () => { const pipe = new LineSplittingPipe(); expect(pipe).toBeTruthy(); }); + + it('Splits lines with new line characters into an array', () => { + const input = 'I like\nnew lines\nthere should be three'; + const pipe = new LineSplittingPipe(); + const output = pipe.transform(input, null); + + expect(output.length).toBe(3); + expect(output[0]).toBe('I like'); + expect(output[1]).toBe('new lines'); + expect(output[2]).toBe('there should be three'); + }); });
13
1.625
12
1
02487522935a47a8b11d08a7726607317fac373b
src/addons/editors/CheckboxEditor.js
src/addons/editors/CheckboxEditor.js
/* @flow */ /** * @jsx React.DOM */ 'use strict'; var React = require('react'); var CheckboxEditor = React.createClass({ PropTypes : { value : React.PropTypes.bool.isRequired, rowIdx : React.PropTypes.number.isRequired, column: React.PropTypes.shape({ key: React.PropTypes.string.isRequired, onCellChange: React.PropTypes.func.isRequired }).isRequired }, render(): ? ReactElement { var formatter = <span> n/a </span> if (this.props.value != null ) { var checked = this.props.value; formatter = <input className="react-grid-CheckBox" type="checkbox" checked={checked} onClick={this.handleChange} /> } return (formatter); }, handleChange(e: Event){ this.props.column.onCellChange(this.props.rowIdx, this.props.column.key, e); } }); module.exports = CheckboxEditor;
/* @flow */ /** * @jsx React.DOM */ 'use strict'; var React = require('react'); var CheckboxEditor = React.createClass({ PropTypes : { value : React.PropTypes.bool.isRequired, rowIdx : React.PropTypes.number.isRequired, column: React.PropTypes.shape({ key: React.PropTypes.string.isRequired, onCellChange: React.PropTypes.func.isRequired }).isRequired }, render(): ? ReactElement { var checked = this.props.value != null ? this.props.value : false; return (<input className="react-grid-CheckBox" type="checkbox" checked={checked} onClick={this.handleChange} />); }, handleChange(e: Event){ this.props.column.onCellChange(this.props.rowIdx, this.props.column.key, e); } }); module.exports = CheckboxEditor;
Revert "format to 'n/a' if no value is passed to the formatter"
Revert "format to 'n/a' if no value is passed to the formatter" This reverts commit 17bcf50a6d27b0221ae56c6a060ea2e6f1d2f240.
JavaScript
mit
yogesh-patel/react-data-grid,bor3ham/react-data-grid,nathanial/react-data-grid,sachgits/react-data-grid,somethingnew2-0/react-data-grid,kexplo/react-data-grid,fayizk1/react-data-grid,jeffvan576/react-data-grid
javascript
## Code Before: /* @flow */ /** * @jsx React.DOM */ 'use strict'; var React = require('react'); var CheckboxEditor = React.createClass({ PropTypes : { value : React.PropTypes.bool.isRequired, rowIdx : React.PropTypes.number.isRequired, column: React.PropTypes.shape({ key: React.PropTypes.string.isRequired, onCellChange: React.PropTypes.func.isRequired }).isRequired }, render(): ? ReactElement { var formatter = <span> n/a </span> if (this.props.value != null ) { var checked = this.props.value; formatter = <input className="react-grid-CheckBox" type="checkbox" checked={checked} onClick={this.handleChange} /> } return (formatter); }, handleChange(e: Event){ this.props.column.onCellChange(this.props.rowIdx, this.props.column.key, e); } }); module.exports = CheckboxEditor; ## Instruction: Revert "format to 'n/a' if no value is passed to the formatter" This reverts commit 17bcf50a6d27b0221ae56c6a060ea2e6f1d2f240. ## Code After: /* @flow */ /** * @jsx React.DOM */ 'use strict'; var React = require('react'); var CheckboxEditor = React.createClass({ PropTypes : { value : React.PropTypes.bool.isRequired, rowIdx : React.PropTypes.number.isRequired, column: React.PropTypes.shape({ key: React.PropTypes.string.isRequired, onCellChange: React.PropTypes.func.isRequired }).isRequired }, render(): ? ReactElement { var checked = this.props.value != null ? this.props.value : false; return (<input className="react-grid-CheckBox" type="checkbox" checked={checked} onClick={this.handleChange} />); }, handleChange(e: Event){ this.props.column.onCellChange(this.props.rowIdx, this.props.column.key, e); } }); module.exports = CheckboxEditor;
/* @flow */ /** * @jsx React.DOM */ 'use strict'; var React = require('react'); var CheckboxEditor = React.createClass({ PropTypes : { value : React.PropTypes.bool.isRequired, rowIdx : React.PropTypes.number.isRequired, column: React.PropTypes.shape({ key: React.PropTypes.string.isRequired, onCellChange: React.PropTypes.func.isRequired }).isRequired }, render(): ? ReactElement { + var checked = this.props.value != null ? this.props.value : false; - var formatter = <span> n/a </span> - if (this.props.value != null ) { - var checked = this.props.value; - formatter = <input className="react-grid-CheckBox" type="checkbox" checked={checked} onClick={this.handleChange} /> ? ^^^^^^^^^^^^^ + return (<input className="react-grid-CheckBox" type="checkbox" checked={checked} onClick={this.handleChange} />); ? ++++++ ^ ++ - } - return (formatter); }, handleChange(e: Event){ this.props.column.onCellChange(this.props.rowIdx, this.props.column.key, e); } }); module.exports = CheckboxEditor;
8
0.235294
2
6
8dfb97f92aa9173b608e78db89baf3ab0698ebd4
.travis.yml
.travis.yml
language: java jdk: - openjdk7 - oraclejdk7 after_success: - mvn jacoco:report coveralls:report
language: java jdk: - openjdk6 - openjdk7 - oraclejdk8 after_success: - mvn jacoco:report coveralls:report
Add OpenJDK 6 and OracleJDK 8 and remove OracleJDK 7
Add OpenJDK 6 and OracleJDK 8 and remove OracleJDK 7
YAML
apache-2.0
johnpaularthur/rundeck-slack-plugin,Sylvain-Bugat/rundeck-slack-plugin
yaml
## Code Before: language: java jdk: - openjdk7 - oraclejdk7 after_success: - mvn jacoco:report coveralls:report ## Instruction: Add OpenJDK 6 and OracleJDK 8 and remove OracleJDK 7 ## Code After: language: java jdk: - openjdk6 - openjdk7 - oraclejdk8 after_success: - mvn jacoco:report coveralls:report
language: java jdk: + - openjdk6 - openjdk7 - - oraclejdk7 ? ^ + - oraclejdk8 ? ^ after_success: - mvn jacoco:report coveralls:report
3
0.333333
2
1
7eea2e447fe3a637d8ef4d4baad6dd3477ed3d7e
lib/caze.rb
lib/caze.rb
require 'caze/version' require 'active_support' require 'active_support/concern' require 'active_support/core_ext/module/delegation' module Caze class NoTransactionMethodError < StandardError; end extend ActiveSupport::Concern module ClassMethods attr_accessor :transaction_handler def has_use_case(use_case_name, use_case_class, options = {}) transactional = options.fetch(:transactional) { false } define_singleton_method(use_case_name, Proc.new { |*args| if transactional handler = self.transaction_handler raise NoTransactionMethodError, "This action should be executed inside a transaction. But no transaction handler was configured." unless handler handler.transaction { use_case_class.send(use_case_name, *args) } else use_case_class.send(use_case_name, *args) end }) end def export(method_name, options = {}) method_to_define = options.fetch(:as) { method_name } define_singleton_method(method_to_define, Proc.new { |*args| use_case_object = args.empty? ? new : new(*args) use_case_object.send(method_name) }) end end end
require 'caze/version' require 'active_support' require 'active_support/concern' require 'active_support/core_ext/module/delegation' module Caze class NoTransactionMethodError < StandardError; end extend ActiveSupport::Concern module ClassMethods attr_accessor :transaction_handler def has_use_case(use_case_name, use_case_class, options = {}) transactional = options.fetch(:transactional) { false } define_singleton_method(use_case_name, Proc.new { |*args| if transactional handler = self.transaction_handler raise NoTransactionMethodError, "This action should be executed inside a transaction. But no transaction handler was configured." unless handler handler.transaction { use_case_class.send(use_case_name, *args) } else use_case_class.send('execute', *args) end }) end def export(method_name, options = {}) method_to_define = options.fetch(:as) { method_name } define_singleton_method(method_to_define, Proc.new { |*args| use_case_object = args.empty? ? new : new(*args) use_case_object.send(method_name) }) end end end
Send 'execute' instead of use_case_name
Send 'execute' instead of use_case_name
Ruby
apache-2.0
zeninpalm/caze
ruby
## Code Before: require 'caze/version' require 'active_support' require 'active_support/concern' require 'active_support/core_ext/module/delegation' module Caze class NoTransactionMethodError < StandardError; end extend ActiveSupport::Concern module ClassMethods attr_accessor :transaction_handler def has_use_case(use_case_name, use_case_class, options = {}) transactional = options.fetch(:transactional) { false } define_singleton_method(use_case_name, Proc.new { |*args| if transactional handler = self.transaction_handler raise NoTransactionMethodError, "This action should be executed inside a transaction. But no transaction handler was configured." unless handler handler.transaction { use_case_class.send(use_case_name, *args) } else use_case_class.send(use_case_name, *args) end }) end def export(method_name, options = {}) method_to_define = options.fetch(:as) { method_name } define_singleton_method(method_to_define, Proc.new { |*args| use_case_object = args.empty? ? new : new(*args) use_case_object.send(method_name) }) end end end ## Instruction: Send 'execute' instead of use_case_name ## Code After: require 'caze/version' require 'active_support' require 'active_support/concern' require 'active_support/core_ext/module/delegation' module Caze class NoTransactionMethodError < StandardError; end extend ActiveSupport::Concern module ClassMethods attr_accessor :transaction_handler def has_use_case(use_case_name, use_case_class, options = {}) transactional = options.fetch(:transactional) { false } define_singleton_method(use_case_name, Proc.new { |*args| if transactional handler = self.transaction_handler raise NoTransactionMethodError, "This action should be executed inside a transaction. But no transaction handler was configured." unless handler handler.transaction { use_case_class.send(use_case_name, *args) } else use_case_class.send('execute', *args) end }) end def export(method_name, options = {}) method_to_define = options.fetch(:as) { method_name } define_singleton_method(method_to_define, Proc.new { |*args| use_case_object = args.empty? ? new : new(*args) use_case_object.send(method_name) }) end end end
require 'caze/version' require 'active_support' require 'active_support/concern' require 'active_support/core_ext/module/delegation' module Caze class NoTransactionMethodError < StandardError; end extend ActiveSupport::Concern module ClassMethods attr_accessor :transaction_handler def has_use_case(use_case_name, use_case_class, options = {}) transactional = options.fetch(:transactional) { false } define_singleton_method(use_case_name, Proc.new { |*args| if transactional handler = self.transaction_handler raise NoTransactionMethodError, "This action should be executed inside a transaction. But no transaction handler was configured." unless handler handler.transaction { use_case_class.send(use_case_name, *args) } else - use_case_class.send(use_case_name, *args) ? ^ ^^^^^^^^^^ + use_case_class.send('execute', *args) ? +++++ ^ ^ end }) end def export(method_name, options = {}) method_to_define = options.fetch(:as) { method_name } define_singleton_method(method_to_define, Proc.new { |*args| use_case_object = args.empty? ? new : new(*args) use_case_object.send(method_name) }) end end end
2
0.052632
1
1
f8bc3b831e6aa8364ad8cd9a1da10e8fa853627e
docs/ISSUE_TEMPLATE.md
docs/ISSUE_TEMPLATE.md
TeamCity version: Azure plugin version: Problem description:
<!--Note: Please read the common problems first: https://github.com/JetBrains/teamcity-azure-plugin#common-problems --> TeamCity version: Azure plugin version: Problem description:
Add link on the common problems
Add link on the common problems
Markdown
apache-2.0
JetBrains/teamcity-azure-plugin,JetBrains/teamcity-azure-plugin,JetBrains/teamcity-azure-plugin
markdown
## Code Before: TeamCity version: Azure plugin version: Problem description: ## Instruction: Add link on the common problems ## Code After: <!--Note: Please read the common problems first: https://github.com/JetBrains/teamcity-azure-plugin#common-problems --> TeamCity version: Azure plugin version: Problem description:
+ <!--Note: Please read the common problems first: https://github.com/JetBrains/teamcity-azure-plugin#common-problems --> + TeamCity version: Azure plugin version: Problem description:
2
0.4
2
0
22aaf754eb04e9f345c55f73ffb0f549d83c68df
apps/explorer/tests/test_templatetags.py
apps/explorer/tests/test_templatetags.py
from django.test import TestCase from ..templatetags import explorer class HighlightTestCase(TestCase): def test_highlight_returns_text_when_empty_word(self): expected = 'foo bar baz' assert explorer.highlight('foo bar baz', '') == expected def test_highlight(self): expected = '<span class="highlight">foo</span> bar baz' assert explorer.highlight('foo bar baz', 'foo') == expected def test_highlight_matches_all_occurences(self): expected = ( '<span class="highlight">foo</span> bar baz' ' nope <span class="highlight">foo</span> bar baz' ) assert explorer.highlight( 'foo bar baz nope foo bar baz', 'foo' ) == expected def test_highlight_matches_part_of_words(self): expected = 'l<span class="highlight">ooo</span>oong word' assert explorer.highlight('looooong word', 'ooo') == expected
from django.test import TestCase from ..templatetags import explorer class HighlightTestCase(TestCase): def test_highlight_returns_text_when_empty_word(self): expected = 'foo bar baz' assert explorer.highlight('foo bar baz', '') == expected def test_highlight(self): expected = '<span class="highlight">foo</span> bar baz' assert explorer.highlight('foo bar baz', 'foo') == expected def test_highlight_matches_all_occurences(self): expected = ( '<span class="highlight">foo</span> bar baz' ' nope <span class="highlight">foo</span> bar baz' ) assert explorer.highlight( 'foo bar baz nope foo bar baz', 'foo' ) == expected def test_highlight_matches_part_of_words(self): expected = 'l<span class="highlight">ooo</span>oong word' assert explorer.highlight('looooong word', 'ooo') == expected class ConcatTestCase(TestCase): def test_concat(self): expected = 'foo-bar' assert explorer.concat('foo-', 'bar') == expected
Add test for concat template tag
Add test for concat template tag
Python
bsd-3-clause
Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel
python
## Code Before: from django.test import TestCase from ..templatetags import explorer class HighlightTestCase(TestCase): def test_highlight_returns_text_when_empty_word(self): expected = 'foo bar baz' assert explorer.highlight('foo bar baz', '') == expected def test_highlight(self): expected = '<span class="highlight">foo</span> bar baz' assert explorer.highlight('foo bar baz', 'foo') == expected def test_highlight_matches_all_occurences(self): expected = ( '<span class="highlight">foo</span> bar baz' ' nope <span class="highlight">foo</span> bar baz' ) assert explorer.highlight( 'foo bar baz nope foo bar baz', 'foo' ) == expected def test_highlight_matches_part_of_words(self): expected = 'l<span class="highlight">ooo</span>oong word' assert explorer.highlight('looooong word', 'ooo') == expected ## Instruction: Add test for concat template tag ## Code After: from django.test import TestCase from ..templatetags import explorer class HighlightTestCase(TestCase): def test_highlight_returns_text_when_empty_word(self): expected = 'foo bar baz' assert explorer.highlight('foo bar baz', '') == expected def test_highlight(self): expected = '<span class="highlight">foo</span> bar baz' assert explorer.highlight('foo bar baz', 'foo') == expected def test_highlight_matches_all_occurences(self): expected = ( '<span class="highlight">foo</span> bar baz' ' nope <span class="highlight">foo</span> bar baz' ) assert explorer.highlight( 'foo bar baz nope foo bar baz', 'foo' ) == expected def test_highlight_matches_part_of_words(self): expected = 'l<span class="highlight">ooo</span>oong word' assert explorer.highlight('looooong word', 'ooo') == expected class ConcatTestCase(TestCase): def test_concat(self): expected = 'foo-bar' assert explorer.concat('foo-', 'bar') == expected
from django.test import TestCase from ..templatetags import explorer class HighlightTestCase(TestCase): def test_highlight_returns_text_when_empty_word(self): expected = 'foo bar baz' assert explorer.highlight('foo bar baz', '') == expected def test_highlight(self): expected = '<span class="highlight">foo</span> bar baz' assert explorer.highlight('foo bar baz', 'foo') == expected def test_highlight_matches_all_occurences(self): expected = ( '<span class="highlight">foo</span> bar baz' ' nope <span class="highlight">foo</span> bar baz' ) assert explorer.highlight( 'foo bar baz nope foo bar baz', 'foo' ) == expected def test_highlight_matches_part_of_words(self): expected = 'l<span class="highlight">ooo</span>oong word' assert explorer.highlight('looooong word', 'ooo') == expected + + + class ConcatTestCase(TestCase): + + def test_concat(self): + + expected = 'foo-bar' + assert explorer.concat('foo-', 'bar') == expected
8
0.25
8
0
7a4cf74c5cad40878e283f8a2fd3bde45ead9faa
.vscode/tasks.json
.vscode/tasks.json
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "taskName": "Build", "type": "shell", "command": "g++", "args": [ "-g2", "-ggdb", /*"-Q", */"-O0", "./src/07-vector/main.cpp", "./src/assert.cpp" ], "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated" } } ] }
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "taskName": "Build", "type": "shell", "command": "g++", "args": [ "-g2", "-ggdb", //"-Q", "-O0", "./src/assert.cpp", // "./src/03-singly-linked-list/main.cpp", // "./src/04-doubly-linked-list/main.cpp", // "./src/05-circularly-linked-list/main.cpp", // "./src/06-array/main.cpp", // "./src/07-vector/main.cpp", "./src/08-stack/main.cpp" ], "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated" } } ] }
Split out shared g++ options;
Split out shared g++ options;
JSON
mit
MichaelZalla/data-structures-review,MichaelZalla/data-structures-review
json
## Code Before: { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "taskName": "Build", "type": "shell", "command": "g++", "args": [ "-g2", "-ggdb", /*"-Q", */"-O0", "./src/07-vector/main.cpp", "./src/assert.cpp" ], "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated" } } ] } ## Instruction: Split out shared g++ options; ## Code After: { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "taskName": "Build", "type": "shell", "command": "g++", "args": [ "-g2", "-ggdb", //"-Q", "-O0", "./src/assert.cpp", // "./src/03-singly-linked-list/main.cpp", // "./src/04-doubly-linked-list/main.cpp", // "./src/05-circularly-linked-list/main.cpp", // "./src/06-array/main.cpp", // "./src/07-vector/main.cpp", "./src/08-stack/main.cpp" ], "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated" } } ] }
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "taskName": "Build", "type": "shell", "command": "g++", "args": [ - "-g2", "-ggdb", /*"-Q", */"-O0", "./src/07-vector/main.cpp", "./src/assert.cpp" + "-g2", + "-ggdb", + //"-Q", + "-O0", + "./src/assert.cpp", + // "./src/03-singly-linked-list/main.cpp", + // "./src/04-doubly-linked-list/main.cpp", + // "./src/05-circularly-linked-list/main.cpp", + // "./src/06-array/main.cpp", + // "./src/07-vector/main.cpp", + "./src/08-stack/main.cpp" ], "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated" } } ] }
12
0.48
11
1
4ed3236e8729745f8a39afda6bd36a0a4c705779
src/index.html
src/index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Pomodoro</title> </head> <body> <h1 id="timer"></h1> <div id="control-bar"></div> <script data-main="js/main" src="js/vendor/require.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Pomodoro</title> </head> <body> <h1 id="timer"></h1> <div id="control-bar"> <button id="start-pomodoro-btn" class="control start-control" data-action="start" data-duration="1500000">Start</button> <button id="start-break-btn" class="control start-control" data-action="start" data-duration="300000">Break</button> <button id="start-lbreak-btn" class="control start-control" data-action="start" data-duration="900000">Long break</button> <button id="stop-btn" class="control stop-control" data-action="stop">Stop</button> </div> <script data-main="js/main" src="js/vendor/require.js"></script> </body> </html>
Create html structure for control bar
Create html structure for control bar
HTML
mit
thibault/pomodoro
html
## Code Before: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Pomodoro</title> </head> <body> <h1 id="timer"></h1> <div id="control-bar"></div> <script data-main="js/main" src="js/vendor/require.js"></script> </body> </html> ## Instruction: Create html structure for control bar ## Code After: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Pomodoro</title> </head> <body> <h1 id="timer"></h1> <div id="control-bar"> <button id="start-pomodoro-btn" class="control start-control" data-action="start" data-duration="1500000">Start</button> <button id="start-break-btn" class="control start-control" data-action="start" data-duration="300000">Break</button> <button id="start-lbreak-btn" class="control start-control" data-action="start" data-duration="900000">Long break</button> <button id="stop-btn" class="control stop-control" data-action="stop">Stop</button> </div> <script data-main="js/main" src="js/vendor/require.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Pomodoro</title> </head> <body> <h1 id="timer"></h1> - <div id="control-bar"></div> ? ------ + <div id="control-bar"> + <button + id="start-pomodoro-btn" + class="control start-control" + data-action="start" + data-duration="1500000">Start</button> + + <button + id="start-break-btn" + class="control start-control" + data-action="start" + data-duration="300000">Break</button> + + <button + id="start-lbreak-btn" + class="control start-control" + data-action="start" + data-duration="900000">Long break</button> + + <button + id="stop-btn" + class="control stop-control" + data-action="stop">Stop</button> + </div> <script data-main="js/main" src="js/vendor/require.js"></script> </body> </html>
25
2.083333
24
1
28c37ce51087c47c94a06520c6a5e089928ac401
.travis.yml
.travis.yml
sudo: false cache: bundler: true directories: - node_modules before_install: nvm install install: - bundle - npm install script: bundle exec ./test env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
sudo: false cache: bundler: true directories: - node_modules addons: apt: packages: - oracle-java8-set-default before_install: nvm install install: - bundle - npm install script: bundle exec ./test env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
Use Java 8 on Travis
Use Java 8 on Travis
YAML
mit
nicolasmccurdy/nicolasmccurdy.github.io,nicolasmccurdy/nicolasmccurdy.github.io
yaml
## Code Before: sudo: false cache: bundler: true directories: - node_modules before_install: nvm install install: - bundle - npm install script: bundle exec ./test env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer ## Instruction: Use Java 8 on Travis ## Code After: sudo: false cache: bundler: true directories: - node_modules addons: apt: packages: - oracle-java8-set-default before_install: nvm install install: - bundle - npm install script: bundle exec ./test env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
sudo: false cache: bundler: true directories: - node_modules + addons: + apt: + packages: + - oracle-java8-set-default before_install: nvm install install: - bundle - npm install script: bundle exec ./test env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
4
0.307692
4
0
db174e6999c322787d101d51ef0f415f13ce184a
examples/buddhabrot/CMakeLists.txt
examples/buddhabrot/CMakeLists.txt
if(QT4_FOUND AND QT4_USABLE) include(${QT_USE_FILE}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(buddhabrot_sse main.cpp) add_target_property(buddhabrot_sse COMPILE_FLAGS "-DVc_IMPL=SSE") target_link_libraries(buddhabrot_sse ${QT_LIBRARIES} Vc) add_executable(buddhabrot_scalar main.cpp) add_target_property(buddhabrot_scalar COMPILE_FLAGS "-DVc_IMPL=Scalar") target_link_libraries(buddhabrot_scalar ${QT_LIBRARIES} Vc) add_executable(buddhabrot_scalar2 main.cpp) add_target_property(buddhabrot_scalar2 COMPILE_FLAGS "-DScalar") target_link_libraries(buddhabrot_scalar2 ${QT_LIBRARIES}) endif()
if(QT4_FOUND AND QT4_USABLE) include(${QT_USE_FILE}) build_example(buddhabrot main.cpp LIBS ${QT_LIBRARIES}) # Special -DScalar target that uses fundamental types directly add_executable(example_buddhabrot_scalar2 main.cpp) add_target_property(example_buddhabrot_scalar2 COMPILE_DEFINITIONS "Scalar") set_property(TARGET example_buddhabrot_scalar2 APPEND PROPERTY COMPILE_OPTIONS ${Vc_ARCHITECTURE_FLAGS}) add_target_property(example_buddhabrot_scalar2 LABELS "Scalar") add_dependencies(Scalar example_buddhabrot_scalar2) add_dependencies(Examples example_buddhabrot_scalar2) target_link_libraries(example_buddhabrot_scalar2 Vc ${QT_LIBRARIES}) vc_add_run_target(example_buddhabrot_scalar2) endif()
Use build_example macro for buddhabrot
cmake: Use build_example macro for buddhabrot Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>
Text
bsd-3-clause
VcDevel/Vc,VcDevel/Vc,chr-engwer/Vc,chr-engwer/Vc,VcDevel/Vc,chr-engwer/Vc,VcDevel/Vc
text
## Code Before: if(QT4_FOUND AND QT4_USABLE) include(${QT_USE_FILE}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(buddhabrot_sse main.cpp) add_target_property(buddhabrot_sse COMPILE_FLAGS "-DVc_IMPL=SSE") target_link_libraries(buddhabrot_sse ${QT_LIBRARIES} Vc) add_executable(buddhabrot_scalar main.cpp) add_target_property(buddhabrot_scalar COMPILE_FLAGS "-DVc_IMPL=Scalar") target_link_libraries(buddhabrot_scalar ${QT_LIBRARIES} Vc) add_executable(buddhabrot_scalar2 main.cpp) add_target_property(buddhabrot_scalar2 COMPILE_FLAGS "-DScalar") target_link_libraries(buddhabrot_scalar2 ${QT_LIBRARIES}) endif() ## Instruction: cmake: Use build_example macro for buddhabrot Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org> ## Code After: if(QT4_FOUND AND QT4_USABLE) include(${QT_USE_FILE}) build_example(buddhabrot main.cpp LIBS ${QT_LIBRARIES}) # Special -DScalar target that uses fundamental types directly add_executable(example_buddhabrot_scalar2 main.cpp) add_target_property(example_buddhabrot_scalar2 COMPILE_DEFINITIONS "Scalar") set_property(TARGET example_buddhabrot_scalar2 APPEND PROPERTY COMPILE_OPTIONS ${Vc_ARCHITECTURE_FLAGS}) add_target_property(example_buddhabrot_scalar2 LABELS "Scalar") add_dependencies(Scalar example_buddhabrot_scalar2) add_dependencies(Examples example_buddhabrot_scalar2) target_link_libraries(example_buddhabrot_scalar2 Vc ${QT_LIBRARIES}) vc_add_run_target(example_buddhabrot_scalar2) endif()
if(QT4_FOUND AND QT4_USABLE) include(${QT_USE_FILE}) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) + build_example(buddhabrot main.cpp LIBS ${QT_LIBRARIES}) - add_executable(buddhabrot_sse main.cpp) - add_target_property(buddhabrot_sse COMPILE_FLAGS "-DVc_IMPL=SSE") - target_link_libraries(buddhabrot_sse ${QT_LIBRARIES} Vc) + # Special -DScalar target that uses fundamental types directly - add_executable(buddhabrot_scalar main.cpp) - add_target_property(buddhabrot_scalar COMPILE_FLAGS "-DVc_IMPL=Scalar") - target_link_libraries(buddhabrot_scalar ${QT_LIBRARIES} Vc) - - add_executable(buddhabrot_scalar2 main.cpp) + add_executable(example_buddhabrot_scalar2 main.cpp) ? ++++++++ - add_target_property(buddhabrot_scalar2 COMPILE_FLAGS "-DScalar") ? ^^^ -- + add_target_property(example_buddhabrot_scalar2 COMPILE_DEFINITIONS "Scalar") ? ++++++++ ++ ^^^^^^^ + set_property(TARGET example_buddhabrot_scalar2 APPEND PROPERTY COMPILE_OPTIONS ${Vc_ARCHITECTURE_FLAGS}) + add_target_property(example_buddhabrot_scalar2 LABELS "Scalar") + add_dependencies(Scalar example_buddhabrot_scalar2) + add_dependencies(Examples example_buddhabrot_scalar2) - target_link_libraries(buddhabrot_scalar2 ${QT_LIBRARIES}) + target_link_libraries(example_buddhabrot_scalar2 Vc ${QT_LIBRARIES}) ? ++++++++ +++ + vc_add_run_target(example_buddhabrot_scalar2) endif()
21
1.3125
10
11
7bf9895f4f53038eaa6908da82d4db024a838663
app/src/container/style/Tasks.scss
app/src/container/style/Tasks.scss
@import "../../style/colors.scss"; @mixin Tasks-sub-container { margin: 1em; } .Tasks-tasks { @include Tasks-sub-container; flex: 1; } .Tasks-sidebar { @include Tasks-sub-container; display: flex; flex-direction: column; justify-content: space-between; width: 50%; margin-left: 0; }
@import "../../style/colors.scss"; @mixin Tasks-sub-container { flex: 1; margin: 1em; } .Tasks-tasks { @include Tasks-sub-container; } .Tasks-sidebar { @include Tasks-sub-container; display: flex; flex-direction: column; justify-content: space-between; margin-left: 0; }
Use flex: 1 instead of width: 50%
Use flex: 1 instead of width: 50%
SCSS
mit
raviqqe/code2d,raviqqe/code2d,raviqqe/code2d,raviqqe/code2d
scss
## Code Before: @import "../../style/colors.scss"; @mixin Tasks-sub-container { margin: 1em; } .Tasks-tasks { @include Tasks-sub-container; flex: 1; } .Tasks-sidebar { @include Tasks-sub-container; display: flex; flex-direction: column; justify-content: space-between; width: 50%; margin-left: 0; } ## Instruction: Use flex: 1 instead of width: 50% ## Code After: @import "../../style/colors.scss"; @mixin Tasks-sub-container { flex: 1; margin: 1em; } .Tasks-tasks { @include Tasks-sub-container; } .Tasks-sidebar { @include Tasks-sub-container; display: flex; flex-direction: column; justify-content: space-between; margin-left: 0; }
@import "../../style/colors.scss"; @mixin Tasks-sub-container { + flex: 1; margin: 1em; } .Tasks-tasks { @include Tasks-sub-container; - - flex: 1; } .Tasks-sidebar { @include Tasks-sub-container; display: flex; flex-direction: column; justify-content: space-between; - width: 50%; margin-left: 0; }
4
0.190476
1
3
220c27fd4c708a41b1415d25a4db4a47ffa20261
README.md
README.md
[![Build status](https://api.travis-ci.org/SamWhited/ph.sh.svg?branch=master)](https://travis-ci.org/SamWhited/ph.sh) # ph.sh (photoshell) A GTK3 application for managing photos. ## Usage Before running `photoshell`, you will need to have a working Python 3.4 environment (including pip and virtualenv), and the dcraw utility installed. To run `photoshell`, just do `make run` from the project directory. The first time you launch `photoshell` it may take a few minutes to install dependencies.
[![Build status](https://api.travis-ci.org/photoshell/photoshell.svg?branch=master)](https://travis-ci.org/photoshell/photoshell) # ph.sh (photoshell) A GTK3 application for managing photos. ## Usage Before running `photoshell`, you will need to have a working Python 3.4 environment (including pip and virtualenv), and the dcraw utility installed. To run `photoshell`, just do `make run` from the project directory. The first time you launch `photoshell` it may take a few minutes to install dependencies.
Use org master branch for Travis status icon
Use org master branch for Travis status icon
Markdown
mit
SamWhited/photoshell,campaul/photoshell,photoshell/photoshell
markdown
## Code Before: [![Build status](https://api.travis-ci.org/SamWhited/ph.sh.svg?branch=master)](https://travis-ci.org/SamWhited/ph.sh) # ph.sh (photoshell) A GTK3 application for managing photos. ## Usage Before running `photoshell`, you will need to have a working Python 3.4 environment (including pip and virtualenv), and the dcraw utility installed. To run `photoshell`, just do `make run` from the project directory. The first time you launch `photoshell` it may take a few minutes to install dependencies. ## Instruction: Use org master branch for Travis status icon ## Code After: [![Build status](https://api.travis-ci.org/photoshell/photoshell.svg?branch=master)](https://travis-ci.org/photoshell/photoshell) # ph.sh (photoshell) A GTK3 application for managing photos. ## Usage Before running `photoshell`, you will need to have a working Python 3.4 environment (including pip and virtualenv), and the dcraw utility installed. To run `photoshell`, just do `make run` from the project directory. The first time you launch `photoshell` it may take a few minutes to install dependencies.
- [![Build status](https://api.travis-ci.org/SamWhited/ph.sh.svg?branch=master)](https://travis-ci.org/SamWhited/ph.sh) ? ^^^^ ^ ^ ^ ^^^^ ^ ^ ^ + [![Build status](https://api.travis-ci.org/photoshell/photoshell.svg?branch=master)](https://travis-ci.org/photoshell/photoshell) ? ^ ^ +++ ^^ ^^^ +++ ^ ^ +++ ^^ ^^^ +++ # ph.sh (photoshell) A GTK3 application for managing photos. ## Usage Before running `photoshell`, you will need to have a working Python 3.4 environment (including pip and virtualenv), and the dcraw utility installed. To run `photoshell`, just do `make run` from the project directory. The first time you launch `photoshell` it may take a few minutes to install dependencies.
2
0.166667
1
1
347b952b4f48182e6f85e3e97811a9635dde876d
test/streams/elasticsearchStream.js
test/streams/elasticsearchStream.js
var tape = require( 'tape' ); var elasticsearchStream = require( '../../lib/streams/elasticsearchStream' ); tape( 'importPipeline.createPeliasElasticsearchPipeline() interface', function ( test ){ test.plan( 1 ); var esPipeline = elasticsearchStream.create(); test.ok( esPipeline.writable, 'Stream is writable' ); } );
var tape = require( 'tape' ); var elasticsearchStream = require( '../../lib/streams/elasticsearchStream' ); tape( 'importPipeline.createPeliasElasticsearchPipeline() interface', function ( test ){ var esPipeline = elasticsearchStream.create(); test.ok( esPipeline.writable, 'Stream is writable' ); test.end(); } );
Use test.end() instead of test.plan()
Use test.end() instead of test.plan() Just more commonly used in our code
JavaScript
mit
pelias/openaddresses,pelias/openaddresses
javascript
## Code Before: var tape = require( 'tape' ); var elasticsearchStream = require( '../../lib/streams/elasticsearchStream' ); tape( 'importPipeline.createPeliasElasticsearchPipeline() interface', function ( test ){ test.plan( 1 ); var esPipeline = elasticsearchStream.create(); test.ok( esPipeline.writable, 'Stream is writable' ); } ); ## Instruction: Use test.end() instead of test.plan() Just more commonly used in our code ## Code After: var tape = require( 'tape' ); var elasticsearchStream = require( '../../lib/streams/elasticsearchStream' ); tape( 'importPipeline.createPeliasElasticsearchPipeline() interface', function ( test ){ var esPipeline = elasticsearchStream.create(); test.ok( esPipeline.writable, 'Stream is writable' ); test.end(); } );
var tape = require( 'tape' ); var elasticsearchStream = require( '../../lib/streams/elasticsearchStream' ); tape( 'importPipeline.createPeliasElasticsearchPipeline() interface', function ( test ){ - test.plan( 1 ); var esPipeline = elasticsearchStream.create(); test.ok( esPipeline.writable, 'Stream is writable' ); + test.end(); } );
2
0.166667
1
1
85cd78175683f00f00c403425e0c049aa3007d70
tests/compile-fail/run_expr_str_ref.rs
tests/compile-fail/run_expr_str_ref.rs
extern crate gluon; use gluon::{new_vm, Compiler}; fn main() { let vm = new_vm(); let _ = Compiler::new().run_expr::<&str>(&vm, "", r#" "test" "#); //~^ mismatched types [E0308] }
extern crate gluon; use gluon::{new_vm, Compiler}; fn main() { let vm = new_vm(); let _ = Compiler::new().run_expr::<&str>(&vm, "", r#" "test" "#); //~^ the trait bound `for<'value> &str: gluon::gluon_vm::api::Getable<'_, 'value>` is not satisfied [E0277] }
Fix compiletest after updating nightly
Fix compiletest after updating nightly
Rust
mit
gluon-lang/gluon,gluon-lang/gluon,Marwes/embed_lang,Marwes/embed_lang
rust
## Code Before: extern crate gluon; use gluon::{new_vm, Compiler}; fn main() { let vm = new_vm(); let _ = Compiler::new().run_expr::<&str>(&vm, "", r#" "test" "#); //~^ mismatched types [E0308] } ## Instruction: Fix compiletest after updating nightly ## Code After: extern crate gluon; use gluon::{new_vm, Compiler}; fn main() { let vm = new_vm(); let _ = Compiler::new().run_expr::<&str>(&vm, "", r#" "test" "#); //~^ the trait bound `for<'value> &str: gluon::gluon_vm::api::Getable<'_, 'value>` is not satisfied [E0277] }
extern crate gluon; use gluon::{new_vm, Compiler}; fn main() { let vm = new_vm(); let _ = Compiler::new().run_expr::<&str>(&vm, "", r#" "test" "#); - //~^ mismatched types [E0308] + //~^ the trait bound `for<'value> &str: gluon::gluon_vm::api::Getable<'_, 'value>` is not satisfied [E0277] }
2
0.2
1
1
a01e924ccd80a11b2f5c59828c5395b92d9fd5a7
scripts/load_firebase.py
scripts/load_firebase.py
import argparse import requests import time DEFAULT_DEVICE = 0 DEFAULT_FILE = '../data/ECG_data.csv' def main(device=0, filename=DEFAULT_FILE): print("Loading firebase for device #%d" % device) with open(filename) as f: index = 0 count = 0 timestamp = int(time.time() * 1000) for line in f: line = line.strip() ts, value = line.split(',', 1) count += float(value) index += 1 if index == 10: # Dump timestamp += 1 print("Sending %s: %s" % (str(timestamp), str(count / 10))) requests.put('https://ubervest.firebaseio.com/devices/0/hr/' + str(timestamp) + '.json', data=str(count / 10)) count = 0 index = 0 timestamp += 1 requests.put('https://ubervest.firebaseio.com/devices/0/hr/' + str(timestamp) + '.json', data=str(count / 10)) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Load sample data for a given device') parser.add_argument('--d', type=int, default=DEFAULT_DEVICE, help="The ID of the device to load with data.") parser.add_argument('--f', type=str, default=DEFAULT_FILE, help="The ID of the device to load with data.") args = parser.parse_args() main(device=args.d, filename=args.f)
import argparse import requests import time DEFAULT_DEVICE = 0 DEFAULT_FILE = '../data/ECG_data.csv' def main(device=0, filename=DEFAULT_FILE): print("Loading firebase for device #%d" % device) with open(filename) as f: index = 0 count = 0 timestamp = int(time.time() * 1000) for line in f: line = line.strip() ts, value = line.split(',', 1) count += float(value) index += 1 if index == 10: # Dump timestamp += 1 print("Sending %s: %s" % (str(timestamp), str(count / 10))) requests.put(('https://ubervest.firebaseio.com/devices/%d/hr/' % device) + str(timestamp) + '.json', data=str(count / 10)) count = 0 index = 0 timestamp += 1 requests.put(('https://ubervest.firebaseio.com/devices/%d/hr/' % device) + str(timestamp) + '.json', data=str(count / 10)) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Load sample data for a given device') parser.add_argument('--d', type=int, default=DEFAULT_DEVICE, help="The ID of the device to load with data.") parser.add_argument('--f', type=str, default=DEFAULT_FILE, help="The ID of the device to load with data.") args = parser.parse_args() main(device=args.d, filename=args.f)
Update ID of device in load script
Update ID of device in load script
Python
mit
easyCZ/SLIP-A-2015,easyCZ/SLIP-A-2015,easyCZ/SLIP-A-2015,easyCZ/SLIP-A-2015,easyCZ/SLIP-A-2015,easyCZ/SLIP-A-2015
python
## Code Before: import argparse import requests import time DEFAULT_DEVICE = 0 DEFAULT_FILE = '../data/ECG_data.csv' def main(device=0, filename=DEFAULT_FILE): print("Loading firebase for device #%d" % device) with open(filename) as f: index = 0 count = 0 timestamp = int(time.time() * 1000) for line in f: line = line.strip() ts, value = line.split(',', 1) count += float(value) index += 1 if index == 10: # Dump timestamp += 1 print("Sending %s: %s" % (str(timestamp), str(count / 10))) requests.put('https://ubervest.firebaseio.com/devices/0/hr/' + str(timestamp) + '.json', data=str(count / 10)) count = 0 index = 0 timestamp += 1 requests.put('https://ubervest.firebaseio.com/devices/0/hr/' + str(timestamp) + '.json', data=str(count / 10)) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Load sample data for a given device') parser.add_argument('--d', type=int, default=DEFAULT_DEVICE, help="The ID of the device to load with data.") parser.add_argument('--f', type=str, default=DEFAULT_FILE, help="The ID of the device to load with data.") args = parser.parse_args() main(device=args.d, filename=args.f) ## Instruction: Update ID of device in load script ## Code After: import argparse import requests import time DEFAULT_DEVICE = 0 DEFAULT_FILE = '../data/ECG_data.csv' def main(device=0, filename=DEFAULT_FILE): print("Loading firebase for device #%d" % device) with open(filename) as f: index = 0 count = 0 timestamp = int(time.time() * 1000) for line in f: line = line.strip() ts, value = line.split(',', 1) count += float(value) index += 1 if index == 10: # Dump timestamp += 1 print("Sending %s: %s" % (str(timestamp), str(count / 10))) requests.put(('https://ubervest.firebaseio.com/devices/%d/hr/' % device) + str(timestamp) + '.json', data=str(count / 10)) count = 0 index = 0 timestamp += 1 requests.put(('https://ubervest.firebaseio.com/devices/%d/hr/' % device) + str(timestamp) + '.json', data=str(count / 10)) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Load sample data for a given device') parser.add_argument('--d', type=int, default=DEFAULT_DEVICE, help="The ID of the device to load with data.") parser.add_argument('--f', type=str, default=DEFAULT_FILE, help="The ID of the device to load with data.") args = parser.parse_args() main(device=args.d, filename=args.f)
import argparse import requests import time DEFAULT_DEVICE = 0 DEFAULT_FILE = '../data/ECG_data.csv' def main(device=0, filename=DEFAULT_FILE): print("Loading firebase for device #%d" % device) with open(filename) as f: index = 0 count = 0 timestamp = int(time.time() * 1000) for line in f: line = line.strip() ts, value = line.split(',', 1) count += float(value) index += 1 if index == 10: # Dump timestamp += 1 print("Sending %s: %s" % (str(timestamp), str(count / 10))) - requests.put('https://ubervest.firebaseio.com/devices/0/hr/' + str(timestamp) + '.json', data=str(count / 10)) ? ^ + requests.put(('https://ubervest.firebaseio.com/devices/%d/hr/' % device) + str(timestamp) + '.json', data=str(count / 10)) ? + ^^ ++++++++++ count = 0 index = 0 timestamp += 1 - requests.put('https://ubervest.firebaseio.com/devices/0/hr/' + str(timestamp) + '.json', data=str(count / 10)) ? ^ + requests.put(('https://ubervest.firebaseio.com/devices/%d/hr/' % device) + str(timestamp) + '.json', data=str(count / 10)) ? + ^^ ++++++++++ if __name__ == "__main__": parser = argparse.ArgumentParser(description='Load sample data for a given device') parser.add_argument('--d', type=int, default=DEFAULT_DEVICE, help="The ID of the device to load with data.") parser.add_argument('--f', type=str, default=DEFAULT_FILE, help="The ID of the device to load with data.") args = parser.parse_args() main(device=args.d, filename=args.f)
4
0.095238
2
2
9b8854ef45ef4dd36f146b756600ab127d5bb2b7
.travis.yml
.travis.yml
language: objective-c osx_image: xcode8.1 sudo: false notifications: email: false before_install: - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - git clone https://github.com/phacility/arcanist.git - git clone https://github.com/phacility/libphutil.git - git clone --recursive https://github.com/material-foundation/material-arc-tools.git - pod install --repo-update script: - set -o pipefail - arcanist/bin/arc unit --everything --trace - xcodebuild build -workspace MaterialMotionStreams.xcworkspace -scheme Catalog -sdk "iphonesimulator10.1" -destination "name=iPhone 6s,OS=10.1" ONLY_ACTIVE_ARCH=YES | xcpretty -c; after_success: - bash <(curl -s https://codecov.io/bash)
language: objective-c osx_image: xcode8.1 sudo: false before_install: - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - git clone https://github.com/phacility/arcanist.git - git clone https://github.com/phacility/libphutil.git - git clone --recursive https://github.com/material-foundation/material-arc-tools.git - pod install --repo-update script: - set -o pipefail - arcanist/bin/arc unit --everything --trace - xcodebuild build -workspace MaterialMotionStreams.xcworkspace -scheme Catalog -sdk "iphonesimulator10.1" -destination "name=iPhone 6s,OS=10.1" ONLY_ACTIVE_ARCH=YES | xcpretty -c; after_success: - bash <(curl -s https://codecov.io/bash)
Send emails on build failure.
Send emails on build failure.
YAML
apache-2.0
material-motion/material-motion-swift,material-motion/material-motion-swift
yaml
## Code Before: language: objective-c osx_image: xcode8.1 sudo: false notifications: email: false before_install: - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - git clone https://github.com/phacility/arcanist.git - git clone https://github.com/phacility/libphutil.git - git clone --recursive https://github.com/material-foundation/material-arc-tools.git - pod install --repo-update script: - set -o pipefail - arcanist/bin/arc unit --everything --trace - xcodebuild build -workspace MaterialMotionStreams.xcworkspace -scheme Catalog -sdk "iphonesimulator10.1" -destination "name=iPhone 6s,OS=10.1" ONLY_ACTIVE_ARCH=YES | xcpretty -c; after_success: - bash <(curl -s https://codecov.io/bash) ## Instruction: Send emails on build failure. ## Code After: language: objective-c osx_image: xcode8.1 sudo: false before_install: - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - git clone https://github.com/phacility/arcanist.git - git clone https://github.com/phacility/libphutil.git - git clone --recursive https://github.com/material-foundation/material-arc-tools.git - pod install --repo-update script: - set -o pipefail - arcanist/bin/arc unit --everything --trace - xcodebuild build -workspace MaterialMotionStreams.xcworkspace -scheme Catalog -sdk "iphonesimulator10.1" -destination "name=iPhone 6s,OS=10.1" ONLY_ACTIVE_ARCH=YES | xcpretty -c; after_success: - bash <(curl -s https://codecov.io/bash)
language: objective-c osx_image: xcode8.1 sudo: false - notifications: - email: false before_install: - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - git clone https://github.com/phacility/arcanist.git - git clone https://github.com/phacility/libphutil.git - git clone --recursive https://github.com/material-foundation/material-arc-tools.git - pod install --repo-update script: - set -o pipefail - arcanist/bin/arc unit --everything --trace - xcodebuild build -workspace MaterialMotionStreams.xcworkspace -scheme Catalog -sdk "iphonesimulator10.1" -destination "name=iPhone 6s,OS=10.1" ONLY_ACTIVE_ARCH=YES | xcpretty -c; after_success: - bash <(curl -s https://codecov.io/bash)
2
0.117647
0
2
cd54f3e1b9a12e40949ec43e7cc0a1da69cc11bd
index.html.erb
index.html.erb
<!DOCTYPE html> <html> <head> <title>Opal Browser - RSpec Runner</title> <script> window.onerror = function(msg, url, line) { var error = document.createElement("div"); error.setAttribute("id", "rspec-error"); error.appendChild(document.createTextNode(msg)); document.body.appendChild(error); } </script> <script src="spec/json2.js"></script> <script src="spec/sizzle.js"></script> <script src="spec/wgxpath.install.js"></script> <%= javascript_include_tag @server.main %> </head> <body> </body> </html>
<!DOCTYPE html> <html> <head> <title>Opal Browser - RSpec Runner</title> </head> <body> <script> window.onerror = function(msg, url, line) { var error = document.createElement("div"); error.setAttribute("id", "rspec-error"); error.appendChild(document.createTextNode(msg)); document.body.appendChild(error); } </script> <script src="spec/json2.js"></script> <script src="spec/sizzle.js"></script> <script src="spec/wgxpath.install.js"></script> <%= javascript_include_tag @server.main %> </body> </html>
Fix error reporting for the runner if body isn't defined
Fix error reporting for the runner if body isn't defined
HTML+ERB
mit
opal/opal-browser,opal/opal-browser,opal/opal-browser,opal/opal-browser
html+erb
## Code Before: <!DOCTYPE html> <html> <head> <title>Opal Browser - RSpec Runner</title> <script> window.onerror = function(msg, url, line) { var error = document.createElement("div"); error.setAttribute("id", "rspec-error"); error.appendChild(document.createTextNode(msg)); document.body.appendChild(error); } </script> <script src="spec/json2.js"></script> <script src="spec/sizzle.js"></script> <script src="spec/wgxpath.install.js"></script> <%= javascript_include_tag @server.main %> </head> <body> </body> </html> ## Instruction: Fix error reporting for the runner if body isn't defined ## Code After: <!DOCTYPE html> <html> <head> <title>Opal Browser - RSpec Runner</title> </head> <body> <script> window.onerror = function(msg, url, line) { var error = document.createElement("div"); error.setAttribute("id", "rspec-error"); error.appendChild(document.createTextNode(msg)); document.body.appendChild(error); } </script> <script src="spec/json2.js"></script> <script src="spec/sizzle.js"></script> <script src="spec/wgxpath.install.js"></script> <%= javascript_include_tag @server.main %> </body> </html>
<!DOCTYPE html> <html> <head> <title>Opal Browser - RSpec Runner</title> - + </head> + <body> <script> window.onerror = function(msg, url, line) { var error = document.createElement("div"); error.setAttribute("id", "rspec-error"); error.appendChild(document.createTextNode(msg)); document.body.appendChild(error); } </script> <script src="spec/json2.js"></script> <script src="spec/sizzle.js"></script> <script src="spec/wgxpath.install.js"></script> <%= javascript_include_tag @server.main %> - </head> - <body> </body> </html>
5
0.2
2
3
94b5c370ef9120257a095d0470c5e221a5170db1
app/views/courses/_row.html.haml
app/views/courses/_row.html.haml
%tr{:class => "#{user ? date_highlight_class(course) : ''}", "data-link" => "#{course_slug_path(course.slug)}"} %td.title{:role => "button", :tabindex => "0"} = course.title %span.creation-date.hidden = course.created_at %td.revisions = course.recent_revision_count %td %span.characters-human = number_to_human course.word_count %span.characters.hidden = course.word_count %small.average-words-human (#{t("metrics.per_user", number: number_to_human(course.average_word_count))}) %span.average-words.hidden = course.average_word_count %td %span.views-human = number_to_human course.view_sum %span.views.hidden = course.view_sum %td %span.students = course.user_count - unless Features.disable_training? %small.untrained= t("users.training_complete_count", count: course.trained_count) - if @presenter&.can_remove_course? %td = form_for(@campaign, url: remove_course_campaign_path(@campaign.slug, course_id: course.id), method: :put, html: { class: 'remove-program-form' }) do = hidden_field_tag('course_title', course.title) %button.button.danger.remove-course{'data-id' => course.id, 'data-title' => course.title, 'data-campaign-title' => @campaign.title} = t('assignments.remove')
%tr{:class => "#{user ? date_highlight_class(course) : ''}", "data-link" => "#{course_slug_path(course.slug)}"} %td.title{:role => "button", :tabindex => "0"} = course.title %span.creation-date.hidden = course.created_at %td.revisions = course.recent_revision_count %td %span.characters-human = number_to_human course.word_count %span.characters.hidden = course.word_count %small.average-words-human (#{t("metrics.per_user", number: number_to_human(course.average_word_count))}) %span.average-words.hidden = course.average_word_count %td %span.views-human = number_to_human course.view_sum %span.views.hidden = course.view_sum %td %span.students = course.user_count - unless Features.disable_training? %small.untrained= t("users.training_complete_count", count: course.trained_count)
Remove unnecessary code in courses/_row partial
Remove unnecessary code in courses/_row partial Since we forked this code, this is not needed in here. It's present in the new forked version campaigns/_course_row.
Haml
mit
KarmaHater/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,sejalkhatri/WikiEduDashboard,sejalkhatri/WikiEduDashboard,alpha721/WikiEduDashboard,alpha721/WikiEduDashboard,KarmaHater/WikiEduDashboard,majakomel/WikiEduDashboard,majakomel/WikiEduDashboard,majakomel/WikiEduDashboard,majakomel/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,sejalkhatri/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,alpha721/WikiEduDashboard,sejalkhatri/WikiEduDashboard,KarmaHater/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,KarmaHater/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,alpha721/WikiEduDashboard,sejalkhatri/WikiEduDashboard
haml
## Code Before: %tr{:class => "#{user ? date_highlight_class(course) : ''}", "data-link" => "#{course_slug_path(course.slug)}"} %td.title{:role => "button", :tabindex => "0"} = course.title %span.creation-date.hidden = course.created_at %td.revisions = course.recent_revision_count %td %span.characters-human = number_to_human course.word_count %span.characters.hidden = course.word_count %small.average-words-human (#{t("metrics.per_user", number: number_to_human(course.average_word_count))}) %span.average-words.hidden = course.average_word_count %td %span.views-human = number_to_human course.view_sum %span.views.hidden = course.view_sum %td %span.students = course.user_count - unless Features.disable_training? %small.untrained= t("users.training_complete_count", count: course.trained_count) - if @presenter&.can_remove_course? %td = form_for(@campaign, url: remove_course_campaign_path(@campaign.slug, course_id: course.id), method: :put, html: { class: 'remove-program-form' }) do = hidden_field_tag('course_title', course.title) %button.button.danger.remove-course{'data-id' => course.id, 'data-title' => course.title, 'data-campaign-title' => @campaign.title} = t('assignments.remove') ## Instruction: Remove unnecessary code in courses/_row partial Since we forked this code, this is not needed in here. It's present in the new forked version campaigns/_course_row. ## Code After: %tr{:class => "#{user ? date_highlight_class(course) : ''}", "data-link" => "#{course_slug_path(course.slug)}"} %td.title{:role => "button", :tabindex => "0"} = course.title %span.creation-date.hidden = course.created_at %td.revisions = course.recent_revision_count %td %span.characters-human = number_to_human course.word_count %span.characters.hidden = course.word_count %small.average-words-human (#{t("metrics.per_user", number: number_to_human(course.average_word_count))}) %span.average-words.hidden = course.average_word_count %td %span.views-human = number_to_human course.view_sum %span.views.hidden = course.view_sum %td %span.students = course.user_count - unless Features.disable_training? %small.untrained= t("users.training_complete_count", count: course.trained_count)
%tr{:class => "#{user ? date_highlight_class(course) : ''}", "data-link" => "#{course_slug_path(course.slug)}"} %td.title{:role => "button", :tabindex => "0"} = course.title %span.creation-date.hidden = course.created_at %td.revisions = course.recent_revision_count %td %span.characters-human = number_to_human course.word_count %span.characters.hidden = course.word_count %small.average-words-human (#{t("metrics.per_user", number: number_to_human(course.average_word_count))}) %span.average-words.hidden = course.average_word_count %td %span.views-human = number_to_human course.view_sum %span.views.hidden = course.view_sum %td %span.students = course.user_count - unless Features.disable_training? %small.untrained= t("users.training_complete_count", count: course.trained_count) - - if @presenter&.can_remove_course? - %td - = form_for(@campaign, url: remove_course_campaign_path(@campaign.slug, course_id: course.id), method: :put, html: { class: 'remove-program-form' }) do - = hidden_field_tag('course_title', course.title) - %button.button.danger.remove-course{'data-id' => course.id, 'data-title' => course.title, 'data-campaign-title' => @campaign.title} - = t('assignments.remove')
6
0.1875
0
6
de6e7710e1ba4d45eeb16bb7ca0fcbf3a251517e
app/src/main/java/com/sampsonjoliver/firestarter/FirebaseActivity.kt
app/src/main/java/com/sampsonjoliver/firestarter/FirebaseActivity.kt
package com.sampsonjoliver.firestarter import android.content.Intent import android.os.Build import android.os.Bundle import android.support.v7.app.AppCompatActivity import com.sampsonjoliver.firestarter.service.SessionManager import com.sampsonjoliver.firestarter.views.login.LoginActivity abstract class FirebaseActivity : AppCompatActivity(), SessionManager.SessionAuthListener { override fun onLogin() { } override fun onLogout() { applicationContext.startActivity(Intent(this, LoginActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) }) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) SessionManager.startSession(this, this) } override fun onStop() { super.onStop() SessionManager.stopSession() } }
package com.sampsonjoliver.firestarter import android.content.Intent import android.os.Build import android.support.v7.app.AppCompatActivity import com.sampsonjoliver.firestarter.service.SessionManager import com.sampsonjoliver.firestarter.views.login.LoginActivity abstract class FirebaseActivity : AppCompatActivity(), SessionManager.SessionAuthListener { override fun onLogin() { } override fun onLogout() { applicationContext.startActivity(Intent(this, LoginActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) }) } override fun onResume() { super.onResume() SessionManager.startSession(this, this) } override fun onPause() { super.onPause() SessionManager.stopSession() } }
Change to Firebase session lifecycle calls
Change to Firebase session lifecycle calls
Kotlin
apache-2.0
sampsonjoliver/Firestarter,sampsonjoliver/Firestarter
kotlin
## Code Before: package com.sampsonjoliver.firestarter import android.content.Intent import android.os.Build import android.os.Bundle import android.support.v7.app.AppCompatActivity import com.sampsonjoliver.firestarter.service.SessionManager import com.sampsonjoliver.firestarter.views.login.LoginActivity abstract class FirebaseActivity : AppCompatActivity(), SessionManager.SessionAuthListener { override fun onLogin() { } override fun onLogout() { applicationContext.startActivity(Intent(this, LoginActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) }) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) SessionManager.startSession(this, this) } override fun onStop() { super.onStop() SessionManager.stopSession() } } ## Instruction: Change to Firebase session lifecycle calls ## Code After: package com.sampsonjoliver.firestarter import android.content.Intent import android.os.Build import android.support.v7.app.AppCompatActivity import com.sampsonjoliver.firestarter.service.SessionManager import com.sampsonjoliver.firestarter.views.login.LoginActivity abstract class FirebaseActivity : AppCompatActivity(), SessionManager.SessionAuthListener { override fun onLogin() { } override fun onLogout() { applicationContext.startActivity(Intent(this, LoginActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) }) } override fun onResume() { super.onResume() SessionManager.startSession(this, this) } override fun onPause() { super.onPause() SessionManager.stopSession() } }
package com.sampsonjoliver.firestarter import android.content.Intent import android.os.Build - import android.os.Bundle import android.support.v7.app.AppCompatActivity import com.sampsonjoliver.firestarter.service.SessionManager import com.sampsonjoliver.firestarter.views.login.LoginActivity abstract class FirebaseActivity : AppCompatActivity(), SessionManager.SessionAuthListener { override fun onLogin() { } override fun onLogout() { applicationContext.startActivity(Intent(this, LoginActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) }) } + override fun onResume() { + super.onResume() - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - SessionManager.startSession(this, this) } - override fun onStop() { ? ^^^^ + override fun onPause() { ? ^^^^^ - super.onStop() ? ^^^^ + super.onPause() ? ^^^^^ SessionManager.stopSession() } }
10
0.285714
4
6
468801e4ebfe636095d637e3290dcfa74383f9f6
packages/apputils/src/index.ts
packages/apputils/src/index.ts
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import '../style/index.css'; export * from './clientsession'; export * from './clipboard'; export * from './collapse'; export * from './commandlinker'; export * from './commandpalette'; export * from './dialog'; export * from './domutils'; export * from './hoverbox'; export * from './iframe'; export * from './inputdialog'; export * from './instancetracker'; export * from './mainareawidget'; export * from './printing'; export * from './sanitizer'; export * from './spinner'; export * from './splash'; export * from './styling'; export * from './thememanager'; export * from './toolbar'; export * from './vdom'; export * from './windowresolver';
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import '../style/index.css'; export * from './clientsession'; export * from './clipboard'; export * from './collapse'; export * from './commandlinker'; export * from './commandpalette'; export * from './dialog'; export * from './domutils'; export * from './hoverbox'; export * from './iframe'; export * from './inputdialog'; export * from './instancetracker'; export * from './mainareawidget'; export * from './printing'; export * from './sanitizer'; export * from './spinner'; export * from './splash'; export * from './styling'; export * from './thememanager'; export * from './tokens'; export * from './toolbar'; export * from './vdom'; export * from './windowresolver';
Fix missing export of IThemeManager token
Fix missing export of IThemeManager token
TypeScript
bsd-3-clause
jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab
typescript
## Code Before: // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import '../style/index.css'; export * from './clientsession'; export * from './clipboard'; export * from './collapse'; export * from './commandlinker'; export * from './commandpalette'; export * from './dialog'; export * from './domutils'; export * from './hoverbox'; export * from './iframe'; export * from './inputdialog'; export * from './instancetracker'; export * from './mainareawidget'; export * from './printing'; export * from './sanitizer'; export * from './spinner'; export * from './splash'; export * from './styling'; export * from './thememanager'; export * from './toolbar'; export * from './vdom'; export * from './windowresolver'; ## Instruction: Fix missing export of IThemeManager token ## Code After: // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import '../style/index.css'; export * from './clientsession'; export * from './clipboard'; export * from './collapse'; export * from './commandlinker'; export * from './commandpalette'; export * from './dialog'; export * from './domutils'; export * from './hoverbox'; export * from './iframe'; export * from './inputdialog'; export * from './instancetracker'; export * from './mainareawidget'; export * from './printing'; export * from './sanitizer'; export * from './spinner'; export * from './splash'; export * from './styling'; export * from './thememanager'; export * from './tokens'; export * from './toolbar'; export * from './vdom'; export * from './windowresolver';
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import '../style/index.css'; export * from './clientsession'; export * from './clipboard'; export * from './collapse'; export * from './commandlinker'; export * from './commandpalette'; export * from './dialog'; export * from './domutils'; export * from './hoverbox'; export * from './iframe'; export * from './inputdialog'; export * from './instancetracker'; export * from './mainareawidget'; export * from './printing'; export * from './sanitizer'; export * from './spinner'; export * from './splash'; export * from './styling'; export * from './thememanager'; + export * from './tokens'; export * from './toolbar'; export * from './vdom'; export * from './windowresolver';
1
0.038462
1
0
f3b877cba4ab0ffdfc553f65547305698ef16391
src/BLEDeviceLimits.h
src/BLEDeviceLimits.h
// Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
// Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(NRF52) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
Fix length issues with nRF52
Fix length issues with nRF52
C
mit
sandeepmistry/arduino-BLEPeripheral,sandeepmistry/arduino-BLEPeripheral,sandeepmistry/arduino-BLEPeripheral
c
## Code Before: // Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif ## Instruction: Fix length issues with nRF52 ## Code After: // Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(NRF52) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
// Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif - #if defined(NRF51) || defined(__RFduino__) + #if defined(NRF51) || defined(NRF52) || defined(__RFduino__) ? ++++++++++++++++++ #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
2
0.051282
1
1
e448f12a79588e15f269f1e47fb732932514afad
src/Doctrine/Orm/Util/QueryNameGeneratorInterface.php
src/Doctrine/Orm/Util/QueryNameGeneratorInterface.php
<?php /* * This file is part of the API Platform project. * * (c) Kévin Dunglas <dunglas@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace ApiPlatform\Doctrine\Orm\Util; /** * @author Amrouche Hamza <hamza.simperfit@gmail.com> */ interface QueryNameGeneratorInterface { /** * Generates a cacheable alias for DQL join. */ public function generateJoinAlias(string $association): string; /** * Generates a cacheable parameter name for DQL query. */ public function generateParameterName(string $name): string; }
<?php /* * This file is part of the API Platform project. * * (c) Kévin Dunglas <dunglas@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace ApiPlatform\Doctrine\Orm\Util; /** * @author Amrouche Hamza <hamza.simperfit@gmail.com> */ interface QueryNameGeneratorInterface { /** * Generates a cacheable alias for DQL join. * * @return literal-string */ public function generateJoinAlias(string $association): string; /** * Generates a cacheable parameter name for DQL query. * * @return literal-string */ public function generateParameterName(string $name): string; }
Add missing return typehints to QueryNameGenerator
Add missing return typehints to QueryNameGenerator This will help to reduce static analysis warnings for consumers in apps baseline
PHP
mit
soyuka/core,soyuka/core,soyuka/core,api-platform/core,api-platform/core,soyuka/core,api-platform/core,api-platform/core
php
## Code Before: <?php /* * This file is part of the API Platform project. * * (c) Kévin Dunglas <dunglas@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace ApiPlatform\Doctrine\Orm\Util; /** * @author Amrouche Hamza <hamza.simperfit@gmail.com> */ interface QueryNameGeneratorInterface { /** * Generates a cacheable alias for DQL join. */ public function generateJoinAlias(string $association): string; /** * Generates a cacheable parameter name for DQL query. */ public function generateParameterName(string $name): string; } ## Instruction: Add missing return typehints to QueryNameGenerator This will help to reduce static analysis warnings for consumers in apps baseline ## Code After: <?php /* * This file is part of the API Platform project. * * (c) Kévin Dunglas <dunglas@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace ApiPlatform\Doctrine\Orm\Util; /** * @author Amrouche Hamza <hamza.simperfit@gmail.com> */ interface QueryNameGeneratorInterface { /** * Generates a cacheable alias for DQL join. * * @return literal-string */ public function generateJoinAlias(string $association): string; /** * Generates a cacheable parameter name for DQL query. * * @return literal-string */ public function generateParameterName(string $name): string; }
<?php /* * This file is part of the API Platform project. * * (c) Kévin Dunglas <dunglas@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace ApiPlatform\Doctrine\Orm\Util; /** * @author Amrouche Hamza <hamza.simperfit@gmail.com> */ interface QueryNameGeneratorInterface { /** * Generates a cacheable alias for DQL join. + * + * @return literal-string */ public function generateJoinAlias(string $association): string; /** * Generates a cacheable parameter name for DQL query. + * + * @return literal-string */ public function generateParameterName(string $name): string; }
4
0.133333
4
0
8dfed5b30e43901ec6ca306ed54f4f95af7770e2
src/main/java/io/sigpipe/sing/query/MetaQuery.java
src/main/java/io/sigpipe/sing/query/MetaQuery.java
package io.sigpipe.sing.query; import java.io.IOException; import java.util.List; import java.util.Set; import io.sigpipe.sing.dataset.feature.FeatureType; import io.sigpipe.sing.graph.DataContainer; import io.sigpipe.sing.graph.Vertex; public class MetaQuery extends Query { private DataContainer aggregateData = new DataContainer(); public MetaQuery() { } public DataContainer result() { return aggregateData; } @Override public void execute(Vertex root) throws IOException, QueryException { this.query(root); } private void query(Vertex vertex) throws IOException, QueryException { DataContainer container = vertex.getData(); if (container != null) { this.aggregateData.merge(container); } if (vertex.numNeighbors() == 0) { /* This is a leaf node */ return; } String childFeature = vertex.getFirstNeighbor().getLabel().getName(); List<Expression> expList = this.expressions.get(childFeature); if (expList != null) { Set<Vertex> matches = evaluate(vertex, expList); for (Vertex match : matches) { if (match == null) { continue; } if (match.getLabel().getType() == FeatureType.NULL) { continue; } query(match); } } else { /* No expression operates on this vertex. Consider all children. */ for (Vertex neighbor : vertex.getAllNeighbors()) { query(neighbor); } } } }
package io.sigpipe.sing.query; import java.util.List; import java.util.Set; import io.sigpipe.sing.dataset.feature.FeatureType; import io.sigpipe.sing.graph.DataContainer; import io.sigpipe.sing.graph.Vertex; public class MetaQuery extends Query { private DataContainer aggregateData = new DataContainer(); public MetaQuery() { } public DataContainer result() { return aggregateData; } @Override public void execute(Vertex root) throws QueryException { this.query(root); } private void query(Vertex vertex) throws QueryException { DataContainer container = vertex.getData(); if (container != null) { this.aggregateData.merge(container); } if (vertex.numNeighbors() == 0) { /* This is a leaf node */ return; } String childFeature = vertex.getFirstNeighbor().getLabel().getName(); List<Expression> expList = this.expressions.get(childFeature); if (expList != null) { Set<Vertex> matches = evaluate(vertex, expList); for (Vertex match : matches) { if (match == null) { continue; } if (match.getLabel().getType() == FeatureType.NULL) { continue; } query(match); } } else { /* No expression operates on this vertex. Consider all children. */ for (Vertex neighbor : vertex.getAllNeighbors()) { query(neighbor); } } } }
Remove IOException from execute() and query()
Remove IOException from execute() and query()
Java
bsd-2-clause
malensek/sing
java
## Code Before: package io.sigpipe.sing.query; import java.io.IOException; import java.util.List; import java.util.Set; import io.sigpipe.sing.dataset.feature.FeatureType; import io.sigpipe.sing.graph.DataContainer; import io.sigpipe.sing.graph.Vertex; public class MetaQuery extends Query { private DataContainer aggregateData = new DataContainer(); public MetaQuery() { } public DataContainer result() { return aggregateData; } @Override public void execute(Vertex root) throws IOException, QueryException { this.query(root); } private void query(Vertex vertex) throws IOException, QueryException { DataContainer container = vertex.getData(); if (container != null) { this.aggregateData.merge(container); } if (vertex.numNeighbors() == 0) { /* This is a leaf node */ return; } String childFeature = vertex.getFirstNeighbor().getLabel().getName(); List<Expression> expList = this.expressions.get(childFeature); if (expList != null) { Set<Vertex> matches = evaluate(vertex, expList); for (Vertex match : matches) { if (match == null) { continue; } if (match.getLabel().getType() == FeatureType.NULL) { continue; } query(match); } } else { /* No expression operates on this vertex. Consider all children. */ for (Vertex neighbor : vertex.getAllNeighbors()) { query(neighbor); } } } } ## Instruction: Remove IOException from execute() and query() ## Code After: package io.sigpipe.sing.query; import java.util.List; import java.util.Set; import io.sigpipe.sing.dataset.feature.FeatureType; import io.sigpipe.sing.graph.DataContainer; import io.sigpipe.sing.graph.Vertex; public class MetaQuery extends Query { private DataContainer aggregateData = new DataContainer(); public MetaQuery() { } public DataContainer result() { return aggregateData; } @Override public void execute(Vertex root) throws QueryException { this.query(root); } private void query(Vertex vertex) throws QueryException { DataContainer container = vertex.getData(); if (container != null) { this.aggregateData.merge(container); } if (vertex.numNeighbors() == 0) { /* This is a leaf node */ return; } String childFeature = vertex.getFirstNeighbor().getLabel().getName(); List<Expression> expList = this.expressions.get(childFeature); if (expList != null) { Set<Vertex> matches = evaluate(vertex, expList); for (Vertex match : matches) { if (match == null) { continue; } if (match.getLabel().getType() == FeatureType.NULL) { continue; } query(match); } } else { /* No expression operates on this vertex. Consider all children. */ for (Vertex neighbor : vertex.getAllNeighbors()) { query(neighbor); } } } }
package io.sigpipe.sing.query; - import java.io.IOException; import java.util.List; import java.util.Set; import io.sigpipe.sing.dataset.feature.FeatureType; import io.sigpipe.sing.graph.DataContainer; import io.sigpipe.sing.graph.Vertex; public class MetaQuery extends Query { private DataContainer aggregateData = new DataContainer(); public MetaQuery() { } public DataContainer result() { return aggregateData; } @Override public void execute(Vertex root) - throws IOException, QueryException { ? ------------- + throws QueryException { this.query(root); } private void query(Vertex vertex) - throws IOException, QueryException { ? ------------- + throws QueryException { DataContainer container = vertex.getData(); if (container != null) { this.aggregateData.merge(container); } if (vertex.numNeighbors() == 0) { /* This is a leaf node */ return; } String childFeature = vertex.getFirstNeighbor().getLabel().getName(); List<Expression> expList = this.expressions.get(childFeature); if (expList != null) { Set<Vertex> matches = evaluate(vertex, expList); for (Vertex match : matches) { if (match == null) { continue; } if (match.getLabel().getType() == FeatureType.NULL) { continue; } query(match); } } else { /* No expression operates on this vertex. Consider all children. */ for (Vertex neighbor : vertex.getAllNeighbors()) { query(neighbor); } } } }
5
0.078125
2
3
ed62cd96063e8928e3a8b535e3e4745e1a0721f7
packages/markdown-preview.less
packages/markdown-preview.less
@import "ui-variables"; .markdown-preview.markdown-preview { background-color: @markdown-preview-background-color; color: @markdown-preview-text-color; border: @markdown-preview-background-color solid @markdown-preview-border-color; .markdown-body { color: @markdown-preview-text-color; word-wrap: normal; } }
@import "ui-variables"; .markdown-preview.markdown-preview { background-color: @markdown-preview-background-color; color: @markdown-preview-text-color; border: @markdown-preview-background-color solid @markdown-preview-border-color; .markdown-body { color: @markdown-preview-text-color; word-wrap: normal; } } .markdown-preview:not([data-use-github-style]) { strong { color: @markdown-preview-text-color; } a { color: darken(@theme-blue, 40%); font-weight: 600; } h1, h2, h3, h4, h5, h6 { color: @markdown-preview-text-color; } }
Fix heading colors for preview styles
Fix heading colors for preview styles
Less
mit
JonSn0w/Atomic-Design-UI,JonSn0w/Atomic-Design-UI
less
## Code Before: @import "ui-variables"; .markdown-preview.markdown-preview { background-color: @markdown-preview-background-color; color: @markdown-preview-text-color; border: @markdown-preview-background-color solid @markdown-preview-border-color; .markdown-body { color: @markdown-preview-text-color; word-wrap: normal; } } ## Instruction: Fix heading colors for preview styles ## Code After: @import "ui-variables"; .markdown-preview.markdown-preview { background-color: @markdown-preview-background-color; color: @markdown-preview-text-color; border: @markdown-preview-background-color solid @markdown-preview-border-color; .markdown-body { color: @markdown-preview-text-color; word-wrap: normal; } } .markdown-preview:not([data-use-github-style]) { strong { color: @markdown-preview-text-color; } a { color: darken(@theme-blue, 40%); font-weight: 600; } h1, h2, h3, h4, h5, h6 { color: @markdown-preview-text-color; } }
@import "ui-variables"; .markdown-preview.markdown-preview { background-color: @markdown-preview-background-color; color: @markdown-preview-text-color; border: @markdown-preview-background-color solid @markdown-preview-border-color; .markdown-body { color: @markdown-preview-text-color; word-wrap: normal; } } + + .markdown-preview:not([data-use-github-style]) { + strong { + color: @markdown-preview-text-color; + } + a { + color: darken(@theme-blue, 40%); + font-weight: 600; + } + h1, h2, h3, h4, h5, h6 { + color: @markdown-preview-text-color; + } + }
13
1.181818
13
0
ae6c5cd6b06e0d7d9a8a9279930f12aef16385ad
packages/plugin-electron-client-state-manager/README.md
packages/plugin-electron-client-state-manager/README.md
This plugin provides a wrapper around the parts of state that need to be synchronised, providing a way for listeners to be notified of changes. The plugin runs in the main Electron process, and patches each of the client mutators whose state we need to synchronise: - `setUser()` - `setContext()` - `addMetadata()` - `clearMetadata()` Any call to these methods (which will be from a developer or a plugin calling `Bugsnag.<method>()` in the main process) will emit an event signifying the change and updated value. Separately, we expose a `bulkUpdate` method for a new renderer to deliver a full state update in one pass.
This plugin provides a wrapper around the parts of state that need to be synchronised, providing a way for listeners to be notified of changes. The plugin runs in the main Electron process, and patches each of the client mutators whose state we need to synchronise: - `setUser()` - `setContext()` - `addMetadata()` - `clearMetadata()` Any call to these methods (which will be from a developer or a plugin calling `Bugsnag.<method>()` in the main process) will emit an event signifying the change and updated value. Separately, we expose a `bulkUpdate` method for a new renderer to deliver a full state update in one pass. ## License This package is free software released under the MIT License. See [LICENSE.txt](./LICENSE.txt) for details.
Add license information to package readme
Add license information to package readme
Markdown
mit
bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js,bugsnag/bugsnag-js
markdown
## Code Before: This plugin provides a wrapper around the parts of state that need to be synchronised, providing a way for listeners to be notified of changes. The plugin runs in the main Electron process, and patches each of the client mutators whose state we need to synchronise: - `setUser()` - `setContext()` - `addMetadata()` - `clearMetadata()` Any call to these methods (which will be from a developer or a plugin calling `Bugsnag.<method>()` in the main process) will emit an event signifying the change and updated value. Separately, we expose a `bulkUpdate` method for a new renderer to deliver a full state update in one pass. ## Instruction: Add license information to package readme ## Code After: This plugin provides a wrapper around the parts of state that need to be synchronised, providing a way for listeners to be notified of changes. The plugin runs in the main Electron process, and patches each of the client mutators whose state we need to synchronise: - `setUser()` - `setContext()` - `addMetadata()` - `clearMetadata()` Any call to these methods (which will be from a developer or a plugin calling `Bugsnag.<method>()` in the main process) will emit an event signifying the change and updated value. Separately, we expose a `bulkUpdate` method for a new renderer to deliver a full state update in one pass. ## License This package is free software released under the MIT License. See [LICENSE.txt](./LICENSE.txt) for details.
This plugin provides a wrapper around the parts of state that need to be synchronised, providing a way for listeners to be notified of changes. The plugin runs in the main Electron process, and patches each of the client mutators whose state we need to synchronise: - `setUser()` - `setContext()` - `addMetadata()` - `clearMetadata()` Any call to these methods (which will be from a developer or a plugin calling `Bugsnag.<method>()` in the main process) will emit an event signifying the change and updated value. Separately, we expose a `bulkUpdate` method for a new renderer to deliver a full state update in one pass. + + ## License + + This package is free software released under the MIT License. See [LICENSE.txt](./LICENSE.txt) for details.
4
0.307692
4
0
842fd4a78f63989ab5bee4a611116b0949d6b48c
doc/md/_toc.md
doc/md/_toc.md
* [Overview](overview.md) * [Core](core.md) * [Vector](vector.md) * [Special Functions](special-functions.md) * [Distributions](distributions.md) * [Linear Algebra](linear-algebra.md) * [Statistical Tests](test.md)
* [Overview](overview.html) * [Core](core.html) * [Vector](vector.html) * [Special Functions](special-functions.html) * [Distributions](distributions.html) * [Linear Algebra](linear-algebra.html) * [Statistical Tests](test.html)
Revert "Add .md, remove .html"
Revert "Add .md, remove .html" This reverts commit 130ff4c83828e4c12c14803fde66e7e0348be198. Reason for revert is because .html files are generated by documentation and are used by the website.
Markdown
mit
jstat/jstat,jstat/jstat,NorthDecoder/jstat,NorthDecoder/jstat
markdown
## Code Before: * [Overview](overview.md) * [Core](core.md) * [Vector](vector.md) * [Special Functions](special-functions.md) * [Distributions](distributions.md) * [Linear Algebra](linear-algebra.md) * [Statistical Tests](test.md) ## Instruction: Revert "Add .md, remove .html" This reverts commit 130ff4c83828e4c12c14803fde66e7e0348be198. Reason for revert is because .html files are generated by documentation and are used by the website. ## Code After: * [Overview](overview.html) * [Core](core.html) * [Vector](vector.html) * [Special Functions](special-functions.html) * [Distributions](distributions.html) * [Linear Algebra](linear-algebra.html) * [Statistical Tests](test.html)
- * [Overview](overview.md) ? ^ + * [Overview](overview.html) ? ++ ^ - * [Core](core.md) ? ^ + * [Core](core.html) ? ++ ^ - * [Vector](vector.md) ? ^ + * [Vector](vector.html) ? ++ ^ - * [Special Functions](special-functions.md) ? ^ + * [Special Functions](special-functions.html) ? ++ ^ - * [Distributions](distributions.md) ? ^ + * [Distributions](distributions.html) ? ++ ^ - * [Linear Algebra](linear-algebra.md) ? ^ + * [Linear Algebra](linear-algebra.html) ? ++ ^ - * [Statistical Tests](test.md) ? ^ + * [Statistical Tests](test.html) ? ++ ^
14
1.75
7
7
c84cf5e0b7b8e4761d4a225a1be77498ff6bc358
src/_constants/po/index.js
src/_constants/po/index.js
export ar from './ar.js'; export de from './de.js'; export en from './en.js'; export es from './es.js'; export fr from './fr.js'; export id from './id.js'; export it from './it.js'; export ja from './ja.js'; export pl from './pl.js'; export pt from './pt.js'; export ru from './ru.js'; export vi from './vi.js'; export zhCN from './zh_cn.js'; export zhTW from './zh_tw.js';
export de from './de.js'; export en from './en.js'; export es from './es.js'; export fr from './fr.js'; export id from './id.js'; export it from './it.js'; export ja from './ja.js'; export pl from './pl.js'; export pt from './pt.js'; export ru from './ru.js'; export vi from './vi.js'; export zhCN from './zh_cn.js'; export zhTW from './zh_tw.js';
Remove last reference to Arabic
Remove last reference to Arabic
JavaScript
mit
binary-com/binary-next-gen,nazaninreihani/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary-next-gen,nazaninreihani/binary-next-gen,binary-com/binary-next-gen
javascript
## Code Before: export ar from './ar.js'; export de from './de.js'; export en from './en.js'; export es from './es.js'; export fr from './fr.js'; export id from './id.js'; export it from './it.js'; export ja from './ja.js'; export pl from './pl.js'; export pt from './pt.js'; export ru from './ru.js'; export vi from './vi.js'; export zhCN from './zh_cn.js'; export zhTW from './zh_tw.js'; ## Instruction: Remove last reference to Arabic ## Code After: export de from './de.js'; export en from './en.js'; export es from './es.js'; export fr from './fr.js'; export id from './id.js'; export it from './it.js'; export ja from './ja.js'; export pl from './pl.js'; export pt from './pt.js'; export ru from './ru.js'; export vi from './vi.js'; export zhCN from './zh_cn.js'; export zhTW from './zh_tw.js';
- export ar from './ar.js'; export de from './de.js'; export en from './en.js'; export es from './es.js'; export fr from './fr.js'; export id from './id.js'; export it from './it.js'; export ja from './ja.js'; export pl from './pl.js'; export pt from './pt.js'; export ru from './ru.js'; export vi from './vi.js'; export zhCN from './zh_cn.js'; export zhTW from './zh_tw.js';
1
0.071429
0
1
f80bc26810ad9d2d687c1fd86b298e3bb7b63c56
examples/official-storybook/stories/addon-docs/react-memo.stories.js
examples/official-storybook/stories/addon-docs/react-memo.stories.js
import React from 'react'; import { DocgenButton } from '../../components/DocgenButton'; const ButtonWithMemo = React.memo((props) => <DocgenButton {...props} />); export default { title: 'Addons/Docs/ButtonWithMemo', component: ButtonWithMemo, parameters: { chromatic: { disable: true } }, }; export const displaysCorrectly = () => <ButtonWithMemo label="Hello World" />; displaysCorrectly.storyName = 'Displays components with memo correctly';
import React from 'react'; import { DocgenButton } from '../../components/DocgenButton'; const ButtonWithMemo = React.memo((props) => <DocgenButton {...props} />); export default { title: 'Addons/Docs/ButtonWithMemo', component: ButtonWithMemo, parameters: { chromatic: { disable: true }, docs: { source: { type: 'dynamic' } }, }, }; export const displaysCorrectly = () => <ButtonWithMemo label="Hello World" />; displaysCorrectly.storyName = 'Displays components with memo correctly';
Add React.memo dynamic snippet to official-storybook
Add React.memo dynamic snippet to official-storybook
JavaScript
mit
storybooks/storybook,storybooks/react-storybook,storybooks/storybook,kadirahq/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook
javascript
## Code Before: import React from 'react'; import { DocgenButton } from '../../components/DocgenButton'; const ButtonWithMemo = React.memo((props) => <DocgenButton {...props} />); export default { title: 'Addons/Docs/ButtonWithMemo', component: ButtonWithMemo, parameters: { chromatic: { disable: true } }, }; export const displaysCorrectly = () => <ButtonWithMemo label="Hello World" />; displaysCorrectly.storyName = 'Displays components with memo correctly'; ## Instruction: Add React.memo dynamic snippet to official-storybook ## Code After: import React from 'react'; import { DocgenButton } from '../../components/DocgenButton'; const ButtonWithMemo = React.memo((props) => <DocgenButton {...props} />); export default { title: 'Addons/Docs/ButtonWithMemo', component: ButtonWithMemo, parameters: { chromatic: { disable: true }, docs: { source: { type: 'dynamic' } }, }, }; export const displaysCorrectly = () => <ButtonWithMemo label="Hello World" />; displaysCorrectly.storyName = 'Displays components with memo correctly';
import React from 'react'; import { DocgenButton } from '../../components/DocgenButton'; const ButtonWithMemo = React.memo((props) => <DocgenButton {...props} />); export default { title: 'Addons/Docs/ButtonWithMemo', component: ButtonWithMemo, + parameters: { - parameters: { chromatic: { disable: true } }, ? ----------- - -- + chromatic: { disable: true }, + docs: { source: { type: 'dynamic' } }, + }, }; export const displaysCorrectly = () => <ButtonWithMemo label="Hello World" />; displaysCorrectly.storyName = 'Displays components with memo correctly';
5
0.384615
4
1
50fbdb41bed90381a2d048c9b18e2f45ccdd1021
src/v2/components/UI/Head/components/Title/index.tsx
src/v2/components/UI/Head/components/Title/index.tsx
import React from 'react' import { unescape } from 'underscore' import Head from 'v2/components/UI/Head' export const TITLE_TEMPLATE = 'Are.na / %s' interface Props { children: string } export const Title: React.FC<Props> = ({ children }) => { const title = TITLE_TEMPLATE.replace('%s', unescape(children)) return ( <Head> <title>{title}</title> <meta name="twitter:title" content={title} /> <meta property="og:title" content={title} /> </Head> ) } export default Title
import React from 'react' import { unescape } from 'underscore' import Head from 'v2/components/UI/Head' export const TITLE_TEMPLATE = '%s — Are.na' interface Props { children: string } export const Title: React.FC<Props> = ({ children }) => { const title = TITLE_TEMPLATE.replace('%s', unescape(children)) return ( <Head> <title>{title}</title> <meta name="twitter:title" content={title} /> <meta property="og:title" content={title} /> </Head> ) } export default Title
Switch title tag template so Are.na goes last
Switch title tag template so Are.na goes last
TypeScript
mit
aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell
typescript
## Code Before: import React from 'react' import { unescape } from 'underscore' import Head from 'v2/components/UI/Head' export const TITLE_TEMPLATE = 'Are.na / %s' interface Props { children: string } export const Title: React.FC<Props> = ({ children }) => { const title = TITLE_TEMPLATE.replace('%s', unescape(children)) return ( <Head> <title>{title}</title> <meta name="twitter:title" content={title} /> <meta property="og:title" content={title} /> </Head> ) } export default Title ## Instruction: Switch title tag template so Are.na goes last ## Code After: import React from 'react' import { unescape } from 'underscore' import Head from 'v2/components/UI/Head' export const TITLE_TEMPLATE = '%s — Are.na' interface Props { children: string } export const Title: React.FC<Props> = ({ children }) => { const title = TITLE_TEMPLATE.replace('%s', unescape(children)) return ( <Head> <title>{title}</title> <meta name="twitter:title" content={title} /> <meta property="og:title" content={title} /> </Head> ) } export default Title
import React from 'react' import { unescape } from 'underscore' import Head from 'v2/components/UI/Head' - export const TITLE_TEMPLATE = 'Are.na / %s' ? ----- + export const TITLE_TEMPLATE = '%s — Are.na' ? +++++ interface Props { children: string } export const Title: React.FC<Props> = ({ children }) => { const title = TITLE_TEMPLATE.replace('%s', unescape(children)) return ( <Head> <title>{title}</title> <meta name="twitter:title" content={title} /> <meta property="og:title" content={title} /> </Head> ) } export default Title
2
0.083333
1
1
7cb9ea0c1ac76b086ef8959c9e5597c26b2d9c40
test/puppetlabs/cthun/meshing/hazelcast_test.clj
test/puppetlabs/cthun/meshing/hazelcast_test.clj
(ns puppetlabs.cthun.meshing.hazelcast-test (require [clojure.test :refer :all] [puppetlabs.cthun.meshing.hazelcast :refer :all]))
(ns puppetlabs.cthun.meshing.hazelcast-test (require [clojure.test :refer :all] [puppetlabs.cthun.meshing.hazelcast :refer :all])) (deftest broker-for-endpoint-test (with-redefs [flatten-location-map (fn [_] [{:broker "bill" :endpoint "cth://localhost/agent"} {:broker "ted" :endpoint "cth://localhost/agent"} {:broker "bill" :endpoint "cth://localhost/controller"}])] (testing "it finds the controller" (is (= "bill" (broker-for-endpoint nil "cth://localhost/controller")))) (testing "it finds the agent" (is (= "bill" (broker-for-endpoint nil "cth://localhost/agent")))) (testing "it won't find something absent" (is (not (broker-for-endpoint nil "cth://localhost/no-suchagent"))))))
Add partial testing to the hazelcast mesh
Add partial testing to the hazelcast mesh
Clojure
apache-2.0
puppetlabs/pcp-broker,puppetlabs/pcp-broker,puppetlabs/pcp-broker
clojure
## Code Before: (ns puppetlabs.cthun.meshing.hazelcast-test (require [clojure.test :refer :all] [puppetlabs.cthun.meshing.hazelcast :refer :all])) ## Instruction: Add partial testing to the hazelcast mesh ## Code After: (ns puppetlabs.cthun.meshing.hazelcast-test (require [clojure.test :refer :all] [puppetlabs.cthun.meshing.hazelcast :refer :all])) (deftest broker-for-endpoint-test (with-redefs [flatten-location-map (fn [_] [{:broker "bill" :endpoint "cth://localhost/agent"} {:broker "ted" :endpoint "cth://localhost/agent"} {:broker "bill" :endpoint "cth://localhost/controller"}])] (testing "it finds the controller" (is (= "bill" (broker-for-endpoint nil "cth://localhost/controller")))) (testing "it finds the agent" (is (= "bill" (broker-for-endpoint nil "cth://localhost/agent")))) (testing "it won't find something absent" (is (not (broker-for-endpoint nil "cth://localhost/no-suchagent"))))))
(ns puppetlabs.cthun.meshing.hazelcast-test (require [clojure.test :refer :all] [puppetlabs.cthun.meshing.hazelcast :refer :all])) + + (deftest broker-for-endpoint-test + (with-redefs [flatten-location-map (fn [_] [{:broker "bill" :endpoint "cth://localhost/agent"} + {:broker "ted" :endpoint "cth://localhost/agent"} + {:broker "bill" :endpoint "cth://localhost/controller"}])] + (testing "it finds the controller" + (is (= "bill" (broker-for-endpoint nil "cth://localhost/controller")))) + (testing "it finds the agent" + (is (= "bill" (broker-for-endpoint nil "cth://localhost/agent")))) + (testing "it won't find something absent" + (is (not (broker-for-endpoint nil "cth://localhost/no-suchagent"))))))
11
3.666667
11
0
218f3352fb2e45eaea9551d33a074b2c5d48a978
nginx/selinux.sls
nginx/selinux.sls
{% from 'states/nginx/map.jinja' import nginx as nginx_map with context %} {% from 'states/defaults.map.jinja' import defaults with context %} .params: stateconf.set: [] # --- end of state config --- {% if params.get('network_connect', false) == true %} nginx-selinux-bool-httpd-can-network-connect: selinux.boolean: - name: httpd_can_network_connect - value: 1 - persist: True - require_in: - service: nginx {% endif %}
{% from 'states/nginx/map.jinja' import nginx as nginx_map with context %} {% from 'states/defaults.map.jinja' import defaults with context %} .params: stateconf.set: [] # --- end of state config --- {% if params.get('network_connect', false) == true %} nginx-selinux-packages: pkg.installed: - pkgs: - policycoreutils - policycoreutils-python nginx-selinux-bool-httpd-can-network-connect: selinux.boolean: - name: httpd_can_network_connect - value: 1 - persist: True - require_in: - service: nginx - require: - pkg: nginx-selinux-packages {% endif %}
Install required packages when configuring SELinux.
nginx: Install required packages when configuring SELinux.
SaltStack
apache-2.0
whatevsz/salt-states,whatevsz/salt-states-parameterized,whatevsz/salt-states-parameterized,whatevsz/salt-states
saltstack
## Code Before: {% from 'states/nginx/map.jinja' import nginx as nginx_map with context %} {% from 'states/defaults.map.jinja' import defaults with context %} .params: stateconf.set: [] # --- end of state config --- {% if params.get('network_connect', false) == true %} nginx-selinux-bool-httpd-can-network-connect: selinux.boolean: - name: httpd_can_network_connect - value: 1 - persist: True - require_in: - service: nginx {% endif %} ## Instruction: nginx: Install required packages when configuring SELinux. ## Code After: {% from 'states/nginx/map.jinja' import nginx as nginx_map with context %} {% from 'states/defaults.map.jinja' import defaults with context %} .params: stateconf.set: [] # --- end of state config --- {% if params.get('network_connect', false) == true %} nginx-selinux-packages: pkg.installed: - pkgs: - policycoreutils - policycoreutils-python nginx-selinux-bool-httpd-can-network-connect: selinux.boolean: - name: httpd_can_network_connect - value: 1 - persist: True - require_in: - service: nginx - require: - pkg: nginx-selinux-packages {% endif %}
{% from 'states/nginx/map.jinja' import nginx as nginx_map with context %} {% from 'states/defaults.map.jinja' import defaults with context %} .params: stateconf.set: [] # --- end of state config --- {% if params.get('network_connect', false) == true %} + nginx-selinux-packages: + pkg.installed: + - pkgs: + - policycoreutils + - policycoreutils-python + nginx-selinux-bool-httpd-can-network-connect: selinux.boolean: - name: httpd_can_network_connect - value: 1 - persist: True - require_in: - service: nginx + - require: + - pkg: nginx-selinux-packages {% endif %}
8
0.5
8
0
8795e608f3068a465587615bbc20bd1dfa72b964
test/test_wepay_rails_initialize.rb
test/test_wepay_rails_initialize.rb
require File.expand_path(File.dirname(__FILE__) + '/helper') class TestWepayRails < ActiveSupport::TestCase def teardown delete_wepay_config_file end test "should initialize WepayRails with settings from wepay.yml" do create_wepay_config_file initialize_wepay_config gateway = WepayRails::Payments::Gateway.new assert_not_nil gateway.configuration assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] end test "should initialize WepayRails with embedded Ruby in wepay.yml.erb" do create_wepay_config_file(true) initialize_wepay_config gateway = WepayRails::Payments::Gateway.new assert_not_nil gateway.configuration assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] assert_equal 'abc' * 3, gateway.access_token end test "should initialize WepayRails with an existing access_token" do gateway = WepayRails::Payments::Gateway.new("myAccessToken") assert_equal "myAccessToken", gateway.access_token end end
require File.expand_path(File.dirname(__FILE__) + '/helper') class TestWepayRailsInitialize < ActiveSupport::TestCase def teardown delete_wepay_config_file end test "should initialize WepayRails with settings from wepay.yml" do create_wepay_config_file initialize_wepay_config @gateway = WepayRails::Payments::Gateway.new assert_not_nil @gateway.configuration assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] end test "should initialize WepayRails with embedded Ruby in wepay.yml.erb" do create_wepay_config_file(true) initialize_wepay_config @gateway = WepayRails::Payments::Gateway.new assert_not_nil @gateway.configuration assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] assert_equal 'abc' * 3, @gateway.access_token end test "should initialize WepayRails with an existing access_token" do @gateway = WepayRails::Payments::Gateway.new("myAccessToken") assert_equal "myAccessToken", @gateway.access_token end end
Change name of test class and change local variables into object variables for clarity.
Change name of test class and change local variables into object variables for clarity.
Ruby
mit
adamthedeveloper/wepay-rails
ruby
## Code Before: require File.expand_path(File.dirname(__FILE__) + '/helper') class TestWepayRails < ActiveSupport::TestCase def teardown delete_wepay_config_file end test "should initialize WepayRails with settings from wepay.yml" do create_wepay_config_file initialize_wepay_config gateway = WepayRails::Payments::Gateway.new assert_not_nil gateway.configuration assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] end test "should initialize WepayRails with embedded Ruby in wepay.yml.erb" do create_wepay_config_file(true) initialize_wepay_config gateway = WepayRails::Payments::Gateway.new assert_not_nil gateway.configuration assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] assert_equal 'abc' * 3, gateway.access_token end test "should initialize WepayRails with an existing access_token" do gateway = WepayRails::Payments::Gateway.new("myAccessToken") assert_equal "myAccessToken", gateway.access_token end end ## Instruction: Change name of test class and change local variables into object variables for clarity. ## Code After: require File.expand_path(File.dirname(__FILE__) + '/helper') class TestWepayRailsInitialize < ActiveSupport::TestCase def teardown delete_wepay_config_file end test "should initialize WepayRails with settings from wepay.yml" do create_wepay_config_file initialize_wepay_config @gateway = WepayRails::Payments::Gateway.new assert_not_nil @gateway.configuration assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] end test "should initialize WepayRails with embedded Ruby in wepay.yml.erb" do create_wepay_config_file(true) initialize_wepay_config @gateway = WepayRails::Payments::Gateway.new assert_not_nil @gateway.configuration assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] assert_equal 'abc' * 3, @gateway.access_token end test "should initialize WepayRails with an existing access_token" do @gateway = WepayRails::Payments::Gateway.new("myAccessToken") assert_equal "myAccessToken", @gateway.access_token end end
require File.expand_path(File.dirname(__FILE__) + '/helper') - class TestWepayRails < ActiveSupport::TestCase + class TestWepayRailsInitialize < ActiveSupport::TestCase ? ++++++++++ def teardown delete_wepay_config_file end test "should initialize WepayRails with settings from wepay.yml" do create_wepay_config_file initialize_wepay_config - gateway = WepayRails::Payments::Gateway.new + @gateway = WepayRails::Payments::Gateway.new ? + - assert_not_nil gateway.configuration + assert_not_nil @gateway.configuration ? + - assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] + assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] ? + end test "should initialize WepayRails with embedded Ruby in wepay.yml.erb" do create_wepay_config_file(true) initialize_wepay_config - gateway = WepayRails::Payments::Gateway.new + @gateway = WepayRails::Payments::Gateway.new ? + - assert_not_nil gateway.configuration + assert_not_nil @gateway.configuration ? + - assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] + assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] ? + - assert_equal 'abc' * 3, gateway.access_token + assert_equal 'abc' * 3, @gateway.access_token ? + end test "should initialize WepayRails with an existing access_token" do - gateway = WepayRails::Payments::Gateway.new("myAccessToken") + @gateway = WepayRails::Payments::Gateway.new("myAccessToken") ? + - assert_equal "myAccessToken", gateway.access_token + assert_equal "myAccessToken", @gateway.access_token ? + end end
20
0.645161
10
10
7d1048bf39b9c53f37332c1c0a2e4340ce23e700
src/net/java/sip/communicator/impl/neomedia/device/ImageStreamingAuto.java
src/net/java/sip/communicator/impl/neomedia/device/ImageStreamingAuto.java
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.neomedia.device; import javax.media.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*; /** * Add ImageStreaming capture device. * * @author Sebastien Vincent */ public class ImageStreamingAuto { /** * Add capture devices. * * @throws Exception if problem when adding capture devices */ public ImageStreamingAuto() throws Exception { String name = "Experimental desktop streaming"; CaptureDeviceInfo devInfo = new CaptureDeviceInfo( name, new MediaLocator( ImageStreamingUtils.LOCATOR_PROTOCOL + ":" + name), DataSource.getFormats()); /* add to JMF device manager */ CaptureDeviceManager.addDevice(devInfo); CaptureDeviceManager.commit(); } }
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.neomedia.device; import javax.media.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*; /** * Add ImageStreaming capture device. * * @author Sebastien Vincent */ public class ImageStreamingAuto { /** * Add capture devices. * * @throws Exception if problem when adding capture devices */ public ImageStreamingAuto() throws Exception { String name = "Desktop Streaming (Experimental)"; CaptureDeviceInfo devInfo = new CaptureDeviceInfo( name, new MediaLocator( ImageStreamingUtils.LOCATOR_PROTOCOL + ":" + name), DataSource.getFormats()); /* add to JMF device manager */ CaptureDeviceManager.addDevice(devInfo); CaptureDeviceManager.commit(); } }
Change name displayed for desktop streaming device in the media configuration panel.
Change name displayed for desktop streaming device in the media configuration panel.
Java
apache-2.0
cobratbq/jitsi,mckayclarey/jitsi,martin7890/jitsi,459below/jitsi,iant-gmbh/jitsi,martin7890/jitsi,ringdna/jitsi,laborautonomo/jitsi,damencho/jitsi,damencho/jitsi,gpolitis/jitsi,ibauersachs/jitsi,ibauersachs/jitsi,HelioGuilherme66/jitsi,gpolitis/jitsi,jibaro/jitsi,tuijldert/jitsi,tuijldert/jitsi,procandi/jitsi,jitsi/jitsi,level7systems/jitsi,ringdna/jitsi,level7systems/jitsi,ibauersachs/jitsi,bhatvv/jitsi,bebo/jitsi,459below/jitsi,Metaswitch/jitsi,jitsi/jitsi,jitsi/jitsi,pplatek/jitsi,ibauersachs/jitsi,laborautonomo/jitsi,HelioGuilherme66/jitsi,bebo/jitsi,level7systems/jitsi,HelioGuilherme66/jitsi,jitsi/jitsi,bebo/jitsi,laborautonomo/jitsi,damencho/jitsi,mckayclarey/jitsi,cobratbq/jitsi,jibaro/jitsi,damencho/jitsi,459below/jitsi,jitsi/jitsi,pplatek/jitsi,ringdna/jitsi,HelioGuilherme66/jitsi,tuijldert/jitsi,bebo/jitsi,level7systems/jitsi,martin7890/jitsi,Metaswitch/jitsi,jibaro/jitsi,Metaswitch/jitsi,martin7890/jitsi,ringdna/jitsi,marclaporte/jitsi,pplatek/jitsi,level7systems/jitsi,mckayclarey/jitsi,gpolitis/jitsi,459below/jitsi,procandi/jitsi,dkcreinoso/jitsi,Metaswitch/jitsi,iant-gmbh/jitsi,damencho/jitsi,bhatvv/jitsi,iant-gmbh/jitsi,pplatek/jitsi,marclaporte/jitsi,gpolitis/jitsi,procandi/jitsi,procandi/jitsi,bhatvv/jitsi,ringdna/jitsi,tuijldert/jitsi,laborautonomo/jitsi,ibauersachs/jitsi,marclaporte/jitsi,cobratbq/jitsi,mckayclarey/jitsi,iant-gmbh/jitsi,martin7890/jitsi,dkcreinoso/jitsi,bhatvv/jitsi,marclaporte/jitsi,459below/jitsi,cobratbq/jitsi,iant-gmbh/jitsi,dkcreinoso/jitsi,laborautonomo/jitsi,dkcreinoso/jitsi,pplatek/jitsi,dkcreinoso/jitsi,bebo/jitsi,procandi/jitsi,marclaporte/jitsi,tuijldert/jitsi,HelioGuilherme66/jitsi,bhatvv/jitsi,jibaro/jitsi,mckayclarey/jitsi,cobratbq/jitsi,gpolitis/jitsi,jibaro/jitsi
java
## Code Before: /* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.neomedia.device; import javax.media.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*; /** * Add ImageStreaming capture device. * * @author Sebastien Vincent */ public class ImageStreamingAuto { /** * Add capture devices. * * @throws Exception if problem when adding capture devices */ public ImageStreamingAuto() throws Exception { String name = "Experimental desktop streaming"; CaptureDeviceInfo devInfo = new CaptureDeviceInfo( name, new MediaLocator( ImageStreamingUtils.LOCATOR_PROTOCOL + ":" + name), DataSource.getFormats()); /* add to JMF device manager */ CaptureDeviceManager.addDevice(devInfo); CaptureDeviceManager.commit(); } } ## Instruction: Change name displayed for desktop streaming device in the media configuration panel. ## Code After: /* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.neomedia.device; import javax.media.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*; /** * Add ImageStreaming capture device. * * @author Sebastien Vincent */ public class ImageStreamingAuto { /** * Add capture devices. * * @throws Exception if problem when adding capture devices */ public ImageStreamingAuto() throws Exception { String name = "Desktop Streaming (Experimental)"; CaptureDeviceInfo devInfo = new CaptureDeviceInfo( name, new MediaLocator( ImageStreamingUtils.LOCATOR_PROTOCOL + ":" + name), DataSource.getFormats()); /* add to JMF device manager */ CaptureDeviceManager.addDevice(devInfo); CaptureDeviceManager.commit(); } }
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.neomedia.device; import javax.media.*; import net.java.sip.communicator.impl.neomedia.imgstreaming.*; import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*; /** * Add ImageStreaming capture device. * * @author Sebastien Vincent */ public class ImageStreamingAuto { /** * Add capture devices. * * @throws Exception if problem when adding capture devices */ public ImageStreamingAuto() throws Exception { - String name = "Experimental desktop streaming"; + String name = "Desktop Streaming (Experimental)"; CaptureDeviceInfo devInfo = new CaptureDeviceInfo( name, new MediaLocator( ImageStreamingUtils.LOCATOR_PROTOCOL + ":" + name), DataSource.getFormats()); /* add to JMF device manager */ CaptureDeviceManager.addDevice(devInfo); CaptureDeviceManager.commit(); } }
2
0.05
1
1
30d27b13955e0bb4698950f3213c9e93de315351
recipes-kernel/linux/linux-raspberrypi_4.1.bb
recipes-kernel/linux/linux-raspberrypi_4.1.bb
LINUX_VERSION ?= "4.1.0" SRCREV = "07009cab090ade3dd180e8a55d590b1a00072eed" SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \ file://0001-rpi2-setup.patch \ file://0002-drm-vc4-Use-the-fbdev_cma-helpers.patch \ file://0003-drm-vc4-Allow-vblank-to-be-disabled.patch \ file://rpi2-defconfig.patch \ file://HULK_SMASH.patch \ " require linux-raspberrypi.inc
LINUX_VERSION ?= "4.1.0" SRCREV = "b8b2f50546513355fecd9ac44b2355f19a9620a8" SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \ file://0001-rpi2-setup.patch \ file://0002-drm-vc4-Use-the-fbdev_cma-helpers.patch \ file://0003-drm-vc4-Allow-vblank-to-be-disabled.patch \ file://rpi2-defconfig.patch \ file://HULK_SMASH.patch \ " require linux-raspberrypi.inc
Use latest anholt's vc4-kms-v3d-rpi2 branch of linux kernel
Use latest anholt's vc4-kms-v3d-rpi2 branch of linux kernel
BitBake
mit
kovrov/meta-raspberrypi,kovrov/meta-raspberrypi,kovrov/meta-raspberrypi
bitbake
## Code Before: LINUX_VERSION ?= "4.1.0" SRCREV = "07009cab090ade3dd180e8a55d590b1a00072eed" SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \ file://0001-rpi2-setup.patch \ file://0002-drm-vc4-Use-the-fbdev_cma-helpers.patch \ file://0003-drm-vc4-Allow-vblank-to-be-disabled.patch \ file://rpi2-defconfig.patch \ file://HULK_SMASH.patch \ " require linux-raspberrypi.inc ## Instruction: Use latest anholt's vc4-kms-v3d-rpi2 branch of linux kernel ## Code After: LINUX_VERSION ?= "4.1.0" SRCREV = "b8b2f50546513355fecd9ac44b2355f19a9620a8" SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \ file://0001-rpi2-setup.patch \ file://0002-drm-vc4-Use-the-fbdev_cma-helpers.patch \ file://0003-drm-vc4-Allow-vblank-to-be-disabled.patch \ file://rpi2-defconfig.patch \ file://HULK_SMASH.patch \ " require linux-raspberrypi.inc
LINUX_VERSION ?= "4.1.0" - SRCREV = "07009cab090ade3dd180e8a55d590b1a00072eed" + SRCREV = "b8b2f50546513355fecd9ac44b2355f19a9620a8" SRC_URI = "git://github.com/anholt/linux.git;protocol=git;branch=vc4-kms-v3d-rpi2 \ file://0001-rpi2-setup.patch \ file://0002-drm-vc4-Use-the-fbdev_cma-helpers.patch \ file://0003-drm-vc4-Allow-vblank-to-be-disabled.patch \ file://rpi2-defconfig.patch \ file://HULK_SMASH.patch \ " require linux-raspberrypi.inc
2
0.166667
1
1
b66e3c56de92803e0f0316a5568bb2bb127f7780
packages/ha/hashids.yaml
packages/ha/hashids.yaml
homepage: http://hashids.org/ changelog-type: '' hash: e03b6340fb9b7ac909370b28b3c7342a30115bfb5137424fe4974dc00ef99fd0 test-bench-deps: bytestring: -any split: -any base: -any containers: -any maintainer: hildenjohannes@gmail.com synopsis: Hashids generates short, unique, non-sequential ids from numbers. changelog: '' basic-deps: bytestring: -any split: -any base: ==4.* containers: -any all-versions: - '1.0.2' - '1.0.2.1' - '1.0.2.2' - '1.0.2.3' author: Johannes Hildén latest: '1.0.2.3' description-type: haddock description: This is a Haskell port of the Hashids library. It is typically used to encode numbers to a format suitable to appear in visible places like urls. It converts numbers like 347 into strings like yr8, or a list of numbers like [27, 986] into 3kTMd. You can also decode those ids back. This is useful in bundling several parameters into one. license-name: MIT
homepage: http://hashids.org/ changelog-type: '' hash: 7bf6f511e4fd5c6a43ee75509d85214221a8efb061c012b0fca8982f51c78576 test-bench-deps: bytestring: -any split: -any base: -any containers: -any maintainer: hildenjohannes@gmail.com synopsis: Hashids generates short, unique, non-sequential ids from numbers. changelog: '' basic-deps: bytestring: -any split: -any base: ==4.* containers: -any all-versions: - '1.0.2' - '1.0.2.1' - '1.0.2.2' - '1.0.2.3' - '1.0.2.4' author: Johannes Hildén latest: '1.0.2.4' description-type: haddock description: This is a Haskell port of the Hashids library. It is typically used to encode numbers to a format suitable to appear in visible places like urls. It converts numbers like 347 into strings like yr8, or a list of numbers like [27, 986] into 3kTMd. You can also decode those ids back. This is useful in bundling several parameters into one. license-name: MIT
Update from Hackage at 2018-02-09T08:35:07Z
Update from Hackage at 2018-02-09T08:35:07Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: http://hashids.org/ changelog-type: '' hash: e03b6340fb9b7ac909370b28b3c7342a30115bfb5137424fe4974dc00ef99fd0 test-bench-deps: bytestring: -any split: -any base: -any containers: -any maintainer: hildenjohannes@gmail.com synopsis: Hashids generates short, unique, non-sequential ids from numbers. changelog: '' basic-deps: bytestring: -any split: -any base: ==4.* containers: -any all-versions: - '1.0.2' - '1.0.2.1' - '1.0.2.2' - '1.0.2.3' author: Johannes Hildén latest: '1.0.2.3' description-type: haddock description: This is a Haskell port of the Hashids library. It is typically used to encode numbers to a format suitable to appear in visible places like urls. It converts numbers like 347 into strings like yr8, or a list of numbers like [27, 986] into 3kTMd. You can also decode those ids back. This is useful in bundling several parameters into one. license-name: MIT ## Instruction: Update from Hackage at 2018-02-09T08:35:07Z ## Code After: homepage: http://hashids.org/ changelog-type: '' hash: 7bf6f511e4fd5c6a43ee75509d85214221a8efb061c012b0fca8982f51c78576 test-bench-deps: bytestring: -any split: -any base: -any containers: -any maintainer: hildenjohannes@gmail.com synopsis: Hashids generates short, unique, non-sequential ids from numbers. changelog: '' basic-deps: bytestring: -any split: -any base: ==4.* containers: -any all-versions: - '1.0.2' - '1.0.2.1' - '1.0.2.2' - '1.0.2.3' - '1.0.2.4' author: Johannes Hildén latest: '1.0.2.4' description-type: haddock description: This is a Haskell port of the Hashids library. It is typically used to encode numbers to a format suitable to appear in visible places like urls. It converts numbers like 347 into strings like yr8, or a list of numbers like [27, 986] into 3kTMd. You can also decode those ids back. This is useful in bundling several parameters into one. license-name: MIT
homepage: http://hashids.org/ changelog-type: '' - hash: e03b6340fb9b7ac909370b28b3c7342a30115bfb5137424fe4974dc00ef99fd0 + hash: 7bf6f511e4fd5c6a43ee75509d85214221a8efb061c012b0fca8982f51c78576 test-bench-deps: bytestring: -any split: -any base: -any containers: -any maintainer: hildenjohannes@gmail.com synopsis: Hashids generates short, unique, non-sequential ids from numbers. changelog: '' basic-deps: bytestring: -any split: -any base: ==4.* containers: -any all-versions: - '1.0.2' - '1.0.2.1' - '1.0.2.2' - '1.0.2.3' + - '1.0.2.4' author: Johannes Hildén - latest: '1.0.2.3' ? ^ + latest: '1.0.2.4' ? ^ description-type: haddock description: This is a Haskell port of the Hashids library. It is typically used to encode numbers to a format suitable to appear in visible places like urls. It converts numbers like 347 into strings like yr8, or a list of numbers like [27, 986] into 3kTMd. You can also decode those ids back. This is useful in bundling several parameters into one. license-name: MIT
5
0.166667
3
2
c464fd0cd0845b3545a3440c311297f54aaceacf
.travis.yml
.travis.yml
language: java script: ant -buildfile Source/build.xml test
language: java script: ant -buildfile Source/build.xml test sudo: false addons: apt: packages: - oracle-java8-installer
Upgrade to correct java compiler
Upgrade to correct java compiler
YAML
mit
MauernChu/P7_Group3
yaml
## Code Before: language: java script: ant -buildfile Source/build.xml test ## Instruction: Upgrade to correct java compiler ## Code After: language: java script: ant -buildfile Source/build.xml test sudo: false addons: apt: packages: - oracle-java8-installer
language: java script: ant -buildfile Source/build.xml test + sudo: false + addons: + apt: + packages: + - oracle-java8-installer
5
2.5
5
0
81b8bbbacd2ce95af1cdd542b902783e89a60297
tasks/dependencies.yml
tasks/dependencies.yml
--- # --------------------------------------------- # Install other dependencies # --------------------------------------------- - name: install dependencies | Debian package: pkg: "{{ item }}" update_cache: yes cache_valid_time: 86400 state: present with_items: - gcc - make - openssl - libssl-dev - libffi-dev - unixodbc-dev when: ansible_os_family == "Debian" - name: install dependencies | RedHat package: name: "{{ item }}" state: present with_items: - gcc - make - openssl - openssl-devel - libffi-devel - libxml2-devel - libxslt-devel - postgresql-devel - unixODBC-devel when: ansible_os_family == "RedHat"
--- # --------------------------------------------- # Install other dependencies # --------------------------------------------- - name: install dependencies | Debian package: pkg: "{{ item }}" update_cache: yes cache_valid_time: 86400 state: present with_items: - gcc - g++ - make - openssl - libssl-dev - libffi-dev - unixodbc-dev when: ansible_os_family == "Debian" - name: install dependencies | RedHat package: name: "{{ item }}" state: present with_items: - gcc - gcc-c++ - make - openssl - openssl-devel - libffi-devel - libxml2-devel - libxslt-devel - postgresql-devel - unixODBC-devel when: ansible_os_family == "RedHat"
Add g++ to dependency (required for pyodbc python package)
Add g++ to dependency (required for pyodbc python package)
YAML
mit
miarec/ansible-role-miarecweb
yaml
## Code Before: --- # --------------------------------------------- # Install other dependencies # --------------------------------------------- - name: install dependencies | Debian package: pkg: "{{ item }}" update_cache: yes cache_valid_time: 86400 state: present with_items: - gcc - make - openssl - libssl-dev - libffi-dev - unixodbc-dev when: ansible_os_family == "Debian" - name: install dependencies | RedHat package: name: "{{ item }}" state: present with_items: - gcc - make - openssl - openssl-devel - libffi-devel - libxml2-devel - libxslt-devel - postgresql-devel - unixODBC-devel when: ansible_os_family == "RedHat" ## Instruction: Add g++ to dependency (required for pyodbc python package) ## Code After: --- # --------------------------------------------- # Install other dependencies # --------------------------------------------- - name: install dependencies | Debian package: pkg: "{{ item }}" update_cache: yes cache_valid_time: 86400 state: present with_items: - gcc - g++ - make - openssl - libssl-dev - libffi-dev - unixodbc-dev when: ansible_os_family == "Debian" - name: install dependencies | RedHat package: name: "{{ item }}" state: present with_items: - gcc - gcc-c++ - make - openssl - openssl-devel - libffi-devel - libxml2-devel - libxslt-devel - postgresql-devel - unixODBC-devel when: ansible_os_family == "RedHat"
--- # --------------------------------------------- # Install other dependencies # --------------------------------------------- - name: install dependencies | Debian package: pkg: "{{ item }}" update_cache: yes cache_valid_time: 86400 state: present with_items: - gcc + - g++ - make - openssl - libssl-dev - libffi-dev - unixodbc-dev when: ansible_os_family == "Debian" - name: install dependencies | RedHat package: name: "{{ item }}" state: present with_items: - gcc + - gcc-c++ - make - openssl - openssl-devel - libffi-devel - libxml2-devel - libxslt-devel - postgresql-devel - unixODBC-devel when: ansible_os_family == "RedHat"
2
0.057143
2
0
870bd42fab2cf0af443c878757b00a91a23474b6
app/views/admin/auth/base.blade.php
app/views/admin/auth/base.blade.php
<!DOCTYPE html> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@lang('gorilla.app_name')</title> {{ HTML::style('static/css/normalize.css') }} {{ HTML::style('static/css/foundation.min.css') }} {{ HTML::style('static/css/admin.css') }} {{ HTML::script('static/js/modernizr.min.js') }} </head> <body id="auth"> <div class="row"> <div class="large-4 large-centered columns"> <h1 class="gorilla text-center">@lang('gorilla.app_name')</h1> @yield('content') </div> </div> <!-- scripts --> {{ HTML::script('static/js/jquery.min.js') }} {{ HTML::script('static/js/plugins/foundation/foundation.min.js') }} {{ HTML::script('static/js/plugins/placeholder/jquery.placeholder.min.js') }} {{ HTML::script('static/js/admin.js') }} @yield('bottom_scripts') </body> </html>
<!DOCTYPE html> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@lang('gorilla.app_name')</title> {{ HTML::style('static/css/normalize.css') }} {{ HTML::style('static/css/plugins/foundation/foundation.min.css') }} {{ HTML::style('static/css/admin.css') }} {{ HTML::script('static/js/modernizr.min.js') }} </head> <body id="auth"> <div class="row"> <div class="large-4 large-centered columns"> <h1 class="gorilla text-center">@lang('gorilla.app_name')</h1> @yield('content') </div> </div> <!-- scripts --> {{ HTML::script('static/js/jquery.min.js') }} {{ HTML::script('static/js/plugins/foundation/foundation.min.js') }} {{ HTML::script('static/js/plugins/placeholder/jquery.placeholder.min.js') }} {{ HTML::script('static/js/admin.js') }} @yield('bottom_scripts') </body> </html>
Fix inclusione css foundation dopo lo spostamento
Fix inclusione css foundation dopo lo spostamento
PHP
mit
billmn/gorilla,billmn/gorilla,billmn/gorilla
php
## Code Before: <!DOCTYPE html> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@lang('gorilla.app_name')</title> {{ HTML::style('static/css/normalize.css') }} {{ HTML::style('static/css/foundation.min.css') }} {{ HTML::style('static/css/admin.css') }} {{ HTML::script('static/js/modernizr.min.js') }} </head> <body id="auth"> <div class="row"> <div class="large-4 large-centered columns"> <h1 class="gorilla text-center">@lang('gorilla.app_name')</h1> @yield('content') </div> </div> <!-- scripts --> {{ HTML::script('static/js/jquery.min.js') }} {{ HTML::script('static/js/plugins/foundation/foundation.min.js') }} {{ HTML::script('static/js/plugins/placeholder/jquery.placeholder.min.js') }} {{ HTML::script('static/js/admin.js') }} @yield('bottom_scripts') </body> </html> ## Instruction: Fix inclusione css foundation dopo lo spostamento ## Code After: <!DOCTYPE html> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@lang('gorilla.app_name')</title> {{ HTML::style('static/css/normalize.css') }} {{ HTML::style('static/css/plugins/foundation/foundation.min.css') }} {{ HTML::style('static/css/admin.css') }} {{ HTML::script('static/js/modernizr.min.js') }} </head> <body id="auth"> <div class="row"> <div class="large-4 large-centered columns"> <h1 class="gorilla text-center">@lang('gorilla.app_name')</h1> @yield('content') </div> </div> <!-- scripts --> {{ HTML::script('static/js/jquery.min.js') }} {{ HTML::script('static/js/plugins/foundation/foundation.min.js') }} {{ HTML::script('static/js/plugins/placeholder/jquery.placeholder.min.js') }} {{ HTML::script('static/js/admin.js') }} @yield('bottom_scripts') </body> </html>
<!DOCTYPE html> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@lang('gorilla.app_name')</title> {{ HTML::style('static/css/normalize.css') }} - {{ HTML::style('static/css/foundation.min.css') }} + {{ HTML::style('static/css/plugins/foundation/foundation.min.css') }} ? +++++++++++++++++++ {{ HTML::style('static/css/admin.css') }} {{ HTML::script('static/js/modernizr.min.js') }} </head> <body id="auth"> <div class="row"> <div class="large-4 large-centered columns"> <h1 class="gorilla text-center">@lang('gorilla.app_name')</h1> @yield('content') </div> </div> <!-- scripts --> {{ HTML::script('static/js/jquery.min.js') }} {{ HTML::script('static/js/plugins/foundation/foundation.min.js') }} {{ HTML::script('static/js/plugins/placeholder/jquery.placeholder.min.js') }} {{ HTML::script('static/js/admin.js') }} @yield('bottom_scripts') </body> </html>
2
0.0625
1
1
b4ebcb2161c00311af61a8f9d393c3aa90a1d70a
app/views/layouts/application.html.erb
app/views/layouts/application.html.erb
<% content_for :head do %> <%= stylesheet_link_tag "application", media: "all" %> <%= javascript_include_tag 'application' %> <% end %> <% content_for :navbar_items do %> <li class='<%= active_navigation_item == 'taxons' ? 'active' : nil %>'> <%= link_to 'Taxons', taxons_path %> </li> <% end %> <%= render template: 'layouts/govuk_admin_template' %>
<% content_for :head do %> <%= stylesheet_link_tag "application", media: "all" %> <%= javascript_include_tag 'application' %> <% end %> <% content_for :navbar_items do %> <li class='<%= active_navigation_item == 'lookup' ? 'active' : nil %>'> <%= link_to 'Tags', lookup_path %> </li> <li class='<%= active_navigation_item == 'taxons' ? 'active' : nil %>'> <%= link_to 'Taxons', taxons_path %> </li> <% end %> <%= render template: 'layouts/govuk_admin_template' %>
Include Tags (lookups) in the nav bar
Include Tags (lookups) in the nav bar Now that we have both tags and taxons, we should have both in the nav bar.
HTML+ERB
mit
alphagov/content-tagger,alphagov/content-tagger,alphagov/content-tagger
html+erb
## Code Before: <% content_for :head do %> <%= stylesheet_link_tag "application", media: "all" %> <%= javascript_include_tag 'application' %> <% end %> <% content_for :navbar_items do %> <li class='<%= active_navigation_item == 'taxons' ? 'active' : nil %>'> <%= link_to 'Taxons', taxons_path %> </li> <% end %> <%= render template: 'layouts/govuk_admin_template' %> ## Instruction: Include Tags (lookups) in the nav bar Now that we have both tags and taxons, we should have both in the nav bar. ## Code After: <% content_for :head do %> <%= stylesheet_link_tag "application", media: "all" %> <%= javascript_include_tag 'application' %> <% end %> <% content_for :navbar_items do %> <li class='<%= active_navigation_item == 'lookup' ? 'active' : nil %>'> <%= link_to 'Tags', lookup_path %> </li> <li class='<%= active_navigation_item == 'taxons' ? 'active' : nil %>'> <%= link_to 'Taxons', taxons_path %> </li> <% end %> <%= render template: 'layouts/govuk_admin_template' %>
<% content_for :head do %> <%= stylesheet_link_tag "application", media: "all" %> <%= javascript_include_tag 'application' %> <% end %> <% content_for :navbar_items do %> + <li class='<%= active_navigation_item == 'lookup' ? 'active' : nil %>'> + <%= link_to 'Tags', lookup_path %> + </li> <li class='<%= active_navigation_item == 'taxons' ? 'active' : nil %>'> <%= link_to 'Taxons', taxons_path %> </li> <% end %> <%= render template: 'layouts/govuk_admin_template' %>
3
0.25
3
0
80215a593c2fdcf0a0ae8b1c61c4342faffd6dac
run.py
run.py
import bb2gh import time config_yaml = 'config.yaml' for issue_id in range(1, 500): while True: try: bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id]) except Exception as inst: print 'issue_id',issue_id print type(inst) print inst.data['message'] print 'waiting for 60 seconds' print time.sleep(60) else: break
import bb2gh import time config_yaml = 'config.yaml' for issue_id in range(190, 500): while True: try: bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id]) except Exception as inst: print 'issue_id',issue_id print type(inst) print inst print 'waiting for 60 seconds' print time.sleep(60) else: break
Fix bug, 'message' key throwing error.
Fix bug, 'message' key throwing error.
Python
mit
wd15/bb2gh
python
## Code Before: import bb2gh import time config_yaml = 'config.yaml' for issue_id in range(1, 500): while True: try: bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id]) except Exception as inst: print 'issue_id',issue_id print type(inst) print inst.data['message'] print 'waiting for 60 seconds' print time.sleep(60) else: break ## Instruction: Fix bug, 'message' key throwing error. ## Code After: import bb2gh import time config_yaml = 'config.yaml' for issue_id in range(190, 500): while True: try: bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id]) except Exception as inst: print 'issue_id',issue_id print type(inst) print inst print 'waiting for 60 seconds' print time.sleep(60) else: break
import bb2gh import time config_yaml = 'config.yaml' - for issue_id in range(1, 500): + for issue_id in range(190, 500): ? ++ while True: try: bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id]) except Exception as inst: print 'issue_id',issue_id print type(inst) - print inst.data['message'] + print inst print 'waiting for 60 seconds' print time.sleep(60) else: break
4
0.2
2
2
9db8d6d4e5f804de5bec99463e2e96a64e628003
README.md
README.md
Go library for extracting and summarizing colours from websites. Its main purpose is decorating links and bookmarks with the general colour theme of the target URL. Decoration means: - Create SVG symbols from a websites colour theme. - Extract the dominant or *interesting* colour for highlighting links. **Godoc [documentation](https://godoc.org/github.com/nochso/colourl) including examples.**
Go library for extracting and summarizing colours from websites. Its main purpose is decorating links and bookmarks with the general colour theme of the target URL. Decoration means: - Create SVG symbols from a websites colour theme. - Extract the dominant or *interesting* colour for highlighting links.
Add godoc and goreportcard badges
Add godoc and goreportcard badges
Markdown
mit
nochso/colourl,nochso/colourl
markdown
## Code Before: Go library for extracting and summarizing colours from websites. Its main purpose is decorating links and bookmarks with the general colour theme of the target URL. Decoration means: - Create SVG symbols from a websites colour theme. - Extract the dominant or *interesting* colour for highlighting links. **Godoc [documentation](https://godoc.org/github.com/nochso/colourl) including examples.** ## Instruction: Add godoc and goreportcard badges ## Code After: Go library for extracting and summarizing colours from websites. Its main purpose is decorating links and bookmarks with the general colour theme of the target URL. Decoration means: - Create SVG symbols from a websites colour theme. - Extract the dominant or *interesting* colour for highlighting links.
Go library for extracting and summarizing colours from websites. Its main purpose is decorating links and bookmarks with the general colour theme of the target URL. Decoration means: - Create SVG symbols from a websites colour theme. - Extract the dominant or *interesting* colour for highlighting links. - - **Godoc [documentation](https://godoc.org/github.com/nochso/colourl) including examples.**
2
0.2
0
2
25301f547f1d3a07f12281ebf3de9f9c5cfd9b35
.travis.yml
.travis.yml
language: python python: - "2.7" - "3.3" - "3.4" services: mysql env: - DJANGO="django==1.8.2" - DJANGO="django==1.7.8" - DJANGO="django==1.6.10" - DJANGO="django==1.5.12" install: - pip install $DJANGO - pip install celery==3.1.18 - pip install django-celery==3.1.16 - pip install coveralls before_script: - mysql -e 'create database testdb;' script: - coverage run --source=djcelery_transactions runtests.py - coverage run --source=djcelery_transactions runtests-djcelery.py after_success: coveralls notifications: email: recipients: - nicolas.grasset@gmail.com on_success: change on_failure: change
language: python python: - "2.7" - "3.3" - "3.4" services: mysql env: - DJANGO="django==1.8.2" - DJANGO="django==1.7.8" - DJANGO="django==1.6.10" install: - pip install $DJANGO - pip install celery==3.1.18 - pip install django-celery==3.1.16 - pip install coveralls before_script: - mysql -e 'create database testdb;' script: - coverage run --source=djcelery_transactions runtests.py - coverage run --source=djcelery_transactions runtests-djcelery.py after_success: coveralls notifications: email: recipients: - nicolas.grasset@gmail.com on_success: change on_failure: change
Drop test support for Django 1.5
pkg: Drop test support for Django 1.5
YAML
bsd-2-clause
stored/django-celery-transactions,fellowshipofone/django-celery-transactions
yaml
## Code Before: language: python python: - "2.7" - "3.3" - "3.4" services: mysql env: - DJANGO="django==1.8.2" - DJANGO="django==1.7.8" - DJANGO="django==1.6.10" - DJANGO="django==1.5.12" install: - pip install $DJANGO - pip install celery==3.1.18 - pip install django-celery==3.1.16 - pip install coveralls before_script: - mysql -e 'create database testdb;' script: - coverage run --source=djcelery_transactions runtests.py - coverage run --source=djcelery_transactions runtests-djcelery.py after_success: coveralls notifications: email: recipients: - nicolas.grasset@gmail.com on_success: change on_failure: change ## Instruction: pkg: Drop test support for Django 1.5 ## Code After: language: python python: - "2.7" - "3.3" - "3.4" services: mysql env: - DJANGO="django==1.8.2" - DJANGO="django==1.7.8" - DJANGO="django==1.6.10" install: - pip install $DJANGO - pip install celery==3.1.18 - pip install django-celery==3.1.16 - pip install coveralls before_script: - mysql -e 'create database testdb;' script: - coverage run --source=djcelery_transactions runtests.py - coverage run --source=djcelery_transactions runtests-djcelery.py after_success: coveralls notifications: email: recipients: - nicolas.grasset@gmail.com on_success: change on_failure: change
language: python python: - "2.7" - "3.3" - "3.4" services: mysql env: - DJANGO="django==1.8.2" - DJANGO="django==1.7.8" - DJANGO="django==1.6.10" - - DJANGO="django==1.5.12" install: - pip install $DJANGO - pip install celery==3.1.18 - pip install django-celery==3.1.16 - pip install coveralls before_script: - mysql -e 'create database testdb;' script: - coverage run --source=djcelery_transactions runtests.py - coverage run --source=djcelery_transactions runtests-djcelery.py after_success: coveralls notifications: email: recipients: - nicolas.grasset@gmail.com on_success: change on_failure: change
1
0.027027
0
1
ca0d366d4520414ed516a98cb9bfa4c48a956cf8
.travis.yml
.travis.yml
language: node_js node_js: - "0.12" - "iojs"
language: node_js node_js: - '0.12' - iojs deploy: provider: npm email: andrew@wizardapps.net api_key: secure: OnWemmnzHTatC11Z3zJvqXMI/hUrW6GQjS/VuWUuunT76FhkXOsYeXWohh6USW5hEdcVTrMQI/xv68OdFxT1wMYUjFmpffk7w1JEgRTxxEptbsf0ugVoanEP9R1Be4dBEVIMlCLlqvlgSITFJbSLCV4ACMN+wJlWytGhziDv6C25eMmc22Hp2KWpYSHpove+W+5JtW866D2VmYovBp/kYuujpxnEHgHGUZ/OWF2YJSHnCwEEA6Tolj6nz6vdA2HKv5T+rxWqs/uh9cg3fRrnIObhSUvhDAhOiXBd7eZ4SyPZLBd+glBHnaHIWmxIcXLZUvFWI+j6ZsGksCRqanEKLY7k3KwhS8Gy7rekW/8zl4qvS9WNUSiPPxd14xMCUtjEYhNQDqBQzFZlIi0D/t/hKZ5YYF2gDr4HeIl1nNc1PRPn+NzGNTK6IqQ+BHGrUeGsPxWv8tVxQTupcXFF2wFdDAA1eLcY8m0SZbwduQGi5TCUwjRBSItM+K3BU9g2k2Fm+H4fObJaEQqeyYnDSCcVlcc22c+PrefTsauT51ihAFpi8kHWYGJH393j6qTxQ5jjQf0q3s7ygt+IcsXPCBpqzYXGJ9bcWKv0XhBb8+Oxn44LtLkeJI8g7Qcn2oNu6Kv2PK6Tt6uHOawdkbnajy+l5EemD7kfW0oNl3+5Q9c7c/o= on: tags: true repo: andrewmunsell/needlepoint
Add NPM deployment to Travis CI
Add NPM deployment to Travis CI
YAML
mit
andrewmunsell/needlepoint
yaml
## Code Before: language: node_js node_js: - "0.12" - "iojs" ## Instruction: Add NPM deployment to Travis CI ## Code After: language: node_js node_js: - '0.12' - iojs deploy: provider: npm email: andrew@wizardapps.net api_key: secure: OnWemmnzHTatC11Z3zJvqXMI/hUrW6GQjS/VuWUuunT76FhkXOsYeXWohh6USW5hEdcVTrMQI/xv68OdFxT1wMYUjFmpffk7w1JEgRTxxEptbsf0ugVoanEP9R1Be4dBEVIMlCLlqvlgSITFJbSLCV4ACMN+wJlWytGhziDv6C25eMmc22Hp2KWpYSHpove+W+5JtW866D2VmYovBp/kYuujpxnEHgHGUZ/OWF2YJSHnCwEEA6Tolj6nz6vdA2HKv5T+rxWqs/uh9cg3fRrnIObhSUvhDAhOiXBd7eZ4SyPZLBd+glBHnaHIWmxIcXLZUvFWI+j6ZsGksCRqanEKLY7k3KwhS8Gy7rekW/8zl4qvS9WNUSiPPxd14xMCUtjEYhNQDqBQzFZlIi0D/t/hKZ5YYF2gDr4HeIl1nNc1PRPn+NzGNTK6IqQ+BHGrUeGsPxWv8tVxQTupcXFF2wFdDAA1eLcY8m0SZbwduQGi5TCUwjRBSItM+K3BU9g2k2Fm+H4fObJaEQqeyYnDSCcVlcc22c+PrefTsauT51ihAFpi8kHWYGJH393j6qTxQ5jjQf0q3s7ygt+IcsXPCBpqzYXGJ9bcWKv0XhBb8+Oxn44LtLkeJI8g7Qcn2oNu6Kv2PK6Tt6uHOawdkbnajy+l5EemD7kfW0oNl3+5Q9c7c/o= on: tags: true repo: andrewmunsell/needlepoint
language: node_js node_js: - - "0.12" + - '0.12' - - "iojs" ? -- - - + - iojs + deploy: + provider: npm + email: andrew@wizardapps.net + api_key: + secure: OnWemmnzHTatC11Z3zJvqXMI/hUrW6GQjS/VuWUuunT76FhkXOsYeXWohh6USW5hEdcVTrMQI/xv68OdFxT1wMYUjFmpffk7w1JEgRTxxEptbsf0ugVoanEP9R1Be4dBEVIMlCLlqvlgSITFJbSLCV4ACMN+wJlWytGhziDv6C25eMmc22Hp2KWpYSHpove+W+5JtW866D2VmYovBp/kYuujpxnEHgHGUZ/OWF2YJSHnCwEEA6Tolj6nz6vdA2HKv5T+rxWqs/uh9cg3fRrnIObhSUvhDAhOiXBd7eZ4SyPZLBd+glBHnaHIWmxIcXLZUvFWI+j6ZsGksCRqanEKLY7k3KwhS8Gy7rekW/8zl4qvS9WNUSiPPxd14xMCUtjEYhNQDqBQzFZlIi0D/t/hKZ5YYF2gDr4HeIl1nNc1PRPn+NzGNTK6IqQ+BHGrUeGsPxWv8tVxQTupcXFF2wFdDAA1eLcY8m0SZbwduQGi5TCUwjRBSItM+K3BU9g2k2Fm+H4fObJaEQqeyYnDSCcVlcc22c+PrefTsauT51ihAFpi8kHWYGJH393j6qTxQ5jjQf0q3s7ygt+IcsXPCBpqzYXGJ9bcWKv0XhBb8+Oxn44LtLkeJI8g7Qcn2oNu6Kv2PK6Tt6uHOawdkbnajy+l5EemD7kfW0oNl3+5Q9c7c/o= + on: + tags: true + repo: andrewmunsell/needlepoint
12
3
10
2
849b9d3e30a362bcb53e599c066f65296cfde0fe
src/models/rules.js
src/models/rules.js
'use strict' const ElectronConfig = require('electron-config') const storage = new ElectronConfig() const rulesStorageKey = 'rules' class Rules { static findAll() { if (storage.has(rulesStorageKey)) { return storage.get(rulesStorageKey) } return [] } static addKey(ruleKey) { const existingRules = this.findAll() const newRules = existingRules if (newRules.indexOf(ruleKey) < 0) { newRules.push(ruleKey) } storage.set(rulesStorageKey, newRules) return newRules } } module.exports = Rules
'use strict' const ElectronConfig = require('electron-config') const storage = new ElectronConfig() const rulesStorageKey = 'rules' class Rules { static findAll() { if (storage.has(rulesStorageKey)) { return storage.get(rulesStorageKey) } return [] } static addKey(ruleKey) { const existingRules = this.findAll() const newRules = existingRules if (newRules.indexOf(ruleKey) < 0) { newRules.push(ruleKey) } storage.set(rulesStorageKey, newRules) return newRules } static deleteKey(ruleKey) { const existingRules = this.findAll() const index = existingRules.indexOf(ruleKey) const newRules = existingRules.slice(0, index). concat(existingRules.slice(index + 1)) storage.set(rulesStorageKey, newRules) return newRules } } module.exports = Rules
Add deleteKey to Rules model
Add deleteKey to Rules model
JavaScript
mit
cheshire137/gh-notifications-snoozer,cheshire137/gh-notifications-snoozer
javascript
## Code Before: 'use strict' const ElectronConfig = require('electron-config') const storage = new ElectronConfig() const rulesStorageKey = 'rules' class Rules { static findAll() { if (storage.has(rulesStorageKey)) { return storage.get(rulesStorageKey) } return [] } static addKey(ruleKey) { const existingRules = this.findAll() const newRules = existingRules if (newRules.indexOf(ruleKey) < 0) { newRules.push(ruleKey) } storage.set(rulesStorageKey, newRules) return newRules } } module.exports = Rules ## Instruction: Add deleteKey to Rules model ## Code After: 'use strict' const ElectronConfig = require('electron-config') const storage = new ElectronConfig() const rulesStorageKey = 'rules' class Rules { static findAll() { if (storage.has(rulesStorageKey)) { return storage.get(rulesStorageKey) } return [] } static addKey(ruleKey) { const existingRules = this.findAll() const newRules = existingRules if (newRules.indexOf(ruleKey) < 0) { newRules.push(ruleKey) } storage.set(rulesStorageKey, newRules) return newRules } static deleteKey(ruleKey) { const existingRules = this.findAll() const index = existingRules.indexOf(ruleKey) const newRules = existingRules.slice(0, index). concat(existingRules.slice(index + 1)) storage.set(rulesStorageKey, newRules) return newRules } } module.exports = Rules
'use strict' const ElectronConfig = require('electron-config') const storage = new ElectronConfig() const rulesStorageKey = 'rules' class Rules { static findAll() { if (storage.has(rulesStorageKey)) { return storage.get(rulesStorageKey) } return [] } static addKey(ruleKey) { const existingRules = this.findAll() const newRules = existingRules if (newRules.indexOf(ruleKey) < 0) { newRules.push(ruleKey) } storage.set(rulesStorageKey, newRules) return newRules } + + static deleteKey(ruleKey) { + const existingRules = this.findAll() + const index = existingRules.indexOf(ruleKey) + const newRules = existingRules.slice(0, index). + concat(existingRules.slice(index + 1)) + storage.set(rulesStorageKey, newRules) + return newRules + } } module.exports = Rules
9
0.346154
9
0
c14731fb7399df2dafdc4fd4b5c66cd5d73fe7e8
import-tests.sh
import-tests.sh
USER=deploy DATABASE=dds NOW=$(date +"%F-%H-%M-%S") DISTANT_DUMP_FOLDER="~/dumps/dump-$NOW" LATEST_DUMP_SYMLINK='dump-latest' LOCAL_DUMP_FOLDER='./dump' cd `dirname $0` read -n 1 -p "Are you POSITIVE you want to replace ALL contents of the $DATABASE database with contents from the $USER one? [y/N]" sure if [[ $sure != 'y' ]] then echo 'Cancelled' exit 1 fi ssh $USER@sgmap.fr "mongodump --db $DATABASE && mv dump $DISTANT_DUMP_FOLDER && rm $LATEST_DUMP_SYMLINK && ln -s $DIR_NAME $LATEST_DUMP_SYMLINK" && rm -rf $LOCAL_DUMP_FOLDER && scp -r $USER@sgmap.fr:$DISTANT_DUMP_FOLDER/$DATABASE $LOCAL_DUMP_FOLDER && mongorestore --drop --db $DATABASE $LOCAL_DUMP_FOLDER
USER=deploy DATABASE=dds NOW=$(date +"%F-%H-%M-%S") DISTANT_DUMP_FOLDER="~/dumps/dump-$NOW" LOCAL_DUMP_FOLDER='./dump' cd `dirname $0` read -n 1 -p "Are you POSITIVE you want to replace ALL contents of the $DATABASE database with contents from the $USER one? [y/N]" sure if [[ $sure != 'y' ]] then echo 'Cancelled' exit 1 fi ssh $USER@sgmap.fr "mongodump --db $DATABASE && mv dump $DISTANT_DUMP_FOLDER && gzip -rv $DISTANT_DUMP_FOLDER" && rm -rf $LOCAL_DUMP_FOLDER && scp -r $USER@sgmap.fr:$DISTANT_DUMP_FOLDER/$DATABASE $LOCAL_DUMP_FOLDER && gunzip -r $LOCAL_DUMP_FOLDER && mongorestore --drop --db $DATABASE $LOCAL_DUMP_FOLDER
Compress dumps over the wire
Compress dumps over the wire Decrease tests import duration by 10x Stop using dump-latest symlink (annoying for recursive compression, no current benefits)
Shell
agpl-3.0
sgmap/mes-aides-ui,sgmap/mes-aides-ui,sgmap/mes-aides-ui,sgmap/mes-aides-ui
shell
## Code Before: USER=deploy DATABASE=dds NOW=$(date +"%F-%H-%M-%S") DISTANT_DUMP_FOLDER="~/dumps/dump-$NOW" LATEST_DUMP_SYMLINK='dump-latest' LOCAL_DUMP_FOLDER='./dump' cd `dirname $0` read -n 1 -p "Are you POSITIVE you want to replace ALL contents of the $DATABASE database with contents from the $USER one? [y/N]" sure if [[ $sure != 'y' ]] then echo 'Cancelled' exit 1 fi ssh $USER@sgmap.fr "mongodump --db $DATABASE && mv dump $DISTANT_DUMP_FOLDER && rm $LATEST_DUMP_SYMLINK && ln -s $DIR_NAME $LATEST_DUMP_SYMLINK" && rm -rf $LOCAL_DUMP_FOLDER && scp -r $USER@sgmap.fr:$DISTANT_DUMP_FOLDER/$DATABASE $LOCAL_DUMP_FOLDER && mongorestore --drop --db $DATABASE $LOCAL_DUMP_FOLDER ## Instruction: Compress dumps over the wire Decrease tests import duration by 10x Stop using dump-latest symlink (annoying for recursive compression, no current benefits) ## Code After: USER=deploy DATABASE=dds NOW=$(date +"%F-%H-%M-%S") DISTANT_DUMP_FOLDER="~/dumps/dump-$NOW" LOCAL_DUMP_FOLDER='./dump' cd `dirname $0` read -n 1 -p "Are you POSITIVE you want to replace ALL contents of the $DATABASE database with contents from the $USER one? [y/N]" sure if [[ $sure != 'y' ]] then echo 'Cancelled' exit 1 fi ssh $USER@sgmap.fr "mongodump --db $DATABASE && mv dump $DISTANT_DUMP_FOLDER && gzip -rv $DISTANT_DUMP_FOLDER" && rm -rf $LOCAL_DUMP_FOLDER && scp -r $USER@sgmap.fr:$DISTANT_DUMP_FOLDER/$DATABASE $LOCAL_DUMP_FOLDER && gunzip -r $LOCAL_DUMP_FOLDER && mongorestore --drop --db $DATABASE $LOCAL_DUMP_FOLDER
USER=deploy DATABASE=dds NOW=$(date +"%F-%H-%M-%S") DISTANT_DUMP_FOLDER="~/dumps/dump-$NOW" - LATEST_DUMP_SYMLINK='dump-latest' LOCAL_DUMP_FOLDER='./dump' cd `dirname $0` read -n 1 -p "Are you POSITIVE you want to replace ALL contents of the $DATABASE database with contents from the $USER one? [y/N]" sure if [[ $sure != 'y' ]] then echo 'Cancelled' exit 1 fi - ssh $USER@sgmap.fr "mongodump --db $DATABASE && mv dump $DISTANT_DUMP_FOLDER && rm $LATEST_DUMP_SYMLINK && ln -s $DIR_NAME $LATEST_DUMP_SYMLINK" && ? ^ ^ ^^^ ^^^ -------------- ^ -------------------------- + ssh $USER@sgmap.fr "mongodump --db $DATABASE && mv dump $DISTANT_DUMP_FOLDER && gzip -rv $DISTANT_DUMP_FOLDER" && ? ++++++ ^ ^^^^ ^ ^^ ^ rm -rf $LOCAL_DUMP_FOLDER && scp -r $USER@sgmap.fr:$DISTANT_DUMP_FOLDER/$DATABASE $LOCAL_DUMP_FOLDER && + gunzip -r $LOCAL_DUMP_FOLDER && mongorestore --drop --db $DATABASE $LOCAL_DUMP_FOLDER
4
0.16
2
2
f00146c7ccf7099dc7f85a8a0aa3a92b293b24d5
.mpv/share.sh
.mpv/share.sh
MPV_PID=$(ps axo '%p %c'|grep [m]pv$|awk '{print $1}') if [ "$(echo ${MPV_PID}|wc -w)" -ne 1 ] ; then echo "Error: too many mpv PIDs: \"${MPV_PID}\" ($(echo ${MPV_PID}|wc -w))" exit 1 fi IFS=' ' for F in $(lsof -p ${MPV_PID} -Ftn |grep -A1 ^tREG|grep ^n|sed 's/^n//g'); do if test -w "$F" ; then TMP_JSON=$(mktemp) exiftool -json "$F" > $TMP_JSON INFO=$(python <<EOF import json f=open('$TMP_JSON', 'r') obj=json.load(f) print('Hi, check out "' + obj[0]["Title"] + '" by ' + obj[0]['Artist'] + ".") EOF ) # Use zenity because the terminal cannot be controlled with mpv running. EMAIL=$(zenity --entry --title "Email to share with?" --text '') echo | mutt -s "$INFO" -- $EMAIL if [[ $? == 0 ]]; then echo "Successfully shared with '$EMAIL'." echo $INFO else echo "Failed to share with '$EMAIL'." echo $INFO fi fi done
function die() { echo $*; exit -1; } # On multiuser machines, output and grep on $USER too MPV_PID=$(ps axo '%p %c'|grep [m]pv$|awk '{print $1}') if [ "$(echo ${MPV_PID}|wc -w)" -ne 1 ] ; then echo "Error: too many mpv PIDs: \"${MPV_PID}\" ($(echo ${MPV_PID}|wc -w))" exit 1 fi IFS=' ' for F in $(lsof -p ${MPV_PID} -Ftn |grep -A1 ^tREG|grep ^n|sed 's/^n//g'); do if test -w "$F" ; then TMP_JSON=$(mktemp) exiftool -json "$F" > $TMP_JSON INFO=$(python <<EOF import json f=open('$TMP_JSON', 'r') obj=json.load(f) print('Hi, check out "' + obj[0]["Title"] + '" by ' + obj[0]['Artist'] + ".") EOF ) # Use zenity because the terminal cannot be controlled with mpv running. EMAIL=$(zenity --entry --title "Email to share with?" --text '') [[ -z $EMAIL ]] && die "Error: No email input." CONTENT=$(zenity --entry --title "Optional message body?" --text '') mutt -s "$INFO" -- $EMAIL<<EOF $CONTENT EOF if [[ $? == 0 ]]; then echo "Successfully shared with '$EMAIL'." else echo "Failed to share with '$EMAIL'."; fi echo $INFO fi done
Add content option when sharing.
mpv: Add content option when sharing.
Shell
mit
bamos/dotfiles,bamos/dotfiles,bamos/dotfiles
shell
## Code Before: MPV_PID=$(ps axo '%p %c'|grep [m]pv$|awk '{print $1}') if [ "$(echo ${MPV_PID}|wc -w)" -ne 1 ] ; then echo "Error: too many mpv PIDs: \"${MPV_PID}\" ($(echo ${MPV_PID}|wc -w))" exit 1 fi IFS=' ' for F in $(lsof -p ${MPV_PID} -Ftn |grep -A1 ^tREG|grep ^n|sed 's/^n//g'); do if test -w "$F" ; then TMP_JSON=$(mktemp) exiftool -json "$F" > $TMP_JSON INFO=$(python <<EOF import json f=open('$TMP_JSON', 'r') obj=json.load(f) print('Hi, check out "' + obj[0]["Title"] + '" by ' + obj[0]['Artist'] + ".") EOF ) # Use zenity because the terminal cannot be controlled with mpv running. EMAIL=$(zenity --entry --title "Email to share with?" --text '') echo | mutt -s "$INFO" -- $EMAIL if [[ $? == 0 ]]; then echo "Successfully shared with '$EMAIL'." echo $INFO else echo "Failed to share with '$EMAIL'." echo $INFO fi fi done ## Instruction: mpv: Add content option when sharing. ## Code After: function die() { echo $*; exit -1; } # On multiuser machines, output and grep on $USER too MPV_PID=$(ps axo '%p %c'|grep [m]pv$|awk '{print $1}') if [ "$(echo ${MPV_PID}|wc -w)" -ne 1 ] ; then echo "Error: too many mpv PIDs: \"${MPV_PID}\" ($(echo ${MPV_PID}|wc -w))" exit 1 fi IFS=' ' for F in $(lsof -p ${MPV_PID} -Ftn |grep -A1 ^tREG|grep ^n|sed 's/^n//g'); do if test -w "$F" ; then TMP_JSON=$(mktemp) exiftool -json "$F" > $TMP_JSON INFO=$(python <<EOF import json f=open('$TMP_JSON', 'r') obj=json.load(f) print('Hi, check out "' + obj[0]["Title"] + '" by ' + obj[0]['Artist'] + ".") EOF ) # Use zenity because the terminal cannot be controlled with mpv running. EMAIL=$(zenity --entry --title "Email to share with?" --text '') [[ -z $EMAIL ]] && die "Error: No email input." CONTENT=$(zenity --entry --title "Optional message body?" --text '') mutt -s "$INFO" -- $EMAIL<<EOF $CONTENT EOF if [[ $? == 0 ]]; then echo "Successfully shared with '$EMAIL'." else echo "Failed to share with '$EMAIL'."; fi echo $INFO fi done
+ + function die() { echo $*; exit -1; } + + # On multiuser machines, output and grep on $USER too MPV_PID=$(ps axo '%p %c'|grep [m]pv$|awk '{print $1}') if [ "$(echo ${MPV_PID}|wc -w)" -ne 1 ] ; then echo "Error: too many mpv PIDs: \"${MPV_PID}\" ($(echo ${MPV_PID}|wc -w))" exit 1 fi IFS=' ' for F in $(lsof -p ${MPV_PID} -Ftn |grep -A1 ^tREG|grep ^n|sed 's/^n//g'); do if test -w "$F" ; then TMP_JSON=$(mktemp) exiftool -json "$F" > $TMP_JSON INFO=$(python <<EOF import json f=open('$TMP_JSON', 'r') obj=json.load(f) print('Hi, check out "' + obj[0]["Title"] + '" by ' + obj[0]['Artist'] + ".") EOF ) # Use zenity because the terminal cannot be controlled with mpv running. EMAIL=$(zenity --entry --title "Email to share with?" --text '') + [[ -z $EMAIL ]] && die "Error: No email input." + CONTENT=$(zenity --entry --title "Optional message body?" --text '') - echo | mutt -s "$INFO" -- $EMAIL ? ------- + mutt -s "$INFO" -- $EMAIL<<EOF ? +++++ - if [[ $? == 0 ]]; then + $CONTENT + EOF - echo "Successfully shared with '$EMAIL'." + if [[ $? == 0 ]]; then echo "Successfully shared with '$EMAIL'." ? ++ +++++++++++++++++++ + else echo "Failed to share with '$EMAIL'."; fi - echo $INFO ? -- + echo $INFO - else - echo "Failed to share with '$EMAIL'." - echo $INFO - fi fi done
20
0.625
12
8
00cffc4197d393e6fc8d8031a4d1f8e78d5c532c
IPython/config/profile/pysh/ipython_config.py
IPython/config/profile/pysh/ipython_config.py
c = get_config() app = c.InteractiveShellApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. load_subconfig('ipython_config.py', profile='default') c.InteractiveShell.prompt_in1 = r'\C_LightGreen\u@\h\C_LightBlue[\C_LightCyan\Y1\C_LightBlue]\C_Green|\#> ' c.InteractiveShell.prompt_in2 = r'\C_Green|\C_LightGreen\D\C_Green> ' c.InteractiveShell.prompt_out = r'<\#> ' c.InteractiveShell.prompts_pad_left = True c.InteractiveShell.separate_in = '' c.InteractiveShell.separate_out = '' c.InteractiveShell.separate_out2 = '' c.PrefilterManager.multi_line_specials = True lines = """ %rehashx """ # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. if hasattr(app, 'exec_lines'): app.exec_lines.append(lines) else: app.exec_lines = [lines]
c = get_config() app = c.InteractiveShellApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. load_subconfig('ipython_config.py', profile='default') c.PromptManager.in_template = r'{color.LightGreen}\u@\h{color.LightBlue}[{color.LightCyan}\Y1{color.LightBlue}]{color.Green}|\#> ' c.PromptManager.in2_template = r'{color.Green}|{color.LightGreen}\D{color.Green}> ' c.PromptManager.out_template = r'<\#> ' c.PromptManager.justify = True c.InteractiveShell.separate_in = '' c.InteractiveShell.separate_out = '' c.InteractiveShell.separate_out2 = '' c.PrefilterManager.multi_line_specials = True lines = """ %rehashx """ # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. if hasattr(app, 'exec_lines'): app.exec_lines.append(lines) else: app.exec_lines = [lines]
Update prompt config for pysh profile.
Update prompt config for pysh profile.
Python
bsd-3-clause
ipython/ipython,ipython/ipython
python
## Code Before: c = get_config() app = c.InteractiveShellApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. load_subconfig('ipython_config.py', profile='default') c.InteractiveShell.prompt_in1 = r'\C_LightGreen\u@\h\C_LightBlue[\C_LightCyan\Y1\C_LightBlue]\C_Green|\#> ' c.InteractiveShell.prompt_in2 = r'\C_Green|\C_LightGreen\D\C_Green> ' c.InteractiveShell.prompt_out = r'<\#> ' c.InteractiveShell.prompts_pad_left = True c.InteractiveShell.separate_in = '' c.InteractiveShell.separate_out = '' c.InteractiveShell.separate_out2 = '' c.PrefilterManager.multi_line_specials = True lines = """ %rehashx """ # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. if hasattr(app, 'exec_lines'): app.exec_lines.append(lines) else: app.exec_lines = [lines] ## Instruction: Update prompt config for pysh profile. ## Code After: c = get_config() app = c.InteractiveShellApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. load_subconfig('ipython_config.py', profile='default') c.PromptManager.in_template = r'{color.LightGreen}\u@\h{color.LightBlue}[{color.LightCyan}\Y1{color.LightBlue}]{color.Green}|\#> ' c.PromptManager.in2_template = r'{color.Green}|{color.LightGreen}\D{color.Green}> ' c.PromptManager.out_template = r'<\#> ' c.PromptManager.justify = True c.InteractiveShell.separate_in = '' c.InteractiveShell.separate_out = '' c.InteractiveShell.separate_out2 = '' c.PrefilterManager.multi_line_specials = True lines = """ %rehashx """ # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. if hasattr(app, 'exec_lines'): app.exec_lines.append(lines) else: app.exec_lines = [lines]
c = get_config() app = c.InteractiveShellApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. load_subconfig('ipython_config.py', profile='default') - c.InteractiveShell.prompt_in1 = r'\C_LightGreen\u@\h\C_LightBlue[\C_LightCyan\Y1\C_LightBlue]\C_Green|\#> ' - c.InteractiveShell.prompt_in2 = r'\C_Green|\C_LightGreen\D\C_Green> ' - c.InteractiveShell.prompt_out = r'<\#> ' + c.PromptManager.in_template = r'{color.LightGreen}\u@\h{color.LightBlue}[{color.LightCyan}\Y1{color.LightBlue}]{color.Green}|\#> ' + c.PromptManager.in2_template = r'{color.Green}|{color.LightGreen}\D{color.Green}> ' + c.PromptManager.out_template = r'<\#> ' - c.InteractiveShell.prompts_pad_left = True + c.PromptManager.justify = True c.InteractiveShell.separate_in = '' c.InteractiveShell.separate_out = '' c.InteractiveShell.separate_out2 = '' c.PrefilterManager.multi_line_specials = True lines = """ %rehashx """ # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. if hasattr(app, 'exec_lines'): app.exec_lines.append(lines) else: app.exec_lines = [lines]
8
0.266667
4
4
ab77b5326ff5d0b49f53e718d8fd6380467665f5
src/main/java/com/cloudmine/api/rest/response/PaymentResponse.java
src/main/java/com/cloudmine/api/rest/response/PaymentResponse.java
package com.cloudmine.api.rest.response; import com.cloudmine.api.rest.response.code.PaymentCode; import org.apache.http.HttpResponse; /** * <br>Copyright CloudMine LLC. All rights reserved * <br> See LICENSE file included with SDK for details. */ public class PaymentResponse extends ResponseBase<PaymentCode> { protected PaymentResponse(HttpResponse response) { super(response); } public PaymentResponse(String messageBody, int statusCode) { super(messageBody, statusCode); } @Override public PaymentCode getResponseCode() { return PaymentCode.codeForStatus(getStatusCode()); } }
package com.cloudmine.api.rest.response; import com.cloudmine.api.CMCreditCard; import com.cloudmine.api.rest.response.code.PaymentCode; import org.apache.http.HttpResponse; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; /** * <br>Copyright CloudMine LLC. All rights reserved * <br> See LICENSE file included with SDK for details. */ public class PaymentResponse extends ResponseBase<PaymentCode> { private List<CMCreditCard> creditCards; protected PaymentResponse(HttpResponse response) { super(response); } public PaymentResponse(String messageBody, int statusCode) { super(messageBody, statusCode); } @Override public PaymentCode getResponseCode() { return PaymentCode.codeForStatus(getStatusCode()); } public List<CMCreditCard> getCreditCards() { if(creditCards == null) { creditCards = new ArrayList<CMCreditCard>(); Object cards = getObject("card"); if(cards instanceof Collection) { for(Object card : (Collection)cards) { if(card instanceof Map) { Map<String, String> cardMap = (Map<String, String>) card; String nameOnCard = cardMap.get("nameOnCard"); String token = cardMap.get("token"); String expirationDate = cardMap.get("expirationDate"); String last4Digits = cardMap.get("last4Digits"); String type = cardMap.get("type"); creditCards.add(new CMCreditCard(nameOnCard, token, expirationDate,last4Digits,type)); } } } } return creditCards; } }
Add seeing loaded cards to payment response
Add seeing loaded cards to payment response
Java
mit
cloudmine/cloudmine-javasdk,cloudmine/cloudmine-javasdk
java
## Code Before: package com.cloudmine.api.rest.response; import com.cloudmine.api.rest.response.code.PaymentCode; import org.apache.http.HttpResponse; /** * <br>Copyright CloudMine LLC. All rights reserved * <br> See LICENSE file included with SDK for details. */ public class PaymentResponse extends ResponseBase<PaymentCode> { protected PaymentResponse(HttpResponse response) { super(response); } public PaymentResponse(String messageBody, int statusCode) { super(messageBody, statusCode); } @Override public PaymentCode getResponseCode() { return PaymentCode.codeForStatus(getStatusCode()); } } ## Instruction: Add seeing loaded cards to payment response ## Code After: package com.cloudmine.api.rest.response; import com.cloudmine.api.CMCreditCard; import com.cloudmine.api.rest.response.code.PaymentCode; import org.apache.http.HttpResponse; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; /** * <br>Copyright CloudMine LLC. All rights reserved * <br> See LICENSE file included with SDK for details. */ public class PaymentResponse extends ResponseBase<PaymentCode> { private List<CMCreditCard> creditCards; protected PaymentResponse(HttpResponse response) { super(response); } public PaymentResponse(String messageBody, int statusCode) { super(messageBody, statusCode); } @Override public PaymentCode getResponseCode() { return PaymentCode.codeForStatus(getStatusCode()); } public List<CMCreditCard> getCreditCards() { if(creditCards == null) { creditCards = new ArrayList<CMCreditCard>(); Object cards = getObject("card"); if(cards instanceof Collection) { for(Object card : (Collection)cards) { if(card instanceof Map) { Map<String, String> cardMap = (Map<String, String>) card; String nameOnCard = cardMap.get("nameOnCard"); String token = cardMap.get("token"); String expirationDate = cardMap.get("expirationDate"); String last4Digits = cardMap.get("last4Digits"); String type = cardMap.get("type"); creditCards.add(new CMCreditCard(nameOnCard, token, expirationDate,last4Digits,type)); } } } } return creditCards; } }
package com.cloudmine.api.rest.response; + import com.cloudmine.api.CMCreditCard; import com.cloudmine.api.rest.response.code.PaymentCode; import org.apache.http.HttpResponse; + + import java.util.ArrayList; + import java.util.Collection; + import java.util.List; + import java.util.Map; /** * <br>Copyright CloudMine LLC. All rights reserved * <br> See LICENSE file included with SDK for details. */ public class PaymentResponse extends ResponseBase<PaymentCode> { + + private List<CMCreditCard> creditCards; + protected PaymentResponse(HttpResponse response) { super(response); } public PaymentResponse(String messageBody, int statusCode) { super(messageBody, statusCode); } @Override public PaymentCode getResponseCode() { return PaymentCode.codeForStatus(getStatusCode()); } + + public List<CMCreditCard> getCreditCards() { + if(creditCards == null) { + creditCards = new ArrayList<CMCreditCard>(); + Object cards = getObject("card"); + if(cards instanceof Collection) { + for(Object card : (Collection)cards) { + if(card instanceof Map) { + Map<String, String> cardMap = (Map<String, String>) card; + String nameOnCard = cardMap.get("nameOnCard"); + String token = cardMap.get("token"); + String expirationDate = cardMap.get("expirationDate"); + String last4Digits = cardMap.get("last4Digits"); + String type = cardMap.get("type"); + creditCards.add(new CMCreditCard(nameOnCard, token, expirationDate,last4Digits,type)); + } + } + } + } + return creditCards; + } }
30
1.304348
30
0
f8c963528d6d39ab04626205e0b46d68f4d146e8
README.md
README.md
babyfood ======== [![Build Status](https://travis-ci.org/meawoppl/babyfood.svg?branch=master)](https://travis-ci.org/meawoppl/babyfood) Tools for the generation of Gerber files. XLN Drill files, and PCB's based on these primitives. Coming soon: 1. Design rules 2. IPC Compliant footprints 3. Design optimization GerberWriter Limitations: 1. Does not check polygon legitimacy (complicated!) 2. Does not check for polygon closure wrt. to file precision, only exact values Next steps: 1. Testing gerber/drill for proper behavior with united calls 2. Adding examples to the testing process. 3. Shapely layer. Used to do DRU checks. 4. Cairo layer. Use for visualization. 5. Dumb route generation approach 6. Work out of tiny-turtle PCB and test fab runs!
babyfood ======== [![Build Status](https://travis-ci.org/meawoppl/babyfood.svg?branch=master)](https://travis-ci.org/meawoppl/babyfood) Tools for the generation of Printed Circuit Boards (PCBs). This includes primitives for gerber, and XLN Drill files. There are several submodules: 1. io - Basic input/output of file formats. 2. layers - anything that can be though of in 2d, currently supports: 1. Gerber Layer 2. Drill Layer (xln format) 3. Cairo layer (coming soon!) 4. Shapely layer (coming soon!) 3. features - Graphical elements that span one or more layers including: 1. Pads (square/round) 2. Via's 3. JDEC Package footprints (coming soon) 4. components - Elements that have both a graphical rep and some other things 1. SMA resistors 2. Some LED's Coming soon =========== 1. Design rules 2. IPC Compliant footprints 3. Design optimization GerberWriter Limitations: 1. Does not check polygon legitimacy (complicated!) 2. Does not check for polygon closure wrt. to file precision, only exact values Next steps: =========== 1. Adding examples to the testing process. 2. Shapely layer. Used to do DRU checks. 3. Cairo layer. Use for visualization. 4. Dumb route generation approach 5. Work out of tiny-turtle PCB and test fab runs!
Update to reflect new structures
Update to reflect new structures
Markdown
bsd-2-clause
meawoppl/babyfood
markdown
## Code Before: babyfood ======== [![Build Status](https://travis-ci.org/meawoppl/babyfood.svg?branch=master)](https://travis-ci.org/meawoppl/babyfood) Tools for the generation of Gerber files. XLN Drill files, and PCB's based on these primitives. Coming soon: 1. Design rules 2. IPC Compliant footprints 3. Design optimization GerberWriter Limitations: 1. Does not check polygon legitimacy (complicated!) 2. Does not check for polygon closure wrt. to file precision, only exact values Next steps: 1. Testing gerber/drill for proper behavior with united calls 2. Adding examples to the testing process. 3. Shapely layer. Used to do DRU checks. 4. Cairo layer. Use for visualization. 5. Dumb route generation approach 6. Work out of tiny-turtle PCB and test fab runs! ## Instruction: Update to reflect new structures ## Code After: babyfood ======== [![Build Status](https://travis-ci.org/meawoppl/babyfood.svg?branch=master)](https://travis-ci.org/meawoppl/babyfood) Tools for the generation of Printed Circuit Boards (PCBs). This includes primitives for gerber, and XLN Drill files. There are several submodules: 1. io - Basic input/output of file formats. 2. layers - anything that can be though of in 2d, currently supports: 1. Gerber Layer 2. Drill Layer (xln format) 3. Cairo layer (coming soon!) 4. Shapely layer (coming soon!) 3. features - Graphical elements that span one or more layers including: 1. Pads (square/round) 2. Via's 3. JDEC Package footprints (coming soon) 4. components - Elements that have both a graphical rep and some other things 1. SMA resistors 2. Some LED's Coming soon =========== 1. Design rules 2. IPC Compliant footprints 3. Design optimization GerberWriter Limitations: 1. Does not check polygon legitimacy (complicated!) 2. Does not check for polygon closure wrt. to file precision, only exact values Next steps: =========== 1. Adding examples to the testing process. 2. Shapely layer. Used to do DRU checks. 3. Cairo layer. Use for visualization. 4. Dumb route generation approach 5. Work out of tiny-turtle PCB and test fab runs!
babyfood ======== [![Build Status](https://travis-ci.org/meawoppl/babyfood.svg?branch=master)](https://travis-ci.org/meawoppl/babyfood) - Tools for the generation of Gerber files. XLN Drill files, and - PCB's based on these primitives. + Tools for the generation of Printed Circuit Boards (PCBs). This includes + primitives for gerber, and XLN Drill files. + There are several submodules: + + 1. io - Basic input/output of file formats. + 2. layers - anything that can be though of in 2d, currently supports: + 1. Gerber Layer + 2. Drill Layer (xln format) + 3. Cairo layer (coming soon!) + 4. Shapely layer (coming soon!) + 3. features - Graphical elements that span one or more layers including: + 1. Pads (square/round) + 2. Via's + 3. JDEC Package footprints (coming soon) + 4. components - Elements that have both a graphical rep and some other things + 1. SMA resistors + 2. Some LED's + - Coming soon: ? - + Coming soon + =========== 1. Design rules 2. IPC Compliant footprints 3. Design optimization GerberWriter Limitations: 1. Does not check polygon legitimacy (complicated!) 2. Does not check for polygon closure wrt. to file precision, only exact values Next steps: + =========== - 1. Testing gerber/drill for proper behavior with united calls - 2. Adding examples to the testing process. ? ^ + 1. Adding examples to the testing process. ? ^ - 3. Shapely layer. Used to do DRU checks. ? ^ + 2. Shapely layer. Used to do DRU checks. ? ^ - 4. Cairo layer. Use for visualization. ? ^ + 3. Cairo layer. Use for visualization. ? ^ - 5. Dumb route generation approach ? ^ + 4. Dumb route generation approach ? ^ - 6. Work out of tiny-turtle PCB and test fab runs! ? ^ + 5. Work out of tiny-turtle PCB and test fab runs! ? ^
35
1.296296
26
9
c34a0e48d3124fa2619c20e65aa25a766d1a7404
doc/contributor-guide/source/index.rst
doc/contributor-guide/source/index.rst
========================================= OpenStack Documentation Contributor Guide ========================================= Abstract ~~~~~~~~ Contents ~~~~~~~~ .. toctree:: :maxdepth: 2 introduction.rst Search in this guide ~~~~~~~~~~~~~~~~~~~~ * :ref:`search`
========================================= OpenStack Documentation Contributor Guide ========================================= Abstract ~~~~~~~~ .. warning:: This guide is a work-in-progress and changing rapidly while we continue to test and enhance the guidance. Please note where there are open "to do" items and help where you are able. Contents ~~~~~~~~ .. toctree:: :maxdepth: 2 introduction.rst Search in this guide ~~~~~~~~~~~~~~~~~~~~ * :ref:`search`
Add initial warning to Contributor Guide
Add initial warning to Contributor Guide Tell readers that the guide is WIP. Change-Id: I0a1662ea9ea30361cc9359afbf90c09eb1492249
reStructuredText
apache-2.0
potsmaster/openstack-manuals,openstack/openstack-manuals,kairoaraujo/openstack-manuals,kairoaraujo/openstack-manuals,Akasurde/openstack-manuals,openstack/openstack-manuals,Akasurde/openstack-manuals,saeki-masaki/openstack-manuals,potsmaster/openstack-manuals,AlekhyaMallina-Vedams/openstack-manuals,saeki-masaki/openstack-manuals,openstack/openstack-manuals,openstack/openstack-manuals,AlekhyaMallina-Vedams/openstack-manuals,AlekhyaMallina-Vedams/openstack-manuals
restructuredtext
## Code Before: ========================================= OpenStack Documentation Contributor Guide ========================================= Abstract ~~~~~~~~ Contents ~~~~~~~~ .. toctree:: :maxdepth: 2 introduction.rst Search in this guide ~~~~~~~~~~~~~~~~~~~~ * :ref:`search` ## Instruction: Add initial warning to Contributor Guide Tell readers that the guide is WIP. Change-Id: I0a1662ea9ea30361cc9359afbf90c09eb1492249 ## Code After: ========================================= OpenStack Documentation Contributor Guide ========================================= Abstract ~~~~~~~~ .. warning:: This guide is a work-in-progress and changing rapidly while we continue to test and enhance the guidance. Please note where there are open "to do" items and help where you are able. Contents ~~~~~~~~ .. toctree:: :maxdepth: 2 introduction.rst Search in this guide ~~~~~~~~~~~~~~~~~~~~ * :ref:`search`
========================================= OpenStack Documentation Contributor Guide ========================================= Abstract ~~~~~~~~ + + .. warning:: This guide is a work-in-progress and changing rapidly + while we continue to test and enhance the guidance. Please note + where there are open "to do" items and help where you are able. Contents ~~~~~~~~ .. toctree:: :maxdepth: 2 introduction.rst Search in this guide ~~~~~~~~~~~~~~~~~~~~ * :ref:`search`
4
0.2
4
0
0c327e17dba29a4e94213f264fe7ea931bb26782
invoke/parser/argument.py
invoke/parser/argument.py
class Argument(object): def __init__(self, name=None, names=(), kind=str, default=None): if name and names: msg = "Cannot give both 'name' and 'names' arguments! Pick one." raise TypeError(msg) if not (name or names): raise TypeError("An Argument must have at least one name.") self.names = names if names else (name,) self.kind = kind self.raw_value = self._value = None self.default = default def __str__(self): return "Arg: %r (%s)" % (self.names, self.kind) @property def takes_value(self): return self.kind is not bool @property def value(self): return self._value if self._value is not None else self.default @value.setter def value(self, arg): self.raw_value = arg self._value = self.kind(arg)
class Argument(object): def __init__(self, name=None, names=(), kind=str, default=None, help=None): if name and names: msg = "Cannot give both 'name' and 'names' arguments! Pick one." raise TypeError(msg) if not (name or names): raise TypeError("An Argument must have at least one name.") self.names = names if names else (name,) self.kind = kind self.raw_value = self._value = None self.default = default self.help = help def __str__(self): return "Arg: %r (%s)" % (self.names, self.kind) @property def takes_value(self): return self.kind is not bool @property def value(self): return self._value if self._value is not None else self.default @value.setter def value(self, arg): self.raw_value = arg self._value = self.kind(arg)
Add support for per Argument help data
Add support for per Argument help data
Python
bsd-2-clause
kejbaly2/invoke,mattrobenolt/invoke,pyinvoke/invoke,pfmoore/invoke,sophacles/invoke,kejbaly2/invoke,pfmoore/invoke,mkusz/invoke,mattrobenolt/invoke,mkusz/invoke,tyewang/invoke,pyinvoke/invoke,singingwolfboy/invoke,frol/invoke,frol/invoke,alex/invoke
python
## Code Before: class Argument(object): def __init__(self, name=None, names=(), kind=str, default=None): if name and names: msg = "Cannot give both 'name' and 'names' arguments! Pick one." raise TypeError(msg) if not (name or names): raise TypeError("An Argument must have at least one name.") self.names = names if names else (name,) self.kind = kind self.raw_value = self._value = None self.default = default def __str__(self): return "Arg: %r (%s)" % (self.names, self.kind) @property def takes_value(self): return self.kind is not bool @property def value(self): return self._value if self._value is not None else self.default @value.setter def value(self, arg): self.raw_value = arg self._value = self.kind(arg) ## Instruction: Add support for per Argument help data ## Code After: class Argument(object): def __init__(self, name=None, names=(), kind=str, default=None, help=None): if name and names: msg = "Cannot give both 'name' and 'names' arguments! Pick one." raise TypeError(msg) if not (name or names): raise TypeError("An Argument must have at least one name.") self.names = names if names else (name,) self.kind = kind self.raw_value = self._value = None self.default = default self.help = help def __str__(self): return "Arg: %r (%s)" % (self.names, self.kind) @property def takes_value(self): return self.kind is not bool @property def value(self): return self._value if self._value is not None else self.default @value.setter def value(self, arg): self.raw_value = arg self._value = self.kind(arg)
class Argument(object): - def __init__(self, name=None, names=(), kind=str, default=None): + def __init__(self, name=None, names=(), kind=str, default=None, help=None): ? +++++++++++ if name and names: msg = "Cannot give both 'name' and 'names' arguments! Pick one." raise TypeError(msg) if not (name or names): raise TypeError("An Argument must have at least one name.") self.names = names if names else (name,) self.kind = kind self.raw_value = self._value = None self.default = default + self.help = help def __str__(self): return "Arg: %r (%s)" % (self.names, self.kind) @property def takes_value(self): return self.kind is not bool @property def value(self): return self._value if self._value is not None else self.default @value.setter def value(self, arg): self.raw_value = arg self._value = self.kind(arg)
3
0.111111
2
1
a3816eaa16e707bfd884be1a9ae15afd4adcb644
tasks/devtools.rake
tasks/devtools.rake
target_gemfile = Devtools.project.shared_gemfile_path source_gemfile = Devtools.shared_gemfile_path target_config = Devtools.project.root source_config = Devtools.default_config_path namespace :devtools do desc 'Sync Gemfile.devtools with gem' task :sync do cp source_gemfile, target_gemfile, :verbose => true end desc "Copy default configs and Gemfile.devtools to #{target_config}" task :init => [ :sync ] do cp_r source_config, target_config, :verbose => true end end desc 'Default: run all specs' task :default => [ :spec ]
target_gemfile = Devtools.project.shared_gemfile_path source_gemfile = Devtools.shared_gemfile_path project_root = Devtools.project.root source_config = Devtools.default_config_path namespace :devtools do desc 'Sync Gemfile.devtools with gem' task :sync do cp source_gemfile, target_gemfile, :verbose => true end desc "Copy default configs and Gemfile.devtools to #{project_root}" task :init => [ :sync ] do cp_r source_config, project_root, :verbose => true end end desc 'Default: run all specs' task :default => [ :spec ]
Rename local variable to be more meaningful
Rename local variable to be more meaningful
Ruby
mit
JonathonMA/devtools,mbj/devtools,zaidan/devtools,sferik/devtools,mvz/devtools,backus/devtools
ruby
## Code Before: target_gemfile = Devtools.project.shared_gemfile_path source_gemfile = Devtools.shared_gemfile_path target_config = Devtools.project.root source_config = Devtools.default_config_path namespace :devtools do desc 'Sync Gemfile.devtools with gem' task :sync do cp source_gemfile, target_gemfile, :verbose => true end desc "Copy default configs and Gemfile.devtools to #{target_config}" task :init => [ :sync ] do cp_r source_config, target_config, :verbose => true end end desc 'Default: run all specs' task :default => [ :spec ] ## Instruction: Rename local variable to be more meaningful ## Code After: target_gemfile = Devtools.project.shared_gemfile_path source_gemfile = Devtools.shared_gemfile_path project_root = Devtools.project.root source_config = Devtools.default_config_path namespace :devtools do desc 'Sync Gemfile.devtools with gem' task :sync do cp source_gemfile, target_gemfile, :verbose => true end desc "Copy default configs and Gemfile.devtools to #{project_root}" task :init => [ :sync ] do cp_r source_config, project_root, :verbose => true end end desc 'Default: run all specs' task :default => [ :spec ]
target_gemfile = Devtools.project.shared_gemfile_path source_gemfile = Devtools.shared_gemfile_path - target_config = Devtools.project.root ? ^^ ^ ^ ^^^^ + project_root = Devtools.project.root ? ^ ^^ + ^ ^^ - source_config = Devtools.default_config_path ? - + source_config = Devtools.default_config_path namespace :devtools do desc 'Sync Gemfile.devtools with gem' task :sync do cp source_gemfile, target_gemfile, :verbose => true end - desc "Copy default configs and Gemfile.devtools to #{target_config}" ? ^^ ^ ^ ^^^^ + desc "Copy default configs and Gemfile.devtools to #{project_root}" ? ^ ^^ + ^ ^^ task :init => [ :sync ] do - cp_r source_config, target_config, :verbose => true ? ^^ ^ ^ ^^^^ + cp_r source_config, project_root, :verbose => true ? ^ ^^ + ^ ^^ end end desc 'Default: run all specs' task :default => [ :spec ]
8
0.4
4
4
121b2361a2c63085feaa36d7051ae2e286387a09
app/assets/javascripts/analytics/init.js.erb
app/assets/javascripts/analytics/init.js.erb
(function() { "use strict"; // Load Google Analytics libraries GOVUK.StaticAnalytics.load(); // Use document.domain in dev, preview and staging so that tracking works // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk). var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain; var universalId = 'UA-26179049-1'; // Configure profiles, setup custom vars, track initial pageview var analytics = new GOVUK.StaticAnalytics({ universalId: universalId, cookieDomain: cookieDomain, govukTrackerGifUrl: '<%= asset_path "/static/a.gif" %>', }); // Make interface public for virtual pageviews and events GOVUK.analytics = analytics; })();
(function(global) { "use strict"; // Load Google Analytics libraries GOVUK.StaticAnalytics.load(); // Use document.domain in dev, preview and staging so that tracking works // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk). var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain; var universalId = 'UA-26179049-1'; // Configure profiles, setup custom vars, track initial pageview var analytics = new GOVUK.StaticAnalytics({ universalId: universalId, cookieDomain: cookieDomain, allowLinker: true, govukTrackerGifUrl: '<%= asset_path "/static/a.gif" %>', }); // Make interface public for virtual pageviews and events GOVUK.analytics = analytics; if (global.ga) { var ga = global.ga; ga('require', 'linker'); ga('linker:autoLink', ['planforbritain.gov.uk']); } })(window);
Add linked domain tracking to Plan For Britain campaign
Add linked domain tracking to Plan For Britain campaign Adds linked tracking without creating a new tracker, as per https://developers.google.com/analytics/devguides/collection/analyticsjs /linker. As this is a temporary measure, we’re calling `ga` directly rather than adding the functionality to `GOVUK.GoogleAnalyticsUniversalTracker` in `govuk_frontend_toolkit`.
HTML+ERB
mit
alphagov/static,alphagov/static,alphagov/static
html+erb
## Code Before: (function() { "use strict"; // Load Google Analytics libraries GOVUK.StaticAnalytics.load(); // Use document.domain in dev, preview and staging so that tracking works // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk). var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain; var universalId = 'UA-26179049-1'; // Configure profiles, setup custom vars, track initial pageview var analytics = new GOVUK.StaticAnalytics({ universalId: universalId, cookieDomain: cookieDomain, govukTrackerGifUrl: '<%= asset_path "/static/a.gif" %>', }); // Make interface public for virtual pageviews and events GOVUK.analytics = analytics; })(); ## Instruction: Add linked domain tracking to Plan For Britain campaign Adds linked tracking without creating a new tracker, as per https://developers.google.com/analytics/devguides/collection/analyticsjs /linker. As this is a temporary measure, we’re calling `ga` directly rather than adding the functionality to `GOVUK.GoogleAnalyticsUniversalTracker` in `govuk_frontend_toolkit`. ## Code After: (function(global) { "use strict"; // Load Google Analytics libraries GOVUK.StaticAnalytics.load(); // Use document.domain in dev, preview and staging so that tracking works // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk). var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain; var universalId = 'UA-26179049-1'; // Configure profiles, setup custom vars, track initial pageview var analytics = new GOVUK.StaticAnalytics({ universalId: universalId, cookieDomain: cookieDomain, allowLinker: true, govukTrackerGifUrl: '<%= asset_path "/static/a.gif" %>', }); // Make interface public for virtual pageviews and events GOVUK.analytics = analytics; if (global.ga) { var ga = global.ga; ga('require', 'linker'); ga('linker:autoLink', ['planforbritain.gov.uk']); } })(window);
- (function() { + (function(global) { ? ++++++ "use strict"; // Load Google Analytics libraries GOVUK.StaticAnalytics.load(); // Use document.domain in dev, preview and staging so that tracking works // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk). var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain; var universalId = 'UA-26179049-1'; // Configure profiles, setup custom vars, track initial pageview var analytics = new GOVUK.StaticAnalytics({ universalId: universalId, cookieDomain: cookieDomain, + allowLinker: true, govukTrackerGifUrl: '<%= asset_path "/static/a.gif" %>', }); // Make interface public for virtual pageviews and events GOVUK.analytics = analytics; - })(); + + if (global.ga) { + var ga = global.ga; + ga('require', 'linker'); + ga('linker:autoLink', ['planforbritain.gov.uk']); + } + })(window);
11
0.5
9
2
c856834735c1bee42b143a4f01376e7d98c7ab67
src/main/java/openblocks/api/ApiHolder.java
src/main/java/openblocks/api/ApiHolder.java
package openblocks.api; import java.lang.annotation.*; /** * Static variables marked with this annotation will be filled with instance * of requested API (defined by type of variable). * * All variables must have type that implements {@link IApiInterface}. * If requested type is not provided by OpenPeripheralAddons, variable will not be set. * * All variables should be filled in 'init'. Value in 'preInit' is undefined. * */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface ApiHolder {}
package openblocks.api; import java.lang.annotation.*; /** * Static variables marked with this annotation will be filled with instance * of requested API (defined by type of variable). * * Static methods marked with this annotation will be called with instance of requested API. * Methods must have single argument, which will be used to select API. * * All used types must implements {@link IApiInterface}. * If requested type is not provided by OpenPeripheralAddons, variable will not be set. * * All variables should be filled in 'init'. Value in 'preInit' is undefined. * */ @Target({ ElementType.FIELD, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) public @interface ApiHolder {}
Allow API annotation to be placed on methods, expand docs
Allow API annotation to be placed on methods, expand docs
Java
mit
TheSilkMiner/OpenBlocks,emmertf/OpenBlocks
java
## Code Before: package openblocks.api; import java.lang.annotation.*; /** * Static variables marked with this annotation will be filled with instance * of requested API (defined by type of variable). * * All variables must have type that implements {@link IApiInterface}. * If requested type is not provided by OpenPeripheralAddons, variable will not be set. * * All variables should be filled in 'init'. Value in 'preInit' is undefined. * */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface ApiHolder {} ## Instruction: Allow API annotation to be placed on methods, expand docs ## Code After: package openblocks.api; import java.lang.annotation.*; /** * Static variables marked with this annotation will be filled with instance * of requested API (defined by type of variable). * * Static methods marked with this annotation will be called with instance of requested API. * Methods must have single argument, which will be used to select API. * * All used types must implements {@link IApiInterface}. * If requested type is not provided by OpenPeripheralAddons, variable will not be set. * * All variables should be filled in 'init'. Value in 'preInit' is undefined. * */ @Target({ ElementType.FIELD, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) public @interface ApiHolder {}
package openblocks.api; import java.lang.annotation.*; /** * Static variables marked with this annotation will be filled with instance * of requested API (defined by type of variable). * + * Static methods marked with this annotation will be called with instance of requested API. + * Methods must have single argument, which will be used to select API. + * - * All variables must have type that implements {@link IApiInterface}. ? ^^^^^^^ --------------- + * All used types must implements {@link IApiInterface}. ? ^^^^^^^^ * If requested type is not provided by OpenPeripheralAddons, variable will not be set. * * All variables should be filled in 'init'. Value in 'preInit' is undefined. * */ - @Target(ElementType.FIELD) + @Target({ ElementType.FIELD, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) public @interface ApiHolder {}
7
0.411765
5
2
57ba33cdb75746baa04f8accae85bf5b997bfd4d
src/CodeEditor.jsx
src/CodeEditor.jsx
import React from "react/addons" var brace = require('brace'); var AceEditor = require('react-ace'); require('brace/mode/javascript') require('brace/theme/github') var $ = require('jquery') // needed for ajax const RaisedButton = require('material-ui/lib/raised-button'); export default React.createClass({ getInitialState: function() { return { source : 'alert("cats!");', changed : false }; }, code: function( text ) { this.setState( { source : text, changed: true } ); return false; }, script: function() { var source = this.state.source; console.log( source ); eval( source ); this.setState( { changed : false } ) }, submit: function() { $.post( '/save', { 'source' : this.state.source }, function( res ) { console.log( res ); } ) }, render: function() { return <div> <AceEditor mode="javascript" value={this.state.source} onChange={this.code} theme="github" editorProps={{$blockScrolling: true}} /> <RaisedButton onClick={this.script} primary={true} label="Test" /> <RaisedButton onClick={this.submit} disabled={this.state.changed} label="Ready" /> </div> } });
import React from "react/addons" var brace = require('brace'); var AceEditor = require('react-ace'); require('brace/mode/javascript') require('brace/theme/github') var $ = require('jquery') // needed for ajax const RaisedButton = require('material-ui/lib/raised-button'); export default React.createClass({ getInitialState: function() { return { source : 'alert("cats!");', changed : false }; }, code: function( text ) { this.setState( { source : text, changed: true } ); return false; }, script: function() { var source = this.state.source; console.log( source ); eval( source ); this.setState( { changed : false } ) }, submit: function() { $.post( '/save', { 'source' : this.state.source }, function( res ) { console.log( res ); } ) }, render: function() { return <div> <div> <AceEditor mode="javascript" value={this.state.source} onChange={this.code} theme="github" editorProps={{$blockScrolling: true}} /> </div> <div style={{'margin-top': '10px'}}> <RaisedButton onClick={this.script} primary={true} label="Test" /> <RaisedButton onClick={this.submit} disabled={this.state.changed} label="Ready" /> </div> </div> } });
Add space between code, test and ready
Add space between code, test and ready
JSX
mit
MuSiika/euhack-2015,MuSiika/euhack-2015
jsx
## Code Before: import React from "react/addons" var brace = require('brace'); var AceEditor = require('react-ace'); require('brace/mode/javascript') require('brace/theme/github') var $ = require('jquery') // needed for ajax const RaisedButton = require('material-ui/lib/raised-button'); export default React.createClass({ getInitialState: function() { return { source : 'alert("cats!");', changed : false }; }, code: function( text ) { this.setState( { source : text, changed: true } ); return false; }, script: function() { var source = this.state.source; console.log( source ); eval( source ); this.setState( { changed : false } ) }, submit: function() { $.post( '/save', { 'source' : this.state.source }, function( res ) { console.log( res ); } ) }, render: function() { return <div> <AceEditor mode="javascript" value={this.state.source} onChange={this.code} theme="github" editorProps={{$blockScrolling: true}} /> <RaisedButton onClick={this.script} primary={true} label="Test" /> <RaisedButton onClick={this.submit} disabled={this.state.changed} label="Ready" /> </div> } }); ## Instruction: Add space between code, test and ready ## Code After: import React from "react/addons" var brace = require('brace'); var AceEditor = require('react-ace'); require('brace/mode/javascript') require('brace/theme/github') var $ = require('jquery') // needed for ajax const RaisedButton = require('material-ui/lib/raised-button'); export default React.createClass({ getInitialState: function() { return { source : 'alert("cats!");', changed : false }; }, code: function( text ) { this.setState( { source : text, changed: true } ); return false; }, script: function() { var source = this.state.source; console.log( source ); eval( source ); this.setState( { changed : false } ) }, submit: function() { $.post( '/save', { 'source' : this.state.source }, function( res ) { console.log( res ); } ) }, render: function() { return <div> <div> <AceEditor mode="javascript" value={this.state.source} onChange={this.code} theme="github" editorProps={{$blockScrolling: true}} /> </div> <div style={{'margin-top': '10px'}}> <RaisedButton onClick={this.script} primary={true} label="Test" /> <RaisedButton onClick={this.submit} disabled={this.state.changed} label="Ready" /> </div> </div> } });
import React from "react/addons" var brace = require('brace'); var AceEditor = require('react-ace'); require('brace/mode/javascript') require('brace/theme/github') var $ = require('jquery') // needed for ajax const RaisedButton = require('material-ui/lib/raised-button'); export default React.createClass({ getInitialState: function() { return { source : 'alert("cats!");', changed : false }; }, code: function( text ) { this.setState( { source : text, changed: true } ); return false; }, script: function() { var source = this.state.source; console.log( source ); eval( source ); this.setState( { changed : false } ) }, submit: function() { $.post( '/save', { 'source' : this.state.source }, function( res ) { console.log( res ); } ) }, render: function() { return <div> + <div> - <AceEditor mode="javascript" value={this.state.source} onChange={this.code} theme="github" editorProps={{$blockScrolling: true}} /> + <AceEditor mode="javascript" value={this.state.source} onChange={this.code} theme="github" editorProps={{$blockScrolling: true}} /> ? ++ + </div> + <div style={{'margin-top': '10px'}}> - <RaisedButton onClick={this.script} primary={true} label="Test" /> + <RaisedButton onClick={this.script} primary={true} label="Test" /> ? ++ - <RaisedButton onClick={this.submit} disabled={this.state.changed} label="Ready" /> + <RaisedButton onClick={this.submit} disabled={this.state.changed} label="Ready" /> ? ++ + </div> </div> } });
10
0.222222
7
3
7dbb41f301f8b669e60e6e5e4f4dc2beb2a5bbc9
sexy_diff.rb
sexy_diff.rb
require 'sinatra' require 'grit' require './diff_presenter' helpers do include Rack::Utils alias_method :h, :escape_html end get '/' do repository = params[:repository] if repository && !repository.empty? files = params[:files].split($/).map { |f| f.strip } if !params[:files].empty? @repo = Grit::Repo.new(repository) @from_sha = params[:from_commit] || @repo.commits.last.sha @to_sha = params[:to_commit] || @repo.commits.first.sha @diffs = @repo.diff(@from_sha, @to_sha, *files) @diff_presenters = @diffs.map { |d| DiffPresenter.new(d) } end erb :index end
require 'sinatra' require 'grit' require './diff_presenter' helpers do include Rack::Utils alias_method :h, :escape_html end get '/' do repository = params[:repository] if repository && !repository.empty? files = params[:files].split($/).map { |f| f.strip } if !params[:files].empty? @repo = Grit::Repo.new(repository) @from_sha = (params[:from_commit].empty?) ? @repo.commits.last.sha : params[:from_commit] @to_sha = (params[:to_commit].empty?) ? @repo.commits.first.sha : params[:to_commit] @diffs = @repo.diff(@from_sha, @to_sha, *files) @diff_presenters = @diffs.map { |d| DiffPresenter.new(d) } end erb :index end
Fix from_commit and to_commit params
Fix from_commit and to_commit params
Ruby
mit
gmalkas/sexy_git_diff
ruby
## Code Before: require 'sinatra' require 'grit' require './diff_presenter' helpers do include Rack::Utils alias_method :h, :escape_html end get '/' do repository = params[:repository] if repository && !repository.empty? files = params[:files].split($/).map { |f| f.strip } if !params[:files].empty? @repo = Grit::Repo.new(repository) @from_sha = params[:from_commit] || @repo.commits.last.sha @to_sha = params[:to_commit] || @repo.commits.first.sha @diffs = @repo.diff(@from_sha, @to_sha, *files) @diff_presenters = @diffs.map { |d| DiffPresenter.new(d) } end erb :index end ## Instruction: Fix from_commit and to_commit params ## Code After: require 'sinatra' require 'grit' require './diff_presenter' helpers do include Rack::Utils alias_method :h, :escape_html end get '/' do repository = params[:repository] if repository && !repository.empty? files = params[:files].split($/).map { |f| f.strip } if !params[:files].empty? @repo = Grit::Repo.new(repository) @from_sha = (params[:from_commit].empty?) ? @repo.commits.last.sha : params[:from_commit] @to_sha = (params[:to_commit].empty?) ? @repo.commits.first.sha : params[:to_commit] @diffs = @repo.diff(@from_sha, @to_sha, *files) @diff_presenters = @diffs.map { |d| DiffPresenter.new(d) } end erb :index end
require 'sinatra' require 'grit' require './diff_presenter' helpers do include Rack::Utils alias_method :h, :escape_html end get '/' do repository = params[:repository] if repository && !repository.empty? files = params[:files].split($/).map { |f| f.strip } if !params[:files].empty? @repo = Grit::Repo.new(repository) - @from_sha = params[:from_commit] || @repo.commits.last.sha ? ^^ + @from_sha = (params[:from_commit].empty?) ? @repo.commits.last.sha : params[:from_commit] ? + ++++++++ ^ +++++++++++++++++++++++ - @to_sha = params[:to_commit] || @repo.commits.first.sha ? ^^ + @to_sha = (params[:to_commit].empty?) ? @repo.commits.first.sha : params[:to_commit] ? + ++++++++ ^ +++++++++++++++++++++ @diffs = @repo.diff(@from_sha, @to_sha, *files) @diff_presenters = @diffs.map { |d| DiffPresenter.new(d) } end erb :index end
4
0.16
2
2
9051546c59225b474f5101e7ab8618f2e5382aff
conf/postgres-ha/postgres-ha-bootstrap.yaml
conf/postgres-ha/postgres-ha-bootstrap.yaml
--- bootstrap: dcs: postgresql: parameters: unix_socket_directories: /tmp,/crunchyadm post_bootstrap: /opt/cpm/bin/bootstrap/post-bootstrap.sh
--- bootstrap: dcs: postgresql: parameters: unix_socket_directories: /tmp,/crunchyadm wal_level: logical post_bootstrap: /opt/cpm/bin/bootstrap/post-bootstrap.sh
Set `wal_level` to `logical` by default in HA container
Set `wal_level` to `logical` by default in HA container This has been available since PostgreSQL 9.4 and allows for both logical decoding to be leveraged (9.4+) and logical replication (10+) to be enabled. Issue: [ch7221]
YAML
apache-2.0
CrunchyData/crunchy-containers,CrunchyData/crunchy-containers,the1forte/crunchy-containers,the1forte/crunchy-containers,CrunchyData/crunchy-containers,the1forte/crunchy-containers
yaml
## Code Before: --- bootstrap: dcs: postgresql: parameters: unix_socket_directories: /tmp,/crunchyadm post_bootstrap: /opt/cpm/bin/bootstrap/post-bootstrap.sh ## Instruction: Set `wal_level` to `logical` by default in HA container This has been available since PostgreSQL 9.4 and allows for both logical decoding to be leveraged (9.4+) and logical replication (10+) to be enabled. Issue: [ch7221] ## Code After: --- bootstrap: dcs: postgresql: parameters: unix_socket_directories: /tmp,/crunchyadm wal_level: logical post_bootstrap: /opt/cpm/bin/bootstrap/post-bootstrap.sh
--- bootstrap: dcs: postgresql: parameters: unix_socket_directories: /tmp,/crunchyadm + wal_level: logical post_bootstrap: /opt/cpm/bin/bootstrap/post-bootstrap.sh
1
0.142857
1
0
e4c11a660be53873fdd47fcbf5fee21c369f0f4d
components/OrganisationList.js
components/OrganisationList.js
import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { jsdom } from 'jsdom' import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery require("jsdom").env("", function(err, window) { if (err) { console.error(err); return; } var $ = require("jquery")(window); require('bootstrap'); }); class OrganisationList extends Component { render() { var numberOfOrgs = this.props.organisations.length; var rows = []; var counter = 0; for(var i=0; i<numberOfOrgs; i++) { rows.push(<OrganisationListRow name={this.props.organisations[i].name} id={this.props.organisations[i].id} key={counter}/>); counter++; }; return( <table className="table table-striped table-bordered table-hover"> <thead className="thead"> <th>Name</th> <th>Id</th> </thead> <tbody className="tbody"> {rows} //<OrganisationListRow name={this.props.organisations[0].name} id={this.props.organisations[0].id}/> </tbody> </table> ); } } export default OrganisationList
import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { jsdom } from 'jsdom' import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery // require("jsdom").env("", function(err, window) { // if (err) { // console.error(err); // return; // } // // var $ = require("jquery")(window); // require('bootstrap'); // }); class OrganisationList extends Component { render() { var numberOfOrgs = this.props.organisations.length; var rows = []; var counter = 0; for(var i=0; i<numberOfOrgs; i++) { rows.push(<OrganisationListRow name={this.props.organisations[i].name} id={this.props.organisations[i].id} key={counter}/>); counter++; }; return( <table className="table table-striped table-bordered table-hover"> <thead className="thead"> <th>Name</th> <th>Id</th> </thead> <tbody className="tbody"> {rows} //<OrganisationListRow name={this.props.organisations[0].name} id={this.props.organisations[0].id}/> </tbody> </table> ); } } export default OrganisationList
Comment out bootstrap to make test suite pass
Comment out bootstrap to make test suite pass
JavaScript
apache-2.0
CodeHubOrg/organisations-database,CodeHubOrg/organisations-database
javascript
## Code Before: import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { jsdom } from 'jsdom' import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery require("jsdom").env("", function(err, window) { if (err) { console.error(err); return; } var $ = require("jquery")(window); require('bootstrap'); }); class OrganisationList extends Component { render() { var numberOfOrgs = this.props.organisations.length; var rows = []; var counter = 0; for(var i=0; i<numberOfOrgs; i++) { rows.push(<OrganisationListRow name={this.props.organisations[i].name} id={this.props.organisations[i].id} key={counter}/>); counter++; }; return( <table className="table table-striped table-bordered table-hover"> <thead className="thead"> <th>Name</th> <th>Id</th> </thead> <tbody className="tbody"> {rows} //<OrganisationListRow name={this.props.organisations[0].name} id={this.props.organisations[0].id}/> </tbody> </table> ); } } export default OrganisationList ## Instruction: Comment out bootstrap to make test suite pass ## Code After: import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { jsdom } from 'jsdom' import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery // require("jsdom").env("", function(err, window) { // if (err) { // console.error(err); // return; // } // // var $ = require("jquery")(window); // require('bootstrap'); // }); class OrganisationList extends Component { render() { var numberOfOrgs = this.props.organisations.length; var rows = []; var counter = 0; for(var i=0; i<numberOfOrgs; i++) { rows.push(<OrganisationListRow name={this.props.organisations[i].name} id={this.props.organisations[i].id} key={counter}/>); counter++; }; return( <table className="table table-striped table-bordered table-hover"> <thead className="thead"> <th>Name</th> <th>Id</th> </thead> <tbody className="tbody"> {rows} //<OrganisationListRow name={this.props.organisations[0].name} id={this.props.organisations[0].id}/> </tbody> </table> ); } } export default OrganisationList
import React, { Component, PropTypes } from 'react' import classnames from 'classnames' import { jsdom } from 'jsdom' import OrganisationListRow from './OrganisationListRow' //Snippet taken from https://www.npmjs.com/package/jquery - require("jsdom").env("", function(err, window) { + // require("jsdom").env("", function(err, window) { ? +++ - if (err) { + // if (err) { ? +++ - console.error(err); + // console.error(err); ? +++ - return; + // return; ? +++ - } - + // } + // - var $ = require("jquery")(window); + // var $ = require("jquery")(window); ? +++ - require('bootstrap'); + // require('bootstrap'); ? +++ - }); + // }); class OrganisationList extends Component { - + render() { var numberOfOrgs = this.props.organisations.length; var rows = []; var counter = 0; for(var i=0; i<numberOfOrgs; i++) { rows.push(<OrganisationListRow name={this.props.organisations[i].name} id={this.props.organisations[i].id} key={counter}/>); counter++; }; return( <table className="table table-striped table-bordered table-hover"> <thead className="thead"> <th>Name</th> <th>Id</th> </thead> <tbody className="tbody"> {rows} //<OrganisationListRow name={this.props.organisations[0].name} id={this.props.organisations[0].id}/> </tbody> </table> ); } } export default OrganisationList
20
0.444444
10
10
e72fa5ab59a8c904d525a33652424b0acf5c9de4
cms/widgets.py
cms/widgets.py
from django.forms.widgets import TextInput class RichTextInput(TextInput): template_name = 'cms/forms/widgets/rich_text.html'
from django.forms.widgets import Textarea class RichTextInput(Textarea): template_name = 'cms/forms/widgets/rich_text.html'
Switch TextInput for Textarea for RichText widget base class
Switch TextInput for Textarea for RichText widget base class
Python
agpl-3.0
Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/Inboxen
python
## Code Before: from django.forms.widgets import TextInput class RichTextInput(TextInput): template_name = 'cms/forms/widgets/rich_text.html' ## Instruction: Switch TextInput for Textarea for RichText widget base class ## Code After: from django.forms.widgets import Textarea class RichTextInput(Textarea): template_name = 'cms/forms/widgets/rich_text.html'
- from django.forms.widgets import TextInput ? ^^^^^ + from django.forms.widgets import Textarea ? ^^^^ - class RichTextInput(TextInput): ? ^^^^^ + class RichTextInput(Textarea): ? ^^^^ template_name = 'cms/forms/widgets/rich_text.html'
4
0.666667
2
2
c8ffce0a9d78c8f275952a36fdaf4ef65460637d
OrangeLabel/Classes/String+OrangeLabel.swift
OrangeLabel/Classes/String+OrangeLabel.swift
// // String+OrangeLabel.swift // OrangeLabel // // Created by Steve Kim on 09/04/2017. // Copyright © 2016 Steve Kim. All rights reserved. // import Foundation extension String { func matches(pattern: String) throws -> [NSTextCheckingResult] { let regex = try NSRegularExpression(pattern: pattern, options: .caseInsensitive) let range = NSRange(location: 0, length: self.characters.count) return regex.matches(in: self, options: .reportCompletion, range: range) } func nsRange(from range: Range<String.Index>) -> NSRange { let from = range.lowerBound.samePosition(in: utf16) let to = range.upperBound.samePosition(in: utf16) return NSRange(location: utf16.distance(from: utf16.startIndex, to: from), length: utf16.distance(from: from, to: to)) } func range(from nsRange: NSRange) -> Range<String.Index>? { guard let from16 = utf16.index(utf16.startIndex, offsetBy: nsRange.location, limitedBy: utf16.endIndex), let to16 = utf16.index(from16, offsetBy: nsRange.length, limitedBy: utf16.endIndex), let from = String.Index(from16, within: self), let to = String.Index(to16, within: self) else { return nil } return from ..< to } }
// // String+OrangeLabel.swift // OrangeLabel // // Created by Steve Kim on 09/04/2017. // Copyright © 2016 Steve Kim. All rights reserved. // import Foundation extension String { func matches(pattern: String) throws -> [NSTextCheckingResult] { let regex = try NSRegularExpression(pattern: pattern) return regex.matches(in: self, options: .reportCompletion, range: NSRange(0..<utf16.count)) } func nsRange(from range: Range<String.Index>) -> NSRange { let from = range.lowerBound.samePosition(in: utf16) let to = range.upperBound.samePosition(in: utf16) return NSRange(location: utf16.distance(from: utf16.startIndex, to: from), length: utf16.distance(from: from, to: to)) } func range(from nsRange: NSRange) -> Range<String.Index>? { guard let from16 = utf16.index(utf16.startIndex, offsetBy: nsRange.location, limitedBy: utf16.endIndex), let to16 = utf16.index(from16, offsetBy: nsRange.length, limitedBy: utf16.endIndex), let from = String.Index(from16, within: self), let to = String.Index(to16, within: self) else { return nil } return from ..< to } }
Support to utf16 characters with regular expression
Support to utf16 characters with regular expression
Swift
mit
pisces/OrangeLabel,pisces/OrangeLabel
swift
## Code Before: // // String+OrangeLabel.swift // OrangeLabel // // Created by Steve Kim on 09/04/2017. // Copyright © 2016 Steve Kim. All rights reserved. // import Foundation extension String { func matches(pattern: String) throws -> [NSTextCheckingResult] { let regex = try NSRegularExpression(pattern: pattern, options: .caseInsensitive) let range = NSRange(location: 0, length: self.characters.count) return regex.matches(in: self, options: .reportCompletion, range: range) } func nsRange(from range: Range<String.Index>) -> NSRange { let from = range.lowerBound.samePosition(in: utf16) let to = range.upperBound.samePosition(in: utf16) return NSRange(location: utf16.distance(from: utf16.startIndex, to: from), length: utf16.distance(from: from, to: to)) } func range(from nsRange: NSRange) -> Range<String.Index>? { guard let from16 = utf16.index(utf16.startIndex, offsetBy: nsRange.location, limitedBy: utf16.endIndex), let to16 = utf16.index(from16, offsetBy: nsRange.length, limitedBy: utf16.endIndex), let from = String.Index(from16, within: self), let to = String.Index(to16, within: self) else { return nil } return from ..< to } } ## Instruction: Support to utf16 characters with regular expression ## Code After: // // String+OrangeLabel.swift // OrangeLabel // // Created by Steve Kim on 09/04/2017. // Copyright © 2016 Steve Kim. All rights reserved. // import Foundation extension String { func matches(pattern: String) throws -> [NSTextCheckingResult] { let regex = try NSRegularExpression(pattern: pattern) return regex.matches(in: self, options: .reportCompletion, range: NSRange(0..<utf16.count)) } func nsRange(from range: Range<String.Index>) -> NSRange { let from = range.lowerBound.samePosition(in: utf16) let to = range.upperBound.samePosition(in: utf16) return NSRange(location: utf16.distance(from: utf16.startIndex, to: from), length: utf16.distance(from: from, to: to)) } func range(from nsRange: NSRange) -> Range<String.Index>? { guard let from16 = utf16.index(utf16.startIndex, offsetBy: nsRange.location, limitedBy: utf16.endIndex), let to16 = utf16.index(from16, offsetBy: nsRange.length, limitedBy: utf16.endIndex), let from = String.Index(from16, within: self), let to = String.Index(to16, within: self) else { return nil } return from ..< to } }
// // String+OrangeLabel.swift // OrangeLabel // // Created by Steve Kim on 09/04/2017. // Copyright © 2016 Steve Kim. All rights reserved. // import Foundation extension String { func matches(pattern: String) throws -> [NSTextCheckingResult] { - let regex = try NSRegularExpression(pattern: pattern, options: .caseInsensitive) ? --------------------------- + let regex = try NSRegularExpression(pattern: pattern) - let range = NSRange(location: 0, length: self.characters.count) - return regex.matches(in: self, options: .reportCompletion, range: range) ? ^ + return regex.matches(in: self, options: .reportCompletion, range: NSRange(0..<utf16.count)) ? ^^^ ++++++++++++++++ + } func nsRange(from range: Range<String.Index>) -> NSRange { let from = range.lowerBound.samePosition(in: utf16) let to = range.upperBound.samePosition(in: utf16) return NSRange(location: utf16.distance(from: utf16.startIndex, to: from), length: utf16.distance(from: from, to: to)) } func range(from nsRange: NSRange) -> Range<String.Index>? { - guard - let from16 = utf16.index(utf16.startIndex, offsetBy: nsRange.location, limitedBy: utf16.endIndex), ? ^^^ + guard let from16 = utf16.index(utf16.startIndex, offsetBy: nsRange.location, limitedBy: utf16.endIndex), ? ^^^^^ let to16 = utf16.index(from16, offsetBy: nsRange.length, limitedBy: utf16.endIndex), let from = String.Index(from16, within: self), let to = String.Index(to16, within: self) else { return nil } return from ..< to } }
8
0.25
3
5
c127c1b196f262e60ec1af683f0f2c2be87ed9a1
core/play-integration-test/src/it/scala/play/it/views/DevErrorPageSpec.scala
core/play-integration-test/src/it/scala/play/it/views/DevErrorPageSpec.scala
/* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package play.it.views import play.api.Configuration import play.api.Environment import play.api.Mode import play.api.http.DefaultHttpErrorHandler import play.api.test._ class DevErrorPageSpec extends PlaySpecification { "devError.scala.html" should { val testExceptionSource = new play.api.PlayException.ExceptionSource("test", "making sure the link shows up") { def line = 100.asInstanceOf[Integer] def position = 20.asInstanceOf[Integer] def input = "test" def sourceName = "someSourceFile" } "link the error line if play.editor is configured" in { DefaultHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s") val result = DefaultHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource) contentAsString(result) must contain("""href="someEditorLinkWith someSourceFile:100" """) } "show prod error page in prod mode" in { val errorHandler = new DefaultHttpErrorHandler() val result = errorHandler.onServerError(FakeRequest(), testExceptionSource) Helpers.contentAsString(result) must contain("Oops, an error occurred") } } }
/* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package play.it.views import play.api.http.DefaultHttpErrorHandler import play.api.http.DevHttpErrorHandler import play.api.test._ class DevErrorPageSpec extends PlaySpecification { "devError.scala.html" should { val testExceptionSource = new play.api.PlayException.ExceptionSource("test", "making sure the link shows up") { def line = 100.asInstanceOf[Integer] def position = 20.asInstanceOf[Integer] def input = "test" def sourceName = "someSourceFile" } "link the error line if play.editor is configured" in { DevHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s") val result = DevHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource) contentAsString(result) must contain("""href="someEditorLinkWith someSourceFile:100" """) } "show prod error page in prod mode" in { val errorHandler = new DefaultHttpErrorHandler() val result = errorHandler.onServerError(FakeRequest(), testExceptionSource) Helpers.contentAsString(result) must contain("Oops, an error occurred") } } }
Use DevHttpErrorHandler to check if play.editor link gets rendered
Use DevHttpErrorHandler to check if play.editor link gets rendered
Scala
apache-2.0
playframework/playframework,playframework/playframework,playframework/playframework
scala
## Code Before: /* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package play.it.views import play.api.Configuration import play.api.Environment import play.api.Mode import play.api.http.DefaultHttpErrorHandler import play.api.test._ class DevErrorPageSpec extends PlaySpecification { "devError.scala.html" should { val testExceptionSource = new play.api.PlayException.ExceptionSource("test", "making sure the link shows up") { def line = 100.asInstanceOf[Integer] def position = 20.asInstanceOf[Integer] def input = "test" def sourceName = "someSourceFile" } "link the error line if play.editor is configured" in { DefaultHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s") val result = DefaultHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource) contentAsString(result) must contain("""href="someEditorLinkWith someSourceFile:100" """) } "show prod error page in prod mode" in { val errorHandler = new DefaultHttpErrorHandler() val result = errorHandler.onServerError(FakeRequest(), testExceptionSource) Helpers.contentAsString(result) must contain("Oops, an error occurred") } } } ## Instruction: Use DevHttpErrorHandler to check if play.editor link gets rendered ## Code After: /* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package play.it.views import play.api.http.DefaultHttpErrorHandler import play.api.http.DevHttpErrorHandler import play.api.test._ class DevErrorPageSpec extends PlaySpecification { "devError.scala.html" should { val testExceptionSource = new play.api.PlayException.ExceptionSource("test", "making sure the link shows up") { def line = 100.asInstanceOf[Integer] def position = 20.asInstanceOf[Integer] def input = "test" def sourceName = "someSourceFile" } "link the error line if play.editor is configured" in { DevHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s") val result = DevHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource) contentAsString(result) must contain("""href="someEditorLinkWith someSourceFile:100" """) } "show prod error page in prod mode" in { val errorHandler = new DefaultHttpErrorHandler() val result = errorHandler.onServerError(FakeRequest(), testExceptionSource) Helpers.contentAsString(result) must contain("Oops, an error occurred") } } }
/* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package play.it.views - import play.api.Configuration - import play.api.Environment - import play.api.Mode import play.api.http.DefaultHttpErrorHandler + import play.api.http.DevHttpErrorHandler import play.api.test._ class DevErrorPageSpec extends PlaySpecification { "devError.scala.html" should { val testExceptionSource = new play.api.PlayException.ExceptionSource("test", "making sure the link shows up") { def line = 100.asInstanceOf[Integer] def position = 20.asInstanceOf[Integer] def input = "test" def sourceName = "someSourceFile" } "link the error line if play.editor is configured" in { - DefaultHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s") ? ^^^^^ + DevHttpErrorHandler.setPlayEditor("someEditorLinkWith %s:%s") ? ^ - val result = DefaultHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource) ? ^^^^^ + val result = DevHttpErrorHandler.onServerError(FakeRequest(), testExceptionSource) ? ^ contentAsString(result) must contain("""href="someEditorLinkWith someSourceFile:100" """) } "show prod error page in prod mode" in { val errorHandler = new DefaultHttpErrorHandler() val result = errorHandler.onServerError(FakeRequest(), testExceptionSource) Helpers.contentAsString(result) must contain("Oops, an error occurred") } } }
8
0.235294
3
5
70ba0be6c1bf77b097137647c6ceca3975e281f2
src/PhpSpecExtension.php
src/PhpSpecExtension.php
<?php namespace RMiller\PhpSpecExtension; use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface; use Behat\Testwork\ServiceContainer\ExtensionManager; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; class PhpSpecExtension implements ExtensionInterface { /** * {@inheritDoc} */ public function load(ContainerBuilder $container, array $config) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__)); $loader->load('services.xml'); $container->setParameter('phpspec_extension.path', $config['path']); $container->setParameter('phpspec_extension.config', $config['config']); } /** * {@inheritDoc} */ public function configure(ArrayNodeDefinition $builder) { $builder ->addDefaultsIfNotSet() ->children() ->scalarNode('path')->defaultValue('bin/phpspec')->end() ->scalarNode('config')->defaultNull()->end() ->end() ->end(); } /** * {@inheritDoc} */ public function getConfigKey() { return 'phpspec'; } /** * {@inheritdoc} */ public function initialize(ExtensionManager $extensionManager) { } /** * {@inheritDoc} */ public function process(ContainerBuilder $container) { } }
<?php namespace RMiller\PhpSpecExtension; use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface; use Behat\Testwork\ServiceContainer\ExtensionManager; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; class PhpSpecExtension implements ExtensionInterface { /** * {@inheritDoc} */ public function load(ContainerBuilder $container, array $config) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__)); $loader->load('services.xml'); $container->setParameter('phpspec_extension.path', $config['path']); $container->setParameter('phpspec_extension.config', $config['config']); } /** * {@inheritDoc} */ public function configure(ArrayNodeDefinition $builder) { $builder ->addDefaultsIfNotSet() ->children() ->scalarNode('path')->defaultValue('bin/phpspec')->end() ->scalarNode('config')->defaultValue('phpspec.yml')->end() ->end() ->end(); } /** * {@inheritDoc} */ public function getConfigKey() { return 'phpspec'; } /** * {@inheritdoc} */ public function initialize(ExtensionManager $extensionManager) { } /** * {@inheritDoc} */ public function process(ContainerBuilder $container) { } }
Set default value for path of config
Set default value for path of config
PHP
mit
vukanac/PhpSpecExtension
php
## Code Before: <?php namespace RMiller\PhpSpecExtension; use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface; use Behat\Testwork\ServiceContainer\ExtensionManager; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; class PhpSpecExtension implements ExtensionInterface { /** * {@inheritDoc} */ public function load(ContainerBuilder $container, array $config) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__)); $loader->load('services.xml'); $container->setParameter('phpspec_extension.path', $config['path']); $container->setParameter('phpspec_extension.config', $config['config']); } /** * {@inheritDoc} */ public function configure(ArrayNodeDefinition $builder) { $builder ->addDefaultsIfNotSet() ->children() ->scalarNode('path')->defaultValue('bin/phpspec')->end() ->scalarNode('config')->defaultNull()->end() ->end() ->end(); } /** * {@inheritDoc} */ public function getConfigKey() { return 'phpspec'; } /** * {@inheritdoc} */ public function initialize(ExtensionManager $extensionManager) { } /** * {@inheritDoc} */ public function process(ContainerBuilder $container) { } } ## Instruction: Set default value for path of config ## Code After: <?php namespace RMiller\PhpSpecExtension; use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface; use Behat\Testwork\ServiceContainer\ExtensionManager; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; class PhpSpecExtension implements ExtensionInterface { /** * {@inheritDoc} */ public function load(ContainerBuilder $container, array $config) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__)); $loader->load('services.xml'); $container->setParameter('phpspec_extension.path', $config['path']); $container->setParameter('phpspec_extension.config', $config['config']); } /** * {@inheritDoc} */ public function configure(ArrayNodeDefinition $builder) { $builder ->addDefaultsIfNotSet() ->children() ->scalarNode('path')->defaultValue('bin/phpspec')->end() ->scalarNode('config')->defaultValue('phpspec.yml')->end() ->end() ->end(); } /** * {@inheritDoc} */ public function getConfigKey() { return 'phpspec'; } /** * {@inheritdoc} */ public function initialize(ExtensionManager $extensionManager) { } /** * {@inheritDoc} */ public function process(ContainerBuilder $container) { } }
<?php namespace RMiller\PhpSpecExtension; use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface; use Behat\Testwork\ServiceContainer\ExtensionManager; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; class PhpSpecExtension implements ExtensionInterface { /** * {@inheritDoc} */ public function load(ContainerBuilder $container, array $config) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__)); $loader->load('services.xml'); $container->setParameter('phpspec_extension.path', $config['path']); $container->setParameter('phpspec_extension.config', $config['config']); } /** * {@inheritDoc} */ public function configure(ArrayNodeDefinition $builder) { $builder ->addDefaultsIfNotSet() ->children() ->scalarNode('path')->defaultValue('bin/phpspec')->end() - ->scalarNode('config')->defaultNull()->end() ? ^ ^^ + ->scalarNode('config')->defaultValue('phpspec.yml')->end() ? ^^^ +++++++++++++ ^ ->end() ->end(); } /** * {@inheritDoc} */ public function getConfigKey() { return 'phpspec'; } /** * {@inheritdoc} */ public function initialize(ExtensionManager $extensionManager) { } /** * {@inheritDoc} */ public function process(ContainerBuilder $container) { } }
2
0.032258
1
1
fdb27c75929d9803cbd516cef046f6a92c027634
runtests.sh
runtests.sh
set -e function test { v=$1 pv=$2 echo "====================================================================" echo "Testing with Django $v and Python $pv" # Setup virtual environment for the specified Django version if absent. IFS='.' read v1 v2 <<< "$v" env="../env$pv-$v" if [ ! -d $env ] ; then virtualenv --no-site-packages -p /usr/bin/python$pv $env fi source $env/bin/activate # Install or upgrade the required Django version. pip install -U "django>=$v1.$v2,<$v1.$(($v2+1))" $env/bin/python$pv runtests.py deactivate echo "" } for v in "1.4" "1.5" "1.6" "1.7" "1.8" "1.9" ; do test $v 2 if [[ ! ( $v =~ ^(1.4)$ ) ]] ; then test $v 3 fi done
set -e if [[ $1 == '--install' ]] ; then install=true else install=false fi function test { v=$1 pv=$2 echo "====================================================================" echo "Testing with Django $v and Python $pv" # Setup virtual environment for the specified Django version if absent. IFS='.' read v1 v2 <<< "$v" env="../env/$pv-$v" if $install ; then env="../env/install-$pv-$v" fi if [ ! -d $env ] ; then virtualenv --no-site-packages -p /usr/bin/python$pv $env fi source $env/bin/activate # Install or upgrade the required Django version. pip install -U "django>=$v1.$v2,<$v1.$(($v2+1))" if $install ; then pip install -U "django-mail-templated" project_dir="../testproject" mkdir $project_dir django-admin startproject testproject $project_dir sed -i -- 's/\(INSTALLED_APPS\s*=\s*\[\)/\1"mail_templated",/' $project_dir/testproject/settings.py $project_dir/manage.py test mail_templated # rm -r $project_dir else $env/bin/python$pv runtests.py fi deactivate echo "" } for v in "1.4" "1.5" "1.6" "1.7" "1.8" "1.9" ; do test $v 2 if [[ ! ( $v =~ ^(1.4)$ ) ]] ; then test $v 3 fi done
Add test of installation from pypi
Add test of installation from pypi
Shell
mit
artemrizhov/django-mail-templated,artemrizhov/django-mail-templated,artemrizhov/django-mail-templated
shell
## Code Before: set -e function test { v=$1 pv=$2 echo "====================================================================" echo "Testing with Django $v and Python $pv" # Setup virtual environment for the specified Django version if absent. IFS='.' read v1 v2 <<< "$v" env="../env$pv-$v" if [ ! -d $env ] ; then virtualenv --no-site-packages -p /usr/bin/python$pv $env fi source $env/bin/activate # Install or upgrade the required Django version. pip install -U "django>=$v1.$v2,<$v1.$(($v2+1))" $env/bin/python$pv runtests.py deactivate echo "" } for v in "1.4" "1.5" "1.6" "1.7" "1.8" "1.9" ; do test $v 2 if [[ ! ( $v =~ ^(1.4)$ ) ]] ; then test $v 3 fi done ## Instruction: Add test of installation from pypi ## Code After: set -e if [[ $1 == '--install' ]] ; then install=true else install=false fi function test { v=$1 pv=$2 echo "====================================================================" echo "Testing with Django $v and Python $pv" # Setup virtual environment for the specified Django version if absent. IFS='.' read v1 v2 <<< "$v" env="../env/$pv-$v" if $install ; then env="../env/install-$pv-$v" fi if [ ! -d $env ] ; then virtualenv --no-site-packages -p /usr/bin/python$pv $env fi source $env/bin/activate # Install or upgrade the required Django version. pip install -U "django>=$v1.$v2,<$v1.$(($v2+1))" if $install ; then pip install -U "django-mail-templated" project_dir="../testproject" mkdir $project_dir django-admin startproject testproject $project_dir sed -i -- 's/\(INSTALLED_APPS\s*=\s*\[\)/\1"mail_templated",/' $project_dir/testproject/settings.py $project_dir/manage.py test mail_templated # rm -r $project_dir else $env/bin/python$pv runtests.py fi deactivate echo "" } for v in "1.4" "1.5" "1.6" "1.7" "1.8" "1.9" ; do test $v 2 if [[ ! ( $v =~ ^(1.4)$ ) ]] ; then test $v 3 fi done
set -e + + if [[ $1 == '--install' ]] ; then + install=true + else + install=false + fi function test { v=$1 pv=$2 echo "====================================================================" echo "Testing with Django $v and Python $pv" # Setup virtual environment for the specified Django version if absent. IFS='.' read v1 v2 <<< "$v" - env="../env$pv-$v" + env="../env/$pv-$v" ? + + if $install ; then + env="../env/install-$pv-$v" + fi if [ ! -d $env ] ; then virtualenv --no-site-packages -p /usr/bin/python$pv $env fi source $env/bin/activate # Install or upgrade the required Django version. pip install -U "django>=$v1.$v2,<$v1.$(($v2+1))" - + if $install ; then + pip install -U "django-mail-templated" + project_dir="../testproject" + mkdir $project_dir + django-admin startproject testproject $project_dir + sed -i -- 's/\(INSTALLED_APPS\s*=\s*\[\)/\1"mail_templated",/' $project_dir/testproject/settings.py + $project_dir/manage.py test mail_templated + # rm -r $project_dir + else - $env/bin/python$pv runtests.py + $env/bin/python$pv runtests.py ? ++++ + fi deactivate echo "" } for v in "1.4" "1.5" "1.6" "1.7" "1.8" "1.9" ; do test $v 2 if [[ ! ( $v =~ ^(1.4)$ ) ]] ; then test $v 3 fi done
24
0.75
21
3
89d2be230f110e5196d15dbc0a61670177e8771a
app/controllers/spree/admin/suppliers_controller.rb
app/controllers/spree/admin/suppliers_controller.rb
module Spree module Admin class SuppliersController < ResourceController respond_to :html end end end
module Spree module Admin class SuppliersController < ResourceController end end end
Remove respond_to as it is not needed
Remove respond_to as it is not needed
Ruby
bsd-3-clause
lenart/spree_suppliers,lenart/spree_suppliers
ruby
## Code Before: module Spree module Admin class SuppliersController < ResourceController respond_to :html end end end ## Instruction: Remove respond_to as it is not needed ## Code After: module Spree module Admin class SuppliersController < ResourceController end end end
module Spree module Admin class SuppliersController < ResourceController - respond_to :html - end end end
2
0.25
0
2
82afe2b391278146a13285bb7e2005ee801c17fc
app/views/search/index.html.erb
app/views/search/index.html.erb
<section id="content" role="main" class="group search ancillary"> <div class="search-container group"> <%= render partial: 'form' %> <div class="group"> <div class="results"> <div class="results-wrapper"> <ul class="results-list"> <%= render collection: @results, partial: "result" %> </ul> </div> </div> </div> </div> </section> <% content_for :extra_headers do %> <link rel="alternate" type="application/json" href="/api/search.json?q=<%= @search_term %>"> <% end %> <% content_for :title, "#{@search_term} | Search | GOV.UK Beta (Test)" %>
<section id="content" role="main" class="group search ancillary"> <div class="search-container group"> <%= render partial: 'form' %> <ul class="results-list"> <%= render collection: @results, partial: "result" %> </ul> </div> </section> <% content_for :extra_headers do %> <link rel="alternate" type="application/json" href="/api/search.json?q=<%= @search_term %>"> <% end %> <% content_for :title, "#{@search_term} | Search | GOV.UK Beta (Test)" %>
Remove some unneeded divs in search results.
Remove some unneeded divs in search results. This is a temporary change that will be replaced with the new search layout shortly
HTML+ERB
mit
alphagov/frontend,alphagov/frontend,alphagov/frontend,alphagov/frontend
html+erb
## Code Before: <section id="content" role="main" class="group search ancillary"> <div class="search-container group"> <%= render partial: 'form' %> <div class="group"> <div class="results"> <div class="results-wrapper"> <ul class="results-list"> <%= render collection: @results, partial: "result" %> </ul> </div> </div> </div> </div> </section> <% content_for :extra_headers do %> <link rel="alternate" type="application/json" href="/api/search.json?q=<%= @search_term %>"> <% end %> <% content_for :title, "#{@search_term} | Search | GOV.UK Beta (Test)" %> ## Instruction: Remove some unneeded divs in search results. This is a temporary change that will be replaced with the new search layout shortly ## Code After: <section id="content" role="main" class="group search ancillary"> <div class="search-container group"> <%= render partial: 'form' %> <ul class="results-list"> <%= render collection: @results, partial: "result" %> </ul> </div> </section> <% content_for :extra_headers do %> <link rel="alternate" type="application/json" href="/api/search.json?q=<%= @search_term %>"> <% end %> <% content_for :title, "#{@search_term} | Search | GOV.UK Beta (Test)" %>
<section id="content" role="main" class="group search ancillary"> <div class="search-container group"> <%= render partial: 'form' %> - <div class="group"> - <div class="results"> - <div class="results-wrapper"> - <ul class="results-list"> ? ------ + <ul class="results-list"> - <%= render collection: @results, partial: "result" %> ? ------ + <%= render collection: @results, partial: "result" %> - </ul> ? ------ + </ul> + - </div> - </div> - </div> </div> </section> <% content_for :extra_headers do %> <link rel="alternate" type="application/json" href="/api/search.json?q=<%= @search_term %>"> <% end %> <% content_for :title, "#{@search_term} | Search | GOV.UK Beta (Test)" %>
13
0.619048
4
9
9e82587382f19c3b9b44093ae056fd68a6cd90c3
app/models/movie.rb
app/models/movie.rb
class Movie < ActiveRecord::Base belongs_to :format end
class Movie < ActiveRecord::Base validates :title, { length: 1..50 } validates :format, { presence: true } validates :length, numericality: { only_integer: true, less_than: 500 } validates :release_year, numericality: { only_integer: true, greater_than: 1800, less_than: 2100 } belongs_to :format end
Add some validations to Movie model (title, format, length, and release_year)
Add some validations to Movie model (title, format, length, and release_year)
Ruby
mit
tra38/Tariq-Movie-Manager,tra38/Tariq-Movie-Manager,tra38/Tariq-Movie-Manager
ruby
## Code Before: class Movie < ActiveRecord::Base belongs_to :format end ## Instruction: Add some validations to Movie model (title, format, length, and release_year) ## Code After: class Movie < ActiveRecord::Base validates :title, { length: 1..50 } validates :format, { presence: true } validates :length, numericality: { only_integer: true, less_than: 500 } validates :release_year, numericality: { only_integer: true, greater_than: 1800, less_than: 2100 } belongs_to :format end
class Movie < ActiveRecord::Base + validates :title, { length: 1..50 } + validates :format, { presence: true } + validates :length, numericality: { only_integer: true, less_than: 500 } + validates :release_year, numericality: { only_integer: true, greater_than: 1800, less_than: 2100 } belongs_to :format end
4
1.333333
4
0
3ef6a3f3d919a80ef9b223273dcd5b272b54d12f
templates/users/user_detail.html
templates/users/user_detail.html
{# (c) Crown Owned Copyright, 2016. Dstl. #} {% extends "layout.html" %} {% block grid_content %} <h2>{{user.slug}}</h2> {% endblock %}
{# (c) Crown Owned Copyright, 2016. Dstl. #} {% extends "layout.html" %} {% block grid_content %} <h1 class="form-title heading-xlarge">User: {% if user.username %} {{user.username}} {% else %} {{user.slug}} {% endif %} </h1> <p class="lede"> Hey there, welcome to this users page. Here's some handy information should you wish to contact them... </p> {% if user.best_way_to_find %} <h3 class="heading-medium">The best way to find this user is:</h3> <div class="panel panel-border-wide"> <p> {{user.best_way_to_find}} </p> </div> {% endif %} {% if user.best_way_to_contact %} <h3 class="heading-medium">The best way to contact this user is:</h3> <div class="panel panel-border-wide"> <p> {{user.best_way_to_contact}} </p> </div> {% endif %} <p> <ul> {% if user.phone %}<li>Phone: {{user.phone}}</li>{% endif %} {% if user.email %}<li>email: <a href="mailto:{{user.email}}">{{user.email}}</a></li>{% endif %} </ul> </p> {% ifequal request.user.slug user.slug %} <hr /> <a href="{% url 'user-updateprofile' request.user.slug %}" class="button">Update your profile</a> {% endifequal %} {% endblock %}
Add user information to user profile page.
Add user information to user profile page.
HTML
mit
dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse
html
## Code Before: {# (c) Crown Owned Copyright, 2016. Dstl. #} {% extends "layout.html" %} {% block grid_content %} <h2>{{user.slug}}</h2> {% endblock %} ## Instruction: Add user information to user profile page. ## Code After: {# (c) Crown Owned Copyright, 2016. Dstl. #} {% extends "layout.html" %} {% block grid_content %} <h1 class="form-title heading-xlarge">User: {% if user.username %} {{user.username}} {% else %} {{user.slug}} {% endif %} </h1> <p class="lede"> Hey there, welcome to this users page. Here's some handy information should you wish to contact them... </p> {% if user.best_way_to_find %} <h3 class="heading-medium">The best way to find this user is:</h3> <div class="panel panel-border-wide"> <p> {{user.best_way_to_find}} </p> </div> {% endif %} {% if user.best_way_to_contact %} <h3 class="heading-medium">The best way to contact this user is:</h3> <div class="panel panel-border-wide"> <p> {{user.best_way_to_contact}} </p> </div> {% endif %} <p> <ul> {% if user.phone %}<li>Phone: {{user.phone}}</li>{% endif %} {% if user.email %}<li>email: <a href="mailto:{{user.email}}">{{user.email}}</a></li>{% endif %} </ul> </p> {% ifequal request.user.slug user.slug %} <hr /> <a href="{% url 'user-updateprofile' request.user.slug %}" class="button">Update your profile</a> {% endifequal %} {% endblock %}
{# (c) Crown Owned Copyright, 2016. Dstl. #} {% extends "layout.html" %} {% block grid_content %} - <h2>{{user.slug}}</h2> + <h1 class="form-title heading-xlarge">User: + {% if user.username %} + {{user.username}} + {% else %} + {{user.slug}} + {% endif %} + </h1> + + <p class="lede"> + Hey there, welcome to this users page. Here's some handy information should + you wish to contact them... + </p> + + {% if user.best_way_to_find %} + <h3 class="heading-medium">The best way to find this user is:</h3> + <div class="panel panel-border-wide"> + <p> + {{user.best_way_to_find}} + </p> + </div> + {% endif %} + + {% if user.best_way_to_contact %} + <h3 class="heading-medium">The best way to contact this user is:</h3> + <div class="panel panel-border-wide"> + <p> + {{user.best_way_to_contact}} + </p> + </div> + {% endif %} + + <p> + <ul> + {% if user.phone %}<li>Phone: {{user.phone}}</li>{% endif %} + {% if user.email %}<li>email: <a href="mailto:{{user.email}}">{{user.email}}</a></li>{% endif %} + </ul> + </p> + + {% ifequal request.user.slug user.slug %} + <hr /> + <a href="{% url 'user-updateprofile' request.user.slug %}" class="button">Update your profile</a> + {% endifequal %} {% endblock %}
43
5.375
42
1
8e2e1a8febf8660895e6475638d44a62a26114d8
circle.yml
circle.yml
machine: # Version of Node.js to use: node: version: 6 # Custom environment dependencies: dependencies: override: - 'nvm install node && nvm use node && npm update -g npm' - 'nvm install 6 && nvm use 6 && npm update -g npm' - 'nvm install 5 && nvm use 5 && npm update -g npm' - 'nvm install 4 && nvm use 4 && npm update -g npm' - 'nvm install 3 && nvm use 3 && npm update -g npm' - 'nvm install 2 && nvm use 2 && npm update -g npm' - 'nvm install 1 && nvm use 1 && npm update -g npm' - 'nvm install 0.12 && nvm use 0.12 && npm update -g npm' - 'nvm install 0.10 && nvm use 0.10 && npm update -g npm' # Custom test commands: test: override: - chmod +x ./tools/ci/circle - ./tools/ci/circle
machine: # Version of Node.js to use: node: version: 6 # Custom environment dependencies: dependencies: override: - 'nvm install node && nvm use node && npm update -g npm' - 'nvm install 6 && nvm use 6 && npm update -g npm' - 'nvm install 5 && nvm use 5 && npm update -g npm' - 'nvm install 4 && nvm use 4 && npm update -g npm' - 'nvm install 3 && nvm use 3 && npm update -g npm' - 'nvm install 2 && nvm use 2 && npm update -g npm' - 'nvm install 1 && nvm use 1 && npm update -g npm' - 'nvm install 0.12 && nvm use 0.12 && npm update -g npm' - 'nvm install 0.10 && nvm use 0.10 && npm update -g npm' # Custom test commands: test: override: - 'chmod +x ./tools/ci/circle && ./tools/ci/circle': parallel: true
Set the `parallel` command modifier
Set the `parallel` command modifier
YAML
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
yaml
## Code Before: machine: # Version of Node.js to use: node: version: 6 # Custom environment dependencies: dependencies: override: - 'nvm install node && nvm use node && npm update -g npm' - 'nvm install 6 && nvm use 6 && npm update -g npm' - 'nvm install 5 && nvm use 5 && npm update -g npm' - 'nvm install 4 && nvm use 4 && npm update -g npm' - 'nvm install 3 && nvm use 3 && npm update -g npm' - 'nvm install 2 && nvm use 2 && npm update -g npm' - 'nvm install 1 && nvm use 1 && npm update -g npm' - 'nvm install 0.12 && nvm use 0.12 && npm update -g npm' - 'nvm install 0.10 && nvm use 0.10 && npm update -g npm' # Custom test commands: test: override: - chmod +x ./tools/ci/circle - ./tools/ci/circle ## Instruction: Set the `parallel` command modifier ## Code After: machine: # Version of Node.js to use: node: version: 6 # Custom environment dependencies: dependencies: override: - 'nvm install node && nvm use node && npm update -g npm' - 'nvm install 6 && nvm use 6 && npm update -g npm' - 'nvm install 5 && nvm use 5 && npm update -g npm' - 'nvm install 4 && nvm use 4 && npm update -g npm' - 'nvm install 3 && nvm use 3 && npm update -g npm' - 'nvm install 2 && nvm use 2 && npm update -g npm' - 'nvm install 1 && nvm use 1 && npm update -g npm' - 'nvm install 0.12 && nvm use 0.12 && npm update -g npm' - 'nvm install 0.10 && nvm use 0.10 && npm update -g npm' # Custom test commands: test: override: - 'chmod +x ./tools/ci/circle && ./tools/ci/circle': parallel: true
machine: # Version of Node.js to use: node: version: 6 # Custom environment dependencies: dependencies: override: - 'nvm install node && nvm use node && npm update -g npm' - 'nvm install 6 && nvm use 6 && npm update -g npm' - 'nvm install 5 && nvm use 5 && npm update -g npm' - 'nvm install 4 && nvm use 4 && npm update -g npm' - 'nvm install 3 && nvm use 3 && npm update -g npm' - 'nvm install 2 && nvm use 2 && npm update -g npm' - 'nvm install 1 && nvm use 1 && npm update -g npm' - 'nvm install 0.12 && nvm use 0.12 && npm update -g npm' - 'nvm install 0.10 && nvm use 0.10 && npm update -g npm' # Custom test commands: test: override: - - chmod +x ./tools/ci/circle - - ./tools/ci/circle + - 'chmod +x ./tools/ci/circle && ./tools/ci/circle': + parallel: true
4
0.153846
2
2
3f35cee68ed7b2a53a847e4b891b9e29b840df02
README.md
README.md
This is an example project to demonstrate [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) and [Swinject](https://github.com/Swinject/Swinject) in a simple weather app that lists current weather information at some locations. ![Screenshot](Assets/SwinjectSimpleExampleScreenshot.png) ## Requirements - Xcode 7 beta 5 - [CocoaPods](https://cocoapods.org) 0.38 or later ## Installation 1. Download the source code or clone the repository. 2. Run `pod install`. 3. Get a free API key from [OpenWeatherMap](http://openweathermap.org). 4. Open `OpenWeatherMap.swift` and fill `apiKey = ""` with your own API key. ## Blog Post The following blog post demonstrates step-by-step development of this project introducing dependency injection and Swinject. - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 1/2](http://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-1/) ## License MIT license. See the `LICENSE` file for details.
This is an example project to demonstrate [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) and [Swinject](https://github.com/Swinject/Swinject) in a simple weather app that lists current weather information at some locations. ![Screenshot](Assets/SwinjectSimpleExampleScreenshot.png) ## Requirements - Xcode 7 beta 5 - [CocoaPods](https://cocoapods.org) 0.38 or later ## Installation 1. Download the source code or clone the repository. 2. Run `pod install`. 3. Get a free API key from [OpenWeatherMap](http://openweathermap.org). 4. Open `OpenWeatherMap.swift` and fill `apiKey = ""` with your own API key. ## Blog Post The following blog post demonstrates step-by-step development of this project introducing dependency injection and Swinject. - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 1/2](https://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-1/) - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 2/2](https://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-2/) ## License MIT license. See the `LICENSE` file for details.
Update readme to add the link to the second blog about the example app.
Update readme to add the link to the second blog about the example app.
Markdown
mit
yoichitgy/SwinjectSimpleExample,Swinject/SwinjectSimpleExample,Swinject/SwinjectSimpleExample,yoichitgy/SwinjectSimpleExample
markdown
## Code Before: This is an example project to demonstrate [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) and [Swinject](https://github.com/Swinject/Swinject) in a simple weather app that lists current weather information at some locations. ![Screenshot](Assets/SwinjectSimpleExampleScreenshot.png) ## Requirements - Xcode 7 beta 5 - [CocoaPods](https://cocoapods.org) 0.38 or later ## Installation 1. Download the source code or clone the repository. 2. Run `pod install`. 3. Get a free API key from [OpenWeatherMap](http://openweathermap.org). 4. Open `OpenWeatherMap.swift` and fill `apiKey = ""` with your own API key. ## Blog Post The following blog post demonstrates step-by-step development of this project introducing dependency injection and Swinject. - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 1/2](http://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-1/) ## License MIT license. See the `LICENSE` file for details. ## Instruction: Update readme to add the link to the second blog about the example app. ## Code After: This is an example project to demonstrate [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) and [Swinject](https://github.com/Swinject/Swinject) in a simple weather app that lists current weather information at some locations. ![Screenshot](Assets/SwinjectSimpleExampleScreenshot.png) ## Requirements - Xcode 7 beta 5 - [CocoaPods](https://cocoapods.org) 0.38 or later ## Installation 1. Download the source code or clone the repository. 2. Run `pod install`. 3. Get a free API key from [OpenWeatherMap](http://openweathermap.org). 4. Open `OpenWeatherMap.swift` and fill `apiKey = ""` with your own API key. ## Blog Post The following blog post demonstrates step-by-step development of this project introducing dependency injection and Swinject. - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 1/2](https://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-1/) - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 2/2](https://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-2/) ## License MIT license. See the `LICENSE` file for details.
This is an example project to demonstrate [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) and [Swinject](https://github.com/Swinject/Swinject) in a simple weather app that lists current weather information at some locations. ![Screenshot](Assets/SwinjectSimpleExampleScreenshot.png) ## Requirements - Xcode 7 beta 5 - [CocoaPods](https://cocoapods.org) 0.38 or later ## Installation 1. Download the source code or clone the repository. 2. Run `pod install`. 3. Get a free API key from [OpenWeatherMap](http://openweathermap.org). 4. Open `OpenWeatherMap.swift` and fill `apiKey = ""` with your own API key. ## Blog Post The following blog post demonstrates step-by-step development of this project introducing dependency injection and Swinject. - - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 1/2](http://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-1/) + - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 1/2](https://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-1/) ? + + - [Dependency Injection Framework for Swift - Simple Weather App Example with Swinject Part 2/2](https://yoichitgy.github.io/post/dependency-injection-framework-for-swift-simple-weather-app-example-with-swinject-part-2/) ## License MIT license. See the `LICENSE` file for details.
3
0.115385
2
1
bbfc91f5c516b950e99639bf942b7e0ffc8db7e8
index.html
index.html
--- layout: default title: Developing User Experience Design --- <h1>{{ page.title }}</h1> <div class="lead">Learn the basic frontend techniques to build wireframes and prototypes with code</div> <nav class="row"> <ul class="col-md-6 nav nav-pills nav-justified"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Profile</a></li> <li><a href="#">Messages</a></li> </ul> </nav>
--- layout: default title: Developing User Experience Design --- <h1>{{ page.title }}</h1> <div class="lead">Learn the basic frontend techniques to build wireframes and prototypes with code</div> <nav class="row"> <ul class="col-md-6 nav nav-pills nav-justified"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Workshop</a></li> <li><a href="#">Articles</a></li> <li><a href="#">Projects</a></li> </ul> </nav> <article> <h1 class="text-center">Let's get started</h1> <section class="panel panel-default"> <header class="panel-heading"> <h3 class="panel-title">Setup your computer</h3> </header> <section class="panel-body"> Panel content </section> </section> </article>
Update nav and add first panel
Update nav and add first panel
HTML
mit
developinguxd/developinguxd.github.io,developinguxd/developinguxd.github.io,developinguxd/developinguxd.github.io,developinguxd/developinguxd.github.io
html
## Code Before: --- layout: default title: Developing User Experience Design --- <h1>{{ page.title }}</h1> <div class="lead">Learn the basic frontend techniques to build wireframes and prototypes with code</div> <nav class="row"> <ul class="col-md-6 nav nav-pills nav-justified"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Profile</a></li> <li><a href="#">Messages</a></li> </ul> </nav> ## Instruction: Update nav and add first panel ## Code After: --- layout: default title: Developing User Experience Design --- <h1>{{ page.title }}</h1> <div class="lead">Learn the basic frontend techniques to build wireframes and prototypes with code</div> <nav class="row"> <ul class="col-md-6 nav nav-pills nav-justified"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Workshop</a></li> <li><a href="#">Articles</a></li> <li><a href="#">Projects</a></li> </ul> </nav> <article> <h1 class="text-center">Let's get started</h1> <section class="panel panel-default"> <header class="panel-heading"> <h3 class="panel-title">Setup your computer</h3> </header> <section class="panel-body"> Panel content </section> </section> </article>
--- layout: default title: Developing User Experience Design --- <h1>{{ page.title }}</h1> <div class="lead">Learn the basic frontend techniques to build wireframes and prototypes with code</div> <nav class="row"> <ul class="col-md-6 nav nav-pills nav-justified"> <li class="active"><a href="#">Home</a></li> + <li><a href="#">Workshop</a></li> - <li><a href="#">Profile</a></li> ? ^ ^^ + <li><a href="#">Articles</a></li> ? ^ ^ + + - <li><a href="#">Messages</a></li> ? ^ ^^^^^ + <li><a href="#">Projects</a></li> ? ^^^^ ^^ </ul> </nav> + + <article> + <h1 class="text-center">Let's get started</h1> + <section class="panel panel-default"> + <header class="panel-heading"> + <h3 class="panel-title">Setup your computer</h3> + </header> + <section class="panel-body"> + Panel content + </section> + </section> + </article>
17
1.133333
15
2