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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
765b58a42268cd93da5341bcf56d0f82744c0561 | packages/ye/yes-precure5-command.yaml | packages/ye/yes-precure5-command.yaml | homepage: https://github.com/igrep/yes-precure5-command/
changelog-type: ''
hash: f1ffb56433d21fc0a9db361fe4b47a4bd9b0e030d9aeca1d34e96488e567e19d
test-bench-deps:
base: ==4.*
hspec: ! '>=1.3'
yes-precure5-command: -any
containers: -any
QuickCheck: -any
maintainer: YAMAMOTO Yuji <whosekiteneverfly@gmail.com>
synopsis: Extended yes command to reproduce phrases in Yes! Precure 5.
changelog: ''
basic-deps:
Cabal: ! '>=1.18'
base: ==4.*
yes-precure5-command: -any
parsec: ! '>=3.0'
containers: -any
mtl: -any
random: -any
all-versions:
- '5'
- '5.0.1'
- '5.5'
- '5.5.1'
author: YAMAMOTO Yuji
latest: '5.5.1'
description-type: haddock
description: ! 'Provides extended yes command to reproduce phrases in Yes! Precure
5 or Yes! PreCure5 GoGo!
See <https://github.com/igrep/yes-precure5-command/blob/master/README.mkd> for details.'
license-name: MIT
| homepage: https://github.com/igrep/yes-precure5-command/
changelog-type: ''
hash: bfca9d4564f761c3501188b6b451e327060e61810cb8a709bf17cc90fbfec69b
test-bench-deps:
base: ==4.*
hspec: ! '>=1.3'
yes-precure5-command: -any
containers: -any
QuickCheck: -any
maintainer: YAMAMOTO Yuji <whosekiteneverfly@gmail.com>
synopsis: Extended yes command to reproduce phrases in Yes! Precure 5.
changelog: ''
basic-deps:
Cabal: ! '>=1.18'
base: ==4.*
yes-precure5-command: -any
parsec: ! '>=3.0'
containers: -any
mtl: -any
random: -any
all-versions:
- '5'
- '5.0.1'
- '5.5'
- '5.5.1'
- '5.5.2'
author: YAMAMOTO Yuji
latest: '5.5.2'
description-type: haddock
description: ! 'Provides extended yes command to reproduce phrases in Yes! Precure
5 or Yes! PreCure5 GoGo!
See <https://github.com/igrep/yes-precure5-command/blob/master/README.mkd> for details.'
license-name: MIT
| Update from Hackage at 2015-12-23T05:16:17+0000 | Update from Hackage at 2015-12-23T05:16:17+0000
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/igrep/yes-precure5-command/
changelog-type: ''
hash: f1ffb56433d21fc0a9db361fe4b47a4bd9b0e030d9aeca1d34e96488e567e19d
test-bench-deps:
base: ==4.*
hspec: ! '>=1.3'
yes-precure5-command: -any
containers: -any
QuickCheck: -any
maintainer: YAMAMOTO Yuji <whosekiteneverfly@gmail.com>
synopsis: Extended yes command to reproduce phrases in Yes! Precure 5.
changelog: ''
basic-deps:
Cabal: ! '>=1.18'
base: ==4.*
yes-precure5-command: -any
parsec: ! '>=3.0'
containers: -any
mtl: -any
random: -any
all-versions:
- '5'
- '5.0.1'
- '5.5'
- '5.5.1'
author: YAMAMOTO Yuji
latest: '5.5.1'
description-type: haddock
description: ! 'Provides extended yes command to reproduce phrases in Yes! Precure
5 or Yes! PreCure5 GoGo!
See <https://github.com/igrep/yes-precure5-command/blob/master/README.mkd> for details.'
license-name: MIT
## Instruction:
Update from Hackage at 2015-12-23T05:16:17+0000
## Code After:
homepage: https://github.com/igrep/yes-precure5-command/
changelog-type: ''
hash: bfca9d4564f761c3501188b6b451e327060e61810cb8a709bf17cc90fbfec69b
test-bench-deps:
base: ==4.*
hspec: ! '>=1.3'
yes-precure5-command: -any
containers: -any
QuickCheck: -any
maintainer: YAMAMOTO Yuji <whosekiteneverfly@gmail.com>
synopsis: Extended yes command to reproduce phrases in Yes! Precure 5.
changelog: ''
basic-deps:
Cabal: ! '>=1.18'
base: ==4.*
yes-precure5-command: -any
parsec: ! '>=3.0'
containers: -any
mtl: -any
random: -any
all-versions:
- '5'
- '5.0.1'
- '5.5'
- '5.5.1'
- '5.5.2'
author: YAMAMOTO Yuji
latest: '5.5.2'
description-type: haddock
description: ! 'Provides extended yes command to reproduce phrases in Yes! Precure
5 or Yes! PreCure5 GoGo!
See <https://github.com/igrep/yes-precure5-command/blob/master/README.mkd> for details.'
license-name: MIT
| homepage: https://github.com/igrep/yes-precure5-command/
changelog-type: ''
- hash: f1ffb56433d21fc0a9db361fe4b47a4bd9b0e030d9aeca1d34e96488e567e19d
+ hash: bfca9d4564f761c3501188b6b451e327060e61810cb8a709bf17cc90fbfec69b
test-bench-deps:
base: ==4.*
hspec: ! '>=1.3'
yes-precure5-command: -any
containers: -any
QuickCheck: -any
maintainer: YAMAMOTO Yuji <whosekiteneverfly@gmail.com>
synopsis: Extended yes command to reproduce phrases in Yes! Precure 5.
changelog: ''
basic-deps:
Cabal: ! '>=1.18'
base: ==4.*
yes-precure5-command: -any
parsec: ! '>=3.0'
containers: -any
mtl: -any
random: -any
all-versions:
- '5'
- '5.0.1'
- '5.5'
- '5.5.1'
+ - '5.5.2'
author: YAMAMOTO Yuji
- latest: '5.5.1'
? ^
+ latest: '5.5.2'
? ^
description-type: haddock
description: ! 'Provides extended yes command to reproduce phrases in Yes! Precure
5 or Yes! PreCure5 GoGo!
See <https://github.com/igrep/yes-precure5-command/blob/master/README.mkd> for details.'
license-name: MIT | 5 | 0.147059 | 3 | 2 |
8c7fb105fbc751c28917c29412252ebfc37124cf | app.rb | app.rb | require 'rubygems'
require 'bundler'
Bundler.require
class SpaceHolder < Sinatra::Base
set :server, :puma
set :views, "#{settings.root}/app/views"
set :assets_css_compressor, :sass
set :assets_precompile, %w(application.css *.png *.svg *.woff *.woff2)
set :assets_prefix, %w(app/assets)
register Sinatra::AssetPipeline
get '/' do
erb :index
end
post '/' do
if params[:width].length > 0 && params[:height].length > 0
redirect %{/#{params[:width]}x#{params[:height]}}
else
erb :index
end
end
get %r{^/((?:[1-4]?\d{1,3}|5000))(x(?:[1-4]?\d{1,3}|5000))?$} do |width, height|
content_type :jpg
dimensions = height ? "#{width}#{height}" : "#{width}x#{width}"
Image.new(dimensions).manipulate.to_blob
end
not_found do
erb :'404'
end
end
Dir.glob('./app/**/*.rb', &method(:require))
| require 'rubygems'
require 'bundler'
Bundler.require
class SpaceHolder < Sinatra::Base
set :server, :puma
set :protection, :except => [:frame_options, :xss_header]
set :views, "#{settings.root}/app/views"
set :assets_css_compressor, :sass
set :assets_precompile, %w(application.css *.png *.svg *.woff *.woff2)
set :assets_prefix, %w(app/assets)
register Sinatra::AssetPipeline
get '/' do
erb :index
end
post '/' do
if params[:width].length > 0 && params[:height].length > 0
redirect %{/#{params[:width]}x#{params[:height]}}
else
erb :index
end
end
get %r{^/((?:[1-4]?\d{1,3}|5000))(x(?:[1-4]?\d{1,3}|5000))?$} do |width, height|
content_type :jpg
dimensions = height ? "#{width}#{height}" : "#{width}x#{width}"
Image.new(dimensions).manipulate.to_blob
end
not_found do
erb :'404'
end
end
Dir.glob('./app/**/*.rb', &method(:require))
| Disable Rack::Protection X-* headers as NGINX handles this. | Disable Rack::Protection X-* headers as NGINX handles this.
| Ruby | mit | jgarber623/spaceholder.cc,jgarber623/spaceholder.cc,jgarber623/spaceholder.cc | ruby | ## Code Before:
require 'rubygems'
require 'bundler'
Bundler.require
class SpaceHolder < Sinatra::Base
set :server, :puma
set :views, "#{settings.root}/app/views"
set :assets_css_compressor, :sass
set :assets_precompile, %w(application.css *.png *.svg *.woff *.woff2)
set :assets_prefix, %w(app/assets)
register Sinatra::AssetPipeline
get '/' do
erb :index
end
post '/' do
if params[:width].length > 0 && params[:height].length > 0
redirect %{/#{params[:width]}x#{params[:height]}}
else
erb :index
end
end
get %r{^/((?:[1-4]?\d{1,3}|5000))(x(?:[1-4]?\d{1,3}|5000))?$} do |width, height|
content_type :jpg
dimensions = height ? "#{width}#{height}" : "#{width}x#{width}"
Image.new(dimensions).manipulate.to_blob
end
not_found do
erb :'404'
end
end
Dir.glob('./app/**/*.rb', &method(:require))
## Instruction:
Disable Rack::Protection X-* headers as NGINX handles this.
## Code After:
require 'rubygems'
require 'bundler'
Bundler.require
class SpaceHolder < Sinatra::Base
set :server, :puma
set :protection, :except => [:frame_options, :xss_header]
set :views, "#{settings.root}/app/views"
set :assets_css_compressor, :sass
set :assets_precompile, %w(application.css *.png *.svg *.woff *.woff2)
set :assets_prefix, %w(app/assets)
register Sinatra::AssetPipeline
get '/' do
erb :index
end
post '/' do
if params[:width].length > 0 && params[:height].length > 0
redirect %{/#{params[:width]}x#{params[:height]}}
else
erb :index
end
end
get %r{^/((?:[1-4]?\d{1,3}|5000))(x(?:[1-4]?\d{1,3}|5000))?$} do |width, height|
content_type :jpg
dimensions = height ? "#{width}#{height}" : "#{width}x#{width}"
Image.new(dimensions).manipulate.to_blob
end
not_found do
erb :'404'
end
end
Dir.glob('./app/**/*.rb', &method(:require))
| require 'rubygems'
require 'bundler'
Bundler.require
class SpaceHolder < Sinatra::Base
set :server, :puma
+ set :protection, :except => [:frame_options, :xss_header]
set :views, "#{settings.root}/app/views"
set :assets_css_compressor, :sass
set :assets_precompile, %w(application.css *.png *.svg *.woff *.woff2)
set :assets_prefix, %w(app/assets)
register Sinatra::AssetPipeline
get '/' do
erb :index
end
post '/' do
if params[:width].length > 0 && params[:height].length > 0
redirect %{/#{params[:width]}x#{params[:height]}}
else
erb :index
end
end
get %r{^/((?:[1-4]?\d{1,3}|5000))(x(?:[1-4]?\d{1,3}|5000))?$} do |width, height|
content_type :jpg
dimensions = height ? "#{width}#{height}" : "#{width}x#{width}"
Image.new(dimensions).manipulate.to_blob
end
not_found do
erb :'404'
end
end
Dir.glob('./app/**/*.rb', &method(:require)) | 1 | 0.02439 | 1 | 0 |
a35114a214b2813970bf7d57dd86d4507aa6f513 | src/compiler/reia_annotator.erl | src/compiler/reia_annotator.erl | -module(reia_annotator).
-export([annotate/1]).
-include("reia_nodes.hrl").
% Internal state of the annotator
-record(state, {scope=normal, bindings=dict:new()}).
annotate(Node) ->
{Node2, _State} = reia_syntax:mapfold_subtrees(
fun annotate/2,
#state{},
Node
),
Node2.
% Match expressions mutate variables on the LHS
annotate(#match{} = Node, State) ->
{Right, State2} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State,
Node#match.right
),
{Left, State3} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State2#state{scope=match},
Node#match.left
),
Node2 = Node#match{left=Left, right=Right},
State4 = State3#state{scope=State#state.scope},
{Node2, State4};
annotate(Node, State) ->
io:format("annotating: ~p~n", [Node]),
{Node, State}.
| -module(reia_annotator).
-export([annotate/1]).
-include("reia_nodes.hrl").
% Internal state of the annotator
-record(state, {scope=normal, bindings=dict:new()}).
annotate(Node) ->
{Node2, _State} = reia_syntax:mapfold_subtrees(
fun annotate/2,
#state{},
Node
),
Node2.
% Walk the LHS of a match expression in match scope
annotate(#match{} = Node, State) ->
{Right, State2} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State,
Node#match.right
),
{Left, State3} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State2#state{scope=match},
Node#match.left
),
Node2 = Node#match{left=Left, right=Right},
State4 = State3#state{scope=State#state.scope},
{Node2, State4};
% Variables are (re)bound while in match scope
annotate(#identifier{name=Name} = Node, #state{scope=match} = State) ->
NewBindings = case dict:find(Name, State#state.bindings) of
{ok, Version} -> dict:store(Name, Version + 1);
error -> dict:store(Name, 0)
end,
{Node, State#state{bindings=NewBindings}};
annotate(Node, State) ->
io:format("annotating: ~p~n", [Node]),
{Node, State}.
| Update bindings dict when match expressions are encountered | Update bindings dict when match expressions are encountered
| Erlang | mit | tarcieri/reia,beni55/reia,beni55/reia,tarcieri/reia | erlang | ## Code Before:
-module(reia_annotator).
-export([annotate/1]).
-include("reia_nodes.hrl").
% Internal state of the annotator
-record(state, {scope=normal, bindings=dict:new()}).
annotate(Node) ->
{Node2, _State} = reia_syntax:mapfold_subtrees(
fun annotate/2,
#state{},
Node
),
Node2.
% Match expressions mutate variables on the LHS
annotate(#match{} = Node, State) ->
{Right, State2} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State,
Node#match.right
),
{Left, State3} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State2#state{scope=match},
Node#match.left
),
Node2 = Node#match{left=Left, right=Right},
State4 = State3#state{scope=State#state.scope},
{Node2, State4};
annotate(Node, State) ->
io:format("annotating: ~p~n", [Node]),
{Node, State}.
## Instruction:
Update bindings dict when match expressions are encountered
## Code After:
-module(reia_annotator).
-export([annotate/1]).
-include("reia_nodes.hrl").
% Internal state of the annotator
-record(state, {scope=normal, bindings=dict:new()}).
annotate(Node) ->
{Node2, _State} = reia_syntax:mapfold_subtrees(
fun annotate/2,
#state{},
Node
),
Node2.
% Walk the LHS of a match expression in match scope
annotate(#match{} = Node, State) ->
{Right, State2} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State,
Node#match.right
),
{Left, State3} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State2#state{scope=match},
Node#match.left
),
Node2 = Node#match{left=Left, right=Right},
State4 = State3#state{scope=State#state.scope},
{Node2, State4};
% Variables are (re)bound while in match scope
annotate(#identifier{name=Name} = Node, #state{scope=match} = State) ->
NewBindings = case dict:find(Name, State#state.bindings) of
{ok, Version} -> dict:store(Name, Version + 1);
error -> dict:store(Name, 0)
end,
{Node, State#state{bindings=NewBindings}};
annotate(Node, State) ->
io:format("annotating: ~p~n", [Node]),
{Node, State}.
| -module(reia_annotator).
-export([annotate/1]).
-include("reia_nodes.hrl").
% Internal state of the annotator
-record(state, {scope=normal, bindings=dict:new()}).
annotate(Node) ->
{Node2, _State} = reia_syntax:mapfold_subtrees(
fun annotate/2,
#state{},
Node
),
Node2.
- % Match expressions mutate variables on the LHS
+ % Walk the LHS of a match expression in match scope
annotate(#match{} = Node, State) ->
{Right, State2} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State,
Node#match.right
),
{Left, State3} = reia_syntax:mapfold_subtrees(
fun annotate/2,
State2#state{scope=match},
Node#match.left
),
Node2 = Node#match{left=Left, right=Right},
State4 = State3#state{scope=State#state.scope},
{Node2, State4};
+ % Variables are (re)bound while in match scope
+ annotate(#identifier{name=Name} = Node, #state{scope=match} = State) ->
+ NewBindings = case dict:find(Name, State#state.bindings) of
+ {ok, Version} -> dict:store(Name, Version + 1);
+ error -> dict:store(Name, 0)
+ end,
+ {Node, State#state{bindings=NewBindings}};
+
annotate(Node, State) ->
io:format("annotating: ~p~n", [Node]),
{Node, State}. | 10 | 0.277778 | 9 | 1 |
2c874f64a443cb68485d6cf50da42cbe79908a10 | db/migrations/010_add_indexes_on_uuid_resources.rb | db/migrations/010_add_indexes_on_uuid_resources.rb | ::Sequel.migration do
change do
alter_table(:uuid_resources) do
add_index :uuid
add_index [:model_class, :key]
end
end
end
| ::Sequel.migration do
change do
alter_table(:uuid_resources) do
add_index :uuid
add_index [:key, :model_class]
end
end
end
| Update index order to be able to use where clause with 'key' only | Update index order to be able to use where clause with 'key' only
| Ruby | mit | sanger/lims-laboratory-app,sanger/lims-laboratory-app,sanger/lims-laboratory-app | ruby | ## Code Before:
::Sequel.migration do
change do
alter_table(:uuid_resources) do
add_index :uuid
add_index [:model_class, :key]
end
end
end
## Instruction:
Update index order to be able to use where clause with 'key' only
## Code After:
::Sequel.migration do
change do
alter_table(:uuid_resources) do
add_index :uuid
add_index [:key, :model_class]
end
end
end
| ::Sequel.migration do
change do
alter_table(:uuid_resources) do
add_index :uuid
- add_index [:model_class, :key]
? ------
+ add_index [:key, :model_class]
? ++++++
end
end
end | 2 | 0.25 | 1 | 1 |
ad6140671d0591a0c0e3d460c8ac5ac09667ccc7 | lib/ebay/types/name_value_list.rb | lib/ebay/types/name_value_list.rb |
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# text_node :name, 'Name', :optional => true
# text_node :value, 'Value', :optional => true
# text_node :source, 'Source', :optional => true
class NameValueList
include XML::Mapping
include Initializer
root_element_name 'NameValueList'
text_node :name, 'Name', :optional => true
text_node :value, 'Value', :optional => true
text_node :source, 'Source', :optional => true
end
end
end
|
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# text_node :name, 'Name', :optional => true
# text_node :value, 'Value', :optional => true
# text_node :source, 'Source', :optional => true
class NameValueList
include XML::Mapping
include Initializer
root_element_name 'NameValueList'
text_node :name, 'Name', :optional => true
text_node :value, 'Value', :optional => true
array_node :values, 'Value', :optional => true, class: String
text_node :source, 'Source', :optional => true
end
end
end
| Add workaround for accepting array of values within NameValueList | Add workaround for accepting array of values within NameValueList
For example as it is required for VariationSpecificsSet
| Ruby | mit | main24/ebayapi-19,main24/ebayapi-19 | ruby | ## Code Before:
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# text_node :name, 'Name', :optional => true
# text_node :value, 'Value', :optional => true
# text_node :source, 'Source', :optional => true
class NameValueList
include XML::Mapping
include Initializer
root_element_name 'NameValueList'
text_node :name, 'Name', :optional => true
text_node :value, 'Value', :optional => true
text_node :source, 'Source', :optional => true
end
end
end
## Instruction:
Add workaround for accepting array of values within NameValueList
For example as it is required for VariationSpecificsSet
## Code After:
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# text_node :name, 'Name', :optional => true
# text_node :value, 'Value', :optional => true
# text_node :source, 'Source', :optional => true
class NameValueList
include XML::Mapping
include Initializer
root_element_name 'NameValueList'
text_node :name, 'Name', :optional => true
text_node :value, 'Value', :optional => true
array_node :values, 'Value', :optional => true, class: String
text_node :source, 'Source', :optional => true
end
end
end
|
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# text_node :name, 'Name', :optional => true
# text_node :value, 'Value', :optional => true
# text_node :source, 'Source', :optional => true
class NameValueList
include XML::Mapping
include Initializer
root_element_name 'NameValueList'
text_node :name, 'Name', :optional => true
text_node :value, 'Value', :optional => true
+ array_node :values, 'Value', :optional => true, class: String
text_node :source, 'Source', :optional => true
end
end
end
| 1 | 0.052632 | 1 | 0 |
83a23a7183bdb68a71468965508be5bd64877c23 | src/app/controllers/HomeController.js | src/app/controllers/HomeController.js | 'use strict';
angular.module('app.controllers')
.controller('HomeController', ['$scope', '$state', 'fileModel', 'imageModel', function HomeController($scope, $state, fileModel, imageModel) {
// private
var _this = {
onCreate: function() {
if(imageModel.getImages().length === 0) {
$scope.loading(true);
imageModel.loadImages()
.then(function() {
$scope.loading(false);
});
}
}
};
// public
$scope.model = imageModel;
/**
* Triggered when the user presses the upload button in the navigation bar.
*/
$scope.upload = function(file) {
if(file && file.length) {
// Set the file
fileModel.setFile(file[0]);
// Navigate to the upload state
$state.go('upload');
}
};
$scope.loadMore = function() {
if(!$scope._data.loading) {
$scope.loading(true);
imageModel.loadMore()
.then(function() {
$scope.loading(false);
});
}
};
// Initialize the controller
_this.onCreate();
}]); | 'use strict';
angular.module('app.controllers')
.controller('HomeController', ['$scope', '$state', 'fileModel', 'imageModel', function HomeController($scope, $state, fileModel, imageModel) {
// private
var _this = {
onCreate: function() {
if(imageModel.getImages().length === 0) {
$scope.loading(true);
imageModel.loadImages()
.finally(function() {
$scope.loading(false);
});
}
}
};
// public
$scope.model = imageModel;
/**
* Triggered when the user presses the upload button in the navigation bar.
*/
$scope.upload = function(file) {
if(file && file.length) {
// Set the file
fileModel.setFile(file[0]);
// Navigate to the upload state
$state.go('upload');
}
};
$scope.loadMore = function() {
if(!$scope._data.loading) {
$scope.loading(true);
imageModel.loadMore()
.finally(function() {
$scope.loading(false);
});
}
};
// Initialize the controller
_this.onCreate();
}]); | Stop the loader in the finally to make sure it allways stops | Stop the loader in the finally to make sure it allways stops
| JavaScript | mit | SamVerschueren/imagery,SamVerschueren/selfie-wall,SamVerschueren/selfie-wall,SamVerschueren/imagery | javascript | ## Code Before:
'use strict';
angular.module('app.controllers')
.controller('HomeController', ['$scope', '$state', 'fileModel', 'imageModel', function HomeController($scope, $state, fileModel, imageModel) {
// private
var _this = {
onCreate: function() {
if(imageModel.getImages().length === 0) {
$scope.loading(true);
imageModel.loadImages()
.then(function() {
$scope.loading(false);
});
}
}
};
// public
$scope.model = imageModel;
/**
* Triggered when the user presses the upload button in the navigation bar.
*/
$scope.upload = function(file) {
if(file && file.length) {
// Set the file
fileModel.setFile(file[0]);
// Navigate to the upload state
$state.go('upload');
}
};
$scope.loadMore = function() {
if(!$scope._data.loading) {
$scope.loading(true);
imageModel.loadMore()
.then(function() {
$scope.loading(false);
});
}
};
// Initialize the controller
_this.onCreate();
}]);
## Instruction:
Stop the loader in the finally to make sure it allways stops
## Code After:
'use strict';
angular.module('app.controllers')
.controller('HomeController', ['$scope', '$state', 'fileModel', 'imageModel', function HomeController($scope, $state, fileModel, imageModel) {
// private
var _this = {
onCreate: function() {
if(imageModel.getImages().length === 0) {
$scope.loading(true);
imageModel.loadImages()
.finally(function() {
$scope.loading(false);
});
}
}
};
// public
$scope.model = imageModel;
/**
* Triggered when the user presses the upload button in the navigation bar.
*/
$scope.upload = function(file) {
if(file && file.length) {
// Set the file
fileModel.setFile(file[0]);
// Navigate to the upload state
$state.go('upload');
}
};
$scope.loadMore = function() {
if(!$scope._data.loading) {
$scope.loading(true);
imageModel.loadMore()
.finally(function() {
$scope.loading(false);
});
}
};
// Initialize the controller
_this.onCreate();
}]); | 'use strict';
angular.module('app.controllers')
.controller('HomeController', ['$scope', '$state', 'fileModel', 'imageModel', function HomeController($scope, $state, fileModel, imageModel) {
// private
var _this = {
onCreate: function() {
if(imageModel.getImages().length === 0) {
$scope.loading(true);
imageModel.loadImages()
- .then(function() {
? ^^^
+ .finally(function() {
? ^^ ++++
$scope.loading(false);
});
}
}
};
// public
$scope.model = imageModel;
/**
* Triggered when the user presses the upload button in the navigation bar.
*/
$scope.upload = function(file) {
if(file && file.length) {
// Set the file
fileModel.setFile(file[0]);
// Navigate to the upload state
$state.go('upload');
}
};
$scope.loadMore = function() {
if(!$scope._data.loading) {
$scope.loading(true);
imageModel.loadMore()
- .then(function() {
? ^^^
+ .finally(function() {
? ^^ ++++
$scope.loading(false);
});
}
};
// Initialize the controller
_this.onCreate();
}]); | 4 | 0.081633 | 2 | 2 |
116808327ac226934af7cd48ac8336d16e602af7 | addon/mixins/component-lookup-mixin.js | addon/mixins/component-lookup-mixin.js | import Ember from 'ember';
export default Ember.Mixin.create({
componentFor(name, owner) {
let component = this._super(name, owner);
// Ensure components are always managed my the container and thus have a connection to their styles
if (!component) {
owner.register(`component:${name}`, Ember.Component);
component = this._super(name, owner);
}
return component;
}
});
| import Ember from 'ember';
export default Ember.Mixin.create({
componentFor(name, owner) {
let component = this._super(name, owner);
// Ensure components are always managed my the container and thus have a connection to their styles
if (!component) {
if (owner.register) {
owner.register(`component:${name}`, Ember.Component);
} else {
owner._registry.register(`component:${name}`, Ember.Component); // Support for Ember 2.0.X
}
component = this._super(name, owner);
}
return component;
}
});
| Fix error in Ember 2.0 | Fix error in Ember 2.0
| JavaScript | mit | salsify/ember-css-modules,salsify/ember-css-modules | javascript | ## Code Before:
import Ember from 'ember';
export default Ember.Mixin.create({
componentFor(name, owner) {
let component = this._super(name, owner);
// Ensure components are always managed my the container and thus have a connection to their styles
if (!component) {
owner.register(`component:${name}`, Ember.Component);
component = this._super(name, owner);
}
return component;
}
});
## Instruction:
Fix error in Ember 2.0
## Code After:
import Ember from 'ember';
export default Ember.Mixin.create({
componentFor(name, owner) {
let component = this._super(name, owner);
// Ensure components are always managed my the container and thus have a connection to their styles
if (!component) {
if (owner.register) {
owner.register(`component:${name}`, Ember.Component);
} else {
owner._registry.register(`component:${name}`, Ember.Component); // Support for Ember 2.0.X
}
component = this._super(name, owner);
}
return component;
}
});
| import Ember from 'ember';
export default Ember.Mixin.create({
componentFor(name, owner) {
let component = this._super(name, owner);
// Ensure components are always managed my the container and thus have a connection to their styles
if (!component) {
+ if (owner.register) {
- owner.register(`component:${name}`, Ember.Component);
+ owner.register(`component:${name}`, Ember.Component);
? ++
+ } else {
+ owner._registry.register(`component:${name}`, Ember.Component); // Support for Ember 2.0.X
+ }
component = this._super(name, owner);
}
return component;
}
}); | 6 | 0.4 | 5 | 1 |
982557f5ad850fb4126bea4adb65aef16291fbd6 | core/forms.py | core/forms.py | from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
exclude = ("created_on",)
model = Contact
class DonateForm(forms.Form):
name = forms.CharField(
max_length=100,
widget=forms.TextInput(attrs={"class": "form-control"})
)
email = forms.EmailField(
widget=forms.EmailInput(attrs={"class": "form-control"})
)
phone = forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"})
)
address = forms.CharField(
widget=forms.Textarea(attrs={"class": "form-control"})
)
pan = forms.CharField(
label=_("PAN"),
max_length=10,
widget=forms.TextInput(attrs={"class": "form-control"}),
help_text=_("PAN is required as per government regulations.")
)
is_indian = forms.BooleanField(
initial = False,
label=_("I hereby declare that I am an Indian"),
widget=forms.CheckboxInput(),
help_text=_("At this moment, we can accept donations from Indians only")
)
def clean_is_indian(self):
data = self.cleaned_data["is_indian"]
if data != True:
raise forms.ValidationError(_("Sorry, we can accept donations "
"from Indians only."))
return data
| from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
exclude = ("created_on",)
model = Contact
class DonateForm(forms.Form):
name = forms.CharField(
max_length=100,
widget=forms.TextInput(attrs={"class": "form-control"})
)
email = forms.EmailField(
widget=forms.EmailInput(attrs={"class": "form-control"})
)
phone = forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"})
)
address = forms.CharField(
widget=forms.Textarea(attrs={"class": "form-control"})
)
pan = forms.CharField(
label=_("PAN"),
max_length=10,
widget=forms.TextInput(attrs={"class": "form-control"}),
help_text=_("PAN is required as per government regulations.")
)
is_indian = forms.BooleanField(
initial = False,
label=_("I declare that I am an Indian citizen"),
widget=forms.CheckboxInput(),
help_text=_("At this moment, we can accept donations from Indians only")
)
def clean_is_indian(self):
data = self.cleaned_data["is_indian"]
if data != True:
raise forms.ValidationError(_("Sorry, we can accept donations "
"from Indians only."))
return data
| Change to the label name for resident status. | Change to the label name for resident status.
| Python | bsd-3-clause | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | python | ## Code Before:
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
exclude = ("created_on",)
model = Contact
class DonateForm(forms.Form):
name = forms.CharField(
max_length=100,
widget=forms.TextInput(attrs={"class": "form-control"})
)
email = forms.EmailField(
widget=forms.EmailInput(attrs={"class": "form-control"})
)
phone = forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"})
)
address = forms.CharField(
widget=forms.Textarea(attrs={"class": "form-control"})
)
pan = forms.CharField(
label=_("PAN"),
max_length=10,
widget=forms.TextInput(attrs={"class": "form-control"}),
help_text=_("PAN is required as per government regulations.")
)
is_indian = forms.BooleanField(
initial = False,
label=_("I hereby declare that I am an Indian"),
widget=forms.CheckboxInput(),
help_text=_("At this moment, we can accept donations from Indians only")
)
def clean_is_indian(self):
data = self.cleaned_data["is_indian"]
if data != True:
raise forms.ValidationError(_("Sorry, we can accept donations "
"from Indians only."))
return data
## Instruction:
Change to the label name for resident status.
## Code After:
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
exclude = ("created_on",)
model = Contact
class DonateForm(forms.Form):
name = forms.CharField(
max_length=100,
widget=forms.TextInput(attrs={"class": "form-control"})
)
email = forms.EmailField(
widget=forms.EmailInput(attrs={"class": "form-control"})
)
phone = forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"})
)
address = forms.CharField(
widget=forms.Textarea(attrs={"class": "form-control"})
)
pan = forms.CharField(
label=_("PAN"),
max_length=10,
widget=forms.TextInput(attrs={"class": "form-control"}),
help_text=_("PAN is required as per government regulations.")
)
is_indian = forms.BooleanField(
initial = False,
label=_("I declare that I am an Indian citizen"),
widget=forms.CheckboxInput(),
help_text=_("At this moment, we can accept donations from Indians only")
)
def clean_is_indian(self):
data = self.cleaned_data["is_indian"]
if data != True:
raise forms.ValidationError(_("Sorry, we can accept donations "
"from Indians only."))
return data
| from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
exclude = ("created_on",)
model = Contact
class DonateForm(forms.Form):
name = forms.CharField(
max_length=100,
widget=forms.TextInput(attrs={"class": "form-control"})
)
email = forms.EmailField(
widget=forms.EmailInput(attrs={"class": "form-control"})
)
phone = forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"})
)
address = forms.CharField(
widget=forms.Textarea(attrs={"class": "form-control"})
)
pan = forms.CharField(
label=_("PAN"),
max_length=10,
widget=forms.TextInput(attrs={"class": "form-control"}),
help_text=_("PAN is required as per government regulations.")
)
is_indian = forms.BooleanField(
initial = False,
- label=_("I hereby declare that I am an Indian"),
? -------
+ label=_("I declare that I am an Indian citizen"),
? ++++++++
widget=forms.CheckboxInput(),
help_text=_("At this moment, we can accept donations from Indians only")
)
def clean_is_indian(self):
data = self.cleaned_data["is_indian"]
if data != True:
raise forms.ValidationError(_("Sorry, we can accept donations "
"from Indians only."))
return data | 2 | 0.044444 | 1 | 1 |
5d6a98827d8676deee126d757b08b3dbeae7526b | test/setup.ts | test/setup.ts | import * as jsdom from "jsdom";
declare var global: any;
const exposedProperties = ["window", "navigator", "document"];
const doc = jsdom.jsdom("<!doctype html><html><body></body></html>");
global.document = doc;
global.window = doc.defaultView;
Object.keys(document.defaultView).forEach((property: string) => {
if (typeof global[property] === "undefined") {
exposedProperties.push(property);
global[property] = document.defaultView[<any>property];
}
});
global.navigator = {
userAgent: "node.js"
};
| import * as jsdom from "jsdom";
import { XMLHttpRequest } from "xmlhttprequest";
declare var global: any;
const exposedProperties = ["window", "navigator", "document"];
const doc = jsdom.jsdom("<!doctype html><html><body></body></html>", {
virtualConsole: jsdom.createVirtualConsole().sendTo(console),
});
global.document = doc;
global.window = doc.defaultView;
// fix the XMLHttpRequest API implementation
global.window.XMLHttpRequest = XMLHttpRequest;
Object.keys(document.defaultView).forEach((property: string) => {
if (typeof global[property] === "undefined") {
exposedProperties.push(property);
global[property] = document.defaultView[<any>property];
}
});
global.navigator = {
userAgent: "node.js"
};
| Replace jsdom XMLHttpRequest implementation and link Node and jsdom consoles. | Replace jsdom XMLHttpRequest implementation and link Node and jsdom consoles.
| TypeScript | mit | Josh-ES/react-here-maps,Josh-ES/react-here-maps | typescript | ## Code Before:
import * as jsdom from "jsdom";
declare var global: any;
const exposedProperties = ["window", "navigator", "document"];
const doc = jsdom.jsdom("<!doctype html><html><body></body></html>");
global.document = doc;
global.window = doc.defaultView;
Object.keys(document.defaultView).forEach((property: string) => {
if (typeof global[property] === "undefined") {
exposedProperties.push(property);
global[property] = document.defaultView[<any>property];
}
});
global.navigator = {
userAgent: "node.js"
};
## Instruction:
Replace jsdom XMLHttpRequest implementation and link Node and jsdom consoles.
## Code After:
import * as jsdom from "jsdom";
import { XMLHttpRequest } from "xmlhttprequest";
declare var global: any;
const exposedProperties = ["window", "navigator", "document"];
const doc = jsdom.jsdom("<!doctype html><html><body></body></html>", {
virtualConsole: jsdom.createVirtualConsole().sendTo(console),
});
global.document = doc;
global.window = doc.defaultView;
// fix the XMLHttpRequest API implementation
global.window.XMLHttpRequest = XMLHttpRequest;
Object.keys(document.defaultView).forEach((property: string) => {
if (typeof global[property] === "undefined") {
exposedProperties.push(property);
global[property] = document.defaultView[<any>property];
}
});
global.navigator = {
userAgent: "node.js"
};
| import * as jsdom from "jsdom";
+ import { XMLHttpRequest } from "xmlhttprequest";
declare var global: any;
const exposedProperties = ["window", "navigator", "document"];
- const doc = jsdom.jsdom("<!doctype html><html><body></body></html>");
? ^^
+ const doc = jsdom.jsdom("<!doctype html><html><body></body></html>", {
? ^^^
+ virtualConsole: jsdom.createVirtualConsole().sendTo(console),
+ });
global.document = doc;
global.window = doc.defaultView;
+
+ // fix the XMLHttpRequest API implementation
+ global.window.XMLHttpRequest = XMLHttpRequest;
Object.keys(document.defaultView).forEach((property: string) => {
if (typeof global[property] === "undefined") {
exposedProperties.push(property);
global[property] = document.defaultView[<any>property];
}
});
global.navigator = {
userAgent: "node.js"
}; | 8 | 0.380952 | 7 | 1 |
c49b797d61e07f5986536a006a850569bb67a9d8 | ResultsWizard2/src/mathsquared/resultswizard2/AdminGuiFrame.java | ResultsWizard2/src/mathsquared/resultswizard2/AdminGuiFrame.java | package mathsquared.resultswizard2;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
/**
* Runs the GUI by which an event administrator can input results.
*
* @author MathSquared
*
*/
public class AdminGuiFrame extends JFrame {
private JPanel contentPane;
/**
* Create the frame.
*/
public AdminGuiFrame () {
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
}
| package mathsquared.resultswizard2;
import java.awt.BorderLayout;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
/**
* Runs the GUI by which an event administrator can input results.
*
* @author MathSquared
*
*/
public class AdminGuiFrame extends JFrame {
private ObjectInputStream ois;
private ObjectOutputStream oos;
private JPanel contentPane;
/**
* Create the frame.
*/
public AdminGuiFrame (ObjectInputStream ois, ObjectOutputStream oos) {
// Initialize comms
this.oos = oos;
this.ois = ois;
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
}
| Add OIS/OOS to constructor and add fields | AGF: Add OIS/OOS to constructor and add fields | Java | mit | MathSquared/ResultsWizard2 | java | ## Code Before:
package mathsquared.resultswizard2;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
/**
* Runs the GUI by which an event administrator can input results.
*
* @author MathSquared
*
*/
public class AdminGuiFrame extends JFrame {
private JPanel contentPane;
/**
* Create the frame.
*/
public AdminGuiFrame () {
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
}
## Instruction:
AGF: Add OIS/OOS to constructor and add fields
## Code After:
package mathsquared.resultswizard2;
import java.awt.BorderLayout;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
/**
* Runs the GUI by which an event administrator can input results.
*
* @author MathSquared
*
*/
public class AdminGuiFrame extends JFrame {
private ObjectInputStream ois;
private ObjectOutputStream oos;
private JPanel contentPane;
/**
* Create the frame.
*/
public AdminGuiFrame (ObjectInputStream ois, ObjectOutputStream oos) {
// Initialize comms
this.oos = oos;
this.ois = ois;
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
}
| package mathsquared.resultswizard2;
import java.awt.BorderLayout;
+ import java.io.ObjectInputStream;
+ import java.io.ObjectOutputStream;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
/**
* Runs the GUI by which an event administrator can input results.
*
* @author MathSquared
*
*/
public class AdminGuiFrame extends JFrame {
+ private ObjectInputStream ois;
+ private ObjectOutputStream oos;
+
private JPanel contentPane;
/**
* Create the frame.
*/
- public AdminGuiFrame () {
+ public AdminGuiFrame (ObjectInputStream ois, ObjectOutputStream oos) {
+ // Initialize comms
+ this.oos = oos;
+ this.ois = ois;
+
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
} | 11 | 0.354839 | 10 | 1 |
4323071a32e8a47b7dafdc76b958402e6a621f2d | .isort.cfg | .isort.cfg | [settings]
not_skip = __init__.py
known_third_party = click,log
known_first_party = demo
include_trailing_comma = true
lines_after_imports = 2
| [settings]
not_skip = __init__.py
multi_line_output = 5
known_third_party = click,log
known_first_party = demo
combine_as_imports = true
include_trailing_comma = true
lines_after_imports = 2
| Deploy Travis CI build 1143 to GitHub | Deploy Travis CI build 1143 to GitHub
| INI | mit | jacebrowning/template-python-demo | ini | ## Code Before:
[settings]
not_skip = __init__.py
known_third_party = click,log
known_first_party = demo
include_trailing_comma = true
lines_after_imports = 2
## Instruction:
Deploy Travis CI build 1143 to GitHub
## Code After:
[settings]
not_skip = __init__.py
multi_line_output = 5
known_third_party = click,log
known_first_party = demo
combine_as_imports = true
include_trailing_comma = true
lines_after_imports = 2
| [settings]
not_skip = __init__.py
+ multi_line_output = 5
+
known_third_party = click,log
-
known_first_party = demo
+ combine_as_imports = true
include_trailing_comma = true
lines_after_imports = 2 | 4 | 0.363636 | 3 | 1 |
2907599eae7563a4c1a61e2296d3e2499f961f71 | delivery/backend/app/conductors/pages/fetches_pages.rb | delivery/backend/app/conductors/pages/fetches_pages.rb | require 'entities/pages/page'
require 'interactors/pages/builds_page'
require_relative '../../presenters/abc/page_presenter' # Need to do load path manip?
module Abc
module Conductors
module Pages
class FetchesPages < Abc::BaseConductor
attr_accessor :params, :options, :errors, :interactors, :repositories
def initialize(params, options = {})
super
# NOTE: Shamelessly ripped from -website, prolly needs to be standardized
self.interactors = OpenStruct.new(self.options[:interactor_classes])
self.repositories = OpenStruct.new(self.options[:repository_classes])
end
def to_response
pages
end
private
def defaults
{
:interactor_classes => { :pages => Abc::Interactors::BuildsPage },
:repository_classes => { :pages => Abc::Adapters::Persistence::Repositories::Page }
}
end
def pages
@pages ||= data.map{|p| interactors.pages.call(p) }
end
def data
repositories.pages.search({})
end
end
end
end
end
| require 'interactors/pages/builds_page'
require_relative '../../presenters/abc/page_presenter' # Need to do load path manip?
module Abc
module Conductors
module Pages
class FetchesPages < Abc::BaseConductor
attr_accessor :params, :options, :errors, :interactors, :repositories
def initialize(params, options = {})
super
# NOTE: Shamelessly ripped from -website, prolly needs to be standardized
self.interactors = OpenStruct.new(self.options[:interactor_classes])
self.repositories = OpenStruct.new(self.options[:repository_classes])
end
def to_response
pages
end
private
def defaults
{
:interactor_classes => { :pages => Abc::Interactors::BuildsPage },
:repository_classes => { :pages => Abc::Adapters::Persistence::Repositories::Page }
}
end
def pages
@pages ||= data.map{|p| interactors.pages.call(p) }
end
def data
repositories.pages.search({})
end
end
end
end
end
| Remove entity loading from conductor | Remove entity loading from conductor
| Ruby | bsd-3-clause | grounded/afterburnercms,grounded/afterburnercms | ruby | ## Code Before:
require 'entities/pages/page'
require 'interactors/pages/builds_page'
require_relative '../../presenters/abc/page_presenter' # Need to do load path manip?
module Abc
module Conductors
module Pages
class FetchesPages < Abc::BaseConductor
attr_accessor :params, :options, :errors, :interactors, :repositories
def initialize(params, options = {})
super
# NOTE: Shamelessly ripped from -website, prolly needs to be standardized
self.interactors = OpenStruct.new(self.options[:interactor_classes])
self.repositories = OpenStruct.new(self.options[:repository_classes])
end
def to_response
pages
end
private
def defaults
{
:interactor_classes => { :pages => Abc::Interactors::BuildsPage },
:repository_classes => { :pages => Abc::Adapters::Persistence::Repositories::Page }
}
end
def pages
@pages ||= data.map{|p| interactors.pages.call(p) }
end
def data
repositories.pages.search({})
end
end
end
end
end
## Instruction:
Remove entity loading from conductor
## Code After:
require 'interactors/pages/builds_page'
require_relative '../../presenters/abc/page_presenter' # Need to do load path manip?
module Abc
module Conductors
module Pages
class FetchesPages < Abc::BaseConductor
attr_accessor :params, :options, :errors, :interactors, :repositories
def initialize(params, options = {})
super
# NOTE: Shamelessly ripped from -website, prolly needs to be standardized
self.interactors = OpenStruct.new(self.options[:interactor_classes])
self.repositories = OpenStruct.new(self.options[:repository_classes])
end
def to_response
pages
end
private
def defaults
{
:interactor_classes => { :pages => Abc::Interactors::BuildsPage },
:repository_classes => { :pages => Abc::Adapters::Persistence::Repositories::Page }
}
end
def pages
@pages ||= data.map{|p| interactors.pages.call(p) }
end
def data
repositories.pages.search({})
end
end
end
end
end
| - require 'entities/pages/page'
require 'interactors/pages/builds_page'
require_relative '../../presenters/abc/page_presenter' # Need to do load path manip?
module Abc
module Conductors
module Pages
class FetchesPages < Abc::BaseConductor
attr_accessor :params, :options, :errors, :interactors, :repositories
def initialize(params, options = {})
super
# NOTE: Shamelessly ripped from -website, prolly needs to be standardized
self.interactors = OpenStruct.new(self.options[:interactor_classes])
self.repositories = OpenStruct.new(self.options[:repository_classes])
end
def to_response
pages
end
private
def defaults
{
:interactor_classes => { :pages => Abc::Interactors::BuildsPage },
:repository_classes => { :pages => Abc::Adapters::Persistence::Repositories::Page }
}
end
def pages
@pages ||= data.map{|p| interactors.pages.call(p) }
end
def data
repositories.pages.search({})
end
end
end
end
end | 1 | 0.025 | 0 | 1 |
b6ec3ba9efae7b6b291391b0333e80f2e9fc6fa0 | src/waldur_mastermind/invoices/migrations/0053_invoiceitem_uuid.py | src/waldur_mastermind/invoices/migrations/0053_invoiceitem_uuid.py | import uuid
from django.db import migrations
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(migrations.Migration):
dependencies = [
('invoices', '0052_delete_servicedowntime'),
]
operations = [
migrations.AddField(
model_name='invoiceitem',
name='uuid',
field=waldur_core.core.fields.UUIDField(null=True),
),
migrations.RunPython(gen_uuid, elidable=True),
migrations.AlterField(
model_name='invoiceitem',
name='uuid',
field=waldur_core.core.fields.UUIDField(),
),
]
| import uuid
from django.db import migrations, models
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(migrations.Migration):
dependencies = [
('invoices', '0052_delete_servicedowntime'),
]
operations = [
migrations.AddField(
model_name='invoiceitem', name='uuid', field=models.UUIDField(null=True),
),
migrations.RunPython(gen_uuid, elidable=True),
migrations.AlterField(
model_name='invoiceitem',
name='uuid',
field=waldur_core.core.fields.UUIDField(),
),
]
| Fix database migration script for UUID field in invoice item model. | Fix database migration script for UUID field in invoice item model.
| Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | python | ## Code Before:
import uuid
from django.db import migrations
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(migrations.Migration):
dependencies = [
('invoices', '0052_delete_servicedowntime'),
]
operations = [
migrations.AddField(
model_name='invoiceitem',
name='uuid',
field=waldur_core.core.fields.UUIDField(null=True),
),
migrations.RunPython(gen_uuid, elidable=True),
migrations.AlterField(
model_name='invoiceitem',
name='uuid',
field=waldur_core.core.fields.UUIDField(),
),
]
## Instruction:
Fix database migration script for UUID field in invoice item model.
## Code After:
import uuid
from django.db import migrations, models
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(migrations.Migration):
dependencies = [
('invoices', '0052_delete_servicedowntime'),
]
operations = [
migrations.AddField(
model_name='invoiceitem', name='uuid', field=models.UUIDField(null=True),
),
migrations.RunPython(gen_uuid, elidable=True),
migrations.AlterField(
model_name='invoiceitem',
name='uuid',
field=waldur_core.core.fields.UUIDField(),
),
]
| import uuid
- from django.db import migrations
+ from django.db import migrations, models
? ++++++++
import waldur_core.core.fields
def gen_uuid(apps, schema_editor):
InvoiceItem = apps.get_model('invoices', 'InvoiceItem')
for row in InvoiceItem.objects.all():
row.uuid = uuid.uuid4().hex
row.save(update_fields=['uuid'])
class Migration(migrations.Migration):
dependencies = [
('invoices', '0052_delete_servicedowntime'),
]
operations = [
migrations.AddField(
+ model_name='invoiceitem', name='uuid', field=models.UUIDField(null=True),
- model_name='invoiceitem',
- name='uuid',
- field=waldur_core.core.fields.UUIDField(null=True),
),
migrations.RunPython(gen_uuid, elidable=True),
migrations.AlterField(
model_name='invoiceitem',
name='uuid',
field=waldur_core.core.fields.UUIDField(),
),
] | 6 | 0.181818 | 2 | 4 |
14c77911c67488f5cde2d3bfb931c26e3097dbc6 | pages/_document.js | pages/_document.js | import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import stylesheet from '../styles/global.sass'
export default class MyDocument extends Document {
static getInitialProps ({ renderPage }) {
const {html, head} = renderPage()
return { html, head }
}
render () {
return (
<html>
<Head>
<link rel='shortcut icon' type='image/x-icon' href='/static/assets/favicon.ico' />
<style dangerouslySetInnerHTML={{ __html: stylesheet }} />
<title>Next Boilerplate</title>
</Head>
<body>
{this.props.customValue}
<Main />
<NextScript />
</body>
</html>
)
}
}
| import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import stylesheet from '../styles/global.sass'
export default class MyDocument extends Document {
static getInitialProps ({ renderPage }) {
const {html, head} = renderPage()
return { html, head }
}
render () {
return (
<html>
<Head>
<style dangerouslySetInnerHTML={{ __html: stylesheet }} />
<link rel='shortcut icon' type='image/x-icon' href='/static/assets/favicon.ico' />
<link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' integrity='sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN' crossOrigin='anonymous' />
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u' crossOrigin='anonymous' />
<title>Next Boilerplate</title>
</Head>
<body>
{this.props.customValue}
<Main />
<NextScript />
</body>
</html>
)
}
}
| Add fontawesome and bootstrap css | Add fontawesome and bootstrap css
| JavaScript | mit | grraft/next-boilerplate,grraft/next-boilerplate | javascript | ## Code Before:
import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import stylesheet from '../styles/global.sass'
export default class MyDocument extends Document {
static getInitialProps ({ renderPage }) {
const {html, head} = renderPage()
return { html, head }
}
render () {
return (
<html>
<Head>
<link rel='shortcut icon' type='image/x-icon' href='/static/assets/favicon.ico' />
<style dangerouslySetInnerHTML={{ __html: stylesheet }} />
<title>Next Boilerplate</title>
</Head>
<body>
{this.props.customValue}
<Main />
<NextScript />
</body>
</html>
)
}
}
## Instruction:
Add fontawesome and bootstrap css
## Code After:
import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import stylesheet from '../styles/global.sass'
export default class MyDocument extends Document {
static getInitialProps ({ renderPage }) {
const {html, head} = renderPage()
return { html, head }
}
render () {
return (
<html>
<Head>
<style dangerouslySetInnerHTML={{ __html: stylesheet }} />
<link rel='shortcut icon' type='image/x-icon' href='/static/assets/favicon.ico' />
<link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' integrity='sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN' crossOrigin='anonymous' />
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u' crossOrigin='anonymous' />
<title>Next Boilerplate</title>
</Head>
<body>
{this.props.customValue}
<Main />
<NextScript />
</body>
</html>
)
}
}
| import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import stylesheet from '../styles/global.sass'
export default class MyDocument extends Document {
static getInitialProps ({ renderPage }) {
const {html, head} = renderPage()
return { html, head }
}
render () {
return (
<html>
<Head>
+ <style dangerouslySetInnerHTML={{ __html: stylesheet }} />
<link rel='shortcut icon' type='image/x-icon' href='/static/assets/favicon.ico' />
- <style dangerouslySetInnerHTML={{ __html: stylesheet }} />
+ <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' integrity='sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN' crossOrigin='anonymous' />
+ <link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u' crossOrigin='anonymous' />
<title>Next Boilerplate</title>
</Head>
<body>
{this.props.customValue}
<Main />
<NextScript />
</body>
</html>
)
}
} | 4 | 0.148148 | 3 | 1 |
a56193f2f9c44ca8f1545c976d2db080e1f99752 | lemon/dashboard/templates/admin/index.html | lemon/dashboard/templates/admin/index.html | {% extends "admin/base_site.html" %}
{% load i18n dashboard %}
{% load url from future %}
{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}dashboard/css/style.css">
{% dashboard_css %}
{% endblock %}
{% block extrahead %}{{ block.super }}
<script src="{{ STATIC_URL }}dashboard/js/script.js"></script>
{% dashboard_js %}
{% endblock %}
{% block breadcrumbs_block %}{% endblock %}
{% block content_title %}{% endblock %}
{% block content %}
<div id="dashboard" class="dashboard"></div>
{% dashboard %}
{% admin_app_list app_list %}
{% endblock %}
| {% extends "admin/base_site.html" %}
{% load i18n dashboard %}
{% load url from future %}
{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}dashboard/css/style.css">
{% dashboard_css %}
{% endblock %}
{% block extrahead %}{{ block.super }}
<script src="{{ STATIC_URL }}dashboard/js/script.js"></script>
{% dashboard_js %}
{% endblock %}
{% block breadcrumbs_block %}
<ul id="breadcrumbs" class="breadcrumbs clearfix">
<li><a href="{% url 'admin:index' %}">{% trans "Home" %}</a></li>
{% block breadcrumbs %}{% endblock %}
</ul>
{% endblock %}
{% block content_title %}{% endblock %}
{% block content %}
<div id="dashboard" class="dashboard"></div>
{% dashboard %}
{% admin_app_list app_list %}
{% endblock %}
| Add breadcrumbs to the admin main page | Add breadcrumbs to the admin main page
| HTML | bsd-3-clause | trilan/lemon,trilan/lemon,trilan/lemon | html | ## Code Before:
{% extends "admin/base_site.html" %}
{% load i18n dashboard %}
{% load url from future %}
{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}dashboard/css/style.css">
{% dashboard_css %}
{% endblock %}
{% block extrahead %}{{ block.super }}
<script src="{{ STATIC_URL }}dashboard/js/script.js"></script>
{% dashboard_js %}
{% endblock %}
{% block breadcrumbs_block %}{% endblock %}
{% block content_title %}{% endblock %}
{% block content %}
<div id="dashboard" class="dashboard"></div>
{% dashboard %}
{% admin_app_list app_list %}
{% endblock %}
## Instruction:
Add breadcrumbs to the admin main page
## Code After:
{% extends "admin/base_site.html" %}
{% load i18n dashboard %}
{% load url from future %}
{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}dashboard/css/style.css">
{% dashboard_css %}
{% endblock %}
{% block extrahead %}{{ block.super }}
<script src="{{ STATIC_URL }}dashboard/js/script.js"></script>
{% dashboard_js %}
{% endblock %}
{% block breadcrumbs_block %}
<ul id="breadcrumbs" class="breadcrumbs clearfix">
<li><a href="{% url 'admin:index' %}">{% trans "Home" %}</a></li>
{% block breadcrumbs %}{% endblock %}
</ul>
{% endblock %}
{% block content_title %}{% endblock %}
{% block content %}
<div id="dashboard" class="dashboard"></div>
{% dashboard %}
{% admin_app_list app_list %}
{% endblock %}
| {% extends "admin/base_site.html" %}
{% load i18n dashboard %}
{% load url from future %}
{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}dashboard/css/style.css">
{% dashboard_css %}
{% endblock %}
{% block extrahead %}{{ block.super }}
<script src="{{ STATIC_URL }}dashboard/js/script.js"></script>
{% dashboard_js %}
{% endblock %}
+ {% block breadcrumbs_block %}
+ <ul id="breadcrumbs" class="breadcrumbs clearfix">
+ <li><a href="{% url 'admin:index' %}">{% trans "Home" %}</a></li>
- {% block breadcrumbs_block %}{% endblock %}
? ------
+ {% block breadcrumbs %}{% endblock %}
? ++++
+ </ul>
+ {% endblock %}
{% block content_title %}{% endblock %}
{% block content %}
<div id="dashboard" class="dashboard"></div>
{% dashboard %}
{% admin_app_list app_list %}
{% endblock %} | 7 | 0.318182 | 6 | 1 |
db2bdfd5baad19914d0d5d78eacbaa7d49b9ce57 | .travis.yml | .travis.yml | language: android
jdk: oraclejdk7
android:
components:
- tools
- build-tools-23.0.2
- android-23
- extra-android-support
- extra-android-m2repository
| language: android
jdk: oraclejdk7
android:
components:
- tools
- build-tools-23.0.2
- android-23
- extra-android-support
- extra-android-m2repository
script:
# The project currently contains no android tests.
# By default Travis-ci executes './gradlew build connectedCheck' which checks for connected devices
- ./gradlew build
| Make ./gradlew build the default building command | Make ./gradlew build the default building command
| YAML | mit | pchrysa/Memento-Calendar,pchrysa/Memento-Calendar,pchrysa/Memento-Calendar | yaml | ## Code Before:
language: android
jdk: oraclejdk7
android:
components:
- tools
- build-tools-23.0.2
- android-23
- extra-android-support
- extra-android-m2repository
## Instruction:
Make ./gradlew build the default building command
## Code After:
language: android
jdk: oraclejdk7
android:
components:
- tools
- build-tools-23.0.2
- android-23
- extra-android-support
- extra-android-m2repository
script:
# The project currently contains no android tests.
# By default Travis-ci executes './gradlew build connectedCheck' which checks for connected devices
- ./gradlew build
| language: android
jdk: oraclejdk7
android:
components:
- tools
- build-tools-23.0.2
- android-23
- extra-android-support
- extra-android-m2repository
+
+ script:
+ # The project currently contains no android tests.
+ # By default Travis-ci executes './gradlew build connectedCheck' which checks for connected devices
+ - ./gradlew build | 5 | 0.5 | 5 | 0 |
2dc28114906e2376b8f0c641e889d76e1e0bf40c | lib/remote_model.rb | lib/remote_model.rb | module RescueGroups
module RemoteModel
def self.included(base)
base.class_eval do
def initialize(attribute_hash)
attribute_hash.each do |key, value|
mapped_method = "#{ self.class.object_fields::FIELDS.key(key.to_sym) }="
next unless self.respond_to?(mapped_method)
self.send(mapped_method, value)
end
end
def attributes
{}.tap do |hash|
self.class.object_fields::FIELDS.keys.each do |attribute|
hash[attribute] = instance_variable_get(:"@#{ attribute }")
end
end
end
end
end
end
end
| module RescueGroups
module RemoteModel
def self.included(base)
base.class_eval do
def initialize(attribute_hash = {})
(attribute_hash || {}).each do |key, value|
mapped_method = "#{ self.class.object_fields::FIELDS.key(key.to_sym) }="
next unless self.respond_to?(mapped_method)
self.send(mapped_method, value)
end
end
def attributes
{}.tap do |hash|
self.class.object_fields::FIELDS.keys.each do |attribute|
hash[attribute] = instance_variable_get(:"@#{ attribute }")
end
end
end
end
end
end
end
| Update RemoteModel to allow initialization with nil | Update RemoteModel to allow initialization with nil
| Ruby | mit | yez/rescue_groups | ruby | ## Code Before:
module RescueGroups
module RemoteModel
def self.included(base)
base.class_eval do
def initialize(attribute_hash)
attribute_hash.each do |key, value|
mapped_method = "#{ self.class.object_fields::FIELDS.key(key.to_sym) }="
next unless self.respond_to?(mapped_method)
self.send(mapped_method, value)
end
end
def attributes
{}.tap do |hash|
self.class.object_fields::FIELDS.keys.each do |attribute|
hash[attribute] = instance_variable_get(:"@#{ attribute }")
end
end
end
end
end
end
end
## Instruction:
Update RemoteModel to allow initialization with nil
## Code After:
module RescueGroups
module RemoteModel
def self.included(base)
base.class_eval do
def initialize(attribute_hash = {})
(attribute_hash || {}).each do |key, value|
mapped_method = "#{ self.class.object_fields::FIELDS.key(key.to_sym) }="
next unless self.respond_to?(mapped_method)
self.send(mapped_method, value)
end
end
def attributes
{}.tap do |hash|
self.class.object_fields::FIELDS.keys.each do |attribute|
hash[attribute] = instance_variable_get(:"@#{ attribute }")
end
end
end
end
end
end
end
| module RescueGroups
module RemoteModel
def self.included(base)
base.class_eval do
- def initialize(attribute_hash)
+ def initialize(attribute_hash = {})
? +++++
- attribute_hash.each do |key, value|
+ (attribute_hash || {}).each do |key, value|
? + +++++++
mapped_method = "#{ self.class.object_fields::FIELDS.key(key.to_sym) }="
next unless self.respond_to?(mapped_method)
self.send(mapped_method, value)
end
end
def attributes
{}.tap do |hash|
self.class.object_fields::FIELDS.keys.each do |attribute|
hash[attribute] = instance_variable_get(:"@#{ attribute }")
end
end
end
end
end
end
end | 4 | 0.173913 | 2 | 2 |
e399b51247fdad2ad03d690ce26b47d3c429c060 | components/commercial_filter/filters/location/location_map.coffee | components/commercial_filter/filters/location/location_map.coffee | module.exports =
fullyQualifiedLocations: [
'New York, NY, USA',
'London, United Kingdom',
'Los Angeles, CA, USA',
'Paris, France',
'Berlin, Germany',
'Hong Kong, Hong Kong'
]
| module.exports =
fullyQualifiedLocations: [
'New York, NY, USA',
'London, United Kingdom',
'Los Angeles, CA, USA',
'Paris, France',
'Berlin, Germany',
'San Francisco, CA, USA'
'Hong Kong, Hong Kong'
]
| Add San Francisco to list of cities on /collect | Add San Francisco to list of cities on /collect
| CoffeeScript | mit | izakp/force,damassi/force,eessex/force,erikdstock/force,kanaabe/force,oxaudo/force,eessex/force,damassi/force,eessex/force,mzikherman/force,joeyAghion/force,xtina-starr/force,eessex/force,oxaudo/force,mzikherman/force,mzikherman/force,damassi/force,izakp/force,dblock/force,izakp/force,dblock/force,cavvia/force-1,artsy/force-public,kanaabe/force,xtina-starr/force,joeyAghion/force,damassi/force,erikdstock/force,artsy/force,cavvia/force-1,oxaudo/force,artsy/force-public,cavvia/force-1,joeyAghion/force,xtina-starr/force,anandaroop/force,dblock/force,artsy/force,oxaudo/force,anandaroop/force,anandaroop/force,joeyAghion/force,yuki24/force,xtina-starr/force,anandaroop/force,mzikherman/force,erikdstock/force,yuki24/force,kanaabe/force,kanaabe/force,erikdstock/force,artsy/force,izakp/force,cavvia/force-1,artsy/force,yuki24/force,kanaabe/force,yuki24/force | coffeescript | ## Code Before:
module.exports =
fullyQualifiedLocations: [
'New York, NY, USA',
'London, United Kingdom',
'Los Angeles, CA, USA',
'Paris, France',
'Berlin, Germany',
'Hong Kong, Hong Kong'
]
## Instruction:
Add San Francisco to list of cities on /collect
## Code After:
module.exports =
fullyQualifiedLocations: [
'New York, NY, USA',
'London, United Kingdom',
'Los Angeles, CA, USA',
'Paris, France',
'Berlin, Germany',
'San Francisco, CA, USA'
'Hong Kong, Hong Kong'
]
| module.exports =
fullyQualifiedLocations: [
'New York, NY, USA',
'London, United Kingdom',
'Los Angeles, CA, USA',
'Paris, France',
'Berlin, Germany',
+ 'San Francisco, CA, USA'
'Hong Kong, Hong Kong'
] | 1 | 0.111111 | 1 | 0 |
e7579d185083be76fd101033139b2c9affbb8ac3 | README.md | README.md |
Make your Mac to connect Internet only via VPN.
## setup
* install VPN client of your choice. Personally prefer Tunnelblick (https://code.google.com/p/tunnelblick/). I set it to connect VPN just after run.
* run: `sh setup.sh YOUR_VPN_SERVER_IP`
* enjoy less spying on you :)
|
Make your Mac to connect Internet only via VPN.
## setup
* install VPN client of your choice. Personally prefer Tunnelblick (https://code.google.com/p/tunnelblick/). I set it to connect VPN just after run.
* run: `sh setup.sh YOUR_VPN_SERVER_IP`
* enjoy less spying on you :)
## disable
In case you want to disable VPN-only run: `pf_reset`
| Add documentation on disabling VPN-only mode. | Add documentation on disabling VPN-only mode.
| Markdown | mit | pr0d1r2/vpn_only_osx | markdown | ## Code Before:
Make your Mac to connect Internet only via VPN.
## setup
* install VPN client of your choice. Personally prefer Tunnelblick (https://code.google.com/p/tunnelblick/). I set it to connect VPN just after run.
* run: `sh setup.sh YOUR_VPN_SERVER_IP`
* enjoy less spying on you :)
## Instruction:
Add documentation on disabling VPN-only mode.
## Code After:
Make your Mac to connect Internet only via VPN.
## setup
* install VPN client of your choice. Personally prefer Tunnelblick (https://code.google.com/p/tunnelblick/). I set it to connect VPN just after run.
* run: `sh setup.sh YOUR_VPN_SERVER_IP`
* enjoy less spying on you :)
## disable
In case you want to disable VPN-only run: `pf_reset`
|
Make your Mac to connect Internet only via VPN.
## setup
* install VPN client of your choice. Personally prefer Tunnelblick (https://code.google.com/p/tunnelblick/). I set it to connect VPN just after run.
* run: `sh setup.sh YOUR_VPN_SERVER_IP`
* enjoy less spying on you :)
+
+ ## disable
+
+ In case you want to disable VPN-only run: `pf_reset` | 4 | 0.5 | 4 | 0 |
cd2a5d7c96d6823e0f5ba2c0b6586485fa9fe325 | README.md | README.md | Modubot
=======
Modubot, the scalable, extensible IRC Bot.
Installation
------------
npm install
grunt
npm start
Documentation
-------------
You can access Modubot's documentation [here](https://modubot.net/docs.html).
| Modubot
=======
Modubot, the scalable, extensible IRC Bot.
Installation
------------
npm install -g grunt-cli
npm install
grunt
npm start
Documentation
-------------
You can access Modubot's documentation [here](https://modubot.net/docs.html).
| Update installation instructions to include grunt-cli | Update installation instructions to include grunt-cli
| Markdown | bsd-3-clause | modubot/modubot.js,modubot/modubot.js | markdown | ## Code Before:
Modubot
=======
Modubot, the scalable, extensible IRC Bot.
Installation
------------
npm install
grunt
npm start
Documentation
-------------
You can access Modubot's documentation [here](https://modubot.net/docs.html).
## Instruction:
Update installation instructions to include grunt-cli
## Code After:
Modubot
=======
Modubot, the scalable, extensible IRC Bot.
Installation
------------
npm install -g grunt-cli
npm install
grunt
npm start
Documentation
-------------
You can access Modubot's documentation [here](https://modubot.net/docs.html).
| Modubot
=======
Modubot, the scalable, extensible IRC Bot.
Installation
------------
+ npm install -g grunt-cli
npm install
grunt
npm start
Documentation
-------------
You can access Modubot's documentation [here](https://modubot.net/docs.html). | 1 | 0.0625 | 1 | 0 |
bdae908d153a4959d4d7ab6d765ed969a2d0f1c3 | lib/tasks/cached_assets.rake | lib/tasks/cached_assets.rake | namespace :cached_assets do
desc "Regenerate aggregate/cached files"
task :regenerate => :environment do
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::AssetTagHelper
include ApplicationHelper
js_dir = "#{RAILS_ROOT}/public/javascripts/"
css_dir = "#{RAILS_ROOT}/public/stylesheets/"
js_assets = ['admin_libraries', 'libraries', 'main']
css_assets = ['main']
js_assets.each do |basename|
path = "#{js_dir}#{basename}.js"
system("rm #{path}") if (File.exist?(path))
end
css_assets.each do |basename|
path = "#{css_dir}#{basename}.css"
system("rm #{path}") if (File.exist?(path))
end
stylesheet_link_tag('core', 'fixmytransport', 'map', 'buttons', :cache => 'main')
library_js_link
admin_library_js_link
main_js_link
end
end
| namespace :cached_assets do
desc "Regenerate aggregate/cached files"
task :regenerate => :environment do
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::AssetTagHelper
include ApplicationHelper
js_dir = "#{RAILS_ROOT}/public/javascripts/"
css_dir = "#{RAILS_ROOT}/public/stylesheets/"
js_assets = ['admin_libraries', 'libraries', 'main']
css_assets = ['main']
js_assets.each do |basename|
path = "#{js_dir}#{basename}.js"
system("rm #{path}") if (File.exist?(path))
end
css_assets.each do |basename|
path = "#{css_dir}#{basename}.css"
system("rm #{path}") if (File.exist?(path))
end
stylesheet_link_tag('core', 'map', 'buttons', 'ui-tabs-mod', 'fixmytransport', :cache => 'main')
library_js_link
admin_library_js_link
main_js_link
end
end
| Update stylesheet regeneration with correct order | Update stylesheet regeneration with correct order
| Ruby | agpl-3.0 | mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport | ruby | ## Code Before:
namespace :cached_assets do
desc "Regenerate aggregate/cached files"
task :regenerate => :environment do
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::AssetTagHelper
include ApplicationHelper
js_dir = "#{RAILS_ROOT}/public/javascripts/"
css_dir = "#{RAILS_ROOT}/public/stylesheets/"
js_assets = ['admin_libraries', 'libraries', 'main']
css_assets = ['main']
js_assets.each do |basename|
path = "#{js_dir}#{basename}.js"
system("rm #{path}") if (File.exist?(path))
end
css_assets.each do |basename|
path = "#{css_dir}#{basename}.css"
system("rm #{path}") if (File.exist?(path))
end
stylesheet_link_tag('core', 'fixmytransport', 'map', 'buttons', :cache => 'main')
library_js_link
admin_library_js_link
main_js_link
end
end
## Instruction:
Update stylesheet regeneration with correct order
## Code After:
namespace :cached_assets do
desc "Regenerate aggregate/cached files"
task :regenerate => :environment do
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::AssetTagHelper
include ApplicationHelper
js_dir = "#{RAILS_ROOT}/public/javascripts/"
css_dir = "#{RAILS_ROOT}/public/stylesheets/"
js_assets = ['admin_libraries', 'libraries', 'main']
css_assets = ['main']
js_assets.each do |basename|
path = "#{js_dir}#{basename}.js"
system("rm #{path}") if (File.exist?(path))
end
css_assets.each do |basename|
path = "#{css_dir}#{basename}.css"
system("rm #{path}") if (File.exist?(path))
end
stylesheet_link_tag('core', 'map', 'buttons', 'ui-tabs-mod', 'fixmytransport', :cache => 'main')
library_js_link
admin_library_js_link
main_js_link
end
end
| namespace :cached_assets do
desc "Regenerate aggregate/cached files"
task :regenerate => :environment do
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::AssetTagHelper
include ApplicationHelper
js_dir = "#{RAILS_ROOT}/public/javascripts/"
css_dir = "#{RAILS_ROOT}/public/stylesheets/"
js_assets = ['admin_libraries', 'libraries', 'main']
css_assets = ['main']
js_assets.each do |basename|
path = "#{js_dir}#{basename}.js"
system("rm #{path}") if (File.exist?(path))
end
css_assets.each do |basename|
path = "#{css_dir}#{basename}.css"
system("rm #{path}") if (File.exist?(path))
end
- stylesheet_link_tag('core', 'fixmytransport', 'map', 'buttons', :cache => 'main')
+ stylesheet_link_tag('core', 'map', 'buttons', 'ui-tabs-mod', 'fixmytransport', :cache => 'main')
library_js_link
admin_library_js_link
main_js_link
end
end | 2 | 0.08 | 1 | 1 |
67771f80d080b9227e8ddfe16b08a8f7dbe01f88 | static/templates/draft_table_body.hbs | static/templates/draft_table_body.hbs | <div id="draft_overlay" class="overlay new-style" data-overlay="drafts">
<div class="flex overlay-content">
<div class="drafts-container modal-bg">
<div class="drafts-header">
<h1>{{t 'Drafts' }}</h1>
<div class="exit">
<span class="exit-sign">×</span>
</div>
<div class="removed-drafts">
{{#tr}}Drafts are not synced to other devices and browsers.{{/tr}}
<br />
{{#tr}}Drafts older than <strong>{draft_lifetime}</strong> days are automatically removed.{{/tr}}
<br />
{{t "Pro tip: You can use 'd' to open your drafts."}}
</div>
</div>
<div class="drafts-list">
<div class="no-drafts">
{{t 'No drafts.'}}
</div>
{{#each drafts}}
{{> draft}}
{{/each}}
</div>
</div>
</div>
</div>
| <div id="draft_overlay" class="overlay new-style" data-overlay="drafts">
<div class="flex overlay-content">
<div class="drafts-container modal-bg">
<div class="drafts-header">
<h1>{{t 'Drafts' }}</h1>
<div class="exit">
<span class="exit-sign">×</span>
</div>
<div class="removed-drafts">
{{#tr}}Drafts are not synced to other devices and browsers.{{/tr}}
<br />
{{#tr}}Drafts older than <strong>{draft_lifetime}</strong> days are automatically removed.{{/tr}}
</div>
</div>
<div class="drafts-list">
<div class="no-drafts">
{{t 'No drafts.'}}
</div>
{{#each drafts}}
{{> draft}}
{{/each}}
</div>
</div>
</div>
</div>
| Remove 'pro tip' from draft modal. | drafts: Remove 'pro tip' from draft modal.
This keyboard shortcut advertisement dates from the original version
of the overlay, before we advertised the shortcut in other ways.
Discussion here:
https://github.com/zulip/zulip/pull/22127#discussion_r882270506
| Handlebars | apache-2.0 | zulip/zulip,andersk/zulip,andersk/zulip,zulip/zulip,andersk/zulip,zulip/zulip,rht/zulip,zulip/zulip,zulip/zulip,zulip/zulip,andersk/zulip,rht/zulip,rht/zulip,andersk/zulip,andersk/zulip,rht/zulip,rht/zulip,zulip/zulip,rht/zulip,rht/zulip,andersk/zulip | handlebars | ## Code Before:
<div id="draft_overlay" class="overlay new-style" data-overlay="drafts">
<div class="flex overlay-content">
<div class="drafts-container modal-bg">
<div class="drafts-header">
<h1>{{t 'Drafts' }}</h1>
<div class="exit">
<span class="exit-sign">×</span>
</div>
<div class="removed-drafts">
{{#tr}}Drafts are not synced to other devices and browsers.{{/tr}}
<br />
{{#tr}}Drafts older than <strong>{draft_lifetime}</strong> days are automatically removed.{{/tr}}
<br />
{{t "Pro tip: You can use 'd' to open your drafts."}}
</div>
</div>
<div class="drafts-list">
<div class="no-drafts">
{{t 'No drafts.'}}
</div>
{{#each drafts}}
{{> draft}}
{{/each}}
</div>
</div>
</div>
</div>
## Instruction:
drafts: Remove 'pro tip' from draft modal.
This keyboard shortcut advertisement dates from the original version
of the overlay, before we advertised the shortcut in other ways.
Discussion here:
https://github.com/zulip/zulip/pull/22127#discussion_r882270506
## Code After:
<div id="draft_overlay" class="overlay new-style" data-overlay="drafts">
<div class="flex overlay-content">
<div class="drafts-container modal-bg">
<div class="drafts-header">
<h1>{{t 'Drafts' }}</h1>
<div class="exit">
<span class="exit-sign">×</span>
</div>
<div class="removed-drafts">
{{#tr}}Drafts are not synced to other devices and browsers.{{/tr}}
<br />
{{#tr}}Drafts older than <strong>{draft_lifetime}</strong> days are automatically removed.{{/tr}}
</div>
</div>
<div class="drafts-list">
<div class="no-drafts">
{{t 'No drafts.'}}
</div>
{{#each drafts}}
{{> draft}}
{{/each}}
</div>
</div>
</div>
</div>
| <div id="draft_overlay" class="overlay new-style" data-overlay="drafts">
<div class="flex overlay-content">
<div class="drafts-container modal-bg">
<div class="drafts-header">
<h1>{{t 'Drafts' }}</h1>
<div class="exit">
<span class="exit-sign">×</span>
</div>
<div class="removed-drafts">
{{#tr}}Drafts are not synced to other devices and browsers.{{/tr}}
<br />
{{#tr}}Drafts older than <strong>{draft_lifetime}</strong> days are automatically removed.{{/tr}}
- <br />
- {{t "Pro tip: You can use 'd' to open your drafts."}}
</div>
</div>
<div class="drafts-list">
<div class="no-drafts">
{{t 'No drafts.'}}
</div>
{{#each drafts}}
{{> draft}}
{{/each}}
</div>
</div>
</div>
</div> | 2 | 0.071429 | 0 | 2 |
7c28f176c0a645e2b647b16473a2c184dc015097 | lib/login.js | lib/login.js | // Apply login on current session and change session id for security reasons.
'use strict';
var rnd = require('nodeca.core/lib/rnd');
module.exports = function login(env, userId) {
env.session.user_id = userId;
env.origin.req.sid = rnd(); // Generate cryptostrong random hex string.
};
| // Apply login on current session and change session id for security reasons.
'use strict';
var rnd = require('nodeca.core/lib/rnd');
module.exports = function login(env, userId) {
env.session.user_id = userId;
env.session_id = rnd(); // Generate cryptostrong random hex string.
};
| Use `env.session_id` instead of deprecated `req.sid`. | Use `env.session_id` instead of deprecated `req.sid`.
| JavaScript | mit | nodeca/nodeca.users | javascript | ## Code Before:
// Apply login on current session and change session id for security reasons.
'use strict';
var rnd = require('nodeca.core/lib/rnd');
module.exports = function login(env, userId) {
env.session.user_id = userId;
env.origin.req.sid = rnd(); // Generate cryptostrong random hex string.
};
## Instruction:
Use `env.session_id` instead of deprecated `req.sid`.
## Code After:
// Apply login on current session and change session id for security reasons.
'use strict';
var rnd = require('nodeca.core/lib/rnd');
module.exports = function login(env, userId) {
env.session.user_id = userId;
env.session_id = rnd(); // Generate cryptostrong random hex string.
};
| // Apply login on current session and change session id for security reasons.
'use strict';
var rnd = require('nodeca.core/lib/rnd');
module.exports = function login(env, userId) {
env.session.user_id = userId;
- env.origin.req.sid = rnd(); // Generate cryptostrong random hex string.
? ---- ^^^^^^
+ env.session_id = rnd(); // Generate cryptostrong random hex string.
? +++++ ^
}; | 2 | 0.153846 | 1 | 1 |
2d3d60ee04b1f54d12959a5575a4434ebaca937c | wargames/drifter/drifter3.md | wargames/drifter/drifter3.md | ---
layout: default
gamename: drifter
level: 3
---
Level 3 is a remote heap corruption issue. Source code can be found in
/drifter/drifter3_src/. It is linked against an ancient malloc
implementation so it should be easily exploitable :)
[Once upon a free()...][] - suitable reading material, amongst others.
[Once upon a free()...]: http://www.phrack.org/archives/57/p57-0x09
| ---
layout: default
gamename: drifter
level: 3
---
Level 3 is a remote heap corruption issue. Source code can be found in
/drifter/drifter3_src/. It is linked against an ancient malloc
implementation so it should be easily exploitable :)
[Once upon a free()...][] - suitable reading material, amongst others.
[Once upon a free()...]: http://phrack.org/archives/issues/57/9.txt
| Fix url to recommended reading | Fix url to recommended reading
| Markdown | mit | OverTheWireOrg/OverTheWire-website,OverTheWireOrg/OverTheWire-website,OverTheWireOrg/OverTheWire-website,OverTheWireOrg/OverTheWire-website,OverTheWireOrg/OverTheWire-website | markdown | ## Code Before:
---
layout: default
gamename: drifter
level: 3
---
Level 3 is a remote heap corruption issue. Source code can be found in
/drifter/drifter3_src/. It is linked against an ancient malloc
implementation so it should be easily exploitable :)
[Once upon a free()...][] - suitable reading material, amongst others.
[Once upon a free()...]: http://www.phrack.org/archives/57/p57-0x09
## Instruction:
Fix url to recommended reading
## Code After:
---
layout: default
gamename: drifter
level: 3
---
Level 3 is a remote heap corruption issue. Source code can be found in
/drifter/drifter3_src/. It is linked against an ancient malloc
implementation so it should be easily exploitable :)
[Once upon a free()...][] - suitable reading material, amongst others.
[Once upon a free()...]: http://phrack.org/archives/issues/57/9.txt
| ---
layout: default
gamename: drifter
level: 3
---
Level 3 is a remote heap corruption issue. Source code can be found in
/drifter/drifter3_src/. It is linked against an ancient malloc
implementation so it should be easily exploitable :)
[Once upon a free()...][] - suitable reading material, amongst others.
- [Once upon a free()...]: http://www.phrack.org/archives/57/p57-0x09
? ---- ^^^^^ ^^
+ [Once upon a free()...]: http://phrack.org/archives/issues/57/9.txt
? +++++++ ^^^ ^
| 2 | 0.166667 | 1 | 1 |
9e9eb5601099263e4d624e114e77b23bfac2d4bd | README.md | README.md |
Neptune is a Kafka client. It's a fork of the [Poseidon](http://github.com/bpot/poseidon) client.
## Usage
```ruby
require 'neptune'
cluster = Neptune::Cluster.new(['localhost:9092'], client_id: 'my_test_producer')
cluster.produce('topic1', 'value1')
```
## Requirements
* Ruby 1.9.3 or higher
* Kafka 0.8 or higher |
Neptune is a Kafka client. It's a fork of the [Poseidon](http://github.com/bpot/poseidon) client.
The only features that are currently implemented include:
* Produce (single message)
To be implemented:
* Compression
* Produce (multiple messages)
* Fetch
* Offset management
## Usage
```ruby
require 'neptune'
cluster = Neptune::Cluster.new(['localhost:9092'], client_id: 'my_test_producer')
cluster.produce('topic1', 'value1')
```
## Requirements
* Ruby 1.9.3 or higher
* Kafka 0.8 or higher | Add notes on what's implemented and what's not | Add notes on what's implemented and what's not
| Markdown | mit | obrie/neptune | markdown | ## Code Before:
Neptune is a Kafka client. It's a fork of the [Poseidon](http://github.com/bpot/poseidon) client.
## Usage
```ruby
require 'neptune'
cluster = Neptune::Cluster.new(['localhost:9092'], client_id: 'my_test_producer')
cluster.produce('topic1', 'value1')
```
## Requirements
* Ruby 1.9.3 or higher
* Kafka 0.8 or higher
## Instruction:
Add notes on what's implemented and what's not
## Code After:
Neptune is a Kafka client. It's a fork of the [Poseidon](http://github.com/bpot/poseidon) client.
The only features that are currently implemented include:
* Produce (single message)
To be implemented:
* Compression
* Produce (multiple messages)
* Fetch
* Offset management
## Usage
```ruby
require 'neptune'
cluster = Neptune::Cluster.new(['localhost:9092'], client_id: 'my_test_producer')
cluster.produce('topic1', 'value1')
```
## Requirements
* Ruby 1.9.3 or higher
* Kafka 0.8 or higher |
Neptune is a Kafka client. It's a fork of the [Poseidon](http://github.com/bpot/poseidon) client.
+
+ The only features that are currently implemented include:
+ * Produce (single message)
+
+ To be implemented:
+ * Compression
+ * Produce (multiple messages)
+ * Fetch
+ * Offset management
## Usage
```ruby
require 'neptune'
cluster = Neptune::Cluster.new(['localhost:9092'], client_id: 'my_test_producer')
cluster.produce('topic1', 'value1')
```
## Requirements
* Ruby 1.9.3 or higher
* Kafka 0.8 or higher | 9 | 0.5625 | 9 | 0 |
045c31b461db3fee223fea7e4d503e2a6de80b8c | src/Form/Type/AdditionalFieldType.php | src/Form/Type/AdditionalFieldType.php | <?php
namespace App\Form\Type;
use App\Entity\Framework\AdditionalField;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class AdditionalFieldType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('displayName')
->add('appliesTo', null, ['data' => 'lsitem'])
->add('type')
->add('typeInfo', null, ['required' => false])
->add('save', SubmitType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => AdditionalField::class,
]);
}
}
| <?php
namespace App\Form\Type;
use App\Entity\Framework\AdditionalField;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
class AdditionalFieldType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$appliesToChoices = array(
'LsItem' => 'lsitem',
'LsAssociation' => 'lsassociation',
'LsDoc' => 'LsDoc',
);
$builder
->add('name')
->add('displayName')
->add('appliesTo', ChoiceType::class, array('choices' => $appliesToChoices))
->add('type', null, ['data' => 'string'])
->add('typeInfo', null, ['required' => false])
->add('save', SubmitType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => AdditionalField::class,
]);
}
}
| Update the additonal fields form so the appliesto field is a select with the values lsitem, lsassociation, and lsdoc. | Update the additonal fields form so the appliesto field is a select with the values lsitem, lsassociation, and lsdoc.
| PHP | mit | opensalt/opensalt,opensalt/opensalt,opensalt/opensalt | php | ## Code Before:
<?php
namespace App\Form\Type;
use App\Entity\Framework\AdditionalField;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class AdditionalFieldType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('displayName')
->add('appliesTo', null, ['data' => 'lsitem'])
->add('type')
->add('typeInfo', null, ['required' => false])
->add('save', SubmitType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => AdditionalField::class,
]);
}
}
## Instruction:
Update the additonal fields form so the appliesto field is a select with the values lsitem, lsassociation, and lsdoc.
## Code After:
<?php
namespace App\Form\Type;
use App\Entity\Framework\AdditionalField;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
class AdditionalFieldType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$appliesToChoices = array(
'LsItem' => 'lsitem',
'LsAssociation' => 'lsassociation',
'LsDoc' => 'LsDoc',
);
$builder
->add('name')
->add('displayName')
->add('appliesTo', ChoiceType::class, array('choices' => $appliesToChoices))
->add('type', null, ['data' => 'string'])
->add('typeInfo', null, ['required' => false])
->add('save', SubmitType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => AdditionalField::class,
]);
}
}
| <?php
namespace App\Form\Type;
use App\Entity\Framework\AdditionalField;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
+ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
class AdditionalFieldType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
+ $appliesToChoices = array(
+ 'LsItem' => 'lsitem',
+ 'LsAssociation' => 'lsassociation',
+ 'LsDoc' => 'LsDoc',
+ );
$builder
->add('name')
->add('displayName')
+ ->add('appliesTo', ChoiceType::class, array('choices' => $appliesToChoices))
- ->add('appliesTo', null, ['data' => 'lsitem'])
? ^ --- --- - ^^^
+ ->add('type', null, ['data' => 'string'])
? ^^ ++ ^^
- ->add('type')
->add('typeInfo', null, ['required' => false])
->add('save', SubmitType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => AdditionalField::class,
]);
}
} | 10 | 0.333333 | 8 | 2 |
b5ea3642439dae8aaa6a92752fbe16779f8217bc | AgreementMaker/src/am/Main.java | AgreementMaker/src/am/Main.java | package am;
import am.app.Core;
import am.batchMode.TrackDispatcher;
import am.userInterface.UI;
/**
* Main class -
*
* This class creates an instance of UI class
*
* @author ADVIS Research Laboratory
* @version 11/27/2004
*/
public class Main
{
/*******************************************************************************************/
/**
* This is the main function
* It creates a new instance of UI class
*
* @param args array of strings
*/
public static void main(String args[])
{
if(args.length == 0 ){
//UI ui;
UI ui = new UI();
Core.getInstance().setUI(ui);
}
else{
String track = args[0];
String subTrack = "";
if(args.length > 1){
subTrack = args[1];
}
TrackDispatcher.dispatchTrack(track, subTrack);
}
}
}
| /** ________________________________________
* ___/ Copyright Notice / Warranty Disclaimer \________________
*
* @copyright { Copyright (c) 2010
* Advances in Information Systems Laboratory at the
* University of Illinois at Chicago
* All Rights Reserved. }
*
* @disclaimer {
* This work is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. }
*
* _____________________
* ___/ Authors / Changelog \___________________________________
*
*
*/
package am;
import javax.swing.SwingUtilities;
import am.app.Core;
import am.batchMode.TrackDispatcher;
import am.userInterface.UI;
/**
* Main class -
*
* This class creates an instance of UI class
*
* @author ADVIS Research Laboratory
* @version 11/27/2004
*/
public class Main
{
/**
* This is the application entry point.
* It creates instantiates.
*
* @param args Command line arguments, used for operating AgreementMaker in automatic mode, without a UI.
*/
public static void main(String args[])
{
if(args.length == 0 ){
// Proper way of intializing the UI.
// Reference: http://java.sun.com/developer/technicalArticles/javase/swingworker/ (Starting off on the Right Thread)
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
Core.setUI( new UI() );
}
}
);
}
else{
String track = args[0];
String subTrack = "";
if(args.length > 1){
subTrack = args[1];
}
TrackDispatcher.dispatchTrack(track, subTrack);
}
}
}
| Initialize the UI in the Event Dispatching Thread. | Initialize the UI in the Event Dispatching Thread.
| Java | agpl-3.0 | Stanwar/agreementmaker,sabarish14/agreementmaker,sabarish14/agreementmaker,Stanwar/agreementmaker,Stanwar/agreementmaker,sabarish14/agreementmaker,sabarish14/agreementmaker,Stanwar/agreementmaker | java | ## Code Before:
package am;
import am.app.Core;
import am.batchMode.TrackDispatcher;
import am.userInterface.UI;
/**
* Main class -
*
* This class creates an instance of UI class
*
* @author ADVIS Research Laboratory
* @version 11/27/2004
*/
public class Main
{
/*******************************************************************************************/
/**
* This is the main function
* It creates a new instance of UI class
*
* @param args array of strings
*/
public static void main(String args[])
{
if(args.length == 0 ){
//UI ui;
UI ui = new UI();
Core.getInstance().setUI(ui);
}
else{
String track = args[0];
String subTrack = "";
if(args.length > 1){
subTrack = args[1];
}
TrackDispatcher.dispatchTrack(track, subTrack);
}
}
}
## Instruction:
Initialize the UI in the Event Dispatching Thread.
## Code After:
/** ________________________________________
* ___/ Copyright Notice / Warranty Disclaimer \________________
*
* @copyright { Copyright (c) 2010
* Advances in Information Systems Laboratory at the
* University of Illinois at Chicago
* All Rights Reserved. }
*
* @disclaimer {
* This work is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. }
*
* _____________________
* ___/ Authors / Changelog \___________________________________
*
*
*/
package am;
import javax.swing.SwingUtilities;
import am.app.Core;
import am.batchMode.TrackDispatcher;
import am.userInterface.UI;
/**
* Main class -
*
* This class creates an instance of UI class
*
* @author ADVIS Research Laboratory
* @version 11/27/2004
*/
public class Main
{
/**
* This is the application entry point.
* It creates instantiates.
*
* @param args Command line arguments, used for operating AgreementMaker in automatic mode, without a UI.
*/
public static void main(String args[])
{
if(args.length == 0 ){
// Proper way of intializing the UI.
// Reference: http://java.sun.com/developer/technicalArticles/javase/swingworker/ (Starting off on the Right Thread)
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
Core.setUI( new UI() );
}
}
);
}
else{
String track = args[0];
String subTrack = "";
if(args.length > 1){
subTrack = args[1];
}
TrackDispatcher.dispatchTrack(track, subTrack);
}
}
}
| + /** ________________________________________
+ * ___/ Copyright Notice / Warranty Disclaimer \________________
+ *
+ * @copyright { Copyright (c) 2010
+ * Advances in Information Systems Laboratory at the
+ * University of Illinois at Chicago
+ * All Rights Reserved. }
+ *
+ * @disclaimer {
+ * This work is distributed WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. }
+ *
+ * _____________________
+ * ___/ Authors / Changelog \___________________________________
+ *
+ *
+ */
+
+
package am;
+
+ import javax.swing.SwingUtilities;
import am.app.Core;
import am.batchMode.TrackDispatcher;
import am.userInterface.UI;
/**
* Main class -
*
* This class creates an instance of UI class
*
* @author ADVIS Research Laboratory
* @version 11/27/2004
*/
public class Main
{
-
- /*******************************************************************************************/
/**
- * This is the main function
- * It creates a new instance of UI class
+ * This is the application entry point.
+ * It creates instantiates.
*
- * @param args array of strings
+ * @param args Command line arguments, used for operating AgreementMaker in automatic mode, without a UI.
*/
public static void main(String args[])
{
if(args.length == 0 ){
- //UI ui;
- UI ui = new UI();
- Core.getInstance().setUI(ui);
+ // Proper way of intializing the UI.
+ // Reference: http://java.sun.com/developer/technicalArticles/javase/swingworker/ (Starting off on the Right Thread)
+ SwingUtilities.invokeLater(
+ new Runnable() {
+ public void run() {
+ Core.setUI( new UI() );
+ }
+ }
+ );
}
else{
String track = args[0];
String subTrack = "";
if(args.length > 1){
subTrack = args[1];
}
TrackDispatcher.dispatchTrack(track, subTrack);
}
}
}
| 42 | 1 | 34 | 8 |
a742b4a9de85c421a1db8b2c7cd38e3823c157e7 | app/models/campaign_event.rb | app/models/campaign_event.rb | class CampaignEvent < ActiveRecord::Base
belongs_to :campaign
belongs_to :described, :polymorphic => true
validates_inclusion_of :event_type, :in => ['outgoing_message_sent',
'incoming_message_received',
'campaign_update_added',
'assignment_given',
'assignment_completed',
'comment_added']
named_scope :visible, :conditions => ["visible = ?", true], :order => 'created_at desc'
before_validation :set_visibility
after_save :update_campaign_latest_event_at
def update_campaign_latest_event_at
self.campaign.update_attribute('latest_event_at', self.created_at)
end
def set_visibility
case self.event_type
when 'assignment_completed'
# all assignment completions are visible except publish-problem, write-to-other
if ['publish-problem', 'write-to-other'].include?(self.described.task_type_name)
self.visible = false
else
self.visible = true
end
when 'comment_added'
# comments currently only on things that already have visible events
self.visible = false
when 'campaign_update_added'
# only general campaign updates are visible
if self.described.incoming_message or self.described.outgoing_message
self.visible = false
else
self.visible = true
end
else
self.visible = true
end
return true
end
end
| class CampaignEvent < ActiveRecord::Base
belongs_to :campaign
belongs_to :described, :polymorphic => true
validates_inclusion_of :event_type, :in => ['outgoing_message_sent',
'incoming_message_received',
'campaign_update_added',
'assignment_given',
'assignment_completed',
'comment_added']
named_scope :visible, :conditions => ["visible = ?", true], :order => 'created_at desc'
before_validation :set_visibility
after_save :update_campaign_latest_event_at
def update_campaign_latest_event_at
self.campaign.update_attribute('latest_event_at', self.created_at)
end
def set_visibility
case self.event_type
when 'assignment_completed'
# all assignment completions are visible except write-to-other
if ['write-to-other'].include?(self.described.task_type_name)
self.visible = false
else
self.visible = true
end
when 'comment_added'
# comments currently only on things that already have visible events
self.visible = false
when 'campaign_update_added'
# only general campaign updates are visible
if self.described.incoming_message or self.described.outgoing_message
self.visible = false
else
self.visible = true
end
else
self.visible = true
end
return true
end
end
| Make reporting the problem a visible campaign event. | Make reporting the problem a visible campaign event.
| Ruby | agpl-3.0 | mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport | ruby | ## Code Before:
class CampaignEvent < ActiveRecord::Base
belongs_to :campaign
belongs_to :described, :polymorphic => true
validates_inclusion_of :event_type, :in => ['outgoing_message_sent',
'incoming_message_received',
'campaign_update_added',
'assignment_given',
'assignment_completed',
'comment_added']
named_scope :visible, :conditions => ["visible = ?", true], :order => 'created_at desc'
before_validation :set_visibility
after_save :update_campaign_latest_event_at
def update_campaign_latest_event_at
self.campaign.update_attribute('latest_event_at', self.created_at)
end
def set_visibility
case self.event_type
when 'assignment_completed'
# all assignment completions are visible except publish-problem, write-to-other
if ['publish-problem', 'write-to-other'].include?(self.described.task_type_name)
self.visible = false
else
self.visible = true
end
when 'comment_added'
# comments currently only on things that already have visible events
self.visible = false
when 'campaign_update_added'
# only general campaign updates are visible
if self.described.incoming_message or self.described.outgoing_message
self.visible = false
else
self.visible = true
end
else
self.visible = true
end
return true
end
end
## Instruction:
Make reporting the problem a visible campaign event.
## Code After:
class CampaignEvent < ActiveRecord::Base
belongs_to :campaign
belongs_to :described, :polymorphic => true
validates_inclusion_of :event_type, :in => ['outgoing_message_sent',
'incoming_message_received',
'campaign_update_added',
'assignment_given',
'assignment_completed',
'comment_added']
named_scope :visible, :conditions => ["visible = ?", true], :order => 'created_at desc'
before_validation :set_visibility
after_save :update_campaign_latest_event_at
def update_campaign_latest_event_at
self.campaign.update_attribute('latest_event_at', self.created_at)
end
def set_visibility
case self.event_type
when 'assignment_completed'
# all assignment completions are visible except write-to-other
if ['write-to-other'].include?(self.described.task_type_name)
self.visible = false
else
self.visible = true
end
when 'comment_added'
# comments currently only on things that already have visible events
self.visible = false
when 'campaign_update_added'
# only general campaign updates are visible
if self.described.incoming_message or self.described.outgoing_message
self.visible = false
else
self.visible = true
end
else
self.visible = true
end
return true
end
end
| class CampaignEvent < ActiveRecord::Base
belongs_to :campaign
belongs_to :described, :polymorphic => true
validates_inclusion_of :event_type, :in => ['outgoing_message_sent',
'incoming_message_received',
'campaign_update_added',
'assignment_given',
'assignment_completed',
'comment_added']
named_scope :visible, :conditions => ["visible = ?", true], :order => 'created_at desc'
before_validation :set_visibility
after_save :update_campaign_latest_event_at
def update_campaign_latest_event_at
self.campaign.update_attribute('latest_event_at', self.created_at)
end
def set_visibility
case self.event_type
when 'assignment_completed'
- # all assignment completions are visible except publish-problem, write-to-other
? -----------------
+ # all assignment completions are visible except write-to-other
- if ['publish-problem', 'write-to-other'].include?(self.described.task_type_name)
? -------------------
+ if ['write-to-other'].include?(self.described.task_type_name)
self.visible = false
else
self.visible = true
end
when 'comment_added'
# comments currently only on things that already have visible events
self.visible = false
when 'campaign_update_added'
# only general campaign updates are visible
if self.described.incoming_message or self.described.outgoing_message
self.visible = false
else
self.visible = true
end
else
self.visible = true
end
return true
end
end | 4 | 0.090909 | 2 | 2 |
e2358c8b41c32dd9bfaa1afe444b418a258fbd5a | app/login/login_test.js | app/login/login_test.js | 'use strict';
describe('angularBasicAuthExample.login module', function() {
var scope;
// Mock unavailable modules
angular.module('ngMessages', []);
angular.module('angularBasicAuthExample.user', []);
beforeEach(module('angularBasicAuthExample.login'));
describe('login controller', function() {
it('should ....', inject(function($rootScope, $controller) {
scope = $rootScope.$new();
var user = {login: function() {}};
var parameters = {
$scope: scope,
User: user
};
var loginCtrl = $controller('LoginCtrl', parameters);
expect(loginCtrl).toBeDefined();
}));
});
});
| 'use strict';
describe('angularBasicAuthExample.login module', function() {
var scope;
// Mock unavailable modules
angular.module('ngMessages', []);
angular.module('ngNotify', []);
angular.module('angularBasicAuthExample.user', []);
beforeEach(module('angularBasicAuthExample.login'));
describe('login controller', function() {
it('should ....', inject(function($rootScope, $controller) {
scope = $rootScope.$new();
var user = {login: function() {}};
var parameters = {
$scope: scope,
ngNotify: null,
User: user
};
var loginCtrl = $controller('LoginCtrl', parameters);
expect(loginCtrl).toBeDefined();
}));
});
});
| Fix test to work with ngNotify | Fix test to work with ngNotify
| JavaScript | mit | jessamynsmith/angular-basic-auth-example,jessamynsmith/angular-basic-auth-example | javascript | ## Code Before:
'use strict';
describe('angularBasicAuthExample.login module', function() {
var scope;
// Mock unavailable modules
angular.module('ngMessages', []);
angular.module('angularBasicAuthExample.user', []);
beforeEach(module('angularBasicAuthExample.login'));
describe('login controller', function() {
it('should ....', inject(function($rootScope, $controller) {
scope = $rootScope.$new();
var user = {login: function() {}};
var parameters = {
$scope: scope,
User: user
};
var loginCtrl = $controller('LoginCtrl', parameters);
expect(loginCtrl).toBeDefined();
}));
});
});
## Instruction:
Fix test to work with ngNotify
## Code After:
'use strict';
describe('angularBasicAuthExample.login module', function() {
var scope;
// Mock unavailable modules
angular.module('ngMessages', []);
angular.module('ngNotify', []);
angular.module('angularBasicAuthExample.user', []);
beforeEach(module('angularBasicAuthExample.login'));
describe('login controller', function() {
it('should ....', inject(function($rootScope, $controller) {
scope = $rootScope.$new();
var user = {login: function() {}};
var parameters = {
$scope: scope,
ngNotify: null,
User: user
};
var loginCtrl = $controller('LoginCtrl', parameters);
expect(loginCtrl).toBeDefined();
}));
});
});
| 'use strict';
describe('angularBasicAuthExample.login module', function() {
var scope;
// Mock unavailable modules
angular.module('ngMessages', []);
+ angular.module('ngNotify', []);
angular.module('angularBasicAuthExample.user', []);
beforeEach(module('angularBasicAuthExample.login'));
describe('login controller', function() {
it('should ....', inject(function($rootScope, $controller) {
scope = $rootScope.$new();
var user = {login: function() {}};
var parameters = {
$scope: scope,
+ ngNotify: null,
User: user
};
var loginCtrl = $controller('LoginCtrl', parameters);
expect(loginCtrl).toBeDefined();
}));
});
}); | 2 | 0.08 | 2 | 0 |
bc9e40b452b20f8464ede746a628b814327bcb3c | packages/ph/phonetic-languages-filters-array.yaml | packages/ph/phonetic-languages-filters-array.yaml | homepage: https://hackage.haskell.org/package/phonetic-languages-filters-array
changelog-type: markdown
hash: bfd1541ebb6755b54d886b30058f87a4ee47d2a172b7ae531d7fceecdc9a7b0d
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Allows to change the structure of the function output.
changelog: |
# Revision history for phonetic-languages-filters-array
## 0.1.0.0 -- 2020-12-31
* First version. Released on an unsuspecting world.
basic-deps:
base: '>=4.7 && <5'
filters-basic: '>=0.1.1 && <1'
mmsyn2-array: '>=0.1.1 && <1'
all-versions:
- 0.1.0.0
author: OleksandrZhabenko
latest: 0.1.0.0
description-type: haddock
description: Allows to change the structure of the function output for the data types
that have instances of the RealFrac class. Is rewritten from the predecessor uniqueness-periods-vector-filters
package.
license-name: MIT
| homepage: https://hackage.haskell.org/package/phonetic-languages-filters-array
changelog-type: markdown
hash: 70dc3029d86ffeb8f768c89873883e975b9d8af9d391043f7f63a0d7a9e6a149
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Allows to change the structure of the function output.
changelog: |
# Revision history for phonetic-languages-filters-array
## 0.1.0.0 -- 2020-12-31
* First version. Released on an unsuspecting world.
## 0.2.0.0 -- 2021-10-30
* Second version. Switched to the Case.Hashable.Cuckoo.getBFstL' function and the cuckoo hashtables.
Updated the dependencies boundaries.
basic-deps:
base: '>=4.9 && <5'
filters-basic: '>=0.1.1 && <1'
mmsyn2-array: '>=0.2.1.1 && <1'
hashable: '>=1.2.7 && <2'
all-versions:
- 0.1.0.0
- 0.2.0.0
author: OleksandrZhabenko
latest: 0.2.0.0
description-type: haddock
description: Allows to change the structure of the function output for the data types
that have instances of the RealFrac class. Is rewritten from the predecessor uniqueness-periods-vector-filters
package. Since the 0.2.0.0 version uses hashtables (because of using Case.Hashable.Cuckoo.getBFstL'
function).
license-name: MIT
| Update from Hackage at 2021-10-30T16:11:01Z | Update from Hackage at 2021-10-30T16:11:01Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://hackage.haskell.org/package/phonetic-languages-filters-array
changelog-type: markdown
hash: bfd1541ebb6755b54d886b30058f87a4ee47d2a172b7ae531d7fceecdc9a7b0d
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Allows to change the structure of the function output.
changelog: |
# Revision history for phonetic-languages-filters-array
## 0.1.0.0 -- 2020-12-31
* First version. Released on an unsuspecting world.
basic-deps:
base: '>=4.7 && <5'
filters-basic: '>=0.1.1 && <1'
mmsyn2-array: '>=0.1.1 && <1'
all-versions:
- 0.1.0.0
author: OleksandrZhabenko
latest: 0.1.0.0
description-type: haddock
description: Allows to change the structure of the function output for the data types
that have instances of the RealFrac class. Is rewritten from the predecessor uniqueness-periods-vector-filters
package.
license-name: MIT
## Instruction:
Update from Hackage at 2021-10-30T16:11:01Z
## Code After:
homepage: https://hackage.haskell.org/package/phonetic-languages-filters-array
changelog-type: markdown
hash: 70dc3029d86ffeb8f768c89873883e975b9d8af9d391043f7f63a0d7a9e6a149
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Allows to change the structure of the function output.
changelog: |
# Revision history for phonetic-languages-filters-array
## 0.1.0.0 -- 2020-12-31
* First version. Released on an unsuspecting world.
## 0.2.0.0 -- 2021-10-30
* Second version. Switched to the Case.Hashable.Cuckoo.getBFstL' function and the cuckoo hashtables.
Updated the dependencies boundaries.
basic-deps:
base: '>=4.9 && <5'
filters-basic: '>=0.1.1 && <1'
mmsyn2-array: '>=0.2.1.1 && <1'
hashable: '>=1.2.7 && <2'
all-versions:
- 0.1.0.0
- 0.2.0.0
author: OleksandrZhabenko
latest: 0.2.0.0
description-type: haddock
description: Allows to change the structure of the function output for the data types
that have instances of the RealFrac class. Is rewritten from the predecessor uniqueness-periods-vector-filters
package. Since the 0.2.0.0 version uses hashtables (because of using Case.Hashable.Cuckoo.getBFstL'
function).
license-name: MIT
| homepage: https://hackage.haskell.org/package/phonetic-languages-filters-array
changelog-type: markdown
- hash: bfd1541ebb6755b54d886b30058f87a4ee47d2a172b7ae531d7fceecdc9a7b0d
+ hash: 70dc3029d86ffeb8f768c89873883e975b9d8af9d391043f7f63a0d7a9e6a149
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Allows to change the structure of the function output.
changelog: |
# Revision history for phonetic-languages-filters-array
## 0.1.0.0 -- 2020-12-31
* First version. Released on an unsuspecting world.
+
+ ## 0.2.0.0 -- 2021-10-30
+
+ * Second version. Switched to the Case.Hashable.Cuckoo.getBFstL' function and the cuckoo hashtables.
+ Updated the dependencies boundaries.
basic-deps:
- base: '>=4.7 && <5'
? ^
+ base: '>=4.9 && <5'
? ^
filters-basic: '>=0.1.1 && <1'
- mmsyn2-array: '>=0.1.1 && <1'
+ mmsyn2-array: '>=0.2.1.1 && <1'
? ++
+ hashable: '>=1.2.7 && <2'
all-versions:
- 0.1.0.0
+ - 0.2.0.0
author: OleksandrZhabenko
- latest: 0.1.0.0
? ^
+ latest: 0.2.0.0
? ^
description-type: haddock
description: Allows to change the structure of the function output for the data types
that have instances of the RealFrac class. Is rewritten from the predecessor uniqueness-periods-vector-filters
- package.
+ package. Since the 0.2.0.0 version uses hashtables (because of using Case.Hashable.Cuckoo.getBFstL'
+ function).
license-name: MIT | 18 | 0.72 | 13 | 5 |
a1fcfa04051fa638837aed9c3e00352bcbe38a72 | src/components/dev-bookmarks.jsx | src/components/dev-bookmarks.jsx | import React from 'react';
const BOOKMARKS = require('json!../../assets/dev-bookmarks.json');
export const DevBookmarks = () => {
const bookmarks = BOOKMARKS.map((bm, i) => {
const isTag = bm.url.startsWith('/tag');
return (<li key={i}>
<span
style={{ color: '#bbb', paddingRight: 5 }}
className={isTag ? 'octicon octicon-three-bars' : 'octicon octicon-link-external'}
/>
<a href={bm.url} style={{ color: '#00b7ff' }} target={ isTag ? '_self' : '_blank'}>
{bm.title}
</a>
</li>);
});
return (<ul className="list-unstyled">{bookmarks}</ul>);
};
| import React from 'react';
import { Link } from 'react-router';
const BOOKMARKS = require('json!../../assets/dev-bookmarks.json');
const STYLE = { color: '#00b7ff' };
export const DevBookmarks = () => {
const bookmarks = BOOKMARKS.map((bm, i) => {
const isTag = bm.url.startsWith('/tag');
const link = isTag
? <Link to={bm.url} style={STYLE}>{bm.title}</Link>
: <a href={bm.url} style={STYLE} target="_blank">{bm.title}</a>;
return (<li key={i}>
<span
style={{ color: '#bbb', paddingRight: 5 }}
className={isTag ? 'octicon octicon-three-bars' : 'octicon octicon-link-external'}
/>
{link}
</li>);
});
return (<ul className="list-unstyled">{bookmarks}</ul>);
};
| Use router for internal links. | Use router for internal links.
| JSX | mit | jhh/puka-react,jhh/puka-react,jhh/puka-react | jsx | ## Code Before:
import React from 'react';
const BOOKMARKS = require('json!../../assets/dev-bookmarks.json');
export const DevBookmarks = () => {
const bookmarks = BOOKMARKS.map((bm, i) => {
const isTag = bm.url.startsWith('/tag');
return (<li key={i}>
<span
style={{ color: '#bbb', paddingRight: 5 }}
className={isTag ? 'octicon octicon-three-bars' : 'octicon octicon-link-external'}
/>
<a href={bm.url} style={{ color: '#00b7ff' }} target={ isTag ? '_self' : '_blank'}>
{bm.title}
</a>
</li>);
});
return (<ul className="list-unstyled">{bookmarks}</ul>);
};
## Instruction:
Use router for internal links.
## Code After:
import React from 'react';
import { Link } from 'react-router';
const BOOKMARKS = require('json!../../assets/dev-bookmarks.json');
const STYLE = { color: '#00b7ff' };
export const DevBookmarks = () => {
const bookmarks = BOOKMARKS.map((bm, i) => {
const isTag = bm.url.startsWith('/tag');
const link = isTag
? <Link to={bm.url} style={STYLE}>{bm.title}</Link>
: <a href={bm.url} style={STYLE} target="_blank">{bm.title}</a>;
return (<li key={i}>
<span
style={{ color: '#bbb', paddingRight: 5 }}
className={isTag ? 'octicon octicon-three-bars' : 'octicon octicon-link-external'}
/>
{link}
</li>);
});
return (<ul className="list-unstyled">{bookmarks}</ul>);
};
| import React from 'react';
+ import { Link } from 'react-router';
const BOOKMARKS = require('json!../../assets/dev-bookmarks.json');
+ const STYLE = { color: '#00b7ff' };
export const DevBookmarks = () => {
const bookmarks = BOOKMARKS.map((bm, i) => {
const isTag = bm.url.startsWith('/tag');
+ const link = isTag
+ ? <Link to={bm.url} style={STYLE}>{bm.title}</Link>
+ : <a href={bm.url} style={STYLE} target="_blank">{bm.title}</a>;
return (<li key={i}>
<span
style={{ color: '#bbb', paddingRight: 5 }}
className={isTag ? 'octicon octicon-three-bars' : 'octicon octicon-link-external'}
/>
+ {link}
- <a href={bm.url} style={{ color: '#00b7ff' }} target={ isTag ? '_self' : '_blank'}>
- {bm.title}
- </a>
</li>);
});
return (<ul className="list-unstyled">{bookmarks}</ul>);
}; | 9 | 0.45 | 6 | 3 |
cbd0ac36f1ff58f892e235aaa5a516cea88396b9 | test/lib/test_query_result_collection.rb | test/lib/test_query_result_collection.rb | require 'test_helper'
class TestQueryResultCollection < Test::Unit::TestCase
def setup
options = {
:username => 'myusername',
:password => 'mypassword',
:token => "somelongtoken"
}
@client = SalesforceBulk::Client.new(options)
@jobId = "123"
@batchId = "234"
@resultIds = ["12","23","34"]
end
test "initilize" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
assert_equal collection.client, @client
assert_equal collection.jobId, @jobId
assert_equal collection.batchId, @batchId
assert_equal collection.currentIndex, 0
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId, 5)
assert_equal collection.currentIndex, 5
end
end | require 'test_helper'
class TestQueryResultCollection < Test::Unit::TestCase
def setup
options = {
:username => 'myusername',
:password => 'mypassword',
:token => "somelongtoken"
}
@client = SalesforceBulk::Client.new(options)
@jobId = "123"
@batchId = "234"
@resultIds = ["12","23","34"]
end
test "initilize" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
assert_equal collection.client, @client
assert_equal collection.jobId, @jobId
assert_equal collection.batchId, @batchId
assert_equal collection.currentIndex, 0
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId, 5)
assert_equal collection.currentIndex, 5
end
test "next?" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
collection.push *@resultIds
assert collection.next?
collection.instance_variable_set("@currentIndex", 2)
assert !collection.next?
end
test "previous?" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
collection.push *@resultIds
assert !collection.previous?
collection.instance_variable_set("@currentIndex", 2)
assert collection.previous?
end
end | Add tests for next? and previous? methods. | Add tests for next? and previous? methods.
| Ruby | mit | javierjulio/salesforce_bulk | ruby | ## Code Before:
require 'test_helper'
class TestQueryResultCollection < Test::Unit::TestCase
def setup
options = {
:username => 'myusername',
:password => 'mypassword',
:token => "somelongtoken"
}
@client = SalesforceBulk::Client.new(options)
@jobId = "123"
@batchId = "234"
@resultIds = ["12","23","34"]
end
test "initilize" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
assert_equal collection.client, @client
assert_equal collection.jobId, @jobId
assert_equal collection.batchId, @batchId
assert_equal collection.currentIndex, 0
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId, 5)
assert_equal collection.currentIndex, 5
end
end
## Instruction:
Add tests for next? and previous? methods.
## Code After:
require 'test_helper'
class TestQueryResultCollection < Test::Unit::TestCase
def setup
options = {
:username => 'myusername',
:password => 'mypassword',
:token => "somelongtoken"
}
@client = SalesforceBulk::Client.new(options)
@jobId = "123"
@batchId = "234"
@resultIds = ["12","23","34"]
end
test "initilize" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
assert_equal collection.client, @client
assert_equal collection.jobId, @jobId
assert_equal collection.batchId, @batchId
assert_equal collection.currentIndex, 0
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId, 5)
assert_equal collection.currentIndex, 5
end
test "next?" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
collection.push *@resultIds
assert collection.next?
collection.instance_variable_set("@currentIndex", 2)
assert !collection.next?
end
test "previous?" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
collection.push *@resultIds
assert !collection.previous?
collection.instance_variable_set("@currentIndex", 2)
assert collection.previous?
end
end | require 'test_helper'
class TestQueryResultCollection < Test::Unit::TestCase
def setup
options = {
:username => 'myusername',
:password => 'mypassword',
:token => "somelongtoken"
}
@client = SalesforceBulk::Client.new(options)
@jobId = "123"
@batchId = "234"
@resultIds = ["12","23","34"]
end
test "initilize" do
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
assert_equal collection.client, @client
assert_equal collection.jobId, @jobId
assert_equal collection.batchId, @batchId
assert_equal collection.currentIndex, 0
collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId, 5)
assert_equal collection.currentIndex, 5
end
+ test "next?" do
+ collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
+ collection.push *@resultIds
+ assert collection.next?
+
+ collection.instance_variable_set("@currentIndex", 2)
+ assert !collection.next?
+ end
+
+ test "previous?" do
+ collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId)
+ collection.push *@resultIds
+ assert !collection.previous?
+
+ collection.instance_variable_set("@currentIndex", 2)
+ assert collection.previous?
+ end
+
end | 18 | 0.62069 | 18 | 0 |
25b63973f2977535b45a608fafc1ca9a326b22df | .travis.yml | .travis.yml | language: php
services:
- docker
before_install:
- docker build -t flyimg .
- docker run -t -d -i -v $(pwd):/var/www/html --name flyimg flyimg
- docker exec flyimg composer install
script:
- docker exec flyimg ./vendor/bin/phpunit
notifications:
email:
- sadoknet@gmail.com
| language: php
services:
- docker
before_install:
- docker build -t flyimg .
- docker run -t -d -i -v $(pwd):/var/www/html --name flyimg flyimg
- docker exec flyimg composer install
script:
- docker exec flyimg ./vendor/bin/phpunit
notifications:
email:
- sadoknet@gmail.com
- baamenabar@gmail.com
| Add baamenabar in the email notifcation: | Add baamenabar in the email notifcation:
| YAML | mit | flyimg/flyimg,flyimg/flyimg,flyimg/flyimg,flyimg/flyimg | yaml | ## Code Before:
language: php
services:
- docker
before_install:
- docker build -t flyimg .
- docker run -t -d -i -v $(pwd):/var/www/html --name flyimg flyimg
- docker exec flyimg composer install
script:
- docker exec flyimg ./vendor/bin/phpunit
notifications:
email:
- sadoknet@gmail.com
## Instruction:
Add baamenabar in the email notifcation:
## Code After:
language: php
services:
- docker
before_install:
- docker build -t flyimg .
- docker run -t -d -i -v $(pwd):/var/www/html --name flyimg flyimg
- docker exec flyimg composer install
script:
- docker exec flyimg ./vendor/bin/phpunit
notifications:
email:
- sadoknet@gmail.com
- baamenabar@gmail.com
| language: php
services:
- docker
before_install:
- docker build -t flyimg .
- docker run -t -d -i -v $(pwd):/var/www/html --name flyimg flyimg
- docker exec flyimg composer install
script:
- docker exec flyimg ./vendor/bin/phpunit
notifications:
email:
- sadoknet@gmail.com
+ - baamenabar@gmail.com | 1 | 0.0625 | 1 | 0 |
0af0f93213cc8a1627b7ea2141e4171673e6c6c9 | packages/hs/hsyslog.yaml | packages/hs/hsyslog.yaml | homepage: http://github.com/peti/hsyslog
changelog-type: ''
hash: adda66d7c9af31f5eac447f73bfb3ad65789cb78dcab8bd2e081de61a16d8fbe
test-bench-deps:
base: -any
doctest: -any
maintainer: Peter Simons <simons@cryp.to>
synopsis: FFI interface to syslog(3) from POSIX.1-2001
changelog: ''
basic-deps:
base: ! '>=3 && <5'
all-versions:
- '1.2'
- '1.3'
- '1.4'
- '1.5'
- '1.6'
- '2.0'
author: Peter Simons <simons@cryp.to>
latest: '2.0'
description-type: haddock
description: ! 'This library provides FFI bindings to syslog(3) from POSIX.1-2001.
See <http://www.opengroup.org/onlinepubs/009695399/basedefs/syslog.h.html> for
further details.'
license-name: BSD3
| homepage: http://github.com/peti/hsyslog
changelog-type: ''
hash: 73f8010b191da91007809db6cf2f2b5a7d7d59732a9c302457ce0816ffe7a25a
test-bench-deps:
bytestring: -any
base: -any
hsyslog: -any
QuickCheck: -any
maintainer: Peter Simons <simons@cryp.to>
synopsis: FFI interface to syslog(3) from POSIX.1-2001
changelog: ''
basic-deps:
bytestring: ==0.10.*
base: ! '>=3 && <5'
all-versions:
- '1.2'
- '1.3'
- '1.4'
- '1.5'
- '1.6'
- '2.0'
- '4'
author: Peter Simons, John Lato, Jonathan Childress
latest: '4'
description-type: haddock
description: ! 'This library provides FFI bindings to syslog(3) from
<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html POSIX.1-2008>.'
license-name: BSD3
| Update from Hackage at 2016-06-03T17:56:04+0000 | Update from Hackage at 2016-06-03T17:56:04+0000
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: http://github.com/peti/hsyslog
changelog-type: ''
hash: adda66d7c9af31f5eac447f73bfb3ad65789cb78dcab8bd2e081de61a16d8fbe
test-bench-deps:
base: -any
doctest: -any
maintainer: Peter Simons <simons@cryp.to>
synopsis: FFI interface to syslog(3) from POSIX.1-2001
changelog: ''
basic-deps:
base: ! '>=3 && <5'
all-versions:
- '1.2'
- '1.3'
- '1.4'
- '1.5'
- '1.6'
- '2.0'
author: Peter Simons <simons@cryp.to>
latest: '2.0'
description-type: haddock
description: ! 'This library provides FFI bindings to syslog(3) from POSIX.1-2001.
See <http://www.opengroup.org/onlinepubs/009695399/basedefs/syslog.h.html> for
further details.'
license-name: BSD3
## Instruction:
Update from Hackage at 2016-06-03T17:56:04+0000
## Code After:
homepage: http://github.com/peti/hsyslog
changelog-type: ''
hash: 73f8010b191da91007809db6cf2f2b5a7d7d59732a9c302457ce0816ffe7a25a
test-bench-deps:
bytestring: -any
base: -any
hsyslog: -any
QuickCheck: -any
maintainer: Peter Simons <simons@cryp.to>
synopsis: FFI interface to syslog(3) from POSIX.1-2001
changelog: ''
basic-deps:
bytestring: ==0.10.*
base: ! '>=3 && <5'
all-versions:
- '1.2'
- '1.3'
- '1.4'
- '1.5'
- '1.6'
- '2.0'
- '4'
author: Peter Simons, John Lato, Jonathan Childress
latest: '4'
description-type: haddock
description: ! 'This library provides FFI bindings to syslog(3) from
<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html POSIX.1-2008>.'
license-name: BSD3
| homepage: http://github.com/peti/hsyslog
changelog-type: ''
- hash: adda66d7c9af31f5eac447f73bfb3ad65789cb78dcab8bd2e081de61a16d8fbe
+ hash: 73f8010b191da91007809db6cf2f2b5a7d7d59732a9c302457ce0816ffe7a25a
test-bench-deps:
+ bytestring: -any
base: -any
- doctest: -any
+ hsyslog: -any
+ QuickCheck: -any
maintainer: Peter Simons <simons@cryp.to>
synopsis: FFI interface to syslog(3) from POSIX.1-2001
changelog: ''
basic-deps:
+ bytestring: ==0.10.*
base: ! '>=3 && <5'
all-versions:
- '1.2'
- '1.3'
- '1.4'
- '1.5'
- '1.6'
- '2.0'
- author: Peter Simons <simons@cryp.to>
+ - '4'
+ author: Peter Simons, John Lato, Jonathan Childress
- latest: '2.0'
? ^^^
+ latest: '4'
? ^
description-type: haddock
- description: ! 'This library provides FFI bindings to syslog(3) from POSIX.1-2001.
? --------------
+ description: ! 'This library provides FFI bindings to syslog(3) from
- See <http://www.opengroup.org/onlinepubs/009695399/basedefs/syslog.h.html> for
? ---- ^^^ -- ^^ ^^^^
+ <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/syslog.h.html POSIX.1-2008>.'
? ^^^^ ^^^^^ +++++++++++++ ^^
-
- further details.'
license-name: BSD3 | 18 | 0.666667 | 10 | 8 |
a62877b7873675b4c88695a81dadb665a7d36e9d | test-integration/success.yml | test-integration/success.yml | - description: Prepare failure test fixture with existing repositories
command: cp ../../../../../test-integration/fixtures/.somerepoman_success.json .repoman.json
exitcode: 0
- description: Command list should list down all repositories
command: ../../../../../bin/repoman list
exitcode: 0
output: ^datagen\nnestor\n$
- description: Command init should succeed due to existing repositories
command: ../../../../../bin/repoman init
exitcode: 0
output: 'Cloning into '
- description: Command get should update repositories
command: ../../../../../bin/repoman get
exitcode: 0
output: 'Already up-to-date.'
- description: Command exec should execute same command on all repositories
command: ../../../../../bin/repoman exec 'touch somefile'
exitcode: 0
output: 'touch somefile'
- description: Command changes should display uncommitted changes
command: ../../../../../bin/repoman changes
exitcode: 0
output: 'somefile'
- description: Command undo should remove uncommitted changes
command: ../../../../../bin/repoman undo
exitcode: 0
output: 'No local changes to save' | - description: Prepare failure test fixture with existing repositories
command: cp ../../../../../test-integration/fixtures/.somerepoman_success.json .repoman.json
exitcode: 0
- description: Command list should list down all repositories
command: ../../../../../bin/repoman list
exitcode: 0
output: ^datagen\nnestor\n$
- description: Command init should succeed due to existing repositories
command: ../../../../../bin/repoman init
exitcode: 0
output: 'Cloning into '
- description: Command get should update repositories
command: ../../../../../bin/repoman get
exitcode: 0
output: 'Current branch master is up to date.'
- description: Command exec should execute same command on all repositories
command: ../../../../../bin/repoman exec 'touch somefile'
exitcode: 0
output: 'touch somefile'
- description: Command changes should display uncommitted changes
command: ../../../../../bin/repoman changes
exitcode: 0
output: 'somefile'
- description: Command undo should remove uncommitted changes
command: ../../../../../bin/repoman undo
exitcode: 0
output: 'No local changes to save'
| Change expectation test following --rebase addition. | Change expectation test following --rebase addition.
| YAML | mit | cliffano/repoman,basti1302/repoman | yaml | ## Code Before:
- description: Prepare failure test fixture with existing repositories
command: cp ../../../../../test-integration/fixtures/.somerepoman_success.json .repoman.json
exitcode: 0
- description: Command list should list down all repositories
command: ../../../../../bin/repoman list
exitcode: 0
output: ^datagen\nnestor\n$
- description: Command init should succeed due to existing repositories
command: ../../../../../bin/repoman init
exitcode: 0
output: 'Cloning into '
- description: Command get should update repositories
command: ../../../../../bin/repoman get
exitcode: 0
output: 'Already up-to-date.'
- description: Command exec should execute same command on all repositories
command: ../../../../../bin/repoman exec 'touch somefile'
exitcode: 0
output: 'touch somefile'
- description: Command changes should display uncommitted changes
command: ../../../../../bin/repoman changes
exitcode: 0
output: 'somefile'
- description: Command undo should remove uncommitted changes
command: ../../../../../bin/repoman undo
exitcode: 0
output: 'No local changes to save'
## Instruction:
Change expectation test following --rebase addition.
## Code After:
- description: Prepare failure test fixture with existing repositories
command: cp ../../../../../test-integration/fixtures/.somerepoman_success.json .repoman.json
exitcode: 0
- description: Command list should list down all repositories
command: ../../../../../bin/repoman list
exitcode: 0
output: ^datagen\nnestor\n$
- description: Command init should succeed due to existing repositories
command: ../../../../../bin/repoman init
exitcode: 0
output: 'Cloning into '
- description: Command get should update repositories
command: ../../../../../bin/repoman get
exitcode: 0
output: 'Current branch master is up to date.'
- description: Command exec should execute same command on all repositories
command: ../../../../../bin/repoman exec 'touch somefile'
exitcode: 0
output: 'touch somefile'
- description: Command changes should display uncommitted changes
command: ../../../../../bin/repoman changes
exitcode: 0
output: 'somefile'
- description: Command undo should remove uncommitted changes
command: ../../../../../bin/repoman undo
exitcode: 0
output: 'No local changes to save'
| - description: Prepare failure test fixture with existing repositories
command: cp ../../../../../test-integration/fixtures/.somerepoman_success.json .repoman.json
exitcode: 0
- description: Command list should list down all repositories
command: ../../../../../bin/repoman list
exitcode: 0
output: ^datagen\nnestor\n$
- description: Command init should succeed due to existing repositories
command: ../../../../../bin/repoman init
exitcode: 0
output: 'Cloning into '
- description: Command get should update repositories
command: ../../../../../bin/repoman get
exitcode: 0
- output: 'Already up-to-date.'
+ output: 'Current branch master is up to date.'
- description: Command exec should execute same command on all repositories
command: ../../../../../bin/repoman exec 'touch somefile'
exitcode: 0
output: 'touch somefile'
- description: Command changes should display uncommitted changes
command: ../../../../../bin/repoman changes
exitcode: 0
output: 'somefile'
- description: Command undo should remove uncommitted changes
command: ../../../../../bin/repoman undo
exitcode: 0
output: 'No local changes to save' | 2 | 0.060606 | 1 | 1 |
edad2b822918c59a2fddb58fd0add3cf83ff9050 | environment/transpiler/environment/equality.lisp | environment/transpiler/environment/equality.lisp | ;;;;; TRE transpiler environment
;;;;; Copyright (c) 2008-2009 Sven Klose <pixel@copei.de>
(defun eq (x y)
(%%%eq x y))
(defun eql (x y)
(unless x ; Convert falsity to 'null'.
(setq x nil))
(unless y
(setq y nil))
(or (eq x y)
(%%%= x y)))
| ;;;;; TRE transpiler environment
;;;;; Copyright (c) 2008-2009,2011 Sven Klose <pixel@copei.de>
(defun eq (x y)
(%%%eq x y))
(defun eql (x y)
(unless x ; Convert falsity to 'null'.
(setq x nil))
(unless y
(setq y nil))
(or (%%%eq x y)
(= x y)))
| Use = insteal of %%%=. | EQUAL: Use = insteal of %%%=.
| Common Lisp | mit | SvenMichaelKlose/tre,SvenMichaelKlose/tre,SvenMichaelKlose/tre | common-lisp | ## Code Before:
;;;;; TRE transpiler environment
;;;;; Copyright (c) 2008-2009 Sven Klose <pixel@copei.de>
(defun eq (x y)
(%%%eq x y))
(defun eql (x y)
(unless x ; Convert falsity to 'null'.
(setq x nil))
(unless y
(setq y nil))
(or (eq x y)
(%%%= x y)))
## Instruction:
EQUAL: Use = insteal of %%%=.
## Code After:
;;;;; TRE transpiler environment
;;;;; Copyright (c) 2008-2009,2011 Sven Klose <pixel@copei.de>
(defun eq (x y)
(%%%eq x y))
(defun eql (x y)
(unless x ; Convert falsity to 'null'.
(setq x nil))
(unless y
(setq y nil))
(or (%%%eq x y)
(= x y)))
| ;;;;; TRE transpiler environment
- ;;;;; Copyright (c) 2008-2009 Sven Klose <pixel@copei.de>
+ ;;;;; Copyright (c) 2008-2009,2011 Sven Klose <pixel@copei.de>
? +++++
(defun eq (x y)
(%%%eq x y))
(defun eql (x y)
(unless x ; Convert falsity to 'null'.
(setq x nil))
(unless y
(setq y nil))
- (or (eq x y)
+ (or (%%%eq x y)
? +++
- (%%%= x y)))
? ---
+ (= x y))) | 6 | 0.461538 | 3 | 3 |
4d4cee56e9146f632c29daaef4acc529b287f2b6 | index.js | index.js | 'use strict';
// Module dependencies
var path = require('path');
// Set module root directory
process.rootTest = __dirname;
process.requireTest = function(filePath) {
return require(path.normalize(process.rootTest + '/' + filePath));
};
module.exports.generator = process.requireTest('lib/generator.js');
| 'use strict';
// Module dependencies
var path = require('path');
// Set module root directory
process.rootTest = __dirname;
process.requireTest = function(filePath) {
return require(path.join(process.rootTest, filePath));
};
module.exports.generator = process.requireTest('lib/generator.js');
| Replace wrong use of path.normalize | Replace wrong use of path.normalize
| JavaScript | agpl-3.0 | veo-labs/openveo-test | javascript | ## Code Before:
'use strict';
// Module dependencies
var path = require('path');
// Set module root directory
process.rootTest = __dirname;
process.requireTest = function(filePath) {
return require(path.normalize(process.rootTest + '/' + filePath));
};
module.exports.generator = process.requireTest('lib/generator.js');
## Instruction:
Replace wrong use of path.normalize
## Code After:
'use strict';
// Module dependencies
var path = require('path');
// Set module root directory
process.rootTest = __dirname;
process.requireTest = function(filePath) {
return require(path.join(process.rootTest, filePath));
};
module.exports.generator = process.requireTest('lib/generator.js');
| 'use strict';
// Module dependencies
var path = require('path');
// Set module root directory
process.rootTest = __dirname;
process.requireTest = function(filePath) {
- return require(path.normalize(process.rootTest + '/' + filePath));
? -------- ^^^^^^^^
+ return require(path.join(process.rootTest, filePath));
? +++ ^
};
module.exports.generator = process.requireTest('lib/generator.js'); | 2 | 0.166667 | 1 | 1 |
bc7fa0de7dcd55cce585151016e5092de7f7416b | lib/acts_as_simple_translatable/class_methods.rb | lib/acts_as_simple_translatable/class_methods.rb | module ActsAsSimpleTranslatable
module ClassMethods
def acts_as_simple_translatable_on(*fields)
# scope :with_translations, -> (locale) { joins(:translations).where(translations: {locale: locale}).preload(:translations) }
scope :with_translations, -> { includes(:translations) }
has_many :translations, as: :translatable, dependent: :destroy
accepts_nested_attributes_for :translations, reject_if: :all_blank, allow_destroy: :true
@locale_fields = fields
class << self
attr_accessor :locale_fields
end
# Loop through fields to define methods such as "name" and "description"
fields.each do |field|
define_method "#{field}" do |default_message = 'NO TRANSLATION'|
content = (I18n.locale == I18n.default_locale) ? super() : locale_translations[field]
content.present? ? content : default_message
end
define_method "#{field}_original" do
super()
end
define_method "#{field}?" do
!send("#{field}").blank?
end
end
define_method :locale_translations do
# load translations
unless @locale_translations
@locale_translations = {}
translations.select { |t| t.locale == I18n.locale.to_s }.each do |translation|
@locale_translations ||= {}
@locale_translations[translation.translatable_field.to_sym] = translation.content
end
end
@locale_translations
end
end
end
end
| module ActsAsSimpleTranslatable
module ClassMethods
def acts_as_simple_translatable_on(*fields)
# scope :with_translations, -> (locale) { joins(:translations).where(translations: {locale: locale}).preload(:translations) }
scope :with_translations, -> { includes(:translations) }
has_many :translations, as: :translatable, dependent: :destroy
accepts_nested_attributes_for :translations, reject_if: :all_blank, allow_destroy: :true
@locale_fields = fields
class << self
attr_accessor :locale_fields
end
# Loop through fields to define methods such as "name" and "description"
fields.each do |field|
define_method "#{field}" do |default_message = 'NO TRANSLATION'|
content = (I18n.locale == I18n.default_locale) ? super() : locale_translations[field]
content.present? || (I18n.locale == I18n.default_locale) ? content : default_message
end
define_method "#{field}_original" do
super()
end
define_method "#{field}?" do
!send("#{field}").blank?
end
end
define_method :locale_translations do
# load translations
unless @locale_translations
@locale_translations = {}
translations.select { |t| t.locale == I18n.locale.to_s }.each do |translation|
@locale_translations ||= {}
@locale_translations[translation.translatable_field.to_sym] = translation.content
end
end
@locale_translations
end
end
end
end
| Hide default translation message when default locale is active | Hide default translation message when default locale is active
| Ruby | mit | d4be4st/acts_as_simple_translatable | ruby | ## Code Before:
module ActsAsSimpleTranslatable
module ClassMethods
def acts_as_simple_translatable_on(*fields)
# scope :with_translations, -> (locale) { joins(:translations).where(translations: {locale: locale}).preload(:translations) }
scope :with_translations, -> { includes(:translations) }
has_many :translations, as: :translatable, dependent: :destroy
accepts_nested_attributes_for :translations, reject_if: :all_blank, allow_destroy: :true
@locale_fields = fields
class << self
attr_accessor :locale_fields
end
# Loop through fields to define methods such as "name" and "description"
fields.each do |field|
define_method "#{field}" do |default_message = 'NO TRANSLATION'|
content = (I18n.locale == I18n.default_locale) ? super() : locale_translations[field]
content.present? ? content : default_message
end
define_method "#{field}_original" do
super()
end
define_method "#{field}?" do
!send("#{field}").blank?
end
end
define_method :locale_translations do
# load translations
unless @locale_translations
@locale_translations = {}
translations.select { |t| t.locale == I18n.locale.to_s }.each do |translation|
@locale_translations ||= {}
@locale_translations[translation.translatable_field.to_sym] = translation.content
end
end
@locale_translations
end
end
end
end
## Instruction:
Hide default translation message when default locale is active
## Code After:
module ActsAsSimpleTranslatable
module ClassMethods
def acts_as_simple_translatable_on(*fields)
# scope :with_translations, -> (locale) { joins(:translations).where(translations: {locale: locale}).preload(:translations) }
scope :with_translations, -> { includes(:translations) }
has_many :translations, as: :translatable, dependent: :destroy
accepts_nested_attributes_for :translations, reject_if: :all_blank, allow_destroy: :true
@locale_fields = fields
class << self
attr_accessor :locale_fields
end
# Loop through fields to define methods such as "name" and "description"
fields.each do |field|
define_method "#{field}" do |default_message = 'NO TRANSLATION'|
content = (I18n.locale == I18n.default_locale) ? super() : locale_translations[field]
content.present? || (I18n.locale == I18n.default_locale) ? content : default_message
end
define_method "#{field}_original" do
super()
end
define_method "#{field}?" do
!send("#{field}").blank?
end
end
define_method :locale_translations do
# load translations
unless @locale_translations
@locale_translations = {}
translations.select { |t| t.locale == I18n.locale.to_s }.each do |translation|
@locale_translations ||= {}
@locale_translations[translation.translatable_field.to_sym] = translation.content
end
end
@locale_translations
end
end
end
end
| module ActsAsSimpleTranslatable
module ClassMethods
def acts_as_simple_translatable_on(*fields)
# scope :with_translations, -> (locale) { joins(:translations).where(translations: {locale: locale}).preload(:translations) }
scope :with_translations, -> { includes(:translations) }
has_many :translations, as: :translatable, dependent: :destroy
accepts_nested_attributes_for :translations, reject_if: :all_blank, allow_destroy: :true
@locale_fields = fields
class << self
attr_accessor :locale_fields
end
# Loop through fields to define methods such as "name" and "description"
fields.each do |field|
define_method "#{field}" do |default_message = 'NO TRANSLATION'|
content = (I18n.locale == I18n.default_locale) ? super() : locale_translations[field]
- content.present? ? content : default_message
+ content.present? || (I18n.locale == I18n.default_locale) ? content : default_message
end
define_method "#{field}_original" do
super()
end
define_method "#{field}?" do
!send("#{field}").blank?
end
end
define_method :locale_translations do
# load translations
unless @locale_translations
@locale_translations = {}
translations.select { |t| t.locale == I18n.locale.to_s }.each do |translation|
@locale_translations ||= {}
@locale_translations[translation.translatable_field.to_sym] = translation.content
end
end
@locale_translations
end
end
end
end | 2 | 0.046512 | 1 | 1 |
7a359f8dcb7a9b5ef6aca00aa95b9b4ea402bfb4 | test/factories/attachments.rb | test/factories/attachments.rb | FactoryGirl.define do
factory :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'greenpaper.pdf')) }
end
sequence(:title) { |index| "file-attachment-title-#{index}" }
sequence(:ordering)
after(:build) do |attachment, evaluator|
attachment.attachment_data ||= build(:attachment_data, file: evaluator.file)
end
end
factory :csv_attachment, parent: :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'sample.csv')) }
end
end
factory :html_attachment do
sequence(:title) { |index| "html-attachment-title-#{index}" }
sequence(:ordering)
body 'Attachment body'
end
end
| FactoryGirl.define do
sequence(:attachment_ordering)
factory :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'greenpaper.pdf')) }
end
sequence(:title) { |index| "file-attachment-title-#{index}" }
ordering { generate(:attachment_ordering) }
after(:build) do |attachment, evaluator|
attachment.attachment_data ||= build(:attachment_data, file: evaluator.file)
end
end
factory :csv_attachment, parent: :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'sample.csv')) }
end
end
factory :html_attachment do
sequence(:title) { |index| "html-attachment-title-#{index}" }
ordering { generate(:attachment_ordering) }
body 'Attachment body'
end
end
| Use a global sequence for attachment ordering | Use a global sequence for attachment ordering
This should fix an intermittent test failure when HTML and File
attachments are built in the same test without being given an explicit
ordering.
| Ruby | mit | ggoral/whitehall,robinwhittleton/whitehall,askl56/whitehall,alphagov/whitehall,robinwhittleton/whitehall,askl56/whitehall,askl56/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,YOTOV-LIMITED/whitehall,alphagov/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,alphagov/whitehall,robinwhittleton/whitehall,ggoral/whitehall,alphagov/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,hotvulcan/whitehall,askl56/whitehall,hotvulcan/whitehall,ggoral/whitehall,robinwhittleton/whitehall | ruby | ## Code Before:
FactoryGirl.define do
factory :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'greenpaper.pdf')) }
end
sequence(:title) { |index| "file-attachment-title-#{index}" }
sequence(:ordering)
after(:build) do |attachment, evaluator|
attachment.attachment_data ||= build(:attachment_data, file: evaluator.file)
end
end
factory :csv_attachment, parent: :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'sample.csv')) }
end
end
factory :html_attachment do
sequence(:title) { |index| "html-attachment-title-#{index}" }
sequence(:ordering)
body 'Attachment body'
end
end
## Instruction:
Use a global sequence for attachment ordering
This should fix an intermittent test failure when HTML and File
attachments are built in the same test without being given an explicit
ordering.
## Code After:
FactoryGirl.define do
sequence(:attachment_ordering)
factory :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'greenpaper.pdf')) }
end
sequence(:title) { |index| "file-attachment-title-#{index}" }
ordering { generate(:attachment_ordering) }
after(:build) do |attachment, evaluator|
attachment.attachment_data ||= build(:attachment_data, file: evaluator.file)
end
end
factory :csv_attachment, parent: :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'sample.csv')) }
end
end
factory :html_attachment do
sequence(:title) { |index| "html-attachment-title-#{index}" }
ordering { generate(:attachment_ordering) }
body 'Attachment body'
end
end
| FactoryGirl.define do
+ sequence(:attachment_ordering)
+
factory :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'greenpaper.pdf')) }
end
sequence(:title) { |index| "file-attachment-title-#{index}" }
- sequence(:ordering)
+ ordering { generate(:attachment_ordering) }
after(:build) do |attachment, evaluator|
attachment.attachment_data ||= build(:attachment_data, file: evaluator.file)
end
end
factory :csv_attachment, parent: :file_attachment do
ignore do
file { File.open(Rails.root.join('test', 'fixtures', 'sample.csv')) }
end
end
factory :html_attachment do
sequence(:title) { |index| "html-attachment-title-#{index}" }
- sequence(:ordering)
+ ordering { generate(:attachment_ordering) }
body 'Attachment body'
end
end | 6 | 0.24 | 4 | 2 |
c85171c70713f903af6d53af36bdae2ea3d74350 | src/MassAPIBundle/Repository/PlaceRepository.php | src/MassAPIBundle/Repository/PlaceRepository.php | <?php
namespace MassAPIBundle\Repository;
use Doctrine\ORM\EntityRepository;
class PlaceRepository extends EntityRepository
{
public function getNearPlace(array $criteria = array())
{
return $this->createQueryBuilder('p')
->leftJoin('p.geo', 'g')
->andWhere('CONTAINS(GeomFromJson(:inside_json), p.geoPoint) > 0')
->setParameter('inside_json', $criteria['inside_json'])
;
}
}
| <?php
namespace MassAPIBundle\Repository;
use Doctrine\ORM\EntityRepository;
class PlaceRepository extends EntityRepository
{
public function getNearPlace(array $criteria = array())
{
return $this->createQueryBuilder('p')
->addSelect('p', 'g')
->leftJoin('p.geo', 'g')
->andWhere('CONTAINS(GeomFromJson(:inside_json), g.geoPoint) > 0')
->setParameter('inside_json', $criteria['inside_json'])
->getQuery()
->getResult()
;
}
}
| Fix Doctrine request for place | Fix Doctrine request for place
| PHP | mit | lologhi/MassAPI,lologhi/MassAPI,lologhi/MassAPI,lologhi/MassAPI | php | ## Code Before:
<?php
namespace MassAPIBundle\Repository;
use Doctrine\ORM\EntityRepository;
class PlaceRepository extends EntityRepository
{
public function getNearPlace(array $criteria = array())
{
return $this->createQueryBuilder('p')
->leftJoin('p.geo', 'g')
->andWhere('CONTAINS(GeomFromJson(:inside_json), p.geoPoint) > 0')
->setParameter('inside_json', $criteria['inside_json'])
;
}
}
## Instruction:
Fix Doctrine request for place
## Code After:
<?php
namespace MassAPIBundle\Repository;
use Doctrine\ORM\EntityRepository;
class PlaceRepository extends EntityRepository
{
public function getNearPlace(array $criteria = array())
{
return $this->createQueryBuilder('p')
->addSelect('p', 'g')
->leftJoin('p.geo', 'g')
->andWhere('CONTAINS(GeomFromJson(:inside_json), g.geoPoint) > 0')
->setParameter('inside_json', $criteria['inside_json'])
->getQuery()
->getResult()
;
}
}
| <?php
namespace MassAPIBundle\Repository;
use Doctrine\ORM\EntityRepository;
class PlaceRepository extends EntityRepository
{
public function getNearPlace(array $criteria = array())
{
return $this->createQueryBuilder('p')
+ ->addSelect('p', 'g')
->leftJoin('p.geo', 'g')
- ->andWhere('CONTAINS(GeomFromJson(:inside_json), p.geoPoint) > 0')
? ^
+ ->andWhere('CONTAINS(GeomFromJson(:inside_json), g.geoPoint) > 0')
? ^
->setParameter('inside_json', $criteria['inside_json'])
+ ->getQuery()
+ ->getResult()
;
}
} | 5 | 0.294118 | 4 | 1 |
8ab371880bbf0be62cab089681d1ef1af144ceeb | server/routes/routes.js | server/routes/routes.js | 'use strict';
var Map = require('../models/map');
module.exports = function (app) {
app.route('/api/maps')
.get(function(req, res){
Map.find(function (error, doc) {
res.send(doc);
});
})
.post(function(req, res){
let map = req.body;
let locationMap = new Map(map);
locationMap.save(function (error, data) {
res.status(300).send();
});
});
app.route('/api/maps/:id')
.delete(function(req, res) {
Map.findOne({
_id: req.params.id
}).remove(function (error, result){
res.status(300).send();
});
})
.patch(function(req, res) {
Map.findOne({
_id: req.params.id
}, function (error, doc) {
for (let key in req.body) {
doc[key] = req.body[key]
}
doc.save();
res.status(200).send();
});
});
}
| 'use strict';
var Map = require('../models/map');
module.exports = function (app) {
app.route('/api/maps')
.get(function(req, res){
Map.find(function (error, doc) {
res.send(doc);
});
})
.post(function(req, res){
let map = req.body;
let locationMap = new Map(map);
locationMap.save(function (error, data) {
res.status(300).send();
});
});
app.route('/api/maps/:id')
.delete(function(req, res) {
Map.findOne({
_id: req.params.id
}).remove(function (error, result){
res.status(300).send();
});
})
.patch(function(req, res) {
Map.findById(req.params.id,
function (error, doc) {
for (let key in req.body) {
if (key === '_id' || key.indexOf('pins') === 0) { continue; }
doc[key] = req.body[key];
}
doc.pins = makePinsArray(req.body)
doc.save();
res.status(200).send();
}
);
});
}
function makePinsArray(obj) {
var pins = [];
for (let key in obj ) {
if (key === 'pinKey') { key = x; }
if (key.indexOf('pins') !== 0) { continue; }
let index = parseInt(/\d+/.exec(key)[0], 10);
let pinKey = /\[([a-z]+)\]/i.exec(key)[1];
let pinValue = parseInt(obj[key], 10);
if (pins[index]) {
pins[index][pinKey] = pinValue;
continue;
}
let o = {};
o[pinKey] = pinValue;
pins.push(o);
}
return pins;
}
| Refactor patch to build pins array and add function to make pins array | Refactor patch to build pins array and add function to make pins array
| JavaScript | mit | jkrayer/poc-map-points,jkrayer/poc-map-points | javascript | ## Code Before:
'use strict';
var Map = require('../models/map');
module.exports = function (app) {
app.route('/api/maps')
.get(function(req, res){
Map.find(function (error, doc) {
res.send(doc);
});
})
.post(function(req, res){
let map = req.body;
let locationMap = new Map(map);
locationMap.save(function (error, data) {
res.status(300).send();
});
});
app.route('/api/maps/:id')
.delete(function(req, res) {
Map.findOne({
_id: req.params.id
}).remove(function (error, result){
res.status(300).send();
});
})
.patch(function(req, res) {
Map.findOne({
_id: req.params.id
}, function (error, doc) {
for (let key in req.body) {
doc[key] = req.body[key]
}
doc.save();
res.status(200).send();
});
});
}
## Instruction:
Refactor patch to build pins array and add function to make pins array
## Code After:
'use strict';
var Map = require('../models/map');
module.exports = function (app) {
app.route('/api/maps')
.get(function(req, res){
Map.find(function (error, doc) {
res.send(doc);
});
})
.post(function(req, res){
let map = req.body;
let locationMap = new Map(map);
locationMap.save(function (error, data) {
res.status(300).send();
});
});
app.route('/api/maps/:id')
.delete(function(req, res) {
Map.findOne({
_id: req.params.id
}).remove(function (error, result){
res.status(300).send();
});
})
.patch(function(req, res) {
Map.findById(req.params.id,
function (error, doc) {
for (let key in req.body) {
if (key === '_id' || key.indexOf('pins') === 0) { continue; }
doc[key] = req.body[key];
}
doc.pins = makePinsArray(req.body)
doc.save();
res.status(200).send();
}
);
});
}
function makePinsArray(obj) {
var pins = [];
for (let key in obj ) {
if (key === 'pinKey') { key = x; }
if (key.indexOf('pins') !== 0) { continue; }
let index = parseInt(/\d+/.exec(key)[0], 10);
let pinKey = /\[([a-z]+)\]/i.exec(key)[1];
let pinValue = parseInt(obj[key], 10);
if (pins[index]) {
pins[index][pinKey] = pinValue;
continue;
}
let o = {};
o[pinKey] = pinValue;
pins.push(o);
}
return pins;
}
| 'use strict';
var Map = require('../models/map');
module.exports = function (app) {
app.route('/api/maps')
.get(function(req, res){
Map.find(function (error, doc) {
res.send(doc);
});
})
.post(function(req, res){
let map = req.body;
let locationMap = new Map(map);
locationMap.save(function (error, data) {
res.status(300).send();
});
});
app.route('/api/maps/:id')
.delete(function(req, res) {
Map.findOne({
_id: req.params.id
}).remove(function (error, result){
res.status(300).send();
});
})
.patch(function(req, res) {
+ Map.findById(req.params.id,
- Map.findOne({
- _id: req.params.id
- }, function (error, doc) {
? ^^
+ function (error, doc) {
? ^
- for (let key in req.body) {
+ for (let key in req.body) {
? ++
+ if (key === '_id' || key.indexOf('pins') === 0) { continue; }
- doc[key] = req.body[key]
+ doc[key] = req.body[key];
? ++ +
+ }
+ doc.pins = makePinsArray(req.body)
+ doc.save();
+ res.status(200).send();
}
- doc.save();
- res.status(200).send();
- });
? -
+ );
});
}
+
+ function makePinsArray(obj) {
+ var pins = [];
+
+ for (let key in obj ) {
+ if (key === 'pinKey') { key = x; }
+ if (key.indexOf('pins') !== 0) { continue; }
+ let index = parseInt(/\d+/.exec(key)[0], 10);
+ let pinKey = /\[([a-z]+)\]/i.exec(key)[1];
+ let pinValue = parseInt(obj[key], 10);
+ if (pins[index]) {
+ pins[index][pinKey] = pinValue;
+ continue;
+ }
+ let o = {};
+ o[pinKey] = pinValue;
+ pins.push(o);
+ }
+
+ return pins;
+ } | 39 | 1.026316 | 31 | 8 |
7fd1d437ca8c4f15c6d578fb9d58e6abd3dba736 | README.rst | README.rst | ======
Metron
======
Current analytics services supported:
* Google Analytics
* Mixpanel
* gaug.es
* Google AdWords Conversion Tracking | ======
Metron
======
Current analytics services supported:
* Google Analytics
* Mixpanel
* gaug.es
* Google AdWords Conversion Tracking
Documentation
-------------
Documentation can be found online at http://metron.readthedocs.org/
| Update readme with documentation link | Update readme with documentation link | reStructuredText | mit | pinax/metron,pinax/pinax-webanalytics,pinax/pinax-webanalytics,pinax/metron | restructuredtext | ## Code Before:
======
Metron
======
Current analytics services supported:
* Google Analytics
* Mixpanel
* gaug.es
* Google AdWords Conversion Tracking
## Instruction:
Update readme with documentation link
## Code After:
======
Metron
======
Current analytics services supported:
* Google Analytics
* Mixpanel
* gaug.es
* Google AdWords Conversion Tracking
Documentation
-------------
Documentation can be found online at http://metron.readthedocs.org/
| ======
Metron
======
Current analytics services supported:
* Google Analytics
* Mixpanel
* gaug.es
* Google AdWords Conversion Tracking
+
+
+ Documentation
+ -------------
+
+ Documentation can be found online at http://metron.readthedocs.org/ | 6 | 0.545455 | 6 | 0 |
57153e83cc810e5bb5f4c9a6774cc8a9163acddd | addon/helpers/elem.js | addon/helpers/elem.js | import Ember from 'ember';
import { elem, mod } from 'ember-cli-bem/mixins/bem';
const {
HTMLBars: { makeBoundHelper },
} = Ember;
const BLOCK_KEY = 'blockName';
export default makeBoundHelper(function(params, hash) {
const blockName = hash[BLOCK_KEY];
const [ elemName ] = params;
if (!blockName) {
throw Error(`${BLOCK_KEY} is required for 'elem' helper`);
}
const elemClassName = elem(blockName, elemName);
const modNames = Object.keys(hash).filter((key) => key !== BLOCK_KEY);
const modClassNames = modNames.map((modName) => {
const modValue = hash[modName];
return mod(elemClassName, { modName, modValue });
});
return [elemClassName, ...modClassNames].filter(Boolean).join(' ');
});
| import Ember from 'ember';
import { elem, mod } from 'ember-cli-bem/mixins/bem';
const {
Helper: { helper }
} = Ember;
const BLOCK_KEY = 'blockName';
export default helper(function(params, hash) {
const blockName = hash[BLOCK_KEY];
const [ elemName ] = params;
if (!blockName) {
throw Error(`${BLOCK_KEY} is required for 'elem' helper`);
}
const elemClassName = elem(blockName, elemName);
const modNames = Object.keys(hash).filter((key) => key !== BLOCK_KEY);
const modClassNames = modNames.map((modName) => {
const modValue = hash[modName];
return mod(elemClassName, { modName, modValue });
});
return [elemClassName, ...modClassNames].filter(Boolean).join(' ');
});
| Remove makeBoundHelper in favor of helper. | Remove makeBoundHelper in favor of helper.
| JavaScript | mit | nikityy/ember-cli-bem,nikityy/ember-cli-bem | javascript | ## Code Before:
import Ember from 'ember';
import { elem, mod } from 'ember-cli-bem/mixins/bem';
const {
HTMLBars: { makeBoundHelper },
} = Ember;
const BLOCK_KEY = 'blockName';
export default makeBoundHelper(function(params, hash) {
const blockName = hash[BLOCK_KEY];
const [ elemName ] = params;
if (!blockName) {
throw Error(`${BLOCK_KEY} is required for 'elem' helper`);
}
const elemClassName = elem(blockName, elemName);
const modNames = Object.keys(hash).filter((key) => key !== BLOCK_KEY);
const modClassNames = modNames.map((modName) => {
const modValue = hash[modName];
return mod(elemClassName, { modName, modValue });
});
return [elemClassName, ...modClassNames].filter(Boolean).join(' ');
});
## Instruction:
Remove makeBoundHelper in favor of helper.
## Code After:
import Ember from 'ember';
import { elem, mod } from 'ember-cli-bem/mixins/bem';
const {
Helper: { helper }
} = Ember;
const BLOCK_KEY = 'blockName';
export default helper(function(params, hash) {
const blockName = hash[BLOCK_KEY];
const [ elemName ] = params;
if (!blockName) {
throw Error(`${BLOCK_KEY} is required for 'elem' helper`);
}
const elemClassName = elem(blockName, elemName);
const modNames = Object.keys(hash).filter((key) => key !== BLOCK_KEY);
const modClassNames = modNames.map((modName) => {
const modValue = hash[modName];
return mod(elemClassName, { modName, modValue });
});
return [elemClassName, ...modClassNames].filter(Boolean).join(' ');
});
| import Ember from 'ember';
import { elem, mod } from 'ember-cli-bem/mixins/bem';
const {
- HTMLBars: { makeBoundHelper },
+ Helper: { helper }
} = Ember;
const BLOCK_KEY = 'blockName';
- export default makeBoundHelper(function(params, hash) {
? ^^^^^^^^^^
+ export default helper(function(params, hash) {
? ^
const blockName = hash[BLOCK_KEY];
const [ elemName ] = params;
if (!blockName) {
throw Error(`${BLOCK_KEY} is required for 'elem' helper`);
}
const elemClassName = elem(blockName, elemName);
const modNames = Object.keys(hash).filter((key) => key !== BLOCK_KEY);
const modClassNames = modNames.map((modName) => {
const modValue = hash[modName];
return mod(elemClassName, { modName, modValue });
});
return [elemClassName, ...modClassNames].filter(Boolean).join(' ');
}); | 4 | 0.148148 | 2 | 2 |
5389767400dc5fb6f1153677d5bd47f5ec1ce15a | roles/python/vars/main.yml | roles/python/vars/main.yml | ---
python_brew_packages:
- name: python
- name: python3
python_packages:
- pip
- virtualenv
- virtualenvwrapper
- boto
- awscli
- neovim
python_pyenv_install_cmd: "CFLAGS=\"-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include\" LDFLAGS=\"-L$(brew --prefix openssl)/lib -L/usr/local/opt/sqlite/lib\" pyenv install"
python_use_pyenv: False
python_pyenv_versions:
- 3.3.6
- 3.5.1
| ---
python_brew_packages:
- name: python
- name: python3
python_packages:
- pip
- virtualenv
- virtualenvwrapper
- boto
- awscli
- neovim
- ansible-lint
python_pyenv_install_cmd: "CFLAGS=\"-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include\" LDFLAGS=\"-L$(brew --prefix openssl)/lib -L/usr/local/opt/sqlite/lib\" pyenv install"
python_use_pyenv: False
python_pyenv_versions:
- 3.3.6
- 3.5.1
| Add ansible-lint to python packages | Add ansible-lint to python packages
| YAML | mit | mtchavez/mac-ansible | yaml | ## Code Before:
---
python_brew_packages:
- name: python
- name: python3
python_packages:
- pip
- virtualenv
- virtualenvwrapper
- boto
- awscli
- neovim
python_pyenv_install_cmd: "CFLAGS=\"-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include\" LDFLAGS=\"-L$(brew --prefix openssl)/lib -L/usr/local/opt/sqlite/lib\" pyenv install"
python_use_pyenv: False
python_pyenv_versions:
- 3.3.6
- 3.5.1
## Instruction:
Add ansible-lint to python packages
## Code After:
---
python_brew_packages:
- name: python
- name: python3
python_packages:
- pip
- virtualenv
- virtualenvwrapper
- boto
- awscli
- neovim
- ansible-lint
python_pyenv_install_cmd: "CFLAGS=\"-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include\" LDFLAGS=\"-L$(brew --prefix openssl)/lib -L/usr/local/opt/sqlite/lib\" pyenv install"
python_use_pyenv: False
python_pyenv_versions:
- 3.3.6
- 3.5.1
| ---
python_brew_packages:
- name: python
- name: python3
python_packages:
- pip
- virtualenv
- virtualenvwrapper
- boto
- awscli
- neovim
+ - ansible-lint
python_pyenv_install_cmd: "CFLAGS=\"-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include\" LDFLAGS=\"-L$(brew --prefix openssl)/lib -L/usr/local/opt/sqlite/lib\" pyenv install"
python_use_pyenv: False
python_pyenv_versions:
- 3.3.6
- 3.5.1 | 1 | 0.058824 | 1 | 0 |
e5ce0dd9ca4ea26154c242bbb5c3e3afa521d541 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- "pip install flake8"
- "pip install tornado passlib"
script:
- "make test"
notifications:
email:
- phihag@phihag.de
- dfmogk@gmail.com
| language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- "pip install flake8"
- "pip install tornado passlib"
- "pip install python-dateutil"
script:
- "make test"
notifications:
email:
- phihag@phihag.de
- dfmogk@gmail.com
| Add dateutil library to Travis | Add dateutil library to Travis
| YAML | mit | hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem | yaml | ## Code Before:
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- "pip install flake8"
- "pip install tornado passlib"
script:
- "make test"
notifications:
email:
- phihag@phihag.de
- dfmogk@gmail.com
## Instruction:
Add dateutil library to Travis
## Code After:
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- "pip install flake8"
- "pip install tornado passlib"
- "pip install python-dateutil"
script:
- "make test"
notifications:
email:
- phihag@phihag.de
- dfmogk@gmail.com
| language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- "pip install flake8"
- "pip install tornado passlib"
+ - "pip install python-dateutil"
script:
- "make test"
notifications:
email:
- phihag@phihag.de
- dfmogk@gmail.com | 1 | 0.066667 | 1 | 0 |
0814589b54af186cefd19b989f0e8348e91c996b | lib/scoruby.rb | lib/scoruby.rb |
require 'scoruby/version'
require 'scoruby/model_factory'
require 'nokogiri'
require 'logger'
module Scoruby
class << self
attr_writer :logger
def logger
@logger ||= Logger.new($stdout).tap do |log|
log.progname = name
end
end
end
def self.load_model(pmml_file_name)
xml = xml_from_file_path(pmml_file_name)
ModelFactory.factory_for(xml)
end
def self.xml_from_file_path(pmml_file_name)
pmml_string = File.open(pmml_file_name, 'rb').read
xml_from_string(pmml_string)
end
def self.xml_from_string(pmml_string)
xml = Nokogiri::XML(pmml_string, &:noblanks)
xml.remove_namespaces!
end
end
|
require 'scoruby/version'
require 'scoruby/model_factory'
require 'nokogiri'
require 'logger'
module Scoruby
class << self
attr_writer :logger
def logger
@logger ||= Logger.new($stdout).tap do |log|
log.progname = name
end
end
end
def self.load_model(pmml_file_name)
xml = xml_from_file_path(pmml_file_name)
ModelFactory.factory_for(xml)
end
def self.load_model_from_string(pmml_string)
xml = xml_from_string(pmml_string)
ModelFactory.factory_for(xml)
end
def self.xml_from_file_path(pmml_file_name)
pmml_string = File.open(pmml_file_name, 'rb').read
xml_from_string(pmml_string)
end
def self.xml_from_string(pmml_string)
xml = Nokogiri::XML(pmml_string, &:noblanks)
xml.remove_namespaces!
end
end
| Allow models to be passed as a string rather than as files | Allow models to be passed as a string rather than as files
| Ruby | mit | asafschers/scoruby,asafschers/random_forester,asafschers/random_forester,asafschers/scoruby | ruby | ## Code Before:
require 'scoruby/version'
require 'scoruby/model_factory'
require 'nokogiri'
require 'logger'
module Scoruby
class << self
attr_writer :logger
def logger
@logger ||= Logger.new($stdout).tap do |log|
log.progname = name
end
end
end
def self.load_model(pmml_file_name)
xml = xml_from_file_path(pmml_file_name)
ModelFactory.factory_for(xml)
end
def self.xml_from_file_path(pmml_file_name)
pmml_string = File.open(pmml_file_name, 'rb').read
xml_from_string(pmml_string)
end
def self.xml_from_string(pmml_string)
xml = Nokogiri::XML(pmml_string, &:noblanks)
xml.remove_namespaces!
end
end
## Instruction:
Allow models to be passed as a string rather than as files
## Code After:
require 'scoruby/version'
require 'scoruby/model_factory'
require 'nokogiri'
require 'logger'
module Scoruby
class << self
attr_writer :logger
def logger
@logger ||= Logger.new($stdout).tap do |log|
log.progname = name
end
end
end
def self.load_model(pmml_file_name)
xml = xml_from_file_path(pmml_file_name)
ModelFactory.factory_for(xml)
end
def self.load_model_from_string(pmml_string)
xml = xml_from_string(pmml_string)
ModelFactory.factory_for(xml)
end
def self.xml_from_file_path(pmml_file_name)
pmml_string = File.open(pmml_file_name, 'rb').read
xml_from_string(pmml_string)
end
def self.xml_from_string(pmml_string)
xml = Nokogiri::XML(pmml_string, &:noblanks)
xml.remove_namespaces!
end
end
|
require 'scoruby/version'
require 'scoruby/model_factory'
require 'nokogiri'
require 'logger'
module Scoruby
class << self
attr_writer :logger
def logger
@logger ||= Logger.new($stdout).tap do |log|
log.progname = name
end
end
end
def self.load_model(pmml_file_name)
xml = xml_from_file_path(pmml_file_name)
ModelFactory.factory_for(xml)
end
+ def self.load_model_from_string(pmml_string)
+ xml = xml_from_string(pmml_string)
+ ModelFactory.factory_for(xml)
+ end
+
def self.xml_from_file_path(pmml_file_name)
pmml_string = File.open(pmml_file_name, 'rb').read
xml_from_string(pmml_string)
end
def self.xml_from_string(pmml_string)
xml = Nokogiri::XML(pmml_string, &:noblanks)
xml.remove_namespaces!
end
end | 5 | 0.15625 | 5 | 0 |
e92933d59cfdc4c7ee3d4918c92057a8fd801728 | aniauth/templates/evexml/eveapi_add_form.html | aniauth/templates/evexml/eveapi_add_form.html | {% extends "base.html" %}
{% block body %}
<p>To login simply enter your email address below, and click the link that is sent to you.</p>
{% if form.errors %}
<p>At least one problem occurred while checking the supplied API key:</p>
{% endif %}
<form method="POST">
{% csrf_token %}
{{ form.non_field_errors }}
<p><input type="number" class="form-control" placeholder="keyID" id="id_keyID" name="keyID"></p>
<p><input type="text" maxlength="32" class="form-control" placeholder="vCode" id="id_vCode" name="vCode"></p>
<p><button class="btn btn-outline-success" type="submit">Submit</button></p>
</form>
{% endblock %}
| {% extends "base.html" %}
{% block body %}
<p>Please enter a full API key, if you have not yet created one <a href="https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=4294967295">click here</a>.</p>
{% if form.errors %}
<p>At least one problem occurred while checking the supplied API key:</p>
{% endif %}
<form method="POST">
{% csrf_token %}
{{ form.non_field_errors }}
<p><input type="number" class="form-control" placeholder="keyID" id="id_key_id" name="key_id"></p>
{{ form.key_id.errors }}
<p><input type="text" maxlength="32" class="form-control" placeholder="vCode" id="id_v_code" name="v_code"></p>
{{ form.v_code.errors }}
<p><button class="btn btn-outline-success" type="submit">Submit</button></p>
</form>
{% endblock %}
| Improve api add form template | Improve api add form template
| HTML | mit | randomic/aniauth-tdd,randomic/aniauth-tdd | html | ## Code Before:
{% extends "base.html" %}
{% block body %}
<p>To login simply enter your email address below, and click the link that is sent to you.</p>
{% if form.errors %}
<p>At least one problem occurred while checking the supplied API key:</p>
{% endif %}
<form method="POST">
{% csrf_token %}
{{ form.non_field_errors }}
<p><input type="number" class="form-control" placeholder="keyID" id="id_keyID" name="keyID"></p>
<p><input type="text" maxlength="32" class="form-control" placeholder="vCode" id="id_vCode" name="vCode"></p>
<p><button class="btn btn-outline-success" type="submit">Submit</button></p>
</form>
{% endblock %}
## Instruction:
Improve api add form template
## Code After:
{% extends "base.html" %}
{% block body %}
<p>Please enter a full API key, if you have not yet created one <a href="https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=4294967295">click here</a>.</p>
{% if form.errors %}
<p>At least one problem occurred while checking the supplied API key:</p>
{% endif %}
<form method="POST">
{% csrf_token %}
{{ form.non_field_errors }}
<p><input type="number" class="form-control" placeholder="keyID" id="id_key_id" name="key_id"></p>
{{ form.key_id.errors }}
<p><input type="text" maxlength="32" class="form-control" placeholder="vCode" id="id_v_code" name="v_code"></p>
{{ form.v_code.errors }}
<p><button class="btn btn-outline-success" type="submit">Submit</button></p>
</form>
{% endblock %}
| {% extends "base.html" %}
{% block body %}
- <p>To login simply enter your email address below, and click the link that is sent to you.</p>
+ <p>Please enter a full API key, if you have not yet created one <a href="https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=4294967295">click here</a>.</p>
{% if form.errors %}
<p>At least one problem occurred while checking the supplied API key:</p>
{% endif %}
<form method="POST">
{% csrf_token %}
{{ form.non_field_errors }}
- <p><input type="number" class="form-control" placeholder="keyID" id="id_keyID" name="keyID"></p>
? ^^ ^^
+ <p><input type="number" class="form-control" placeholder="keyID" id="id_key_id" name="key_id"></p>
? ^^^ ^^^
+ {{ form.key_id.errors }}
- <p><input type="text" maxlength="32" class="form-control" placeholder="vCode" id="id_vCode" name="vCode"></p>
? ^ ^
+ <p><input type="text" maxlength="32" class="form-control" placeholder="vCode" id="id_v_code" name="v_code"></p>
? ^^ ^^
+ {{ form.v_code.errors }}
<p><button class="btn btn-outline-success" type="submit">Submit</button></p>
</form>
{% endblock %} | 8 | 0.421053 | 5 | 3 |
3f60a30907e810890b723898a7cf1c2b32bc6848 | .cdaf/imageBuild/Dockerfile | .cdaf/imageBuild/Dockerfile | ARG CONTAINER_IMAGE
FROM ${CONTAINER_IMAGE}
ARG proxy
ENV http_proxy=$proxy
# Create root, i.e. C:\solution
WORKDIR /solution
# Copy entire directory (rely on storeForLocal to limit to only to required, unlike containerBuild)
COPY automation automation
# Shared bootstrap between Docker and Vagrant
COPY bootstrapPython.ps1 .
RUN automation\provisioning\runner.bat bootstrapPython.ps1
# Install runtime dependencies at System Level
RUN RMDIR /Q/S C:\python38\lib\site-packages
ADD site-packages.tar.gz /
# Install the application
ADD cbe.tar.gz .
COPY manage.py .
RUN python manage.py migrate
RUN python manage.py createsuperuser superuser super@hero.net passw0rd
CMD ["python", "manage.py", "runserver"] | ARG CONTAINER_IMAGE
FROM ${CONTAINER_IMAGE}
ARG proxy
ENV http_proxy=$proxy
# Create root, i.e. C:\solution
WORKDIR /solution
# Copy entire directory (rely on storeForLocal to limit to only to required, unlike containerBuild)
COPY automation automation
# Shared bootstrap between Docker and Vagrant
COPY bootstrapPython.ps1 .
RUN automation\provisioning\runner.bat bootstrapPython.ps1
# Install runtime dependencies at System Level
RUN RMDIR /Q/S C:\python38\lib\site-packages
ADD site-packages.tar.gz /
# Install the application
ADD cbe.tar.gz .
COPY manage.py .
RUN python manage.py migrate
RUN python manage.py createsuperuser superuser super@hero.net passw0rd
CMD "python -u manage.py runserver 0.0.0.0:8000" | Use single string for startup command | Use single string for startup command
| unknown | apache-2.0 | Semprini/cbe,cdaf/cbe,cdaf/cbe,Semprini/cbe | unknown | ## Code Before:
ARG CONTAINER_IMAGE
FROM ${CONTAINER_IMAGE}
ARG proxy
ENV http_proxy=$proxy
# Create root, i.e. C:\solution
WORKDIR /solution
# Copy entire directory (rely on storeForLocal to limit to only to required, unlike containerBuild)
COPY automation automation
# Shared bootstrap between Docker and Vagrant
COPY bootstrapPython.ps1 .
RUN automation\provisioning\runner.bat bootstrapPython.ps1
# Install runtime dependencies at System Level
RUN RMDIR /Q/S C:\python38\lib\site-packages
ADD site-packages.tar.gz /
# Install the application
ADD cbe.tar.gz .
COPY manage.py .
RUN python manage.py migrate
RUN python manage.py createsuperuser superuser super@hero.net passw0rd
CMD ["python", "manage.py", "runserver"]
## Instruction:
Use single string for startup command
## Code After:
ARG CONTAINER_IMAGE
FROM ${CONTAINER_IMAGE}
ARG proxy
ENV http_proxy=$proxy
# Create root, i.e. C:\solution
WORKDIR /solution
# Copy entire directory (rely on storeForLocal to limit to only to required, unlike containerBuild)
COPY automation automation
# Shared bootstrap between Docker and Vagrant
COPY bootstrapPython.ps1 .
RUN automation\provisioning\runner.bat bootstrapPython.ps1
# Install runtime dependencies at System Level
RUN RMDIR /Q/S C:\python38\lib\site-packages
ADD site-packages.tar.gz /
# Install the application
ADD cbe.tar.gz .
COPY manage.py .
RUN python manage.py migrate
RUN python manage.py createsuperuser superuser super@hero.net passw0rd
CMD "python -u manage.py runserver 0.0.0.0:8000" | ARG CONTAINER_IMAGE
FROM ${CONTAINER_IMAGE}
ARG proxy
ENV http_proxy=$proxy
# Create root, i.e. C:\solution
WORKDIR /solution
# Copy entire directory (rely on storeForLocal to limit to only to required, unlike containerBuild)
COPY automation automation
# Shared bootstrap between Docker and Vagrant
COPY bootstrapPython.ps1 .
RUN automation\provisioning\runner.bat bootstrapPython.ps1
# Install runtime dependencies at System Level
RUN RMDIR /Q/S C:\python38\lib\site-packages
ADD site-packages.tar.gz /
# Install the application
ADD cbe.tar.gz .
COPY manage.py .
RUN python manage.py migrate
RUN python manage.py createsuperuser superuser super@hero.net passw0rd
- CMD ["python", "manage.py", "runserver"]
+ CMD "python -u manage.py runserver 0.0.0.0:8000" | 2 | 0.074074 | 1 | 1 |
0286a96d8646254464d4b71a6428c26517ecc432 | README.md | README.md | Some random search algorithms
| Some random search algorithms
[](https://travis-ci.org/XeryusTC/search)
[](https://coveralls.io/github/XeryusTC/search?branch=master)
| Add badges for testing and coverage | Add badges for testing and coverage
| Markdown | mit | XeryusTC/search | markdown | ## Code Before:
Some random search algorithms
## Instruction:
Add badges for testing and coverage
## Code After:
Some random search algorithms
[](https://travis-ci.org/XeryusTC/search)
[](https://coveralls.io/github/XeryusTC/search?branch=master)
| Some random search algorithms
+ [](https://travis-ci.org/XeryusTC/search)
+ [](https://coveralls.io/github/XeryusTC/search?branch=master) | 2 | 2 | 2 | 0 |
329637b7991479905dee691000b030c710044d0d | adagios/status/templates/status_services.html | adagios/status/templates/status_services.html | {% extends "base_status.html" %}
{% block title %}Status Overview{% endblock %}
{% block smallheader %}{% endblock %}
{% block adagios_hausinn %}
{% endblock %}
{% block largeheader %}Service Overview
{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url status.views.services %}">Services</a>{% endblock %}
{% load adagiostags %}
{% block sidebar_outer %}
{% endblock %}
{% block content %}
{% include "snippets/status_servicelist_snippet.html" %}
{% endblock %}
{% block footer %} {{ block.super }} {% endblock %} | {% extends "base_status.html" %}
{% block title %}Status Overview{% endblock %}
{% block smallheader %}{% endblock %}
{% block adagios_hausinn %}
{% endblock %}
{% block largeheader %}Service Overview
{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url status.views.services %}">Services</a>{% endblock %}
{% load adagiostags %}
{% block sidebar_outer %}
{% endblock %}
{% block content %}
{% include "snippets/status_servicelist_snippet.html" %}
{% endblock %}
{% block footer %}
{{ block.super }}
<script>
function timedRefresh(timeoutPeriod) {
var interval = setInterval(refreshPage, timeoutPeriod);
}
function refreshPage() {
checked_boxes = $( ".selectable :checked" );
shown_modals = $("div .modal.in");
if (checked_boxes.length + shown_modals.length == 0) {
console.log("Refreshing page...");
location.reload(true);
}
else {
console.log("Canceled auto-refresh of page because input boxes or modals have been edited");
clearInterval(1);
}
}
$(document).ready(function() {
timedRefresh(30000);
});
</script>
{% endblock %} | Put a timed refresh on 30seconds | status->services: Put a timed refresh on 30seconds
| HTML | agpl-3.0 | opinkerfi/adagios,opinkerfi/adagios,kaji-project/adagios,kb2ma/adagios,zengzhaozheng/adagios,kb2ma/adagios,kaji-project/adagios,kb2ma/adagios,opinkerfi/adagios,zengzhaozheng/adagios,kb2ma/adagios,opinkerfi/adagios,zengzhaozheng/adagios,kaji-project/adagios,kaji-project/adagios,zengzhaozheng/adagios | html | ## Code Before:
{% extends "base_status.html" %}
{% block title %}Status Overview{% endblock %}
{% block smallheader %}{% endblock %}
{% block adagios_hausinn %}
{% endblock %}
{% block largeheader %}Service Overview
{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url status.views.services %}">Services</a>{% endblock %}
{% load adagiostags %}
{% block sidebar_outer %}
{% endblock %}
{% block content %}
{% include "snippets/status_servicelist_snippet.html" %}
{% endblock %}
{% block footer %} {{ block.super }} {% endblock %}
## Instruction:
status->services: Put a timed refresh on 30seconds
## Code After:
{% extends "base_status.html" %}
{% block title %}Status Overview{% endblock %}
{% block smallheader %}{% endblock %}
{% block adagios_hausinn %}
{% endblock %}
{% block largeheader %}Service Overview
{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url status.views.services %}">Services</a>{% endblock %}
{% load adagiostags %}
{% block sidebar_outer %}
{% endblock %}
{% block content %}
{% include "snippets/status_servicelist_snippet.html" %}
{% endblock %}
{% block footer %}
{{ block.super }}
<script>
function timedRefresh(timeoutPeriod) {
var interval = setInterval(refreshPage, timeoutPeriod);
}
function refreshPage() {
checked_boxes = $( ".selectable :checked" );
shown_modals = $("div .modal.in");
if (checked_boxes.length + shown_modals.length == 0) {
console.log("Refreshing page...");
location.reload(true);
}
else {
console.log("Canceled auto-refresh of page because input boxes or modals have been edited");
clearInterval(1);
}
}
$(document).ready(function() {
timedRefresh(30000);
});
</script>
{% endblock %} | {% extends "base_status.html" %}
{% block title %}Status Overview{% endblock %}
{% block smallheader %}{% endblock %}
{% block adagios_hausinn %}
{% endblock %}
{% block largeheader %}Service Overview
{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url status.views.services %}">Services</a>{% endblock %}
{% load adagiostags %}
{% block sidebar_outer %}
{% endblock %}
{% block content %}
{% include "snippets/status_servicelist_snippet.html" %}
{% endblock %}
- {% block footer %} {{ block.super }} {% endblock %}
+ {% block footer %}
+ {{ block.super }}
+
+ <script>
+ function timedRefresh(timeoutPeriod) {
+ var interval = setInterval(refreshPage, timeoutPeriod);
+ }
+
+ function refreshPage() {
+ checked_boxes = $( ".selectable :checked" );
+ shown_modals = $("div .modal.in");
+ if (checked_boxes.length + shown_modals.length == 0) {
+ console.log("Refreshing page...");
+ location.reload(true);
+ }
+ else {
+ console.log("Canceled auto-refresh of page because input boxes or modals have been edited");
+ clearInterval(1);
+ }
+ }
+
+ $(document).ready(function() {
+ timedRefresh(30000);
+ });
+ </script>
+ {% endblock %} | 27 | 1.227273 | 26 | 1 |
4487a9b0628db7670a3b252db3de8c6e7b46fde0 | src/with-raw.js | src/with-raw.js | import { root } from './util';
const { HTMLElement } = root;
export function withRaw (Base = HTMLElement) {
return class extends Base {
static is = null
static observedAttributes = []
attributeChangedCallback () {}
connectedCallback () {}
disconnectedCallback () {}
};
}
| import { root } from './util';
const { HTMLElement = class {} } = root;
export function withRaw (Base = HTMLElement) {
return class extends Base {
static is = null
static observedAttributes = []
attributeChangedCallback () {}
connectedCallback () {}
disconnectedCallback () {}
};
}
| Fix broken node test by ensuring a default for HTMLElement. | test: Fix broken node test by ensuring a default for HTMLElement.
| JavaScript | mit | skatejs/skatejs,chrisdarroch/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs | javascript | ## Code Before:
import { root } from './util';
const { HTMLElement } = root;
export function withRaw (Base = HTMLElement) {
return class extends Base {
static is = null
static observedAttributes = []
attributeChangedCallback () {}
connectedCallback () {}
disconnectedCallback () {}
};
}
## Instruction:
test: Fix broken node test by ensuring a default for HTMLElement.
## Code After:
import { root } from './util';
const { HTMLElement = class {} } = root;
export function withRaw (Base = HTMLElement) {
return class extends Base {
static is = null
static observedAttributes = []
attributeChangedCallback () {}
connectedCallback () {}
disconnectedCallback () {}
};
}
| import { root } from './util';
- const { HTMLElement } = root;
+ const { HTMLElement = class {} } = root;
? +++++++++++
export function withRaw (Base = HTMLElement) {
return class extends Base {
static is = null
static observedAttributes = []
attributeChangedCallback () {}
connectedCallback () {}
disconnectedCallback () {}
};
} | 2 | 0.153846 | 1 | 1 |
5bffcd5375bb221ed2fc26401dae2f6e9deefc5b | src/gol/client/bl.cljs | src/gol/client/bl.cljs | (ns gol.client.bl)
(defn neighbours
[[x y]]
(for [dx [-1 0 1] dy [-1 0 1]
:when (not= 0 dx dy)]
[(+ dx x) (+ dy y)]))
(defn stepper
[neighbours birth? survive?]
(fn [cells]
(set (for [[loc n] (frequencies (mapcat neighbours cells))
:when (if (cells loc) (survive? n) (birth? n))]
loc))))
(def step (stepper neighbours #{3} #{2 3}))
(defn filter-on-viewport
[bw bh coll]
(filter (fn [[x y]] (and (< -1 x bw) (< -1 y bh))) coll))
(defn filtered-on-viewport-stepper
[w h]
(comp set (partial filter-on-viewport w h) step))
(defn rand-2d
[width height]
(cons [(rand-int width) (rand-int height)] (lazy-seq (rand-2d width height))))
(defn rand-population
[width height]
(distinct (rand-2d width height)))
| (ns gol.client.bl)
(defn neighbours
[[x y]]
(for [dx [-1 0 1] dy [-1 0 1]
:when (not= 0 dx dy)]
[(+ dx x) (+ dy y)]))
(defn stepper
[neighbours birth? survive?]
(fn [cells]
(set (for [[loc n] (frequencies (mapcat neighbours cells))
:when (if (cells loc) (survive? n) (birth? n))]
loc))))
(def step (stepper neighbours #{3} #{2 3}))
(defn filter-on-viewport
[bw bh coll]
(filter (fn [[x y]] (and (< -1 x bw) (< -1 y bh))) coll))
(defn filtered-on-viewport-stepper
[w h]
(comp set (partial filter-on-viewport w h) step))
(defn rand-2d-seq
[width height]
(cons [(rand-int width) (rand-int height)] (lazy-seq (rand-2d-seq width height))))
(defn rand-population
[width height]
(distinct (rand-2d-seq width height)))
| Rename random 2d sequence generator | Rename random 2d sequence generator
| Clojure | mit | pavel-v-chernykh/gol | clojure | ## Code Before:
(ns gol.client.bl)
(defn neighbours
[[x y]]
(for [dx [-1 0 1] dy [-1 0 1]
:when (not= 0 dx dy)]
[(+ dx x) (+ dy y)]))
(defn stepper
[neighbours birth? survive?]
(fn [cells]
(set (for [[loc n] (frequencies (mapcat neighbours cells))
:when (if (cells loc) (survive? n) (birth? n))]
loc))))
(def step (stepper neighbours #{3} #{2 3}))
(defn filter-on-viewport
[bw bh coll]
(filter (fn [[x y]] (and (< -1 x bw) (< -1 y bh))) coll))
(defn filtered-on-viewport-stepper
[w h]
(comp set (partial filter-on-viewport w h) step))
(defn rand-2d
[width height]
(cons [(rand-int width) (rand-int height)] (lazy-seq (rand-2d width height))))
(defn rand-population
[width height]
(distinct (rand-2d width height)))
## Instruction:
Rename random 2d sequence generator
## Code After:
(ns gol.client.bl)
(defn neighbours
[[x y]]
(for [dx [-1 0 1] dy [-1 0 1]
:when (not= 0 dx dy)]
[(+ dx x) (+ dy y)]))
(defn stepper
[neighbours birth? survive?]
(fn [cells]
(set (for [[loc n] (frequencies (mapcat neighbours cells))
:when (if (cells loc) (survive? n) (birth? n))]
loc))))
(def step (stepper neighbours #{3} #{2 3}))
(defn filter-on-viewport
[bw bh coll]
(filter (fn [[x y]] (and (< -1 x bw) (< -1 y bh))) coll))
(defn filtered-on-viewport-stepper
[w h]
(comp set (partial filter-on-viewport w h) step))
(defn rand-2d-seq
[width height]
(cons [(rand-int width) (rand-int height)] (lazy-seq (rand-2d-seq width height))))
(defn rand-population
[width height]
(distinct (rand-2d-seq width height)))
| (ns gol.client.bl)
(defn neighbours
[[x y]]
(for [dx [-1 0 1] dy [-1 0 1]
:when (not= 0 dx dy)]
[(+ dx x) (+ dy y)]))
(defn stepper
[neighbours birth? survive?]
(fn [cells]
(set (for [[loc n] (frequencies (mapcat neighbours cells))
:when (if (cells loc) (survive? n) (birth? n))]
loc))))
(def step (stepper neighbours #{3} #{2 3}))
(defn filter-on-viewport
[bw bh coll]
(filter (fn [[x y]] (and (< -1 x bw) (< -1 y bh))) coll))
(defn filtered-on-viewport-stepper
[w h]
(comp set (partial filter-on-viewport w h) step))
- (defn rand-2d
+ (defn rand-2d-seq
? ++++
[width height]
- (cons [(rand-int width) (rand-int height)] (lazy-seq (rand-2d width height))))
+ (cons [(rand-int width) (rand-int height)] (lazy-seq (rand-2d-seq width height))))
? ++++
(defn rand-population
[width height]
- (distinct (rand-2d width height)))
+ (distinct (rand-2d-seq width height)))
? ++++
| 6 | 0.1875 | 3 | 3 |
62a911e6c2435da34130f31798d698a7263c4a74 | environment.yml | environment.yml | channels:
- conda-forge
- bioconda
dependencies:
- r-base
- r-tidyverse
- r-biocmanager
- nano
- bioconductor-breastcancermainz
- bioconductor-biobase
- bioconductor-limma
- bioconductor-pathview
- bioconductor-hgu133a.db | channels:
- conda-forge
- bioconda
dependencies:
- r-base
- r-tidyverse
- r-biocmanager
- r-htmltools
- r-tinytex
- nano
- bioconductor-breastcancermainz
- bioconductor-biobase
- bioconductor-limma
- bioconductor-pathview
- bioconductor-hgu133a.db
| Add tinytex and htmltools for knitting R markdown files | Add tinytex and htmltools for knitting R markdown files | YAML | mit | humberto-ortiz/expression-workshop | yaml | ## Code Before:
channels:
- conda-forge
- bioconda
dependencies:
- r-base
- r-tidyverse
- r-biocmanager
- nano
- bioconductor-breastcancermainz
- bioconductor-biobase
- bioconductor-limma
- bioconductor-pathview
- bioconductor-hgu133a.db
## Instruction:
Add tinytex and htmltools for knitting R markdown files
## Code After:
channels:
- conda-forge
- bioconda
dependencies:
- r-base
- r-tidyverse
- r-biocmanager
- r-htmltools
- r-tinytex
- nano
- bioconductor-breastcancermainz
- bioconductor-biobase
- bioconductor-limma
- bioconductor-pathview
- bioconductor-hgu133a.db
| channels:
- conda-forge
- bioconda
dependencies:
- r-base
- r-tidyverse
- r-biocmanager
+ - r-htmltools
+ - r-tinytex
- nano
- bioconductor-breastcancermainz
- bioconductor-biobase
- bioconductor-limma
- bioconductor-pathview
- bioconductor-hgu133a.db | 2 | 0.153846 | 2 | 0 |
935657aa643de17c04ea15ddb8af9aee27a05516 | setup.py | setup.py | """Rachiopy setup script."""
from setuptools import find_packages, setup
from datetime import datetime
NOW = datetime.now().strftime("%m/%d/%Y%H%M%S")
VERSION = f"1.0.0-dev{NOW}"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz"
PROJECT_URLS = {"Bug Reports": f"{GITHUB_URL}/issues"}
PACKAGES = find_packages(exclude=["tests", "tests.*"])
setup(
name="RachioPy",
version=VERSION,
author="Robbert Verbruggen",
author_email="rfverbruggen@icloud.com",
packages=PACKAGES,
install_requires=["requests"],
url=GITHUB_URL,
download_url=DOWNLOAD_URL,
project_urls=PROJECT_URLS,
license="MIT",
description="A Python module for the Rachio API.",
platforms="Cross Platform",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development",
],
)
| """Rachiopy setup script."""
from setuptools import find_packages, setup
from datetime import datetime
VERSION = "1.0.0"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz"
PROJECT_URLS = {"Bug Reports": f"{GITHUB_URL}/issues"}
PACKAGES = find_packages(exclude=["tests", "tests.*"])
setup(
name="RachioPy",
version=VERSION,
author="Robbert Verbruggen",
author_email="rfverbruggen@icloud.com",
packages=PACKAGES,
install_requires=["requests"],
url=GITHUB_URL,
download_url=DOWNLOAD_URL,
project_urls=PROJECT_URLS,
license="MIT",
description="A Python module for the Rachio API.",
platforms="Cross Platform",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development",
],
)
| Set the final version number | Set the final version number
| Python | mit | rfverbruggen/rachiopy | python | ## Code Before:
"""Rachiopy setup script."""
from setuptools import find_packages, setup
from datetime import datetime
NOW = datetime.now().strftime("%m/%d/%Y%H%M%S")
VERSION = f"1.0.0-dev{NOW}"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz"
PROJECT_URLS = {"Bug Reports": f"{GITHUB_URL}/issues"}
PACKAGES = find_packages(exclude=["tests", "tests.*"])
setup(
name="RachioPy",
version=VERSION,
author="Robbert Verbruggen",
author_email="rfverbruggen@icloud.com",
packages=PACKAGES,
install_requires=["requests"],
url=GITHUB_URL,
download_url=DOWNLOAD_URL,
project_urls=PROJECT_URLS,
license="MIT",
description="A Python module for the Rachio API.",
platforms="Cross Platform",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development",
],
)
## Instruction:
Set the final version number
## Code After:
"""Rachiopy setup script."""
from setuptools import find_packages, setup
from datetime import datetime
VERSION = "1.0.0"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz"
PROJECT_URLS = {"Bug Reports": f"{GITHUB_URL}/issues"}
PACKAGES = find_packages(exclude=["tests", "tests.*"])
setup(
name="RachioPy",
version=VERSION,
author="Robbert Verbruggen",
author_email="rfverbruggen@icloud.com",
packages=PACKAGES,
install_requires=["requests"],
url=GITHUB_URL,
download_url=DOWNLOAD_URL,
project_urls=PROJECT_URLS,
license="MIT",
description="A Python module for the Rachio API.",
platforms="Cross Platform",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development",
],
)
| """Rachiopy setup script."""
from setuptools import find_packages, setup
from datetime import datetime
- NOW = datetime.now().strftime("%m/%d/%Y%H%M%S")
-
- VERSION = f"1.0.0-dev{NOW}"
? - ---------
+ VERSION = "1.0.0"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz"
PROJECT_URLS = {"Bug Reports": f"{GITHUB_URL}/issues"}
PACKAGES = find_packages(exclude=["tests", "tests.*"])
setup(
name="RachioPy",
version=VERSION,
author="Robbert Verbruggen",
author_email="rfverbruggen@icloud.com",
packages=PACKAGES,
install_requires=["requests"],
url=GITHUB_URL,
download_url=DOWNLOAD_URL,
project_urls=PROJECT_URLS,
license="MIT",
description="A Python module for the Rachio API.",
platforms="Cross Platform",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Software Development",
],
) | 4 | 0.097561 | 1 | 3 |
642d8cd7b9669111aea0c22ec09530fab383593f | lepton/renderer.h | lepton/renderer.h | /****************************************************************************
*
* Copyright (c) 2008 by Casey Duncan and contributors
* All Rights Reserved.
*
* This software is subject to the provisions of the MIT License
* A copy of the license should accompany this distribution.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*
****************************************************************************/
/* Renderer shared code
*
* $Id$
*/
#ifndef _RENDERER_H_
#define _RENDERER_H_
typedef struct {
PyObject_HEAD
Py_ssize_t size;
float *data;
} FloatArrayObject;
/* Return true if o is a bon-a-fide FloatArrayObject */
int FloatArrayObject_Check(FloatArrayObject *o);
FloatArrayObject *
FloatArray_new(Py_ssize_t size);
FloatArrayObject *
generate_default_2D_tex_coords(GroupObject *pgroup);
/* Initialize the glew OpenGL extension manager
If glew has already been initialized, do nothing */
int
glew_initialize(void);
#endif
| /****************************************************************************
*
* Copyright (c) 2008 by Casey Duncan and contributors
* All Rights Reserved.
*
* This software is subject to the provisions of the MIT License
* A copy of the license should accompany this distribution.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*
****************************************************************************/
/* Renderer shared code
*
* $Id$
*/
#ifndef _RENDERER_H_
#define _RENDERER_H_
typedef struct {
PyObject_HEAD
Py_ssize_t size;
float *data;
} FloatArrayObject;
/* Return true if o is a bon-a-fide FloatArrayObject */
int FloatArrayObject_Check(FloatArrayObject *o);
FloatArrayObject *
FloatArray_new(Py_ssize_t size);
FloatArrayObject *
generate_default_2D_tex_coords(GroupObject *pgroup);
/* Initialize the glew OpenGL extension manager
If glew has already been initialized, do nothing */
int
glew_initialize(void);
#endif
// Windows lacks fminf
#ifndef fminf
#define fminf(x, y) (((x) < (y)) ? (x) : (y))
#endif
| Define fminf for platforms that lack it | Define fminf for platforms that lack it
| C | mit | pombreda/py-lepton,caseman/py-lepton,caseman/py-lepton,pombreda/py-lepton | c | ## Code Before:
/****************************************************************************
*
* Copyright (c) 2008 by Casey Duncan and contributors
* All Rights Reserved.
*
* This software is subject to the provisions of the MIT License
* A copy of the license should accompany this distribution.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*
****************************************************************************/
/* Renderer shared code
*
* $Id$
*/
#ifndef _RENDERER_H_
#define _RENDERER_H_
typedef struct {
PyObject_HEAD
Py_ssize_t size;
float *data;
} FloatArrayObject;
/* Return true if o is a bon-a-fide FloatArrayObject */
int FloatArrayObject_Check(FloatArrayObject *o);
FloatArrayObject *
FloatArray_new(Py_ssize_t size);
FloatArrayObject *
generate_default_2D_tex_coords(GroupObject *pgroup);
/* Initialize the glew OpenGL extension manager
If glew has already been initialized, do nothing */
int
glew_initialize(void);
#endif
## Instruction:
Define fminf for platforms that lack it
## Code After:
/****************************************************************************
*
* Copyright (c) 2008 by Casey Duncan and contributors
* All Rights Reserved.
*
* This software is subject to the provisions of the MIT License
* A copy of the license should accompany this distribution.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*
****************************************************************************/
/* Renderer shared code
*
* $Id$
*/
#ifndef _RENDERER_H_
#define _RENDERER_H_
typedef struct {
PyObject_HEAD
Py_ssize_t size;
float *data;
} FloatArrayObject;
/* Return true if o is a bon-a-fide FloatArrayObject */
int FloatArrayObject_Check(FloatArrayObject *o);
FloatArrayObject *
FloatArray_new(Py_ssize_t size);
FloatArrayObject *
generate_default_2D_tex_coords(GroupObject *pgroup);
/* Initialize the glew OpenGL extension manager
If glew has already been initialized, do nothing */
int
glew_initialize(void);
#endif
// Windows lacks fminf
#ifndef fminf
#define fminf(x, y) (((x) < (y)) ? (x) : (y))
#endif
| /****************************************************************************
*
* Copyright (c) 2008 by Casey Duncan and contributors
* All Rights Reserved.
*
* This software is subject to the provisions of the MIT License
* A copy of the license should accompany this distribution.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*
****************************************************************************/
/* Renderer shared code
*
* $Id$
*/
#ifndef _RENDERER_H_
#define _RENDERER_H_
typedef struct {
PyObject_HEAD
Py_ssize_t size;
float *data;
} FloatArrayObject;
/* Return true if o is a bon-a-fide FloatArrayObject */
int FloatArrayObject_Check(FloatArrayObject *o);
FloatArrayObject *
FloatArray_new(Py_ssize_t size);
FloatArrayObject *
generate_default_2D_tex_coords(GroupObject *pgroup);
/* Initialize the glew OpenGL extension manager
If glew has already been initialized, do nothing */
int
glew_initialize(void);
#endif
+
+ // Windows lacks fminf
+ #ifndef fminf
+ #define fminf(x, y) (((x) < (y)) ? (x) : (y))
+ #endif | 5 | 0.121951 | 5 | 0 |
f15503bdce9c00d6a86f3e9357ab5c0465ba5f5c | Manifold/Module+String.swift | Manifold/Module+String.swift | // Copyright © 2015 Rob Rix. All rights reserved.
extension Module {
public static var string: Module {
let List: Term = "List"
let cons: Term = "cons"
let `nil`: Term = "nil"
let String = Declaration("String",
type: .Type,
value: .Embedded(Swift.String.self))
let Character = Declaration("Character",
type: .Type,
value: .Embedded(Swift.Character.self))
return Module("String", [ String, Character ])
}
}
| // Copyright © 2015 Rob Rix. All rights reserved.
extension Module {
public static var string: Module {
let List: Term = "List"
let cons: Term = "cons"
let `nil`: Term = "nil"
let String = Declaration("String",
type: .Type,
value: .Embedded(Swift.String.self))
let Character = Declaration("Character",
type: .Type,
value: .Embedded(Swift.Character.self))
return Module("String", [ String, Character ])
func toTerm(characters: Swift.String.CharacterView) -> Term {
switch characters.first {
case let .Some(c):
return cons[Character.ref, .Embedded(c), toTerm(characters.dropFirst())]
default:
return `nil`[Character.ref]
}
}
}
}
| Write a function to construct a List Character from a String. | Write a function to construct a List Character from a String.
| Swift | mit | antitypical/Manifold,antitypical/Manifold | swift | ## Code Before:
// Copyright © 2015 Rob Rix. All rights reserved.
extension Module {
public static var string: Module {
let List: Term = "List"
let cons: Term = "cons"
let `nil`: Term = "nil"
let String = Declaration("String",
type: .Type,
value: .Embedded(Swift.String.self))
let Character = Declaration("Character",
type: .Type,
value: .Embedded(Swift.Character.self))
return Module("String", [ String, Character ])
}
}
## Instruction:
Write a function to construct a List Character from a String.
## Code After:
// Copyright © 2015 Rob Rix. All rights reserved.
extension Module {
public static var string: Module {
let List: Term = "List"
let cons: Term = "cons"
let `nil`: Term = "nil"
let String = Declaration("String",
type: .Type,
value: .Embedded(Swift.String.self))
let Character = Declaration("Character",
type: .Type,
value: .Embedded(Swift.Character.self))
return Module("String", [ String, Character ])
func toTerm(characters: Swift.String.CharacterView) -> Term {
switch characters.first {
case let .Some(c):
return cons[Character.ref, .Embedded(c), toTerm(characters.dropFirst())]
default:
return `nil`[Character.ref]
}
}
}
}
| // Copyright © 2015 Rob Rix. All rights reserved.
extension Module {
public static var string: Module {
let List: Term = "List"
let cons: Term = "cons"
let `nil`: Term = "nil"
let String = Declaration("String",
type: .Type,
value: .Embedded(Swift.String.self))
let Character = Declaration("Character",
type: .Type,
value: .Embedded(Swift.Character.self))
return Module("String", [ String, Character ])
+ func toTerm(characters: Swift.String.CharacterView) -> Term {
+ switch characters.first {
+ case let .Some(c):
+ return cons[Character.ref, .Embedded(c), toTerm(characters.dropFirst())]
+ default:
+ return `nil`[Character.ref]
+ }
+ }
}
} | 8 | 0.421053 | 8 | 0 |
3970c7facdf0429d32588920edb307e503cbdfec | grappelli_safe/templates/admin/change_list_results.html | grappelli_safe/templates/admin/change_list_results.html | {% if result_hidden_fields %}
<div class="hiddenfields"> {# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="result-list">
<table cellspacing="0">
<thead>
<tr>
{% for header in result_headers %}
<th{{ header.class_attrib }}>
{% if header.sortable %}<a href="{{ header.url }}">{% endif %}
{{ header.text|capfirst }}
{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
|
{% if result_hidden_fields %}
<div class="hiddenfields"> {# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="result-list">
<table cellspacing="0">
<thead>
<tr>
{% for header in result_headers %}
<th{{ header.class_attrib }}>
{% if header.sortable %}
{% if header.url %}
<a href="{{ header.url }}">
{% else %}
<a href="{{ header.url_primary }}">
{% endif %}
{% endif %}
{{ header.text|capfirst }}
{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
| Update to Django 1.4's format for column sorting. | Update to Django 1.4's format for column sorting.
| HTML | bsd-3-clause | dsanders11/grappelli-safe,dsanders11/grappelli-safe,dsanders11/grappelli-safe | html | ## Code Before:
{% if result_hidden_fields %}
<div class="hiddenfields"> {# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="result-list">
<table cellspacing="0">
<thead>
<tr>
{% for header in result_headers %}
<th{{ header.class_attrib }}>
{% if header.sortable %}<a href="{{ header.url }}">{% endif %}
{{ header.text|capfirst }}
{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
## Instruction:
Update to Django 1.4's format for column sorting.
## Code After:
{% if result_hidden_fields %}
<div class="hiddenfields"> {# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="result-list">
<table cellspacing="0">
<thead>
<tr>
{% for header in result_headers %}
<th{{ header.class_attrib }}>
{% if header.sortable %}
{% if header.url %}
<a href="{{ header.url }}">
{% else %}
<a href="{{ header.url_primary }}">
{% endif %}
{% endif %}
{{ header.text|capfirst }}
{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
| +
{% if result_hidden_fields %}
<div class="hiddenfields"> {# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="result-list">
<table cellspacing="0">
<thead>
<tr>
{% for header in result_headers %}
<th{{ header.class_attrib }}>
- {% if header.sortable %}<a href="{{ header.url }}">{% endif %}
+ {% if header.sortable %}
+ {% if header.url %}
+ <a href="{{ header.url }}">
+ {% else %}
+ <a href="{{ header.url_primary }}">
+ {% endif %}
+ {% endif %}
{{ header.text|capfirst }}
{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %} | 9 | 0.346154 | 8 | 1 |
9474e5d0b77410cfb830d5cc9f9dc962a74f40a2 | composer.json | composer.json | {
"name": "stevebauman/maintenance",
"description": "A Preventative Maintenance Application (CMMS) for Laravel",
"authors": [
{
"name": "Steve Bauman",
"email": "steven_bauman_7@hotmail.com"
}
],
"license": "GPL-2.0+",
"require": {
"php": ">=5.4.0",
"illuminate/support": "4.2.*",
"stevebauman/corp": "1.0.*",
"stevebauman/core-helper": "1.0.*",
"stevebauman/eloquenttable": "1.1.*",
"stevebauman/inventory": "1.7.*",
"stevebauman/calendar-helper": "0.1.*",
"stevebauman/log-reader": "1.0.*",
"cartalyst/sentry": "2.1.*",
"arcanedev/no-captcha": "1.2.*",
"baum/baum": "1.0.* | 1.1.*",
"simplesoftwareio/simple-qrcode": "1.1.* | 1.2.*",
"davejamesmiller/laravel-breadcrumbs": "2.3.* | 3.0.*",
"google/apiclient": "1.1.*"
},
"archive": {
"exclude": ["/tests"]
},
"autoload": {
"psr-4": {
"Stevebauman\\Maintenance\\": "src/Stevebauman/Maintenance/"
}
},
"minimum-stability": "stable"
}
| {
"name": "stevebauman/maintenance",
"description": "A Preventative Maintenance Application (CMMS) for Laravel",
"authors": [
{
"name": "Steve Bauman",
"email": "steven_bauman_7@hotmail.com"
}
],
"license": "GPL-2.0+",
"require": {
"php": ">=5.4.0",
"illuminate/support": "4.* | 5.*",
"stevebauman/corp": "1.0.*",
"stevebauman/core-helper": "1.0.*",
"stevebauman/eloquenttable": "1.1.*",
"stevebauman/inventory": "1.7.*",
"stevebauman/calendar-helper": "0.1.*",
"stevebauman/log-reader": "1.0.*",
"cartalyst/sentry": "2.1.*",
"anhskohbo/no-captcha": "1.* | 2.*",
"baum/baum": "1.0.* | 1.1.*",
"simplesoftwareio/simple-qrcode": "1.1.* | 1.2.*",
"davejamesmiller/laravel-breadcrumbs": "2.3.* | 3.0.*",
"google/apiclient": "1.1.*"
},
"archive": {
"exclude": ["/tests"]
},
"autoload": {
"psr-4": {
"Stevebauman\\Maintenance\\": "src/Stevebauman/Maintenance/"
}
},
"minimum-stability": "stable"
}
| Replace no-catpcha provider, allow laravel 5 | Replace no-catpcha provider, allow laravel 5
| JSON | mit | stevebauman/maintenance,stevebauman/maintenance,stevebauman/maintenance | json | ## Code Before:
{
"name": "stevebauman/maintenance",
"description": "A Preventative Maintenance Application (CMMS) for Laravel",
"authors": [
{
"name": "Steve Bauman",
"email": "steven_bauman_7@hotmail.com"
}
],
"license": "GPL-2.0+",
"require": {
"php": ">=5.4.0",
"illuminate/support": "4.2.*",
"stevebauman/corp": "1.0.*",
"stevebauman/core-helper": "1.0.*",
"stevebauman/eloquenttable": "1.1.*",
"stevebauman/inventory": "1.7.*",
"stevebauman/calendar-helper": "0.1.*",
"stevebauman/log-reader": "1.0.*",
"cartalyst/sentry": "2.1.*",
"arcanedev/no-captcha": "1.2.*",
"baum/baum": "1.0.* | 1.1.*",
"simplesoftwareio/simple-qrcode": "1.1.* | 1.2.*",
"davejamesmiller/laravel-breadcrumbs": "2.3.* | 3.0.*",
"google/apiclient": "1.1.*"
},
"archive": {
"exclude": ["/tests"]
},
"autoload": {
"psr-4": {
"Stevebauman\\Maintenance\\": "src/Stevebauman/Maintenance/"
}
},
"minimum-stability": "stable"
}
## Instruction:
Replace no-catpcha provider, allow laravel 5
## Code After:
{
"name": "stevebauman/maintenance",
"description": "A Preventative Maintenance Application (CMMS) for Laravel",
"authors": [
{
"name": "Steve Bauman",
"email": "steven_bauman_7@hotmail.com"
}
],
"license": "GPL-2.0+",
"require": {
"php": ">=5.4.0",
"illuminate/support": "4.* | 5.*",
"stevebauman/corp": "1.0.*",
"stevebauman/core-helper": "1.0.*",
"stevebauman/eloquenttable": "1.1.*",
"stevebauman/inventory": "1.7.*",
"stevebauman/calendar-helper": "0.1.*",
"stevebauman/log-reader": "1.0.*",
"cartalyst/sentry": "2.1.*",
"anhskohbo/no-captcha": "1.* | 2.*",
"baum/baum": "1.0.* | 1.1.*",
"simplesoftwareio/simple-qrcode": "1.1.* | 1.2.*",
"davejamesmiller/laravel-breadcrumbs": "2.3.* | 3.0.*",
"google/apiclient": "1.1.*"
},
"archive": {
"exclude": ["/tests"]
},
"autoload": {
"psr-4": {
"Stevebauman\\Maintenance\\": "src/Stevebauman/Maintenance/"
}
},
"minimum-stability": "stable"
}
| {
"name": "stevebauman/maintenance",
"description": "A Preventative Maintenance Application (CMMS) for Laravel",
"authors": [
{
"name": "Steve Bauman",
"email": "steven_bauman_7@hotmail.com"
}
],
"license": "GPL-2.0+",
"require": {
"php": ">=5.4.0",
- "illuminate/support": "4.2.*",
? ^
+ "illuminate/support": "4.* | 5.*",
? ^^^^^
"stevebauman/corp": "1.0.*",
"stevebauman/core-helper": "1.0.*",
"stevebauman/eloquenttable": "1.1.*",
"stevebauman/inventory": "1.7.*",
"stevebauman/calendar-helper": "0.1.*",
"stevebauman/log-reader": "1.0.*",
"cartalyst/sentry": "2.1.*",
- "arcanedev/no-captcha": "1.2.*",
? --- ^^^^
+ "anhskohbo/no-captcha": "1.* | 2.*",
? ^^^^^^^ ++++
"baum/baum": "1.0.* | 1.1.*",
"simplesoftwareio/simple-qrcode": "1.1.* | 1.2.*",
"davejamesmiller/laravel-breadcrumbs": "2.3.* | 3.0.*",
"google/apiclient": "1.1.*"
},
"archive": {
"exclude": ["/tests"]
},
"autoload": {
"psr-4": {
"Stevebauman\\Maintenance\\": "src/Stevebauman/Maintenance/"
}
},
"minimum-stability": "stable"
} | 4 | 0.111111 | 2 | 2 |
6b21f112ad32c004ac26cbf6194f467fe63601e9 | README.md | README.md |
FruitMachine helper that allows different setup and teardown callbacks to be called based on media queries.
## Example
```js
var fm = require('fm');
module.exports = fm.define({
template: function() {
},
helpers: [
require('fruitmachine-media')
],
media: {
'(max-width: 699px), (max-height: 699px)': 'small',
'(min-width: 700px) and (min-height: 700px)': 'large'
},
states: {
small: {
setup: function() {
// Run small setup logic
},
teardown: function() {
// Run small teardown logic
}
},
large: {
setup: function() {
// Run large setup logic
},
teardown: function() {
// Run large teardown logic
}
}
}
});
```
## Author
- **Wilson Page** - [@wilsonpage](http://github.com/wilsonpage)
## Contributors
- **Matt Andrews** - [@matthew-andrews](http://github.com/matthew-andrews)
## License
Copyright (c) 2014 The Financial Times Limited
Licensed under the MIT license.
## Credits and collaboration
All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. Enjoy...
|
FruitMachine helper that allows different setup and teardown callbacks to be called based on media queries.
## Example usage
```js
var fm = require('fm');
fm.define({
name: 'passionfruit',
template: function() {
// Normal fruitmachine template method
},
helpers: [
require('fruitmachine-media')
],
media: {
'(max-width: 699px), (max-height: 699px)': 'small',
'(min-width: 700px) and (min-height: 700px)': 'large'
},
states: {
small: {
setup: function() {
// Run small setup logic
},
teardown: function() {
// Run small teardown logic
}
},
large: {
setup: function() {
// Run large setup logic
},
teardown: function() {
// Run large teardown logic
}
}
}
});
```
## Author
- **Wilson Page** - [@wilsonpage](http://github.com/wilsonpage)
## Contributors
- **Matt Andrews** - [@matthew-andrews](http://github.com/matthew-andrews)
## License
Copyright (c) 2014 The Financial Times Limited
Licensed under the MIT license.
## Credits and collaboration
All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. Enjoy...
| Add a few extra details to the example | Add a few extra details to the example
| Markdown | mit | ftlabs/fruitmachine-media | markdown | ## Code Before:
FruitMachine helper that allows different setup and teardown callbacks to be called based on media queries.
## Example
```js
var fm = require('fm');
module.exports = fm.define({
template: function() {
},
helpers: [
require('fruitmachine-media')
],
media: {
'(max-width: 699px), (max-height: 699px)': 'small',
'(min-width: 700px) and (min-height: 700px)': 'large'
},
states: {
small: {
setup: function() {
// Run small setup logic
},
teardown: function() {
// Run small teardown logic
}
},
large: {
setup: function() {
// Run large setup logic
},
teardown: function() {
// Run large teardown logic
}
}
}
});
```
## Author
- **Wilson Page** - [@wilsonpage](http://github.com/wilsonpage)
## Contributors
- **Matt Andrews** - [@matthew-andrews](http://github.com/matthew-andrews)
## License
Copyright (c) 2014 The Financial Times Limited
Licensed under the MIT license.
## Credits and collaboration
All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. Enjoy...
## Instruction:
Add a few extra details to the example
## Code After:
FruitMachine helper that allows different setup and teardown callbacks to be called based on media queries.
## Example usage
```js
var fm = require('fm');
fm.define({
name: 'passionfruit',
template: function() {
// Normal fruitmachine template method
},
helpers: [
require('fruitmachine-media')
],
media: {
'(max-width: 699px), (max-height: 699px)': 'small',
'(min-width: 700px) and (min-height: 700px)': 'large'
},
states: {
small: {
setup: function() {
// Run small setup logic
},
teardown: function() {
// Run small teardown logic
}
},
large: {
setup: function() {
// Run large setup logic
},
teardown: function() {
// Run large teardown logic
}
}
}
});
```
## Author
- **Wilson Page** - [@wilsonpage](http://github.com/wilsonpage)
## Contributors
- **Matt Andrews** - [@matthew-andrews](http://github.com/matthew-andrews)
## License
Copyright (c) 2014 The Financial Times Limited
Licensed under the MIT license.
## Credits and collaboration
All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. Enjoy...
|
FruitMachine helper that allows different setup and teardown callbacks to be called based on media queries.
- ## Example
+ ## Example usage
? ++++++
```js
var fm = require('fm');
- module.exports = fm.define({
+ fm.define({
+ name: 'passionfruit',
+
template: function() {
+ // Normal fruitmachine template method
+ },
- },
helpers: [
require('fruitmachine-media')
],
media: {
'(max-width: 699px), (max-height: 699px)': 'small',
'(min-width: 700px) and (min-height: 700px)': 'large'
},
states: {
small: {
setup: function() {
// Run small setup logic
},
teardown: function() {
// Run small teardown logic
}
},
large: {
setup: function() {
// Run large setup logic
},
teardown: function() {
// Run large teardown logic
}
}
}
});
```
## Author
- **Wilson Page** - [@wilsonpage](http://github.com/wilsonpage)
## Contributors
- **Matt Andrews** - [@matthew-andrews](http://github.com/matthew-andrews)
## License
Copyright (c) 2014 The Financial Times Limited
Licensed under the MIT license.
## Credits and collaboration
All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request. Enjoy... | 9 | 0.157895 | 6 | 3 |
3c5c86907b70111cd8f4c9fe3e92c333c5ab2251 | lib/puppet-catalog-test/puppet_adapter/puppet_4x_adapter.rb | lib/puppet-catalog-test/puppet_adapter/puppet_4x_adapter.rb | require "puppet"
module PuppetCatalogTest
class Puppet4xAdapter < BasePuppetAdapter
def initialize(config)
super(config)
@env = Puppet.lookup(:current_environment).
override_with(:manifest => config[:manifest_path]).
override_with(:modulepath => config[:module_paths])
@env.each_plugin_directory do |dir|
$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
end
require 'puppet/test/test_helper'
Puppet::Test::TestHelper.initialize
Puppet::Test::TestHelper.before_all_tests
end
def version
Puppet.version
end
def nodes
@env.known_resource_types.nodes.keys
end
def create_node(hostname, facts)
node = Puppet::Node.new(hostname, :facts => Puppet::Node::Facts.new("facts", facts))
node.merge(facts)
node
end
def compile(node)
begin
Puppet::Test::TestHelper.before_each_test
Puppet::Parser::Compiler.compile(node)
rescue => e
raise e
ensure
Puppet::Test::TestHelper.after_each_test
end
end
end
end
| require "puppet"
module PuppetCatalogTest
class Puppet4xAdapter < BasePuppetAdapter
def initialize(config)
super(config)
@env = Puppet.lookup(:current_environment).
override_with(:manifest => config[:manifest_path]).
override_with(:modulepath => config[:module_paths])
@env.each_plugin_directory do |dir|
$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
end
require 'puppet/test/test_helper'
Puppet::Test::TestHelper.initialize
Puppet::Test::TestHelper.before_all_tests
end
def version
Puppet.version
end
def nodes
@env.known_resource_types.nodes.keys
end
def create_node(hostname, facts)
Puppet::Test::TestHelper.before_each_test
init_config
node = Puppet::Node.new(hostname, :facts => Puppet::Node::Facts.new("facts", facts))
node.merge(facts)
node
end
def compile(node)
begin
Puppet::Parser::Compiler.compile(node)
rescue => e
raise e
ensure
Puppet::Test::TestHelper.after_each_test
end
end
end
end
| Move Puppet 4.x to the same scheme as Puppet 3.x | Move Puppet 4.x to the same scheme as Puppet 3.x
| Ruby | mit | invadersmustdie/puppet-catalog-test,invadersmustdie/puppet-catalog-test,invadersmustdie/puppet-catalog-test | ruby | ## Code Before:
require "puppet"
module PuppetCatalogTest
class Puppet4xAdapter < BasePuppetAdapter
def initialize(config)
super(config)
@env = Puppet.lookup(:current_environment).
override_with(:manifest => config[:manifest_path]).
override_with(:modulepath => config[:module_paths])
@env.each_plugin_directory do |dir|
$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
end
require 'puppet/test/test_helper'
Puppet::Test::TestHelper.initialize
Puppet::Test::TestHelper.before_all_tests
end
def version
Puppet.version
end
def nodes
@env.known_resource_types.nodes.keys
end
def create_node(hostname, facts)
node = Puppet::Node.new(hostname, :facts => Puppet::Node::Facts.new("facts", facts))
node.merge(facts)
node
end
def compile(node)
begin
Puppet::Test::TestHelper.before_each_test
Puppet::Parser::Compiler.compile(node)
rescue => e
raise e
ensure
Puppet::Test::TestHelper.after_each_test
end
end
end
end
## Instruction:
Move Puppet 4.x to the same scheme as Puppet 3.x
## Code After:
require "puppet"
module PuppetCatalogTest
class Puppet4xAdapter < BasePuppetAdapter
def initialize(config)
super(config)
@env = Puppet.lookup(:current_environment).
override_with(:manifest => config[:manifest_path]).
override_with(:modulepath => config[:module_paths])
@env.each_plugin_directory do |dir|
$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
end
require 'puppet/test/test_helper'
Puppet::Test::TestHelper.initialize
Puppet::Test::TestHelper.before_all_tests
end
def version
Puppet.version
end
def nodes
@env.known_resource_types.nodes.keys
end
def create_node(hostname, facts)
Puppet::Test::TestHelper.before_each_test
init_config
node = Puppet::Node.new(hostname, :facts => Puppet::Node::Facts.new("facts", facts))
node.merge(facts)
node
end
def compile(node)
begin
Puppet::Parser::Compiler.compile(node)
rescue => e
raise e
ensure
Puppet::Test::TestHelper.after_each_test
end
end
end
end
| require "puppet"
module PuppetCatalogTest
class Puppet4xAdapter < BasePuppetAdapter
def initialize(config)
super(config)
@env = Puppet.lookup(:current_environment).
override_with(:manifest => config[:manifest_path]).
override_with(:modulepath => config[:module_paths])
@env.each_plugin_directory do |dir|
$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
end
require 'puppet/test/test_helper'
Puppet::Test::TestHelper.initialize
Puppet::Test::TestHelper.before_all_tests
end
def version
Puppet.version
end
def nodes
@env.known_resource_types.nodes.keys
end
def create_node(hostname, facts)
+ Puppet::Test::TestHelper.before_each_test
+ init_config
node = Puppet::Node.new(hostname, :facts => Puppet::Node::Facts.new("facts", facts))
node.merge(facts)
node
end
def compile(node)
begin
- Puppet::Test::TestHelper.before_each_test
Puppet::Parser::Compiler.compile(node)
rescue => e
raise e
ensure
Puppet::Test::TestHelper.after_each_test
end
end
end
end | 3 | 0.06383 | 2 | 1 |
e9964a0f96777c5aae83349ccde3d14fbd04353b | contrib/generate-gresource-xml.py | contrib/generate-gresource-xml.py |
import sys
import os
import xml.etree.ElementTree as ET
if len(sys.argv) < 2:
print("not enough arguments")
sys.exit(1)
root = ET.Element("gresources")
n_gresource = ET.SubElement(root, "gresource", {"prefix": "/org/freedesktop/fwupd"})
for fn in sorted(sys.argv[2:]):
n_file = ET.SubElement(n_gresource, "file", {"compressed": "true"})
n_file.text = fn
if fn.endswith(".xml"):
n_file.set("preprocess", "xml-stripblanks")
n_file.set("alias", os.path.basename(fn))
with open(sys.argv[1], "wb") as f:
f.write(ET.tostring(root, "utf-8", xml_declaration=True))
sys.exit(0)
|
import sys
import os
import xml.etree.ElementTree as ET
if len(sys.argv) < 2:
print("not enough arguments")
sys.exit(1)
root = ET.Element("gresources")
n_gresource = ET.SubElement(root, "gresource", {"prefix": "/org/freedesktop/fwupd"})
for fn in sorted(sys.argv[2:]):
n_file = ET.SubElement(n_gresource, "file", {"compressed": "true"})
n_file.text = fn
if fn.endswith(".xml"):
n_file.set("preprocess", "xml-stripblanks")
n_file.set("alias", os.path.basename(fn))
with open(sys.argv[1], "wb") as f:
try:
f.write(ET.tostring(root, "utf-8", xml_declaration=True))
except TypeError:
f.write(ET.tostring(root, "utf-8"))
sys.exit(0)
| Fix compile when using python 3.7 or older | trivial: Fix compile when using python 3.7 or older
Signed-off-by: Richard Hughes <320bca71fc381a4a025636043ca86e734e31cf8b@hughsie.com>
| Python | lgpl-2.1 | fwupd/fwupd,fwupd/fwupd,fwupd/fwupd,fwupd/fwupd | python | ## Code Before:
import sys
import os
import xml.etree.ElementTree as ET
if len(sys.argv) < 2:
print("not enough arguments")
sys.exit(1)
root = ET.Element("gresources")
n_gresource = ET.SubElement(root, "gresource", {"prefix": "/org/freedesktop/fwupd"})
for fn in sorted(sys.argv[2:]):
n_file = ET.SubElement(n_gresource, "file", {"compressed": "true"})
n_file.text = fn
if fn.endswith(".xml"):
n_file.set("preprocess", "xml-stripblanks")
n_file.set("alias", os.path.basename(fn))
with open(sys.argv[1], "wb") as f:
f.write(ET.tostring(root, "utf-8", xml_declaration=True))
sys.exit(0)
## Instruction:
trivial: Fix compile when using python 3.7 or older
Signed-off-by: Richard Hughes <320bca71fc381a4a025636043ca86e734e31cf8b@hughsie.com>
## Code After:
import sys
import os
import xml.etree.ElementTree as ET
if len(sys.argv) < 2:
print("not enough arguments")
sys.exit(1)
root = ET.Element("gresources")
n_gresource = ET.SubElement(root, "gresource", {"prefix": "/org/freedesktop/fwupd"})
for fn in sorted(sys.argv[2:]):
n_file = ET.SubElement(n_gresource, "file", {"compressed": "true"})
n_file.text = fn
if fn.endswith(".xml"):
n_file.set("preprocess", "xml-stripblanks")
n_file.set("alias", os.path.basename(fn))
with open(sys.argv[1], "wb") as f:
try:
f.write(ET.tostring(root, "utf-8", xml_declaration=True))
except TypeError:
f.write(ET.tostring(root, "utf-8"))
sys.exit(0)
|
import sys
import os
import xml.etree.ElementTree as ET
if len(sys.argv) < 2:
print("not enough arguments")
sys.exit(1)
root = ET.Element("gresources")
n_gresource = ET.SubElement(root, "gresource", {"prefix": "/org/freedesktop/fwupd"})
for fn in sorted(sys.argv[2:]):
n_file = ET.SubElement(n_gresource, "file", {"compressed": "true"})
n_file.text = fn
if fn.endswith(".xml"):
n_file.set("preprocess", "xml-stripblanks")
n_file.set("alias", os.path.basename(fn))
with open(sys.argv[1], "wb") as f:
+ try:
- f.write(ET.tostring(root, "utf-8", xml_declaration=True))
+ f.write(ET.tostring(root, "utf-8", xml_declaration=True))
? ++++
+ except TypeError:
+ f.write(ET.tostring(root, "utf-8"))
sys.exit(0) | 5 | 0.227273 | 4 | 1 |
677a70708bbcefc869a24414004d0473a8927abf | lib/maskable_attribute/acts_as_maskable_attribute.rb | lib/maskable_attribute/acts_as_maskable_attribute.rb | module MaskableAttribute
module ActsAsMaskableAttribute
extend ActiveSupport::Concern
included do
end
module ClassMethods
##
# Specifices an attribute to be masked, followed by masks to be made available to the attribute.
#
# ==== Examples
#
# class Foo < ActiveRecord::Base
# maskable_attrribute :some_attribute, :some_method_be_used_as_a_mask, :another_attribute_mask
# end
def maskable_attribute(masked_attribute, *masks)
cattr_accessor :masked_attributes, :masks
self.masked_attributes ||= Hash.new
self.masked_attributes[masked_attribute] = MaskableAttribute.new masks
self.masks ||= {}
self.masks[masked_attribute] = masks
self.send(:define_method, name.to_s) { maskable_attributes[masked_attribute] }
self.send(:define_method, name.to_s + "=") { |value| maskable_attributes[masked_attribute] = value }
end
end
end
end
ActiveRecord::Base.send :include, MaskableAttribute::ActsAsMaskableAttribute
| module MaskableAttribute
module ActsAsMaskableAttribute
extend ActiveSupport::Concern
included do
end
module ClassMethods
##
# Specifices an attribute to be masked, followed by masks to be made available to the attribute.
#
# ==== Examples
#
# class Foo < ActiveRecord::Base
# maskable_attrribute :some_attribute, :some_method_be_used_as_a_mask, :another_attribute_mask
# end
def maskable_attribute(masked_attribute, *masks)
cattr_accessor :masked_attributes, :masks
self.masked_attributes ||= Hash.new
self.masked_attributes[masked_attribute] = MaskableAttribute.new masks
self.masks ||= {}
self.masks[masked_attribute] = masks
define_method masked_attribute do
masked_attributes[masked_attribute]
end
define_method "#{masked_attribute}=" do |value|
masked_attributes[masked_attribute] = value
end
end
end
end
end
ActiveRecord::Base.send :include, MaskableAttribute::ActsAsMaskableAttribute
| Improve Instance Getter/Setter Method Definitions | Improve Instance Getter/Setter Method Definitions
Switch from the condensed brace ({}) style to the easier to read do|end style.
| Ruby | mit | billy-ran-away/maskable_attribute,billy-ran-away/maskable_attribute | ruby | ## Code Before:
module MaskableAttribute
module ActsAsMaskableAttribute
extend ActiveSupport::Concern
included do
end
module ClassMethods
##
# Specifices an attribute to be masked, followed by masks to be made available to the attribute.
#
# ==== Examples
#
# class Foo < ActiveRecord::Base
# maskable_attrribute :some_attribute, :some_method_be_used_as_a_mask, :another_attribute_mask
# end
def maskable_attribute(masked_attribute, *masks)
cattr_accessor :masked_attributes, :masks
self.masked_attributes ||= Hash.new
self.masked_attributes[masked_attribute] = MaskableAttribute.new masks
self.masks ||= {}
self.masks[masked_attribute] = masks
self.send(:define_method, name.to_s) { maskable_attributes[masked_attribute] }
self.send(:define_method, name.to_s + "=") { |value| maskable_attributes[masked_attribute] = value }
end
end
end
end
ActiveRecord::Base.send :include, MaskableAttribute::ActsAsMaskableAttribute
## Instruction:
Improve Instance Getter/Setter Method Definitions
Switch from the condensed brace ({}) style to the easier to read do|end style.
## Code After:
module MaskableAttribute
module ActsAsMaskableAttribute
extend ActiveSupport::Concern
included do
end
module ClassMethods
##
# Specifices an attribute to be masked, followed by masks to be made available to the attribute.
#
# ==== Examples
#
# class Foo < ActiveRecord::Base
# maskable_attrribute :some_attribute, :some_method_be_used_as_a_mask, :another_attribute_mask
# end
def maskable_attribute(masked_attribute, *masks)
cattr_accessor :masked_attributes, :masks
self.masked_attributes ||= Hash.new
self.masked_attributes[masked_attribute] = MaskableAttribute.new masks
self.masks ||= {}
self.masks[masked_attribute] = masks
define_method masked_attribute do
masked_attributes[masked_attribute]
end
define_method "#{masked_attribute}=" do |value|
masked_attributes[masked_attribute] = value
end
end
end
end
end
ActiveRecord::Base.send :include, MaskableAttribute::ActsAsMaskableAttribute
| module MaskableAttribute
module ActsAsMaskableAttribute
extend ActiveSupport::Concern
included do
end
module ClassMethods
##
# Specifices an attribute to be masked, followed by masks to be made available to the attribute.
#
# ==== Examples
#
# class Foo < ActiveRecord::Base
# maskable_attrribute :some_attribute, :some_method_be_used_as_a_mask, :another_attribute_mask
# end
def maskable_attribute(masked_attribute, *masks)
cattr_accessor :masked_attributes, :masks
self.masked_attributes ||= Hash.new
self.masked_attributes[masked_attribute] = MaskableAttribute.new masks
self.masks ||= {}
self.masks[masked_attribute] = masks
- self.send(:define_method, name.to_s) { maskable_attributes[masked_attribute] }
- self.send(:define_method, name.to_s + "=") { |value| maskable_attributes[masked_attribute] = value }
+
+ define_method masked_attribute do
+ masked_attributes[masked_attribute]
+ end
+
+ define_method "#{masked_attribute}=" do |value|
+ masked_attributes[masked_attribute] = value
+ end
end
end
end
end
ActiveRecord::Base.send :include, MaskableAttribute::ActsAsMaskableAttribute | 10 | 0.333333 | 8 | 2 |
26a66053274ddea417f8bb43a5668c8cfc1a39d2 | .travis.yml | .travis.yml | language: python
python:
- '2.6'
- '2.7'
- 'pypy'
install: "python setup.py install"
script: "dna -h"
deploy:
provider: pypi
user: allanino
password:
secure: f6A4pg0MWM11U4i+MViOMNe/YM9LT6v/jAFs6JRQ7jp+2eVjuzFlfByVn0sLdALExHi4sno66j7aLTGJcSlwlRZUt/Wss1C+4Rt1D+KrzriFdH8WANKzTF63fh8cZDYMdEerzCkcPwzcBB5tmdpMXq44LIaw/d4a7hF2L5bNqlc=
on:
tags: true
repo: allanino/DNA
| language: python
python:
- '2.6'
- '2.7'
- 'pypy'
install: "python setup.py install"
script: "dna -h"
deploy:
provider: pypi
user: allanino
password:
secure: f6A4pg0MWM11U4i+MViOMNe/YM9LT6v/jAFs6JRQ7jp+2eVjuzFlfByVn0sLdALExHi4sno66j7aLTGJcSlwlRZUt/Wss1C+4Rt1D+KrzriFdH8WANKzTF63fh8cZDYMdEerzCkcPwzcBB5tmdpMXq44LIaw/d4a7hF2L5bNqlc=
on:
all_branches: true
tags: true
repo: allanino/DNA
| Fix Travis not building branch v0.3 | Fix Travis not building branch v0.3
| YAML | mit | allanino/DNA | yaml | ## Code Before:
language: python
python:
- '2.6'
- '2.7'
- 'pypy'
install: "python setup.py install"
script: "dna -h"
deploy:
provider: pypi
user: allanino
password:
secure: f6A4pg0MWM11U4i+MViOMNe/YM9LT6v/jAFs6JRQ7jp+2eVjuzFlfByVn0sLdALExHi4sno66j7aLTGJcSlwlRZUt/Wss1C+4Rt1D+KrzriFdH8WANKzTF63fh8cZDYMdEerzCkcPwzcBB5tmdpMXq44LIaw/d4a7hF2L5bNqlc=
on:
tags: true
repo: allanino/DNA
## Instruction:
Fix Travis not building branch v0.3
## Code After:
language: python
python:
- '2.6'
- '2.7'
- 'pypy'
install: "python setup.py install"
script: "dna -h"
deploy:
provider: pypi
user: allanino
password:
secure: f6A4pg0MWM11U4i+MViOMNe/YM9LT6v/jAFs6JRQ7jp+2eVjuzFlfByVn0sLdALExHi4sno66j7aLTGJcSlwlRZUt/Wss1C+4Rt1D+KrzriFdH8WANKzTF63fh8cZDYMdEerzCkcPwzcBB5tmdpMXq44LIaw/d4a7hF2L5bNqlc=
on:
all_branches: true
tags: true
repo: allanino/DNA
| language: python
python:
- '2.6'
- '2.7'
- 'pypy'
install: "python setup.py install"
script: "dna -h"
deploy:
provider: pypi
user: allanino
password:
secure: f6A4pg0MWM11U4i+MViOMNe/YM9LT6v/jAFs6JRQ7jp+2eVjuzFlfByVn0sLdALExHi4sno66j7aLTGJcSlwlRZUt/Wss1C+4Rt1D+KrzriFdH8WANKzTF63fh8cZDYMdEerzCkcPwzcBB5tmdpMXq44LIaw/d4a7hF2L5bNqlc=
on:
+ all_branches: true
tags: true
repo: allanino/DNA | 1 | 0.052632 | 1 | 0 |
5467db0f6210cba75ef9b56c2f1a783b23cceb4b | html/templates/Home.php | html/templates/Home.php | <!-- Jquery Calls Specific to this page -->
<script src="html/js/Home.js" type="text/javascript"></script>
</head>
<body>
<div id="notifications"></div>
<div id="idletimeout">
You will be logged off in <span><!-- countdown place holder --></span> seconds due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using ClinicCases</a>.
</div>
<div id = "nav_container">
<?php $t = tabs($dbh,$_GET['i']); echo $t; ?>
<div id="menus">
<?php include 'html/templates/Menus.php'; ?>
</div>
</div>
<div id="content">
This is the home file.
</div>
| <!-- Jquery Calls Specific to this page -->
<script src="html/js/Home.js" type="text/javascript"></script>
</head>
<body>
<div id="notifications"></div>
<div id="idletimeout">
You will be logged off in <span><!-- countdown place holder --></span> seconds due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using ClinicCases</a>.
</div>
<div id = "nav_container">
<?php $t = tabs($dbh,$_GET['i']); echo $t; ?>
<div id="menus">
<?php include 'html/templates/Menus.php'; ?>
</div>
</div>
<div id="content">
Activity | Upcoming | Trends
</div>
| Add placemarker for three views on home screen. | Add placemarker for three views on home screen.
git-svn-id: 245d8f85226f8eeeaacc1269b037bb4851d63c96@918 54a900ba-8191-11dd-a5c9-f1483cedc3eb
| PHP | mit | nswinea/cliniccases,nswinea/cliniccases,nswinea/cliniccases | php | ## Code Before:
<!-- Jquery Calls Specific to this page -->
<script src="html/js/Home.js" type="text/javascript"></script>
</head>
<body>
<div id="notifications"></div>
<div id="idletimeout">
You will be logged off in <span><!-- countdown place holder --></span> seconds due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using ClinicCases</a>.
</div>
<div id = "nav_container">
<?php $t = tabs($dbh,$_GET['i']); echo $t; ?>
<div id="menus">
<?php include 'html/templates/Menus.php'; ?>
</div>
</div>
<div id="content">
This is the home file.
</div>
## Instruction:
Add placemarker for three views on home screen.
git-svn-id: 245d8f85226f8eeeaacc1269b037bb4851d63c96@918 54a900ba-8191-11dd-a5c9-f1483cedc3eb
## Code After:
<!-- Jquery Calls Specific to this page -->
<script src="html/js/Home.js" type="text/javascript"></script>
</head>
<body>
<div id="notifications"></div>
<div id="idletimeout">
You will be logged off in <span><!-- countdown place holder --></span> seconds due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using ClinicCases</a>.
</div>
<div id = "nav_container">
<?php $t = tabs($dbh,$_GET['i']); echo $t; ?>
<div id="menus">
<?php include 'html/templates/Menus.php'; ?>
</div>
</div>
<div id="content">
Activity | Upcoming | Trends
</div>
| <!-- Jquery Calls Specific to this page -->
<script src="html/js/Home.js" type="text/javascript"></script>
</head>
<body>
<div id="notifications"></div>
<div id="idletimeout">
You will be logged off in <span><!-- countdown place holder --></span> seconds due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using ClinicCases</a>.
</div>
<div id = "nav_container">
<?php $t = tabs($dbh,$_GET['i']); echo $t; ?>
<div id="menus">
<?php include 'html/templates/Menus.php'; ?>
</div>
</div>
<div id="content">
- This is the home file.
+ Activity | Upcoming | Trends
</div>
| 2 | 0.068966 | 1 | 1 |
50c08a03b7cb532c5e582c52061c60b7d959fb0b | roles/prgmr.rb | roles/prgmr.rb | name "prgmr"
description "Role applied to all servers at prgmr.com"
default_attributes(
:hosted_by => "prgmr.com",
:location => "San Francisco, California",
:timezone => "PST8PDT",
:networking => {
:nameservers => ["8.8.4.4", "65.19.174.2", "65.19.175.2"],
:roles => {
:external => {
:zone => "pr"
}
}
}
)
override_attributes(
:ntp => {
:servers => ["0.us.pool.ntp.org", "1.us.pool.ntp.org", "2.us.pool.ntp.org"]
}
)
run_list(
"role[us]"
)
| name "prgmr"
description "Role applied to all servers at prgmr.com"
default_attributes(
:hosted_by => "prgmr.com",
:location => "San Francisco, California",
:timezone => "PST8PDT",
:networking => {
:nameservers => ["8.8.8.8", "8.8.4.4"],
:roles => {
:external => {
:zone => "pr"
}
}
}
)
override_attributes(
:ntp => {
:servers => ["0.us.pool.ntp.org", "1.us.pool.ntp.org", "2.us.pool.ntp.org"]
}
)
run_list(
"role[us]"
)
| Use google DNS for jakelong | Use google DNS for jakelong
| Ruby | apache-2.0 | zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,Firefishy/chef,zerebubuth/openstreetmap-chef,Firefishy/chef,tomhughes/openstreetmap-chef,Firefishy/chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,Firefishy/chef,openstreetmap/chef,openstreetmap/chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,openstreetmap/chef,openstreetmap/chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,Firefishy/chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,openstreetmap/chef,tomhughes/openstreetmap-chef,Firefishy/chef,Firefishy/chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,Firefishy/chef | ruby | ## Code Before:
name "prgmr"
description "Role applied to all servers at prgmr.com"
default_attributes(
:hosted_by => "prgmr.com",
:location => "San Francisco, California",
:timezone => "PST8PDT",
:networking => {
:nameservers => ["8.8.4.4", "65.19.174.2", "65.19.175.2"],
:roles => {
:external => {
:zone => "pr"
}
}
}
)
override_attributes(
:ntp => {
:servers => ["0.us.pool.ntp.org", "1.us.pool.ntp.org", "2.us.pool.ntp.org"]
}
)
run_list(
"role[us]"
)
## Instruction:
Use google DNS for jakelong
## Code After:
name "prgmr"
description "Role applied to all servers at prgmr.com"
default_attributes(
:hosted_by => "prgmr.com",
:location => "San Francisco, California",
:timezone => "PST8PDT",
:networking => {
:nameservers => ["8.8.8.8", "8.8.4.4"],
:roles => {
:external => {
:zone => "pr"
}
}
}
)
override_attributes(
:ntp => {
:servers => ["0.us.pool.ntp.org", "1.us.pool.ntp.org", "2.us.pool.ntp.org"]
}
)
run_list(
"role[us]"
)
| name "prgmr"
description "Role applied to all servers at prgmr.com"
default_attributes(
:hosted_by => "prgmr.com",
:location => "San Francisco, California",
:timezone => "PST8PDT",
:networking => {
- :nameservers => ["8.8.4.4", "65.19.174.2", "65.19.175.2"],
+ :nameservers => ["8.8.8.8", "8.8.4.4"],
:roles => {
:external => {
:zone => "pr"
}
}
}
)
override_attributes(
:ntp => {
:servers => ["0.us.pool.ntp.org", "1.us.pool.ntp.org", "2.us.pool.ntp.org"]
}
)
run_list(
"role[us]"
) | 2 | 0.076923 | 1 | 1 |
dd91e90db54b6ed6d88b0bbd09eba60a5890dc0a | prog/CMakeLists.txt | prog/CMakeLists.txt | cmake_minimum_required (VERSION 2.8.12)
# title and version of the project
project (pomerol CXX)
set(default_progs "anderson" "hubbard2d")
find_package(Boost COMPONENTS system program_options REQUIRED)
set(BOOST_EXTRA_LIBS ${Boost_LIBRARIES})
set(BOOST_EXTRA_INCLUDES ${Boost_INCLUDE_DIRS})
if (${PROJECT_CAPNAME}_CXX11)
find_package(Git)
execute_process(COMMAND "${GIT_EXECUTABLE}" "clone" "--branch" "master" "https://github.com/aeantipov/gftools.git" "gftools" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
message(STATUS "Building executables")
if(NOT progs_list)
set(progs_list "anderson")
endif()
foreach(model ${progs_list})
list (FIND default_progs ${model} _index)
if (${_index} GREATER -1)
string(TOUPPER ${model} def)
set(def "POMEROL_${def}")
#string(CONCAT def "POMEROL_" ${def})
add_prog(${model} ${def})
else()
message(WARNING "Unknown program \"${model}\" has been skiped.")
endif()
endforeach()
| cmake_minimum_required (VERSION 2.8.12)
# title and version of the project
project (pomerol CXX)
set(default_progs "anderson" "hubbard2d")
find_package(Boost COMPONENTS system program_options REQUIRED)
set(BOOST_EXTRA_LIBS ${Boost_LIBRARIES})
set(BOOST_EXTRA_INCLUDES ${Boost_INCLUDE_DIRS})
if (${PROJECT_CAPNAME}_CXX11)
find_package(Git)
execute_process(COMMAND "${GIT_EXECUTABLE}" "clone" "--branch" "master" "https://github.com/aeantipov/gftools.git" "gftools" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
message(STATUS "Building executables")
if(NOT progs_list)
set(progs_list "anderson")
endif()
foreach(model ${progs_list})
list (FIND default_progs ${model} _index)
if (${_index} GREATER -1)
string(TOUPPER ${model} def)
set(def "POMEROL_${def}")
add_prog(${model} ${def})
else()
message(WARNING "Unknown program \"${model}\" has been skiped.")
endif()
endforeach()
| Check for correct program name. Cleanup. | Check for correct program name. Cleanup.
| Text | mpl-2.0 | aeantipov/pomerol,aeantipov/pomerol,aeantipov/pomerol | text | ## Code Before:
cmake_minimum_required (VERSION 2.8.12)
# title and version of the project
project (pomerol CXX)
set(default_progs "anderson" "hubbard2d")
find_package(Boost COMPONENTS system program_options REQUIRED)
set(BOOST_EXTRA_LIBS ${Boost_LIBRARIES})
set(BOOST_EXTRA_INCLUDES ${Boost_INCLUDE_DIRS})
if (${PROJECT_CAPNAME}_CXX11)
find_package(Git)
execute_process(COMMAND "${GIT_EXECUTABLE}" "clone" "--branch" "master" "https://github.com/aeantipov/gftools.git" "gftools" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
message(STATUS "Building executables")
if(NOT progs_list)
set(progs_list "anderson")
endif()
foreach(model ${progs_list})
list (FIND default_progs ${model} _index)
if (${_index} GREATER -1)
string(TOUPPER ${model} def)
set(def "POMEROL_${def}")
#string(CONCAT def "POMEROL_" ${def})
add_prog(${model} ${def})
else()
message(WARNING "Unknown program \"${model}\" has been skiped.")
endif()
endforeach()
## Instruction:
Check for correct program name. Cleanup.
## Code After:
cmake_minimum_required (VERSION 2.8.12)
# title and version of the project
project (pomerol CXX)
set(default_progs "anderson" "hubbard2d")
find_package(Boost COMPONENTS system program_options REQUIRED)
set(BOOST_EXTRA_LIBS ${Boost_LIBRARIES})
set(BOOST_EXTRA_INCLUDES ${Boost_INCLUDE_DIRS})
if (${PROJECT_CAPNAME}_CXX11)
find_package(Git)
execute_process(COMMAND "${GIT_EXECUTABLE}" "clone" "--branch" "master" "https://github.com/aeantipov/gftools.git" "gftools" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
message(STATUS "Building executables")
if(NOT progs_list)
set(progs_list "anderson")
endif()
foreach(model ${progs_list})
list (FIND default_progs ${model} _index)
if (${_index} GREATER -1)
string(TOUPPER ${model} def)
set(def "POMEROL_${def}")
add_prog(${model} ${def})
else()
message(WARNING "Unknown program \"${model}\" has been skiped.")
endif()
endforeach()
| cmake_minimum_required (VERSION 2.8.12)
# title and version of the project
project (pomerol CXX)
set(default_progs "anderson" "hubbard2d")
find_package(Boost COMPONENTS system program_options REQUIRED)
set(BOOST_EXTRA_LIBS ${Boost_LIBRARIES})
set(BOOST_EXTRA_INCLUDES ${Boost_INCLUDE_DIRS})
if (${PROJECT_CAPNAME}_CXX11)
find_package(Git)
execute_process(COMMAND "${GIT_EXECUTABLE}" "clone" "--branch" "master" "https://github.com/aeantipov/gftools.git" "gftools" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
message(STATUS "Building executables")
if(NOT progs_list)
set(progs_list "anderson")
endif()
foreach(model ${progs_list})
list (FIND default_progs ${model} _index)
if (${_index} GREATER -1)
string(TOUPPER ${model} def)
set(def "POMEROL_${def}")
- #string(CONCAT def "POMEROL_" ${def})
add_prog(${model} ${def})
else()
message(WARNING "Unknown program \"${model}\" has been skiped.")
endif()
endforeach() | 1 | 0.033333 | 0 | 1 |
1a6188a4298e235f67b83f1ef44c119469c0b227 | package.json | package.json | {
"devDependencies": {
"tslint": "^3.15.1",
"tslint-config-typings": "^0.2.4",
"typescript": "^2.0.6"
},
"scripts": {
"lint": "tslint discord.d.ts discord.js-test.ts"
}
}
| {
"devDependencies": {
"tslint": "^3.15.1",
"tslint-config-typings": "^0.2.4",
"typescript": "^2.0.6",
"typings": "^1.5.0"
},
"scripts": {
"lint": "tslint discord.d.ts discord.js-test.ts"
}
}
| Add typings as a dev depedency | Add typings as a dev depedency
| JSON | mit | acdenisSK/discord.js-typings | json | ## Code Before:
{
"devDependencies": {
"tslint": "^3.15.1",
"tslint-config-typings": "^0.2.4",
"typescript": "^2.0.6"
},
"scripts": {
"lint": "tslint discord.d.ts discord.js-test.ts"
}
}
## Instruction:
Add typings as a dev depedency
## Code After:
{
"devDependencies": {
"tslint": "^3.15.1",
"tslint-config-typings": "^0.2.4",
"typescript": "^2.0.6",
"typings": "^1.5.0"
},
"scripts": {
"lint": "tslint discord.d.ts discord.js-test.ts"
}
}
| {
"devDependencies": {
"tslint": "^3.15.1",
"tslint-config-typings": "^0.2.4",
- "typescript": "^2.0.6"
+ "typescript": "^2.0.6",
? +
+ "typings": "^1.5.0"
},
"scripts": {
"lint": "tslint discord.d.ts discord.js-test.ts"
}
} | 3 | 0.3 | 2 | 1 |
88ec6dc5bfa4c6c6e66f0034b4860fda021cb391 | demo/graphics/frame.js | demo/graphics/frame.js | 'use strict';
var PIXI = window.PIXI,
Point = require('../data/point'),
Rect = require('../data/rect');
function Frame(position, url, options) {
this.pos = position;
this.dir = options.direction || new Point(1, 1);
this.offset = options.offset || new Point(0, 0);
var base = PIXI.BaseTexture.fromImage(url, false, PIXI.scaleModes.NEAREST),
slice = options.crop || new Rect(0, 0, base.width, base.height),
tex = new PIXI.Texture(base, slice);
this.sprite = new PIXI.Sprite(tex);
this.render();
}
Frame.prototype.render = function() {
var gPos = this.sprite.position,
gScale = this.sprite.scale;
gPos.x = Math.round(this.pos.x + this.offset.x);
gPos.y = Math.round(this.pos.y + this.offset.y);
gScale.x = this.dir.x;
gScale.y = this.dir.y;
/*
* Flipping will result in the sprite appearing to jump (flips on the 0,
* rather than mid-sprite), so subtract the sprite's size from its position
* if it's flipped.
*/
if(gScale.x < 0) gPos.x -= this.sprite.width;
if(gScale.y < 0) gPos.y -= this.sprite.height;
};
module.exports = Frame;
| 'use strict';
var PIXI = window.PIXI,
Point = require('../data/point'),
Rect = require('../data/rect');
function Frame(position, url, options) {
this.pos = position;
this.dir = options.direction || new Point(1, 1);
this.offset = options.offset || new Point(0, 0);
var base = PIXI.BaseTexture.fromImage(url, false, PIXI.scaleModes.NEAREST),
slice = options.crop || new Rect(0, 0, base.width, base.height),
tex = new PIXI.Texture(base, slice);
this.sprite = new PIXI.Sprite(tex);
this.render();
}
Frame.prototype.render = function() {
var gPos = this.sprite.position,
gScale = this.sprite.scale;
gPos.x = this.pos.x + this.offset.x;
gPos.y = this.pos.y + this.offset.y;
gScale.x = this.dir.x;
gScale.y = this.dir.y;
/*
* Flipping will result in the sprite appearing to jump (flips on the 0,
* rather than mid-sprite), so subtract the sprite's size from its position
* if it's flipped.
*/
if(gScale.x < 0) gPos.x -= this.sprite.width;
if(gScale.y < 0) gPos.y -= this.sprite.height;
};
module.exports = Frame;
| Remove deoptimized calls based on profiling | Remove deoptimized calls based on profiling
| JavaScript | mit | reissbaker/gamekernel,reissbaker/gamekernel | javascript | ## Code Before:
'use strict';
var PIXI = window.PIXI,
Point = require('../data/point'),
Rect = require('../data/rect');
function Frame(position, url, options) {
this.pos = position;
this.dir = options.direction || new Point(1, 1);
this.offset = options.offset || new Point(0, 0);
var base = PIXI.BaseTexture.fromImage(url, false, PIXI.scaleModes.NEAREST),
slice = options.crop || new Rect(0, 0, base.width, base.height),
tex = new PIXI.Texture(base, slice);
this.sprite = new PIXI.Sprite(tex);
this.render();
}
Frame.prototype.render = function() {
var gPos = this.sprite.position,
gScale = this.sprite.scale;
gPos.x = Math.round(this.pos.x + this.offset.x);
gPos.y = Math.round(this.pos.y + this.offset.y);
gScale.x = this.dir.x;
gScale.y = this.dir.y;
/*
* Flipping will result in the sprite appearing to jump (flips on the 0,
* rather than mid-sprite), so subtract the sprite's size from its position
* if it's flipped.
*/
if(gScale.x < 0) gPos.x -= this.sprite.width;
if(gScale.y < 0) gPos.y -= this.sprite.height;
};
module.exports = Frame;
## Instruction:
Remove deoptimized calls based on profiling
## Code After:
'use strict';
var PIXI = window.PIXI,
Point = require('../data/point'),
Rect = require('../data/rect');
function Frame(position, url, options) {
this.pos = position;
this.dir = options.direction || new Point(1, 1);
this.offset = options.offset || new Point(0, 0);
var base = PIXI.BaseTexture.fromImage(url, false, PIXI.scaleModes.NEAREST),
slice = options.crop || new Rect(0, 0, base.width, base.height),
tex = new PIXI.Texture(base, slice);
this.sprite = new PIXI.Sprite(tex);
this.render();
}
Frame.prototype.render = function() {
var gPos = this.sprite.position,
gScale = this.sprite.scale;
gPos.x = this.pos.x + this.offset.x;
gPos.y = this.pos.y + this.offset.y;
gScale.x = this.dir.x;
gScale.y = this.dir.y;
/*
* Flipping will result in the sprite appearing to jump (flips on the 0,
* rather than mid-sprite), so subtract the sprite's size from its position
* if it's flipped.
*/
if(gScale.x < 0) gPos.x -= this.sprite.width;
if(gScale.y < 0) gPos.y -= this.sprite.height;
};
module.exports = Frame;
| 'use strict';
var PIXI = window.PIXI,
Point = require('../data/point'),
Rect = require('../data/rect');
function Frame(position, url, options) {
this.pos = position;
this.dir = options.direction || new Point(1, 1);
this.offset = options.offset || new Point(0, 0);
var base = PIXI.BaseTexture.fromImage(url, false, PIXI.scaleModes.NEAREST),
slice = options.crop || new Rect(0, 0, base.width, base.height),
tex = new PIXI.Texture(base, slice);
this.sprite = new PIXI.Sprite(tex);
this.render();
}
Frame.prototype.render = function() {
var gPos = this.sprite.position,
gScale = this.sprite.scale;
- gPos.x = Math.round(this.pos.x + this.offset.x);
? ----------- -
+ gPos.x = this.pos.x + this.offset.x;
- gPos.y = Math.round(this.pos.y + this.offset.y);
? ----------- -
+ gPos.y = this.pos.y + this.offset.y;
gScale.x = this.dir.x;
gScale.y = this.dir.y;
/*
* Flipping will result in the sprite appearing to jump (flips on the 0,
* rather than mid-sprite), so subtract the sprite's size from its position
* if it's flipped.
*/
if(gScale.x < 0) gPos.x -= this.sprite.width;
if(gScale.y < 0) gPos.y -= this.sprite.height;
};
module.exports = Frame; | 4 | 0.095238 | 2 | 2 |
ff476b33c26a9067e6ac64b2c161d29b0febea33 | py/capnptools/examples/tests/test_books.py | py/capnptools/examples/tests/test_books.py | import unittest
from examples import books
class BooksTest(unittest.TestCase):
def test_builder(self):
book = books.MallocMessageBuilder().init_root(books.Book)
book.title = 'Moby-Dick; or, The Whale'
book.authors = ['Herman Melville']
self.assertEqual(
{
'title': 'Moby-Dick; or, The Whale',
'authors': ['Herman Melville'],
},
book._as_dict(),
)
book = book._as_reader()
self.assertEqual('Moby-Dick; or, The Whale', book.title)
self.assertEqual(['Herman Melville'], book.authors._as_dict())
self.assertEqual(
{
'title': 'Moby-Dick; or, The Whale',
'authors': ['Herman Melville'],
},
book._as_dict(),
)
if __name__ == '__main__':
unittest.main()
| import unittest
import os
import tempfile
from examples import books
class BooksTest(unittest.TestCase):
BOOK = {
'title': 'Moby-Dick; or, The Whale',
'authors': ['Herman Melville'],
}
def test_builder(self):
book = books.MallocMessageBuilder().init_root(books.Book)
book.title = self.BOOK['title']
book.authors = self.BOOK['authors']
self.assertEqual(self.BOOK, book._as_dict())
book = book._as_reader()
self.assertEqual(self.BOOK['title'], book.title)
self.assertEqual(self.BOOK['authors'], book.authors._as_dict())
self.assertEqual(self.BOOK, book._as_dict())
def test_write(self):
builder = books.MallocMessageBuilder()
book = builder.init_root(books.Book)
book.title = self.BOOK['title']
book.authors = self.BOOK['authors']
for read_cls, write_func in [
('StreamFdMessageReader', 'write_to'),
('PackedFdMessageReader', 'write_packed_to')]:
with self.subTest(read_cls=read_cls, write_func=write_func):
fd, path = tempfile.mkstemp()
try:
getattr(builder, write_func)(fd)
os.close(fd)
fd = os.open(path, os.O_RDONLY)
reader = getattr(books, read_cls)(fd)
book = reader.get_root(books.Book)
self.assertEqual(self.BOOK, book._as_dict())
finally:
os.unlink(path)
os.close(fd)
if __name__ == '__main__':
unittest.main()
| Add unit tests for write_to and write_packed_to | Add unit tests for write_to and write_packed_to
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | python | ## Code Before:
import unittest
from examples import books
class BooksTest(unittest.TestCase):
def test_builder(self):
book = books.MallocMessageBuilder().init_root(books.Book)
book.title = 'Moby-Dick; or, The Whale'
book.authors = ['Herman Melville']
self.assertEqual(
{
'title': 'Moby-Dick; or, The Whale',
'authors': ['Herman Melville'],
},
book._as_dict(),
)
book = book._as_reader()
self.assertEqual('Moby-Dick; or, The Whale', book.title)
self.assertEqual(['Herman Melville'], book.authors._as_dict())
self.assertEqual(
{
'title': 'Moby-Dick; or, The Whale',
'authors': ['Herman Melville'],
},
book._as_dict(),
)
if __name__ == '__main__':
unittest.main()
## Instruction:
Add unit tests for write_to and write_packed_to
## Code After:
import unittest
import os
import tempfile
from examples import books
class BooksTest(unittest.TestCase):
BOOK = {
'title': 'Moby-Dick; or, The Whale',
'authors': ['Herman Melville'],
}
def test_builder(self):
book = books.MallocMessageBuilder().init_root(books.Book)
book.title = self.BOOK['title']
book.authors = self.BOOK['authors']
self.assertEqual(self.BOOK, book._as_dict())
book = book._as_reader()
self.assertEqual(self.BOOK['title'], book.title)
self.assertEqual(self.BOOK['authors'], book.authors._as_dict())
self.assertEqual(self.BOOK, book._as_dict())
def test_write(self):
builder = books.MallocMessageBuilder()
book = builder.init_root(books.Book)
book.title = self.BOOK['title']
book.authors = self.BOOK['authors']
for read_cls, write_func in [
('StreamFdMessageReader', 'write_to'),
('PackedFdMessageReader', 'write_packed_to')]:
with self.subTest(read_cls=read_cls, write_func=write_func):
fd, path = tempfile.mkstemp()
try:
getattr(builder, write_func)(fd)
os.close(fd)
fd = os.open(path, os.O_RDONLY)
reader = getattr(books, read_cls)(fd)
book = reader.get_root(books.Book)
self.assertEqual(self.BOOK, book._as_dict())
finally:
os.unlink(path)
os.close(fd)
if __name__ == '__main__':
unittest.main()
| import unittest
+
+ import os
+ import tempfile
from examples import books
class BooksTest(unittest.TestCase):
+ BOOK = {
+ 'title': 'Moby-Dick; or, The Whale',
+ 'authors': ['Herman Melville'],
+ }
+
def test_builder(self):
+
book = books.MallocMessageBuilder().init_root(books.Book)
+ book.title = self.BOOK['title']
+ book.authors = self.BOOK['authors']
+ self.assertEqual(self.BOOK, book._as_dict())
- book.title = 'Moby-Dick; or, The Whale'
- book.authors = ['Herman Melville']
- self.assertEqual(
- {
- 'title': 'Moby-Dick; or, The Whale',
- 'authors': ['Herman Melville'],
- },
- book._as_dict(),
- )
book = book._as_reader()
- self.assertEqual('Moby-Dick; or, The Whale', book.title)
+ self.assertEqual(self.BOOK['title'], book.title)
- self.assertEqual(['Herman Melville'], book.authors._as_dict())
? ^^ ^^^^^^^^^^^^
+ self.assertEqual(self.BOOK['authors'], book.authors._as_dict())
? +++++++++ ^^^^^ ^
- self.assertEqual(
- {
- 'title': 'Moby-Dick; or, The Whale',
- 'authors': ['Herman Melville'],
- },
- book._as_dict(),
- )
+ self.assertEqual(self.BOOK, book._as_dict())
+
+ def test_write(self):
+
+ builder = books.MallocMessageBuilder()
+ book = builder.init_root(books.Book)
+ book.title = self.BOOK['title']
+ book.authors = self.BOOK['authors']
+
+ for read_cls, write_func in [
+ ('StreamFdMessageReader', 'write_to'),
+ ('PackedFdMessageReader', 'write_packed_to')]:
+
+ with self.subTest(read_cls=read_cls, write_func=write_func):
+ fd, path = tempfile.mkstemp()
+ try:
+ getattr(builder, write_func)(fd)
+ os.close(fd)
+
+ fd = os.open(path, os.O_RDONLY)
+ reader = getattr(books, read_cls)(fd)
+ book = reader.get_root(books.Book)
+ self.assertEqual(self.BOOK, book._as_dict())
+
+ finally:
+ os.unlink(path)
+ os.close(fd)
if __name__ == '__main__':
unittest.main() | 59 | 1.787879 | 41 | 18 |
ba3d6d82bfffa40b8aadbb3d18e41be81f61f162 | Package.swift | Package.swift | import PackageDescription
let package = Package(
name: "AdminPanelProvider",
dependencies: [
// Vapor
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/leaf-provider.git", majorVersion: 1),
.Package(url: "https://github.com/vapor/mysql-provider.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/auth-provider.git", majorVersion: 1),
// Nodes
.Package(url: "https://github.com/nodes-vapor/flash.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/slugify.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/storage.git", majorVersion: 0, minor: 4),
.Package(url: "https://github.com/nodes-vapor/paginator.git", majorVersion: 2, minor: 0),
.Package(url: "https://github.com/nodes-vapor/audit-provider.git", majorVersion: 0, minor: 1),
]
)
| import PackageDescription
let package = Package(
name: "AdminPanelProvider",
dependencies: [
// Vapor
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/leaf-provider.git", majorVersion: 1),
.Package(url: "https://github.com/vapor/auth-provider.git", majorVersion: 1),
// Nodes
.Package(url: "https://github.com/nodes-vapor/flash.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/slugify.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/storage.git", majorVersion: 0, minor: 4),
.Package(url: "https://github.com/nodes-vapor/paginator.git", majorVersion: 2, minor: 0),
.Package(url: "https://github.com/nodes-vapor/audit-provider.git", majorVersion: 0, minor: 1),
]
)
| Remove mysql as a dependency | Remove mysql as a dependency
| Swift | mit | nodes-vapor/admin-panel-provider,nodes-vapor/admin-panel-provider,nodes-vapor/admin-panel-provider | swift | ## Code Before:
import PackageDescription
let package = Package(
name: "AdminPanelProvider",
dependencies: [
// Vapor
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/leaf-provider.git", majorVersion: 1),
.Package(url: "https://github.com/vapor/mysql-provider.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/auth-provider.git", majorVersion: 1),
// Nodes
.Package(url: "https://github.com/nodes-vapor/flash.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/slugify.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/storage.git", majorVersion: 0, minor: 4),
.Package(url: "https://github.com/nodes-vapor/paginator.git", majorVersion: 2, minor: 0),
.Package(url: "https://github.com/nodes-vapor/audit-provider.git", majorVersion: 0, minor: 1),
]
)
## Instruction:
Remove mysql as a dependency
## Code After:
import PackageDescription
let package = Package(
name: "AdminPanelProvider",
dependencies: [
// Vapor
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/leaf-provider.git", majorVersion: 1),
.Package(url: "https://github.com/vapor/auth-provider.git", majorVersion: 1),
// Nodes
.Package(url: "https://github.com/nodes-vapor/flash.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/slugify.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/storage.git", majorVersion: 0, minor: 4),
.Package(url: "https://github.com/nodes-vapor/paginator.git", majorVersion: 2, minor: 0),
.Package(url: "https://github.com/nodes-vapor/audit-provider.git", majorVersion: 0, minor: 1),
]
)
| import PackageDescription
let package = Package(
name: "AdminPanelProvider",
dependencies: [
// Vapor
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/leaf-provider.git", majorVersion: 1),
- .Package(url: "https://github.com/vapor/mysql-provider.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/auth-provider.git", majorVersion: 1),
// Nodes
.Package(url: "https://github.com/nodes-vapor/flash.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/slugify.git", majorVersion: 1),
.Package(url: "https://github.com/nodes-vapor/storage.git", majorVersion: 0, minor: 4),
.Package(url: "https://github.com/nodes-vapor/paginator.git", majorVersion: 2, minor: 0),
.Package(url: "https://github.com/nodes-vapor/audit-provider.git", majorVersion: 0, minor: 1),
]
) | 1 | 0.052632 | 0 | 1 |
f0e67be6c94d4e53843087ff9d39ca666b6435b6 | README.md | README.md |

## Welcome to the educational RNA-seq wiki!
* Do you want to learn how to align RNA-sequences to a reference genome?
* Do you want to bypass the process of installing alignment software and get a preview into a panel of different alignment strategies?
* Do you want to compare how popular mapping algorithms perform on your data?
#### Then this is the tutorial for you! [Please proceed to our wiki](https://github.com/DCGenomics/ngs_education_hackathon_v002/wiki)
|

## Welcome to the educational RNA-seq wiki!
* Do you want to learn how to align RNA-sequences to a reference genome?
* Do you want to bypass the process of installing alignment software and get a preview into a panel of different alignment strategies?
* Do you want to compare how popular mapping algorithms perform on your data?
#### Then this is the tutorial for you! [Please proceed to our wiki](https://github.com/DCGenomics/ngs_education_hackathon_v002/wiki)
| Change source of logo from afdennis to DCGenomics | Change source of logo from afdennis to DCGenomics | Markdown | cc0-1.0 | DCGenomics/ngs_education_hackathon_v002,DCGenomics/ngs_education_hackathon_v002,DCGenomics/ngs_education_hackathon_v002 | markdown | ## Code Before:

## Welcome to the educational RNA-seq wiki!
* Do you want to learn how to align RNA-sequences to a reference genome?
* Do you want to bypass the process of installing alignment software and get a preview into a panel of different alignment strategies?
* Do you want to compare how popular mapping algorithms perform on your data?
#### Then this is the tutorial for you! [Please proceed to our wiki](https://github.com/DCGenomics/ngs_education_hackathon_v002/wiki)
## Instruction:
Change source of logo from afdennis to DCGenomics
## Code After:

## Welcome to the educational RNA-seq wiki!
* Do you want to learn how to align RNA-sequences to a reference genome?
* Do you want to bypass the process of installing alignment software and get a preview into a panel of different alignment strategies?
* Do you want to compare how popular mapping algorithms perform on your data?
#### Then this is the tutorial for you! [Please proceed to our wiki](https://github.com/DCGenomics/ngs_education_hackathon_v002/wiki)
|
- 
+ 
## Welcome to the educational RNA-seq wiki!
* Do you want to learn how to align RNA-sequences to a reference genome?
* Do you want to bypass the process of installing alignment software and get a preview into a panel of different alignment strategies?
* Do you want to compare how popular mapping algorithms perform on your data?
#### Then this is the tutorial for you! [Please proceed to our wiki](https://github.com/DCGenomics/ngs_education_hackathon_v002/wiki)
| 2 | 0.133333 | 1 | 1 |
3100acc2ac5d4c1d11ae84ff01c4ff9de8fef8c2 | README.rst | README.rst | CLiC Project
============
Web application for the CLiC Dickens project http://clic.bham.ac.uk
How to cite the CLiC web application?
=====================================
Please cite CLiC as follows:
Johan de Joode, Catherine Smith, Rein Sikveland, Matthew B. O'Donnell. 2016. CLiC: A web application for corpus stylistics. Available at http://clic.bham.ac.uk. http://dx.doi.org/[use DOI number mentioned above]
Docs
====
For the docs, read the docs folder in this repository.
License
=======
MIT. For more information, cf. the LICENSE.
| CLiC Project
============
Web application for the CLiC Dickens project http://clic.bham.ac.uk
How to cite the CLiC web application?
=====================================
Please cite CLiC as follows:
Johan de Joode, Catherine Smith, Rein Sikveland, Matthew B. O'Donnell. 2016. CLiC: A web application for corpus stylistics. http://dx.doi.org/[use DOI number mentioned above]
Docs
====
For the docs, read the docs folder in this repository.
License
=======
MIT. For more information, cf. the LICENSE.
| Delete link that could change | Delete link that could change
| reStructuredText | mit | CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic | restructuredtext | ## Code Before:
CLiC Project
============
Web application for the CLiC Dickens project http://clic.bham.ac.uk
How to cite the CLiC web application?
=====================================
Please cite CLiC as follows:
Johan de Joode, Catherine Smith, Rein Sikveland, Matthew B. O'Donnell. 2016. CLiC: A web application for corpus stylistics. Available at http://clic.bham.ac.uk. http://dx.doi.org/[use DOI number mentioned above]
Docs
====
For the docs, read the docs folder in this repository.
License
=======
MIT. For more information, cf. the LICENSE.
## Instruction:
Delete link that could change
## Code After:
CLiC Project
============
Web application for the CLiC Dickens project http://clic.bham.ac.uk
How to cite the CLiC web application?
=====================================
Please cite CLiC as follows:
Johan de Joode, Catherine Smith, Rein Sikveland, Matthew B. O'Donnell. 2016. CLiC: A web application for corpus stylistics. http://dx.doi.org/[use DOI number mentioned above]
Docs
====
For the docs, read the docs folder in this repository.
License
=======
MIT. For more information, cf. the LICENSE.
| CLiC Project
============
Web application for the CLiC Dickens project http://clic.bham.ac.uk
How to cite the CLiC web application?
=====================================
Please cite CLiC as follows:
- Johan de Joode, Catherine Smith, Rein Sikveland, Matthew B. O'Donnell. 2016. CLiC: A web application for corpus stylistics. Available at http://clic.bham.ac.uk. http://dx.doi.org/[use DOI number mentioned above]
? --------------------------------------
+ Johan de Joode, Catherine Smith, Rein Sikveland, Matthew B. O'Donnell. 2016. CLiC: A web application for corpus stylistics. http://dx.doi.org/[use DOI number mentioned above]
Docs
====
For the docs, read the docs folder in this repository.
License
=======
MIT. For more information, cf. the LICENSE. | 2 | 0.086957 | 1 | 1 |
d7e8bfac48e5b142348cd503f39387e9d88a3b85 | lib/gitlab/background_migration/migrate_stage_index.rb | lib/gitlab/background_migration/migrate_stage_index.rb |
module Gitlab
module BackgroundMigration
class MigrateStageIndex
module Migratable
class Stage < ActiveRecord::Base
self.table_name = 'ci_stages'
end
end
def perform(start_id, stop_id)
if Gitlab::Database.postgresql?
sql = <<~SQL
WITH freqs AS (
SELECT stage_id, stage_idx, COUNT(*) AS freq FROM ci_builds
WHERE stage_id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
AND stage_idx IS NOT NULL
GROUP BY stage_id, stage_idx
), indexes AS (
SELECT DISTINCT stage_id, last_value(stage_idx)
OVER (PARTITION BY stage_id ORDER BY freq ASC) AS index
FROM freqs
)
UPDATE ci_stages SET index = indexes.index
FROM indexes WHERE indexes.stage_id = ci_stages.id
AND ci_stages.index IS NULL;
SQL
else
sql = <<~SQL
UPDATE ci_stages
SET index =
(SELECT stage_idx FROM ci_builds
WHERE ci_builds.stage_id = ci_stages.id
GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1)
WHERE ci_stages.id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
AND ci_stages.index IS NULL
SQL
end
ActiveRecord::Base.connection.execute(sql)
end
end
end
end
|
module Gitlab
module BackgroundMigration
class MigrateStageIndex
def perform(start_id, stop_id)
migrate_stage_index_sql(start_id.to_i, stop_id.to_i).tap do |sql|
ActiveRecord::Base.connection.execute(sql)
end
end
private
def migrate_stage_index_sql(start_id, stop_id)
if Gitlab::Database.postgresql?
<<~SQL
WITH freqs AS (
SELECT stage_id, stage_idx, COUNT(*) AS freq FROM ci_builds
WHERE stage_id BETWEEN #{start_id} AND #{stop_id}
AND stage_idx IS NOT NULL
GROUP BY stage_id, stage_idx
), indexes AS (
SELECT DISTINCT stage_id, last_value(stage_idx)
OVER (PARTITION BY stage_id ORDER BY freq ASC) AS index
FROM freqs
)
UPDATE ci_stages SET index = indexes.index
FROM indexes WHERE indexes.stage_id = ci_stages.id
AND ci_stages.index IS NULL;
SQL
else
<<~SQL
UPDATE ci_stages
SET index =
(SELECT stage_idx FROM ci_builds
WHERE ci_builds.stage_id = ci_stages.id
GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1)
WHERE ci_stages.id BETWEEN #{start_id} AND #{stop_id}
AND ci_stages.index IS NULL
SQL
end
end
end
end
end
| Improve stages index migration code readability | Improve stages index migration code readability
| Ruby | mit | mmkassem/gitlabhq,dreampet/gitlab,dreampet/gitlab,jirutka/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,iiet/iiet-git,axilleas/gitlabhq,stoplightio/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,axilleas/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,jirutka/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,dreampet/gitlab | ruby | ## Code Before:
module Gitlab
module BackgroundMigration
class MigrateStageIndex
module Migratable
class Stage < ActiveRecord::Base
self.table_name = 'ci_stages'
end
end
def perform(start_id, stop_id)
if Gitlab::Database.postgresql?
sql = <<~SQL
WITH freqs AS (
SELECT stage_id, stage_idx, COUNT(*) AS freq FROM ci_builds
WHERE stage_id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
AND stage_idx IS NOT NULL
GROUP BY stage_id, stage_idx
), indexes AS (
SELECT DISTINCT stage_id, last_value(stage_idx)
OVER (PARTITION BY stage_id ORDER BY freq ASC) AS index
FROM freqs
)
UPDATE ci_stages SET index = indexes.index
FROM indexes WHERE indexes.stage_id = ci_stages.id
AND ci_stages.index IS NULL;
SQL
else
sql = <<~SQL
UPDATE ci_stages
SET index =
(SELECT stage_idx FROM ci_builds
WHERE ci_builds.stage_id = ci_stages.id
GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1)
WHERE ci_stages.id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
AND ci_stages.index IS NULL
SQL
end
ActiveRecord::Base.connection.execute(sql)
end
end
end
end
## Instruction:
Improve stages index migration code readability
## Code After:
module Gitlab
module BackgroundMigration
class MigrateStageIndex
def perform(start_id, stop_id)
migrate_stage_index_sql(start_id.to_i, stop_id.to_i).tap do |sql|
ActiveRecord::Base.connection.execute(sql)
end
end
private
def migrate_stage_index_sql(start_id, stop_id)
if Gitlab::Database.postgresql?
<<~SQL
WITH freqs AS (
SELECT stage_id, stage_idx, COUNT(*) AS freq FROM ci_builds
WHERE stage_id BETWEEN #{start_id} AND #{stop_id}
AND stage_idx IS NOT NULL
GROUP BY stage_id, stage_idx
), indexes AS (
SELECT DISTINCT stage_id, last_value(stage_idx)
OVER (PARTITION BY stage_id ORDER BY freq ASC) AS index
FROM freqs
)
UPDATE ci_stages SET index = indexes.index
FROM indexes WHERE indexes.stage_id = ci_stages.id
AND ci_stages.index IS NULL;
SQL
else
<<~SQL
UPDATE ci_stages
SET index =
(SELECT stage_idx FROM ci_builds
WHERE ci_builds.stage_id = ci_stages.id
GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1)
WHERE ci_stages.id BETWEEN #{start_id} AND #{stop_id}
AND ci_stages.index IS NULL
SQL
end
end
end
end
end
|
module Gitlab
module BackgroundMigration
class MigrateStageIndex
- module Migratable
- class Stage < ActiveRecord::Base
- self.table_name = 'ci_stages'
+ def perform(start_id, stop_id)
+ migrate_stage_index_sql(start_id.to_i, stop_id.to_i).tap do |sql|
+ ActiveRecord::Base.connection.execute(sql)
end
end
- def perform(start_id, stop_id)
+ private
+
+ def migrate_stage_index_sql(start_id, stop_id)
if Gitlab::Database.postgresql?
- sql = <<~SQL
? ------
+ <<~SQL
WITH freqs AS (
SELECT stage_id, stage_idx, COUNT(*) AS freq FROM ci_builds
- WHERE stage_id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
? ----- -----
+ WHERE stage_id BETWEEN #{start_id} AND #{stop_id}
AND stage_idx IS NOT NULL
GROUP BY stage_id, stage_idx
), indexes AS (
SELECT DISTINCT stage_id, last_value(stage_idx)
OVER (PARTITION BY stage_id ORDER BY freq ASC) AS index
FROM freqs
)
UPDATE ci_stages SET index = indexes.index
FROM indexes WHERE indexes.stage_id = ci_stages.id
AND ci_stages.index IS NULL;
SQL
else
- sql = <<~SQL
? ------
+ <<~SQL
UPDATE ci_stages
SET index =
(SELECT stage_idx FROM ci_builds
WHERE ci_builds.stage_id = ci_stages.id
GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1)
- WHERE ci_stages.id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
? ----- -----
+ WHERE ci_stages.id BETWEEN #{start_id} AND #{stop_id}
AND ci_stages.index IS NULL
SQL
end
-
- ActiveRecord::Base.connection.execute(sql)
end
end
end
end | 20 | 0.444444 | 10 | 10 |
1a0acbf2af322e0c5b56eb9beccaecd83752551f | circle.yml | circle.yml | machine:
timezone:
America/Los_Angeles
environment:
PYTHONPATH: /home/ubuntu/ISB-CGC-Webapp:/home/ubuntu/ISB-CGC-Webapp/lib
python:
version: 2.7.10
dependencies:
override:
- sudo -E /bin/sh ./shell/install-deps.sh
database:
post:
- mysql -u ubuntu -e "USE mysql; SET PASSWORD FOR 'ubuntu'@'localhost' = PASSWORD('isb')"
- sudo -E /bin/sh ./shell/database-setup.sh
deployment:
staging:
branch: [master]
commands:
- sudo -E rm -rf ./lib
- sudo -E /bin/sh ./shell/gcloud_authenticate.sh
- sudo -E /bin/sh ./shell/gcloud-pull-staging-files.sh
- sudo -E ./google-cloud-sdk/bin/gcloud preview app deploy --verbosity debug app.yaml cron.yaml queue.yaml --promote | machine:
timezone:
America/Los_Angeles
environment:
PYTHONPATH: /home/ubuntu/ISB-CGC-Webapp:/home/ubuntu/ISB-CGC-Webapp/lib
python:
version: 2.7.10
dependencies:
override:
- sudo -E /bin/sh ./shell/install-deps.sh
database:
post:
- mysql -u ubuntu -e "USE mysql; SET PASSWORD FOR 'ubuntu'@'localhost' = PASSWORD('isb')"
- sudo -E /bin/sh ./shell/database-setup.sh
deployment:
staging:
branch: [master]
commands:
- sudo -E rm -rf ./lib
- sudo -E /bin/sh ./shell/gcloud_authenticate.sh
- sudo -E /bin/sh ./shell/gcloud-pull-staging-files.sh
- sudo -E ./google-cloud-sdk/bin/gcloud preview app deploy app.yaml cron.yaml queue.yaml --promote | Remove verbosity from deployment command | Remove verbosity from deployment command
| YAML | apache-2.0 | isb-cgc/ISB-CGC-Webapp,isb-cgc/ISB-CGC-Webapp,isb-cgc/ISB-CGC-Webapp,isb-cgc/ISB-CGC-Webapp | yaml | ## Code Before:
machine:
timezone:
America/Los_Angeles
environment:
PYTHONPATH: /home/ubuntu/ISB-CGC-Webapp:/home/ubuntu/ISB-CGC-Webapp/lib
python:
version: 2.7.10
dependencies:
override:
- sudo -E /bin/sh ./shell/install-deps.sh
database:
post:
- mysql -u ubuntu -e "USE mysql; SET PASSWORD FOR 'ubuntu'@'localhost' = PASSWORD('isb')"
- sudo -E /bin/sh ./shell/database-setup.sh
deployment:
staging:
branch: [master]
commands:
- sudo -E rm -rf ./lib
- sudo -E /bin/sh ./shell/gcloud_authenticate.sh
- sudo -E /bin/sh ./shell/gcloud-pull-staging-files.sh
- sudo -E ./google-cloud-sdk/bin/gcloud preview app deploy --verbosity debug app.yaml cron.yaml queue.yaml --promote
## Instruction:
Remove verbosity from deployment command
## Code After:
machine:
timezone:
America/Los_Angeles
environment:
PYTHONPATH: /home/ubuntu/ISB-CGC-Webapp:/home/ubuntu/ISB-CGC-Webapp/lib
python:
version: 2.7.10
dependencies:
override:
- sudo -E /bin/sh ./shell/install-deps.sh
database:
post:
- mysql -u ubuntu -e "USE mysql; SET PASSWORD FOR 'ubuntu'@'localhost' = PASSWORD('isb')"
- sudo -E /bin/sh ./shell/database-setup.sh
deployment:
staging:
branch: [master]
commands:
- sudo -E rm -rf ./lib
- sudo -E /bin/sh ./shell/gcloud_authenticate.sh
- sudo -E /bin/sh ./shell/gcloud-pull-staging-files.sh
- sudo -E ./google-cloud-sdk/bin/gcloud preview app deploy app.yaml cron.yaml queue.yaml --promote | machine:
timezone:
America/Los_Angeles
environment:
PYTHONPATH: /home/ubuntu/ISB-CGC-Webapp:/home/ubuntu/ISB-CGC-Webapp/lib
python:
version: 2.7.10
dependencies:
override:
- sudo -E /bin/sh ./shell/install-deps.sh
database:
post:
- mysql -u ubuntu -e "USE mysql; SET PASSWORD FOR 'ubuntu'@'localhost' = PASSWORD('isb')"
- sudo -E /bin/sh ./shell/database-setup.sh
deployment:
staging:
branch: [master]
commands:
- sudo -E rm -rf ./lib
- sudo -E /bin/sh ./shell/gcloud_authenticate.sh
- sudo -E /bin/sh ./shell/gcloud-pull-staging-files.sh
- - sudo -E ./google-cloud-sdk/bin/gcloud preview app deploy --verbosity debug app.yaml cron.yaml queue.yaml --promote
? ------------------
+ - sudo -E ./google-cloud-sdk/bin/gcloud preview app deploy app.yaml cron.yaml queue.yaml --promote | 2 | 0.090909 | 1 | 1 |
13736da41e2c75d275e8f752926c11dbb81249a8 | app/index.js | app/index.js | // New Relic Server monitoring support
if ( process.env.NEW_RELIC_ENABLED ) {
require( "newrelic" );
}
const restify = require('restify');
const applyRoutes = require('./routes');
const logger = require('./lib/logger')
const middleware = require('./lib/middleware')
const package = require('../package')
const server = restify.createServer({
name: 'openbadger',
version: package.version,
log: logger,
});
server.pre(restify.pre.sanitizePath());
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser({mapParams: false}));
server.use(restify.bodyParser({mapParams: false, rejectUnknown: true}));
server.use(middleware.verifyRequest())
server.use(middleware.attachResolvePath())
server.use(middleware.attachErrorLogger())
applyRoutes(server);
module.exports = server;
if (!module.parent) {
server.listen(process.env.PORT || 8080, function () {
console.log('%s listening at %s', server.name, server.url);
});
}
| // New Relic Server monitoring support
if ( process.env.NEW_RELIC_ENABLED ) {
require( "newrelic" );
}
const restify = require('restify');
const applyRoutes = require('./routes');
const logger = require('./lib/logger')
const middleware = require('./lib/middleware')
const package = require('../package')
const server = restify.createServer({
name: package.name,
version: package.version,
log: logger,
});
server.pre(restify.pre.sanitizePath());
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser({mapParams: false}));
server.use(restify.bodyParser({mapParams: false, rejectUnknown: true}));
server.use(middleware.verifyRequest())
server.use(middleware.attachResolvePath())
server.use(middleware.attachErrorLogger())
applyRoutes(server);
module.exports = server;
if (!module.parent) {
server.listen(process.env.PORT || 8080, function () {
console.log('%s listening at %s', server.name, server.url);
});
}
| Use `package.name` in the app definition. | Use `package.name` in the app definition.
| JavaScript | mpl-2.0 | friedger/badgekit-api,acabunoc/badgekit-api,mozilla/badgekit-api | javascript | ## Code Before:
// New Relic Server monitoring support
if ( process.env.NEW_RELIC_ENABLED ) {
require( "newrelic" );
}
const restify = require('restify');
const applyRoutes = require('./routes');
const logger = require('./lib/logger')
const middleware = require('./lib/middleware')
const package = require('../package')
const server = restify.createServer({
name: 'openbadger',
version: package.version,
log: logger,
});
server.pre(restify.pre.sanitizePath());
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser({mapParams: false}));
server.use(restify.bodyParser({mapParams: false, rejectUnknown: true}));
server.use(middleware.verifyRequest())
server.use(middleware.attachResolvePath())
server.use(middleware.attachErrorLogger())
applyRoutes(server);
module.exports = server;
if (!module.parent) {
server.listen(process.env.PORT || 8080, function () {
console.log('%s listening at %s', server.name, server.url);
});
}
## Instruction:
Use `package.name` in the app definition.
## Code After:
// New Relic Server monitoring support
if ( process.env.NEW_RELIC_ENABLED ) {
require( "newrelic" );
}
const restify = require('restify');
const applyRoutes = require('./routes');
const logger = require('./lib/logger')
const middleware = require('./lib/middleware')
const package = require('../package')
const server = restify.createServer({
name: package.name,
version: package.version,
log: logger,
});
server.pre(restify.pre.sanitizePath());
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser({mapParams: false}));
server.use(restify.bodyParser({mapParams: false, rejectUnknown: true}));
server.use(middleware.verifyRequest())
server.use(middleware.attachResolvePath())
server.use(middleware.attachErrorLogger())
applyRoutes(server);
module.exports = server;
if (!module.parent) {
server.listen(process.env.PORT || 8080, function () {
console.log('%s listening at %s', server.name, server.url);
});
}
| // New Relic Server monitoring support
if ( process.env.NEW_RELIC_ENABLED ) {
require( "newrelic" );
}
const restify = require('restify');
const applyRoutes = require('./routes');
const logger = require('./lib/logger')
const middleware = require('./lib/middleware')
const package = require('../package')
const server = restify.createServer({
- name: 'openbadger',
+ name: package.name,
version: package.version,
log: logger,
});
server.pre(restify.pre.sanitizePath());
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser({mapParams: false}));
server.use(restify.bodyParser({mapParams: false, rejectUnknown: true}));
server.use(middleware.verifyRequest())
server.use(middleware.attachResolvePath())
server.use(middleware.attachErrorLogger())
applyRoutes(server);
module.exports = server;
if (!module.parent) {
server.listen(process.env.PORT || 8080, function () {
console.log('%s listening at %s', server.name, server.url);
});
} | 2 | 0.058824 | 1 | 1 |
6921dcf66a084af3f5ebadb7191ed335bd07b207 | .github/workflows/web.yml | .github/workflows/web.yml | name: Python package
on: [push, pull_request]
jobs:
django:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.6
- 3.7
django:
- "==2.1.*"
- "==2.2.*"
steps:
- uses: actions/checkout@v1
- name: Start database early
run: docker-compose up -d db
- name: Build application
run: make build
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO_VERSION: ${{ matrix.django }}
- name: Lint
run: make lint
- name: Migration check
run: make check
- name: Show settings
run: make settings
- name: Run unit tests
run: make test
- name: Run e2e tests
run: make e2e
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build application
run: make build
- name: Build documentation
run: make docs
| name: Python package
on: [push, pull_request]
jobs:
django:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.6
- 3.7
django:
- "==2.2.*"
steps:
- uses: actions/checkout@v1
- name: Start database early
run: docker-compose up -d db
- name: Build application
run: make build
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO_VERSION: ${{ matrix.django }}
- name: Lint
run: make lint
- name: Migration check
run: make check
- name: Show settings
run: make settings
- name: Run unit tests
run: make test
- name: Run e2e tests
run: make e2e
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build application
run: make build
- name: Build documentation
run: make docs
| Drop django 2.1 version from CI | Drop django 2.1 version from CI | YAML | mit | watchdogpolska/poradnia,rwakulszowa/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia,rwakulszowa/poradnia,rwakulszowa/poradnia | yaml | ## Code Before:
name: Python package
on: [push, pull_request]
jobs:
django:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.6
- 3.7
django:
- "==2.1.*"
- "==2.2.*"
steps:
- uses: actions/checkout@v1
- name: Start database early
run: docker-compose up -d db
- name: Build application
run: make build
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO_VERSION: ${{ matrix.django }}
- name: Lint
run: make lint
- name: Migration check
run: make check
- name: Show settings
run: make settings
- name: Run unit tests
run: make test
- name: Run e2e tests
run: make e2e
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build application
run: make build
- name: Build documentation
run: make docs
## Instruction:
Drop django 2.1 version from CI
## Code After:
name: Python package
on: [push, pull_request]
jobs:
django:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.6
- 3.7
django:
- "==2.2.*"
steps:
- uses: actions/checkout@v1
- name: Start database early
run: docker-compose up -d db
- name: Build application
run: make build
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO_VERSION: ${{ matrix.django }}
- name: Lint
run: make lint
- name: Migration check
run: make check
- name: Show settings
run: make settings
- name: Run unit tests
run: make test
- name: Run e2e tests
run: make e2e
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build application
run: make build
- name: Build documentation
run: make docs
| name: Python package
on: [push, pull_request]
jobs:
django:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.6
- 3.7
django:
- - "==2.1.*"
- "==2.2.*"
steps:
- uses: actions/checkout@v1
- name: Start database early
run: docker-compose up -d db
- name: Build application
run: make build
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO_VERSION: ${{ matrix.django }}
- name: Lint
run: make lint
- name: Migration check
run: make check
- name: Show settings
run: make settings
- name: Run unit tests
run: make test
- name: Run e2e tests
run: make e2e
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build application
run: make build
- name: Build documentation
run: make docs | 1 | 0.022727 | 0 | 1 |
b0afa20189ba24edebd154a1245331096db4d0ce | lib/tasks/taxonomy_event_log.rake | lib/tasks/taxonomy_event_log.rake | task taxonomy_event_log: [:environment] do
events = TaxonomyEventLog.new.export
file = CSV.generate(headers: true) do |csv|
csv << events.first.keys
events.each do |event|
csv << event.values
end
end
puts file
end
| desc "Export the taxonomy event log"
task taxonomy_event_log: [:environment] do
events = TaxonomyEventLog.new.export
file = CSV.generate(headers: true) do |csv|
csv << events.first.keys
events.each do |event|
csv << event.values
end
end
puts file
end
| Add description for export taxonomy rake task | Add description for export taxonomy rake task
| Ruby | mit | alphagov/publishing-api,alphagov/publishing-api | ruby | ## Code Before:
task taxonomy_event_log: [:environment] do
events = TaxonomyEventLog.new.export
file = CSV.generate(headers: true) do |csv|
csv << events.first.keys
events.each do |event|
csv << event.values
end
end
puts file
end
## Instruction:
Add description for export taxonomy rake task
## Code After:
desc "Export the taxonomy event log"
task taxonomy_event_log: [:environment] do
events = TaxonomyEventLog.new.export
file = CSV.generate(headers: true) do |csv|
csv << events.first.keys
events.each do |event|
csv << event.values
end
end
puts file
end
| + desc "Export the taxonomy event log"
task taxonomy_event_log: [:environment] do
events = TaxonomyEventLog.new.export
file = CSV.generate(headers: true) do |csv|
csv << events.first.keys
events.each do |event|
csv << event.values
end
end
puts file
end | 1 | 0.076923 | 1 | 0 |
9036e6fb82174f8fae0ef280efe32f20cf9c38d2 | docs/index.rst | docs/index.rst | .. include:: common.inc
.. toctree::
:hidden:
contributing
code-of-conduct
status
known_issues
versioning
Welcome to SkyWater SKY130 PDK's documentation!
===============================================
.. warning::
This documentation is currently a **work in progress**.
.. _CurrentStatus:
Current Status - |current-status|
=================================
.. include:: status.rst
:start-after: current_status_text
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| .. include:: common.inc
.. toctree::
:hidden:
contributing
code-of-conduct
Current Status <status>
known_issues
versioning
Welcome to SkyWater SKY130 PDK's documentation!
===============================================
.. warning::
This documentation is currently a **work in progress**.
.. _CurrentStatus:
Current Status - |current-status|
=================================
.. include:: status.rst
:start-after: current_status_text
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| Improve the current status heading. | docs: Improve the current status heading.
Signed-off-by: Tim 'mithro' Ansell <f857bf86f3aed4a1021a5247bd2399c65b7ad5cd@google.com>
| reStructuredText | apache-2.0 | google/skywater-pdk | restructuredtext | ## Code Before:
.. include:: common.inc
.. toctree::
:hidden:
contributing
code-of-conduct
status
known_issues
versioning
Welcome to SkyWater SKY130 PDK's documentation!
===============================================
.. warning::
This documentation is currently a **work in progress**.
.. _CurrentStatus:
Current Status - |current-status|
=================================
.. include:: status.rst
:start-after: current_status_text
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
## Instruction:
docs: Improve the current status heading.
Signed-off-by: Tim 'mithro' Ansell <f857bf86f3aed4a1021a5247bd2399c65b7ad5cd@google.com>
## Code After:
.. include:: common.inc
.. toctree::
:hidden:
contributing
code-of-conduct
Current Status <status>
known_issues
versioning
Welcome to SkyWater SKY130 PDK's documentation!
===============================================
.. warning::
This documentation is currently a **work in progress**.
.. _CurrentStatus:
Current Status - |current-status|
=================================
.. include:: status.rst
:start-after: current_status_text
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| .. include:: common.inc
.. toctree::
:hidden:
contributing
code-of-conduct
- status
+ Current Status <status>
known_issues
versioning
Welcome to SkyWater SKY130 PDK's documentation!
===============================================
.. warning::
This documentation is currently a **work in progress**.
.. _CurrentStatus:
Current Status - |current-status|
=================================
.. include:: status.rst
:start-after: current_status_text
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search` | 2 | 0.057143 | 1 | 1 |
f486896cc3a3bf17b5c64059b76564e17dd32999 | .travis.yml | .travis.yml | branches:
only:
- master
language: go
go:
- 1.4
- 1.5
- tip
before_install:
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/mattn/goveralls
- export GOPATH=$PWD/ltc/Godeps/_workspace:$GOPATH
- export PATH=$HOME/gopath/bin:$PATH
script:
- ginkgo -r --race --randomizeAllSpecs --failOnPending --skipMeasurements --cover ltc cell-helpers
- test -z "$(go fmt ./ltc/... ./cell-helpers/...)"
after_success:
- 'echo "mode: set" > coverage.out'
- 'find ltc cell-helpers -name "*.coverprofile" -exec grep -v mode: {} >> coverage.out \;'
- goveralls -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
| branches:
only:
- master
language: go
go:
- 1.4
- 1.5
before_install:
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/mattn/goveralls
- export GOPATH=$PWD/ltc/Godeps/_workspace:$GOPATH
- export PATH=$HOME/gopath/bin:$PATH
script:
- ginkgo -r --randomizeAllSpecs --failOnPending --skipMeasurements --cover ltc cell-helpers
- test -z "$(go fmt ./ltc/... ./cell-helpers/...)"
after_success:
- 'echo "mode: set" > coverage.out'
- 'find ltc cell-helpers -name "*.coverprofile" -exec grep -v mode: {} >> coverage.out \;'
- goveralls -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
| Remove data race detection on Travis due to flakey specs | Remove data race detection on Travis due to flakey specs
[#103111308]
Signed-off-by: Stephen Levine <72d5489bdb659bea8b15ba0173fe796f11329883@pivotal.io>
| YAML | apache-2.0 | datachand/lattice,Klaudit/lattice,davidwadden/lattice,davidwadden/lattice-release,svrc-pivotal/lattice,SrinivasChilveri/lattice,datachand/lattice,SrinivasChilveri/lattice,Klaudit/lattice,davidwadden/lattice-release,davidwadden/lattice,felipeg48/lattice,svrc-pivotal/lattice,svrc-pivotal/lattice,svrc-pivotal/lattice,datachand/lattice,SrinivasChilveri/lattice,felipeg48/lattice,Klaudit/lattice,cloudfoundry-incubator/ltc,SrinivasChilveri/lattice,cloudfoundry-incubator/ltc,datachand/lattice,Klaudit/lattice | yaml | ## Code Before:
branches:
only:
- master
language: go
go:
- 1.4
- 1.5
- tip
before_install:
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/mattn/goveralls
- export GOPATH=$PWD/ltc/Godeps/_workspace:$GOPATH
- export PATH=$HOME/gopath/bin:$PATH
script:
- ginkgo -r --race --randomizeAllSpecs --failOnPending --skipMeasurements --cover ltc cell-helpers
- test -z "$(go fmt ./ltc/... ./cell-helpers/...)"
after_success:
- 'echo "mode: set" > coverage.out'
- 'find ltc cell-helpers -name "*.coverprofile" -exec grep -v mode: {} >> coverage.out \;'
- goveralls -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
## Instruction:
Remove data race detection on Travis due to flakey specs
[#103111308]
Signed-off-by: Stephen Levine <72d5489bdb659bea8b15ba0173fe796f11329883@pivotal.io>
## Code After:
branches:
only:
- master
language: go
go:
- 1.4
- 1.5
before_install:
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/mattn/goveralls
- export GOPATH=$PWD/ltc/Godeps/_workspace:$GOPATH
- export PATH=$HOME/gopath/bin:$PATH
script:
- ginkgo -r --randomizeAllSpecs --failOnPending --skipMeasurements --cover ltc cell-helpers
- test -z "$(go fmt ./ltc/... ./cell-helpers/...)"
after_success:
- 'echo "mode: set" > coverage.out'
- 'find ltc cell-helpers -name "*.coverprofile" -exec grep -v mode: {} >> coverage.out \;'
- goveralls -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
| branches:
only:
- master
language: go
go:
- 1.4
- 1.5
- - tip
before_install:
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/mattn/goveralls
- export GOPATH=$PWD/ltc/Godeps/_workspace:$GOPATH
- export PATH=$HOME/gopath/bin:$PATH
script:
- - ginkgo -r --race --randomizeAllSpecs --failOnPending --skipMeasurements --cover ltc cell-helpers
? -------
+ - ginkgo -r --randomizeAllSpecs --failOnPending --skipMeasurements --cover ltc cell-helpers
- test -z "$(go fmt ./ltc/... ./cell-helpers/...)"
after_success:
- 'echo "mode: set" > coverage.out'
- 'find ltc cell-helpers -name "*.coverprofile" -exec grep -v mode: {} >> coverage.out \;'
- goveralls -coverprofile=coverage.out -repotoken=$COVERALLS_TOKEN
| 3 | 0.115385 | 1 | 2 |
ad426b7d6914d2fa96e95f87fdf2267262c34731 | app/controllers/sms_controller.rb | app/controllers/sms_controller.rb | post '/send_sms' do
@user = User.find(session[:user_id])
reach = @user.reaches.find_by(main_reach: true)
to = reach.contact_phone
message = reach.text
p client = Twilio::REST::Client.new(
ENV["TWILIO_ACCOUNT_SID"],
ENV["TWILIO_AUTH_TOKEN"]
)
client.messages.create(
to: to,
from: "+16502001654",
body: message
)
redirect '/dashboard'
end
# post '/receive_sms' do
# content_type 'text/xml'
# response = Twilio::TwiML::Response.new do |r|
# r.Message "Thanks for messaging Reach. Please Reach out to #{session[:user:id]}"
# end
| post '/send_sms' do
@user = User.find(session[:user_id])
reach = @user.reaches.find_by(main_reach: true)
to = reach.contact_phone
message = reach.text + " -- sent by: " + @user.username + " via Reach"
p client = Twilio::REST::Client.new(
ENV["TWILIO_ACCOUNT_SID"],
ENV["TWILIO_AUTH_TOKEN"]
)
client.messages.create(
to: to,
from: "+16502001654",
body: message
)
redirect '/dashboard'
end
# post '/receive_sms' do
# content_type 'text/xml'
# response = Twilio::TwiML::Response.new do |r|
# r.Message "Thanks for messaging Reach. Please Reach out to #{session[:user:id]}"
# end
| Add sent by signature in text message | Add sent by signature in text message
| Ruby | mit | hypatiah/reach,hypatiah/reach,hypatiah/reach | ruby | ## Code Before:
post '/send_sms' do
@user = User.find(session[:user_id])
reach = @user.reaches.find_by(main_reach: true)
to = reach.contact_phone
message = reach.text
p client = Twilio::REST::Client.new(
ENV["TWILIO_ACCOUNT_SID"],
ENV["TWILIO_AUTH_TOKEN"]
)
client.messages.create(
to: to,
from: "+16502001654",
body: message
)
redirect '/dashboard'
end
# post '/receive_sms' do
# content_type 'text/xml'
# response = Twilio::TwiML::Response.new do |r|
# r.Message "Thanks for messaging Reach. Please Reach out to #{session[:user:id]}"
# end
## Instruction:
Add sent by signature in text message
## Code After:
post '/send_sms' do
@user = User.find(session[:user_id])
reach = @user.reaches.find_by(main_reach: true)
to = reach.contact_phone
message = reach.text + " -- sent by: " + @user.username + " via Reach"
p client = Twilio::REST::Client.new(
ENV["TWILIO_ACCOUNT_SID"],
ENV["TWILIO_AUTH_TOKEN"]
)
client.messages.create(
to: to,
from: "+16502001654",
body: message
)
redirect '/dashboard'
end
# post '/receive_sms' do
# content_type 'text/xml'
# response = Twilio::TwiML::Response.new do |r|
# r.Message "Thanks for messaging Reach. Please Reach out to #{session[:user:id]}"
# end
| post '/send_sms' do
@user = User.find(session[:user_id])
reach = @user.reaches.find_by(main_reach: true)
to = reach.contact_phone
- message = reach.text
+ message = reach.text + " -- sent by: " + @user.username + " via Reach"
p client = Twilio::REST::Client.new(
ENV["TWILIO_ACCOUNT_SID"],
ENV["TWILIO_AUTH_TOKEN"]
)
client.messages.create(
to: to,
from: "+16502001654",
body: message
)
redirect '/dashboard'
end
# post '/receive_sms' do
# content_type 'text/xml'
# response = Twilio::TwiML::Response.new do |r|
# r.Message "Thanks for messaging Reach. Please Reach out to #{session[:user:id]}"
# end | 2 | 0.090909 | 1 | 1 |
17305541fff8cdf2ad709f16ecb6db1dfed325ca | src/hyper-content-for.js | src/hyper-content-for.js | angular.module("hyperContentFor", [])
.value("HYPER_CONTENT_FOR_IDS", { })
.directive("hyperContent", function() {
return {
scope: { "for": "@" },
restrict: "E",
transclude: true,
controller: function($scope, $transclude, HYPER_CONTENT_FOR_IDS) {
HYPER_CONTENT_FOR_IDS[$scope["for"]] = $transclude();
}
};
})
.directive("hyperYield", function(HYPER_CONTENT_FOR_IDS) {
return {
scope: { to: "@" },
restrict: "E",
link: function(scope, elem) {
interval = null;
watchFn = function() { return HYPER_CONTENT_FOR_IDS[scope.to]; };
scope.$watch(watchFn, function(newValue) {
elem.empty();
elem.append(newValue);
});
}
};
});
| angular.module('hyperContentFor', [])
.value('HYPER_CONTENT_FOR_IDS', { })
.directive('hyperContent', function() {
return {
scope: { 'for': '@' },
restrict: 'E',
transclude: true,
controller: function($scope, $transclude, HYPER_CONTENT_FOR_IDS) {
HYPER_CONTENT_FOR_IDS[$scope['for']] = $transclude();
}
};
})
.directive('hyperYield', function(HYPER_CONTENT_FOR_IDS) {
return {
scope: { to: '@' },
restrict: 'E',
link: function(scope, elem) {
interval = null;
watchFn = function() { return HYPER_CONTENT_FOR_IDS[scope.to]; };
scope.$watch(watchFn, function(newValue) {
elem.empty();
elem.append(newValue);
});
}
};
});
| Swap out double quotes with single quotes | Swap out double quotes with single quotes
| JavaScript | mit | hyperoslo/hyper-content-for-angular,hyperoslo/hyper-content-for-angular | javascript | ## Code Before:
angular.module("hyperContentFor", [])
.value("HYPER_CONTENT_FOR_IDS", { })
.directive("hyperContent", function() {
return {
scope: { "for": "@" },
restrict: "E",
transclude: true,
controller: function($scope, $transclude, HYPER_CONTENT_FOR_IDS) {
HYPER_CONTENT_FOR_IDS[$scope["for"]] = $transclude();
}
};
})
.directive("hyperYield", function(HYPER_CONTENT_FOR_IDS) {
return {
scope: { to: "@" },
restrict: "E",
link: function(scope, elem) {
interval = null;
watchFn = function() { return HYPER_CONTENT_FOR_IDS[scope.to]; };
scope.$watch(watchFn, function(newValue) {
elem.empty();
elem.append(newValue);
});
}
};
});
## Instruction:
Swap out double quotes with single quotes
## Code After:
angular.module('hyperContentFor', [])
.value('HYPER_CONTENT_FOR_IDS', { })
.directive('hyperContent', function() {
return {
scope: { 'for': '@' },
restrict: 'E',
transclude: true,
controller: function($scope, $transclude, HYPER_CONTENT_FOR_IDS) {
HYPER_CONTENT_FOR_IDS[$scope['for']] = $transclude();
}
};
})
.directive('hyperYield', function(HYPER_CONTENT_FOR_IDS) {
return {
scope: { to: '@' },
restrict: 'E',
link: function(scope, elem) {
interval = null;
watchFn = function() { return HYPER_CONTENT_FOR_IDS[scope.to]; };
scope.$watch(watchFn, function(newValue) {
elem.empty();
elem.append(newValue);
});
}
};
});
| - angular.module("hyperContentFor", [])
? ^ ^
+ angular.module('hyperContentFor', [])
? ^ ^
- .value("HYPER_CONTENT_FOR_IDS", { })
? ^ ^
+ .value('HYPER_CONTENT_FOR_IDS', { })
? ^ ^
- .directive("hyperContent", function() {
? ^ ^
+ .directive('hyperContent', function() {
? ^ ^
return {
- scope: { "for": "@" },
? ^ ^ ^ ^
+ scope: { 'for': '@' },
? ^ ^ ^ ^
- restrict: "E",
? ^ ^
+ restrict: 'E',
? ^ ^
transclude: true,
controller: function($scope, $transclude, HYPER_CONTENT_FOR_IDS) {
- HYPER_CONTENT_FOR_IDS[$scope["for"]] = $transclude();
? ^ ^
+ HYPER_CONTENT_FOR_IDS[$scope['for']] = $transclude();
? ^ ^
}
};
})
- .directive("hyperYield", function(HYPER_CONTENT_FOR_IDS) {
? ^ ^
+ .directive('hyperYield', function(HYPER_CONTENT_FOR_IDS) {
? ^ ^
return {
- scope: { to: "@" },
? ^ ^
+ scope: { to: '@' },
? ^ ^
- restrict: "E",
? ^ ^
+ restrict: 'E',
? ^ ^
link: function(scope, elem) {
interval = null;
watchFn = function() { return HYPER_CONTENT_FOR_IDS[scope.to]; };
scope.$watch(watchFn, function(newValue) {
elem.empty();
elem.append(newValue);
});
}
};
}); | 18 | 0.514286 | 9 | 9 |
982a2c0891ba6efde5a8c805e3913ed0490ea295 | src/elements/button/button.js | src/elements/button/button.js | (function() {
'use strict';
angular
.module('semantic.ui.elements.button', [])
.directive('smButton', smButton);
function smButton() {
return {
restrict:'E',
replace: true,
transclude: true,
template: setTemplate,
link: function(scope, element, attrs, ctrl, transclude) {
var node = element[0];
transclude(function(nodes) {
element.append(nodes);
});
if (isAnchorBtn(attrs)) {
scope.$watch(attrs.ngDisabled, function(isDisabled) {
element.attr('tabindex', isDisabled ? -1 : 0);
if (isDisabled) {
element.addClass('disabled');
}
});
}
if (attrs.ariaLabel === void 0) {
element.attr('aria-label', node.textContent.trim());
}
scope.$watch(attrs.ngDisabled, function(isDisabled) {
if (isDisabled) {
element.addClass('disabled');
}
});
}
};
function isAnchorBtn(attrs) {
return attrs.href !== void 0 || attrs.ngHref !== void 0 || attrs.xlinkHref !== void 0;
}
function setTemplate(element, attrs) {
if (isAnchorBtn(attrs)) {
return '<a class="ui button"></a>';
} else {
return '<button class="ui button"></button>';
}
}
}
})();
| (function() {
'use strict';
angular
.module('semantic.ui.elements.button', [])
.directive('smButton', smButton);
smButton['$inject'] = ['$animate'];
function smButton($animate) {
return {
restrict:'E',
replace: true,
transclude: true,
template: setTemplate,
link: function(scope, element, attrs, ctrl, transclude) {
var node = element[0];
transclude(scope, function(nodes) {
element.append(nodes);
});
if (isAnchorBtn(attrs)) {
scope.$watch(attrs.ngDisabled, function(isDisabled) {
element.attr('tabindex', isDisabled ? -1 : 0);
if (isDisabled) {
$animate.addClass(element, 'disabled');
}
});
}
if (attrs.ariaLabel === void 0) {
element.attr('aria-label', node.textContent.trim());
}
scope.$watch(attrs.ngDisabled, function(isDisabled) {
if (isDisabled) {
$animate.addClass(element, 'disabled');
}
});
}
};
function isAnchorBtn(attrs) {
return attrs.href !== void 0 || attrs.ngHref !== void 0 || attrs.xlinkHref !== void 0;
}
function setTemplate(element, attrs) {
if (isAnchorBtn(attrs)) {
return '<a class="ui button"></a>';
} else {
return '<button class="ui button"></button>';
}
}
}
})();
| Use to manage css classes | refactor(smButton): Use to manage css classes
| JavaScript | mit | joseym/Semantic-UI-Angular,giftstarter/Semantic-UI-Angular,mxth/Semantic-UI-Angular,meisterpeeps/Semantic-UI-Angular,Semantic-Org/Semantic-UI-Angular,matheuspoleza/Semantic-UI-Angular,joseym/Semantic-UI-Angular,christiannwamba/Semantic-UI-Angular,marcoT89/Semantic-UI-Angular,giftstarter/Semantic-UI-Angular,codedogfish/Semantic-UI-Angular,HackedByChinese/Semantic-UI-Angular,meisterpeeps/Semantic-UI-Angular,marcoT89/Semantic-UI-Angular,jessicalc/Semantic-UI-Angular,christiannwamba/Semantic-UI-Angular,jessicalc/Semantic-UI-Angular,matheuspoleza/Semantic-UI-Angular,mxth/Semantic-UI-Angular,Semantic-Org/Semantic-UI-Angular,jimschubert/Semantic-UI-Angular,codedogfish/Semantic-UI-Angular,jimschubert/Semantic-UI-Angular,HackedByChinese/Semantic-UI-Angular,Semantic-Org/Semantic-UI-Angular,HackedByChinese/Semantic-UI-Angular | javascript | ## Code Before:
(function() {
'use strict';
angular
.module('semantic.ui.elements.button', [])
.directive('smButton', smButton);
function smButton() {
return {
restrict:'E',
replace: true,
transclude: true,
template: setTemplate,
link: function(scope, element, attrs, ctrl, transclude) {
var node = element[0];
transclude(function(nodes) {
element.append(nodes);
});
if (isAnchorBtn(attrs)) {
scope.$watch(attrs.ngDisabled, function(isDisabled) {
element.attr('tabindex', isDisabled ? -1 : 0);
if (isDisabled) {
element.addClass('disabled');
}
});
}
if (attrs.ariaLabel === void 0) {
element.attr('aria-label', node.textContent.trim());
}
scope.$watch(attrs.ngDisabled, function(isDisabled) {
if (isDisabled) {
element.addClass('disabled');
}
});
}
};
function isAnchorBtn(attrs) {
return attrs.href !== void 0 || attrs.ngHref !== void 0 || attrs.xlinkHref !== void 0;
}
function setTemplate(element, attrs) {
if (isAnchorBtn(attrs)) {
return '<a class="ui button"></a>';
} else {
return '<button class="ui button"></button>';
}
}
}
})();
## Instruction:
refactor(smButton): Use to manage css classes
## Code After:
(function() {
'use strict';
angular
.module('semantic.ui.elements.button', [])
.directive('smButton', smButton);
smButton['$inject'] = ['$animate'];
function smButton($animate) {
return {
restrict:'E',
replace: true,
transclude: true,
template: setTemplate,
link: function(scope, element, attrs, ctrl, transclude) {
var node = element[0];
transclude(scope, function(nodes) {
element.append(nodes);
});
if (isAnchorBtn(attrs)) {
scope.$watch(attrs.ngDisabled, function(isDisabled) {
element.attr('tabindex', isDisabled ? -1 : 0);
if (isDisabled) {
$animate.addClass(element, 'disabled');
}
});
}
if (attrs.ariaLabel === void 0) {
element.attr('aria-label', node.textContent.trim());
}
scope.$watch(attrs.ngDisabled, function(isDisabled) {
if (isDisabled) {
$animate.addClass(element, 'disabled');
}
});
}
};
function isAnchorBtn(attrs) {
return attrs.href !== void 0 || attrs.ngHref !== void 0 || attrs.xlinkHref !== void 0;
}
function setTemplate(element, attrs) {
if (isAnchorBtn(attrs)) {
return '<a class="ui button"></a>';
} else {
return '<button class="ui button"></button>';
}
}
}
})();
| (function() {
'use strict';
angular
.module('semantic.ui.elements.button', [])
.directive('smButton', smButton);
+ smButton['$inject'] = ['$animate'];
+
- function smButton() {
+ function smButton($animate) {
? ++++++++
return {
restrict:'E',
replace: true,
transclude: true,
template: setTemplate,
link: function(scope, element, attrs, ctrl, transclude) {
var node = element[0];
- transclude(function(nodes) {
+ transclude(scope, function(nodes) {
? +++++++
element.append(nodes);
});
if (isAnchorBtn(attrs)) {
scope.$watch(attrs.ngDisabled, function(isDisabled) {
element.attr('tabindex', isDisabled ? -1 : 0);
if (isDisabled) {
- element.addClass('disabled');
? ------
+ $animate.addClass(element, 'disabled');
? +++++++ +++++++++
}
});
}
if (attrs.ariaLabel === void 0) {
element.attr('aria-label', node.textContent.trim());
}
scope.$watch(attrs.ngDisabled, function(isDisabled) {
if (isDisabled) {
- element.addClass('disabled');
? ------
+ $animate.addClass(element, 'disabled');
? +++++++ +++++++++
}
});
}
};
function isAnchorBtn(attrs) {
return attrs.href !== void 0 || attrs.ngHref !== void 0 || attrs.xlinkHref !== void 0;
}
function setTemplate(element, attrs) {
if (isAnchorBtn(attrs)) {
return '<a class="ui button"></a>';
} else {
return '<button class="ui button"></button>';
}
}
}
})(); | 10 | 0.178571 | 6 | 4 |
58edd1a70a731017fdb7ff40bdd9526656c58d0f | scripts/docker-env.sh | scripts/docker-env.sh |
if ! type -P docker-compose || [ -z "$(docker-compose ps -q)" ]; then
echo "ERROR: docker-compose does not exist or is not running" >&2
exit 1
fi
function password_ready() {
docker-compose ps -q | \
xargs -n1 -I {} docker exec {} test -r /var/lib/jenkins/secrets/initialAdminPassword
}
if [ -z "${JENKINS_PASSWORD}" ]; then
until password_ready; do
echo '/var/lib/jenkins/secrets/initialAdminPassword not available, yet...'
sleep 5
done
JENKINS_PASSWORD="$(docker-compose ps -q | xargs -n1 -I {} docker exec {} cat /var/lib/jenkins/secrets/initialAdminPassword)"
export JENKINS_PASSWORD
fi
|
if ! type -P docker-compose || [ -z "$(docker-compose ps -q)" ]; then
echo "ERROR: docker-compose does not exist or is not running" >&2
exit 1
fi
function password_ready() {
docker-compose ps -q | \
xargs -n1 -I {} docker exec {} test -r "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}"/secrets/initialAdminPassword
}
if [ -z "${JENKINS_PASSWORD}" ]; then
until password_ready; do
echo "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}/secrets/initialAdminPassword not available, yet..."
sleep 5
done
JENKINS_PASSWORD="$(docker-compose ps -q | xargs -n1 -I {} docker exec {} cat "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}"/secrets/initialAdminPassword)"
export JENKINS_PASSWORD
fi
| Upgrade support for docker jenkins home custom path | Upgrade support for docker jenkins home custom path
| Shell | apache-2.0 | samrocketman/jenkins-bootstrap-shared,samrocketman/jenkins-bootstrap-shared | shell | ## Code Before:
if ! type -P docker-compose || [ -z "$(docker-compose ps -q)" ]; then
echo "ERROR: docker-compose does not exist or is not running" >&2
exit 1
fi
function password_ready() {
docker-compose ps -q | \
xargs -n1 -I {} docker exec {} test -r /var/lib/jenkins/secrets/initialAdminPassword
}
if [ -z "${JENKINS_PASSWORD}" ]; then
until password_ready; do
echo '/var/lib/jenkins/secrets/initialAdminPassword not available, yet...'
sleep 5
done
JENKINS_PASSWORD="$(docker-compose ps -q | xargs -n1 -I {} docker exec {} cat /var/lib/jenkins/secrets/initialAdminPassword)"
export JENKINS_PASSWORD
fi
## Instruction:
Upgrade support for docker jenkins home custom path
## Code After:
if ! type -P docker-compose || [ -z "$(docker-compose ps -q)" ]; then
echo "ERROR: docker-compose does not exist or is not running" >&2
exit 1
fi
function password_ready() {
docker-compose ps -q | \
xargs -n1 -I {} docker exec {} test -r "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}"/secrets/initialAdminPassword
}
if [ -z "${JENKINS_PASSWORD}" ]; then
until password_ready; do
echo "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}/secrets/initialAdminPassword not available, yet..."
sleep 5
done
JENKINS_PASSWORD="$(docker-compose ps -q | xargs -n1 -I {} docker exec {} cat "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}"/secrets/initialAdminPassword)"
export JENKINS_PASSWORD
fi
|
if ! type -P docker-compose || [ -z "$(docker-compose ps -q)" ]; then
echo "ERROR: docker-compose does not exist or is not running" >&2
exit 1
fi
function password_ready() {
docker-compose ps -q | \
- xargs -n1 -I {} docker exec {} test -r /var/lib/jenkins/secrets/initialAdminPassword
+ xargs -n1 -I {} docker exec {} test -r "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}"/secrets/initialAdminPassword
? ++++++++++++++++++++++++ ++
}
if [ -z "${JENKINS_PASSWORD}" ]; then
until password_ready; do
- echo '/var/lib/jenkins/secrets/initialAdminPassword not available, yet...'
? ^ ^
+ echo "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}/secrets/initialAdminPassword not available, yet..."
? ^^^^^^^^^^^^^^^^^^^^^^^^ + ^
sleep 5
done
- JENKINS_PASSWORD="$(docker-compose ps -q | xargs -n1 -I {} docker exec {} cat /var/lib/jenkins/secrets/initialAdminPassword)"
+ JENKINS_PASSWORD="$(docker-compose ps -q | xargs -n1 -I {} docker exec {} cat "${DOCKER_JENKINS_HOME:-/var/lib/jenkins}"/secrets/initialAdminPassword)"
? ++++++++++++++++++++++++ ++
export JENKINS_PASSWORD
fi | 6 | 0.3 | 3 | 3 |
e8898d35a451312b4ef1e6255479a7e988ba86d1 | roboblocks/roboblocks.sh | roboblocks/roboblocks.sh | set -ex
# git clone https://github.com/bq/roboblocks.git
git clone file:///home/vrruiz/tmp/bitbloq/roboblocks.git-make roboblocks
cd roboblocks/
npm install bower
npm run bower
cp -r bower_components/ src/
cp -r bower_components/blockly-bq/media/ src/
cp -r dist/* src/
| set -ex
git clone https://github.com/bq/roboblocks.git
cd roboblocks/
npm install bower
npm run bower
cp -r bower_components/ src/
cp -r bower_components/blockly-bq/media/ src/
cp -r dist/* src/
| Fix temp call in script | Fix temp call in script
| Shell | bsd-2-clause | vrruiz/visualino,vrruiz/visualino,vrruiz/visualino,vrruiz/visualino | shell | ## Code Before:
set -ex
# git clone https://github.com/bq/roboblocks.git
git clone file:///home/vrruiz/tmp/bitbloq/roboblocks.git-make roboblocks
cd roboblocks/
npm install bower
npm run bower
cp -r bower_components/ src/
cp -r bower_components/blockly-bq/media/ src/
cp -r dist/* src/
## Instruction:
Fix temp call in script
## Code After:
set -ex
git clone https://github.com/bq/roboblocks.git
cd roboblocks/
npm install bower
npm run bower
cp -r bower_components/ src/
cp -r bower_components/blockly-bq/media/ src/
cp -r dist/* src/
| set -ex
- # git clone https://github.com/bq/roboblocks.git
? --
+ git clone https://github.com/bq/roboblocks.git
- git clone file:///home/vrruiz/tmp/bitbloq/roboblocks.git-make roboblocks
cd roboblocks/
npm install bower
npm run bower
cp -r bower_components/ src/
cp -r bower_components/blockly-bq/media/ src/
cp -r dist/* src/ | 3 | 0.333333 | 1 | 2 |
240672d747be83ae64bf2a4a2180a29c7fc0de64 | plugins/GroupNumberOfUser/GroupNumberOfUser.pl | plugins/GroupNumberOfUser/GroupNumberOfUser.pl | package MT::Plugin::GroupNumberOfUser;
use strict;
use warnings;
use base qw( MT::Plugin );
my $plugin = __PACKAGE__->new(
{ name => 'GroupNumberOfUser',
version => 0.01,
author_name => 'masiuchi',
author_link => 'https://github.com/masiuchi',
plugin_link =>
'https://github.com/masiuchi/mt-plugin-group-number-of-user',
description =>
'<__trans phrase="Add group number column in Manage Users screen.">',
registry => { list_properties => { author => \&_list_properties, }, },
}
);
MT->add_plugin($plugin);
sub _list_properties {
return {
group_number => {
base => '__virtual.integer',
label => 'Group Number',
html => sub {
my ( $prop, $obj ) = @_;
$obj->group_count;
},
},
};
}
1;
| package MT::Plugin::GroupNumberOfUser;
use strict;
use warnings;
use base qw( MT::Plugin );
my $plugin = __PACKAGE__->new(
{ name => 'GroupNumberOfUser',
version => 0.01,
author_name => 'masiuchi',
author_link => 'https://github.com/masiuchi',
plugin_link =>
'https://github.com/masiuchi/mt-plugin-group-number-of-user',
description =>
'<__trans phrase="Add group number column in Manage Users screen.">',
registry => { list_properties => { author => \&_list_properties, }, },
}
);
MT->add_plugin($plugin);
sub _list_properties {
return {
group_number => {
base => '__virtual.integer',
label => 'Group Number',
html => sub {
my ( $prop, $obj ) = @_;
my $group_count = $obj->group_count;
my $author_id = $obj->id;
my $script = MT->app->script;
return
"<a href='$script?__mode=list&_type=group&blog_id=0&filter=author_id&filter_val=$author_id'>$group_count</a>";
},
},
};
}
1;
| Add link to Manage Groups screen. | Add link to Manage Groups screen.
| Perl | mit | masiuchi/mt-plugin-group-number-of-user | perl | ## Code Before:
package MT::Plugin::GroupNumberOfUser;
use strict;
use warnings;
use base qw( MT::Plugin );
my $plugin = __PACKAGE__->new(
{ name => 'GroupNumberOfUser',
version => 0.01,
author_name => 'masiuchi',
author_link => 'https://github.com/masiuchi',
plugin_link =>
'https://github.com/masiuchi/mt-plugin-group-number-of-user',
description =>
'<__trans phrase="Add group number column in Manage Users screen.">',
registry => { list_properties => { author => \&_list_properties, }, },
}
);
MT->add_plugin($plugin);
sub _list_properties {
return {
group_number => {
base => '__virtual.integer',
label => 'Group Number',
html => sub {
my ( $prop, $obj ) = @_;
$obj->group_count;
},
},
};
}
1;
## Instruction:
Add link to Manage Groups screen.
## Code After:
package MT::Plugin::GroupNumberOfUser;
use strict;
use warnings;
use base qw( MT::Plugin );
my $plugin = __PACKAGE__->new(
{ name => 'GroupNumberOfUser',
version => 0.01,
author_name => 'masiuchi',
author_link => 'https://github.com/masiuchi',
plugin_link =>
'https://github.com/masiuchi/mt-plugin-group-number-of-user',
description =>
'<__trans phrase="Add group number column in Manage Users screen.">',
registry => { list_properties => { author => \&_list_properties, }, },
}
);
MT->add_plugin($plugin);
sub _list_properties {
return {
group_number => {
base => '__virtual.integer',
label => 'Group Number',
html => sub {
my ( $prop, $obj ) = @_;
my $group_count = $obj->group_count;
my $author_id = $obj->id;
my $script = MT->app->script;
return
"<a href='$script?__mode=list&_type=group&blog_id=0&filter=author_id&filter_val=$author_id'>$group_count</a>";
},
},
};
}
1;
| package MT::Plugin::GroupNumberOfUser;
use strict;
use warnings;
use base qw( MT::Plugin );
my $plugin = __PACKAGE__->new(
{ name => 'GroupNumberOfUser',
version => 0.01,
author_name => 'masiuchi',
author_link => 'https://github.com/masiuchi',
plugin_link =>
'https://github.com/masiuchi/mt-plugin-group-number-of-user',
description =>
'<__trans phrase="Add group number column in Manage Users screen.">',
registry => { list_properties => { author => \&_list_properties, }, },
}
);
MT->add_plugin($plugin);
sub _list_properties {
return {
group_number => {
base => '__virtual.integer',
label => 'Group Number',
html => sub {
my ( $prop, $obj ) = @_;
- $obj->group_count;
+ my $group_count = $obj->group_count;
? ++++++++++++++++++
+ my $author_id = $obj->id;
+ my $script = MT->app->script;
+ return
+ "<a href='$script?__mode=list&_type=group&blog_id=0&filter=author_id&filter_val=$author_id'>$group_count</a>";
},
},
};
}
1; | 6 | 0.171429 | 5 | 1 |
6c929f04559698a5988aaa3b03d42a03c091fc57 | pyes/tests/pyestest.py | pyes/tests/pyestest.py |
import unittest
from pyes import ES, file_to_attachment
from pyes.exceptions import NotFoundException
from pprint import pprint
import os
class ESTestCase(unittest.TestCase):
def setUp(self):
self.conn = ES('127.0.0.1:9200')
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def tearDown(self):
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def assertResultContains(self, result, expected):
for (key, value) in expected.items():
self.assertEquals(value, result[key])
def dump(self, result):
"""
dump to stdout the result
"""
pprint(result)
main = unittest.main |
import unittest
from pyes import ES, file_to_attachment
from pyes.exceptions import NotFoundException
from pprint import pprint
import os
class ESTestCase(unittest.TestCase):
def setUp(self):
self.conn = ES('127.0.0.1:9200')
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def tearDown(self):
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def assertResultContains(self, result, expected):
for (key, value) in expected.items():
self.assertEquals(value, result[key])
def checkRaises(self, excClass, callableObj, *args, **kwargs):
"""Assert that calling callableObj with *args and **kwargs raises an
exception of type excClass, and return the exception object so that
further tests on it can be performed.
"""
try:
callableObj(*args, **kwargs)
except excClass, e:
return e
else:
raise self.failureException, \
"Expected exception %s not raised" % excClass
def dump(self, result):
"""
dump to stdout the result
"""
pprint(result)
main = unittest.main
| Add a checkRaises method to check that an exception is raised, but also return it for futher tests. | Add a checkRaises method to check that an exception is raised, but also return it for futher tests.
| Python | bsd-3-clause | mouadino/pyes,Fiedzia/pyes,haiwen/pyes,HackLinux/pyes,haiwen/pyes,Fiedzia/pyes,Fiedzia/pyes,aparo/pyes,aparo/pyes,haiwen/pyes,rookdev/pyes,HackLinux/pyes,jayzeng/pyes,HackLinux/pyes,mavarick/pyes,mavarick/pyes,rookdev/pyes,mavarick/pyes,jayzeng/pyes,mouadino/pyes,aparo/pyes,jayzeng/pyes | python | ## Code Before:
import unittest
from pyes import ES, file_to_attachment
from pyes.exceptions import NotFoundException
from pprint import pprint
import os
class ESTestCase(unittest.TestCase):
def setUp(self):
self.conn = ES('127.0.0.1:9200')
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def tearDown(self):
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def assertResultContains(self, result, expected):
for (key, value) in expected.items():
self.assertEquals(value, result[key])
def dump(self, result):
"""
dump to stdout the result
"""
pprint(result)
main = unittest.main
## Instruction:
Add a checkRaises method to check that an exception is raised, but also return it for futher tests.
## Code After:
import unittest
from pyes import ES, file_to_attachment
from pyes.exceptions import NotFoundException
from pprint import pprint
import os
class ESTestCase(unittest.TestCase):
def setUp(self):
self.conn = ES('127.0.0.1:9200')
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def tearDown(self):
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def assertResultContains(self, result, expected):
for (key, value) in expected.items():
self.assertEquals(value, result[key])
def checkRaises(self, excClass, callableObj, *args, **kwargs):
"""Assert that calling callableObj with *args and **kwargs raises an
exception of type excClass, and return the exception object so that
further tests on it can be performed.
"""
try:
callableObj(*args, **kwargs)
except excClass, e:
return e
else:
raise self.failureException, \
"Expected exception %s not raised" % excClass
def dump(self, result):
"""
dump to stdout the result
"""
pprint(result)
main = unittest.main
|
import unittest
from pyes import ES, file_to_attachment
from pyes.exceptions import NotFoundException
from pprint import pprint
import os
class ESTestCase(unittest.TestCase):
def setUp(self):
self.conn = ES('127.0.0.1:9200')
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def tearDown(self):
try:
self.conn.delete_index("test-index")
except NotFoundException:
pass
def assertResultContains(self, result, expected):
for (key, value) in expected.items():
self.assertEquals(value, result[key])
+ def checkRaises(self, excClass, callableObj, *args, **kwargs):
+ """Assert that calling callableObj with *args and **kwargs raises an
+ exception of type excClass, and return the exception object so that
+ further tests on it can be performed.
+ """
+ try:
+ callableObj(*args, **kwargs)
+ except excClass, e:
+ return e
+ else:
+ raise self.failureException, \
+ "Expected exception %s not raised" % excClass
+
def dump(self, result):
"""
dump to stdout the result
"""
pprint(result)
main = unittest.main | 13 | 0.40625 | 13 | 0 |
2aaf9762fae996b5459e95cf328125ea77e718dd | app/controllers/blog_controller.rb | app/controllers/blog_controller.rb | class BlogController < ApplicationController
before_filter :find_post, only: [:show]
POSTS_PER_PAGE = 6
def index
unless params[:page] and params[:page].to_i >= 0
@page = 0
else
@page = params[:page].to_i
end
@total_pages = (BlogPost.all.count / POSTS_PER_PAGE).ceil
@posts = BlogPost.all.slice(@page * POSTS_PER_PAGE, POSTS_PER_PAGE)
if @posts.blank?
redirect_to(blog_index_path)
end
end
def show
if stale?(@post, public: true)
render text: @post.html, layout: true
end
end
private
def find_post
@post = BlogPost.find params[:id]
redirect_to blog_index_path unless @post
end
end
| class BlogController < ApplicationController
POSTS_PER_PAGE = 6
before_filter :find_post, only: [:show]
def index
unless params[:page] and params[:page].to_i >= 0
@page = 0
else
@page = params[:page].to_i
end
@total_pages = (BlogPost.all.count / POSTS_PER_PAGE).ceil
@posts = BlogPost.all.slice(@page * POSTS_PER_PAGE, POSTS_PER_PAGE)
if @posts.blank?
redirect_to(blog_index_path)
end
end
def show
if stale?(@post, public: true)
render text: @post.html, layout: true
end
end
private
def find_post
@post = BlogPost.find params[:id]
redirect_to blog_index_path unless @post
end
end
| Put the constant at the top | Put the constant at the top
| Ruby | apache-2.0 | sarahmonster/suitor,sarahmonster/suitor,sarahmonster/suitor | ruby | ## Code Before:
class BlogController < ApplicationController
before_filter :find_post, only: [:show]
POSTS_PER_PAGE = 6
def index
unless params[:page] and params[:page].to_i >= 0
@page = 0
else
@page = params[:page].to_i
end
@total_pages = (BlogPost.all.count / POSTS_PER_PAGE).ceil
@posts = BlogPost.all.slice(@page * POSTS_PER_PAGE, POSTS_PER_PAGE)
if @posts.blank?
redirect_to(blog_index_path)
end
end
def show
if stale?(@post, public: true)
render text: @post.html, layout: true
end
end
private
def find_post
@post = BlogPost.find params[:id]
redirect_to blog_index_path unless @post
end
end
## Instruction:
Put the constant at the top
## Code After:
class BlogController < ApplicationController
POSTS_PER_PAGE = 6
before_filter :find_post, only: [:show]
def index
unless params[:page] and params[:page].to_i >= 0
@page = 0
else
@page = params[:page].to_i
end
@total_pages = (BlogPost.all.count / POSTS_PER_PAGE).ceil
@posts = BlogPost.all.slice(@page * POSTS_PER_PAGE, POSTS_PER_PAGE)
if @posts.blank?
redirect_to(blog_index_path)
end
end
def show
if stale?(@post, public: true)
render text: @post.html, layout: true
end
end
private
def find_post
@post = BlogPost.find params[:id]
redirect_to blog_index_path unless @post
end
end
| class BlogController < ApplicationController
+ POSTS_PER_PAGE = 6
+
before_filter :find_post, only: [:show]
- POSTS_PER_PAGE = 6
def index
unless params[:page] and params[:page].to_i >= 0
@page = 0
else
@page = params[:page].to_i
end
@total_pages = (BlogPost.all.count / POSTS_PER_PAGE).ceil
@posts = BlogPost.all.slice(@page * POSTS_PER_PAGE, POSTS_PER_PAGE)
if @posts.blank?
redirect_to(blog_index_path)
end
end
def show
if stale?(@post, public: true)
render text: @post.html, layout: true
end
end
private
def find_post
@post = BlogPost.find params[:id]
redirect_to blog_index_path unless @post
end
end | 3 | 0.09375 | 2 | 1 |
838866c74f698db02c7bb87e90e75f41d5abe927 | app/views/saved_occupations/create.html.erb | app/views/saved_occupations/create.html.erb | <header id="global-breadcrumb">
<ol>
<li><a href="<%= new_scrapbook_search_path %>">Search</a></li>
<li><a href="<%= scrapbook_search_path(query: @query) %>">Results</a></li>
<li><a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>"><%= @occupation.title %></a></li>
<li>Saved</li>
</ol>
</header>
<%= render "saved_occupations/confirmation_box", occupation: @occupation %>
<p>
<a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>" id="back-to-occupation" class="link-back">Back to "<%= @occupation.title %>"</a><br>
<a href="<%= scrapbook_search_path(query: @query) %>" id="back-to-search-results" class="link-back">Back to search results</a>
</p>
| <% content_for :breadcrumbs do %>
<ol>
<li><a href="<%= new_scrapbook_search_path %>">Search</a></li>
<li><a href="<%= scrapbook_search_path(query: @query) %>">Results</a></li>
<li><a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>"><%= @occupation.title %></a></li>
<li>Saved</li>
</ol>
<% end %>
<%= render "saved_occupations/confirmation_box", occupation: @occupation %>
<p>
<a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>" id="back-to-occupation" class="link-back">Back to "<%= @occupation.title %>"</a><br>
<a href="<%= scrapbook_search_path(query: @query) %>" id="back-to-search-results" class="link-back">Back to search results</a>
</p>
| Fix breadcrumbs on non-JS save occupations | Fix breadcrumbs on non-JS save occupations
| HTML+ERB | apache-2.0 | lm-tools/work-you-could-do,lm-tools/work-you-could-do,lm-tools/work-you-could-do,lm-tools/work-you-could-do | html+erb | ## Code Before:
<header id="global-breadcrumb">
<ol>
<li><a href="<%= new_scrapbook_search_path %>">Search</a></li>
<li><a href="<%= scrapbook_search_path(query: @query) %>">Results</a></li>
<li><a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>"><%= @occupation.title %></a></li>
<li>Saved</li>
</ol>
</header>
<%= render "saved_occupations/confirmation_box", occupation: @occupation %>
<p>
<a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>" id="back-to-occupation" class="link-back">Back to "<%= @occupation.title %>"</a><br>
<a href="<%= scrapbook_search_path(query: @query) %>" id="back-to-search-results" class="link-back">Back to search results</a>
</p>
## Instruction:
Fix breadcrumbs on non-JS save occupations
## Code After:
<% content_for :breadcrumbs do %>
<ol>
<li><a href="<%= new_scrapbook_search_path %>">Search</a></li>
<li><a href="<%= scrapbook_search_path(query: @query) %>">Results</a></li>
<li><a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>"><%= @occupation.title %></a></li>
<li>Saved</li>
</ol>
<% end %>
<%= render "saved_occupations/confirmation_box", occupation: @occupation %>
<p>
<a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>" id="back-to-occupation" class="link-back">Back to "<%= @occupation.title %>"</a><br>
<a href="<%= scrapbook_search_path(query: @query) %>" id="back-to-search-results" class="link-back">Back to search results</a>
</p>
| - <header id="global-breadcrumb">
+ <% content_for :breadcrumbs do %>
<ol>
<li><a href="<%= new_scrapbook_search_path %>">Search</a></li>
<li><a href="<%= scrapbook_search_path(query: @query) %>">Results</a></li>
<li><a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>"><%= @occupation.title %></a></li>
<li>Saved</li>
</ol>
- </header>
+ <% end %>
<%= render "saved_occupations/confirmation_box", occupation: @occupation %>
<p>
<a href="<%= scrapbook_occupation_path(soc_code: @occupation.soc_code, query: @query) %>" id="back-to-occupation" class="link-back">Back to "<%= @occupation.title %>"</a><br>
<a href="<%= scrapbook_search_path(query: @query) %>" id="back-to-search-results" class="link-back">Back to search results</a>
</p> | 4 | 0.266667 | 2 | 2 |
34a1442ffa5877eb1fd41499b52959762a68d3b0 | src/MonoDevelop.Dnx/Templates/Projects/LibraryProject.MyClass.cs.xft.xml | src/MonoDevelop.Dnx/Templates/Projects/LibraryProject.MyClass.cs.xft.xml | <?xml version="1.0"?>
<Template
originator="Matt Ward"
created="2015/09/13"
lastModified="2015/09/13">
<TemplateConfiguration>
<_Name>Library MyClass.cs</_Name>
</TemplateConfiguration>
<TemplateFiles>
<File
name="MyClass.cs"
DefaultName="MyClass.cs"
src="LibraryProject.MyClass.cs" />
</TemplateFiles>
</Template> | <?xml version="1.0"?>
<Template
originator="Matt Ward"
created="2015/09/13"
lastModified="2015/09/13">
<TemplateConfiguration>
<_Name>Library MyClass.cs</_Name>
</TemplateConfiguration>
<TemplateFiles>
<File
name="MyClass.cs"
DefaultName="MyClass.cs"
src="LibraryProject.MyClass.cs"
AddStandardHeader="True" />
</TemplateFiles>
</Template> | Add standard header to class file generated for library project. | Add standard header to class file generated for library project.
| XML | mit | mrward/monodevelop-dnx-addin | xml | ## Code Before:
<?xml version="1.0"?>
<Template
originator="Matt Ward"
created="2015/09/13"
lastModified="2015/09/13">
<TemplateConfiguration>
<_Name>Library MyClass.cs</_Name>
</TemplateConfiguration>
<TemplateFiles>
<File
name="MyClass.cs"
DefaultName="MyClass.cs"
src="LibraryProject.MyClass.cs" />
</TemplateFiles>
</Template>
## Instruction:
Add standard header to class file generated for library project.
## Code After:
<?xml version="1.0"?>
<Template
originator="Matt Ward"
created="2015/09/13"
lastModified="2015/09/13">
<TemplateConfiguration>
<_Name>Library MyClass.cs</_Name>
</TemplateConfiguration>
<TemplateFiles>
<File
name="MyClass.cs"
DefaultName="MyClass.cs"
src="LibraryProject.MyClass.cs"
AddStandardHeader="True" />
</TemplateFiles>
</Template> | <?xml version="1.0"?>
<Template
originator="Matt Ward"
created="2015/09/13"
lastModified="2015/09/13">
<TemplateConfiguration>
<_Name>Library MyClass.cs</_Name>
</TemplateConfiguration>
<TemplateFiles>
<File
name="MyClass.cs"
DefaultName="MyClass.cs"
- src="LibraryProject.MyClass.cs" />
? ---
+ src="LibraryProject.MyClass.cs"
+ AddStandardHeader="True" />
</TemplateFiles>
</Template> | 3 | 0.176471 | 2 | 1 |
abf9fdf98f1afd3184aa670e167fcaa837916c5a | src/BracketedSentenceWidget.cpp | src/BracketedSentenceWidget.cpp |
BracketedSentenceWidget::BracketedSentenceWidget(QWidget *parent)
:
QTextEdit(parent),
d_stylesheet(":/stylesheets/bracketed-sentence.xsl"),
d_transformer(d_stylesheet)
{
QFontMetrics m(font());
int ruleHeight = m.lineSpacing();
setFixedHeight(2 * ruleHeight + (2 * document()->documentMargin()));
setReadOnly(true);
}
void BracketedSentenceWidget::setParse(QString const &parse)
{
d_parse = parse;
updateText();
}
void BracketedSentenceWidget::updateText()
{
if (!d_parse.isEmpty())
{
QString sentence = transformXML(d_parse);
setText(sentence.trimmed());
}
}
QString BracketedSentenceWidget::transformXML(QString const &xml) const
{
QHash<QString, QString> params;
return d_transformer.transform(xml, params);
}
|
BracketedSentenceWidget::BracketedSentenceWidget(QWidget *parent)
:
QTextEdit(parent),
d_stylesheet(":/stylesheets/bracketed-sentence.xsl"),
d_transformer(d_stylesheet)
{
QFontMetrics m(document()->defaultFont());
int ruleHeight = m.lineSpacing();
setFixedHeight(2 * ruleHeight + (2 * document()->documentMargin()));
setReadOnly(true);
}
void BracketedSentenceWidget::setParse(QString const &parse)
{
d_parse = parse;
updateText();
}
void BracketedSentenceWidget::updateText()
{
if (!d_parse.isEmpty())
{
QString sentence = transformXML(d_parse);
setText(sentence.trimmed());
}
}
QString BracketedSentenceWidget::transformXML(QString const &xml) const
{
QHash<QString, QString> params;
return d_transformer.transform(xml, params);
}
| Use document font in BracketedWindow. | Use document font in BracketedWindow.
| C++ | lgpl-2.1 | rug-compling/dact,evdmade01/dact,evdmade01/dact,rug-compling/dact,evdmade01/dact | c++ | ## Code Before:
BracketedSentenceWidget::BracketedSentenceWidget(QWidget *parent)
:
QTextEdit(parent),
d_stylesheet(":/stylesheets/bracketed-sentence.xsl"),
d_transformer(d_stylesheet)
{
QFontMetrics m(font());
int ruleHeight = m.lineSpacing();
setFixedHeight(2 * ruleHeight + (2 * document()->documentMargin()));
setReadOnly(true);
}
void BracketedSentenceWidget::setParse(QString const &parse)
{
d_parse = parse;
updateText();
}
void BracketedSentenceWidget::updateText()
{
if (!d_parse.isEmpty())
{
QString sentence = transformXML(d_parse);
setText(sentence.trimmed());
}
}
QString BracketedSentenceWidget::transformXML(QString const &xml) const
{
QHash<QString, QString> params;
return d_transformer.transform(xml, params);
}
## Instruction:
Use document font in BracketedWindow.
## Code After:
BracketedSentenceWidget::BracketedSentenceWidget(QWidget *parent)
:
QTextEdit(parent),
d_stylesheet(":/stylesheets/bracketed-sentence.xsl"),
d_transformer(d_stylesheet)
{
QFontMetrics m(document()->defaultFont());
int ruleHeight = m.lineSpacing();
setFixedHeight(2 * ruleHeight + (2 * document()->documentMargin()));
setReadOnly(true);
}
void BracketedSentenceWidget::setParse(QString const &parse)
{
d_parse = parse;
updateText();
}
void BracketedSentenceWidget::updateText()
{
if (!d_parse.isEmpty())
{
QString sentence = transformXML(d_parse);
setText(sentence.trimmed());
}
}
QString BracketedSentenceWidget::transformXML(QString const &xml) const
{
QHash<QString, QString> params;
return d_transformer.transform(xml, params);
}
|
BracketedSentenceWidget::BracketedSentenceWidget(QWidget *parent)
:
QTextEdit(parent),
d_stylesheet(":/stylesheets/bracketed-sentence.xsl"),
d_transformer(d_stylesheet)
{
- QFontMetrics m(font());
+ QFontMetrics m(document()->defaultFont());
int ruleHeight = m.lineSpacing();
setFixedHeight(2 * ruleHeight + (2 * document()->documentMargin()));
setReadOnly(true);
}
void BracketedSentenceWidget::setParse(QString const &parse)
{
d_parse = parse;
updateText();
}
void BracketedSentenceWidget::updateText()
{
if (!d_parse.isEmpty())
{
QString sentence = transformXML(d_parse);
setText(sentence.trimmed());
}
}
QString BracketedSentenceWidget::transformXML(QString const &xml) const
{
QHash<QString, QString> params;
return d_transformer.transform(xml, params);
} | 2 | 0.060606 | 1 | 1 |
71fc5d4966fe0151b8e896c617fa0a467c224e97 | README.md | README.md |

_Easily manage community and commercial support with Support Central!_
Support Central is an aggregator for various support channels. It displays in a central interface which support tickets need replying on. This allows the Phusion Passenger support team to easily handle both community and commercial support in a central interface.
The following support channels are currently supported:
* Github issue tracker
* Supportbee
## Github issue tracking
Support Central tracks Github issues as follows. For every repository for which the webhook is installed, the following happens:
* If a new issue is opened by a non-Phusion member, the issue gets the 'SupportCentral' label.
* If a new issue comment is posted by a non-Phusion member, the issue gets the 'SupportCentral label'.
* This label is removed if a Phusion member posts a comment in that issue.
Support Central displays all issues with the 'SupportCentral' label.
## Contributing
Please refer to the [contribution guide](CONTRIBUTING.md).
## Installation in production
* If you are a Phusion employee, read the [Phusion employee deployment guide](PHUSION_DEPLOYMENT.md).
* If you are not a Phusion employee, read the [general deployment guide](GENERAL_DEPLOYMENT.md).
|

_Easily manage community and commercial support with Support Central!_
Support Central is an aggregator for various support channels. It displays in a central interface which support tickets need replying on. This allows the Phusion Passenger support team to easily handle both community and commercial support in a central interface.
The following support channels are currently supported:
* Github issue tracker
* Supportbee
* Frontapp
## Github issue tracking
Support Central tracks Github issues as follows. For every repository for which the webhook is installed, the following happens:
* If a new issue is opened by a non-Phusion member, the issue gets the 'SupportCentral' label.
* If a new issue comment is posted by a non-Phusion member, the issue gets the 'SupportCentral label'.
* This label is removed if a Phusion member posts a comment in that issue.
Support Central displays all issues with the 'SupportCentral' label.
## Contributing
Please refer to the [contribution guide](CONTRIBUTING.md).
## Installation in production
* If you are a Phusion employee, read the [Phusion employee deployment guide](PHUSION_DEPLOYMENT.md).
* If you are not a Phusion employee, read the [general deployment guide](GENERAL_DEPLOYMENT.md).
| Add Frontapp to the list of supported channels | Add Frontapp to the list of supported channels
| Markdown | mit | phusion/support_central,phusion/support_central,phusion/support_central | markdown | ## Code Before:

_Easily manage community and commercial support with Support Central!_
Support Central is an aggregator for various support channels. It displays in a central interface which support tickets need replying on. This allows the Phusion Passenger support team to easily handle both community and commercial support in a central interface.
The following support channels are currently supported:
* Github issue tracker
* Supportbee
## Github issue tracking
Support Central tracks Github issues as follows. For every repository for which the webhook is installed, the following happens:
* If a new issue is opened by a non-Phusion member, the issue gets the 'SupportCentral' label.
* If a new issue comment is posted by a non-Phusion member, the issue gets the 'SupportCentral label'.
* This label is removed if a Phusion member posts a comment in that issue.
Support Central displays all issues with the 'SupportCentral' label.
## Contributing
Please refer to the [contribution guide](CONTRIBUTING.md).
## Installation in production
* If you are a Phusion employee, read the [Phusion employee deployment guide](PHUSION_DEPLOYMENT.md).
* If you are not a Phusion employee, read the [general deployment guide](GENERAL_DEPLOYMENT.md).
## Instruction:
Add Frontapp to the list of supported channels
## Code After:

_Easily manage community and commercial support with Support Central!_
Support Central is an aggregator for various support channels. It displays in a central interface which support tickets need replying on. This allows the Phusion Passenger support team to easily handle both community and commercial support in a central interface.
The following support channels are currently supported:
* Github issue tracker
* Supportbee
* Frontapp
## Github issue tracking
Support Central tracks Github issues as follows. For every repository for which the webhook is installed, the following happens:
* If a new issue is opened by a non-Phusion member, the issue gets the 'SupportCentral' label.
* If a new issue comment is posted by a non-Phusion member, the issue gets the 'SupportCentral label'.
* This label is removed if a Phusion member posts a comment in that issue.
Support Central displays all issues with the 'SupportCentral' label.
## Contributing
Please refer to the [contribution guide](CONTRIBUTING.md).
## Installation in production
* If you are a Phusion employee, read the [Phusion employee deployment guide](PHUSION_DEPLOYMENT.md).
* If you are not a Phusion employee, read the [general deployment guide](GENERAL_DEPLOYMENT.md).
|

_Easily manage community and commercial support with Support Central!_
Support Central is an aggregator for various support channels. It displays in a central interface which support tickets need replying on. This allows the Phusion Passenger support team to easily handle both community and commercial support in a central interface.
The following support channels are currently supported:
* Github issue tracker
* Supportbee
+ * Frontapp
## Github issue tracking
Support Central tracks Github issues as follows. For every repository for which the webhook is installed, the following happens:
* If a new issue is opened by a non-Phusion member, the issue gets the 'SupportCentral' label.
* If a new issue comment is posted by a non-Phusion member, the issue gets the 'SupportCentral label'.
* This label is removed if a Phusion member posts a comment in that issue.
Support Central displays all issues with the 'SupportCentral' label.
## Contributing
Please refer to the [contribution guide](CONTRIBUTING.md).
## Installation in production
* If you are a Phusion employee, read the [Phusion employee deployment guide](PHUSION_DEPLOYMENT.md).
* If you are not a Phusion employee, read the [general deployment guide](GENERAL_DEPLOYMENT.md). | 1 | 0.033333 | 1 | 0 |
d01a5cdf950b7421703e2a018ee0306935e79555 | sugar/activity/__init__.py | sugar/activity/__init__.py | import gtk
from sugar.graphics.grid import Grid
settings = gtk.settings_get_default()
grid = Grid()
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
settings.set_string_property('gtk-font-name', 'Sans 14', '')
def get_default_type(activity_type):
"""Get the activity default type.
It's the type of the main network service which tracks presence
and provides info about the activity, for example the title."""
splitted_id = activity_type.split('.')
splitted_id.reverse()
return '_' + '_'.join(splitted_id) + '._udp'
| import gtk
from sugar.graphics.grid import Grid
settings = gtk.settings_get_default()
grid = Grid()
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
def get_default_type(activity_type):
"""Get the activity default type.
It's the type of the main network service which tracks presence
and provides info about the activity, for example the title."""
splitted_id = activity_type.split('.')
splitted_id.reverse()
return '_' + '_'.join(splitted_id) + '._udp'
| Move font size in the theme | Move font size in the theme
| Python | lgpl-2.1 | Daksh/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit,ceibal-tatu/sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,samdroid-apps/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit-gtk3,puneetgkaur/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,quozl/sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,samdroid-apps/sugar-toolkit-gtk3,puneetgkaur/sugar-toolkit-gtk3,manuq/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,quozl/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit,godiard/sugar-toolkit-gtk3,manuq/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,i5o/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,samdroid-apps/sugar-toolkit-gtk3,quozl/sugar-toolkit-gtk3,manuq/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,ceibal-tatu/sugar-toolkit,sugarlabs/sugar-toolkit-gtk3,Daksh/sugar-toolkit-gtk3,godiard/sugar-toolkit-gtk3,i5o/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit,samdroid-apps/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit,tchx84/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit-gtk3,quozl/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,godiard/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit,puneetgkaur/sugar-toolkit-gtk3,Daksh/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit,gusDuarte/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit | python | ## Code Before:
import gtk
from sugar.graphics.grid import Grid
settings = gtk.settings_get_default()
grid = Grid()
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
settings.set_string_property('gtk-font-name', 'Sans 14', '')
def get_default_type(activity_type):
"""Get the activity default type.
It's the type of the main network service which tracks presence
and provides info about the activity, for example the title."""
splitted_id = activity_type.split('.')
splitted_id.reverse()
return '_' + '_'.join(splitted_id) + '._udp'
## Instruction:
Move font size in the theme
## Code After:
import gtk
from sugar.graphics.grid import Grid
settings = gtk.settings_get_default()
grid = Grid()
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
def get_default_type(activity_type):
"""Get the activity default type.
It's the type of the main network service which tracks presence
and provides info about the activity, for example the title."""
splitted_id = activity_type.split('.')
splitted_id.reverse()
return '_' + '_'.join(splitted_id) + '._udp'
| import gtk
from sugar.graphics.grid import Grid
settings = gtk.settings_get_default()
grid = Grid()
sizes = 'gtk-large-toolbar=%d, %d' % (grid.dimension(1), grid.dimension(1))
settings.set_string_property('gtk-icon-sizes', sizes, '')
- settings.set_string_property('gtk-font-name', 'Sans 14', '')
-
def get_default_type(activity_type):
"""Get the activity default type.
It's the type of the main network service which tracks presence
and provides info about the activity, for example the title."""
splitted_id = activity_type.split('.')
splitted_id.reverse()
return '_' + '_'.join(splitted_id) + '._udp' | 2 | 0.1 | 0 | 2 |
bd2bd2d17d3b008f081a49a31180b46bbff4b65d | exponent-view-template/ios/pod-install-exponent.sh | exponent-view-template/ios/pod-install-exponent.sh |
pushd ..
exp stop
popd
pod install
pushd ..
# resolve possible packager conflicts introduced by pod install
exp prepare-detached-build --platform ios --skipXcodeConfig 1
exp r -c
popd
|
pod install
pushd ..
# resolve possible packager conflicts introduced by pod install
exp prepare-detached-build --platform ios --skipXcodeConfig 1
popd
echo "Finished installing and cleaning up dependencies. Be sure and serve or restart your project with `exp r -c`"
| Remove exp stop from pod install script (untested) | Remove exp stop from pod install script (untested)
fbshipit-source-id: 821b6aa
| Shell | bsd-3-clause | exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent | shell | ## Code Before:
pushd ..
exp stop
popd
pod install
pushd ..
# resolve possible packager conflicts introduced by pod install
exp prepare-detached-build --platform ios --skipXcodeConfig 1
exp r -c
popd
## Instruction:
Remove exp stop from pod install script (untested)
fbshipit-source-id: 821b6aa
## Code After:
pod install
pushd ..
# resolve possible packager conflicts introduced by pod install
exp prepare-detached-build --platform ios --skipXcodeConfig 1
popd
echo "Finished installing and cleaning up dependencies. Be sure and serve or restart your project with `exp r -c`"
| -
- pushd ..
- exp stop
- popd
pod install
pushd ..
# resolve possible packager conflicts introduced by pod install
exp prepare-detached-build --platform ios --skipXcodeConfig 1
- exp r -c
popd
+
+ echo "Finished installing and cleaning up dependencies. Be sure and serve or restart your project with `exp r -c`" | 7 | 0.583333 | 2 | 5 |
10ae7e579232389ffe64bc67d56d5f27b62293fc | locales/ga-IE/copyright.properties | locales/ga-IE/copyright.properties | nav_copyright_campaign=FEACHTAS CÓIPCHIRT
nav_more_resources=TUILLEADH ACMHAINNÍ
nav_get_involved=GLAC PÁIRT
main_title=An fód a sheasamh ar son an Idirlín
get_involved_button=GLAC PÁIRT
# Sign up form
first_name=Ainm
last_name=Sloinne
email=Seoladh r-phoist (riachtanach)
country=Tír
link_tos=Téarmaí Seirbhíse Mozilla
link_pp=Polasaí Príobháideachais
# Sign up button
sign_up_button=CLÁRAIGH
# Footer
contact_us=Teagmháil
code_of_conduct=Cód Iompair
legal=Cúrsaí Dlí
privacy_policy=Polasaí Príobháideachais
| nav_copyright_campaign=FEACHTAS CÓIPCHIRT
nav_more_resources=TUILLEADH ACMHAINNÍ
nav_get_involved=GLAC PÁIRT
main_title=Seasamh an fhóid ar son an Idirlín
get_involved_button=GLAC PÁIRT
question_3=An aontaíonn tú go bhfuil ealaíontóirí, nuálaithe, agus cruthaitheoirí tábhachtach?
# Sign up form
first_name=Ainm
last_name=Sloinne
email=Seoladh r-phoist (riachtanach)
country=Tír
link_tos=Téarmaí Seirbhíse Mozilla
link_pp=Polasaí Príobháideachais
# Sign up button
sign_up_button=CLÁRAIGH
# Footer
contact_us=Teagmháil
code_of_conduct=Cód Iompair
legal=Cúrsaí Dlí
privacy_policy=Polasaí Príobháideachais
donate=Bronn
cookies=Fianáin
lang_selector=Teanga an leathanaigh:
| Update Irish (ga-IE) localization of EU Copyright campaign | Pontoon: Update Irish (ga-IE) localization of EU Copyright campaign
Localization authors:
- kscanne <kscanne@gmail.com>
| INI | mpl-2.0 | mozilla/copyright | ini | ## Code Before:
nav_copyright_campaign=FEACHTAS CÓIPCHIRT
nav_more_resources=TUILLEADH ACMHAINNÍ
nav_get_involved=GLAC PÁIRT
main_title=An fód a sheasamh ar son an Idirlín
get_involved_button=GLAC PÁIRT
# Sign up form
first_name=Ainm
last_name=Sloinne
email=Seoladh r-phoist (riachtanach)
country=Tír
link_tos=Téarmaí Seirbhíse Mozilla
link_pp=Polasaí Príobháideachais
# Sign up button
sign_up_button=CLÁRAIGH
# Footer
contact_us=Teagmháil
code_of_conduct=Cód Iompair
legal=Cúrsaí Dlí
privacy_policy=Polasaí Príobháideachais
## Instruction:
Pontoon: Update Irish (ga-IE) localization of EU Copyright campaign
Localization authors:
- kscanne <kscanne@gmail.com>
## Code After:
nav_copyright_campaign=FEACHTAS CÓIPCHIRT
nav_more_resources=TUILLEADH ACMHAINNÍ
nav_get_involved=GLAC PÁIRT
main_title=Seasamh an fhóid ar son an Idirlín
get_involved_button=GLAC PÁIRT
question_3=An aontaíonn tú go bhfuil ealaíontóirí, nuálaithe, agus cruthaitheoirí tábhachtach?
# Sign up form
first_name=Ainm
last_name=Sloinne
email=Seoladh r-phoist (riachtanach)
country=Tír
link_tos=Téarmaí Seirbhíse Mozilla
link_pp=Polasaí Príobháideachais
# Sign up button
sign_up_button=CLÁRAIGH
# Footer
contact_us=Teagmháil
code_of_conduct=Cód Iompair
legal=Cúrsaí Dlí
privacy_policy=Polasaí Príobháideachais
donate=Bronn
cookies=Fianáin
lang_selector=Teanga an leathanaigh:
| nav_copyright_campaign=FEACHTAS CÓIPCHIRT
nav_more_resources=TUILLEADH ACMHAINNÍ
nav_get_involved=GLAC PÁIRT
- main_title=An fód a sheasamh ar son an Idirlín
? ^^^^^^^^^^^
+ main_title=Seasamh an fhóid ar son an Idirlín
? ^ +++++++++
get_involved_button=GLAC PÁIRT
+ question_3=An aontaíonn tú go bhfuil ealaíontóirí, nuálaithe, agus cruthaitheoirí tábhachtach?
# Sign up form
first_name=Ainm
last_name=Sloinne
email=Seoladh r-phoist (riachtanach)
country=Tír
link_tos=Téarmaí Seirbhíse Mozilla
link_pp=Polasaí Príobháideachais
# Sign up button
sign_up_button=CLÁRAIGH
# Footer
contact_us=Teagmháil
code_of_conduct=Cód Iompair
legal=Cúrsaí Dlí
privacy_policy=Polasaí Príobháideachais
+ donate=Bronn
+ cookies=Fianáin
+ lang_selector=Teanga an leathanaigh: | 6 | 0.206897 | 5 | 1 |
79be43b8988068f3450efc05da76a02c08a4847d | sli/acceptance-tests/test/features/apiV1/endpoints/listAttendancesEndpoint.feature | sli/acceptance-tests/test/features/apiV1/endpoints/listAttendancesEndpoint.feature | @RALLY_US5074
Feature: List-Attendance endpoint should return a list of all student attendances
Scenario Outline: Check that I can get all attendances for a school
Given I am logged in using "cgray" "cgray1234" to realm "IL"
When I navigate to <url> with <id>
Then I should receive a valid return code
And I can see all the attendances in a school
Examples:
| url | id |
| "/schools/#{id}/studentSchoolAssociations/students/attendances" | "92d6d5a0-852c-45f4-907a-912752831772" |
# TODO: Fix this - offset makes API throw out of bound exception.`
# | "/schools/#{id}/studentSchoolAssociations/students/attendances?offset=50" | "92d6d5a0-852c-45f4-907a-912752831772" |
| @RALLY_US5074
Feature: List-Attendance endpoint should return a list of all student attendances
Scenario Outline: Check that I can get all attendances for a school
Given I am logged in using "cgray" "cgray1234" to realm "IL"
When I navigate to <url> with <id>
Then I should receive a valid return code
And I can see all the attendances in a school
Examples:
| url | id |
| "/schools/#{id}/studentSchoolAssociations/students/attendances" | "92d6d5a0-852c-45f4-907a-912752831772" |
| "/schools/#{id}/studentSchoolAssociations/students/attendances?offset=50" | "92d6d5a0-852c-45f4-907a-912752831772" |
| Remove TODO that is no longer relevant | Remove TODO that is no longer relevant
| Cucumber | apache-2.0 | inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service | cucumber | ## Code Before:
@RALLY_US5074
Feature: List-Attendance endpoint should return a list of all student attendances
Scenario Outline: Check that I can get all attendances for a school
Given I am logged in using "cgray" "cgray1234" to realm "IL"
When I navigate to <url> with <id>
Then I should receive a valid return code
And I can see all the attendances in a school
Examples:
| url | id |
| "/schools/#{id}/studentSchoolAssociations/students/attendances" | "92d6d5a0-852c-45f4-907a-912752831772" |
# TODO: Fix this - offset makes API throw out of bound exception.`
# | "/schools/#{id}/studentSchoolAssociations/students/attendances?offset=50" | "92d6d5a0-852c-45f4-907a-912752831772" |
## Instruction:
Remove TODO that is no longer relevant
## Code After:
@RALLY_US5074
Feature: List-Attendance endpoint should return a list of all student attendances
Scenario Outline: Check that I can get all attendances for a school
Given I am logged in using "cgray" "cgray1234" to realm "IL"
When I navigate to <url> with <id>
Then I should receive a valid return code
And I can see all the attendances in a school
Examples:
| url | id |
| "/schools/#{id}/studentSchoolAssociations/students/attendances" | "92d6d5a0-852c-45f4-907a-912752831772" |
| "/schools/#{id}/studentSchoolAssociations/students/attendances?offset=50" | "92d6d5a0-852c-45f4-907a-912752831772" |
| @RALLY_US5074
Feature: List-Attendance endpoint should return a list of all student attendances
Scenario Outline: Check that I can get all attendances for a school
Given I am logged in using "cgray" "cgray1234" to realm "IL"
When I navigate to <url> with <id>
Then I should receive a valid return code
And I can see all the attendances in a school
Examples:
| url | id |
| "/schools/#{id}/studentSchoolAssociations/students/attendances" | "92d6d5a0-852c-45f4-907a-912752831772" |
- # TODO: Fix this - offset makes API throw out of bound exception.`
- # | "/schools/#{id}/studentSchoolAssociations/students/attendances?offset=50" | "92d6d5a0-852c-45f4-907a-912752831772" |
? -
+ | "/schools/#{id}/studentSchoolAssociations/students/attendances?offset=50" | "92d6d5a0-852c-45f4-907a-912752831772" | | 3 | 0.214286 | 1 | 2 |
a97ce4c8f2dd5c78617778ba575203fbb6046789 | spec/spec_helper.rb | spec/spec_helper.rb | require 'rspec'
require 'rack/test'
require 'mock_redis'
$LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, "..", "..", "lib")))
require 'duckweed'
RSpec.configure do |conf|
conf.include Rack::Test::Methods
conf.before(:all) do
Duckweed.redis = MockRedis.new
end
conf.before(:each) do
Duckweed.redis.reset!
end
end
| require 'rspec'
require 'rack/test'
require 'mock_redis'
$LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, "..", "..", "lib")))
require 'duckweed'
module SpecHelpers
def open_page_in_browser
path = "/tmp/duckweed_sample_#{$$}.html"
File.open(path, 'w') do |f|
f.write(last_response.body)
end
`which open && open #{path}`
end
end
RSpec.configure do |conf|
conf.include Rack::Test::Methods
conf.include SpecHelpers
conf.before(:all) do
Duckweed.redis = MockRedis.new
end
conf.before(:each) do
Duckweed.redis.reset!
end
end
| Add spec helpers to open page in web browser for debugging | Add spec helpers to open page in web browser for debugging
Obvious caveat: this will only work if you are running the tests on your
local machine, and particularly, it depends on Mac OS X (for the "open"
command).
| Ruby | mit | causes/duckweed | ruby | ## Code Before:
require 'rspec'
require 'rack/test'
require 'mock_redis'
$LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, "..", "..", "lib")))
require 'duckweed'
RSpec.configure do |conf|
conf.include Rack::Test::Methods
conf.before(:all) do
Duckweed.redis = MockRedis.new
end
conf.before(:each) do
Duckweed.redis.reset!
end
end
## Instruction:
Add spec helpers to open page in web browser for debugging
Obvious caveat: this will only work if you are running the tests on your
local machine, and particularly, it depends on Mac OS X (for the "open"
command).
## Code After:
require 'rspec'
require 'rack/test'
require 'mock_redis'
$LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, "..", "..", "lib")))
require 'duckweed'
module SpecHelpers
def open_page_in_browser
path = "/tmp/duckweed_sample_#{$$}.html"
File.open(path, 'w') do |f|
f.write(last_response.body)
end
`which open && open #{path}`
end
end
RSpec.configure do |conf|
conf.include Rack::Test::Methods
conf.include SpecHelpers
conf.before(:all) do
Duckweed.redis = MockRedis.new
end
conf.before(:each) do
Duckweed.redis.reset!
end
end
| require 'rspec'
require 'rack/test'
require 'mock_redis'
$LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, "..", "..", "lib")))
require 'duckweed'
+ module SpecHelpers
+ def open_page_in_browser
+ path = "/tmp/duckweed_sample_#{$$}.html"
+ File.open(path, 'w') do |f|
+ f.write(last_response.body)
+ end
+ `which open && open #{path}`
+ end
+ end
+
RSpec.configure do |conf|
conf.include Rack::Test::Methods
+ conf.include SpecHelpers
conf.before(:all) do
Duckweed.redis = MockRedis.new
end
conf.before(:each) do
Duckweed.redis.reset!
end
-
end | 12 | 0.6 | 11 | 1 |
3b0d39abb8a3f6ffe6c120321f0dd789da614e5b | .travis.yml | .travis.yml | language: rust
cache: cargo
dist: xenial
rust:
- stable
- beta
- nightly
addons:
apt:
packages:
- golang-go
- libev-dev
- uthash-dev
script:
- cargo build --verbose --all --examples
- cargo test --verbose --all
- cargo doc --no-deps
- make -C examples
deploy:
provider: pages
fqdn: docs.quic.tech
local-dir: target/doc
skip-cleanup: true
github-token: $GITHUB_TOKEN
on:
branch: master
condition: $TRAVIS_RUST_VERSION = stable
| language: rust
dist: xenial
rust:
- stable
- beta
- nightly
addons:
apt:
packages:
- golang-go
- libev-dev
- uthash-dev
script:
- cargo build --verbose --all --examples
- cargo test --verbose --all
- cargo doc --no-deps
- make -C examples
deploy:
provider: pages
fqdn: docs.quic.tech
local-dir: target/doc
skip-cleanup: true
github-token: $GITHUB_TOKEN
on:
branch: master
condition: $TRAVIS_RUST_VERSION = stable
| Revert "add Cargo cache to Travis" | Revert "add Cargo cache to Travis"
This seems to be breaking PR builds due to having "branch" and "pull request"
builds which reuse the same build artifacts, which in turn confuses the C
examples Makefile and cause the C examples to fail to build.
See e.g. https://github.com/cloudflare/quiche/pull/20/checks?check_run_id=59225473
This is really the Makefile's fault for being too stupid, but until I can
figure out how to fix it (e.g. make cargo build C examples?), it's just
easier to disable the build cache.
This reverts commit 5ddb63a879067702c4fac749adc96674cb61dc39.
| YAML | bsd-2-clause | cloudflare/quiche,cloudflare/quiche,cloudflare/quiche | yaml | ## Code Before:
language: rust
cache: cargo
dist: xenial
rust:
- stable
- beta
- nightly
addons:
apt:
packages:
- golang-go
- libev-dev
- uthash-dev
script:
- cargo build --verbose --all --examples
- cargo test --verbose --all
- cargo doc --no-deps
- make -C examples
deploy:
provider: pages
fqdn: docs.quic.tech
local-dir: target/doc
skip-cleanup: true
github-token: $GITHUB_TOKEN
on:
branch: master
condition: $TRAVIS_RUST_VERSION = stable
## Instruction:
Revert "add Cargo cache to Travis"
This seems to be breaking PR builds due to having "branch" and "pull request"
builds which reuse the same build artifacts, which in turn confuses the C
examples Makefile and cause the C examples to fail to build.
See e.g. https://github.com/cloudflare/quiche/pull/20/checks?check_run_id=59225473
This is really the Makefile's fault for being too stupid, but until I can
figure out how to fix it (e.g. make cargo build C examples?), it's just
easier to disable the build cache.
This reverts commit 5ddb63a879067702c4fac749adc96674cb61dc39.
## Code After:
language: rust
dist: xenial
rust:
- stable
- beta
- nightly
addons:
apt:
packages:
- golang-go
- libev-dev
- uthash-dev
script:
- cargo build --verbose --all --examples
- cargo test --verbose --all
- cargo doc --no-deps
- make -C examples
deploy:
provider: pages
fqdn: docs.quic.tech
local-dir: target/doc
skip-cleanup: true
github-token: $GITHUB_TOKEN
on:
branch: master
condition: $TRAVIS_RUST_VERSION = stable
| language: rust
-
- cache: cargo
dist: xenial
rust:
- stable
- beta
- nightly
addons:
apt:
packages:
- golang-go
- libev-dev
- uthash-dev
script:
- cargo build --verbose --all --examples
- cargo test --verbose --all
- cargo doc --no-deps
- make -C examples
deploy:
provider: pages
fqdn: docs.quic.tech
local-dir: target/doc
skip-cleanup: true
github-token: $GITHUB_TOKEN
on:
branch: master
condition: $TRAVIS_RUST_VERSION = stable | 2 | 0.060606 | 0 | 2 |
0d942b544e7ebdf94001583c0cf79f22676d0abc | src/styles/_menu.scss | src/styles/_menu.scss | .menu {
background: $red;
height: 3em;
box-shadow: 0 -1em 0.5em -1em #222 inset;
ul {
height: inherit;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: no-wrap;
}
li {
font-family: $heading-font;
}
a, a:visited {
color: white;
text-decoration: none;
padding: 1em;
}
a:hover {
color: $yellow;
}
}
| .menu {
background: $red;
height: 3em;
box-shadow: 0 -1em 0.5em -1em #222 inset;
ul {
height: inherit;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: no-wrap;
}
li {
font-family: $heading-font;
}
a, a:visited {
color: white;
text-decoration: none;
}
a:hover {
color: $yellow;
}
}
| Fix menu items on small screens. | Fix menu items on small screens.
| SCSS | mit | apelsinet/portfolio,apelsinet/portfolio | scss | ## Code Before:
.menu {
background: $red;
height: 3em;
box-shadow: 0 -1em 0.5em -1em #222 inset;
ul {
height: inherit;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: no-wrap;
}
li {
font-family: $heading-font;
}
a, a:visited {
color: white;
text-decoration: none;
padding: 1em;
}
a:hover {
color: $yellow;
}
}
## Instruction:
Fix menu items on small screens.
## Code After:
.menu {
background: $red;
height: 3em;
box-shadow: 0 -1em 0.5em -1em #222 inset;
ul {
height: inherit;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: no-wrap;
}
li {
font-family: $heading-font;
}
a, a:visited {
color: white;
text-decoration: none;
}
a:hover {
color: $yellow;
}
}
| .menu {
background: $red;
height: 3em;
box-shadow: 0 -1em 0.5em -1em #222 inset;
ul {
height: inherit;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: no-wrap;
}
li {
font-family: $heading-font;
}
a, a:visited {
color: white;
text-decoration: none;
- padding: 1em;
}
a:hover {
color: $yellow;
}
} | 1 | 0.037037 | 0 | 1 |
ed91ca0b6cf90150a710c8af63143143a2b82965 | requery-test/src/main/java/io/requery/test/modelautovalue/Phone.java | requery-test/src/main/java/io/requery/test/modelautovalue/Phone.java | /*
* Copyright 2016 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.requery.test.modelautovalue;
import com.google.auto.value.AutoValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
@Entity
@AutoValue
public abstract class Phone {
public static Phone create(int id, String phoneNumber, boolean normalized, int ownerId) {
return new AutoValue_Phone(id, phoneNumber, normalized, ownerId);
}
@Id @GeneratedValue
public abstract int getId();
public abstract String getPhoneNumber();
public abstract boolean isNormalized();
@JoinColumn(foreignKey = @ForeignKey, table = "Person")
public abstract int getOwnerId();
}
| /*
* Copyright 2016 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.requery.test.modelautovalue;
import com.google.auto.value.AutoValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
@Entity
@AutoValue
public abstract class Phone {
public static Phone create(int id, String phoneNumber, boolean normalized, int ownerId) {
return new AutoValue_Phone(id, phoneNumber, normalized, ownerId);
}
@Id @GeneratedValue
public abstract int getId();
public abstract String getPhoneNumber();
public abstract boolean isNormalized();
@JoinColumn(foreignKey = @ForeignKey, table = "Person")
public abstract int getOwnerId();
// this method should not be processed
public boolean isValid() {
return getPhoneNumber() != null && isNormalized();
}
}
| Add non-processable method for testing | Add non-processable method for testing
| Java | apache-2.0 | requery/requery,sakuna63/requery,requery/requery,sakuna63/requery | java | ## Code Before:
/*
* Copyright 2016 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.requery.test.modelautovalue;
import com.google.auto.value.AutoValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
@Entity
@AutoValue
public abstract class Phone {
public static Phone create(int id, String phoneNumber, boolean normalized, int ownerId) {
return new AutoValue_Phone(id, phoneNumber, normalized, ownerId);
}
@Id @GeneratedValue
public abstract int getId();
public abstract String getPhoneNumber();
public abstract boolean isNormalized();
@JoinColumn(foreignKey = @ForeignKey, table = "Person")
public abstract int getOwnerId();
}
## Instruction:
Add non-processable method for testing
## Code After:
/*
* Copyright 2016 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.requery.test.modelautovalue;
import com.google.auto.value.AutoValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
@Entity
@AutoValue
public abstract class Phone {
public static Phone create(int id, String phoneNumber, boolean normalized, int ownerId) {
return new AutoValue_Phone(id, phoneNumber, normalized, ownerId);
}
@Id @GeneratedValue
public abstract int getId();
public abstract String getPhoneNumber();
public abstract boolean isNormalized();
@JoinColumn(foreignKey = @ForeignKey, table = "Person")
public abstract int getOwnerId();
// this method should not be processed
public boolean isValid() {
return getPhoneNumber() != null && isNormalized();
}
}
| /*
* Copyright 2016 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.requery.test.modelautovalue;
import com.google.auto.value.AutoValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
@Entity
@AutoValue
public abstract class Phone {
public static Phone create(int id, String phoneNumber, boolean normalized, int ownerId) {
return new AutoValue_Phone(id, phoneNumber, normalized, ownerId);
}
@Id @GeneratedValue
public abstract int getId();
public abstract String getPhoneNumber();
public abstract boolean isNormalized();
@JoinColumn(foreignKey = @ForeignKey, table = "Person")
public abstract int getOwnerId();
+
+ // this method should not be processed
+ public boolean isValid() {
+ return getPhoneNumber() != null && isNormalized();
+ }
} | 5 | 0.119048 | 5 | 0 |
c4eebf35c256c4ecc1ef5935b787c6b20c486c82 | client/package.json | client/package.json | {
"name": "SnapScreen",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"format": "find ./app -name '*.js' -type f | xargs prettier --write --single-quote --trailing-comma es5"
},
"dependencies": {
"haversine": "^1.0.2",
"jsx-control-statements": "^3.1.5",
"moment": "^2.18.1",
"native-base": "2.1.2",
"prettier": "^1.2.2",
"react": "16.0.0-alpha.6",
"react-native": "0.43.4",
"react-native-login": "git+https://github.com/secondsun/react-native-login.git",
"react-navigation": "^1.0.0-beta.8"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
| {
"name": "SnapScreen",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"format": "find ./app -name '*.js' -type f | xargs prettier --write --single-quote --trailing-comma es5"
},
"dependencies": {
"haversine": "^1.0.2",
"moment": "^2.18.1",
"native-base": "2.1.2",
"react": "16.0.0-alpha.6",
"react-native": "0.43.4",
"react-native-login": "git+https://github.com/secondsun/react-native-login.git",
"react-navigation": "^1.0.0-beta.8"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"jsx-control-statements": "^3.1.5",
"prettier": "^1.2.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
| Make prettier & jsx-control-statements devDependencies. | Make prettier & jsx-control-statements devDependencies. | JSON | apache-2.0 | feedhenry/snapscreen,damienomurchu/snapscreen,feedhenry/snapscreen,feedhenry/snapscreen,damienomurchu/snapscreen,damienomurchu/snapscreen | json | ## Code Before:
{
"name": "SnapScreen",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"format": "find ./app -name '*.js' -type f | xargs prettier --write --single-quote --trailing-comma es5"
},
"dependencies": {
"haversine": "^1.0.2",
"jsx-control-statements": "^3.1.5",
"moment": "^2.18.1",
"native-base": "2.1.2",
"prettier": "^1.2.2",
"react": "16.0.0-alpha.6",
"react-native": "0.43.4",
"react-native-login": "git+https://github.com/secondsun/react-native-login.git",
"react-navigation": "^1.0.0-beta.8"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
## Instruction:
Make prettier & jsx-control-statements devDependencies.
## Code After:
{
"name": "SnapScreen",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"format": "find ./app -name '*.js' -type f | xargs prettier --write --single-quote --trailing-comma es5"
},
"dependencies": {
"haversine": "^1.0.2",
"moment": "^2.18.1",
"native-base": "2.1.2",
"react": "16.0.0-alpha.6",
"react-native": "0.43.4",
"react-native-login": "git+https://github.com/secondsun/react-native-login.git",
"react-navigation": "^1.0.0-beta.8"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"jsx-control-statements": "^3.1.5",
"prettier": "^1.2.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
| {
"name": "SnapScreen",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"format": "find ./app -name '*.js' -type f | xargs prettier --write --single-quote --trailing-comma es5"
},
"dependencies": {
"haversine": "^1.0.2",
- "jsx-control-statements": "^3.1.5",
"moment": "^2.18.1",
"native-base": "2.1.2",
- "prettier": "^1.2.2",
"react": "16.0.0-alpha.6",
"react-native": "0.43.4",
"react-native-login": "git+https://github.com/secondsun/react-native-login.git",
"react-navigation": "^1.0.0-beta.8"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
+ "jsx-control-statements": "^3.1.5",
+ "prettier": "^1.2.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
} | 4 | 0.133333 | 2 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.