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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e2370b30a5667ae27b55d833f617c8ab99651662 | index.html | index.html | <script src="node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
System.config({
map: {
css: 'node_modules/system-css/css.js',
json: 'node_modules/systemjs-plugin-json/json.js'
},
packages: {
'.': {
defaultExtension: 'js',
meta: {
'*.css': {
loader: 'css'
},
'*.json': {
loader: 'json'
}
}
}
}
});
System.import('test.json').then(function(test) { console.log(test.glossary); });
System.import('sub/cjs').then(function(cjs) { console.log(cjs); });
</script>
| <script src="node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
System.config({
map: {
css: 'node_modules/system-css/css.js',
json: 'node_modules/systemjs-plugin-json/json.js',
'phosphor-domutil': 'node_modules/phosphor-domutil/lib/index.js',
'phosphor-signaling': 'node_modules/phosphor-signaling/lib/index.js',
'phosphor-widget': 'node_modules/phosphor-widget/lib/index.js',
'phosphor-properties': 'node_modules/phosphor-properties/lib/index.js',
'phosphor-arrays': 'node_modules/phosphor-arrays/lib/index.js',
'phosphor-disposable': 'node_modules/phosphor-disposable/lib/index.js',
'phosphor-messaging': 'node_modules/phosphor-messaging/lib/index.js',
'phosphor-nodewrapper': 'node_modules/phosphor-nodewrapper/lib/index.js',
'phosphor-queue': 'node_modules/phosphor-queue/lib/index.js',
'phosphor-menus': 'node_modules/phosphor-menus/lib/index.js'
},
packages: {
'.': {
defaultExtension: 'js',
meta: {
'*.css': {
loader: 'css'
},
'*.json': {
loader: 'json'
}
}
}
}
});
System.import('test.json').then(function(test) { console.log(test.glossary); });
System.import('sub/cjs').then(function(cjs) { console.log(cjs); });
System.import('phosphor-menus').then(function(index) {console.log(index); });
</script>
| Add an import using node-modules | Add an import using node-modules
| HTML | mit | blink1073/systemjs-demo,blink1073/systemjs-demo | html | ## Code Before:
<script src="node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
System.config({
map: {
css: 'node_modules/system-css/css.js',
json: 'node_modules/systemjs-plugin-json/json.js'
},
packages: {
'.': {
defaultExtension: 'js',
meta: {
'*.css': {
loader: 'css'
},
'*.json': {
loader: 'json'
}
}
}
}
});
System.import('test.json').then(function(test) { console.log(test.glossary); });
System.import('sub/cjs').then(function(cjs) { console.log(cjs); });
</script>
## Instruction:
Add an import using node-modules
## Code After:
<script src="node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
System.config({
map: {
css: 'node_modules/system-css/css.js',
json: 'node_modules/systemjs-plugin-json/json.js',
'phosphor-domutil': 'node_modules/phosphor-domutil/lib/index.js',
'phosphor-signaling': 'node_modules/phosphor-signaling/lib/index.js',
'phosphor-widget': 'node_modules/phosphor-widget/lib/index.js',
'phosphor-properties': 'node_modules/phosphor-properties/lib/index.js',
'phosphor-arrays': 'node_modules/phosphor-arrays/lib/index.js',
'phosphor-disposable': 'node_modules/phosphor-disposable/lib/index.js',
'phosphor-messaging': 'node_modules/phosphor-messaging/lib/index.js',
'phosphor-nodewrapper': 'node_modules/phosphor-nodewrapper/lib/index.js',
'phosphor-queue': 'node_modules/phosphor-queue/lib/index.js',
'phosphor-menus': 'node_modules/phosphor-menus/lib/index.js'
},
packages: {
'.': {
defaultExtension: 'js',
meta: {
'*.css': {
loader: 'css'
},
'*.json': {
loader: 'json'
}
}
}
}
});
System.import('test.json').then(function(test) { console.log(test.glossary); });
System.import('sub/cjs').then(function(cjs) { console.log(cjs); });
System.import('phosphor-menus').then(function(index) {console.log(index); });
</script>
| <script src="node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
System.config({
map: {
css: 'node_modules/system-css/css.js',
- json: 'node_modules/systemjs-plugin-json/json.js'
+ json: 'node_modules/systemjs-plugin-json/json.js',
? +
+ 'phosphor-domutil': 'node_modules/phosphor-domutil/lib/index.js',
+ 'phosphor-signaling': 'node_modules/phosphor-signaling/lib/index.js',
+ 'phosphor-widget': 'node_modules/phosphor-widget/lib/index.js',
+ 'phosphor-properties': 'node_modules/phosphor-properties/lib/index.js',
+ 'phosphor-arrays': 'node_modules/phosphor-arrays/lib/index.js',
+ 'phosphor-disposable': 'node_modules/phosphor-disposable/lib/index.js',
+ 'phosphor-messaging': 'node_modules/phosphor-messaging/lib/index.js',
+ 'phosphor-nodewrapper': 'node_modules/phosphor-nodewrapper/lib/index.js',
+ 'phosphor-queue': 'node_modules/phosphor-queue/lib/index.js',
+ 'phosphor-menus': 'node_modules/phosphor-menus/lib/index.js'
},
packages: {
'.': {
defaultExtension: 'js',
meta: {
'*.css': {
loader: 'css'
},
'*.json': {
loader: 'json'
}
}
}
}
});
System.import('test.json').then(function(test) { console.log(test.glossary); });
System.import('sub/cjs').then(function(cjs) { console.log(cjs); });
+ System.import('phosphor-menus').then(function(index) {console.log(index); });
</script> | 13 | 0.5 | 12 | 1 |
af4541dd99146e33876930fe54449eac8e40cf22 | modules/core/travis_fail_reaction.js | modules/core/travis_fail_reaction.js | // PiscoBot Script
var commandDescription = {
name: 'Travis CI Build Fails',
author: 'Daniel Gallegos [@that_taco_guy]',
trigger: '',
version: 1.0,
description: 'Have the bot react to a build failing on Travis CI.',
module: 'Core'
};
global.botHelp.push(commandDescription);
var _ = require('underscore');
global.piscobot.on('bot_message', function(bot, message) {
if(!_.isEmpty(message.attachments)) {
var botMessage = message.attachments[0];
var regex = new RegExp(/Build.*of.*by .* (failed|errored) in/, 'g');
if(!_.isEmpty(botMessage.text) && regex.test(botMessage.text)) {
bot.api.reactions.add({
timestamp: message.ts,
channel: message.channel,
name: 'poop'
}, function(err) {
if(err) {
bot.botkit.log('Failed to add emoji reaction :(', err);
}
});
}
}
});
| // PiscoBot Script
var commandDescription = {
name: 'Travis CI Build Fails',
author: 'Daniel Gallegos [@that_taco_guy]',
trigger: '',
version: 1.0,
description: 'Have the bot react to a build failing on Travis CI.',
module: 'Core'
};
global.botHelp.push(commandDescription);
var _ = require('underscore');
global.piscobot.on('bot_message', function(bot, message) {
if(!_.isEmpty(message.attachments)) {
var botMessage = message.attachments[0];
var regex = /Build.*of.*by .* (failed|errored) in/g;
if(!_.isEmpty(botMessage.text) && regex.test(botMessage.text)) {
bot.api.reactions.add({
timestamp: message.ts,
channel: message.channel,
name: 'poop'
}, function(err) {
if(err) {
bot.botkit.log('Failed to add emoji reaction :(', err);
}
});
}
}
});
| Fix broken RegExp in Travis mentions | Fix broken RegExp in Travis mentions
| JavaScript | mit | devacademyla/PiscoBot,devacademyla/PiscoBot | javascript | ## Code Before:
// PiscoBot Script
var commandDescription = {
name: 'Travis CI Build Fails',
author: 'Daniel Gallegos [@that_taco_guy]',
trigger: '',
version: 1.0,
description: 'Have the bot react to a build failing on Travis CI.',
module: 'Core'
};
global.botHelp.push(commandDescription);
var _ = require('underscore');
global.piscobot.on('bot_message', function(bot, message) {
if(!_.isEmpty(message.attachments)) {
var botMessage = message.attachments[0];
var regex = new RegExp(/Build.*of.*by .* (failed|errored) in/, 'g');
if(!_.isEmpty(botMessage.text) && regex.test(botMessage.text)) {
bot.api.reactions.add({
timestamp: message.ts,
channel: message.channel,
name: 'poop'
}, function(err) {
if(err) {
bot.botkit.log('Failed to add emoji reaction :(', err);
}
});
}
}
});
## Instruction:
Fix broken RegExp in Travis mentions
## Code After:
// PiscoBot Script
var commandDescription = {
name: 'Travis CI Build Fails',
author: 'Daniel Gallegos [@that_taco_guy]',
trigger: '',
version: 1.0,
description: 'Have the bot react to a build failing on Travis CI.',
module: 'Core'
};
global.botHelp.push(commandDescription);
var _ = require('underscore');
global.piscobot.on('bot_message', function(bot, message) {
if(!_.isEmpty(message.attachments)) {
var botMessage = message.attachments[0];
var regex = /Build.*of.*by .* (failed|errored) in/g;
if(!_.isEmpty(botMessage.text) && regex.test(botMessage.text)) {
bot.api.reactions.add({
timestamp: message.ts,
channel: message.channel,
name: 'poop'
}, function(err) {
if(err) {
bot.botkit.log('Failed to add emoji reaction :(', err);
}
});
}
}
});
| // PiscoBot Script
var commandDescription = {
name: 'Travis CI Build Fails',
author: 'Daniel Gallegos [@that_taco_guy]',
trigger: '',
version: 1.0,
description: 'Have the bot react to a build failing on Travis CI.',
module: 'Core'
};
global.botHelp.push(commandDescription);
var _ = require('underscore');
global.piscobot.on('bot_message', function(bot, message) {
if(!_.isEmpty(message.attachments)) {
var botMessage = message.attachments[0];
- var regex = new RegExp(/Build.*of.*by .* (failed|errored) in/, 'g');
? ----------- --- --
+ var regex = /Build.*of.*by .* (failed|errored) in/g;
if(!_.isEmpty(botMessage.text) && regex.test(botMessage.text)) {
bot.api.reactions.add({
timestamp: message.ts,
channel: message.channel,
name: 'poop'
}, function(err) {
if(err) {
bot.botkit.log('Failed to add emoji reaction :(', err);
}
});
}
}
}); | 2 | 0.0625 | 1 | 1 |
9668a7946887f1510ab34f52a3868c10e0729e07 | .travis.yml | .travis.yml | language: node_js
node_js:
- "0.10"
before_script:
- npm install -g gulp
| language: node_js
node_js:
- '0.10'
before_script:
- npm install -g gulp
deploy:
provider: releases
api_key:
secure: jMfEk/5oF5NybZlrI2/QA3Gs2fYvE38GQQPyTVBgH5gBZqnaH4ij28fegxercTuzqO4AMGK7BvAmxNd6Wf95CYt72uuiRKFCpRto3/8kBh6TNS1SWQCB6U/heccr4hHGvPViCkkidPCAzAjRLe0TIkrHhJt1nQ5u/d6ZI3++e/0=
file: ./out/perfect-scrollbar.zip
on:
repo: noraesae/perfect-scrollbar
branch: master
tags: true
before_deploy:
- gulp
- gulp compress
| Add automatic release with TravisCI. | Add automatic release with TravisCI.
| YAML | mit | utatti/perfect-scrollbar,utatti/perfect-scrollbar,guandai/perfect-scrollbar | yaml | ## Code Before:
language: node_js
node_js:
- "0.10"
before_script:
- npm install -g gulp
## Instruction:
Add automatic release with TravisCI.
## Code After:
language: node_js
node_js:
- '0.10'
before_script:
- npm install -g gulp
deploy:
provider: releases
api_key:
secure: jMfEk/5oF5NybZlrI2/QA3Gs2fYvE38GQQPyTVBgH5gBZqnaH4ij28fegxercTuzqO4AMGK7BvAmxNd6Wf95CYt72uuiRKFCpRto3/8kBh6TNS1SWQCB6U/heccr4hHGvPViCkkidPCAzAjRLe0TIkrHhJt1nQ5u/d6ZI3++e/0=
file: ./out/perfect-scrollbar.zip
on:
repo: noraesae/perfect-scrollbar
branch: master
tags: true
before_deploy:
- gulp
- gulp compress
| language: node_js
node_js:
- - "0.10"
+ - '0.10'
before_script:
- - npm install -g gulp
? --
+ - npm install -g gulp
+ deploy:
+ provider: releases
+ api_key:
+ secure: jMfEk/5oF5NybZlrI2/QA3Gs2fYvE38GQQPyTVBgH5gBZqnaH4ij28fegxercTuzqO4AMGK7BvAmxNd6Wf95CYt72uuiRKFCpRto3/8kBh6TNS1SWQCB6U/heccr4hHGvPViCkkidPCAzAjRLe0TIkrHhJt1nQ5u/d6ZI3++e/0=
+ file: ./out/perfect-scrollbar.zip
+ on:
+ repo: noraesae/perfect-scrollbar
+ branch: master
+ tags: true
+ before_deploy:
+ - gulp
+ - gulp compress | 16 | 3.2 | 14 | 2 |
5d90d773032db5f118e33fbac717e255c6298050 | spec/main_spec.rb | spec/main_spec.rb | Capybara.app = MyApp
# Capybara.default_driver = :selenium
Capybara.default_driver = :poltergeist
Capybara.app_host = 'http://localhost:3000'
describe 'Show Top Page' do
it 'test' do
visit 'index.html'
file_path = File.expand_path('./screenshot.jpg')
script = %(document.body.style.backgroundColor = "white")
page.execute_script(script)
save_screenshot(file_path, full: true)
expect(page).to have_content 'click'
expect(page).to have_css('form > input')
end
end
| Capybara.app = MyApp
# Capybara.default_driver = :selenium
Capybara.default_driver = :poltergeist
Capybara.app_host = 'http://localhost:3000'
describe 'Show Top Page' do
it 'test' do
visit 'index.html'
file_path = File.expand_path('./screenshot.jpg')
save_screenshot(file_path, full: true)
expect(page).to have_content 'click'
expect(page).to have_css('form > input')
end
end
| Remove specification of white background | Remove specification of white background
| Ruby | mit | gouf/sinatra_with_capybara_rspec,gouf/sinatra_with_capybara_rspec | ruby | ## Code Before:
Capybara.app = MyApp
# Capybara.default_driver = :selenium
Capybara.default_driver = :poltergeist
Capybara.app_host = 'http://localhost:3000'
describe 'Show Top Page' do
it 'test' do
visit 'index.html'
file_path = File.expand_path('./screenshot.jpg')
script = %(document.body.style.backgroundColor = "white")
page.execute_script(script)
save_screenshot(file_path, full: true)
expect(page).to have_content 'click'
expect(page).to have_css('form > input')
end
end
## Instruction:
Remove specification of white background
## Code After:
Capybara.app = MyApp
# Capybara.default_driver = :selenium
Capybara.default_driver = :poltergeist
Capybara.app_host = 'http://localhost:3000'
describe 'Show Top Page' do
it 'test' do
visit 'index.html'
file_path = File.expand_path('./screenshot.jpg')
save_screenshot(file_path, full: true)
expect(page).to have_content 'click'
expect(page).to have_css('form > input')
end
end
| Capybara.app = MyApp
# Capybara.default_driver = :selenium
Capybara.default_driver = :poltergeist
Capybara.app_host = 'http://localhost:3000'
describe 'Show Top Page' do
it 'test' do
visit 'index.html'
file_path = File.expand_path('./screenshot.jpg')
- script = %(document.body.style.backgroundColor = "white")
- page.execute_script(script)
save_screenshot(file_path, full: true)
expect(page).to have_content 'click'
expect(page).to have_css('form > input')
end
end | 2 | 0.125 | 0 | 2 |
7e07232ab523910f5e963ca3d0e2a6b61d949e61 | lib/postamt/railtie.rb | lib/postamt/railtie.rb | module Postamt
class Railtie < Rails::Railtie
railtie_name "postamt"
attr_accessor :running_in_rake
rake_tasks do
self.running_in_rake = true
end
initializer "postamt.hook", before: "active_record.initialize_database" do |app|
if self.running_in_rake
# We mustn't hook into AR when db:migrate or db:test:load_schema
# run, but user-defined Rake tasks still need us
task_names = []
tasks_to_examine = Rake.application.top_level_tasks.map{ |task_name| Rake.application[task_name] }
until tasks_to_examine.empty?
task = tasks_to_examine.pop
task_names << task.name
tasks_to_examine += task.prerequisite_tasks
end
if task_names.any? { |task_name| task_name.start_with? "db:" }
# Stub out Postamt's monkeypatches if we're running in a Rake task
ActionController::Base.instance_eval do
def use_db_connection(connection, args)
end
end
ActiveRecord::Base.instance_eval do
class_attribute :default_connection
end
next
end
end
Postamt.hook!
end
end
end
| module Postamt
class Railtie < Rails::Railtie
railtie_name "postamt"
attr_accessor :running_in_rake
rake_tasks do
self.running_in_rake = true
end
initializer "postamt.hook", before: "active_record.initialize_database" do |app|
if self.running_in_rake
# We mustn't hook into AR when db:migrate or db:test:load_schema
# run, but user-defined Rake tasks still need us
task_names = []
tasks_to_examine = Rake.application.top_level_tasks.map{ |task_string|
task_name, task_args = Rake.application.parse_task_string(task_string)
Rake.application[task_name]
}
until tasks_to_examine.empty?
task = tasks_to_examine.pop
task_names << task.name
tasks_to_examine += task.prerequisite_tasks
end
if task_names.any? { |task_name| task_name.start_with? "db:" }
# Stub out Postamt's monkeypatches if we're running in a Rake task
ActionController::Base.instance_eval do
def use_db_connection(connection, args)
end
end
ActiveRecord::Base.instance_eval do
class_attribute :default_connection
end
next
end
end
Postamt.hook!
end
end
end
| Fix bug from improper handling of raketask string | Fix bug from improper handling of raketask string
| Ruby | mit | sauspiel/postamt,sauspiel/postamt,sauspiel/postamt | ruby | ## Code Before:
module Postamt
class Railtie < Rails::Railtie
railtie_name "postamt"
attr_accessor :running_in_rake
rake_tasks do
self.running_in_rake = true
end
initializer "postamt.hook", before: "active_record.initialize_database" do |app|
if self.running_in_rake
# We mustn't hook into AR when db:migrate or db:test:load_schema
# run, but user-defined Rake tasks still need us
task_names = []
tasks_to_examine = Rake.application.top_level_tasks.map{ |task_name| Rake.application[task_name] }
until tasks_to_examine.empty?
task = tasks_to_examine.pop
task_names << task.name
tasks_to_examine += task.prerequisite_tasks
end
if task_names.any? { |task_name| task_name.start_with? "db:" }
# Stub out Postamt's monkeypatches if we're running in a Rake task
ActionController::Base.instance_eval do
def use_db_connection(connection, args)
end
end
ActiveRecord::Base.instance_eval do
class_attribute :default_connection
end
next
end
end
Postamt.hook!
end
end
end
## Instruction:
Fix bug from improper handling of raketask string
## Code After:
module Postamt
class Railtie < Rails::Railtie
railtie_name "postamt"
attr_accessor :running_in_rake
rake_tasks do
self.running_in_rake = true
end
initializer "postamt.hook", before: "active_record.initialize_database" do |app|
if self.running_in_rake
# We mustn't hook into AR when db:migrate or db:test:load_schema
# run, but user-defined Rake tasks still need us
task_names = []
tasks_to_examine = Rake.application.top_level_tasks.map{ |task_string|
task_name, task_args = Rake.application.parse_task_string(task_string)
Rake.application[task_name]
}
until tasks_to_examine.empty?
task = tasks_to_examine.pop
task_names << task.name
tasks_to_examine += task.prerequisite_tasks
end
if task_names.any? { |task_name| task_name.start_with? "db:" }
# Stub out Postamt's monkeypatches if we're running in a Rake task
ActionController::Base.instance_eval do
def use_db_connection(connection, args)
end
end
ActiveRecord::Base.instance_eval do
class_attribute :default_connection
end
next
end
end
Postamt.hook!
end
end
end
| module Postamt
class Railtie < Rails::Railtie
railtie_name "postamt"
attr_accessor :running_in_rake
rake_tasks do
self.running_in_rake = true
end
initializer "postamt.hook", before: "active_record.initialize_database" do |app|
if self.running_in_rake
# We mustn't hook into AR when db:migrate or db:test:load_schema
# run, but user-defined Rake tasks still need us
task_names = []
- tasks_to_examine = Rake.application.top_level_tasks.map{ |task_name| Rake.application[task_name] }
? ^^^ ------------------------------
+ tasks_to_examine = Rake.application.top_level_tasks.map{ |task_string|
? ++++ ^
+ task_name, task_args = Rake.application.parse_task_string(task_string)
+ Rake.application[task_name]
+ }
until tasks_to_examine.empty?
task = tasks_to_examine.pop
task_names << task.name
tasks_to_examine += task.prerequisite_tasks
end
if task_names.any? { |task_name| task_name.start_with? "db:" }
# Stub out Postamt's monkeypatches if we're running in a Rake task
ActionController::Base.instance_eval do
def use_db_connection(connection, args)
end
end
ActiveRecord::Base.instance_eval do
class_attribute :default_connection
end
next
end
end
Postamt.hook!
end
end
end | 5 | 0.138889 | 4 | 1 |
3c4e0d2843dacc25cf864842c2fc0b7ce523ee3a | app/views/stars/_star.html.erb | app/views/stars/_star.html.erb | <li class="star sheer round clearfix">
<%= render :partial => 'shared/photo_pair',
:locals => {:star => star, :size => :square} %>
<div class="info">
<div class="reason">
<%= star.reason %>
</div>
<div class="time">
<%= friendly_time(star.created_at) %>
</div>
</div>
<%= render :partial => 'stars/second', :locals => {:star => star} %>
<ul class="comments">
<% star.comments.each do |comment| %>
<li>
<%= photo(comment.author) %>
<%= comment.author.name %>
<%= comment.body %>
<%= friendly_time(comment.created_at) %>
</li>
<% end %>
</ul>
</li>
| <li class="star sheer round clearfix">
<%= render :partial => 'shared/photo_pair',
:locals => {:star => star, :size => :square} %>
<div class="info">
<div class="reason">
<%= star.reason %>
</div>
<div class="time">
<%= friendly_time(star.created_at) %>
</div>
<div class="new_comment">
<% form_for(Comment.new(:star_id => star.id, :author_id => current_user.id)) do |f| %>
<%= f.error_messages %>
<%= f.hidden_field :star_id %>
<%= f.hidden_field :author_id %>
<p>
<%= f.label :body %><br />
<%= f.text_field :body %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
</div>
</div>
<%= render :partial => 'stars/second', :locals => {:star => star} %>
<ul class="comments">
<% star.comments.each do |comment| %>
<li>
<%= photo(comment.author) %>
<%= comment.author.name %>
<%= comment.body %>
<%= friendly_time(comment.created_at) %>
</li>
<% end %>
</ul>
</li>
| Add the comment form for each star | Add the comment form for each star
| HTML+ERB | mit | causes/stars-causes,causes/stars-causes | html+erb | ## Code Before:
<li class="star sheer round clearfix">
<%= render :partial => 'shared/photo_pair',
:locals => {:star => star, :size => :square} %>
<div class="info">
<div class="reason">
<%= star.reason %>
</div>
<div class="time">
<%= friendly_time(star.created_at) %>
</div>
</div>
<%= render :partial => 'stars/second', :locals => {:star => star} %>
<ul class="comments">
<% star.comments.each do |comment| %>
<li>
<%= photo(comment.author) %>
<%= comment.author.name %>
<%= comment.body %>
<%= friendly_time(comment.created_at) %>
</li>
<% end %>
</ul>
</li>
## Instruction:
Add the comment form for each star
## Code After:
<li class="star sheer round clearfix">
<%= render :partial => 'shared/photo_pair',
:locals => {:star => star, :size => :square} %>
<div class="info">
<div class="reason">
<%= star.reason %>
</div>
<div class="time">
<%= friendly_time(star.created_at) %>
</div>
<div class="new_comment">
<% form_for(Comment.new(:star_id => star.id, :author_id => current_user.id)) do |f| %>
<%= f.error_messages %>
<%= f.hidden_field :star_id %>
<%= f.hidden_field :author_id %>
<p>
<%= f.label :body %><br />
<%= f.text_field :body %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
</div>
</div>
<%= render :partial => 'stars/second', :locals => {:star => star} %>
<ul class="comments">
<% star.comments.each do |comment| %>
<li>
<%= photo(comment.author) %>
<%= comment.author.name %>
<%= comment.body %>
<%= friendly_time(comment.created_at) %>
</li>
<% end %>
</ul>
</li>
| <li class="star sheer round clearfix">
<%= render :partial => 'shared/photo_pair',
:locals => {:star => star, :size => :square} %>
<div class="info">
<div class="reason">
<%= star.reason %>
</div>
<div class="time">
<%= friendly_time(star.created_at) %>
</div>
+ <div class="new_comment">
+ <% form_for(Comment.new(:star_id => star.id, :author_id => current_user.id)) do |f| %>
+ <%= f.error_messages %>
+ <%= f.hidden_field :star_id %>
+ <%= f.hidden_field :author_id %>
+ <p>
+ <%= f.label :body %><br />
+ <%= f.text_field :body %>
+ </p>
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+ <% end %>
+ </div>
</div>
<%= render :partial => 'stars/second', :locals => {:star => star} %>
<ul class="comments">
<% star.comments.each do |comment| %>
<li>
<%= photo(comment.author) %>
<%= comment.author.name %>
<%= comment.body %>
<%= friendly_time(comment.created_at) %>
</li>
<% end %>
</ul>
</li> | 14 | 0.608696 | 14 | 0 |
db51cb8e93a40d7737babf936c50ba88a1665c21 | .github/workflows/ci.yml | .github/workflows/ci.yml | name: CI
on: [push, pull_request]
env:
GO11MODULE: on
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2-beta
with:
go-version: '^1.7'
- name: Check out code
uses: actions/checkout@9a3a9ade
with:
submodules: true
- name: Clean up extra files
run: rm ./testcases/*.go
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1
env:
GOROOT: ''
with:
golangci_lint_version: 'v1.23.6'
- name: Download deps
run: go mod download
- name: Run tests
run: go test -race -v ./...
- name: Submit coverage report
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -covermode=count -coverprofile=profile.cov
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
| name: CI
on: [push, pull_request]
env:
GO11MODULE: on
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.7'
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Clean up extra files
run: rm ./testcases/*.go
- name: Download deps
run: go mod download
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1
env:
GOROOT: ''
with:
golangci_lint_version: 'v1.23.6'
- name: Run tests
run: go test -race -v ./...
- name: Submit coverage report
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -covermode=count -coverprofile=profile.cov
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
| Update to stable versions of GitHub Actions | Update to stable versions of GitHub Actions | YAML | mit | go-irc/irc,go-irc/irc | yaml | ## Code Before:
name: CI
on: [push, pull_request]
env:
GO11MODULE: on
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2-beta
with:
go-version: '^1.7'
- name: Check out code
uses: actions/checkout@9a3a9ade
with:
submodules: true
- name: Clean up extra files
run: rm ./testcases/*.go
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1
env:
GOROOT: ''
with:
golangci_lint_version: 'v1.23.6'
- name: Download deps
run: go mod download
- name: Run tests
run: go test -race -v ./...
- name: Submit coverage report
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -covermode=count -coverprofile=profile.cov
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
## Instruction:
Update to stable versions of GitHub Actions
## Code After:
name: CI
on: [push, pull_request]
env:
GO11MODULE: on
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.7'
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Clean up extra files
run: rm ./testcases/*.go
- name: Download deps
run: go mod download
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1
env:
GOROOT: ''
with:
golangci_lint_version: 'v1.23.6'
- name: Run tests
run: go test -race -v ./...
- name: Submit coverage report
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -covermode=count -coverprofile=profile.cov
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
| name: CI
on: [push, pull_request]
env:
GO11MODULE: on
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
- uses: actions/setup-go@v2-beta
? -----
+ uses: actions/setup-go@v2
with:
go-version: '^1.7'
- name: Check out code
- uses: actions/checkout@9a3a9ade
? ^^^^^^^^
+ uses: actions/checkout@v2
? ^^
with:
submodules: true
- name: Clean up extra files
run: rm ./testcases/*.go
+
+ - name: Download deps
+ run: go mod download
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1
env:
GOROOT: ''
with:
golangci_lint_version: 'v1.23.6'
-
- - name: Download deps
- run: go mod download
- name: Run tests
run: go test -race -v ./...
- name: Submit coverage report
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -covermode=count -coverprofile=profile.cov
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
| 10 | 0.212766 | 5 | 5 |
ce54c5c29f49e32dd6adeb2e1ace9dcf889d5603 | packages/get-random-values/index.js | packages/get-random-values/index.js | const getRandomValues = (buf) => {
if (typeof process !== 'undefined') {
const nodeCrypto = require('crypto');
const bytes = nodeCrypto.randomBytes(buf.length);
buf.set(bytes);
return buf;
}
if (window.crypto && window.crypto.getRandomValues) {
return window.crypto.getRandomValues(buf);
}
if (window.msCrypto && window.msCrypto.getRandomValues) {
return window.msCrypto.getRandomValues(buf);
}
throw new Error('No secure random number generator available.');
};
module.exports = getRandomValues;
| const getRandomValues = (buf) => {
if (typeof process !== 'undefined') {
const nodeCrypto = require('crypto');
const bytes = nodeCrypto.randomBytes(buf.length);
buf.set(bytes);
return buf;
}
if (typeof crypto !== 'undefined') {
return crypto.getRandomValues(buf);
}
if (window.crypto && window.crypto.getRandomValues) {
return window.crypto.getRandomValues(buf);
}
if (window.msCrypto && window.msCrypto.getRandomValues) {
return window.msCrypto.getRandomValues(buf);
}
throw new Error('No secure random number generator available.');
};
module.exports = getRandomValues;
| Support generating random values in web worker without window | Support generating random values in web worker without window
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient | javascript | ## Code Before:
const getRandomValues = (buf) => {
if (typeof process !== 'undefined') {
const nodeCrypto = require('crypto');
const bytes = nodeCrypto.randomBytes(buf.length);
buf.set(bytes);
return buf;
}
if (window.crypto && window.crypto.getRandomValues) {
return window.crypto.getRandomValues(buf);
}
if (window.msCrypto && window.msCrypto.getRandomValues) {
return window.msCrypto.getRandomValues(buf);
}
throw new Error('No secure random number generator available.');
};
module.exports = getRandomValues;
## Instruction:
Support generating random values in web worker without window
## Code After:
const getRandomValues = (buf) => {
if (typeof process !== 'undefined') {
const nodeCrypto = require('crypto');
const bytes = nodeCrypto.randomBytes(buf.length);
buf.set(bytes);
return buf;
}
if (typeof crypto !== 'undefined') {
return crypto.getRandomValues(buf);
}
if (window.crypto && window.crypto.getRandomValues) {
return window.crypto.getRandomValues(buf);
}
if (window.msCrypto && window.msCrypto.getRandomValues) {
return window.msCrypto.getRandomValues(buf);
}
throw new Error('No secure random number generator available.');
};
module.exports = getRandomValues;
| const getRandomValues = (buf) => {
if (typeof process !== 'undefined') {
const nodeCrypto = require('crypto');
const bytes = nodeCrypto.randomBytes(buf.length);
buf.set(bytes);
return buf;
+ }
+
+ if (typeof crypto !== 'undefined') {
+ return crypto.getRandomValues(buf);
}
if (window.crypto && window.crypto.getRandomValues) {
return window.crypto.getRandomValues(buf);
}
if (window.msCrypto && window.msCrypto.getRandomValues) {
return window.msCrypto.getRandomValues(buf);
}
throw new Error('No secure random number generator available.');
};
module.exports = getRandomValues; | 4 | 0.2 | 4 | 0 |
4c4356d6492a3671d2b151455c3773f274f764b8 | app/assets/stylesheets/attending.css.scss | app/assets/stylesheets/attending.css.scss | // Place all the styles related to the attending controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.event {
text-align: left;
}
.event input[type='text'] {
width: 140px;
}
.event_choices {
border: 1px #A0A0A0 solid;
margin-top: -1px; // merge with previous line
}
.event_choice {
display: inline-block;
min-width: 275px;
}
.event_link {
text-align: right;
padding-bottom: 10px;
}
.tabs {
text-align:center;
}
.nexttab,
.prevtab {
display: inline-block;
width: 40%;
padding: 10px;
}
.nexttab:hover,
.prevtab:hover {
}
| // Place all the styles related to the attending controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.event {
text-align: left;
}
.event input[type='text'] {
width: 140px;
}
.event_choices {
border: 1px #A0A0A0 solid;
margin-top: -1px; // merge with previous line
}
.event_choice {
display: inline-block;
min-width: 275px;
}
.event_link {
text-align: right;
padding-bottom: 10px;
}
.tabs {
text-align:center;
}
.nexttab,
.prevtab {
display: inline-block;
width: 40%;
padding: 10px;
}
.prevtab:hover {
background-color: #ccc;
}
| Make prevtab button hover friendlier (grey not black) | Make prevtab button hover friendlier (grey not black)
| SCSS | mit | rdunlop/unicycling-registration,scotthue/unicycling-registration,scotthue/unicycling-registration,rdunlop/unicycling-registration,rdunlop/unicycling-registration,rdunlop/unicycling-registration,scotthue/unicycling-registration | scss | ## Code Before:
// Place all the styles related to the attending controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.event {
text-align: left;
}
.event input[type='text'] {
width: 140px;
}
.event_choices {
border: 1px #A0A0A0 solid;
margin-top: -1px; // merge with previous line
}
.event_choice {
display: inline-block;
min-width: 275px;
}
.event_link {
text-align: right;
padding-bottom: 10px;
}
.tabs {
text-align:center;
}
.nexttab,
.prevtab {
display: inline-block;
width: 40%;
padding: 10px;
}
.nexttab:hover,
.prevtab:hover {
}
## Instruction:
Make prevtab button hover friendlier (grey not black)
## Code After:
// Place all the styles related to the attending controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.event {
text-align: left;
}
.event input[type='text'] {
width: 140px;
}
.event_choices {
border: 1px #A0A0A0 solid;
margin-top: -1px; // merge with previous line
}
.event_choice {
display: inline-block;
min-width: 275px;
}
.event_link {
text-align: right;
padding-bottom: 10px;
}
.tabs {
text-align:center;
}
.nexttab,
.prevtab {
display: inline-block;
width: 40%;
padding: 10px;
}
.prevtab:hover {
background-color: #ccc;
}
| // Place all the styles related to the attending controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.event {
text-align: left;
}
.event input[type='text'] {
width: 140px;
}
.event_choices {
border: 1px #A0A0A0 solid;
margin-top: -1px; // merge with previous line
}
.event_choice {
display: inline-block;
min-width: 275px;
}
.event_link {
text-align: right;
padding-bottom: 10px;
}
.tabs {
text-align:center;
}
.nexttab,
.prevtab {
display: inline-block;
width: 40%;
padding: 10px;
}
- .nexttab:hover,
.prevtab:hover {
+ background-color: #ccc;
} | 2 | 0.055556 | 1 | 1 |
52baa36cddc1051e073df9cd63bdfacc5ccba5e1 | lib/client/rollbar-client.js | lib/client/rollbar-client.js | Meteor.startup(function() {
Tracker.autorun(function() {
if (Meteor.userId() && Meteor.user()) {
Rollbar.configure({
payload: {
person: {
id: Meteor.userId(),
username: Meteor.user().profile.name
}
}
});
} else {
Rollbar.configure({
payload: {
person: null
}
});
}
});
});
throwError = function() {
Meteor.apply('throwError', arguments, function(err, result) {
if (err) {
console.log("Could not log event to rollbar");
console.log(err);
}
});
};
handleError = function(error) {
Meteor.apply('handleError', arguments, function(err, result) {
console.log("Could not log error to rollbar");
console.log(err);
});
}; | Meteor.startup(function() {
Tracker.autorun(function() {
if (Meteor.userId() && Meteor.user()) {
Rollbar.configure({
payload: {
person: {
id: Meteor.userId(),
username: Meteor.user().profile && Meteor.user().profile.name
}
}
});
} else {
Rollbar.configure({
payload: {
person: null
}
});
}
});
});
throwError = function() {
Meteor.apply('throwError', arguments, function(err, result) {
if (err) {
console.log("Could not log event to rollbar");
console.log(err);
}
});
};
handleError = function(error) {
Meteor.apply('handleError', arguments, function(err, result) {
console.log("Could not log error to rollbar");
console.log(err);
});
}; | Allow for case where user has no profile. | Allow for case where user has no profile.
| JavaScript | mit | thesaucecode/meteor-rollbar,thesaucecode/meteor-rollbar | javascript | ## Code Before:
Meteor.startup(function() {
Tracker.autorun(function() {
if (Meteor.userId() && Meteor.user()) {
Rollbar.configure({
payload: {
person: {
id: Meteor.userId(),
username: Meteor.user().profile.name
}
}
});
} else {
Rollbar.configure({
payload: {
person: null
}
});
}
});
});
throwError = function() {
Meteor.apply('throwError', arguments, function(err, result) {
if (err) {
console.log("Could not log event to rollbar");
console.log(err);
}
});
};
handleError = function(error) {
Meteor.apply('handleError', arguments, function(err, result) {
console.log("Could not log error to rollbar");
console.log(err);
});
};
## Instruction:
Allow for case where user has no profile.
## Code After:
Meteor.startup(function() {
Tracker.autorun(function() {
if (Meteor.userId() && Meteor.user()) {
Rollbar.configure({
payload: {
person: {
id: Meteor.userId(),
username: Meteor.user().profile && Meteor.user().profile.name
}
}
});
} else {
Rollbar.configure({
payload: {
person: null
}
});
}
});
});
throwError = function() {
Meteor.apply('throwError', arguments, function(err, result) {
if (err) {
console.log("Could not log event to rollbar");
console.log(err);
}
});
};
handleError = function(error) {
Meteor.apply('handleError', arguments, function(err, result) {
console.log("Could not log error to rollbar");
console.log(err);
});
}; | Meteor.startup(function() {
Tracker.autorun(function() {
if (Meteor.userId() && Meteor.user()) {
Rollbar.configure({
payload: {
person: {
id: Meteor.userId(),
- username: Meteor.user().profile.name
+ username: Meteor.user().profile && Meteor.user().profile.name
? +++++++++++++++++++++++++
}
}
});
} else {
Rollbar.configure({
payload: {
person: null
}
});
}
});
});
throwError = function() {
Meteor.apply('throwError', arguments, function(err, result) {
if (err) {
console.log("Could not log event to rollbar");
console.log(err);
}
});
};
handleError = function(error) {
Meteor.apply('handleError', arguments, function(err, result) {
console.log("Could not log error to rollbar");
console.log(err);
});
}; | 2 | 0.055556 | 1 | 1 |
c4d4347d210a6e3b6d4cc19fb224734bb8b5234a | app/resources/views/layouts/app.twig | app/resources/views/layouts/app.twig | <!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ asset('app.js') }}" defer></script>
<link rel="icon" href="/app/resources/images/favicon.{{ config('dark_mode') ? 'dark' : 'light' }}.png">
<link rel="stylesheet" href="{{ asset('app.css') }}">
<title>{% block title %}{% endblock %} • Directory Lister</title>
<div id="app" class="flex flex-col min-h-screen font-mono {{ config('dark_mode') ? 'dark-mode' : '' }}">
{% block content %}{% endblock %}
</div>
| <!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ asset('app.js') }}" defer></script>
<link rel="icon" href="/app/resources/images/favicon.{{ config('dark_mode') ? 'dark' : 'light' }}.png">
<link rel="stylesheet" href="{{ asset('app.css') }}">
<title>{% block title %}{% endblock %} • Directory Lister</title>
<div id="app" class="flex flex-col min-h-screen font-mono {{ config('dark_mode') ? 'dark-mode' : 'light-mode' }}">
{% block content %}{% endblock %}
</div>
| Add 'light-mode' class when not in dark mode | Add 'light-mode' class when not in dark mode
| Twig | mit | DirectoryLister/DirectoryLister,DirectoryLister/DirectoryLister,DirectoryLister/DirectoryLister,DirectoryLister/DirectoryLister | twig | ## Code Before:
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ asset('app.js') }}" defer></script>
<link rel="icon" href="/app/resources/images/favicon.{{ config('dark_mode') ? 'dark' : 'light' }}.png">
<link rel="stylesheet" href="{{ asset('app.css') }}">
<title>{% block title %}{% endblock %} • Directory Lister</title>
<div id="app" class="flex flex-col min-h-screen font-mono {{ config('dark_mode') ? 'dark-mode' : '' }}">
{% block content %}{% endblock %}
</div>
## Instruction:
Add 'light-mode' class when not in dark mode
## Code After:
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ asset('app.js') }}" defer></script>
<link rel="icon" href="/app/resources/images/favicon.{{ config('dark_mode') ? 'dark' : 'light' }}.png">
<link rel="stylesheet" href="{{ asset('app.css') }}">
<title>{% block title %}{% endblock %} • Directory Lister</title>
<div id="app" class="flex flex-col min-h-screen font-mono {{ config('dark_mode') ? 'dark-mode' : 'light-mode' }}">
{% block content %}{% endblock %}
</div>
| <!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ asset('app.js') }}" defer></script>
<link rel="icon" href="/app/resources/images/favicon.{{ config('dark_mode') ? 'dark' : 'light' }}.png">
<link rel="stylesheet" href="{{ asset('app.css') }}">
<title>{% block title %}{% endblock %} • Directory Lister</title>
- <div id="app" class="flex flex-col min-h-screen font-mono {{ config('dark_mode') ? 'dark-mode' : '' }}">
+ <div id="app" class="flex flex-col min-h-screen font-mono {{ config('dark_mode') ? 'dark-mode' : 'light-mode' }}">
? ++++++++++
{% block content %}{% endblock %}
</div> | 2 | 0.142857 | 1 | 1 |
0a8cc71245b834954033c5ce4c7284fc8a5b09c9 | recipe-server/client/selfrepair/self_repair.js | recipe-server/client/selfrepair/self_repair.js | import NormandyDriver from 'selfrepair/normandy_driver';
import {
fetchRecipes,
filterContext,
doesRecipeMatch,
runRecipe,
} from 'selfrepair/self_repair_runner';
const driver = new NormandyDriver();
driver.registerCallbacks();
// Actually fetch and run the recipes.
fetchRecipes().then(recipes => {
filterContext(driver).then(context => {
// Update Normandy driver with user's country.
driver._location.countryCode = context.normandy.country;
for (const recipe of recipes) {
doesRecipeMatch(recipe, context).then(([, match]) => {
if (match) {
runRecipe(recipe, driver).catch(err => {
console.error(err);
});
}
});
}
});
}).catch(err => {
console.error(err);
});
| import NormandyDriver from 'selfrepair/normandy_driver';
import {
fetchRecipes,
filterContext,
doesRecipeMatch,
runRecipe,
} from 'selfrepair/self_repair_runner';
const driver = new NormandyDriver();
driver.registerCallbacks();
// Actually fetch and run the recipes.
fetchRecipes().then(recipes => {
filterContext(driver).then(context => {
for (const recipe of recipes) {
doesRecipeMatch(recipe, context).then(([, match]) => {
if (match) {
runRecipe(recipe, driver).catch(err => {
console.error(err);
});
}
});
}
});
}).catch(err => {
console.error(err);
});
| Remove stale reference to driver.location | self-repair: Remove stale reference to driver.location
| JavaScript | mpl-2.0 | mozilla/normandy,mozilla/normandy,mozilla/normandy,Osmose/normandy,Osmose/normandy,Osmose/normandy,mozilla/normandy,Osmose/normandy | javascript | ## Code Before:
import NormandyDriver from 'selfrepair/normandy_driver';
import {
fetchRecipes,
filterContext,
doesRecipeMatch,
runRecipe,
} from 'selfrepair/self_repair_runner';
const driver = new NormandyDriver();
driver.registerCallbacks();
// Actually fetch and run the recipes.
fetchRecipes().then(recipes => {
filterContext(driver).then(context => {
// Update Normandy driver with user's country.
driver._location.countryCode = context.normandy.country;
for (const recipe of recipes) {
doesRecipeMatch(recipe, context).then(([, match]) => {
if (match) {
runRecipe(recipe, driver).catch(err => {
console.error(err);
});
}
});
}
});
}).catch(err => {
console.error(err);
});
## Instruction:
self-repair: Remove stale reference to driver.location
## Code After:
import NormandyDriver from 'selfrepair/normandy_driver';
import {
fetchRecipes,
filterContext,
doesRecipeMatch,
runRecipe,
} from 'selfrepair/self_repair_runner';
const driver = new NormandyDriver();
driver.registerCallbacks();
// Actually fetch and run the recipes.
fetchRecipes().then(recipes => {
filterContext(driver).then(context => {
for (const recipe of recipes) {
doesRecipeMatch(recipe, context).then(([, match]) => {
if (match) {
runRecipe(recipe, driver).catch(err => {
console.error(err);
});
}
});
}
});
}).catch(err => {
console.error(err);
});
| import NormandyDriver from 'selfrepair/normandy_driver';
import {
fetchRecipes,
filterContext,
doesRecipeMatch,
runRecipe,
} from 'selfrepair/self_repair_runner';
const driver = new NormandyDriver();
driver.registerCallbacks();
// Actually fetch and run the recipes.
fetchRecipes().then(recipes => {
filterContext(driver).then(context => {
- // Update Normandy driver with user's country.
- driver._location.countryCode = context.normandy.country;
-
for (const recipe of recipes) {
doesRecipeMatch(recipe, context).then(([, match]) => {
if (match) {
runRecipe(recipe, driver).catch(err => {
console.error(err);
});
}
});
}
});
}).catch(err => {
console.error(err);
}); | 3 | 0.1 | 0 | 3 |
f69b8e2cdf48fa4e9b31096788ee6cf72812a29a | Instanssi/ext_blog/templates/ext_blog/blog_messages.html | Instanssi/ext_blog/templates/ext_blog/blog_messages.html | <div id="blog">
{% for entry in entries %}
<div class="message">
<div class="title">{{ entry.title }}</div>
{{ entry.text|safe }}
<div class="date">{{ entry.date|date:"d.m.Y \k\l\o\. H:i" }}</div>
</div>
{% endfor %}
</div>
| <div id="blog">
{% for entry in entries %}
<div class="message">
<div class="title"><a name="blog{{ entry.id }}">{{ entry.title }}</a></div>
{{ entry.text|safe }}
<div class="date">{{ entry.date|date:"d.m.Y \k\l\o\. H:i" }}</div>
</div>
{% endfor %}
</div>
| Add anchor name to blog messages for easier access. | ext_blog: Add anchor name to blog messages for easier access.
| HTML | mit | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | html | ## Code Before:
<div id="blog">
{% for entry in entries %}
<div class="message">
<div class="title">{{ entry.title }}</div>
{{ entry.text|safe }}
<div class="date">{{ entry.date|date:"d.m.Y \k\l\o\. H:i" }}</div>
</div>
{% endfor %}
</div>
## Instruction:
ext_blog: Add anchor name to blog messages for easier access.
## Code After:
<div id="blog">
{% for entry in entries %}
<div class="message">
<div class="title"><a name="blog{{ entry.id }}">{{ entry.title }}</a></div>
{{ entry.text|safe }}
<div class="date">{{ entry.date|date:"d.m.Y \k\l\o\. H:i" }}</div>
</div>
{% endfor %}
</div>
| <div id="blog">
{% for entry in entries %}
<div class="message">
- <div class="title">{{ entry.title }}</div>
+ <div class="title"><a name="blog{{ entry.id }}">{{ entry.title }}</a></div>
{{ entry.text|safe }}
<div class="date">{{ entry.date|date:"d.m.Y \k\l\o\. H:i" }}</div>
</div>
{% endfor %}
</div> | 2 | 0.222222 | 1 | 1 |
35750137cd17f507ea418607bd1eb37be04f149e | src/main/java/de/aikiit/fotocollector/main/DateJacksonSerializer.java | src/main/java/de/aikiit/fotocollector/main/DateJacksonSerializer.java | package de.aikiit.fotocollector.main;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author hirsch
* @version 2016-03-10, 23:38
*/
public class DateJacksonSerializer extends JsonSerializer<Date> {
@Override
public void serialize(final Date value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
String formattedDate = value != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value) : "none";
gen.writeString(formattedDate);
}
}
| package de.aikiit.fotocollector.main;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* @author hirsch
* @version 2016-03-10, 23:38
*/
public class DateJacksonSerializer extends JsonSerializer<Date> {
@Override
public void serialize(final Date value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
String formattedDate = value != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.GERMANY).format(value) : "none";
gen.writeString(formattedDate);
}
}
| Add Locale to date formatting. | Add Locale to date formatting.
| Java | apache-2.0 | ottlinger/fotocollector,ottlinger/fotocollector | java | ## Code Before:
package de.aikiit.fotocollector.main;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author hirsch
* @version 2016-03-10, 23:38
*/
public class DateJacksonSerializer extends JsonSerializer<Date> {
@Override
public void serialize(final Date value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
String formattedDate = value != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value) : "none";
gen.writeString(formattedDate);
}
}
## Instruction:
Add Locale to date formatting.
## Code After:
package de.aikiit.fotocollector.main;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* @author hirsch
* @version 2016-03-10, 23:38
*/
public class DateJacksonSerializer extends JsonSerializer<Date> {
@Override
public void serialize(final Date value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
String formattedDate = value != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.GERMANY).format(value) : "none";
gen.writeString(formattedDate);
}
}
| package de.aikiit.fotocollector.main;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
+ import java.util.Locale;
/**
* @author hirsch
* @version 2016-03-10, 23:38
*/
public class DateJacksonSerializer extends JsonSerializer<Date> {
@Override
public void serialize(final Date value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
- String formattedDate = value != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value) : "none";
+ String formattedDate = value != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.GERMANY).format(value) : "none";
? ++++++++++++++++
gen.writeString(formattedDate);
}
} | 3 | 0.136364 | 2 | 1 |
660ad6b6918e8459e8c510b17e5f41ab01f70393 | app/settings/settings.rb | app/settings/settings.rb | require 'yaml'
module Settings
extend self
@_settings = {}
def load
@_settings = YAML.load_file("#{Rails.root}/config/settings.yml")
end
def get(key)
@_settings[key.to_s]
end
def set(key, value)
@_settings[key.to_s] = value
write
end
def write
File.open("#{Rails.root}/config/settings.yml", 'w+') do |f|
f.write(YAML.dump(@_settings))
end
end
end
| require 'yaml'
module Settings
class << self
@_settings = {}
def load
@_settings = YAML.load_file("#{Rails.root}/config/settings.yml")
end
def get(key)
@_settings[key.to_s]
end
def set(key, value)
@_settings[key.to_s] = value
write
end
def write
File.open("#{Rails.root}/config/settings.yml", 'w+') do |f|
f.write(YAML.dump(@_settings))
end
end
end
end
| Modify Settings as class singleton | Modify Settings as class singleton
| Ruby | mit | danitrap/terebi,danitrap/terebi,danitrap/terebi | ruby | ## Code Before:
require 'yaml'
module Settings
extend self
@_settings = {}
def load
@_settings = YAML.load_file("#{Rails.root}/config/settings.yml")
end
def get(key)
@_settings[key.to_s]
end
def set(key, value)
@_settings[key.to_s] = value
write
end
def write
File.open("#{Rails.root}/config/settings.yml", 'w+') do |f|
f.write(YAML.dump(@_settings))
end
end
end
## Instruction:
Modify Settings as class singleton
## Code After:
require 'yaml'
module Settings
class << self
@_settings = {}
def load
@_settings = YAML.load_file("#{Rails.root}/config/settings.yml")
end
def get(key)
@_settings[key.to_s]
end
def set(key, value)
@_settings[key.to_s] = value
write
end
def write
File.open("#{Rails.root}/config/settings.yml", 'w+') do |f|
f.write(YAML.dump(@_settings))
end
end
end
end
| require 'yaml'
module Settings
+ class << self
- extend self
-
@_settings = {}
- def load
+ def load
? ++
- @_settings = YAML.load_file("#{Rails.root}/config/settings.yml")
+ @_settings = YAML.load_file("#{Rails.root}/config/settings.yml")
? ++
- end
+ end
? ++
- def get(key)
+ def get(key)
? ++
- @_settings[key.to_s]
+ @_settings[key.to_s]
? ++
- end
+ end
? ++
- def set(key, value)
+ def set(key, value)
? ++
- @_settings[key.to_s] = value
+ @_settings[key.to_s] = value
? ++
- write
+ write
? ++
- end
+ end
? ++
- def write
+ def write
? ++
- File.open("#{Rails.root}/config/settings.yml", 'w+') do |f|
+ File.open("#{Rails.root}/config/settings.yml", 'w+') do |f|
? ++
- f.write(YAML.dump(@_settings))
+ f.write(YAML.dump(@_settings))
? ++
+ end
end
end
end | 30 | 1.111111 | 15 | 15 |
4c31d79e581717e4104b0b62cc2127f0603cb078 | pages/thanks.html | pages/thanks.html | ---
title: Contact
nav: contact
permalink: /thanks/
layout: default
---
<h1>Thank You!</h1>
| ---
title: Contact
nav: contact
permalink: /thanks/
layout: default
---
<h1>Thank you!</h1>
<p>Your message was received. I'll get back to you shortly.</p>
| Update copy for the contact message sent page | Update copy for the contact message sent page | HTML | mit | felipead/felipead.github.io,felipead/felipead.github.io,felipead/felipead.github.com,felipead/felipead.github.com | html | ## Code Before:
---
title: Contact
nav: contact
permalink: /thanks/
layout: default
---
<h1>Thank You!</h1>
## Instruction:
Update copy for the contact message sent page
## Code After:
---
title: Contact
nav: contact
permalink: /thanks/
layout: default
---
<h1>Thank you!</h1>
<p>Your message was received. I'll get back to you shortly.</p>
| ---
title: Contact
nav: contact
permalink: /thanks/
layout: default
---
- <h1>Thank You!</h1>
? ^
+ <h1>Thank you!</h1>
? ^
+
+ <p>Your message was received. I'll get back to you shortly.</p> | 4 | 0.5 | 3 | 1 |
b5dc826a07c8183f6c960888db73f6feb1e5a780 | etc/consul/consul.json | etc/consul/consul.json | {
"disable_update_check": true,
"disable_remote_exec": true,
"log_level": "warn",
"cert_file": "/etc/tls/consul.service.consul.pem",
"key_file": "/etc/tls/consul.service.consul.key",
"ca_file": "/etc/tls/ca.pem",
"verify_incoming": true,
"verify_outgoing": true,
"verify_server_hostname": true,
"acl_default_policy": "allow",
"acl_down_policy": "extend-cache",
"addresses": {
"dns": "0.0.0.0",
"https": "0.0.0.0"
},
"ports": {
"dns": 53,
"https": 8501
},
"recursors": [ "9.9.9.9" ],
"dns_config": {
"enable_truncate": true
},
"limits": {
"rpc_rate": 1000
}
}
| {
"disable_update_check": true,
"disable_remote_exec": true,
"log_level": "warn",
"cert_file": "/etc/tls/consul.service.consul.pem",
"key_file": "/etc/tls/consul.service.consul.key",
"ca_file": "/etc/tls/ca.pem",
"verify_incoming": true,
"verify_outgoing": true,
"verify_server_hostname": true,
"acl_default_policy": "allow",
"acl_down_policy": "extend-cache",
"addresses": {
"dns": "0.0.0.0",
"https": "0.0.0.0"
},
"ports": {
"dns": 53,
"https": 8501
},
"recursors": [ "1.1.1.1", "1.0.0.1", "9.9.9.9" ],
"dns_config": {
"enable_truncate": true
},
"limits": {
"rpc_rate": 1000
}
}
| Add Cludflare's 1.1.1.1 DNS servers as recursors | Add Cludflare's 1.1.1.1 DNS servers as recursors
| JSON | isc | mterron/consul-betterscratch,mterron/consul | json | ## Code Before:
{
"disable_update_check": true,
"disable_remote_exec": true,
"log_level": "warn",
"cert_file": "/etc/tls/consul.service.consul.pem",
"key_file": "/etc/tls/consul.service.consul.key",
"ca_file": "/etc/tls/ca.pem",
"verify_incoming": true,
"verify_outgoing": true,
"verify_server_hostname": true,
"acl_default_policy": "allow",
"acl_down_policy": "extend-cache",
"addresses": {
"dns": "0.0.0.0",
"https": "0.0.0.0"
},
"ports": {
"dns": 53,
"https": 8501
},
"recursors": [ "9.9.9.9" ],
"dns_config": {
"enable_truncate": true
},
"limits": {
"rpc_rate": 1000
}
}
## Instruction:
Add Cludflare's 1.1.1.1 DNS servers as recursors
## Code After:
{
"disable_update_check": true,
"disable_remote_exec": true,
"log_level": "warn",
"cert_file": "/etc/tls/consul.service.consul.pem",
"key_file": "/etc/tls/consul.service.consul.key",
"ca_file": "/etc/tls/ca.pem",
"verify_incoming": true,
"verify_outgoing": true,
"verify_server_hostname": true,
"acl_default_policy": "allow",
"acl_down_policy": "extend-cache",
"addresses": {
"dns": "0.0.0.0",
"https": "0.0.0.0"
},
"ports": {
"dns": 53,
"https": 8501
},
"recursors": [ "1.1.1.1", "1.0.0.1", "9.9.9.9" ],
"dns_config": {
"enable_truncate": true
},
"limits": {
"rpc_rate": 1000
}
}
| {
"disable_update_check": true,
"disable_remote_exec": true,
"log_level": "warn",
"cert_file": "/etc/tls/consul.service.consul.pem",
"key_file": "/etc/tls/consul.service.consul.key",
"ca_file": "/etc/tls/ca.pem",
"verify_incoming": true,
"verify_outgoing": true,
"verify_server_hostname": true,
"acl_default_policy": "allow",
"acl_down_policy": "extend-cache",
"addresses": {
"dns": "0.0.0.0",
"https": "0.0.0.0"
},
"ports": {
"dns": 53,
"https": 8501
},
- "recursors": [ "9.9.9.9" ],
+ "recursors": [ "1.1.1.1", "1.0.0.1", "9.9.9.9" ],
"dns_config": {
"enable_truncate": true
},
"limits": {
"rpc_rate": 1000
}
} | 2 | 0.064516 | 1 | 1 |
50a497763d916f4776636ff3a453fc66582b8a95 | public/Try.elm | public/Try.elm | import Website.Message (report)
main = report [markdown|
# Online Editor
Write and compile code online!
* <a href="/edit/examples/Elements/HelloWorld.elm" target="_top">Hello World!</a>
* <a href="/edit/examples/Elements/Image.elm" target="_top">Images</a>
* <a href="/edit/examples/Elements/LinearGradient.elm" target="_top">Gradients</a>
For more guidance check out:
* <a href="/Examples.elm" target="_top">Tons more examples</a>
* <a href="/Learn.elm" target="_top">Learning resources</a>
|] | import Website.Message (report)
main = report [markdown|
# Online Editor
Write and compile code online!
* <a href="/edit/examples/Elements/HelloWorld.elm" target="_top">Hello World!</a>
* <a href="/edit/examples/Reactive/Position.elm" target="_top">Mouse</a>
* <a href="/edit/examples/Intermediate/Clock.elm" target="_top">Clock</a>
For more guidance check out:
* <a href="/Examples.elm" target="_top">Tons more examples</a>
* <a href="/Learn.elm" target="_top">Learning resources</a>
|] | Use @mgold's suggestion for better examples | Use @mgold's suggestion for better examples
| Elm | bsd-3-clause | randomer/elm-lang.org,ThomasWeiser/elm-lang.org,kevinrood/elm-lang.org,semaj/jameslarisch.com-elm,FranklinChen/elm-lang.org,yang-wei/elm-lang.org,coreyhaines/elm-lang.org,liubko/elm-lang.org,randomer/elm-lang.org,rtfeldman/elm-lang.org,jvoigtlaender/elm-lang.org,frankschmitt/elm-lang.org,avh4/elm-lang.org,jazmit/elm-lang.org,yang-wei/elm-lang.org,amitaibu/elm-lang.org,frankschmitt/elm-lang.org,coreyhaines/elm-lang.org,akeeton/elm-lang.org,rtorr/elm-lang.org,rtfeldman/elm-lang.org,inchingforward/elm-lang.org,eeue56/elm-lang.org,ThomasWeiser/elm-lang.org,akeeton/elm-lang.org,liubko/elm-lang.org,elm-guides/elm-lang.org,eeue56/elm-lang.org,jvoigtlaender/elm-lang.org,FranklinChen/elm-lang.org,inchingforward/elm-lang.org,kevinrood/elm-lang.org,jazmit/elm-lang.org,amitaibu/elm-lang.org,elm-guides/elm-lang.org,rtorr/elm-lang.org | elm | ## Code Before:
import Website.Message (report)
main = report [markdown|
# Online Editor
Write and compile code online!
* <a href="/edit/examples/Elements/HelloWorld.elm" target="_top">Hello World!</a>
* <a href="/edit/examples/Elements/Image.elm" target="_top">Images</a>
* <a href="/edit/examples/Elements/LinearGradient.elm" target="_top">Gradients</a>
For more guidance check out:
* <a href="/Examples.elm" target="_top">Tons more examples</a>
* <a href="/Learn.elm" target="_top">Learning resources</a>
|]
## Instruction:
Use @mgold's suggestion for better examples
## Code After:
import Website.Message (report)
main = report [markdown|
# Online Editor
Write and compile code online!
* <a href="/edit/examples/Elements/HelloWorld.elm" target="_top">Hello World!</a>
* <a href="/edit/examples/Reactive/Position.elm" target="_top">Mouse</a>
* <a href="/edit/examples/Intermediate/Clock.elm" target="_top">Clock</a>
For more guidance check out:
* <a href="/Examples.elm" target="_top">Tons more examples</a>
* <a href="/Learn.elm" target="_top">Learning resources</a>
|] | import Website.Message (report)
main = report [markdown|
# Online Editor
Write and compile code online!
* <a href="/edit/examples/Elements/HelloWorld.elm" target="_top">Hello World!</a>
+ * <a href="/edit/examples/Reactive/Position.elm" target="_top">Mouse</a>
- * <a href="/edit/examples/Elements/Image.elm" target="_top">Images</a>
? ^^ ^ ^ ^^^^^ ^^^^^^
+ * <a href="/edit/examples/Intermediate/Clock.elm" target="_top">Clock</a>
? ^^^ + ^^^ ^ ^^^^^ ^^^^^
- * <a href="/edit/examples/Elements/LinearGradient.elm" target="_top">Gradients</a>
For more guidance check out:
* <a href="/Examples.elm" target="_top">Tons more examples</a>
* <a href="/Learn.elm" target="_top">Learning resources</a>
|] | 4 | 0.222222 | 2 | 2 |
0ef47bb8b4ec70f41deb2798ae2fd62022fcffcc | .travis.yml | .travis.yml | language: objective-c
xcode_project: Project/BTKInjector.xcodeproj
xcode_scheme: BTKInjector
xcode_sdk:
- iphonesimulator7.1
- iphonesimulator7.0
- iphonesimulator6.1
before_install:
- brew update
- brew upgrade xctool
| language: objective-c
xcode_project: Project/BTKInjector.xcodeproj
xcode_scheme: BTKInjector
xcode_sdk:
- iphonesimulator7.1
- iphonesimulator7.0
before_install:
- brew update
- brew upgrade xctool
| Remove iphonesimulator6.1 from target SDKs | Remove iphonesimulator6.1 from target SDKs
Because tests fails from following error message
```
BTKInjectorDuckTypingTests.m:34:90: error: reference to 'NSNotFound' is ambiguous
XCTAssertTrue(([exception.reason rangeOfString:@"does not conforms"].location != NSNotFound)
```
| YAML | apache-2.0 | tomohisaota/BTKInjector,tomohisaota/BTKInjector | yaml | ## Code Before:
language: objective-c
xcode_project: Project/BTKInjector.xcodeproj
xcode_scheme: BTKInjector
xcode_sdk:
- iphonesimulator7.1
- iphonesimulator7.0
- iphonesimulator6.1
before_install:
- brew update
- brew upgrade xctool
## Instruction:
Remove iphonesimulator6.1 from target SDKs
Because tests fails from following error message
```
BTKInjectorDuckTypingTests.m:34:90: error: reference to 'NSNotFound' is ambiguous
XCTAssertTrue(([exception.reason rangeOfString:@"does not conforms"].location != NSNotFound)
```
## Code After:
language: objective-c
xcode_project: Project/BTKInjector.xcodeproj
xcode_scheme: BTKInjector
xcode_sdk:
- iphonesimulator7.1
- iphonesimulator7.0
before_install:
- brew update
- brew upgrade xctool
| language: objective-c
xcode_project: Project/BTKInjector.xcodeproj
xcode_scheme: BTKInjector
xcode_sdk:
- iphonesimulator7.1
- iphonesimulator7.0
- - iphonesimulator6.1
before_install:
- brew update
- brew upgrade xctool | 1 | 0.083333 | 0 | 1 |
e9988de9efdbbd1e710835319b6e0f552f1697d5 | vim/colors.vim | vim/colors.vim | if !exists('g:colors_name') || g:colors_name != 'solarized8_dark'
colorscheme solarized8_dark
endif
| if !exists('g:colors_name') || g:colors_name != 'solarized8_dark'
colorscheme solarized8_dark
endif
nnoremap <localleader>B :<c-u>exe "colors" (g:colors_name =~# "dark"
\ ? substitute(g:colors_name, 'dark', 'light', '')
\ : substitute(g:colors_name, 'light', 'dark', '')
\ )<cr>
| Add vim keybinding to switch solarized themes | Add vim keybinding to switch solarized themes
| VimL | mit | gaalcaras/dotfiles,gaalcaras/dotfiles | viml | ## Code Before:
if !exists('g:colors_name') || g:colors_name != 'solarized8_dark'
colorscheme solarized8_dark
endif
## Instruction:
Add vim keybinding to switch solarized themes
## Code After:
if !exists('g:colors_name') || g:colors_name != 'solarized8_dark'
colorscheme solarized8_dark
endif
nnoremap <localleader>B :<c-u>exe "colors" (g:colors_name =~# "dark"
\ ? substitute(g:colors_name, 'dark', 'light', '')
\ : substitute(g:colors_name, 'light', 'dark', '')
\ )<cr>
| if !exists('g:colors_name') || g:colors_name != 'solarized8_dark'
colorscheme solarized8_dark
endif
+
+ nnoremap <localleader>B :<c-u>exe "colors" (g:colors_name =~# "dark"
+ \ ? substitute(g:colors_name, 'dark', 'light', '')
+ \ : substitute(g:colors_name, 'light', 'dark', '')
+ \ )<cr> | 5 | 1.666667 | 5 | 0 |
450ad8aef4536dca726d4e68401a12efa1cc44a0 | README.md | README.md | GSS engine [](https://travis-ci.org/gss/engine)
==========
[](https://saucelabs.com/u/gss-engine)
Compiles and runs Grid Style Sheet (GSS) rules. GSS is an implementation of Badros & Borning's [Constraint Cascading Style Sheets](http://www.cs.washington.edu/research/constraints/web/ccss-uwtr.pdf), enabling far better layout control through building relational rules between different elements.
GSS supports the following syntaxes for defining layout rules:
* [CCSS](https://github.com/gss/ccss-compiler#readme) - direct constraints related to position and size of DOM elements
* [VFL](https://github.com/gss/vfl-compiler#readme) - horizontal and vertical spacing constraints based on [Apple's Visual Format Language](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/VisualFormatLanguage/VisualFormatLanguage.html)
The main GSS repository provides a [Component](http://component.io/) library handling both the compilation and application of the layout constraints.
Please refer to <http://gridstylesheets.org/> for documentation and usage instructions.
| GSS engine [](https://travis-ci.org/gss/engine)
==========
[](https://saucelabs.com/u/gss-engine)
Compiles and runs Grid Style Sheet (GSS) rules. GSS is an implementation of Badros & Borning's [Constraint Cascading Style Sheets](http://www.cs.washington.edu/research/constraints/web/ccss-uwtr.pdf), enabling far better layout control through building relational rules between different elements.
GSS supports the following syntaxes for defining layout rules:
* [CCSS](https://github.com/gss/ccss-compiler#readme) - direct constraints related to position and size of DOM elements
* [VFL](https://github.com/gss/vfl-compiler#readme) - horizontal and vertical spacing constraints based on [Apple's Visual Format Language](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/VisualFormatLanguage/VisualFormatLanguage.html)
The main GSS repository provides a [Component](http://component.io/) library handling both the compilation and application of the layout constraints.
## Documentation
**_GSS is heavily under development. Updated documentation coming soon._**
Please refer to <http://gridstylesheets.org/> for legacy documentation and usage instructions.
| Add note about outdated documentation. | Add note about outdated documentation.
| Markdown | mit | mcanthony/gss-engine,seedtigo/engine,DavidStrada/engine,defconcepts/engine,17tsejm1/engine,defconcepts/engine,seedtigo/engine,DavidStrada/engine,gss/engine,17tsejm1/engine,mcanthony/gss-engine | markdown | ## Code Before:
GSS engine [](https://travis-ci.org/gss/engine)
==========
[](https://saucelabs.com/u/gss-engine)
Compiles and runs Grid Style Sheet (GSS) rules. GSS is an implementation of Badros & Borning's [Constraint Cascading Style Sheets](http://www.cs.washington.edu/research/constraints/web/ccss-uwtr.pdf), enabling far better layout control through building relational rules between different elements.
GSS supports the following syntaxes for defining layout rules:
* [CCSS](https://github.com/gss/ccss-compiler#readme) - direct constraints related to position and size of DOM elements
* [VFL](https://github.com/gss/vfl-compiler#readme) - horizontal and vertical spacing constraints based on [Apple's Visual Format Language](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/VisualFormatLanguage/VisualFormatLanguage.html)
The main GSS repository provides a [Component](http://component.io/) library handling both the compilation and application of the layout constraints.
Please refer to <http://gridstylesheets.org/> for documentation and usage instructions.
## Instruction:
Add note about outdated documentation.
## Code After:
GSS engine [](https://travis-ci.org/gss/engine)
==========
[](https://saucelabs.com/u/gss-engine)
Compiles and runs Grid Style Sheet (GSS) rules. GSS is an implementation of Badros & Borning's [Constraint Cascading Style Sheets](http://www.cs.washington.edu/research/constraints/web/ccss-uwtr.pdf), enabling far better layout control through building relational rules between different elements.
GSS supports the following syntaxes for defining layout rules:
* [CCSS](https://github.com/gss/ccss-compiler#readme) - direct constraints related to position and size of DOM elements
* [VFL](https://github.com/gss/vfl-compiler#readme) - horizontal and vertical spacing constraints based on [Apple's Visual Format Language](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/VisualFormatLanguage/VisualFormatLanguage.html)
The main GSS repository provides a [Component](http://component.io/) library handling both the compilation and application of the layout constraints.
## Documentation
**_GSS is heavily under development. Updated documentation coming soon._**
Please refer to <http://gridstylesheets.org/> for legacy documentation and usage instructions.
| GSS engine [](https://travis-ci.org/gss/engine)
==========
[](https://saucelabs.com/u/gss-engine)
Compiles and runs Grid Style Sheet (GSS) rules. GSS is an implementation of Badros & Borning's [Constraint Cascading Style Sheets](http://www.cs.washington.edu/research/constraints/web/ccss-uwtr.pdf), enabling far better layout control through building relational rules between different elements.
GSS supports the following syntaxes for defining layout rules:
* [CCSS](https://github.com/gss/ccss-compiler#readme) - direct constraints related to position and size of DOM elements
* [VFL](https://github.com/gss/vfl-compiler#readme) - horizontal and vertical spacing constraints based on [Apple's Visual Format Language](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/VisualFormatLanguage/VisualFormatLanguage.html)
The main GSS repository provides a [Component](http://component.io/) library handling both the compilation and application of the layout constraints.
+
+ ## Documentation
+
+ **_GSS is heavily under development. Updated documentation coming soon._**
+
- Please refer to <http://gridstylesheets.org/> for documentation and usage instructions.
+ Please refer to <http://gridstylesheets.org/> for legacy documentation and usage instructions.
? +++++++
| 7 | 0.466667 | 6 | 1 |
8044b3d432c7ac521400ff38822bf56db04c47ba | project/Build.scala | project/Build.scala | import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "Play20StartApp"
val appVersion = "1.0"
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.2",
"com.roundeights" % "hasher" % "0.3" from "http://cloud.github.com/downloads/Nycto/Hasher/hasher_2.9.1-0.3.jar",
"org.mindrot" % "jbcrypt" % "0.3m"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Apache" at "http://repo1.maven.org/maven2/",
resolvers += "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/"
)
}
| import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "Play20StartApp"
val appVersion = "1.0"
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.2",
"org.mindrot" % "jbcrypt" % "0.3m"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Apache" at "http://repo1.maven.org/maven2/",
resolvers += "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/"
)
}
| Remove Hasher library reference, as it's not being used. | Remove Hasher library reference, as it's not being used.
| Scala | bsd-3-clause | bmjares/self_service,bmjares/self_service,yesnault/PlayStartApp,yesnault/PlayStartApp | scala | ## Code Before:
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "Play20StartApp"
val appVersion = "1.0"
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.2",
"com.roundeights" % "hasher" % "0.3" from "http://cloud.github.com/downloads/Nycto/Hasher/hasher_2.9.1-0.3.jar",
"org.mindrot" % "jbcrypt" % "0.3m"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Apache" at "http://repo1.maven.org/maven2/",
resolvers += "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/"
)
}
## Instruction:
Remove Hasher library reference, as it's not being used.
## Code After:
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "Play20StartApp"
val appVersion = "1.0"
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.2",
"org.mindrot" % "jbcrypt" % "0.3m"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Apache" at "http://repo1.maven.org/maven2/",
resolvers += "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/"
)
}
| import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "Play20StartApp"
val appVersion = "1.0"
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.2",
- "com.roundeights" % "hasher" % "0.3" from "http://cloud.github.com/downloads/Nycto/Hasher/hasher_2.9.1-0.3.jar",
"org.mindrot" % "jbcrypt" % "0.3m"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Apache" at "http://repo1.maven.org/maven2/",
resolvers += "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/"
)
} | 1 | 0.045455 | 0 | 1 |
6f5631f2e25bb9d4c1a86901cfda5a10a04df30f | README.md | README.md |
Drip is continuous integration for npm.
## Running
Starting the server:
node script/server.js
Starting workers:
node script/worker.js
## Requirements
drip has the following requirements:
* redis (for resque, and scheduling and working of builds)
* mongodb (for storage of build statistics)
## Testing
Run:
npm test
## Authors
drip was written by [Christopher Meiklejohn](mailto:christopher.meiklejohn@gmail.com), [Simon Højberg](http://twitter.com/shojberg), and Barnaby Claydon for the [2011 Node Knockout](http://nodeknockout.com).
## License
Copyright © 2011 drip. It is free software, and may be redistributed under the terms specified in the LICENSE file.
|
Drip is continuous integration for npm.
## Running
Starting the server:
node script/server.js
Starting workers:
node script/worker.js
## Requirements
drip has the following requirements:
* redis (for resque, and scheduling and working of builds)
* mongodb (for storage of build statistics)
## Compiling
coffee -c **/*.coffee
## Testing
npm test
## Running
Be sure to have the following environment variables set:
NODE_ENV, PORT, REDIS_URL, REDIS_PORT, REDIS_HOST, MONGO_URL
## Authors
drip was written by [Christopher Meiklejohn](mailto:christopher.meiklejohn@gmail.com), [Simon Højberg](http://twitter.com/shojberg), and Barnaby Claydon for the [2011 Node Knockout](http://nodeknockout.com).
## License
Copyright © 2011 drip. It is free software, and may be redistributed under the terms specified in the LICENSE file.
| Add more to the readme. | Add more to the readme.
| Markdown | mit | drip/drip | markdown | ## Code Before:
Drip is continuous integration for npm.
## Running
Starting the server:
node script/server.js
Starting workers:
node script/worker.js
## Requirements
drip has the following requirements:
* redis (for resque, and scheduling and working of builds)
* mongodb (for storage of build statistics)
## Testing
Run:
npm test
## Authors
drip was written by [Christopher Meiklejohn](mailto:christopher.meiklejohn@gmail.com), [Simon Højberg](http://twitter.com/shojberg), and Barnaby Claydon for the [2011 Node Knockout](http://nodeknockout.com).
## License
Copyright © 2011 drip. It is free software, and may be redistributed under the terms specified in the LICENSE file.
## Instruction:
Add more to the readme.
## Code After:
Drip is continuous integration for npm.
## Running
Starting the server:
node script/server.js
Starting workers:
node script/worker.js
## Requirements
drip has the following requirements:
* redis (for resque, and scheduling and working of builds)
* mongodb (for storage of build statistics)
## Compiling
coffee -c **/*.coffee
## Testing
npm test
## Running
Be sure to have the following environment variables set:
NODE_ENV, PORT, REDIS_URL, REDIS_PORT, REDIS_HOST, MONGO_URL
## Authors
drip was written by [Christopher Meiklejohn](mailto:christopher.meiklejohn@gmail.com), [Simon Højberg](http://twitter.com/shojberg), and Barnaby Claydon for the [2011 Node Knockout](http://nodeknockout.com).
## License
Copyright © 2011 drip. It is free software, and may be redistributed under the terms specified in the LICENSE file.
|
Drip is continuous integration for npm.
## Running
Starting the server:
node script/server.js
Starting workers:
node script/worker.js
## Requirements
drip has the following requirements:
* redis (for resque, and scheduling and working of builds)
* mongodb (for storage of build statistics)
+ ## Compiling
+
+ coffee -c **/*.coffee
+
## Testing
- Run:
-
npm test
+
+ ## Running
+
+ Be sure to have the following environment variables set:
+
+ NODE_ENV, PORT, REDIS_URL, REDIS_PORT, REDIS_HOST, MONGO_URL
## Authors
drip was written by [Christopher Meiklejohn](mailto:christopher.meiklejohn@gmail.com), [Simon Højberg](http://twitter.com/shojberg), and Barnaby Claydon for the [2011 Node Knockout](http://nodeknockout.com).
## License
Copyright © 2011 drip. It is free software, and may be redistributed under the terms specified in the LICENSE file. | 12 | 0.363636 | 10 | 2 |
c3fddc4bbdd412493f1335330d15460f8be6bb00 | .s3deploy.yml | .s3deploy.yml | ---
aws_bucket: www.rustforrubyists.com
skip_regex: (md)|(book/header.html)|(book/footer.html)|(txt)|(yml)|(Makefile)|(gitignore)|(xml)|(.tgz)|(LICENSE)$
| ---
aws_bucket: www.rustforrubyists.com
skip_regex: (pdf)|(mobi)|(epub)|(md)|(book/header.html)|(book/footer.html)|(txt)|(yml)|(Makefile)|(gitignore)|(xml)|(.tgz)|(LICENSE)$
| Revert "actually deploy epubs and such" | Revert "actually deploy epubs and such"
This reverts commit 1d9c1171a89de2265654612456a20a545f1991e5.
This was dumb.
| YAML | agpl-3.0 | dskecse/rust_for_rubyists,dskecse/rust_for_rubyists,dskecse/rust_for_rubyists,steveklabnik/rust_for_rubyists,steveklabnik/rust_for_rubyists,steveklabnik/rust_for_rubyists,gpbonillas/rust_for_rubyists,gpbonillas/rust_for_rubyists,gpbonillas/rust_for_rubyists | yaml | ## Code Before:
---
aws_bucket: www.rustforrubyists.com
skip_regex: (md)|(book/header.html)|(book/footer.html)|(txt)|(yml)|(Makefile)|(gitignore)|(xml)|(.tgz)|(LICENSE)$
## Instruction:
Revert "actually deploy epubs and such"
This reverts commit 1d9c1171a89de2265654612456a20a545f1991e5.
This was dumb.
## Code After:
---
aws_bucket: www.rustforrubyists.com
skip_regex: (pdf)|(mobi)|(epub)|(md)|(book/header.html)|(book/footer.html)|(txt)|(yml)|(Makefile)|(gitignore)|(xml)|(.tgz)|(LICENSE)$
| ---
aws_bucket: www.rustforrubyists.com
- skip_regex: (md)|(book/header.html)|(book/footer.html)|(txt)|(yml)|(Makefile)|(gitignore)|(xml)|(.tgz)|(LICENSE)$
+ skip_regex: (pdf)|(mobi)|(epub)|(md)|(book/header.html)|(book/footer.html)|(txt)|(yml)|(Makefile)|(gitignore)|(xml)|(.tgz)|(LICENSE)$
? ++++++++++++++++++++
| 2 | 0.5 | 1 | 1 |
1c62224c83ad8a80a224a83033222251d9262e58 | src/Entity/EntityInterface.php | src/Entity/EntityInterface.php | <?php declare(strict_types=1);
namespace Cjsaylor\Domain\Entity;
use Cjsaylor\Domain\Behavior\ArraySerializable;
interface EntityInterface extends \ArrayAccess, ArraySerializable
{
}
| <?php declare(strict_types=1);
namespace Cjsaylor\Domain\Entity;
use Cjsaylor\Domain\Behavior\ArraySerializable;
interface EntityInterface extends \ArrayAccess, ArraySerializable
{
public function initialize(array $data = []) : void;
}
| Enforce an initialize method for entity interface. | Enforce an initialize method for entity interface.
| PHP | mit | cjsaylor/libdomain | php | ## Code Before:
<?php declare(strict_types=1);
namespace Cjsaylor\Domain\Entity;
use Cjsaylor\Domain\Behavior\ArraySerializable;
interface EntityInterface extends \ArrayAccess, ArraySerializable
{
}
## Instruction:
Enforce an initialize method for entity interface.
## Code After:
<?php declare(strict_types=1);
namespace Cjsaylor\Domain\Entity;
use Cjsaylor\Domain\Behavior\ArraySerializable;
interface EntityInterface extends \ArrayAccess, ArraySerializable
{
public function initialize(array $data = []) : void;
}
| <?php declare(strict_types=1);
namespace Cjsaylor\Domain\Entity;
use Cjsaylor\Domain\Behavior\ArraySerializable;
interface EntityInterface extends \ArrayAccess, ArraySerializable
{
+ public function initialize(array $data = []) : void;
} | 1 | 0.111111 | 1 | 0 |
2574a677cac656d263c2e79e24544d37e3c5ab48 | documentation/source/users/rmg/installation/index.rst | documentation/source/users/rmg/installation/index.rst | .. _installation:
************
Installation
************
.. NOTE::
It is recommended that RMG be installed with Python 2.7, although it has been previously tested that Python 2.5 and 2.6 may also work. Dependency issues render it incompatible with Python 3.x releases.
For Basic Users: Binary Installation Using Anaconda
===================================================
It is highly recommended to use the Python platform Anaconda to perform the installation of RMG-Py.
A binary installation is recommended for users who want to use RMG out of the box, and are
not interested in changing or recompiling the RMG code or making many additions to
RMG's thermodynamic and kinetics databases.
.. toctree::
:maxdepth: 1
anacondaUser
anacondaUserWindows
For Developers: Installation by Source Using Anaconda Environment
=================================================================
RMG-Py can now be built by source using the Anaconda Python Platform to assist in installing
all necessary dependencies. This is recommended for a developer who may be altering the RMG source code
or someone who expects to manipulate the databases extensively. You will also be able to access the latest
source code updates and patches through Github.
.. toctree::
:maxdepth: 1
anacondaDeveloper
anacondaDeveloperWindows
Dependencies
============
Please visit the page below for detailed information on all of RMG's dependencies and their license restrictions
.. toctree::
:maxdepth: 1
dependencies | .. _installation:
************
Installation
************
.. NOTE::
It is recommended that RMG be installed with Python 2.7, although it has been previously tested that Python 2.5 and 2.6 may also work. Dependency issues render it incompatible with Python 3.x releases.
For Basic Users: Binary Installation Using Anaconda
===================================================
It is highly recommended to use the Python platform Anaconda to perform the installation of RMG-Py.
A binary installation is recommended for users who want to use RMG out of the box, and are
not interested in changing or recompiling the RMG code or making many additions to
RMG's thermodynamic and kinetics databases.
.. toctree::
:maxdepth: 1
anacondaUser
anacondaUserWindows
windowsEnvironment
For Developers: Installation by Source Using Anaconda Environment
=================================================================
RMG-Py can now be built by source using the Anaconda Python Platform to assist in installing
all necessary dependencies. This is recommended for a developer who may be altering the RMG source code
or someone who expects to manipulate the databases extensively. You will also be able to access the latest
source code updates and patches through Github.
.. toctree::
:maxdepth: 1
anacondaDeveloper
anacondaDeveloperWindows
windowsEnvironment
Dependencies
============
Please visit the page below for detailed information on all of RMG's dependencies and their license restrictions
.. toctree::
:maxdepth: 1
dependencies | Add setting the windows environment to the doctree so that it apepars in pdf | Add setting the windows environment to the doctree so that it apepars in pdf
| reStructuredText | mit | pierrelb/RMG-Py,nickvandewiele/RMG-Py,nyee/RMG-Py,chatelak/RMG-Py,nyee/RMG-Py,chatelak/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py | restructuredtext | ## Code Before:
.. _installation:
************
Installation
************
.. NOTE::
It is recommended that RMG be installed with Python 2.7, although it has been previously tested that Python 2.5 and 2.6 may also work. Dependency issues render it incompatible with Python 3.x releases.
For Basic Users: Binary Installation Using Anaconda
===================================================
It is highly recommended to use the Python platform Anaconda to perform the installation of RMG-Py.
A binary installation is recommended for users who want to use RMG out of the box, and are
not interested in changing or recompiling the RMG code or making many additions to
RMG's thermodynamic and kinetics databases.
.. toctree::
:maxdepth: 1
anacondaUser
anacondaUserWindows
For Developers: Installation by Source Using Anaconda Environment
=================================================================
RMG-Py can now be built by source using the Anaconda Python Platform to assist in installing
all necessary dependencies. This is recommended for a developer who may be altering the RMG source code
or someone who expects to manipulate the databases extensively. You will also be able to access the latest
source code updates and patches through Github.
.. toctree::
:maxdepth: 1
anacondaDeveloper
anacondaDeveloperWindows
Dependencies
============
Please visit the page below for detailed information on all of RMG's dependencies and their license restrictions
.. toctree::
:maxdepth: 1
dependencies
## Instruction:
Add setting the windows environment to the doctree so that it apepars in pdf
## Code After:
.. _installation:
************
Installation
************
.. NOTE::
It is recommended that RMG be installed with Python 2.7, although it has been previously tested that Python 2.5 and 2.6 may also work. Dependency issues render it incompatible with Python 3.x releases.
For Basic Users: Binary Installation Using Anaconda
===================================================
It is highly recommended to use the Python platform Anaconda to perform the installation of RMG-Py.
A binary installation is recommended for users who want to use RMG out of the box, and are
not interested in changing or recompiling the RMG code or making many additions to
RMG's thermodynamic and kinetics databases.
.. toctree::
:maxdepth: 1
anacondaUser
anacondaUserWindows
windowsEnvironment
For Developers: Installation by Source Using Anaconda Environment
=================================================================
RMG-Py can now be built by source using the Anaconda Python Platform to assist in installing
all necessary dependencies. This is recommended for a developer who may be altering the RMG source code
or someone who expects to manipulate the databases extensively. You will also be able to access the latest
source code updates and patches through Github.
.. toctree::
:maxdepth: 1
anacondaDeveloper
anacondaDeveloperWindows
windowsEnvironment
Dependencies
============
Please visit the page below for detailed information on all of RMG's dependencies and their license restrictions
.. toctree::
:maxdepth: 1
dependencies | .. _installation:
************
Installation
************
.. NOTE::
It is recommended that RMG be installed with Python 2.7, although it has been previously tested that Python 2.5 and 2.6 may also work. Dependency issues render it incompatible with Python 3.x releases.
For Basic Users: Binary Installation Using Anaconda
===================================================
It is highly recommended to use the Python platform Anaconda to perform the installation of RMG-Py.
A binary installation is recommended for users who want to use RMG out of the box, and are
not interested in changing or recompiling the RMG code or making many additions to
RMG's thermodynamic and kinetics databases.
.. toctree::
:maxdepth: 1
anacondaUser
anacondaUserWindows
+ windowsEnvironment
For Developers: Installation by Source Using Anaconda Environment
=================================================================
RMG-Py can now be built by source using the Anaconda Python Platform to assist in installing
all necessary dependencies. This is recommended for a developer who may be altering the RMG source code
or someone who expects to manipulate the databases extensively. You will also be able to access the latest
source code updates and patches through Github.
.. toctree::
:maxdepth: 1
anacondaDeveloper
anacondaDeveloperWindows
+ windowsEnvironment
Dependencies
============
Please visit the page below for detailed information on all of RMG's dependencies and their license restrictions
.. toctree::
:maxdepth: 1
dependencies | 2 | 0.04 | 2 | 0 |
1fae522622d477b12acf262475146005a795df35 | README.md | README.md | Config Loader
=============
[](https://packagist.org/packages/garoevans/config_loader) [](https://travis-ci.org/garoevans/config_loader) [](https://packagist.org/packages/garoevans/config_loader)
Installation
------------
This library requires PHP 5.3 or later, and is installable and autoloadable via Composer as [garoevans/config_loader](https://packagist.org/packages/garoevans/config_loader).
Usage
-----
<?php
use Garoevans\ConfigLoader;
$config = ConfigLoader('config_directory', 'ini_file_name.ini');
$config->load();
// Gets the ini section called 'db' or returns an empty array
$config->get('db', array());
// Gets the value of 'host' from the 'db' section or returns an empty string
$config->get('db/host', ''); | Config Loader
=============
[](https://packagist.org/packages/garoevans/config_loader) [](https://travis-ci.org/garoevans/config_loader) [](https://packagist.org/packages/garoevans/config_loader)
Installation
------------
This library requires PHP 5.3 or later, and is installable and autoloadable via Composer as [garoevans/config_loader](https://packagist.org/packages/garoevans/config_loader).
Usage
-----
```php
use Garoevans\ConfigLoader;
$config = ConfigLoader('config_directory', 'ini_file_name.ini');
$config->load();
// Gets the ini section called 'db' or returns an empty array
$config->get('db', array());
// Gets the value of 'host' from the 'db' section or returns an empty string
$config->get('db/host', '');
```
| Update readme to syntax highlight PHP | Update readme to syntax highlight PHP
| Markdown | mit | garoevans/config_loader | markdown | ## Code Before:
Config Loader
=============
[](https://packagist.org/packages/garoevans/config_loader) [](https://travis-ci.org/garoevans/config_loader) [](https://packagist.org/packages/garoevans/config_loader)
Installation
------------
This library requires PHP 5.3 or later, and is installable and autoloadable via Composer as [garoevans/config_loader](https://packagist.org/packages/garoevans/config_loader).
Usage
-----
<?php
use Garoevans\ConfigLoader;
$config = ConfigLoader('config_directory', 'ini_file_name.ini');
$config->load();
// Gets the ini section called 'db' or returns an empty array
$config->get('db', array());
// Gets the value of 'host' from the 'db' section or returns an empty string
$config->get('db/host', '');
## Instruction:
Update readme to syntax highlight PHP
## Code After:
Config Loader
=============
[](https://packagist.org/packages/garoevans/config_loader) [](https://travis-ci.org/garoevans/config_loader) [](https://packagist.org/packages/garoevans/config_loader)
Installation
------------
This library requires PHP 5.3 or later, and is installable and autoloadable via Composer as [garoevans/config_loader](https://packagist.org/packages/garoevans/config_loader).
Usage
-----
```php
use Garoevans\ConfigLoader;
$config = ConfigLoader('config_directory', 'ini_file_name.ini');
$config->load();
// Gets the ini section called 'db' or returns an empty array
$config->get('db', array());
// Gets the value of 'host' from the 'db' section or returns an empty string
$config->get('db/host', '');
```
| Config Loader
=============
[](https://packagist.org/packages/garoevans/config_loader) [](https://travis-ci.org/garoevans/config_loader) [](https://packagist.org/packages/garoevans/config_loader)
Installation
------------
This library requires PHP 5.3 or later, and is installable and autoloadable via Composer as [garoevans/config_loader](https://packagist.org/packages/garoevans/config_loader).
Usage
-----
- <?php
+ ```php
- use Garoevans\ConfigLoader;
? ----
+ use Garoevans\ConfigLoader;
- $config = ConfigLoader('config_directory', 'ini_file_name.ini');
? ----
+ $config = ConfigLoader('config_directory', 'ini_file_name.ini');
- $config->load();
? ----
+ $config->load();
- // Gets the ini section called 'db' or returns an empty array
? ----
+ // Gets the ini section called 'db' or returns an empty array
- $config->get('db', array());
? ----
+ $config->get('db', array());
- // Gets the value of 'host' from the 'db' section or returns an empty string
? ----
+ // Gets the value of 'host' from the 'db' section or returns an empty string
- $config->get('db/host', '');
? ----
+ $config->get('db/host', '');
+ ``` | 17 | 0.708333 | 9 | 8 |
03322a4009b3e1a3f73ec73a03d9cfc3786c5d0a | _includes/welcome.md | _includes/welcome.md | Howdy, Cloud Adventurer!
========================
You've stumbled across the Microsoft Azure Web Sites Cheat Sheet -- The quickest reference for getting to know [Microsoft Azure Web Sites][WAWS] on the web. If you're looking for some [tutorials][WAWSTutorial] on how to develop solutions on Microsoft Azure Web Sites check out the [Microsoft Azure][WindowsAzure] product site or the [Microsoft Azure Training Kit][WATK].
Browse around this one page reference for information on **command-line tools**<!--, **language references**, lesser known **utilities**--> for managing your Microsoft Azure Web Sites. Take a quick look at the **features** that are offered on Microsoft Azure Web Sites then start exploring the wonderful world of Microsoft Azure!
[Try Microsoft Azure Web Sites today for free!][FreeTrial]
[WindowsAzure]: http://www.windowsazure.com
[WAWSTutorial]: http://www.windowsazure.com/en-us/develop/overview
[WAWS]: http://www.windowsazure.com/en-us/home/scenarios/web-sites
[WATK]: http://www.windowsazure.com/en-us/develop/net/other-resources/training-kit
[FreeTrial]: http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=ACBCB6EE5
| Howdy, Cloud Adventurer!
========================
You've stumbled across the Microsoft Azure Web Sites Cheat Sheet -- The quickest reference for getting to know [Microsoft Azure Web Sites][WAWS] on the web. If you're looking for some [tutorials][WAWSTutorial] on how to develop solutions on Microsoft Azure Web Sites check out the [Microsoft Azure][WindowsAzure] product site.
Browse around this one page reference for information on **command-line tools**<!--, **language references**, lesser known **utilities**--> for managing your Microsoft Azure Web Sites. Take a quick look at the **features** that are offered on Microsoft Azure Web Sites then start exploring the wonderful world of Microsoft Azure!
[Try Microsoft Azure Web Sites today for free!][FreeTrial]
[WindowsAzure]: http://www.windowsazure.com
[WAWSTutorial]: http://www.windowsazure.com/en-us/develop/overview
[WAWS]: http://www.windowsazure.com/en-us/home/scenarios/web-sites
[FreeTrial]: http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=ACBCB6EE5
| Remove cross links to the training kit | Remove cross links to the training kit
The training kit topic on azure.microsoft.com is being removed from the site. This link is driving about 50 page views every three months to that, so I'm removing the link. | Markdown | apache-2.0 | cicorias/MicrosoftAzureWebSitesCheatSheet,stephbu/MicrosoftAzureWebSitesCheatSheet | markdown | ## Code Before:
Howdy, Cloud Adventurer!
========================
You've stumbled across the Microsoft Azure Web Sites Cheat Sheet -- The quickest reference for getting to know [Microsoft Azure Web Sites][WAWS] on the web. If you're looking for some [tutorials][WAWSTutorial] on how to develop solutions on Microsoft Azure Web Sites check out the [Microsoft Azure][WindowsAzure] product site or the [Microsoft Azure Training Kit][WATK].
Browse around this one page reference for information on **command-line tools**<!--, **language references**, lesser known **utilities**--> for managing your Microsoft Azure Web Sites. Take a quick look at the **features** that are offered on Microsoft Azure Web Sites then start exploring the wonderful world of Microsoft Azure!
[Try Microsoft Azure Web Sites today for free!][FreeTrial]
[WindowsAzure]: http://www.windowsazure.com
[WAWSTutorial]: http://www.windowsazure.com/en-us/develop/overview
[WAWS]: http://www.windowsazure.com/en-us/home/scenarios/web-sites
[WATK]: http://www.windowsazure.com/en-us/develop/net/other-resources/training-kit
[FreeTrial]: http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=ACBCB6EE5
## Instruction:
Remove cross links to the training kit
The training kit topic on azure.microsoft.com is being removed from the site. This link is driving about 50 page views every three months to that, so I'm removing the link.
## Code After:
Howdy, Cloud Adventurer!
========================
You've stumbled across the Microsoft Azure Web Sites Cheat Sheet -- The quickest reference for getting to know [Microsoft Azure Web Sites][WAWS] on the web. If you're looking for some [tutorials][WAWSTutorial] on how to develop solutions on Microsoft Azure Web Sites check out the [Microsoft Azure][WindowsAzure] product site.
Browse around this one page reference for information on **command-line tools**<!--, **language references**, lesser known **utilities**--> for managing your Microsoft Azure Web Sites. Take a quick look at the **features** that are offered on Microsoft Azure Web Sites then start exploring the wonderful world of Microsoft Azure!
[Try Microsoft Azure Web Sites today for free!][FreeTrial]
[WindowsAzure]: http://www.windowsazure.com
[WAWSTutorial]: http://www.windowsazure.com/en-us/develop/overview
[WAWS]: http://www.windowsazure.com/en-us/home/scenarios/web-sites
[FreeTrial]: http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=ACBCB6EE5
| Howdy, Cloud Adventurer!
========================
- You've stumbled across the Microsoft Azure Web Sites Cheat Sheet -- The quickest reference for getting to know [Microsoft Azure Web Sites][WAWS] on the web. If you're looking for some [tutorials][WAWSTutorial] on how to develop solutions on Microsoft Azure Web Sites check out the [Microsoft Azure][WindowsAzure] product site or the [Microsoft Azure Training Kit][WATK].
? --------------------------------------------
+ You've stumbled across the Microsoft Azure Web Sites Cheat Sheet -- The quickest reference for getting to know [Microsoft Azure Web Sites][WAWS] on the web. If you're looking for some [tutorials][WAWSTutorial] on how to develop solutions on Microsoft Azure Web Sites check out the [Microsoft Azure][WindowsAzure] product site.
Browse around this one page reference for information on **command-line tools**<!--, **language references**, lesser known **utilities**--> for managing your Microsoft Azure Web Sites. Take a quick look at the **features** that are offered on Microsoft Azure Web Sites then start exploring the wonderful world of Microsoft Azure!
[Try Microsoft Azure Web Sites today for free!][FreeTrial]
[WindowsAzure]: http://www.windowsazure.com
[WAWSTutorial]: http://www.windowsazure.com/en-us/develop/overview
[WAWS]: http://www.windowsazure.com/en-us/home/scenarios/web-sites
- [WATK]: http://www.windowsazure.com/en-us/develop/net/other-resources/training-kit
[FreeTrial]: http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=ACBCB6EE5 | 3 | 0.214286 | 1 | 2 |
4bb0baca00f907c4ccf4777fddc35d537341aeb2 | composer.json | composer.json | {
"name": "thujohn/analytics",
"description": "Google Analytics for Laravel 4",
"keywords": ["analytics", "laravel", "laravel4"],
"license": "MIT",
"authors": [
{
"name": "Jonathan Thuau",
"email": "jonathan.thuau@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": ">=4.0.0",
"bitgandtter/google-api": "dev-master"
},
"autoload": {
"psr-0": {
"Thujohn\\Analytics": "src/"
}
},
"minimum-stability": "dev"
}
| {
"name": "thujohn/analytics",
"description": "Google Analytics for Laravel 4",
"keywords": ["google", "analytics", "laravel", "laravel4"],
"license": "MIT",
"authors": [
{
"name": "Jonathan Thuau",
"email": "jonathan.thuau@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": ">=4.0.0",
"bitgandtter/google-api": "dev-master"
},
"autoload": {
"psr-0": {
"Thujohn\\Analytics": "src/"
}
},
"minimum-stability": "dev"
}
| Add google as a keyword | Add google as a keyword
You are not showing up here when searching for google http://registry.autopergamene.eu/
As a result I had started creating my own package. Right now my package is only a wrapper to get a google ID from config, but was planning on building it out with features like yours.
I'm going to add a deprecation notice to my repo linking to yours. | JSON | mit | thujohn/analytics-l4 | json | ## Code Before:
{
"name": "thujohn/analytics",
"description": "Google Analytics for Laravel 4",
"keywords": ["analytics", "laravel", "laravel4"],
"license": "MIT",
"authors": [
{
"name": "Jonathan Thuau",
"email": "jonathan.thuau@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": ">=4.0.0",
"bitgandtter/google-api": "dev-master"
},
"autoload": {
"psr-0": {
"Thujohn\\Analytics": "src/"
}
},
"minimum-stability": "dev"
}
## Instruction:
Add google as a keyword
You are not showing up here when searching for google http://registry.autopergamene.eu/
As a result I had started creating my own package. Right now my package is only a wrapper to get a google ID from config, but was planning on building it out with features like yours.
I'm going to add a deprecation notice to my repo linking to yours.
## Code After:
{
"name": "thujohn/analytics",
"description": "Google Analytics for Laravel 4",
"keywords": ["google", "analytics", "laravel", "laravel4"],
"license": "MIT",
"authors": [
{
"name": "Jonathan Thuau",
"email": "jonathan.thuau@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": ">=4.0.0",
"bitgandtter/google-api": "dev-master"
},
"autoload": {
"psr-0": {
"Thujohn\\Analytics": "src/"
}
},
"minimum-stability": "dev"
}
| {
"name": "thujohn/analytics",
"description": "Google Analytics for Laravel 4",
- "keywords": ["analytics", "laravel", "laravel4"],
+ "keywords": ["google", "analytics", "laravel", "laravel4"],
? ++++++++++
"license": "MIT",
"authors": [
{
"name": "Jonathan Thuau",
"email": "jonathan.thuau@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": ">=4.0.0",
"bitgandtter/google-api": "dev-master"
},
"autoload": {
"psr-0": {
"Thujohn\\Analytics": "src/"
}
},
"minimum-stability": "dev"
} | 2 | 0.086957 | 1 | 1 |
3f6405a7ebcb804e88aba4be5a68c767690c4a72 | test/test_app.c | test/test_app.c |
TEST(app_new) {
app_t * app = app_new();
assert(app->running == 0);
assert(app->io == 0);
app_free(app);
}
TEST(current_app_set_to) {
app_t * app = app_new();
assert(current_app == 0);
current_app_set_to(app);
assert(current_app == app);
app_free(app);
current_app_set_to(0);
}
static test_t app_test_suite[] = {
TEST_REF(app_new),
0
};
|
TEST(app_new) {
app_t * app = app_new();
assert(app->running == 0);
assert(app->io == 0);
app_free(app);
}
TEST(current_app_set_to) {
app_t * app = app_new();
assert(current_app == 0);
current_app_set_to(app);
assert(current_app == app);
app_free(app);
current_app_set_to(0);
}
TEST(app_parse_command_line) {
app_t * app = app_new();
int argc = 3;
char * argv[] = {"chip8", "--io", "terminal"};
app_parse_command_line(app, argc, argv);
assert(app->io && strcmp(app->io->name, "terminal") == 0);
app_free(app);
}
static test_t app_test_suite[] = {
TEST_REF(app_new),
TEST_REF(app_parse_command_line),
0
};
| Add a failing test for app_parse_command_line | Add a failing test for app_parse_command_line
| C | mit | gsamokovarov/chip8.c,gsamokovarov/chip8.c | c | ## Code Before:
TEST(app_new) {
app_t * app = app_new();
assert(app->running == 0);
assert(app->io == 0);
app_free(app);
}
TEST(current_app_set_to) {
app_t * app = app_new();
assert(current_app == 0);
current_app_set_to(app);
assert(current_app == app);
app_free(app);
current_app_set_to(0);
}
static test_t app_test_suite[] = {
TEST_REF(app_new),
0
};
## Instruction:
Add a failing test for app_parse_command_line
## Code After:
TEST(app_new) {
app_t * app = app_new();
assert(app->running == 0);
assert(app->io == 0);
app_free(app);
}
TEST(current_app_set_to) {
app_t * app = app_new();
assert(current_app == 0);
current_app_set_to(app);
assert(current_app == app);
app_free(app);
current_app_set_to(0);
}
TEST(app_parse_command_line) {
app_t * app = app_new();
int argc = 3;
char * argv[] = {"chip8", "--io", "terminal"};
app_parse_command_line(app, argc, argv);
assert(app->io && strcmp(app->io->name, "terminal") == 0);
app_free(app);
}
static test_t app_test_suite[] = {
TEST_REF(app_new),
TEST_REF(app_parse_command_line),
0
};
|
TEST(app_new) {
app_t * app = app_new();
assert(app->running == 0);
assert(app->io == 0);
app_free(app);
}
TEST(current_app_set_to) {
app_t * app = app_new();
assert(current_app == 0);
current_app_set_to(app);
assert(current_app == app);
app_free(app);
current_app_set_to(0);
}
+ TEST(app_parse_command_line) {
+ app_t * app = app_new();
+ int argc = 3;
+ char * argv[] = {"chip8", "--io", "terminal"};
+
+ app_parse_command_line(app, argc, argv);
+ assert(app->io && strcmp(app->io->name, "terminal") == 0);
+
+ app_free(app);
+ }
+
static test_t app_test_suite[] = {
TEST_REF(app_new),
+ TEST_REF(app_parse_command_line),
0
}; | 12 | 0.444444 | 12 | 0 |
f11741e68ea40207b96c45e9072da98e470c5494 | requirements.txt | requirements.txt | d2to1>=0.2.10,<0.3
pbr>=0.5.16,<0.6
SQLAlchemy>=0.7,<=0.7.99
eventlet
extras
kombu>2.4.7
routes
WebOb
PasteDeploy
paste
sqlalchemy-migrate>=0.7.2
netaddr
httplib2
lxml
python-novaclient
python-cinderclient>=1.0.4
python-keystoneclient
python-swiftclient
iso8601
oslo.config>=1.1.0
jsonschema>=1.0.0,!=1.4.0,<2
Jinja2
pexpect
| d2to1>=0.2.10,<0.3
pbr>=0.5.16,<0.6
SQLAlchemy>=0.7,<=0.7.99
eventlet
extras
kombu>2.4.7
routes
WebOb
PasteDeploy
paste
sqlalchemy-migrate>=0.7.2
netaddr
httplib2
lxml
python-novaclient
python-cinderclient>=1.0.4
python-keystoneclient
python-swiftclient
iso8601
jsonschema>=1.0.0,!=1.4.0,<2
Jinja2
pexpect
-f http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3
oslo.config>=1.2.0a3
| Update oslo.cfg to >= 1.2.0 | Update oslo.cfg to >= 1.2.0
Need a newer version of Oslo.cfg so we can use DictOpt.
fixes bug 1213192
Change-Id: I9d41d6184c57ecec46403390fac972bd9e76ab17
| Text | apache-2.0 | mmasaki/trove,citrix-openstack-build/trove,redhat-openstack/trove,denismakogon/trove-guestagent,cp16net/trove,citrix-openstack-build/trove,zhangg/trove,changsimon/trove,fabian4/trove,mmasaki/trove,openstack/trove,cp16net/trove,hplustree/trove,hplustree/trove,mmasaki/trove,denismakogon/trove-guestagent,zhujzhuo/openstack-trove,zhujzhuo/openstack-trove,citrix-openstack/build-trove,redhat-openstack/trove,citrix-openstack/build-trove,redhat-openstack/trove,cp16net/trove,citrix-openstack/build-trove,zhangg/trove,fabian4/trove,changsimon/trove,citrix-openstack-build/trove,openstack/trove,changsimon/trove,fabian4/trove,zhujzhuo/openstack-trove | text | ## Code Before:
d2to1>=0.2.10,<0.3
pbr>=0.5.16,<0.6
SQLAlchemy>=0.7,<=0.7.99
eventlet
extras
kombu>2.4.7
routes
WebOb
PasteDeploy
paste
sqlalchemy-migrate>=0.7.2
netaddr
httplib2
lxml
python-novaclient
python-cinderclient>=1.0.4
python-keystoneclient
python-swiftclient
iso8601
oslo.config>=1.1.0
jsonschema>=1.0.0,!=1.4.0,<2
Jinja2
pexpect
## Instruction:
Update oslo.cfg to >= 1.2.0
Need a newer version of Oslo.cfg so we can use DictOpt.
fixes bug 1213192
Change-Id: I9d41d6184c57ecec46403390fac972bd9e76ab17
## Code After:
d2to1>=0.2.10,<0.3
pbr>=0.5.16,<0.6
SQLAlchemy>=0.7,<=0.7.99
eventlet
extras
kombu>2.4.7
routes
WebOb
PasteDeploy
paste
sqlalchemy-migrate>=0.7.2
netaddr
httplib2
lxml
python-novaclient
python-cinderclient>=1.0.4
python-keystoneclient
python-swiftclient
iso8601
jsonschema>=1.0.0,!=1.4.0,<2
Jinja2
pexpect
-f http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3
oslo.config>=1.2.0a3
| d2to1>=0.2.10,<0.3
pbr>=0.5.16,<0.6
SQLAlchemy>=0.7,<=0.7.99
eventlet
extras
kombu>2.4.7
routes
WebOb
PasteDeploy
paste
sqlalchemy-migrate>=0.7.2
netaddr
httplib2
lxml
python-novaclient
python-cinderclient>=1.0.4
python-keystoneclient
python-swiftclient
iso8601
- oslo.config>=1.1.0
jsonschema>=1.0.0,!=1.4.0,<2
Jinja2
pexpect
+ -f http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3
+ oslo.config>=1.2.0a3
+ | 4 | 0.173913 | 3 | 1 |
fc756a2a91f02584a9b4c0abdc068d83daa720f8 | lib/config/resource/src/resources/analytics.js | lib/config/resource/src/resources/analytics.js | 'use strict';
// Formulas are deprecated, we're now using meter, accumulate, aggregate
// and rate Javascript functions instead
module.exports = {
resource_id: 'analytics',
measures: [
{
name: 'classifiers',
unit: 'INSTANCE'
},
{
name: 'classifier_api_calls',
unit: 'CALL'
},
{
name: 'training_event_api_calls',
unit: 'CALL'
}],
metrics: [
{
name: 'classifier_instances',
unit: 'INSTANCE',
formula: 'AVG({classifier})'
},
{
name: 'classifier_api_calls',
unit: 'CALL',
formula: 'SUM({classifier_api.calls})'
},
{
name: 'training_event_api_calls',
unit: 'CALL',
formula: 'SUM({training_event_api_calls})'
}]
};
| 'use strict';
// A sample analytics service that uses metering formulas
// Formulas are deprecated, we're now using meter, accumulate, aggregate
// and rate Javascript functions instead
module.exports = {
resource_id: 'analytics',
measures: [
{
name: 'classifiers',
unit: 'INSTANCE'
},
{
name: 'classifier_api_calls',
unit: 'CALL'
},
{
name: 'training_event_api_calls',
unit: 'CALL'
}],
metrics: [
{
name: 'classifier_instances',
unit: 'INSTANCE',
formula: 'AVG({classifier})'
},
{
name: 'classifier_api_calls',
unit: 'CALL',
formula: 'SUM({classifier_api.calls})'
},
{
name: 'training_event_api_calls',
unit: 'CALL',
formula: 'SUM({training_event_api_calls})'
}]
};
| Add header comment to sample resource config | Add header comment to sample resource config
| JavaScript | apache-2.0 | kurumai/cf-abacus,pombredanne/cf-abacus,rajkiranrbala/cf-abacus,pombredanne/cf-abacus,sasrin/cf-abacus,cloudfoundry-incubator/cf-abacus,pombredanne/cf-abacus,jsdelfino/x-abacus,nmaslarski/cf-abacus,danparsons/cf-abacus,jsdelfino/cf-abacus-experiment,rajkiranrbala/cf-abacus,danparsons/cf-abacus,18F/cf-abacus,sasrin/cf-abacus,sasrin/cf-abacus,rajkiranrbala/cf-abacus,18F/cf-abacus,pombredanne/cf-abacus,jsdelfino/d-abacus,nmaslarski/cf-abacus,cloudfoundry-incubator/cf-abacus,KRuelY/cf-abacus,KRuelY/cf-abacus,cloudfoundry-incubator/cf-abacus,rajkiranrbala/cf-abacus,nmaslarski/cf-abacus,KRuelY/cf-abacus,BetaFood/cf-abacus-dev,nmaslarski/cf-abacus,danparsons/cf-abacus,jsdelfino/x-abacus,kurumai/cf-abacus,jsdelfino/cf-abacus-experiment,jsdelfino/x-abacus,KRuelY/cf-abacus,jsdelfino/d-abacus,jsdelfino/cf-abacus-experiment,jsdelfino/d-abacus,jsdelfino/x-abacus,jsdelfino/d-abacus,BetaFood/cf-abacus-dev,BetaFood/cf-abacus-dev,18F/cf-abacus | javascript | ## Code Before:
'use strict';
// Formulas are deprecated, we're now using meter, accumulate, aggregate
// and rate Javascript functions instead
module.exports = {
resource_id: 'analytics',
measures: [
{
name: 'classifiers',
unit: 'INSTANCE'
},
{
name: 'classifier_api_calls',
unit: 'CALL'
},
{
name: 'training_event_api_calls',
unit: 'CALL'
}],
metrics: [
{
name: 'classifier_instances',
unit: 'INSTANCE',
formula: 'AVG({classifier})'
},
{
name: 'classifier_api_calls',
unit: 'CALL',
formula: 'SUM({classifier_api.calls})'
},
{
name: 'training_event_api_calls',
unit: 'CALL',
formula: 'SUM({training_event_api_calls})'
}]
};
## Instruction:
Add header comment to sample resource config
## Code After:
'use strict';
// A sample analytics service that uses metering formulas
// Formulas are deprecated, we're now using meter, accumulate, aggregate
// and rate Javascript functions instead
module.exports = {
resource_id: 'analytics',
measures: [
{
name: 'classifiers',
unit: 'INSTANCE'
},
{
name: 'classifier_api_calls',
unit: 'CALL'
},
{
name: 'training_event_api_calls',
unit: 'CALL'
}],
metrics: [
{
name: 'classifier_instances',
unit: 'INSTANCE',
formula: 'AVG({classifier})'
},
{
name: 'classifier_api_calls',
unit: 'CALL',
formula: 'SUM({classifier_api.calls})'
},
{
name: 'training_event_api_calls',
unit: 'CALL',
formula: 'SUM({training_event_api_calls})'
}]
};
| 'use strict';
+
+ // A sample analytics service that uses metering formulas
// Formulas are deprecated, we're now using meter, accumulate, aggregate
// and rate Javascript functions instead
module.exports = {
resource_id: 'analytics',
measures: [
{
name: 'classifiers',
unit: 'INSTANCE'
},
{
name: 'classifier_api_calls',
unit: 'CALL'
},
{
name: 'training_event_api_calls',
unit: 'CALL'
}],
metrics: [
{
name: 'classifier_instances',
unit: 'INSTANCE',
formula: 'AVG({classifier})'
},
{
name: 'classifier_api_calls',
unit: 'CALL',
formula: 'SUM({classifier_api.calls})'
},
{
name: 'training_event_api_calls',
unit: 'CALL',
formula: 'SUM({training_event_api_calls})'
}]
};
| 2 | 0.052632 | 2 | 0 |
066a7dacf20ed3dd123790dc78e99317856ea731 | tutorial/polls/admin.py | tutorial/polls/admin.py | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin) | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
#fields = ['pub_date', 'question_text']
fieldsets = [
(None, {'fields' : ['question_text']}),
('Date Information', { 'fields' : ['pub_date'], 'classes': ['collapse']}),
]
admin.site.register(Question, QuestionAdmin) | Put Question Admin fields in a fieldset and added a collapse class to the date field | Put Question Admin fields in a fieldset and added a collapse class to the date field
| Python | mit | ikosenn/django_reignited,ikosenn/django_reignited | python | ## Code Before:
from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin)
## Instruction:
Put Question Admin fields in a fieldset and added a collapse class to the date field
## Code After:
from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
#fields = ['pub_date', 'question_text']
fieldsets = [
(None, {'fields' : ['question_text']}),
('Date Information', { 'fields' : ['pub_date'], 'classes': ['collapse']}),
]
admin.site.register(Question, QuestionAdmin) | from django.contrib import admin
# Register your models here.
from .models import Question
+ class QuestionAdmin(admin.ModelAdmin):
- class QuestionAdmin(admin.ModelAdmin):
- fields = ['pub_date', 'question_text']
+ #fields = ['pub_date', 'question_text']
? +
+
+ fieldsets = [
+ (None, {'fields' : ['question_text']}),
+ ('Date Information', { 'fields' : ['pub_date'], 'classes': ['collapse']}),
+ ]
admin.site.register(Question, QuestionAdmin) | 9 | 0.818182 | 7 | 2 |
11f89275f3dc26bb90faa7c9310607b6284ae582 | src/caesium/crypto/generichash.clj | src/caesium/crypto/generichash.clj | (ns caesium.crypto.generichash
(:import (org.abstractj.kalium.crypto Hash)))
(def ^:private sixteen-nuls (byte-array 16))
(defn blake2b
"Computes the BLAKE2b digest of the given message, with optional
salt, key and personalization parameters."
([message]
(.blake2 (new Hash) message))
([message & {salt :salt key :key personal :personal
:or {salt sixteen-nuls
personal sixteen-nuls
key (byte-array 0)}}]
(.blake2 (new Hash) message key salt personal)))
| (ns caesium.crypto.generichash
(:import (org.abstractj.kalium.crypto Hash)))
(def ^:private empty-byte-array (byte-array 0))
(def ^:private sixteen-nuls (byte-array 16))
(defn blake2b
"Computes the BLAKE2b digest of the given message, with optional
salt, key and personalization parameters."
([message]
(.blake2 (new Hash) message))
([message & {salt :salt key :key personal :personal
:or {salt sixteen-nuls
personal sixteen-nuls
key empty-byte-array}}]
(.blake2 (new Hash) message key salt personal)))
| Make the empty byte array a constant too | Make the empty byte array a constant too
| Clojure | epl-1.0 | lvh/caesium | clojure | ## Code Before:
(ns caesium.crypto.generichash
(:import (org.abstractj.kalium.crypto Hash)))
(def ^:private sixteen-nuls (byte-array 16))
(defn blake2b
"Computes the BLAKE2b digest of the given message, with optional
salt, key and personalization parameters."
([message]
(.blake2 (new Hash) message))
([message & {salt :salt key :key personal :personal
:or {salt sixteen-nuls
personal sixteen-nuls
key (byte-array 0)}}]
(.blake2 (new Hash) message key salt personal)))
## Instruction:
Make the empty byte array a constant too
## Code After:
(ns caesium.crypto.generichash
(:import (org.abstractj.kalium.crypto Hash)))
(def ^:private empty-byte-array (byte-array 0))
(def ^:private sixteen-nuls (byte-array 16))
(defn blake2b
"Computes the BLAKE2b digest of the given message, with optional
salt, key and personalization parameters."
([message]
(.blake2 (new Hash) message))
([message & {salt :salt key :key personal :personal
:or {salt sixteen-nuls
personal sixteen-nuls
key empty-byte-array}}]
(.blake2 (new Hash) message key salt personal)))
| (ns caesium.crypto.generichash
(:import (org.abstractj.kalium.crypto Hash)))
+ (def ^:private empty-byte-array (byte-array 0))
(def ^:private sixteen-nuls (byte-array 16))
(defn blake2b
"Computes the BLAKE2b digest of the given message, with optional
salt, key and personalization parameters."
([message]
(.blake2 (new Hash) message))
([message & {salt :salt key :key personal :personal
:or {salt sixteen-nuls
personal sixteen-nuls
- key (byte-array 0)}}]
? ^ ---
+ key empty-byte-array}}]
? ^^^^^^
(.blake2 (new Hash) message key salt personal))) | 3 | 0.2 | 2 | 1 |
f3e41eaa27dd90590c00405cb55aa1b049d50cf8 | setup.sh | setup.sh | ABS_PATH=`cd "$1"; pwd`
echo "Creating a semilings for $ABS_PATH to ~/"
if [ ! -e "$ABS_PATH/.vimrc" ]; then
ln -s "$ABS_PATH/.vimrc" ~/.vimrc
echo "Link created"
fi
if [ ! -d "$ABS_PATH/.vim" ]; then
ln -s "$ABS_PATH/.vim" ~/.vim
echo "vim folder created"
fi
if [ ! -d "$ABS_PATH/.vim/bundle" ]; then
mkdir -p "$ABS_PATH/.vim/bundle"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/nerdtree" ]; then
echo "Cloning the nerdTree plugin"
git clone git@github.com:scrooloose/nerdtree.git "$ABS_PATH/.vim/bundle/nerdtree"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/jedi-vim" ]; then
echo "Cloning the jedi-vim plugin"
git clone git@github.com:siper92/jedi-vim.git "$ABS_PATH/.vim/bundle/jedi-vim"
fi
| ABS_PATH=`cd "$1"; pwd`
echo "Creating a semilings for $ABS_PATH to ~/"
if [ ! -e "$ABS_PATH/.vimrc" ]; then
ln -s "$ABS_PATH/.vimrc" ~/.vimrc
echo "Link created"
fi
if [ ! -d "$ABS_PATH/.vim" ]; then
ln -s "$ABS_PATH/.vim" ~/.vim
echo "vim folder created"
fi
if [ ! -d "$ABS_PATH/.vim/bundle" ]; then
mkdir -p "$ABS_PATH/.vim/bundle"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/nerdtree" ]; then
echo "Cloning the nerdTree plugin"
git clone git@github.com:scrooloose/nerdtree.git "$ABS_PATH/.vim/bundle/nerdtree"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/jedi-vim" ]; then
echo "Cloning the jedi-vim plugin"
git clone --recursive git@github.com:siper92/jedi-vim.git "$ABS_PATH/.vim/bundle/jedi-vim"
fi
| Fix for jedi install clone added -recursice | Fix for jedi install clone added -recursice
| Shell | mit | siper92/vimrc-home | shell | ## Code Before:
ABS_PATH=`cd "$1"; pwd`
echo "Creating a semilings for $ABS_PATH to ~/"
if [ ! -e "$ABS_PATH/.vimrc" ]; then
ln -s "$ABS_PATH/.vimrc" ~/.vimrc
echo "Link created"
fi
if [ ! -d "$ABS_PATH/.vim" ]; then
ln -s "$ABS_PATH/.vim" ~/.vim
echo "vim folder created"
fi
if [ ! -d "$ABS_PATH/.vim/bundle" ]; then
mkdir -p "$ABS_PATH/.vim/bundle"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/nerdtree" ]; then
echo "Cloning the nerdTree plugin"
git clone git@github.com:scrooloose/nerdtree.git "$ABS_PATH/.vim/bundle/nerdtree"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/jedi-vim" ]; then
echo "Cloning the jedi-vim plugin"
git clone git@github.com:siper92/jedi-vim.git "$ABS_PATH/.vim/bundle/jedi-vim"
fi
## Instruction:
Fix for jedi install clone added -recursice
## Code After:
ABS_PATH=`cd "$1"; pwd`
echo "Creating a semilings for $ABS_PATH to ~/"
if [ ! -e "$ABS_PATH/.vimrc" ]; then
ln -s "$ABS_PATH/.vimrc" ~/.vimrc
echo "Link created"
fi
if [ ! -d "$ABS_PATH/.vim" ]; then
ln -s "$ABS_PATH/.vim" ~/.vim
echo "vim folder created"
fi
if [ ! -d "$ABS_PATH/.vim/bundle" ]; then
mkdir -p "$ABS_PATH/.vim/bundle"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/nerdtree" ]; then
echo "Cloning the nerdTree plugin"
git clone git@github.com:scrooloose/nerdtree.git "$ABS_PATH/.vim/bundle/nerdtree"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/jedi-vim" ]; then
echo "Cloning the jedi-vim plugin"
git clone --recursive git@github.com:siper92/jedi-vim.git "$ABS_PATH/.vim/bundle/jedi-vim"
fi
| ABS_PATH=`cd "$1"; pwd`
echo "Creating a semilings for $ABS_PATH to ~/"
if [ ! -e "$ABS_PATH/.vimrc" ]; then
ln -s "$ABS_PATH/.vimrc" ~/.vimrc
echo "Link created"
fi
if [ ! -d "$ABS_PATH/.vim" ]; then
ln -s "$ABS_PATH/.vim" ~/.vim
echo "vim folder created"
fi
if [ ! -d "$ABS_PATH/.vim/bundle" ]; then
mkdir -p "$ABS_PATH/.vim/bundle"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/nerdtree" ]; then
echo "Cloning the nerdTree plugin"
git clone git@github.com:scrooloose/nerdtree.git "$ABS_PATH/.vim/bundle/nerdtree"
fi
if [ ! -d "$ABS_PATH/.vim/bundle/jedi-vim" ]; then
echo "Cloning the jedi-vim plugin"
- git clone git@github.com:siper92/jedi-vim.git "$ABS_PATH/.vim/bundle/jedi-vim"
+ git clone --recursive git@github.com:siper92/jedi-vim.git "$ABS_PATH/.vim/bundle/jedi-vim"
? ++++++++++++
fi | 2 | 0.08 | 1 | 1 |
3f5c6ebda6a48def153f2f0673e83fb5b7f1828e | gtksource-3.0/config.json | gtksource-3.0/config.json | {
"namespace": "GtkSource",
"version": "3.0",
"method-blacklist": {
"PrintCompositor": [
"draw_page",
"paginate"
]
}
}
| {
"namespace": "GtkSource",
"version": "3.0"
}
| Move everything to whitelist in gtksource-3.0. | Move everything to whitelist in gtksource-3.0.
| JSON | mit | nsf/gogobject,nsf/gogobject,nsf/gogobject,nsf/gogobject | json | ## Code Before:
{
"namespace": "GtkSource",
"version": "3.0",
"method-blacklist": {
"PrintCompositor": [
"draw_page",
"paginate"
]
}
}
## Instruction:
Move everything to whitelist in gtksource-3.0.
## Code After:
{
"namespace": "GtkSource",
"version": "3.0"
}
| {
"namespace": "GtkSource",
- "version": "3.0",
? -
+ "version": "3.0"
- "method-blacklist": {
- "PrintCompositor": [
- "draw_page",
- "paginate"
- ]
- }
} | 8 | 0.8 | 1 | 7 |
1cde66beec37decc0d44efb87da5413443a26c39 | app/views/browse/_user_selections_controls.html.haml | app/views/browse/_user_selections_controls.html.haml | %p
= label_tag(:'location-type', 'Location type')
= select_tag(:'location-type', options_for_select(view_state.location_type_options))
%p
= label_tag(:'location-term', 'Search for a location')
= text_field_tag(:'location-term')
%button{ type: 'submit', value: 'search', name: 'form-action' }
Search
| %p
= label_tag(:'location-type', 'Location type')
= select_tag(:'location-type', options_for_select(view_state.location_type_options))
%p
= label_tag(:'location-term', 'Search for a location')
= text_field_tag(:'location-term')
%button{ type: 'submit', value: 'search', name: 'form-action' }
Search
%h3.o-heading--3 Dates
%p
= label_tag(:from, 'From:')
= date_field_tag(:from, view_state.user_selections.from_date)
%p
= label_tag(:to, 'To:')
= date_field_tag(:to, view_state.user_selections.to_date)
| Add dates to user preferences form | Add dates to user preferences form
| Haml | mit | epimorphics/ukhpi,epimorphics/ukhpi,epimorphics/ukhpi,epimorphics/ukhpi | haml | ## Code Before:
%p
= label_tag(:'location-type', 'Location type')
= select_tag(:'location-type', options_for_select(view_state.location_type_options))
%p
= label_tag(:'location-term', 'Search for a location')
= text_field_tag(:'location-term')
%button{ type: 'submit', value: 'search', name: 'form-action' }
Search
## Instruction:
Add dates to user preferences form
## Code After:
%p
= label_tag(:'location-type', 'Location type')
= select_tag(:'location-type', options_for_select(view_state.location_type_options))
%p
= label_tag(:'location-term', 'Search for a location')
= text_field_tag(:'location-term')
%button{ type: 'submit', value: 'search', name: 'form-action' }
Search
%h3.o-heading--3 Dates
%p
= label_tag(:from, 'From:')
= date_field_tag(:from, view_state.user_selections.from_date)
%p
= label_tag(:to, 'To:')
= date_field_tag(:to, view_state.user_selections.to_date)
| %p
= label_tag(:'location-type', 'Location type')
= select_tag(:'location-type', options_for_select(view_state.location_type_options))
%p
= label_tag(:'location-term', 'Search for a location')
= text_field_tag(:'location-term')
- %button{ type: 'submit', value: 'search', name: 'form-action' }
+ %button{ type: 'submit', value: 'search', name: 'form-action' }
? ++
- Search
+ Search
? ++
+
+ %h3.o-heading--3 Dates
+
+ %p
+ = label_tag(:from, 'From:')
+ = date_field_tag(:from, view_state.user_selections.from_date)
+
+ %p
+ = label_tag(:to, 'To:')
+ = date_field_tag(:to, view_state.user_selections.to_date) | 14 | 1.4 | 12 | 2 |
ecc8209e145c691d46e4f0a518780fa6fb35e160 | src/app/period/period.component.html | src/app/period/period.component.html | <div class="grid-container">
<h2 class="mat-h2"><a routerLink="/team/{{team.id}}">{{team.displayName}}</a> :
<span *ngIf="!isEditing" (click)="edit()">{{period.displayName}}</span>
<span *ngIf="isEditing">
<input [(ngModel)]="period.displayName"/>
<button (click)="stopEditing()" class="btn btn-primary">OK</button>
</span>
</h2>
<div fxLayout="row wrap" fxLayoutGap="20px" width="100%">
<div fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-bucket *ngFor="let bucket of period.buckets" [bucket]="bucket" [unit]="period.unit"
[totalAllocationPercentage]="totalAllocationPercentage()"
[globalResourcesAvailable]="totalAvailable()"
[validAssignees]="validAssignees()"></app-bucket>
<div><button (click)="addBucket()" mat-raised-button color="primary">Add Bucket</button></div>
<app-assignments-by-person [period]="period"></app-assignments-by-person>
</div>
<div fxFlex="calc(50%-20px)">
<app-people [people]="period.people"
[peopleCommitments]="peopleCommitments()"
[totalAvailable]="totalAvailable()"
[totalCommitted]="totalCommitted()"
[totalUncommitted]="totalUncommitted()"
[unit]="period.unit">
</app-people>
</div>
</div>
</div> | <div class="grid-container">
<h2 class="mat-h2"><a routerLink="/team/{{team.id}}">{{team.displayName}}</a> :
<span *ngIf="!isEditing" (click)="edit()">{{period.displayName}}</span>
<span *ngIf="isEditing">
<input [(ngModel)]="period.displayName"/>
<button (click)="stopEditing()" class="btn btn-primary">OK</button>
</span>
</h2>
<div fxLayout="row wrap" fxLayoutGap="20px" width="100%">
<div fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-bucket *ngFor="let bucket of period.buckets" [bucket]="bucket" [unit]="period.unit"
[totalAllocationPercentage]="totalAllocationPercentage()"
[globalResourcesAvailable]="totalAvailable()"
[validAssignees]="validAssignees()"></app-bucket>
<div><button (click)="addBucket()" mat-raised-button color="primary">Add Bucket</button></div>
</div>
<span fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-people [people]="period.people"
[peopleCommitments]="peopleCommitments()"
[totalAvailable]="totalAvailable()"
[totalCommitted]="totalCommitted()"
[totalUncommitted]="totalUncommitted()"
[unit]="period.unit">
</app-people>
<app-assignments-by-person [period]="period"></app-assignments-by-person>
</span>
</div>
</div> | Move assignments by person to the right | Move assignments by person to the right
| HTML | apache-2.0 | google/peoplemath,google/peoplemath,google/peoplemath,google/peoplemath,google/peoplemath | html | ## Code Before:
<div class="grid-container">
<h2 class="mat-h2"><a routerLink="/team/{{team.id}}">{{team.displayName}}</a> :
<span *ngIf="!isEditing" (click)="edit()">{{period.displayName}}</span>
<span *ngIf="isEditing">
<input [(ngModel)]="period.displayName"/>
<button (click)="stopEditing()" class="btn btn-primary">OK</button>
</span>
</h2>
<div fxLayout="row wrap" fxLayoutGap="20px" width="100%">
<div fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-bucket *ngFor="let bucket of period.buckets" [bucket]="bucket" [unit]="period.unit"
[totalAllocationPercentage]="totalAllocationPercentage()"
[globalResourcesAvailable]="totalAvailable()"
[validAssignees]="validAssignees()"></app-bucket>
<div><button (click)="addBucket()" mat-raised-button color="primary">Add Bucket</button></div>
<app-assignments-by-person [period]="period"></app-assignments-by-person>
</div>
<div fxFlex="calc(50%-20px)">
<app-people [people]="period.people"
[peopleCommitments]="peopleCommitments()"
[totalAvailable]="totalAvailable()"
[totalCommitted]="totalCommitted()"
[totalUncommitted]="totalUncommitted()"
[unit]="period.unit">
</app-people>
</div>
</div>
</div>
## Instruction:
Move assignments by person to the right
## Code After:
<div class="grid-container">
<h2 class="mat-h2"><a routerLink="/team/{{team.id}}">{{team.displayName}}</a> :
<span *ngIf="!isEditing" (click)="edit()">{{period.displayName}}</span>
<span *ngIf="isEditing">
<input [(ngModel)]="period.displayName"/>
<button (click)="stopEditing()" class="btn btn-primary">OK</button>
</span>
</h2>
<div fxLayout="row wrap" fxLayoutGap="20px" width="100%">
<div fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-bucket *ngFor="let bucket of period.buckets" [bucket]="bucket" [unit]="period.unit"
[totalAllocationPercentage]="totalAllocationPercentage()"
[globalResourcesAvailable]="totalAvailable()"
[validAssignees]="validAssignees()"></app-bucket>
<div><button (click)="addBucket()" mat-raised-button color="primary">Add Bucket</button></div>
</div>
<span fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-people [people]="period.people"
[peopleCommitments]="peopleCommitments()"
[totalAvailable]="totalAvailable()"
[totalCommitted]="totalCommitted()"
[totalUncommitted]="totalUncommitted()"
[unit]="period.unit">
</app-people>
<app-assignments-by-person [period]="period"></app-assignments-by-person>
</span>
</div>
</div> | <div class="grid-container">
<h2 class="mat-h2"><a routerLink="/team/{{team.id}}">{{team.displayName}}</a> :
<span *ngIf="!isEditing" (click)="edit()">{{period.displayName}}</span>
<span *ngIf="isEditing">
<input [(ngModel)]="period.displayName"/>
<button (click)="stopEditing()" class="btn btn-primary">OK</button>
</span>
</h2>
<div fxLayout="row wrap" fxLayoutGap="20px" width="100%">
<div fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-bucket *ngFor="let bucket of period.buckets" [bucket]="bucket" [unit]="period.unit"
[totalAllocationPercentage]="totalAllocationPercentage()"
[globalResourcesAvailable]="totalAvailable()"
[validAssignees]="validAssignees()"></app-bucket>
<div><button (click)="addBucket()" mat-raised-button color="primary">Add Bucket</button></div>
- <app-assignments-by-person [period]="period"></app-assignments-by-person>
</div>
- <div fxFlex="calc(50%-20px)">
+ <span fxLayout="column" fxFlex="calc(50%-20px)" fxLayoutGap="20px">
<app-people [people]="period.people"
[peopleCommitments]="peopleCommitments()"
[totalAvailable]="totalAvailable()"
[totalCommitted]="totalCommitted()"
[totalUncommitted]="totalUncommitted()"
[unit]="period.unit">
</app-people>
- </div>
+ <app-assignments-by-person [period]="period"></app-assignments-by-person>
+ </span>
</div>
</div> | 6 | 0.171429 | 3 | 3 |
d9e5721f6afa72990d408474ede0bc21ef027ca5 | lib/specinfra/command/linux/base/selinux.rb | lib/specinfra/command/linux/base/selinux.rb | class Specinfra::Command::Linux::Base::Selinux < Specinfra::Command::Base::Selinux
class << self
def check_has_mode(mode, policy = nil)
cmd = ""
cmd += "test ! -f /etc/selinux/config || (" if mode == "disabled"
cmd += "getenforce | grep -i -- #{escape(mode)}"
cmd += %Q{ && grep -iE -- '^\\s*SELINUX=#{escape(mode)}\\>' /etc/selinux/config}
cmd += %Q{ && grep -iE -- '^\\s*SELINUXTYPE=#{escape(policy)}\\>' /etc/selinux/config} if policy != nil
cmd += ")" if mode == "disabled"
cmd
end
end
end
| class Specinfra::Command::Linux::Base::Selinux < Specinfra::Command::Base::Selinux
class << self
def check_has_mode(mode, policy = nil)
cmd = ""
cmd += "test ! -f /etc/selinux/config || ( " if mode == "disabled"
cmd += "(getenforce | grep -i -- #{escape(mode)})"
cmd += " || (getenforce | grep -i -- #{escape('permissive')}) )" if mode == "disabled"
cmd += %Q{ && grep -iE -- '^\\s*SELINUX=#{escape(mode)}\\>' /etc/selinux/config}
cmd += %Q{ && grep -iE -- '^\\s*SELINUXTYPE=#{escape(policy)}\\>' /etc/selinux/config} if policy != nil
cmd
end
end
end
| Change check mode shell command | Change check mode shell command
| Ruby | mit | verisign/specinfra,serverspec/specinfra,mizzy/specinfra | ruby | ## Code Before:
class Specinfra::Command::Linux::Base::Selinux < Specinfra::Command::Base::Selinux
class << self
def check_has_mode(mode, policy = nil)
cmd = ""
cmd += "test ! -f /etc/selinux/config || (" if mode == "disabled"
cmd += "getenforce | grep -i -- #{escape(mode)}"
cmd += %Q{ && grep -iE -- '^\\s*SELINUX=#{escape(mode)}\\>' /etc/selinux/config}
cmd += %Q{ && grep -iE -- '^\\s*SELINUXTYPE=#{escape(policy)}\\>' /etc/selinux/config} if policy != nil
cmd += ")" if mode == "disabled"
cmd
end
end
end
## Instruction:
Change check mode shell command
## Code After:
class Specinfra::Command::Linux::Base::Selinux < Specinfra::Command::Base::Selinux
class << self
def check_has_mode(mode, policy = nil)
cmd = ""
cmd += "test ! -f /etc/selinux/config || ( " if mode == "disabled"
cmd += "(getenforce | grep -i -- #{escape(mode)})"
cmd += " || (getenforce | grep -i -- #{escape('permissive')}) )" if mode == "disabled"
cmd += %Q{ && grep -iE -- '^\\s*SELINUX=#{escape(mode)}\\>' /etc/selinux/config}
cmd += %Q{ && grep -iE -- '^\\s*SELINUXTYPE=#{escape(policy)}\\>' /etc/selinux/config} if policy != nil
cmd
end
end
end
| class Specinfra::Command::Linux::Base::Selinux < Specinfra::Command::Base::Selinux
class << self
def check_has_mode(mode, policy = nil)
cmd = ""
- cmd += "test ! -f /etc/selinux/config || (" if mode == "disabled"
+ cmd += "test ! -f /etc/selinux/config || ( " if mode == "disabled"
? +
- cmd += "getenforce | grep -i -- #{escape(mode)}"
+ cmd += "(getenforce | grep -i -- #{escape(mode)})"
? + +
+ cmd += " || (getenforce | grep -i -- #{escape('permissive')}) )" if mode == "disabled"
cmd += %Q{ && grep -iE -- '^\\s*SELINUX=#{escape(mode)}\\>' /etc/selinux/config}
cmd += %Q{ && grep -iE -- '^\\s*SELINUXTYPE=#{escape(policy)}\\>' /etc/selinux/config} if policy != nil
- cmd += ")" if mode == "disabled"
cmd
end
end
end | 6 | 0.461538 | 3 | 3 |
326ddbc4a887780f4513d39f3f8a000d6464293b | lib/capybara-screenshot/pruner.rb | lib/capybara-screenshot/pruner.rb | module Capybara
module Screenshot
class Pruner
attr_reader :strategy
def initialize(strategy)
@strategy = strategy
@strategy_proc = case strategy
when :keep_all
-> { }
when :keep_last_run
-> { prune_with_last_run_strategy }
when Hash
raise ArgumentError, ":keep key is required" unless strategy[:keep]
raise ArgumentError, ":keep value must be number greater than zero" unless strategy[:keep].to_i > 0
-> { prune_with_numeric_strategy(strategy[:keep].to_i) }
else
fail "Invalid prune strategy #{strategy}. `:keep_all`or `{ keep: 10 }` are valid examples."
end
end
def prune_old_screenshots
strategy_proc.call
end
private
attr_reader :strategy_proc
def wildcard_path
File.expand_path('*.{html,png}', Screenshot.capybara_root)
end
def prune_with_last_run_strategy
FileUtils.rm_rf(Dir.glob(wildcard_path))
end
def prune_with_numeric_strategy(count)
files = Dir.glob(wildcard_path).sort_by do |file_name|
File.mtime(File.expand_path(file_name, Screenshot.capybara_root))
end
FileUtils.rm_rf(files[0...-count])
end
end
end
end
| module Capybara
module Screenshot
class Pruner
attr_reader :strategy
def initialize(strategy)
@strategy = strategy
@strategy_proc = case strategy
when :keep_all
lambda { }
when :keep_last_run
lambda { prune_with_last_run_strategy }
when Hash
raise ArgumentError, ":keep key is required" unless strategy[:keep]
raise ArgumentError, ":keep value must be number greater than zero" unless strategy[:keep].to_i > 0
lambda { prune_with_numeric_strategy(strategy[:keep].to_i) }
else
fail "Invalid prune strategy #{strategy}. `:keep_all`or `{ keep: 10 }` are valid examples."
end
end
def prune_old_screenshots
strategy_proc.call
end
private
attr_reader :strategy_proc
def wildcard_path
File.expand_path('*.{html,png}', Screenshot.capybara_root)
end
def prune_with_last_run_strategy
FileUtils.rm_rf(Dir.glob(wildcard_path))
end
def prune_with_numeric_strategy(count)
files = Dir.glob(wildcard_path).sort_by do |file_name|
File.mtime(File.expand_path(file_name, Screenshot.capybara_root))
end
FileUtils.rm_rf(files[0...-count])
end
end
end
end
| Use older lambda syntax for 1.8.7 compatibility | Use older lambda syntax for 1.8.7 compatibility
| Ruby | mit | mattheworiordan/capybara-screenshot,xuwupeng2000/capybara-screenshot,Patru/capybara-screenshot,BentPixels/capybara-screenshot,chendrix/capybara-screenshot,HealthTeacher/capybara-screenshot | ruby | ## Code Before:
module Capybara
module Screenshot
class Pruner
attr_reader :strategy
def initialize(strategy)
@strategy = strategy
@strategy_proc = case strategy
when :keep_all
-> { }
when :keep_last_run
-> { prune_with_last_run_strategy }
when Hash
raise ArgumentError, ":keep key is required" unless strategy[:keep]
raise ArgumentError, ":keep value must be number greater than zero" unless strategy[:keep].to_i > 0
-> { prune_with_numeric_strategy(strategy[:keep].to_i) }
else
fail "Invalid prune strategy #{strategy}. `:keep_all`or `{ keep: 10 }` are valid examples."
end
end
def prune_old_screenshots
strategy_proc.call
end
private
attr_reader :strategy_proc
def wildcard_path
File.expand_path('*.{html,png}', Screenshot.capybara_root)
end
def prune_with_last_run_strategy
FileUtils.rm_rf(Dir.glob(wildcard_path))
end
def prune_with_numeric_strategy(count)
files = Dir.glob(wildcard_path).sort_by do |file_name|
File.mtime(File.expand_path(file_name, Screenshot.capybara_root))
end
FileUtils.rm_rf(files[0...-count])
end
end
end
end
## Instruction:
Use older lambda syntax for 1.8.7 compatibility
## Code After:
module Capybara
module Screenshot
class Pruner
attr_reader :strategy
def initialize(strategy)
@strategy = strategy
@strategy_proc = case strategy
when :keep_all
lambda { }
when :keep_last_run
lambda { prune_with_last_run_strategy }
when Hash
raise ArgumentError, ":keep key is required" unless strategy[:keep]
raise ArgumentError, ":keep value must be number greater than zero" unless strategy[:keep].to_i > 0
lambda { prune_with_numeric_strategy(strategy[:keep].to_i) }
else
fail "Invalid prune strategy #{strategy}. `:keep_all`or `{ keep: 10 }` are valid examples."
end
end
def prune_old_screenshots
strategy_proc.call
end
private
attr_reader :strategy_proc
def wildcard_path
File.expand_path('*.{html,png}', Screenshot.capybara_root)
end
def prune_with_last_run_strategy
FileUtils.rm_rf(Dir.glob(wildcard_path))
end
def prune_with_numeric_strategy(count)
files = Dir.glob(wildcard_path).sort_by do |file_name|
File.mtime(File.expand_path(file_name, Screenshot.capybara_root))
end
FileUtils.rm_rf(files[0...-count])
end
end
end
end
| module Capybara
module Screenshot
class Pruner
attr_reader :strategy
def initialize(strategy)
@strategy = strategy
@strategy_proc = case strategy
when :keep_all
- -> { }
? ^^
+ lambda { }
? ^^^^^^
when :keep_last_run
- -> { prune_with_last_run_strategy }
? ^^
+ lambda { prune_with_last_run_strategy }
? ^^^^^^
when Hash
raise ArgumentError, ":keep key is required" unless strategy[:keep]
raise ArgumentError, ":keep value must be number greater than zero" unless strategy[:keep].to_i > 0
- -> { prune_with_numeric_strategy(strategy[:keep].to_i) }
? ^^
+ lambda { prune_with_numeric_strategy(strategy[:keep].to_i) }
? ^^^^^^
else
fail "Invalid prune strategy #{strategy}. `:keep_all`or `{ keep: 10 }` are valid examples."
end
end
def prune_old_screenshots
strategy_proc.call
end
private
attr_reader :strategy_proc
def wildcard_path
File.expand_path('*.{html,png}', Screenshot.capybara_root)
end
def prune_with_last_run_strategy
FileUtils.rm_rf(Dir.glob(wildcard_path))
end
def prune_with_numeric_strategy(count)
files = Dir.glob(wildcard_path).sort_by do |file_name|
File.mtime(File.expand_path(file_name, Screenshot.capybara_root))
end
FileUtils.rm_rf(files[0...-count])
end
end
end
end | 6 | 0.12766 | 3 | 3 |
87c7a33bd97dcb18b1615a982cadff5dd82b65a5 | central-web/app/templates/configure/dialog_create_config.html | central-web/app/templates/configure/dialog_create_config.html | {% import "bootstrap/wtf.html" as wtf %}
<div id="modal-create-config" class="modal fade" data-backdrop="static">
<div class="modal-dialog">
<form class="form" id="config_form" enctype="multipart/form-data" role="form">
<div class="modal-content">
<div class="modal-header">
<a href="#" role="button" class="close cancel" aria-label="Close"><span aria-hidden="true">×</span></a>
<h4 class="modal-title">New Configuration</h4>
</div>
<div class="modal-body">
<div class="form-device">
{{ config_form.hidden_tag() }}
{{ wtf.form_errors(config_form, hiddens = "only") }}
{{ wtf.form_field(config_form.name) }}
{{ wtf.form_field(config_form.lockcode) }}
{{ wtf.form_field(config_form.map_area_file) }}
{{ wtf.form_field(config_form.map_area_filename, readonly = "readonly") }}
</div>
</div>
<div class="modal-footer">
<a href="#" role="button" class="btn btn-default cancel">Cancel</a>
{{ wtf.form_field(config_form.submit, button_map = {'config_submit': 'primary'}) }}
</div>
</div>
</form>
</div>
</div>
| {% import "bootstrap/wtf.html" as wtf %}
<div id="config-dialog" class="modal" data-backdrop="static">
<div class="modal-dialog">
<form class="form" id="config_form" enctype="multipart/form-data" role="form">
<div class="modal-content">
<div class="modal-header">
<a href="#" role="button" class="close cancel" aria-label="Close"><span aria-hidden="true">×</span></a>
<h4 class="modal-title">New Configuration</h4>
</div>
<div class="modal-body">
{{ config_form.hidden_tag() }}
{{ wtf.form_errors(config_form, hiddens = "only") }}
{{ wtf.form_field(config_form.name) }}
{{ wtf.form_field(config_form.lockcode) }}
{{ wtf.form_field(config_form.map_area_file) }}
{{ wtf.form_field(config_form.map_area_filename, readonly = "readonly") }}
</div>
<div class="modal-footer">
<a href="#" role="button" class="btn btn-default cancel">Cancel</a>
{{ wtf.form_field(config_form.submit, button_map = {'config_submit': 'primary'}) }}
</div>
</div>
</form>
</div>
</div>
| Remove extra useless div and avoid fading dialog for show/hide. | Remove extra useless div and avoid fading dialog for show/hide.
| HTML | apache-2.0 | jfpoilpret/alarm-system,jfpoilpret/alarm-system,jfpoilpret/alarm-system,jfpoilpret/alarm-system | html | ## Code Before:
{% import "bootstrap/wtf.html" as wtf %}
<div id="modal-create-config" class="modal fade" data-backdrop="static">
<div class="modal-dialog">
<form class="form" id="config_form" enctype="multipart/form-data" role="form">
<div class="modal-content">
<div class="modal-header">
<a href="#" role="button" class="close cancel" aria-label="Close"><span aria-hidden="true">×</span></a>
<h4 class="modal-title">New Configuration</h4>
</div>
<div class="modal-body">
<div class="form-device">
{{ config_form.hidden_tag() }}
{{ wtf.form_errors(config_form, hiddens = "only") }}
{{ wtf.form_field(config_form.name) }}
{{ wtf.form_field(config_form.lockcode) }}
{{ wtf.form_field(config_form.map_area_file) }}
{{ wtf.form_field(config_form.map_area_filename, readonly = "readonly") }}
</div>
</div>
<div class="modal-footer">
<a href="#" role="button" class="btn btn-default cancel">Cancel</a>
{{ wtf.form_field(config_form.submit, button_map = {'config_submit': 'primary'}) }}
</div>
</div>
</form>
</div>
</div>
## Instruction:
Remove extra useless div and avoid fading dialog for show/hide.
## Code After:
{% import "bootstrap/wtf.html" as wtf %}
<div id="config-dialog" class="modal" data-backdrop="static">
<div class="modal-dialog">
<form class="form" id="config_form" enctype="multipart/form-data" role="form">
<div class="modal-content">
<div class="modal-header">
<a href="#" role="button" class="close cancel" aria-label="Close"><span aria-hidden="true">×</span></a>
<h4 class="modal-title">New Configuration</h4>
</div>
<div class="modal-body">
{{ config_form.hidden_tag() }}
{{ wtf.form_errors(config_form, hiddens = "only") }}
{{ wtf.form_field(config_form.name) }}
{{ wtf.form_field(config_form.lockcode) }}
{{ wtf.form_field(config_form.map_area_file) }}
{{ wtf.form_field(config_form.map_area_filename, readonly = "readonly") }}
</div>
<div class="modal-footer">
<a href="#" role="button" class="btn btn-default cancel">Cancel</a>
{{ wtf.form_field(config_form.submit, button_map = {'config_submit': 'primary'}) }}
</div>
</div>
</form>
</div>
</div>
| {% import "bootstrap/wtf.html" as wtf %}
- <div id="modal-create-config" class="modal fade" data-backdrop="static">
? ------------- -----
+ <div id="config-dialog" class="modal" data-backdrop="static">
? +++++++
<div class="modal-dialog">
<form class="form" id="config_form" enctype="multipart/form-data" role="form">
<div class="modal-content">
<div class="modal-header">
<a href="#" role="button" class="close cancel" aria-label="Close"><span aria-hidden="true">×</span></a>
<h4 class="modal-title">New Configuration</h4>
</div>
<div class="modal-body">
- <div class="form-device">
{{ config_form.hidden_tag() }}
{{ wtf.form_errors(config_form, hiddens = "only") }}
{{ wtf.form_field(config_form.name) }}
{{ wtf.form_field(config_form.lockcode) }}
{{ wtf.form_field(config_form.map_area_file) }}
{{ wtf.form_field(config_form.map_area_filename, readonly = "readonly") }}
- </div>
</div>
<div class="modal-footer">
<a href="#" role="button" class="btn btn-default cancel">Cancel</a>
{{ wtf.form_field(config_form.submit, button_map = {'config_submit': 'primary'}) }}
</div>
</div>
</form>
</div>
</div> | 4 | 0.142857 | 1 | 3 |
eb7e36629a61515778029096370ccfb41399590f | bluebottle/activities/migrations/0018_auto_20200212_1025.py | bluebottle/activities/migrations/0018_auto_20200212_1025.py | from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from django.contrib.auth.models import Permission, Group
def remove_anonymous_permissions(apps, schema_editor):
permissions = (
('assignments', 'api_read_assignment'),
('events', 'api_read_event'),
('activities', 'api_read_activity'),
('funding', 'api_read_funding'),
)
tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
with LocalTenant(tenant):
if properties.CLOSED_SITE:
anonymous = Group.objects.get(name='Anonymous')
for (app, codename) in permissions:
permission = Permission.objects.get(
content_type__app_label=app,
codename=codename
)
anonymous.permissions.remove(permission)
anonymous.save()
class Migration(migrations.Migration):
dependencies = [
('activities', '0017_auto_20200205_1054'),
]
operations = [
migrations.RunPython(remove_anonymous_permissions)
]
| from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from django.contrib.auth.models import Permission, Group
def remove_anonymous_permissions(apps, schema_editor):
permissions = (
('assignments', 'api_read_assignment'),
('events', 'api_read_event'),
('activities', 'api_read_activity'),
('funding', 'api_read_funding'),
)
tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
with LocalTenant(tenant):
if properties.CLOSED_SITE:
anonymous = Group.objects.get(name='Anonymous')
for (app, codename) in permissions:
try:
permission = Permission.objects.get(
content_type__app_label=app,
codename=codename
)
anonymous.permissions.remove(permission)
except Permission.DoesNotExist:
pass
anonymous.save()
class Migration(migrations.Migration):
dependencies = [
('activities', '0017_auto_20200205_1054'),
]
operations = [
migrations.RunPython(remove_anonymous_permissions)
]
| Fix migration for new tenants | Fix migration for new tenants
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | python | ## Code Before:
from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from django.contrib.auth.models import Permission, Group
def remove_anonymous_permissions(apps, schema_editor):
permissions = (
('assignments', 'api_read_assignment'),
('events', 'api_read_event'),
('activities', 'api_read_activity'),
('funding', 'api_read_funding'),
)
tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
with LocalTenant(tenant):
if properties.CLOSED_SITE:
anonymous = Group.objects.get(name='Anonymous')
for (app, codename) in permissions:
permission = Permission.objects.get(
content_type__app_label=app,
codename=codename
)
anonymous.permissions.remove(permission)
anonymous.save()
class Migration(migrations.Migration):
dependencies = [
('activities', '0017_auto_20200205_1054'),
]
operations = [
migrations.RunPython(remove_anonymous_permissions)
]
## Instruction:
Fix migration for new tenants
## Code After:
from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from django.contrib.auth.models import Permission, Group
def remove_anonymous_permissions(apps, schema_editor):
permissions = (
('assignments', 'api_read_assignment'),
('events', 'api_read_event'),
('activities', 'api_read_activity'),
('funding', 'api_read_funding'),
)
tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
with LocalTenant(tenant):
if properties.CLOSED_SITE:
anonymous = Group.objects.get(name='Anonymous')
for (app, codename) in permissions:
try:
permission = Permission.objects.get(
content_type__app_label=app,
codename=codename
)
anonymous.permissions.remove(permission)
except Permission.DoesNotExist:
pass
anonymous.save()
class Migration(migrations.Migration):
dependencies = [
('activities', '0017_auto_20200205_1054'),
]
operations = [
migrations.RunPython(remove_anonymous_permissions)
]
| from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from django.contrib.auth.models import Permission, Group
def remove_anonymous_permissions(apps, schema_editor):
permissions = (
('assignments', 'api_read_assignment'),
('events', 'api_read_event'),
('activities', 'api_read_activity'),
('funding', 'api_read_funding'),
)
tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
with LocalTenant(tenant):
if properties.CLOSED_SITE:
anonymous = Group.objects.get(name='Anonymous')
for (app, codename) in permissions:
+ try:
- permission = Permission.objects.get(
+ permission = Permission.objects.get(
? ++++
- content_type__app_label=app,
+ content_type__app_label=app,
? ++++
- codename=codename
+ codename=codename
? ++++
- )
+ )
? ++++
- anonymous.permissions.remove(permission)
+ anonymous.permissions.remove(permission)
? ++++
-
+ except Permission.DoesNotExist:
+ pass
anonymous.save()
class Migration(migrations.Migration):
dependencies = [
('activities', '0017_auto_20200205_1054'),
]
operations = [
migrations.RunPython(remove_anonymous_permissions)
] | 14 | 0.311111 | 8 | 6 |
e8ff455dbce28e641cbcae19596562fe0631a8f7 | 01-10/p10.rs | 01-10/p10.rs | enum Node<T> {
One(T),
Many(uint, T)
}
fn pack<T: Clone+Eq>(list: &[T]) -> ~[~[T]] {
let mut it = list.iter();
let mut result = ~[];
let mut l = 1;
loop {
match it.nth(l - 1) {
Some(e) => {
let mut slice = ~[];
slice.push(e.clone());
for f in it.take_while(|&a| *a == *e) {
slice.push(f.clone());
}
l = slice.len();
result.push(slice);
},
None => break
}
}
result
}
fn encode<T: Clone>(list: ~[~[T]]) -> ~[Node<T>] {
list.map(|e|
match *e {
[ref a] => One(a.clone()),
[ref a, ..] => Many(e.len(), a.clone()),
_ => unreachable!()
})
}
fn main() {
let list =
~['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e', 'e', 'e', 'e'];
println!("{:?}", encode(pack(list)));
}
| enum Node<T> {
One(T),
Many(uint, T)
}
fn pack<T: Clone+Eq>(list: &[T]) -> ~[~[T]] {
let mut it = list.iter();
let mut result = ~[];
let mut l = 1;
loop {
match it.nth(l - 1) {
Some(e) => {
let mut slice = ~[];
slice.push(e.clone());
for f in it.take_while(|&a| *a == *e) {
slice.push(f.clone());
}
l = slice.len();
result.push(slice);
},
None => break
}
}
result
}
fn encode<T: Clone>(list: ~[~[T]]) -> ~[Node<T>] {
list.map(|e|
match e.len() {
1 => One(e[0].clone()),
n => Many(n, e[0].clone())
})
}
fn main() {
let list =
~['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e', 'e', 'e', 'e'];
println!("{:?}", encode(pack(list)));
}
| Remove unique vector matching from Problem 10 | Remove unique vector matching from Problem 10
| Rust | cc0-1.0 | Armavica/99-Problems-Rust | rust | ## Code Before:
enum Node<T> {
One(T),
Many(uint, T)
}
fn pack<T: Clone+Eq>(list: &[T]) -> ~[~[T]] {
let mut it = list.iter();
let mut result = ~[];
let mut l = 1;
loop {
match it.nth(l - 1) {
Some(e) => {
let mut slice = ~[];
slice.push(e.clone());
for f in it.take_while(|&a| *a == *e) {
slice.push(f.clone());
}
l = slice.len();
result.push(slice);
},
None => break
}
}
result
}
fn encode<T: Clone>(list: ~[~[T]]) -> ~[Node<T>] {
list.map(|e|
match *e {
[ref a] => One(a.clone()),
[ref a, ..] => Many(e.len(), a.clone()),
_ => unreachable!()
})
}
fn main() {
let list =
~['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e', 'e', 'e', 'e'];
println!("{:?}", encode(pack(list)));
}
## Instruction:
Remove unique vector matching from Problem 10
## Code After:
enum Node<T> {
One(T),
Many(uint, T)
}
fn pack<T: Clone+Eq>(list: &[T]) -> ~[~[T]] {
let mut it = list.iter();
let mut result = ~[];
let mut l = 1;
loop {
match it.nth(l - 1) {
Some(e) => {
let mut slice = ~[];
slice.push(e.clone());
for f in it.take_while(|&a| *a == *e) {
slice.push(f.clone());
}
l = slice.len();
result.push(slice);
},
None => break
}
}
result
}
fn encode<T: Clone>(list: ~[~[T]]) -> ~[Node<T>] {
list.map(|e|
match e.len() {
1 => One(e[0].clone()),
n => Many(n, e[0].clone())
})
}
fn main() {
let list =
~['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e', 'e', 'e', 'e'];
println!("{:?}", encode(pack(list)));
}
| enum Node<T> {
One(T),
Many(uint, T)
}
fn pack<T: Clone+Eq>(list: &[T]) -> ~[~[T]] {
let mut it = list.iter();
let mut result = ~[];
let mut l = 1;
loop {
match it.nth(l - 1) {
Some(e) => {
let mut slice = ~[];
slice.push(e.clone());
for f in it.take_while(|&a| *a == *e) {
slice.push(f.clone());
}
l = slice.len();
result.push(slice);
},
None => break
}
}
result
}
fn encode<T: Clone>(list: ~[~[T]]) -> ~[Node<T>] {
list.map(|e|
- match *e {
? -
+ match e.len() {
? ++++++
- [ref a] => One(a.clone()),
? ^^^^^^^^^^^ ^
+ 1 => One(e[0].clone()),
? ^ ^^^^
- [ref a, ..] => Many(e.len(), a.clone()),
? ^^^^^^^^^^^ ---- -- ^ -
+ n => Many(n, e[0].clone())
? ^ ^^^^
- _ => unreachable!()
})
}
fn main() {
let list =
~['a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e', 'e', 'e', 'e'];
println!("{:?}", encode(pack(list)));
} | 7 | 0.166667 | 3 | 4 |
1478c8b4d81fa59d1b85303c4bc1da8e5a05d6af | content/page/salary_history.md | content/page/salary_history.md | +++
title = "My salary history"
date = "2019-04-09"
tags = ["gds", "metaswitch"]
+++
I am publishing this page to allow my colleagues to compare their salaries with me. Therefore, I hereby consent to any and all processing (etc.) of this data by those working at GDS or Metaswitch.[^1]
# Government Digital Service (2019-present)
My salary is currently £56 000. If you include the equivalent value of the civil service pension, this becomes ~£67 000.
I was hired as a Developer, for which the advertised range was £48 000 to £56 000. That was for band 'A.London'.
# Metaswitch (2015-8)
Metaswitch views salary information as confidential. However, I think I can safely say that my final salary was less than my starting salary at GDS.
The Metaswitch starting salary for graduate hires was £32 000 when I joined, and is now £35 000.
[^1]: feel free to contact me if you don't fulfil that criterion, but want to use this information
| +++
title = "My salary history"
date = "2019-04-09"
tags = ["gds", "metaswitch"]
+++
I am publishing this page to allow my colleagues to compare their salaries with me. Therefore, I hereby consent to any and all processing (etc.) of this data by those working at GDS or Metaswitch.[^1]
# Government Digital Service (2019-present)
I currently work part time (90%), with a full-time-equivalent salary of £56 000. The civil service pension adds the equivalent of another ~20%.
I was hired as a Developer, for which the advertised range was £48 000 to £56 000. That was for band 'A.London'.
# Metaswitch (2015-8)
My salary at Metaswitch ended at £48 000, with an annual bonus of about £2000. I also had a number of share options, but left before the Microsoft acquisition, so they were worthless.
The Metaswitch starting salary for graduate hires was £32 000 when I joined, and is now £35 000.
[^1]: feel free to contact me if you don't fulfil that criterion, but want to use this information
| Add details to salary history | Add details to salary history | Markdown | mit | bjgill/bjgill.github.io-generation,bjgill/bjgill.github.io-generation | markdown | ## Code Before:
+++
title = "My salary history"
date = "2019-04-09"
tags = ["gds", "metaswitch"]
+++
I am publishing this page to allow my colleagues to compare their salaries with me. Therefore, I hereby consent to any and all processing (etc.) of this data by those working at GDS or Metaswitch.[^1]
# Government Digital Service (2019-present)
My salary is currently £56 000. If you include the equivalent value of the civil service pension, this becomes ~£67 000.
I was hired as a Developer, for which the advertised range was £48 000 to £56 000. That was for band 'A.London'.
# Metaswitch (2015-8)
Metaswitch views salary information as confidential. However, I think I can safely say that my final salary was less than my starting salary at GDS.
The Metaswitch starting salary for graduate hires was £32 000 when I joined, and is now £35 000.
[^1]: feel free to contact me if you don't fulfil that criterion, but want to use this information
## Instruction:
Add details to salary history
## Code After:
+++
title = "My salary history"
date = "2019-04-09"
tags = ["gds", "metaswitch"]
+++
I am publishing this page to allow my colleagues to compare their salaries with me. Therefore, I hereby consent to any and all processing (etc.) of this data by those working at GDS or Metaswitch.[^1]
# Government Digital Service (2019-present)
I currently work part time (90%), with a full-time-equivalent salary of £56 000. The civil service pension adds the equivalent of another ~20%.
I was hired as a Developer, for which the advertised range was £48 000 to £56 000. That was for band 'A.London'.
# Metaswitch (2015-8)
My salary at Metaswitch ended at £48 000, with an annual bonus of about £2000. I also had a number of share options, but left before the Microsoft acquisition, so they were worthless.
The Metaswitch starting salary for graduate hires was £32 000 when I joined, and is now £35 000.
[^1]: feel free to contact me if you don't fulfil that criterion, but want to use this information
| +++
title = "My salary history"
date = "2019-04-09"
tags = ["gds", "metaswitch"]
+++
I am publishing this page to allow my colleagues to compare their salaries with me. Therefore, I hereby consent to any and all processing (etc.) of this data by those working at GDS or Metaswitch.[^1]
# Government Digital Service (2019-present)
- My salary is currently £56 000. If you include the equivalent value of the civil service pension, this becomes ~£67 000.
+ I currently work part time (90%), with a full-time-equivalent salary of £56 000. The civil service pension adds the equivalent of another ~20%.
I was hired as a Developer, for which the advertised range was £48 000 to £56 000. That was for band 'A.London'.
# Metaswitch (2015-8)
- Metaswitch views salary information as confidential. However, I think I can safely say that my final salary was less than my starting salary at GDS.
+ My salary at Metaswitch ended at £48 000, with an annual bonus of about £2000. I also had a number of share options, but left before the Microsoft acquisition, so they were worthless.
The Metaswitch starting salary for graduate hires was £32 000 when I joined, and is now £35 000.
[^1]: feel free to contact me if you don't fulfil that criterion, but want to use this information | 4 | 0.190476 | 2 | 2 |
97705c9f839a655207f8a914eb578aadc858c545 | apps/taigaio.sh | apps/taigaio.sh |
git clone https://github.com/taigaio/taiga-scripts.git
cd taiga-scripts
bash setup-server.sh
whiptail --msgbox "Taiga.Io successfully installed!
Open http://$IP:8000 in your browser to access to Taiga.Io" 12 64
|
git clone https://github.com/taigaio/taiga-scripts.git
cd taiga-scripts
# Delete "exit" to remove root protection
sed -i '/exit 1/d' setup-server.sh
bash setup-server.sh
whiptail --msgbox "Taiga.Io successfully installed!
Open http://$IP:8000 in your browser to access to Taiga.Io" 12 64
| Delete exit to remove root protection | Delete exit to remove root protection
| Shell | mit | DFabric/DPlatform-ShellCore,j8r/DPlatform | shell | ## Code Before:
git clone https://github.com/taigaio/taiga-scripts.git
cd taiga-scripts
bash setup-server.sh
whiptail --msgbox "Taiga.Io successfully installed!
Open http://$IP:8000 in your browser to access to Taiga.Io" 12 64
## Instruction:
Delete exit to remove root protection
## Code After:
git clone https://github.com/taigaio/taiga-scripts.git
cd taiga-scripts
# Delete "exit" to remove root protection
sed -i '/exit 1/d' setup-server.sh
bash setup-server.sh
whiptail --msgbox "Taiga.Io successfully installed!
Open http://$IP:8000 in your browser to access to Taiga.Io" 12 64
|
git clone https://github.com/taigaio/taiga-scripts.git
cd taiga-scripts
+
+ # Delete "exit" to remove root protection
+ sed -i '/exit 1/d' setup-server.sh
bash setup-server.sh
whiptail --msgbox "Taiga.Io successfully installed!
Open http://$IP:8000 in your browser to access to Taiga.Io" 12 64 | 3 | 0.375 | 3 | 0 |
fb9cd73c675bcda70c66c28f3d71f1cb670e31b5 | .travis.yml | .travis.yml | language: node_js
node_js:
- "6"
- "5"
- "4"
after_script:
- cat ./coverage/PhantomJS\ 2.1.1\ \(Linux\ 0.0.0\)/lcov.info | ./node_modules/.bin/codacy-coverage
| language: node_js
node_js:
- "6"
- "5"
- "4"
after_script:
- cat ./coverage/PhantomJS\ 2.1.1\ \(Linux\ 0.0.0\)/lcov.info | ./node_modules/.bin/codacy-coverage
- bash <(curl -s https://codecov.io/bash)
| Send coverage report do codecov on every CI build | Send coverage report do codecov on every CI build | YAML | apache-2.0 | tbouron/angular-java-stack-viewer,tbouron/angular-java-stack-viewer | yaml | ## Code Before:
language: node_js
node_js:
- "6"
- "5"
- "4"
after_script:
- cat ./coverage/PhantomJS\ 2.1.1\ \(Linux\ 0.0.0\)/lcov.info | ./node_modules/.bin/codacy-coverage
## Instruction:
Send coverage report do codecov on every CI build
## Code After:
language: node_js
node_js:
- "6"
- "5"
- "4"
after_script:
- cat ./coverage/PhantomJS\ 2.1.1\ \(Linux\ 0.0.0\)/lcov.info | ./node_modules/.bin/codacy-coverage
- bash <(curl -s https://codecov.io/bash)
| language: node_js
node_js:
- "6"
- "5"
- "4"
after_script:
- - cat ./coverage/PhantomJS\ 2.1.1\ \(Linux\ 0.0.0\)/lcov.info | ./node_modules/.bin/codacy-coverage
? -
+ - cat ./coverage/PhantomJS\ 2.1.1\ \(Linux\ 0.0.0\)/lcov.info | ./node_modules/.bin/codacy-coverage
+ - bash <(curl -s https://codecov.io/bash) | 3 | 0.428571 | 2 | 1 |
2cdf6a8e17d1320bd199f3309c777d0a4fedadd4 | .travis.yml | .travis.yml | language: ruby
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.2"
notifications:
email:
on_failure: change
gemfiles:
- gemfiles/Gemfile.sinatra-1.0 | language: ruby
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.2"
notifications:
email:
on_failure: change
gemfiles:
- Gemfile
- gemfiles/Gemfile.sinatra-1.0 | Add normal Gemfile to build matrix | Add normal Gemfile to build matrix
| YAML | mit | danascheider/sinatra-sequel_extension | yaml | ## Code Before:
language: ruby
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.2"
notifications:
email:
on_failure: change
gemfiles:
- gemfiles/Gemfile.sinatra-1.0
## Instruction:
Add normal Gemfile to build matrix
## Code After:
language: ruby
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.2"
notifications:
email:
on_failure: change
gemfiles:
- Gemfile
- gemfiles/Gemfile.sinatra-1.0 | language: ruby
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.2"
notifications:
email:
on_failure: change
gemfiles:
+ - Gemfile
- gemfiles/Gemfile.sinatra-1.0 | 1 | 0.1 | 1 | 0 |
2548f8cb14da247b3c94ef1e2bf7f4db358e9051 | backend/app/helpers/spree/admin/stock_transfers_helper.rb | backend/app/helpers/spree/admin/stock_transfers_helper.rb | module Spree
module Admin
module StockTransfersHelper
def handle_stock_transfer(stock_transfer)
if can?(:show, stock_transfer)
link_to stock_transfer.number, admin_stock_transfer_path(stock_transfer)
else
stock_transfer.number
end
end
def stock_transfer_edit_or_ship_path(stock_transfer)
if stock_transfer.finalized?
tracking_info_admin_stock_transfer_path(stock_transfer)
else
edit_admin_stock_transfer_path(stock_transfer)
end
end
def stock_transfer_status(stock_transfer)
stock_transfer.closed? ? Spree.t(:closed) : Spree.t(:open)
end
def deleted_variant_admin_hint(variant)
newer_variant_with_same_sku = Spree::Variant.find_by(sku: variant.sku)
hint_type = newer_variant_with_same_sku ? :deleted_explanation_with_replacement : :deleted_explanation
hint_text = I18n.t(
hint_type,
scope: [:spree, :hints, "spree/variant"],
date: variant.deleted_at
)
admin_hint(
I18n.t(:deleted, scope: [:spree, :hints, "spree/variant"]),
hint_text
)
end
end
end
end
| module Spree
module Admin
module StockTransfersHelper
def handle_stock_transfer(stock_transfer)
if can?(:show, stock_transfer)
link_to stock_transfer.number, admin_stock_transfer_path(stock_transfer)
else
stock_transfer.number
end
end
def stock_transfer_edit_or_ship_path(stock_transfer)
if stock_transfer.finalized?
tracking_info_admin_stock_transfer_path(stock_transfer)
else
edit_admin_stock_transfer_path(stock_transfer)
end
end
def deleted_variant_admin_hint(variant)
newer_variant_with_same_sku = Spree::Variant.find_by(sku: variant.sku)
hint_type = newer_variant_with_same_sku ? :deleted_explanation_with_replacement : :deleted_explanation
hint_text = I18n.t(
hint_type,
scope: [:spree, :hints, "spree/variant"],
date: variant.deleted_at
)
admin_hint(
I18n.t(:deleted, scope: [:spree, :hints, "spree/variant"]),
hint_text
)
end
end
end
end
| Remove the stock_transfer_status helper method | Remove the stock_transfer_status helper method
This is no longer in use after switching this display to use the pill
component.
| Ruby | bsd-3-clause | pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus | ruby | ## Code Before:
module Spree
module Admin
module StockTransfersHelper
def handle_stock_transfer(stock_transfer)
if can?(:show, stock_transfer)
link_to stock_transfer.number, admin_stock_transfer_path(stock_transfer)
else
stock_transfer.number
end
end
def stock_transfer_edit_or_ship_path(stock_transfer)
if stock_transfer.finalized?
tracking_info_admin_stock_transfer_path(stock_transfer)
else
edit_admin_stock_transfer_path(stock_transfer)
end
end
def stock_transfer_status(stock_transfer)
stock_transfer.closed? ? Spree.t(:closed) : Spree.t(:open)
end
def deleted_variant_admin_hint(variant)
newer_variant_with_same_sku = Spree::Variant.find_by(sku: variant.sku)
hint_type = newer_variant_with_same_sku ? :deleted_explanation_with_replacement : :deleted_explanation
hint_text = I18n.t(
hint_type,
scope: [:spree, :hints, "spree/variant"],
date: variant.deleted_at
)
admin_hint(
I18n.t(:deleted, scope: [:spree, :hints, "spree/variant"]),
hint_text
)
end
end
end
end
## Instruction:
Remove the stock_transfer_status helper method
This is no longer in use after switching this display to use the pill
component.
## Code After:
module Spree
module Admin
module StockTransfersHelper
def handle_stock_transfer(stock_transfer)
if can?(:show, stock_transfer)
link_to stock_transfer.number, admin_stock_transfer_path(stock_transfer)
else
stock_transfer.number
end
end
def stock_transfer_edit_or_ship_path(stock_transfer)
if stock_transfer.finalized?
tracking_info_admin_stock_transfer_path(stock_transfer)
else
edit_admin_stock_transfer_path(stock_transfer)
end
end
def deleted_variant_admin_hint(variant)
newer_variant_with_same_sku = Spree::Variant.find_by(sku: variant.sku)
hint_type = newer_variant_with_same_sku ? :deleted_explanation_with_replacement : :deleted_explanation
hint_text = I18n.t(
hint_type,
scope: [:spree, :hints, "spree/variant"],
date: variant.deleted_at
)
admin_hint(
I18n.t(:deleted, scope: [:spree, :hints, "spree/variant"]),
hint_text
)
end
end
end
end
| module Spree
module Admin
module StockTransfersHelper
def handle_stock_transfer(stock_transfer)
if can?(:show, stock_transfer)
link_to stock_transfer.number, admin_stock_transfer_path(stock_transfer)
else
stock_transfer.number
end
end
def stock_transfer_edit_or_ship_path(stock_transfer)
if stock_transfer.finalized?
tracking_info_admin_stock_transfer_path(stock_transfer)
else
edit_admin_stock_transfer_path(stock_transfer)
end
end
- def stock_transfer_status(stock_transfer)
- stock_transfer.closed? ? Spree.t(:closed) : Spree.t(:open)
- end
-
def deleted_variant_admin_hint(variant)
newer_variant_with_same_sku = Spree::Variant.find_by(sku: variant.sku)
hint_type = newer_variant_with_same_sku ? :deleted_explanation_with_replacement : :deleted_explanation
hint_text = I18n.t(
hint_type,
scope: [:spree, :hints, "spree/variant"],
date: variant.deleted_at
)
admin_hint(
I18n.t(:deleted, scope: [:spree, :hints, "spree/variant"]),
hint_text
)
end
end
end
end | 4 | 0.102564 | 0 | 4 |
cb26c1662d5c69d7a27fb198b7fa2b1551bd7ee0 | src/di/MultiBinding/MapProvider.php | src/di/MultiBinding/MapProvider.php | <?php
declare(strict_types=1);
namespace Ray\Di\MultiBinding;
use Koriym\ParamReader\ParamReaderInterface;
use Ray\Di\Di\Set;
use Ray\Di\Exception\SetNotFound;
use Ray\Di\InjectionPointInterface;
use Ray\Di\InjectorInterface;
use Ray\Di\ProviderInterface;
final class MapProvider implements ProviderInterface
{
/** @var MultiBindings */
private $multiBindings;
/** @var InjectionPointInterface */
private $ip;
/** @var InjectorInterface */
private $injector;
/** @var ParamReaderInterface */
private $reader;
public function __construct(
InjectionPointInterface $ip,
MultiBindings $multiBindings,
InjectorInterface $injector,
ParamReaderInterface $reader
) {
$this->multiBindings = $multiBindings;
$this->ip = $ip;
$this->injector = $injector;
$this->reader = $reader;
}
public function get(): Map
{
/** @var ?Set $set */
$set = $this->reader->getParametrAnnotation($this->ip->getParameter(), Set::class);
if ($set === null) {
throw new SetNotFound((string) $this->ip->getParameter());
}
/** @var array<string, LazyTo<object>> $keyBasedLazy */
$keyBasedLazy = $this->multiBindings[$set->interface];
return new Map($keyBasedLazy, $this->injector);
}
}
| <?php
declare(strict_types=1);
namespace Ray\Di\MultiBinding;
use Koriym\ParamReader\ParamReaderInterface;
use Ray\Di\Di\Set;
use Ray\Di\Exception\SetNotFound;
use Ray\Di\InjectionPointInterface;
use Ray\Di\InjectorInterface;
use Ray\Di\ProviderInterface;
final class MapProvider implements ProviderInterface
{
/** @var MultiBindings */
private $multiBindings;
/** @var InjectionPointInterface */
private $ip;
/** @var InjectorInterface */
private $injector;
/** @var ParamReaderInterface */
private $reader;
public function __construct(
InjectionPointInterface $ip,
MultiBindings $multiBindings,
InjectorInterface $injector,
ParamReaderInterface $reader
) {
$this->multiBindings = $multiBindings;
$this->ip = $ip;
$this->injector = $injector;
$this->reader = $reader;
}
public function get(): Map
{
/** @var ?Set $set */
$set = $this->reader->getParametrAnnotation($this->ip->getParameter(), Set::class);
if ($set === null) {
throw new SetNotFound((string) $this->ip->getParameter());
}
/** @var array<string, LazyTo<object>> $lazies */
$lazies = $this->multiBindings[$set->interface];
return new Map($lazies, $this->injector);
}
}
| Rename var name as same asa parameter | Rename var name as same asa parameter
| PHP | mit | koriym/Ray.Di,ray-di/Ray.Di | php | ## Code Before:
<?php
declare(strict_types=1);
namespace Ray\Di\MultiBinding;
use Koriym\ParamReader\ParamReaderInterface;
use Ray\Di\Di\Set;
use Ray\Di\Exception\SetNotFound;
use Ray\Di\InjectionPointInterface;
use Ray\Di\InjectorInterface;
use Ray\Di\ProviderInterface;
final class MapProvider implements ProviderInterface
{
/** @var MultiBindings */
private $multiBindings;
/** @var InjectionPointInterface */
private $ip;
/** @var InjectorInterface */
private $injector;
/** @var ParamReaderInterface */
private $reader;
public function __construct(
InjectionPointInterface $ip,
MultiBindings $multiBindings,
InjectorInterface $injector,
ParamReaderInterface $reader
) {
$this->multiBindings = $multiBindings;
$this->ip = $ip;
$this->injector = $injector;
$this->reader = $reader;
}
public function get(): Map
{
/** @var ?Set $set */
$set = $this->reader->getParametrAnnotation($this->ip->getParameter(), Set::class);
if ($set === null) {
throw new SetNotFound((string) $this->ip->getParameter());
}
/** @var array<string, LazyTo<object>> $keyBasedLazy */
$keyBasedLazy = $this->multiBindings[$set->interface];
return new Map($keyBasedLazy, $this->injector);
}
}
## Instruction:
Rename var name as same asa parameter
## Code After:
<?php
declare(strict_types=1);
namespace Ray\Di\MultiBinding;
use Koriym\ParamReader\ParamReaderInterface;
use Ray\Di\Di\Set;
use Ray\Di\Exception\SetNotFound;
use Ray\Di\InjectionPointInterface;
use Ray\Di\InjectorInterface;
use Ray\Di\ProviderInterface;
final class MapProvider implements ProviderInterface
{
/** @var MultiBindings */
private $multiBindings;
/** @var InjectionPointInterface */
private $ip;
/** @var InjectorInterface */
private $injector;
/** @var ParamReaderInterface */
private $reader;
public function __construct(
InjectionPointInterface $ip,
MultiBindings $multiBindings,
InjectorInterface $injector,
ParamReaderInterface $reader
) {
$this->multiBindings = $multiBindings;
$this->ip = $ip;
$this->injector = $injector;
$this->reader = $reader;
}
public function get(): Map
{
/** @var ?Set $set */
$set = $this->reader->getParametrAnnotation($this->ip->getParameter(), Set::class);
if ($set === null) {
throw new SetNotFound((string) $this->ip->getParameter());
}
/** @var array<string, LazyTo<object>> $lazies */
$lazies = $this->multiBindings[$set->interface];
return new Map($lazies, $this->injector);
}
}
| <?php
declare(strict_types=1);
namespace Ray\Di\MultiBinding;
use Koriym\ParamReader\ParamReaderInterface;
use Ray\Di\Di\Set;
use Ray\Di\Exception\SetNotFound;
use Ray\Di\InjectionPointInterface;
use Ray\Di\InjectorInterface;
use Ray\Di\ProviderInterface;
final class MapProvider implements ProviderInterface
{
/** @var MultiBindings */
private $multiBindings;
/** @var InjectionPointInterface */
private $ip;
/** @var InjectorInterface */
private $injector;
/** @var ParamReaderInterface */
private $reader;
public function __construct(
InjectionPointInterface $ip,
MultiBindings $multiBindings,
InjectorInterface $injector,
ParamReaderInterface $reader
) {
$this->multiBindings = $multiBindings;
$this->ip = $ip;
$this->injector = $injector;
$this->reader = $reader;
}
public function get(): Map
{
/** @var ?Set $set */
$set = $this->reader->getParametrAnnotation($this->ip->getParameter(), Set::class);
if ($set === null) {
throw new SetNotFound((string) $this->ip->getParameter());
}
- /** @var array<string, LazyTo<object>> $keyBasedLazy */
? ^^^^^^^^^ ^
+ /** @var array<string, LazyTo<object>> $lazies */
? ^ ^^^
- $keyBasedLazy = $this->multiBindings[$set->interface];
? ^^^^^^^^^ ^
+ $lazies = $this->multiBindings[$set->interface];
? ^ ^^^
- return new Map($keyBasedLazy, $this->injector);
? ^^^^^^^^^ ^
+ return new Map($lazies, $this->injector);
? ^ ^^^
}
} | 6 | 0.113208 | 3 | 3 |
238cb4590508838cf420c23eece94715ce314a27 | CppChart/Log.h | CppChart/Log.h |
inline void Log(std::string str)
{
std::cout << "[" << __LINE__ << "] " << __FUNCTION__ << " : " << str << std::endl;
}
inline void LogFnStart()
{
Log("Entered");
}
inline void LogFnEnd()
{
Log("Finished");
}
inline void NestedLog(std::string str)
{
std::cout << "\n\t" << str << "\n" << std::endl;
}
namespace CppChart
{
std::ostream& operator<<(std::ostream& stream, const sf::Vector2f& v);
std::ostream& operator<<(std::ostream& stream, const sf::Vector2u& v);
std::ostream& operator<<(std::ostream& stream, const sf::Color& c);
template <typename T>
std::string ToString(const T& val);
}
#endif |
inline void Log(std::string str)
{
std::cout << "[" << __LINE__ << "] " << __FUNCTION__ << " : " << str << std::endl;
}
inline void LogFnStart()
{
Log("Entered");
}
inline void LogFnEnd()
{
Log("Finished");
}
inline void NestedLog(std::string str)
{
std::cout << "\n\t" << str << "\n" << std::endl;
}
namespace CppChart
{
std::ostream& operator<<(std::ostream&, const sf::Vector2f&);
std::ostream& operator<<(std::ostream&, const sf::Vector2u&);
std::ostream& operator<<(std::ostream&, const sf::Color&);
template <typename T>
std::string ToString(const T&);
}
#endif | Delete argument names of function | Delete argument names of function
| C | mit | utilForever/CppChart | c | ## Code Before:
inline void Log(std::string str)
{
std::cout << "[" << __LINE__ << "] " << __FUNCTION__ << " : " << str << std::endl;
}
inline void LogFnStart()
{
Log("Entered");
}
inline void LogFnEnd()
{
Log("Finished");
}
inline void NestedLog(std::string str)
{
std::cout << "\n\t" << str << "\n" << std::endl;
}
namespace CppChart
{
std::ostream& operator<<(std::ostream& stream, const sf::Vector2f& v);
std::ostream& operator<<(std::ostream& stream, const sf::Vector2u& v);
std::ostream& operator<<(std::ostream& stream, const sf::Color& c);
template <typename T>
std::string ToString(const T& val);
}
#endif
## Instruction:
Delete argument names of function
## Code After:
inline void Log(std::string str)
{
std::cout << "[" << __LINE__ << "] " << __FUNCTION__ << " : " << str << std::endl;
}
inline void LogFnStart()
{
Log("Entered");
}
inline void LogFnEnd()
{
Log("Finished");
}
inline void NestedLog(std::string str)
{
std::cout << "\n\t" << str << "\n" << std::endl;
}
namespace CppChart
{
std::ostream& operator<<(std::ostream&, const sf::Vector2f&);
std::ostream& operator<<(std::ostream&, const sf::Vector2u&);
std::ostream& operator<<(std::ostream&, const sf::Color&);
template <typename T>
std::string ToString(const T&);
}
#endif |
inline void Log(std::string str)
{
std::cout << "[" << __LINE__ << "] " << __FUNCTION__ << " : " << str << std::endl;
}
inline void LogFnStart()
{
Log("Entered");
}
inline void LogFnEnd()
{
Log("Finished");
}
inline void NestedLog(std::string str)
{
std::cout << "\n\t" << str << "\n" << std::endl;
}
namespace CppChart
{
- std::ostream& operator<<(std::ostream& stream, const sf::Vector2f& v);
? ------- --
+ std::ostream& operator<<(std::ostream&, const sf::Vector2f&);
- std::ostream& operator<<(std::ostream& stream, const sf::Vector2u& v);
? ------- --
+ std::ostream& operator<<(std::ostream&, const sf::Vector2u&);
- std::ostream& operator<<(std::ostream& stream, const sf::Color& c);
? ------- --
+ std::ostream& operator<<(std::ostream&, const sf::Color&);
template <typename T>
- std::string ToString(const T& val);
? ----
+ std::string ToString(const T&);
}
#endif | 8 | 0.25 | 4 | 4 |
20797136cd834312a2418b0698021413f63a7366 | raw/assets/js/layout/admin/auth/login/admin_auth_login_common_layout.js | raw/assets/js/layout/admin/auth/login/admin_auth_login_common_layout.js | /**
* This <server-gardu-reporter> project created by :
* Name : syafiq
* Date / Time : 28 June 2017, 11:03 PM.
* Email : syafiq.rezpector@gmail.com
* Github : syafiqq
*/
(function ($)
{
$(function ()
{
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
/*
* Run right away
* */
})(jQuery);
| /**
* This <server-gardu-reporter> project created by :
* Name : syafiq
* Date / Time : 28 June 2017, 11:03 PM.
* Email : syafiq.rezpector@gmail.com
* Github : syafiqq
*/
(function ($)
{
$(function ()
{
$('form#login').on('submit', function (event)
{
event.preventDefault();
var input = $(this).serializeObject();
input['remember_me'] = $(this).find('input[type=checkbox][name=remember_me]').prop('checked');
if ((input['remember_me'] === undefined) || (input['remember_me'] === null))
{
input['remember_me'] = false;
}
console.log(input);
});
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
/*
* Run right away
* */
})(jQuery);
| Add initial form submit function | Add initial form submit function
| JavaScript | mit | Syafiqq/server-gardu-reporter,Syafiqq/server-gardu-reporter,Syafiqq/server-gardu-reporter,Syafiqq/server-gardu-reporter | javascript | ## Code Before:
/**
* This <server-gardu-reporter> project created by :
* Name : syafiq
* Date / Time : 28 June 2017, 11:03 PM.
* Email : syafiq.rezpector@gmail.com
* Github : syafiqq
*/
(function ($)
{
$(function ()
{
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
/*
* Run right away
* */
})(jQuery);
## Instruction:
Add initial form submit function
## Code After:
/**
* This <server-gardu-reporter> project created by :
* Name : syafiq
* Date / Time : 28 June 2017, 11:03 PM.
* Email : syafiq.rezpector@gmail.com
* Github : syafiqq
*/
(function ($)
{
$(function ()
{
$('form#login').on('submit', function (event)
{
event.preventDefault();
var input = $(this).serializeObject();
input['remember_me'] = $(this).find('input[type=checkbox][name=remember_me]').prop('checked');
if ((input['remember_me'] === undefined) || (input['remember_me'] === null))
{
input['remember_me'] = false;
}
console.log(input);
});
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
/*
* Run right away
* */
})(jQuery);
| /**
* This <server-gardu-reporter> project created by :
* Name : syafiq
* Date / Time : 28 June 2017, 11:03 PM.
* Email : syafiq.rezpector@gmail.com
* Github : syafiqq
*/
(function ($)
{
$(function ()
{
+ $('form#login').on('submit', function (event)
+ {
+ event.preventDefault();
+
+ var input = $(this).serializeObject();
+
+ input['remember_me'] = $(this).find('input[type=checkbox][name=remember_me]').prop('checked');
+ if ((input['remember_me'] === undefined) || (input['remember_me'] === null))
+ {
+ input['remember_me'] = false;
+ }
+
+ console.log(input);
+ });
+
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
/*
* Run right away
* */
})(jQuery); | 15 | 0.681818 | 15 | 0 |
f64f093568e932bec180f571831548ec24301f3d | cookbooks/checkers/metadata.rb | cookbooks/checkers/metadata.rb | name 'checkers'
maintainer 'Sebastian Wiesner'
maintainer_email 'swiesner@lunaryorn.com'
license 'X11/MIT'
description 'Installs all syntax checkers supported by Flycheck'
version '0.1.0'
| name 'checkers'
maintainer 'Sebastian Wiesner'
maintainer_email 'swiesner@lunaryorn.com'
license 'X11/MIT'
description 'Installs all syntax checkers supported by Flycheck'
version '0.1.0'
depends 'apt'
| Add missing apt dependency to checkers cookbook | Add missing apt dependency to checkers cookbook
| Ruby | mit | purcell/flycheck-vm,purcell/flycheck-vm | ruby | ## Code Before:
name 'checkers'
maintainer 'Sebastian Wiesner'
maintainer_email 'swiesner@lunaryorn.com'
license 'X11/MIT'
description 'Installs all syntax checkers supported by Flycheck'
version '0.1.0'
## Instruction:
Add missing apt dependency to checkers cookbook
## Code After:
name 'checkers'
maintainer 'Sebastian Wiesner'
maintainer_email 'swiesner@lunaryorn.com'
license 'X11/MIT'
description 'Installs all syntax checkers supported by Flycheck'
version '0.1.0'
depends 'apt'
| name 'checkers'
maintainer 'Sebastian Wiesner'
maintainer_email 'swiesner@lunaryorn.com'
license 'X11/MIT'
description 'Installs all syntax checkers supported by Flycheck'
version '0.1.0'
+
+ depends 'apt' | 2 | 0.333333 | 2 | 0 |
8a3f6b8cbe530268cc6ce4994521eff06519e413 | etorrent_test.cfg | etorrent_test.cfg | {etorrent_common_config, [{dirwatch_interval, 20 },
{use_upnp, false},
{dht, false },
{dht_port, 6882 },
{max_peers, 200},
{max_upload_rate, 175},
{max_upload_slots, auto},
{fs_watermark_high, 128},
{fs_watermark_low, 100},
{min_uploads, 2},
{preallocation_strategy, sparse },
{webui, false },
{webui_logger_dir, "log/webui"},
{webui_bind_address, {127,0,0,1}},
{webui_port, 8080},
{profiling, false}]}.
| {etorrent_common_config, [{dirwatch_interval, 20 },
{use_upnp, false},
{dht, false },
{dht_port, 6882 },
{max_peers, 200},
{max_download_rate, 2000},
{max_upload_rate, 2000},
{max_upload_slots, auto},
{fs_watermark_high, 128},
{fs_watermark_low, 100},
{min_uploads, 2},
{preallocation_strategy, sparse },
{webui, false },
{webui_logger_dir, "log/webui"},
{webui_bind_address, {127,0,0,1}},
{webui_port, 8080},
{profiling, false}]}.
| Enable up/download rates in the test configuration. | Enable up/download rates in the test configuration.
| INI | bsd-2-clause | jlouis/etorrent,beni55/etorrent | ini | ## Code Before:
{etorrent_common_config, [{dirwatch_interval, 20 },
{use_upnp, false},
{dht, false },
{dht_port, 6882 },
{max_peers, 200},
{max_upload_rate, 175},
{max_upload_slots, auto},
{fs_watermark_high, 128},
{fs_watermark_low, 100},
{min_uploads, 2},
{preallocation_strategy, sparse },
{webui, false },
{webui_logger_dir, "log/webui"},
{webui_bind_address, {127,0,0,1}},
{webui_port, 8080},
{profiling, false}]}.
## Instruction:
Enable up/download rates in the test configuration.
## Code After:
{etorrent_common_config, [{dirwatch_interval, 20 },
{use_upnp, false},
{dht, false },
{dht_port, 6882 },
{max_peers, 200},
{max_download_rate, 2000},
{max_upload_rate, 2000},
{max_upload_slots, auto},
{fs_watermark_high, 128},
{fs_watermark_low, 100},
{min_uploads, 2},
{preallocation_strategy, sparse },
{webui, false },
{webui_logger_dir, "log/webui"},
{webui_bind_address, {127,0,0,1}},
{webui_port, 8080},
{profiling, false}]}.
| {etorrent_common_config, [{dirwatch_interval, 20 },
{use_upnp, false},
{dht, false },
{dht_port, 6882 },
{max_peers, 200},
+ {max_download_rate, 2000},
- {max_upload_rate, 175},
? ^^^
+ {max_upload_rate, 2000},
? ^^^^
{max_upload_slots, auto},
{fs_watermark_high, 128},
{fs_watermark_low, 100},
{min_uploads, 2},
{preallocation_strategy, sparse },
{webui, false },
{webui_logger_dir, "log/webui"},
{webui_bind_address, {127,0,0,1}},
{webui_port, 8080},
{profiling, false}]}. | 3 | 0.1875 | 2 | 1 |
b4fc4a8ed7f43ced0f22ae95f3efb461fc65b2c7 | demos/resources/codemirror-extension/addon/hint/show-hint-eclipse.css | demos/resources/codemirror-extension/addon/hint/show-hint-eclipse.css | .CodeMirror-hints {
position: absolute;
z-index: 10;
border : double rgb(212, 208, 200) 3px;
max-height: 200px;
max-width: 400px;
min-width: 400px;
overflow: auto;
background: white;
font-family: Tahoma;
font-size: 12px;
padding: 0px;
}
.CodeMirror-hint {
margin: 0px;
padding: 0px;
border: 0px solid transparent;
list-style-type: none;
cursor: pointer;
white-space: nowrap;
}
.CodeMirror-hint-active {
color: white!important;
background-color: rgb(10,36,106) !important;
} | .CodeMirror-hints {
position: absolute;
z-index: 10;
border : double rgb(212, 208, 200) 3px;
max-height: 200px;
max-width: 400px;
min-width: 400px;
overflow: auto;
background: white;
font-family: Tahoma;
font-size: 12px;
padding: 0px;
}
.CodeMirror-hint {
margin: 0px;
padding: 0px;
border: 0px solid transparent;
list-style-type: none;
cursor: pointer;
white-space: nowrap;
display: inline-block;
clear: left;
float: left;
}
.CodeMirror-hint-active {
color: white!important;
background-color: rgb(10,36,106) !important;
} | Make hint templates with longer text readable | Make hint templates with longer text readable
Longer template descriptions were not readable when selected, because the text,
when vertically scrolled, was white on white background. Change items to have
float left and use `inline-block` display to prevent that.
| CSS | mit | angelozerr/tern-tabris,eclipsesource/tern-tabris,eclipsesource/tern-tabris,angelozerr/tern-tabris | css | ## Code Before:
.CodeMirror-hints {
position: absolute;
z-index: 10;
border : double rgb(212, 208, 200) 3px;
max-height: 200px;
max-width: 400px;
min-width: 400px;
overflow: auto;
background: white;
font-family: Tahoma;
font-size: 12px;
padding: 0px;
}
.CodeMirror-hint {
margin: 0px;
padding: 0px;
border: 0px solid transparent;
list-style-type: none;
cursor: pointer;
white-space: nowrap;
}
.CodeMirror-hint-active {
color: white!important;
background-color: rgb(10,36,106) !important;
}
## Instruction:
Make hint templates with longer text readable
Longer template descriptions were not readable when selected, because the text,
when vertically scrolled, was white on white background. Change items to have
float left and use `inline-block` display to prevent that.
## Code After:
.CodeMirror-hints {
position: absolute;
z-index: 10;
border : double rgb(212, 208, 200) 3px;
max-height: 200px;
max-width: 400px;
min-width: 400px;
overflow: auto;
background: white;
font-family: Tahoma;
font-size: 12px;
padding: 0px;
}
.CodeMirror-hint {
margin: 0px;
padding: 0px;
border: 0px solid transparent;
list-style-type: none;
cursor: pointer;
white-space: nowrap;
display: inline-block;
clear: left;
float: left;
}
.CodeMirror-hint-active {
color: white!important;
background-color: rgb(10,36,106) !important;
} | .CodeMirror-hints {
position: absolute;
z-index: 10;
border : double rgb(212, 208, 200) 3px;
max-height: 200px;
max-width: 400px;
min-width: 400px;
overflow: auto;
background: white;
font-family: Tahoma;
font-size: 12px;
padding: 0px;
}
.CodeMirror-hint {
margin: 0px;
padding: 0px;
border: 0px solid transparent;
list-style-type: none;
cursor: pointer;
white-space: nowrap;
+ display: inline-block;
+ clear: left;
+ float: left;
}
.CodeMirror-hint-active {
color: white!important;
background-color: rgb(10,36,106) !important;
} | 3 | 0.111111 | 3 | 0 |
2ee95bb5e1a7595e92337bb47f60b74bb4330e32 | components/rake-support/lib/torquebox/tasks/archive.rb | components/rake-support/lib/torquebox/tasks/archive.rb | if ( rails?( Dir.pwd ) )
namespace :torquebox do
desc "Create a self-contained application archive"
task :archive do
puts "Creating archive of #{RAILS_ROOT}"
bundle_name = File.basename( RAILS_ROOT ) + '.rails'
FileUtils.rm_rf( bundle_name )
skip_files = [
'log',
'tmp',
]
include_files = []
Dir[ "#{RAILS_ROOT}/*" ].each do |entry|
entry = File.basename( entry )
unless ( skip_files.include?( entry ) )
include_files << entry
end
end
puts "Creating archive: #{bundle_name}"
Dir.chdir( RAILS_ROOT ) do
cmd = "jar cf #{bundle_name} #{include_files.join(' ')}"
Open3.popen3( cmd ) do |stdin, stdout, stderr|
stdin.close
stdout_thr = Thread.new(stdout) {|stdout_io|
stdout_io.readlines.each do |l|
puts l
end
stdout_io.close
}
stderr_thr = Thread.new(stderr) {|stderr_io|
stderr_io.readlines.each do |l|
puts l
end
}
stdout_thr.join
stderr_thr.join
end
end
puts "Created archive: #{bundle_name}"
end
end
end
| if ( rails?( Dir.pwd ) )
namespace :torquebox do
desc "Create a self-contained application archive"
task :archive do
puts "Creating archive of #{RAILS_ROOT}"
bundle_name = File.basename( RAILS_ROOT ) + '.rails'
FileUtils.rm_rf( bundle_name )
skip_files = [
'log',
'tmp',
]
include_files = []
Dir[ "#{RAILS_ROOT}/*" ].each do |entry|
entry = File.basename( entry )
unless ( skip_files.include?( entry ) )
include_files << entry
end
end
puts "Creating archive: #{bundle_name}"
Dir.chdir( RAILS_ROOT ) do
unless File.exist? "config/rails-env.yml"
File.open( "config/rails-env.yml", "w" ) do |out|
YAML.dump( { "RAILS_ENV" => "production" }, out )
end
end
cmd = "jar cf #{bundle_name} #{include_files.join(' ')}"
Open3.popen3( cmd ) do |stdin, stdout, stderr|
stdin.close
stdout_thr = Thread.new(stdout) {|stdout_io|
stdout_io.readlines.each do |l|
puts l
end
stdout_io.close
}
stderr_thr = Thread.new(stderr) {|stderr_io|
stderr_io.readlines.each do |l|
puts l
end
}
stdout_thr.join
stderr_thr.join
end
end
puts "Created archive: #{bundle_name}"
end
end
end
| Create rails-env.yml if not present before archiving. | Create rails-env.yml if not present before archiving.
| Ruby | apache-2.0 | torquebox/torquebox,torquebox/torquebox-release,torquebox/torquebox-release,samwgoldman/torquebox,torquebox/torquebox,torquebox/torquebox-release,mje113/torquebox,torquebox/torquebox,vaskoz/torquebox,ksw2599/torquebox,vaskoz/torquebox,torquebox/torquebox,mje113/torquebox,ksw2599/torquebox,samwgoldman/torquebox,samwgoldman/torquebox,ksw2599/torquebox,torquebox/torquebox-release,vaskoz/torquebox,mje113/torquebox,vaskoz/torquebox,mje113/torquebox,ksw2599/torquebox,samwgoldman/torquebox | ruby | ## Code Before:
if ( rails?( Dir.pwd ) )
namespace :torquebox do
desc "Create a self-contained application archive"
task :archive do
puts "Creating archive of #{RAILS_ROOT}"
bundle_name = File.basename( RAILS_ROOT ) + '.rails'
FileUtils.rm_rf( bundle_name )
skip_files = [
'log',
'tmp',
]
include_files = []
Dir[ "#{RAILS_ROOT}/*" ].each do |entry|
entry = File.basename( entry )
unless ( skip_files.include?( entry ) )
include_files << entry
end
end
puts "Creating archive: #{bundle_name}"
Dir.chdir( RAILS_ROOT ) do
cmd = "jar cf #{bundle_name} #{include_files.join(' ')}"
Open3.popen3( cmd ) do |stdin, stdout, stderr|
stdin.close
stdout_thr = Thread.new(stdout) {|stdout_io|
stdout_io.readlines.each do |l|
puts l
end
stdout_io.close
}
stderr_thr = Thread.new(stderr) {|stderr_io|
stderr_io.readlines.each do |l|
puts l
end
}
stdout_thr.join
stderr_thr.join
end
end
puts "Created archive: #{bundle_name}"
end
end
end
## Instruction:
Create rails-env.yml if not present before archiving.
## Code After:
if ( rails?( Dir.pwd ) )
namespace :torquebox do
desc "Create a self-contained application archive"
task :archive do
puts "Creating archive of #{RAILS_ROOT}"
bundle_name = File.basename( RAILS_ROOT ) + '.rails'
FileUtils.rm_rf( bundle_name )
skip_files = [
'log',
'tmp',
]
include_files = []
Dir[ "#{RAILS_ROOT}/*" ].each do |entry|
entry = File.basename( entry )
unless ( skip_files.include?( entry ) )
include_files << entry
end
end
puts "Creating archive: #{bundle_name}"
Dir.chdir( RAILS_ROOT ) do
unless File.exist? "config/rails-env.yml"
File.open( "config/rails-env.yml", "w" ) do |out|
YAML.dump( { "RAILS_ENV" => "production" }, out )
end
end
cmd = "jar cf #{bundle_name} #{include_files.join(' ')}"
Open3.popen3( cmd ) do |stdin, stdout, stderr|
stdin.close
stdout_thr = Thread.new(stdout) {|stdout_io|
stdout_io.readlines.each do |l|
puts l
end
stdout_io.close
}
stderr_thr = Thread.new(stderr) {|stderr_io|
stderr_io.readlines.each do |l|
puts l
end
}
stdout_thr.join
stderr_thr.join
end
end
puts "Created archive: #{bundle_name}"
end
end
end
| if ( rails?( Dir.pwd ) )
namespace :torquebox do
desc "Create a self-contained application archive"
task :archive do
puts "Creating archive of #{RAILS_ROOT}"
bundle_name = File.basename( RAILS_ROOT ) + '.rails'
FileUtils.rm_rf( bundle_name )
skip_files = [
'log',
'tmp',
]
include_files = []
Dir[ "#{RAILS_ROOT}/*" ].each do |entry|
entry = File.basename( entry )
unless ( skip_files.include?( entry ) )
include_files << entry
end
end
puts "Creating archive: #{bundle_name}"
Dir.chdir( RAILS_ROOT ) do
+ unless File.exist? "config/rails-env.yml"
+ File.open( "config/rails-env.yml", "w" ) do |out|
+ YAML.dump( { "RAILS_ENV" => "production" }, out )
+ end
+ end
cmd = "jar cf #{bundle_name} #{include_files.join(' ')}"
Open3.popen3( cmd ) do |stdin, stdout, stderr|
stdin.close
stdout_thr = Thread.new(stdout) {|stdout_io|
stdout_io.readlines.each do |l|
puts l
end
stdout_io.close
}
stderr_thr = Thread.new(stderr) {|stderr_io|
stderr_io.readlines.each do |l|
puts l
end
}
stdout_thr.join
stderr_thr.join
end
end
puts "Created archive: #{bundle_name}"
end
end
end
| 5 | 0.104167 | 5 | 0 |
ff9d6bc72673843fcdf6f7e0d866beec5bdb45f0 | mezzanine/accounts/models.py | mezzanine/accounts/models.py | from django.db.models.signals import post_save
from django.dispatch import receiver
from mezzanine.utils.models import get_user_model
from mezzanine.accounts import get_profile_model, get_profile_user_fieldname
# Signal for ensuring users have a profile instance.
Profile = get_profile_model()
User = get_user_model()
if Profile:
user_field = get_profile_user_fieldname()
@receiver(post_save, sender=User)
def user_saved(sender=None, instance=None, **kwargs):
Profile.objects.get_or_create(**{str(user_field): instance})
|
from django.db import connection
from django.db.models.signals import post_save
from django.db.utils import DatabaseError
from django.dispatch import receiver
from mezzanine.utils.models import get_user_model
from mezzanine.accounts import get_profile_model, get_profile_user_fieldname
# Signal for ensuring users have a profile instance.
Profile = get_profile_model()
User = get_user_model()
if Profile:
user_field = get_profile_user_fieldname()
@receiver(post_save, sender=User)
def user_saved(sender=None, instance=None, **kwargs):
try:
Profile.objects.get_or_create(**{str(user_field): instance})
except DatabaseError:
# User creation in initial syncdb may have been triggered,
# while profile model is under migration management and
# doesn't exist yet. We close the connection so that it
# gets re-opened, allowing syncdb to continue and complete.
connection.close()
| Allow initial user creation in syncdb when a profile model is managed by migrations and doesn't yet exist. | Allow initial user creation in syncdb when a profile model is managed by migrations and doesn't yet exist.
| Python | bsd-2-clause | jjz/mezzanine,cccs-web/mezzanine,stephenmcd/mezzanine,Kniyl/mezzanine,gradel/mezzanine,mush42/mezzanine,dekomote/mezzanine-modeltranslation-backport,eino-makitalo/mezzanine,dsanders11/mezzanine,cccs-web/mezzanine,christianwgd/mezzanine,scarcry/snm-mezzanine,theclanks/mezzanine,webounty/mezzanine,dovydas/mezzanine,nikolas/mezzanine,douglaskastle/mezzanine,readevalprint/mezzanine,dovydas/mezzanine,emile2016/mezzanine,ZeroXn/mezzanine,vladir/mezzanine,damnfine/mezzanine,vladir/mezzanine,damnfine/mezzanine,stbarnabas/mezzanine,frankchin/mezzanine,stephenmcd/mezzanine,saintbird/mezzanine,Cajoline/mezzanine,Kniyl/mezzanine,wyzex/mezzanine,jjz/mezzanine,readevalprint/mezzanine,viaregio/mezzanine,jerivas/mezzanine,promil23/mezzanine,jerivas/mezzanine,spookylukey/mezzanine,viaregio/mezzanine,nikolas/mezzanine,douglaskastle/mezzanine,Kniyl/mezzanine,sjuxax/mezzanine,webounty/mezzanine,promil23/mezzanine,PegasusWang/mezzanine,biomassives/mezzanine,scarcry/snm-mezzanine,PegasusWang/mezzanine,SoLoHiC/mezzanine,nikolas/mezzanine,agepoly/mezzanine,fusionbox/mezzanine,frankier/mezzanine,PegasusWang/mezzanine,fusionbox/mezzanine,geodesign/mezzanine,sjdines/mezzanine,batpad/mezzanine,AlexHill/mezzanine,scarcry/snm-mezzanine,molokov/mezzanine,viaregio/mezzanine,dekomote/mezzanine-modeltranslation-backport,wbtuomela/mezzanine,promil23/mezzanine,wbtuomela/mezzanine,eino-makitalo/mezzanine,wyzex/mezzanine,saintbird/mezzanine,stephenmcd/mezzanine,joshcartme/mezzanine,gradel/mezzanine,wyzex/mezzanine,adrian-the-git/mezzanine,emile2016/mezzanine,geodesign/mezzanine,frankier/mezzanine,dovydas/mezzanine,industrydive/mezzanine,emile2016/mezzanine,stbarnabas/mezzanine,agepoly/mezzanine,SoLoHiC/mezzanine,readevalprint/mezzanine,SoLoHiC/mezzanine,dustinrb/mezzanine,biomassives/mezzanine,christianwgd/mezzanine,tuxinhang1989/mezzanine,theclanks/mezzanine,sjdines/mezzanine,tuxinhang1989/mezzanine,webounty/mezzanine,Cajoline/mezzanine,dsanders11/mezzanine,jjz/mezzanine,Skytorn86/mezzanine,ryneeverett/mezzanine,joshcartme/mezzanine,Skytorn86/mezzanine,biomassives/mezzanine,agepoly/mezzanine,spookylukey/mezzanine,ZeroXn/mezzanine,spookylukey/mezzanine,industrydive/mezzanine,joshcartme/mezzanine,eino-makitalo/mezzanine,mush42/mezzanine,christianwgd/mezzanine,ryneeverett/mezzanine,jerivas/mezzanine,dustinrb/mezzanine,theclanks/mezzanine,sjdines/mezzanine,vladir/mezzanine,Cicero-Zhao/mezzanine,adrian-the-git/mezzanine,Cicero-Zhao/mezzanine,industrydive/mezzanine,gradel/mezzanine,dekomote/mezzanine-modeltranslation-backport,sjuxax/mezzanine,douglaskastle/mezzanine,adrian-the-git/mezzanine,AlexHill/mezzanine,damnfine/mezzanine,Cajoline/mezzanine,frankchin/mezzanine,molokov/mezzanine,dsanders11/mezzanine,ryneeverett/mezzanine,tuxinhang1989/mezzanine,wbtuomela/mezzanine,ZeroXn/mezzanine,Skytorn86/mezzanine,batpad/mezzanine,mush42/mezzanine,frankchin/mezzanine,saintbird/mezzanine,sjuxax/mezzanine,frankier/mezzanine,molokov/mezzanine,geodesign/mezzanine,dustinrb/mezzanine | python | ## Code Before:
from django.db.models.signals import post_save
from django.dispatch import receiver
from mezzanine.utils.models import get_user_model
from mezzanine.accounts import get_profile_model, get_profile_user_fieldname
# Signal for ensuring users have a profile instance.
Profile = get_profile_model()
User = get_user_model()
if Profile:
user_field = get_profile_user_fieldname()
@receiver(post_save, sender=User)
def user_saved(sender=None, instance=None, **kwargs):
Profile.objects.get_or_create(**{str(user_field): instance})
## Instruction:
Allow initial user creation in syncdb when a profile model is managed by migrations and doesn't yet exist.
## Code After:
from django.db import connection
from django.db.models.signals import post_save
from django.db.utils import DatabaseError
from django.dispatch import receiver
from mezzanine.utils.models import get_user_model
from mezzanine.accounts import get_profile_model, get_profile_user_fieldname
# Signal for ensuring users have a profile instance.
Profile = get_profile_model()
User = get_user_model()
if Profile:
user_field = get_profile_user_fieldname()
@receiver(post_save, sender=User)
def user_saved(sender=None, instance=None, **kwargs):
try:
Profile.objects.get_or_create(**{str(user_field): instance})
except DatabaseError:
# User creation in initial syncdb may have been triggered,
# while profile model is under migration management and
# doesn't exist yet. We close the connection so that it
# gets re-opened, allowing syncdb to continue and complete.
connection.close()
| +
+ from django.db import connection
from django.db.models.signals import post_save
+ from django.db.utils import DatabaseError
from django.dispatch import receiver
from mezzanine.utils.models import get_user_model
from mezzanine.accounts import get_profile_model, get_profile_user_fieldname
# Signal for ensuring users have a profile instance.
Profile = get_profile_model()
User = get_user_model()
if Profile:
user_field = get_profile_user_fieldname()
@receiver(post_save, sender=User)
def user_saved(sender=None, instance=None, **kwargs):
+ try:
- Profile.objects.get_or_create(**{str(user_field): instance})
+ Profile.objects.get_or_create(**{str(user_field): instance})
? ++++
+ except DatabaseError:
+ # User creation in initial syncdb may have been triggered,
+ # while profile model is under migration management and
+ # doesn't exist yet. We close the connection so that it
+ # gets re-opened, allowing syncdb to continue and complete.
+ connection.close() | 12 | 0.705882 | 11 | 1 |
2ba5f562edb568653574d329a9f1ffbe8b15e7c5 | tests/test_caching.py | tests/test_caching.py | import os
import tempfile
from . import RTRSSTestCase
from rtrss import caching, config
class CachingTestCase(RTRSSTestCase):
def setUp(self):
fh, self.filename = tempfile.mkstemp(dir=config.DATA_DIR)
os.close(fh)
def tearDown(self):
os.remove(self.filename)
def test_open_for_atomic_write_writes(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
def test_atomic_write_really_atomic(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename, 'w') as f1:
f1.write('this will be overwritten')
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
| import os
import tempfile
from . import TempDirTestCase
from rtrss import caching
class CachingTestCase(TempDirTestCase):
def setUp(self):
super(CachingTestCase, self).setUp()
fh, self.filename = tempfile.mkstemp(dir=self.dir.path)
os.close(fh)
def tearDown(self):
os.remove(self.filename)
super(CachingTestCase, self).tearDown()
def test_open_for_atomic_write_writes(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
def test_atomic_write_really_atomic(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename, 'w') as f1:
f1.write('this will be overwritten')
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
| Update test case to use new base class | Update test case to use new base class
| Python | apache-2.0 | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | python | ## Code Before:
import os
import tempfile
from . import RTRSSTestCase
from rtrss import caching, config
class CachingTestCase(RTRSSTestCase):
def setUp(self):
fh, self.filename = tempfile.mkstemp(dir=config.DATA_DIR)
os.close(fh)
def tearDown(self):
os.remove(self.filename)
def test_open_for_atomic_write_writes(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
def test_atomic_write_really_atomic(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename, 'w') as f1:
f1.write('this will be overwritten')
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
## Instruction:
Update test case to use new base class
## Code After:
import os
import tempfile
from . import TempDirTestCase
from rtrss import caching
class CachingTestCase(TempDirTestCase):
def setUp(self):
super(CachingTestCase, self).setUp()
fh, self.filename = tempfile.mkstemp(dir=self.dir.path)
os.close(fh)
def tearDown(self):
os.remove(self.filename)
super(CachingTestCase, self).tearDown()
def test_open_for_atomic_write_writes(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
def test_atomic_write_really_atomic(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename, 'w') as f1:
f1.write('this will be overwritten')
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
| import os
import tempfile
- from . import RTRSSTestCase
? - ^^^
+ from . import TempDirTestCase
? ^^^^^^
- from rtrss import caching, config
? --------
+ from rtrss import caching
- class CachingTestCase(RTRSSTestCase):
? - ^^^
+ class CachingTestCase(TempDirTestCase):
? ^^^^^^
def setUp(self):
+ super(CachingTestCase, self).setUp()
- fh, self.filename = tempfile.mkstemp(dir=config.DATA_DIR)
? ^^^ ^ ^^^^^^^^
+ fh, self.filename = tempfile.mkstemp(dir=self.dir.path)
? ^^^ ++ ^ ^^^^
os.close(fh)
def tearDown(self):
os.remove(self.filename)
+ super(CachingTestCase, self).tearDown()
def test_open_for_atomic_write_writes(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data)
def test_atomic_write_really_atomic(self):
test_data = 'test'
with caching.open_for_atomic_write(self.filename) as f:
f.write(test_data)
with open(self.filename, 'w') as f1:
f1.write('this will be overwritten')
with open(self.filename) as f:
data = f.read()
self.assertEqual(test_data, data) | 10 | 0.285714 | 6 | 4 |
ccd9d033047d6eea20db1a09023f902df351393d | README.md | README.md |
vEwe is a JS library used to manage events through an easy to extend view object. With jQuery as its sole dependency it provides a lightweight alternative for those wishing to avoid a full fledged "framework".
**Key features include:**
+ AMD (asynchronous module definition) ready
+ Unlimited inheritance in 2 flavors
+ Light weight prototypical view objects
+ Events with all the power of jQuery's .on()
For more information visit: http://vewe.mattrohland.com/
|
vEwe is a JS library used to manage events through an easy to extend view object. With jQuery as its sole dependency it provides a lightweight alternative for those wishing to avoid a full fledged "framework".
**Key features include:**
+ AMD (asynchronous module definition) ready
+ Unlimited inheritance in 2 flavors
+ Light weight prototypical view objects
+ Events with all the power of jQuery's .on()
For more information visit: http://mattrohland.github.io/vEwe
| Update page location to github | Update page location to github | Markdown | mit | mattrohland/vEwe,mattrohland/vEwe | markdown | ## Code Before:
vEwe is a JS library used to manage events through an easy to extend view object. With jQuery as its sole dependency it provides a lightweight alternative for those wishing to avoid a full fledged "framework".
**Key features include:**
+ AMD (asynchronous module definition) ready
+ Unlimited inheritance in 2 flavors
+ Light weight prototypical view objects
+ Events with all the power of jQuery's .on()
For more information visit: http://vewe.mattrohland.com/
## Instruction:
Update page location to github
## Code After:
vEwe is a JS library used to manage events through an easy to extend view object. With jQuery as its sole dependency it provides a lightweight alternative for those wishing to avoid a full fledged "framework".
**Key features include:**
+ AMD (asynchronous module definition) ready
+ Unlimited inheritance in 2 flavors
+ Light weight prototypical view objects
+ Events with all the power of jQuery's .on()
For more information visit: http://mattrohland.github.io/vEwe
|
vEwe is a JS library used to manage events through an easy to extend view object. With jQuery as its sole dependency it provides a lightweight alternative for those wishing to avoid a full fledged "framework".
**Key features include:**
+ AMD (asynchronous module definition) ready
+ Unlimited inheritance in 2 flavors
+ Light weight prototypical view objects
+ Events with all the power of jQuery's .on()
- For more information visit: http://vewe.mattrohland.com/
? ----- ^ -
+ For more information visit: http://mattrohland.github.io/vEwe
? ^^^^^^^^ ++++
| 2 | 0.2 | 1 | 1 |
91ee668b4ef42a3e600b4ba617daad183ff8e04b | Ch13_Modules/listing13.06.js | Ch13_Modules/listing13.06.js | /* Get Programming with JavaScript
* Listing 13.06
* Using the spacer namespace
*/
console.log(spacer.box("It's like magic!", 20, "*"));
/* Further Adventures
*
* 1) Run the program.
*
* 2) One at a time, try different
* characters in the call to
* spacer.box.
*
* 3) At the prompt, type spacer
* and press Enter.
*
* > spacer
*
* The spacer object will be displayed
* along with its methods. spacer was
* added to the global scope by the
* module imported using an HTML
* script element.
*
*/ | // Get Programming with JavaScript
// Listings 13.05 and 13.06
// Using the number generator in the guessing game
// tixina
var getGuesser = function (lowest, highest) {
var secret = between(lowest, highest);
return function (userNumber) {
if (userNumber === secret) {
return "Well done!";
} else if (userNumber > secret) {
return "Too high!";
} else {
return "Too low!";
}
};
};
var guess = getGuesser(5, 10);
/* Further Adventures
*
* 1) Run the program and play the game.
*
* 2) Change the arguments to getGuesser so that
* the number to guess is in a bigger range.
*
* 3) Update the game so that it keeps track of
* the number of guesses a player takes to
* find the secret number.
*
* > Well done! You took 6 guesses.
*
*/
| Update to the guessing game | Update to the guessing game | JavaScript | mit | jrlarsen/AdventuresInJavaScript,jrlarsen/AdventuresInCode,jrlarsen/GetProgramming,jrlarsen/AdventuresInJavaScript,jrlarsen/AdventuresInCode,jrlarsen/GetProgramming | javascript | ## Code Before:
/* Get Programming with JavaScript
* Listing 13.06
* Using the spacer namespace
*/
console.log(spacer.box("It's like magic!", 20, "*"));
/* Further Adventures
*
* 1) Run the program.
*
* 2) One at a time, try different
* characters in the call to
* spacer.box.
*
* 3) At the prompt, type spacer
* and press Enter.
*
* > spacer
*
* The spacer object will be displayed
* along with its methods. spacer was
* added to the global scope by the
* module imported using an HTML
* script element.
*
*/
## Instruction:
Update to the guessing game
## Code After:
// Get Programming with JavaScript
// Listings 13.05 and 13.06
// Using the number generator in the guessing game
// tixina
var getGuesser = function (lowest, highest) {
var secret = between(lowest, highest);
return function (userNumber) {
if (userNumber === secret) {
return "Well done!";
} else if (userNumber > secret) {
return "Too high!";
} else {
return "Too low!";
}
};
};
var guess = getGuesser(5, 10);
/* Further Adventures
*
* 1) Run the program and play the game.
*
* 2) Change the arguments to getGuesser so that
* the number to guess is in a bigger range.
*
* 3) Update the game so that it keeps track of
* the number of guesses a player takes to
* find the secret number.
*
* > Well done! You took 6 guesses.
*
*/
| - /* Get Programming with JavaScript
? ^
+ // Get Programming with JavaScript
? ^
- * Listing 13.06
- * Using the spacer namespace
- */
+ // Listings 13.05 and 13.06
+ // Using the number generator in the guessing game
+ // tixina
- console.log(spacer.box("It's like magic!", 20, "*"));
+ var getGuesser = function (lowest, highest) {
+ var secret = between(lowest, highest);
+
+ return function (userNumber) {
+ if (userNumber === secret) {
+ return "Well done!";
+ } else if (userNumber > secret) {
+ return "Too high!";
+ } else {
+ return "Too low!";
+ }
+ };
+ };
+
+ var guess = getGuesser(5, 10);
+
/* Further Adventures
*
- * 1) Run the program.
+ * 1) Run the program and play the game.
*
+ * 2) Change the arguments to getGuesser so that
+ * the number to guess is in a bigger range.
- * 2) One at a time, try different
- * characters in the call to
- * spacer.box.
*
- * 3) At the prompt, type spacer
- * and press Enter.
+ * 3) Update the game so that it keeps track of
+ * the number of guesses a player takes to
+ * find the secret number.
*
+ * > Well done! You took 6 guesses.
- * > spacer
- *
- * The spacer object will be displayed
- * along with its methods. spacer was
- * added to the global scope by the
- * module imported using an HTML
- * script element.
*
*/ | 45 | 1.607143 | 27 | 18 |
dc1f3bbb1cc7d94ff772a654cfc5acc8526525af | app/assets/scss/overrides/_radios.scss | app/assets/scss/overrides/_radios.scss | /*
* On the What type of service do you want to add? page, we want to display the question
* description as hint text, but it's already got classes applied to the HTML. So we want
* to reinstate the govuk-hint colour to conform with other hints.
*
* It may be better to remove these classes in the content loader before they get into
* this app.
*/
.dm-radios--description-hint .govuk-radios__hint .govuk-body,
.dm-radios--description-hint .govuk-radios__hint .govuk-list {
color: $govuk-secondary-text-colour;
} | /*
* On the What type of service do you want to add? page, we want to display the question
* description as hint text, but it's already got classes applied to the HTML. So we want
* to reinstate the govuk-hint colour to conform with other hints.
*
* It may be better to remove these classes in the content loader before they get into
* this app.
*/
.dm-radios--description-hint .govuk-radios__hint .govuk-body,
.dm-radios--description-hint .govuk-radios__hint .govuk-list {
color: $govuk-secondary-text-colour;
}
/*
* We have multiple conditional questions on one option in the declaration journey.
* Because of the way content loader generates questions we end up with no spacing
* beneath the conditional fieldset. This fixes that, but might become unnecessary
* if we redesign the question.
*/
.govuk-radios__conditional fieldset {
margin-bottom: govuk-spacing(6);
} | Add spacing for multiple conditional questions | Add spacing for multiple conditional questions
| SCSS | mit | alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend | scss | ## Code Before:
/*
* On the What type of service do you want to add? page, we want to display the question
* description as hint text, but it's already got classes applied to the HTML. So we want
* to reinstate the govuk-hint colour to conform with other hints.
*
* It may be better to remove these classes in the content loader before they get into
* this app.
*/
.dm-radios--description-hint .govuk-radios__hint .govuk-body,
.dm-radios--description-hint .govuk-radios__hint .govuk-list {
color: $govuk-secondary-text-colour;
}
## Instruction:
Add spacing for multiple conditional questions
## Code After:
/*
* On the What type of service do you want to add? page, we want to display the question
* description as hint text, but it's already got classes applied to the HTML. So we want
* to reinstate the govuk-hint colour to conform with other hints.
*
* It may be better to remove these classes in the content loader before they get into
* this app.
*/
.dm-radios--description-hint .govuk-radios__hint .govuk-body,
.dm-radios--description-hint .govuk-radios__hint .govuk-list {
color: $govuk-secondary-text-colour;
}
/*
* We have multiple conditional questions on one option in the declaration journey.
* Because of the way content loader generates questions we end up with no spacing
* beneath the conditional fieldset. This fixes that, but might become unnecessary
* if we redesign the question.
*/
.govuk-radios__conditional fieldset {
margin-bottom: govuk-spacing(6);
} | /*
* On the What type of service do you want to add? page, we want to display the question
* description as hint text, but it's already got classes applied to the HTML. So we want
* to reinstate the govuk-hint colour to conform with other hints.
*
* It may be better to remove these classes in the content loader before they get into
* this app.
*/
.dm-radios--description-hint .govuk-radios__hint .govuk-body,
.dm-radios--description-hint .govuk-radios__hint .govuk-list {
color: $govuk-secondary-text-colour;
}
+
+ /*
+ * We have multiple conditional questions on one option in the declaration journey.
+ * Because of the way content loader generates questions we end up with no spacing
+ * beneath the conditional fieldset. This fixes that, but might become unnecessary
+ * if we redesign the question.
+ */
+ .govuk-radios__conditional fieldset {
+ margin-bottom: govuk-spacing(6);
+ } | 10 | 0.833333 | 10 | 0 |
e581eb9f332bde7e69cf4fa10a379d860e5d133a | Settings/SettingsUI.h | Settings/SettingsUI.h |
class SettingsUI : public Window {
public:
SettingsUI(HINSTANCE hInstance);
INT_PTR LaunchPropertySheet();
virtual LRESULT WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
private:
};
/* Forward Declarations */
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam);
BOOL CALLBACK GeneralTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK DisplayTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK OSDTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK HotkeyTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK AboutTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); |
class About;
class Display;
class General;
class Hotkeys;
class OSD;
class TabPage;
class SettingsUI : public Window {
public:
SettingsUI(HINSTANCE hInstance);
INT_PTR LaunchPropertySheet();
virtual LRESULT WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
private:
std::vector<TabPage *> _tabs;
General *_general;
Display *_display;
OSD *_osd;
Hotkeys *_hotkeys;
About *_about;
private:
/* Startup x/y location offsets */
static const int XOFFSET = 70;
static const int YOFFSET = 20;
};
/* Forward Declarations */
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam); | Add instance variables, remove callbacks | Add instance variables, remove callbacks
| C | bsd-2-clause | malensek/3RVX,malensek/3RVX,malensek/3RVX | c | ## Code Before:
class SettingsUI : public Window {
public:
SettingsUI(HINSTANCE hInstance);
INT_PTR LaunchPropertySheet();
virtual LRESULT WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
private:
};
/* Forward Declarations */
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam);
BOOL CALLBACK GeneralTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK DisplayTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK OSDTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK HotkeyTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK AboutTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
## Instruction:
Add instance variables, remove callbacks
## Code After:
class About;
class Display;
class General;
class Hotkeys;
class OSD;
class TabPage;
class SettingsUI : public Window {
public:
SettingsUI(HINSTANCE hInstance);
INT_PTR LaunchPropertySheet();
virtual LRESULT WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
private:
std::vector<TabPage *> _tabs;
General *_general;
Display *_display;
OSD *_osd;
Hotkeys *_hotkeys;
About *_about;
private:
/* Startup x/y location offsets */
static const int XOFFSET = 70;
static const int YOFFSET = 20;
};
/* Forward Declarations */
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam); |
+ class About;
+ class Display;
+ class General;
+ class Hotkeys;
+ class OSD;
+ class TabPage;
class SettingsUI : public Window {
public:
SettingsUI(HINSTANCE hInstance);
INT_PTR LaunchPropertySheet();
virtual LRESULT WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
+ private:
+ std::vector<TabPage *> _tabs;
+ General *_general;
+ Display *_display;
+ OSD *_osd;
+ Hotkeys *_hotkeys;
+ About *_about;
private:
+ /* Startup x/y location offsets */
+ static const int XOFFSET = 70;
+ static const int YOFFSET = 20;
};
/* Forward Declarations */
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam);
-
- BOOL CALLBACK GeneralTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
- BOOL CALLBACK DisplayTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
- BOOL CALLBACK OSDTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
- BOOL CALLBACK HotkeyTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
- BOOL CALLBACK AboutTabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); | 22 | 0.88 | 16 | 6 |
15675d7fa1686d3c57a5a21561a28029fa23f8fa | core/src/main/java/arez/Reaction.java | core/src/main/java/arez/Reaction.java | package arez;
import javax.annotation.Nonnull;
import jsinterop.annotations.JsFunction;
/**
* Interface that accepts an {@link Observer} that has been scheduled and
* performs the actions required to run observer.
*
* <p>The interface is marked with the {@link JsFunction} annotation to communicate
* to the GWT2 compiler that it is not necessary to generate class information
* for the implementing methods which reduces code size somewhat.</p>
*/
@JsFunction
@FunctionalInterface
interface Reaction
{
/**
* React to changes, or throw an exception if unable to do so.
*
* @param observer the observer of changes.
* @throws Throwable if there is an error reacting to changes.
*/
void react( @Nonnull Observer observer )
throws Throwable;
}
| package arez;
import javax.annotation.Nonnull;
/**
* Interface that accepts an {@link Observer} that has been scheduled and
* performs the actions required to run observer.
*/
@FunctionalInterface
interface Reaction
{
/**
* React to changes, or throw an exception if unable to do so.
*
* @param observer the observer of changes.
* @throws Throwable if there is an error reacting to changes.
*/
void react( @Nonnull Observer observer )
throws Throwable;
}
| Remove JsFunction as in some cases it increases the code size | Remove JsFunction as in some cases it increases the code size
| Java | apache-2.0 | realityforge/arez,realityforge/arez,realityforge/arez | java | ## Code Before:
package arez;
import javax.annotation.Nonnull;
import jsinterop.annotations.JsFunction;
/**
* Interface that accepts an {@link Observer} that has been scheduled and
* performs the actions required to run observer.
*
* <p>The interface is marked with the {@link JsFunction} annotation to communicate
* to the GWT2 compiler that it is not necessary to generate class information
* for the implementing methods which reduces code size somewhat.</p>
*/
@JsFunction
@FunctionalInterface
interface Reaction
{
/**
* React to changes, or throw an exception if unable to do so.
*
* @param observer the observer of changes.
* @throws Throwable if there is an error reacting to changes.
*/
void react( @Nonnull Observer observer )
throws Throwable;
}
## Instruction:
Remove JsFunction as in some cases it increases the code size
## Code After:
package arez;
import javax.annotation.Nonnull;
/**
* Interface that accepts an {@link Observer} that has been scheduled and
* performs the actions required to run observer.
*/
@FunctionalInterface
interface Reaction
{
/**
* React to changes, or throw an exception if unable to do so.
*
* @param observer the observer of changes.
* @throws Throwable if there is an error reacting to changes.
*/
void react( @Nonnull Observer observer )
throws Throwable;
}
| package arez;
import javax.annotation.Nonnull;
- import jsinterop.annotations.JsFunction;
/**
* Interface that accepts an {@link Observer} that has been scheduled and
* performs the actions required to run observer.
- *
- * <p>The interface is marked with the {@link JsFunction} annotation to communicate
- * to the GWT2 compiler that it is not necessary to generate class information
- * for the implementing methods which reduces code size somewhat.</p>
*/
- @JsFunction
@FunctionalInterface
interface Reaction
{
/**
* React to changes, or throw an exception if unable to do so.
*
* @param observer the observer of changes.
* @throws Throwable if there is an error reacting to changes.
*/
void react( @Nonnull Observer observer )
throws Throwable;
} | 6 | 0.230769 | 0 | 6 |
31adcc005fd099f5dd759396e0719d9f1e2a4883 | src/html/templates/slides/hello-world-jsfiddle.html | src/html/templates/slides/hello-world-jsfiddle.html | <section slide-controller="hello-world-js-fiddle">
<h4>http://jsfiddle.net</h4>
<iframe width="100%" height="90%" src="http://jsfiddle.net" onload="parent.focus()"></iframe>
</section>
| <section slide-controller="hello-world-js-fiddle">
<h4>http://jsfiddle.net</h4>
</section>
| Remove JS fiddle iframe for now | Remove JS fiddle iframe for now
| HTML | mit | tdg5/js4pm,tdg5/js4pm,tdg5/front-end-skills-for-pms,tdg5/front-end-skills-for-pms | html | ## Code Before:
<section slide-controller="hello-world-js-fiddle">
<h4>http://jsfiddle.net</h4>
<iframe width="100%" height="90%" src="http://jsfiddle.net" onload="parent.focus()"></iframe>
</section>
## Instruction:
Remove JS fiddle iframe for now
## Code After:
<section slide-controller="hello-world-js-fiddle">
<h4>http://jsfiddle.net</h4>
</section>
| <section slide-controller="hello-world-js-fiddle">
<h4>http://jsfiddle.net</h4>
- <iframe width="100%" height="90%" src="http://jsfiddle.net" onload="parent.focus()"></iframe>
</section> | 1 | 0.25 | 0 | 1 |
7e81239e7d6d84b0aecf48aa72941d35e7925414 | end-to-end/buildall.sh | end-to-end/buildall.sh | echo "Building images"
set -x
docker build -q -t dwflynn/demo:1.0.0 --build-arg VERSION=1.0.0 demo-service
docker build -q -t dwflynn/demo:2.0.0 --build-arg VERSION=2.0.0 demo-service
docker build -q -t dwflynn/demo:1.0.0tls --build-arg VERSION=1.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/demo:2.0.0tls --build-arg VERSION=2.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/auth:0.0.1 auth-service
docker build -q -t dwflynn/auth:0.0.1tls --build-arg TLS=--tls auth-service
# seriously? there's no docker push --quiet???
docker push dwflynn/demo:1.0.0
docker push dwflynn/demo:2.0.0
docker push dwflynn/demo:1.0.0tls
docker push dwflynn/demo:2.0.0tls
docker push dwflynn/auth:0.0.1
docker push dwflynn/auth:0.0.1tls
set +x
| echo "Building images"
set -x
docker build -q -t dwflynn/demo:1.0.0 --build-arg VERSION=1.0.0 demo-service
docker build -q -t dwflynn/demo:2.0.0 --build-arg VERSION=2.0.0 demo-service
docker build -q -t dwflynn/demo:1.0.0tls --build-arg VERSION=1.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/demo:2.0.0tls --build-arg VERSION=2.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/auth:0.0.1 auth-service
docker build -q -t dwflynn/auth:0.0.1tls --build-arg TLS=--tls auth-service
# seriously? there's no docker push --quiet???
docker push dwflynn/demo:1.0.0 | python linify.py push.log
docker push dwflynn/demo:2.0.0 | python linify.py push.log
docker push dwflynn/demo:1.0.0tls | python linify.py push.log
docker push dwflynn/demo:2.0.0tls | python linify.py push.log
docker push dwflynn/auth:0.0.1 | python linify.py push.log
docker push dwflynn/auth:0.0.1tls | python linify.py push.log
set +x
| Use linify on the docker push commands. Stupid docker push. | Use linify on the docker push commands. Stupid docker push.
| Shell | apache-2.0 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | shell | ## Code Before:
echo "Building images"
set -x
docker build -q -t dwflynn/demo:1.0.0 --build-arg VERSION=1.0.0 demo-service
docker build -q -t dwflynn/demo:2.0.0 --build-arg VERSION=2.0.0 demo-service
docker build -q -t dwflynn/demo:1.0.0tls --build-arg VERSION=1.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/demo:2.0.0tls --build-arg VERSION=2.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/auth:0.0.1 auth-service
docker build -q -t dwflynn/auth:0.0.1tls --build-arg TLS=--tls auth-service
# seriously? there's no docker push --quiet???
docker push dwflynn/demo:1.0.0
docker push dwflynn/demo:2.0.0
docker push dwflynn/demo:1.0.0tls
docker push dwflynn/demo:2.0.0tls
docker push dwflynn/auth:0.0.1
docker push dwflynn/auth:0.0.1tls
set +x
## Instruction:
Use linify on the docker push commands. Stupid docker push.
## Code After:
echo "Building images"
set -x
docker build -q -t dwflynn/demo:1.0.0 --build-arg VERSION=1.0.0 demo-service
docker build -q -t dwflynn/demo:2.0.0 --build-arg VERSION=2.0.0 demo-service
docker build -q -t dwflynn/demo:1.0.0tls --build-arg VERSION=1.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/demo:2.0.0tls --build-arg VERSION=2.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/auth:0.0.1 auth-service
docker build -q -t dwflynn/auth:0.0.1tls --build-arg TLS=--tls auth-service
# seriously? there's no docker push --quiet???
docker push dwflynn/demo:1.0.0 | python linify.py push.log
docker push dwflynn/demo:2.0.0 | python linify.py push.log
docker push dwflynn/demo:1.0.0tls | python linify.py push.log
docker push dwflynn/demo:2.0.0tls | python linify.py push.log
docker push dwflynn/auth:0.0.1 | python linify.py push.log
docker push dwflynn/auth:0.0.1tls | python linify.py push.log
set +x
| echo "Building images"
set -x
docker build -q -t dwflynn/demo:1.0.0 --build-arg VERSION=1.0.0 demo-service
docker build -q -t dwflynn/demo:2.0.0 --build-arg VERSION=2.0.0 demo-service
docker build -q -t dwflynn/demo:1.0.0tls --build-arg VERSION=1.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/demo:2.0.0tls --build-arg VERSION=2.0.0 --build-arg TLS=--tls demo-service
docker build -q -t dwflynn/auth:0.0.1 auth-service
docker build -q -t dwflynn/auth:0.0.1tls --build-arg TLS=--tls auth-service
# seriously? there's no docker push --quiet???
- docker push dwflynn/demo:1.0.0
- docker push dwflynn/demo:2.0.0
- docker push dwflynn/demo:1.0.0tls
- docker push dwflynn/demo:2.0.0tls
- docker push dwflynn/auth:0.0.1
- docker push dwflynn/auth:0.0.1tls
+ docker push dwflynn/demo:1.0.0 | python linify.py push.log
+ docker push dwflynn/demo:2.0.0 | python linify.py push.log
+ docker push dwflynn/demo:1.0.0tls | python linify.py push.log
+ docker push dwflynn/demo:2.0.0tls | python linify.py push.log
+ docker push dwflynn/auth:0.0.1 | python linify.py push.log
+ docker push dwflynn/auth:0.0.1tls | python linify.py push.log
set +x | 12 | 0.666667 | 6 | 6 |
fc22d55ba17eac6bb0d3b50584cab0356a8aace9 | circle.yml | circle.yml | machine:
environment:
ANDROID_BUILD_TOOLS_VERSION: 23.0.2
ANDROID_SDK_VERSION: 23
EMULATOR_AVD: circleci-android21
TERM: dumb
java:
version: oraclejdk8
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter tools
- echo y | android update sdk --no-ui --all --filter platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION},android-${ANDROID_SDK_VERSION},extra-android-m2repository
test:
pre:
- ./gradlew assemble -PdisablePreDex
override:
- case ${CIRCLE_NODE_INDEX} in 0) ./gradlew check ;; 1) emulator -avd ${EMULATOR_AVD} -no-audio -no-window & circle-android wait-for-boot; ./gradlew connectedCheck ;; esac:
parallel: true
post:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- find . -type f -regex ".*/build/test-results/.*xml\|.*/build/outputs/androidTest-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
| machine:
environment:
ANDROID_BUILD_TOOLS_VERSION: 23.0.2
ANDROID_SDK_VERSION: 23
EMULATOR_AVD: circleci-android21
TERM: dumb
java:
version: oraclejdk8
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter tools
- echo y | android update sdk --no-ui --all --filter platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION},android-${ANDROID_SDK_VERSION},extra-android-m2repository
test:
pre:
- ./gradlew assemble -PdisablePreDex
override:
- case ${CIRCLE_NODE_INDEX} in 0) ./gradlew check ;; 1) emulator -avd ${EMULATOR_AVD} -no-audio -no-window & circle-android wait-for-boot; ./gradlew connectedCheck ;; esac:
parallel: true
post:
- find . -type f -regex ".*/build/test-results/.*xml\|.*/build/outputs/androidTest-results/.*xml" -exec cp {} ${CIRCLE_TEST_REPORTS} \;
| Copy test reports to $CIRCLE_TEST_REPORTS, do not create subdirectory | Copy test reports to $CIRCLE_TEST_REPORTS, do not create subdirectory
| YAML | apache-2.0 | mkjensen/android-playground | yaml | ## Code Before:
machine:
environment:
ANDROID_BUILD_TOOLS_VERSION: 23.0.2
ANDROID_SDK_VERSION: 23
EMULATOR_AVD: circleci-android21
TERM: dumb
java:
version: oraclejdk8
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter tools
- echo y | android update sdk --no-ui --all --filter platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION},android-${ANDROID_SDK_VERSION},extra-android-m2repository
test:
pre:
- ./gradlew assemble -PdisablePreDex
override:
- case ${CIRCLE_NODE_INDEX} in 0) ./gradlew check ;; 1) emulator -avd ${EMULATOR_AVD} -no-audio -no-window & circle-android wait-for-boot; ./gradlew connectedCheck ;; esac:
parallel: true
post:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- find . -type f -regex ".*/build/test-results/.*xml\|.*/build/outputs/androidTest-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
## Instruction:
Copy test reports to $CIRCLE_TEST_REPORTS, do not create subdirectory
## Code After:
machine:
environment:
ANDROID_BUILD_TOOLS_VERSION: 23.0.2
ANDROID_SDK_VERSION: 23
EMULATOR_AVD: circleci-android21
TERM: dumb
java:
version: oraclejdk8
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter tools
- echo y | android update sdk --no-ui --all --filter platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION},android-${ANDROID_SDK_VERSION},extra-android-m2repository
test:
pre:
- ./gradlew assemble -PdisablePreDex
override:
- case ${CIRCLE_NODE_INDEX} in 0) ./gradlew check ;; 1) emulator -avd ${EMULATOR_AVD} -no-audio -no-window & circle-android wait-for-boot; ./gradlew connectedCheck ;; esac:
parallel: true
post:
- find . -type f -regex ".*/build/test-results/.*xml\|.*/build/outputs/androidTest-results/.*xml" -exec cp {} ${CIRCLE_TEST_REPORTS} \;
| machine:
environment:
ANDROID_BUILD_TOOLS_VERSION: 23.0.2
ANDROID_SDK_VERSION: 23
EMULATOR_AVD: circleci-android21
TERM: dumb
java:
version: oraclejdk8
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter tools
- echo y | android update sdk --no-ui --all --filter platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION},android-${ANDROID_SDK_VERSION},extra-android-m2repository
test:
pre:
- ./gradlew assemble -PdisablePreDex
override:
- case ${CIRCLE_NODE_INDEX} in 0) ./gradlew check ;; 1) emulator -avd ${EMULATOR_AVD} -no-audio -no-window & circle-android wait-for-boot; ./gradlew connectedCheck ;; esac:
parallel: true
post:
- - mkdir -p $CIRCLE_TEST_REPORTS/junit/
- - find . -type f -regex ".*/build/test-results/.*xml\|.*/build/outputs/androidTest-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
? ^^^^^^^
+ - find . -type f -regex ".*/build/test-results/.*xml\|.*/build/outputs/androidTest-results/.*xml" -exec cp {} ${CIRCLE_TEST_REPORTS} \;
? + ^
| 3 | 0.130435 | 1 | 2 |
02446f0c8b4e0aa31f7ba4bab1d71c84b836a348 | README.md | README.md | Snitch
======
An aggregate health checking service. Point snitch at http servers or processes and it will return a `200` status code
if more than 70% of the checks are passing. Snitch was built to be used with AWS Cloud Watch for monitoring docker
containers by triggering if a snitch process falls out of a private ELB.
## Running
```
$ go get github.com/film42/snitch
```
## Docs
```
Must provide at least one process or host to check:
-check value
List of host:port combos to check. Example: --check localhost:1234 --check localhost:3422
-port int
Port to listen on (default 9999)
-process value
List of process substring to check. Example: --process sidekiq --process puma
```
| Snitch
======
An aggregate health checking service. Point snitch at http servers or processes and it will return a `200` status code
if more than 70% of the checks are passing. Snitch was built to be used with AWS Cloud Watch for monitoring docker
containers by triggering if a snitch process falls out of a private ELB.
### Installing
To build from source you can do:
```
$ go get github.com/film42/turbulence
$ ./bin/turbulence
```
Or you can grab the pre-built docker container:
```
$ docker run -p 9999:9999 -d film42/snitch:latest --check localhost:3000 --check localhost:3001
```
## Docs
```
Must provide at least one process or host to check:
-check value
List of host:port combos to check. Example: --check localhost:1234 --check localhost:3422
-port int
Port to listen on (default 9999)
-process value
List of process substring to check. Example: --process sidekiq --process puma
```
| Update readme docs to include docker container | Update readme docs to include docker container
| Markdown | mit | film42/snitch | markdown | ## Code Before:
Snitch
======
An aggregate health checking service. Point snitch at http servers or processes and it will return a `200` status code
if more than 70% of the checks are passing. Snitch was built to be used with AWS Cloud Watch for monitoring docker
containers by triggering if a snitch process falls out of a private ELB.
## Running
```
$ go get github.com/film42/snitch
```
## Docs
```
Must provide at least one process or host to check:
-check value
List of host:port combos to check. Example: --check localhost:1234 --check localhost:3422
-port int
Port to listen on (default 9999)
-process value
List of process substring to check. Example: --process sidekiq --process puma
```
## Instruction:
Update readme docs to include docker container
## Code After:
Snitch
======
An aggregate health checking service. Point snitch at http servers or processes and it will return a `200` status code
if more than 70% of the checks are passing. Snitch was built to be used with AWS Cloud Watch for monitoring docker
containers by triggering if a snitch process falls out of a private ELB.
### Installing
To build from source you can do:
```
$ go get github.com/film42/turbulence
$ ./bin/turbulence
```
Or you can grab the pre-built docker container:
```
$ docker run -p 9999:9999 -d film42/snitch:latest --check localhost:3000 --check localhost:3001
```
## Docs
```
Must provide at least one process or host to check:
-check value
List of host:port combos to check. Example: --check localhost:1234 --check localhost:3422
-port int
Port to listen on (default 9999)
-process value
List of process substring to check. Example: --process sidekiq --process puma
```
| Snitch
======
An aggregate health checking service. Point snitch at http servers or processes and it will return a `200` status code
if more than 70% of the checks are passing. Snitch was built to be used with AWS Cloud Watch for monitoring docker
containers by triggering if a snitch process falls out of a private ELB.
- ## Running
+ ### Installing
+
+ To build from source you can do:
```
- $ go get github.com/film42/snitch
? ^ -- ^
+ $ go get github.com/film42/turbulence
? ^^^^^^^ ^
+ $ ./bin/turbulence
+ ```
+
+ Or you can grab the pre-built docker container:
+
+ ```
+ $ docker run -p 9999:9999 -d film42/snitch:latest --check localhost:3000 --check localhost:3001
```
## Docs
```
Must provide at least one process or host to check:
-check value
List of host:port combos to check. Example: --check localhost:1234 --check localhost:3422
-port int
Port to listen on (default 9999)
-process value
List of process substring to check. Example: --process sidekiq --process puma
``` | 13 | 0.541667 | 11 | 2 |
1baa089313df9fcd3846b0a6b684997ada08f43b | lib/generators/has_publishing/publishing_generator.rb | lib/generators/has_publishing/publishing_generator.rb | require 'rails/generators'
require 'rails/generators/migration'
module HasPublishing
class PublishingGenerator < ::Rails::Generators::NamedBase
include Rails::Generators::Migration
def self.source_root
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
end
def self.next_migration_number(dirname)
if ActiveRecord::Base.timestamped_migrations
Time.new.utc.strftime("%Y%m%d%H%M%S")
else
"%.3d" % (current_migration_number(dirname) + 1)
end
end
def create_migration_file
set_local_assigns!
validate_file_name!
migration_template 'migration.rb', "db/migrate/publishing_fields_for_#{@table_name}.rb"
end
def set_local_assigns!
@table_name = file_name.pluralize
end
end
end | require 'rails/generators'
require 'rails/generators/migration'
module HasPublishing
class PublishingGenerator < ::Rails::Generators::NamedBase
include Rails::Generators::Migration
def self.source_root
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
end
def self.next_migration_number(dirname)
if ActiveRecord::Base.timestamped_migrations
Time.new.utc.strftime("%Y%m%d%H%M%S")
else
"%.3d" % (current_migration_number(dirname) + 1)
end
end
def create_migration_file
set_local_assigns!
migration_template 'migration.rb', "db/migrate/publishing_fields_for_#{@table_name}.rb"
end
def set_local_assigns!
@table_name = file_name.pluralize
end
end
end | Remove uncalled method from generator | Remove uncalled method from generator
| Ruby | mit | 3months/has_publishing | ruby | ## Code Before:
require 'rails/generators'
require 'rails/generators/migration'
module HasPublishing
class PublishingGenerator < ::Rails::Generators::NamedBase
include Rails::Generators::Migration
def self.source_root
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
end
def self.next_migration_number(dirname)
if ActiveRecord::Base.timestamped_migrations
Time.new.utc.strftime("%Y%m%d%H%M%S")
else
"%.3d" % (current_migration_number(dirname) + 1)
end
end
def create_migration_file
set_local_assigns!
validate_file_name!
migration_template 'migration.rb', "db/migrate/publishing_fields_for_#{@table_name}.rb"
end
def set_local_assigns!
@table_name = file_name.pluralize
end
end
end
## Instruction:
Remove uncalled method from generator
## Code After:
require 'rails/generators'
require 'rails/generators/migration'
module HasPublishing
class PublishingGenerator < ::Rails::Generators::NamedBase
include Rails::Generators::Migration
def self.source_root
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
end
def self.next_migration_number(dirname)
if ActiveRecord::Base.timestamped_migrations
Time.new.utc.strftime("%Y%m%d%H%M%S")
else
"%.3d" % (current_migration_number(dirname) + 1)
end
end
def create_migration_file
set_local_assigns!
migration_template 'migration.rb', "db/migrate/publishing_fields_for_#{@table_name}.rb"
end
def set_local_assigns!
@table_name = file_name.pluralize
end
end
end | require 'rails/generators'
require 'rails/generators/migration'
module HasPublishing
class PublishingGenerator < ::Rails::Generators::NamedBase
include Rails::Generators::Migration
def self.source_root
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
end
def self.next_migration_number(dirname)
if ActiveRecord::Base.timestamped_migrations
Time.new.utc.strftime("%Y%m%d%H%M%S")
else
"%.3d" % (current_migration_number(dirname) + 1)
end
end
def create_migration_file
set_local_assigns!
- validate_file_name!
migration_template 'migration.rb', "db/migrate/publishing_fields_for_#{@table_name}.rb"
end
def set_local_assigns!
@table_name = file_name.pluralize
end
end
end | 1 | 0.033333 | 0 | 1 |
9ab53c59943096c6a799901eb0d2236d881a9fa7 | project.clj | project.clj | (defproject lean-map "0.3.0"
:description "Lean Hash Array Mapped Trie implementation in ClojureScript"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:clean-targets ^{:protect false} ["resources/out"]
:jvm-opts ^:replace ["-Xms512m" "-Xmx512m" "-server"]
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]]
:profiles {:test {:dependencies [[collection-check "0.1.7-SNAPSHOT"]]}}
:plugins [[lein-doo "0.1.6-rc.1"]]
:cljsbuild {:builds
[{:id "test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:optimizations :none}}
{:id "node-test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:output-dir "target"
:target :nodejs
:optimizations :none}}]}) | (defproject lean-map "0.3.0"
:description "Lean Hash Array Mapped Trie implementation in ClojureScript"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:clean-targets ^{:protect false} ["resources/out"]
:source-paths ["src/main"]
:jvm-opts ^:replace ["-Xms512m" "-Xmx512m" "-server"]
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]]
:profiles {:test {:dependencies [[collection-check "0.1.7-SNAPSHOT"]]}}
:plugins [[lein-doo "0.1.6-rc.1"]]
:cljsbuild {:builds
[{:id "test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:optimizations :none}}
{:id "node-test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:output-dir "target"
:target :nodejs
:optimizations :none}}]}) | Add in source paths for jar deploys. Oops | Add in source paths for jar deploys. Oops
| Clojure | epl-1.0 | bendyworks/lean-map,mfikes/lean-map,bendyworks/lean-map,mfikes/lean-map,bendyworks/lean-map | clojure | ## Code Before:
(defproject lean-map "0.3.0"
:description "Lean Hash Array Mapped Trie implementation in ClojureScript"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:clean-targets ^{:protect false} ["resources/out"]
:jvm-opts ^:replace ["-Xms512m" "-Xmx512m" "-server"]
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]]
:profiles {:test {:dependencies [[collection-check "0.1.7-SNAPSHOT"]]}}
:plugins [[lein-doo "0.1.6-rc.1"]]
:cljsbuild {:builds
[{:id "test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:optimizations :none}}
{:id "node-test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:output-dir "target"
:target :nodejs
:optimizations :none}}]})
## Instruction:
Add in source paths for jar deploys. Oops
## Code After:
(defproject lean-map "0.3.0"
:description "Lean Hash Array Mapped Trie implementation in ClojureScript"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:clean-targets ^{:protect false} ["resources/out"]
:source-paths ["src/main"]
:jvm-opts ^:replace ["-Xms512m" "-Xmx512m" "-server"]
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]]
:profiles {:test {:dependencies [[collection-check "0.1.7-SNAPSHOT"]]}}
:plugins [[lein-doo "0.1.6-rc.1"]]
:cljsbuild {:builds
[{:id "test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:optimizations :none}}
{:id "node-test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:output-dir "target"
:target :nodejs
:optimizations :none}}]}) | (defproject lean-map "0.3.0"
:description "Lean Hash Array Mapped Trie implementation in ClojureScript"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:clean-targets ^{:protect false} ["resources/out"]
+
+ :source-paths ["src/main"]
:jvm-opts ^:replace ["-Xms512m" "-Xmx512m" "-server"]
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]]
:profiles {:test {:dependencies [[collection-check "0.1.7-SNAPSHOT"]]}}
:plugins [[lein-doo "0.1.6-rc.1"]]
:cljsbuild {:builds
[{:id "test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:optimizations :none}}
{:id "node-test"
:source-paths ["src/main" "test"]
:compiler {:output-to "resources/public/js/testable.js"
:main cljs.lean-map.test.runner
:output-dir "target"
:target :nodejs
:optimizations :none}}]}) | 2 | 0.066667 | 2 | 0 |
8cb96d7cdecc693f2633a5294ae366e6b52e3555 | Resources/views/CRUD/list.html.twig | Resources/views/CRUD/list.html.twig | {% extends '@FSiAdmin/List/list.html.twig' %}
{% block top_buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', {element : element.id, redirect_uri: app.request.uri}) }}" class="btn btn-xs btn-success">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock top_buttons %}
{% block bottom_buttons %}
{% block buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', {element : element.id, redirect_uri: app.request.uri}) }}" class="btn btn-success" id="create-element">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock buttons %}
{% endblock bottom_buttons %}
| {% extends '@FSiAdmin/List/list.html.twig' %}
{% block top_buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', element.getRouteParameters()|merge({redirect_uri: app.request.uri})) }}" class="btn btn-xs btn-success">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock top_buttons %}
{% block bottom_buttons %}
{% block buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', element.getRouteParameters()|merge({redirect_uri: app.request.uri})) }}" class="btn btn-success" id="create-element">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock buttons %}
{% endblock bottom_buttons %}
| Use admin element to generate path to create action | Use admin element to generate path to create action
| Twig | mit | chives/admin-bundle,admin-panel/admin-bundle,admin-panel/admin-bundle,chives/admin-bundle,chives/admin-bundle,admin-panel/admin-bundle,szymach/admin-bundle,fsi-open/admin-bundle,szymach/admin-bundle,chives/admin-bundle,chives/admin-bundle,fsi-open/admin-bundle | twig | ## Code Before:
{% extends '@FSiAdmin/List/list.html.twig' %}
{% block top_buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', {element : element.id, redirect_uri: app.request.uri}) }}" class="btn btn-xs btn-success">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock top_buttons %}
{% block bottom_buttons %}
{% block buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', {element : element.id, redirect_uri: app.request.uri}) }}" class="btn btn-success" id="create-element">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock buttons %}
{% endblock bottom_buttons %}
## Instruction:
Use admin element to generate path to create action
## Code After:
{% extends '@FSiAdmin/List/list.html.twig' %}
{% block top_buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', element.getRouteParameters()|merge({redirect_uri: app.request.uri})) }}" class="btn btn-xs btn-success">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock top_buttons %}
{% block bottom_buttons %}
{% block buttons %}
{% if element.option('allow_add') == true %}
<a href="{{ path('fsi_admin_form', element.getRouteParameters()|merge({redirect_uri: app.request.uri})) }}" class="btn btn-success" id="create-element">
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock buttons %}
{% endblock bottom_buttons %}
| {% extends '@FSiAdmin/List/list.html.twig' %}
{% block top_buttons %}
{% if element.option('allow_add') == true %}
- <a href="{{ path('fsi_admin_form', {element : element.id, redirect_uri: app.request.uri}) }}" class="btn btn-xs btn-success">
? ----------- ^^^^
+ <a href="{{ path('fsi_admin_form', element.getRouteParameters()|merge({redirect_uri: app.request.uri})) }}" class="btn btn-xs btn-success">
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock top_buttons %}
{% block bottom_buttons %}
{% block buttons %}
{% if element.option('allow_add') == true %}
- <a href="{{ path('fsi_admin_form', {element : element.id, redirect_uri: app.request.uri}) }}" class="btn btn-success" id="create-element">
? ----------- ^^^^
+ <a href="{{ path('fsi_admin_form', element.getRouteParameters()|merge({redirect_uri: app.request.uri})) }}" class="btn btn-success" id="create-element">
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +
<span class="glyphicon glyphicon-plus"></span>
{{ 'crud.list.button.create'|trans({}, 'FSiAdminBundle') }}
</a>
{% endif %}
{% endblock buttons %}
{% endblock bottom_buttons %} | 4 | 0.190476 | 2 | 2 |
6fa49c0e9be1447ac2ab5e67abd8d64bff928100 | README.md | README.md | An OSC to MQTT bridge based on pyliblo and paho.mqtt
|
An [OSC] to [MQTT] bridge based on [pyliblo] and [paho.mqtt].
[osc]: http://opensoundcontrol.org/
[mqtt]: http://mqtt.org/
[paho.mqtt]: https://www.eclipse.org/paho/clients/python/
[pyliblo]: http://das.nasophon.de/pyliblo/
| Add links to project description | Add links to project description
| Markdown | mit | SpotlightKid/osc2mqtt,SpotlightKid/osc2mqtt | markdown | ## Code Before:
An OSC to MQTT bridge based on pyliblo and paho.mqtt
## Instruction:
Add links to project description
## Code After:
An [OSC] to [MQTT] bridge based on [pyliblo] and [paho.mqtt].
[osc]: http://opensoundcontrol.org/
[mqtt]: http://mqtt.org/
[paho.mqtt]: https://www.eclipse.org/paho/clients/python/
[pyliblo]: http://das.nasophon.de/pyliblo/
| +
- An OSC to MQTT bridge based on pyliblo and paho.mqtt
+ An [OSC] to [MQTT] bridge based on [pyliblo] and [paho.mqtt].
? + + + + + + + ++
+
+
+ [osc]: http://opensoundcontrol.org/
+ [mqtt]: http://mqtt.org/
+ [paho.mqtt]: https://www.eclipse.org/paho/clients/python/
+ [pyliblo]: http://das.nasophon.de/pyliblo/ | 9 | 9 | 8 | 1 |
d1c792d910cd438ff41f5f28acdfec868024704a | README.md | README.md | _ __
____ _(_)________ ____ _____/ /_
/ __ `/ / ___/ __ \/ __ \/ ___/ __/
/ /_/ / / / / /_/ / /_/ / / / /_
\__,_/_/_/ / .___/\____/_/ \__/
/_/
# airport
A command line interface for Airport wireless on OS X.
## Usage
```
Usage:
airport (on | off | info | quality | scan | join <SSID>)
airport -h | --help | help
airport --version
Subcommands:
on Turn wireless on.
off Turn wireless off.
info Show the current airport status.
quality Show the wireless quality as a percentage.
scan Perform a scan for wireless networks.
join Join the specified network.
help Display this help information.
Options:
-h --help Display this help information.
--version Display version information.
```
| _ __
____ _(_)________ ____ _____/ /_
/ __ `/ / ___/ __ \/ __ \/ ___/ __/
/ /_/ / / / / /_/ / /_/ / / / /_
\__,_/_/_/ / .___/\____/_/ \__/
/_/
# airport
A command line interface for Airport wireless on OS X.
## Usage
```
Usage:
airport (on | off | info | quality | scan | join <SSID>)
airport -h | --help | help
airport --version
Subcommands:
on Turn wireless on.
off Turn wireless off.
info Show the current airport status.
quality Show the wireless quality as a percentage.
scan Perform a scan for wireless networks.
join Join the specified network.
help Display this help information.
Options:
-h --help Display this help information.
--version Display version information.
```
## Installation
### Homebrew
To install with [Homebrew](http://brew.sh/):
brew tap alphabetum/taps && brew install alphabetum/taps/airport
### bpkg
To install with [bpkg](http://www.bpkg.io/):
bpkg install alphabetum/aiport
### Manual
To install manually, simply add the `airport` script to your `$PATH`. If
you already have a `~/bin` directory, you can use the following command:
curl -L https://raw.github.com/alphabetum/airport/master/airport \
-o ~/bin/airport && chmod +x ~/bin/airport
| Add installation information to Readme. | Add installation information to Readme.
| Markdown | mit | alphabetum/airport | markdown | ## Code Before:
_ __
____ _(_)________ ____ _____/ /_
/ __ `/ / ___/ __ \/ __ \/ ___/ __/
/ /_/ / / / / /_/ / /_/ / / / /_
\__,_/_/_/ / .___/\____/_/ \__/
/_/
# airport
A command line interface for Airport wireless on OS X.
## Usage
```
Usage:
airport (on | off | info | quality | scan | join <SSID>)
airport -h | --help | help
airport --version
Subcommands:
on Turn wireless on.
off Turn wireless off.
info Show the current airport status.
quality Show the wireless quality as a percentage.
scan Perform a scan for wireless networks.
join Join the specified network.
help Display this help information.
Options:
-h --help Display this help information.
--version Display version information.
```
## Instruction:
Add installation information to Readme.
## Code After:
_ __
____ _(_)________ ____ _____/ /_
/ __ `/ / ___/ __ \/ __ \/ ___/ __/
/ /_/ / / / / /_/ / /_/ / / / /_
\__,_/_/_/ / .___/\____/_/ \__/
/_/
# airport
A command line interface for Airport wireless on OS X.
## Usage
```
Usage:
airport (on | off | info | quality | scan | join <SSID>)
airport -h | --help | help
airport --version
Subcommands:
on Turn wireless on.
off Turn wireless off.
info Show the current airport status.
quality Show the wireless quality as a percentage.
scan Perform a scan for wireless networks.
join Join the specified network.
help Display this help information.
Options:
-h --help Display this help information.
--version Display version information.
```
## Installation
### Homebrew
To install with [Homebrew](http://brew.sh/):
brew tap alphabetum/taps && brew install alphabetum/taps/airport
### bpkg
To install with [bpkg](http://www.bpkg.io/):
bpkg install alphabetum/aiport
### Manual
To install manually, simply add the `airport` script to your `$PATH`. If
you already have a `~/bin` directory, you can use the following command:
curl -L https://raw.github.com/alphabetum/airport/master/airport \
-o ~/bin/airport && chmod +x ~/bin/airport
| _ __
____ _(_)________ ____ _____/ /_
/ __ `/ / ___/ __ \/ __ \/ ___/ __/
/ /_/ / / / / /_/ / /_/ / / / /_
\__,_/_/_/ / .___/\____/_/ \__/
/_/
# airport
A command line interface for Airport wireless on OS X.
## Usage
```
Usage:
airport (on | off | info | quality | scan | join <SSID>)
airport -h | --help | help
airport --version
Subcommands:
on Turn wireless on.
off Turn wireless off.
info Show the current airport status.
quality Show the wireless quality as a percentage.
scan Perform a scan for wireless networks.
join Join the specified network.
help Display this help information.
Options:
-h --help Display this help information.
--version Display version information.
```
+
+ ## Installation
+
+ ### Homebrew
+
+ To install with [Homebrew](http://brew.sh/):
+
+ brew tap alphabetum/taps && brew install alphabetum/taps/airport
+
+ ### bpkg
+
+ To install with [bpkg](http://www.bpkg.io/):
+
+ bpkg install alphabetum/aiport
+
+ ### Manual
+
+ To install manually, simply add the `airport` script to your `$PATH`. If
+ you already have a `~/bin` directory, you can use the following command:
+
+ curl -L https://raw.github.com/alphabetum/airport/master/airport \
+ -o ~/bin/airport && chmod +x ~/bin/airport | 22 | 0.6875 | 22 | 0 |
e64063535ff8ef851701a5a55bf25564fc752d27 | test_case_monkey/tcm/templates/project_create.html | test_case_monkey/tcm/templates/project_create.html | {% extends "base.html" %}
{% load static %}
{% block content %}
<div>
<h2>Add project</h2>
<br />
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save" />
</form>
</div>
{% endblock content %}
| {% extends "base.html" %}
{% load static %}
{% block content %}
{% load crispy_forms_tags %}
<div>
<h2>Add project</h2>
<br />
<form action="" method="post">{% csrf_token %}
{{ form|crispy }}
<input type="submit" value="Save" />
</form>
</div>
{% endblock content %}
| Use crispyform instead of default form while creating project | Use crispyform instead of default form while creating project
| HTML | mit | Fanarim/test_case_monkey,Fanarim/test_case_monkey,Fanarim/test_case_monkey,Fanarim/test_case_monkey | html | ## Code Before:
{% extends "base.html" %}
{% load static %}
{% block content %}
<div>
<h2>Add project</h2>
<br />
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save" />
</form>
</div>
{% endblock content %}
## Instruction:
Use crispyform instead of default form while creating project
## Code After:
{% extends "base.html" %}
{% load static %}
{% block content %}
{% load crispy_forms_tags %}
<div>
<h2>Add project</h2>
<br />
<form action="" method="post">{% csrf_token %}
{{ form|crispy }}
<input type="submit" value="Save" />
</form>
</div>
{% endblock content %}
| {% extends "base.html" %}
{% load static %}
{% block content %}
+ {% load crispy_forms_tags %}
<div>
<h2>Add project</h2>
<br />
<form action="" method="post">{% csrf_token %}
- {{ form.as_p }}
? ^^ -
+ {{ form|crispy }}
? ^^^^ +
<input type="submit" value="Save" />
</form>
</div>
{% endblock content %} | 3 | 0.214286 | 2 | 1 |
835c4a3e49ca7d4597f57a86567ff2dbaae030af | pages/common/crontab.md | pages/common/crontab.md |
> Schedule cron jobs to run on a time interval for the current user.
- Edit the crontab file for the current user:
`crontab -e`
- View a list of existing cron jobs for current user:
`crontab -l`
- Remove all cron jobs for the current user:
`crontab -r`
- Cron job definition format:
`{{minute}} {{hour}} {{day_of_month}} {{month}} {{day_of_week}} {{command_to_execute}}`
- Sample job which runs at 10:00 every day. * means any value:
`0 10 * * * {{path/to/script.sh}}`
- Sample job which runs every minute on the 3rd of April:
`* * 3 4 * {{path/to/script.sh}}`
- Sample job which runs at 02:30 every friday:
`30 2 * * 5 {{path/to/script.sh}}`
|
> Schedule cron jobs to run on a time interval for the current user.
> Job definition format: "(min) (hour) (day_of_month) (month) (day_of_week) command_to_execute".
- Edit the crontab file for the current user:
`crontab -e`
- View a list of existing cron jobs for current user:
`crontab -l`
- Remove all cron jobs for the current user:
`crontab -r`
- Sample job which runs at 10:00 every day. * means any value:
`0 10 * * * {{path/to/script.sh}}`
- Sample job which runs every minute on the 3rd of April:
`* * 3 Apr * {{path/to/script.sh}}`
- Sample job which runs at 02:30 every Friday:
`30 2 * * Fri {{path/to/script.sh}}`
| Use day/month names instead of nos. | cron: Use day/month names instead of nos.
| Markdown | mit | felixonmars/tldr,deekim/tldr,zoisom/tldr,deekim/tldr,slash3b/tldr,cptdeka10/tldr,UncommonPleb/tldr,felixonmars/tldr,cptdeka10/tldr,zoisom/tldr,cptdeka10/tldr,UncommonPleb/tldr,deekim/tldr,katekyan/tldr,slash3b/tldr,katekyan/tldr,zoisom/tldr,Phizho/tldr,katekyan/tldr,slash3b/tldr,UncommonPleb/tldr,Phizho/tldr,felixonmars/tldr,Phizho/tldr | markdown | ## Code Before:
> Schedule cron jobs to run on a time interval for the current user.
- Edit the crontab file for the current user:
`crontab -e`
- View a list of existing cron jobs for current user:
`crontab -l`
- Remove all cron jobs for the current user:
`crontab -r`
- Cron job definition format:
`{{minute}} {{hour}} {{day_of_month}} {{month}} {{day_of_week}} {{command_to_execute}}`
- Sample job which runs at 10:00 every day. * means any value:
`0 10 * * * {{path/to/script.sh}}`
- Sample job which runs every minute on the 3rd of April:
`* * 3 4 * {{path/to/script.sh}}`
- Sample job which runs at 02:30 every friday:
`30 2 * * 5 {{path/to/script.sh}}`
## Instruction:
cron: Use day/month names instead of nos.
## Code After:
> Schedule cron jobs to run on a time interval for the current user.
> Job definition format: "(min) (hour) (day_of_month) (month) (day_of_week) command_to_execute".
- Edit the crontab file for the current user:
`crontab -e`
- View a list of existing cron jobs for current user:
`crontab -l`
- Remove all cron jobs for the current user:
`crontab -r`
- Sample job which runs at 10:00 every day. * means any value:
`0 10 * * * {{path/to/script.sh}}`
- Sample job which runs every minute on the 3rd of April:
`* * 3 Apr * {{path/to/script.sh}}`
- Sample job which runs at 02:30 every Friday:
`30 2 * * Fri {{path/to/script.sh}}`
|
> Schedule cron jobs to run on a time interval for the current user.
+ > Job definition format: "(min) (hour) (day_of_month) (month) (day_of_week) command_to_execute".
- Edit the crontab file for the current user:
`crontab -e`
- View a list of existing cron jobs for current user:
`crontab -l`
- Remove all cron jobs for the current user:
`crontab -r`
- - Cron job definition format:
-
- `{{minute}} {{hour}} {{day_of_month}} {{month}} {{day_of_week}} {{command_to_execute}}`
-
- Sample job which runs at 10:00 every day. * means any value:
`0 10 * * * {{path/to/script.sh}}`
- Sample job which runs every minute on the 3rd of April:
- `* * 3 4 * {{path/to/script.sh}}`
? ^
+ `* * 3 Apr * {{path/to/script.sh}}`
? ^^^
- - Sample job which runs at 02:30 every friday:
? ^
+ - Sample job which runs at 02:30 every Friday:
? ^
- `30 2 * * 5 {{path/to/script.sh}}`
? ^
+ `30 2 * * Fri {{path/to/script.sh}}`
? ^^^
| 11 | 0.366667 | 4 | 7 |
67a6a6ec06462dcd5b6f88f7d6e172e332d31936 | .github/PULL_REQUEST_TEMPLATE.md | .github/PULL_REQUEST_TEMPLATE.md | <!--
# Title Line Template: [Brief statement describing what this pull request fixes.]
Use the title line as the title of your pull request, then delete these lines.
-->
## Description
Include a high-level description for what the pull request fixes and links to Github issues it resolves.
## Additional information
* Relevant research and support documents
* Screen shot images
* Notes
* etc.
## Definition of Done
- [ ] Content/documentation reviewed by Julian or someone in the Content Team
- [ ] UX reviewed by Gary or someone the Design team
- [ ] Code reviewed by one of the core developers
- [ ] Acceptance Testing
- [ ] Cross-browser tested against standard browser matrix (TBD)
- [ ] Tested on multiple devices (TBD)
- [ ] HTML5 validation (CircleCI)
- [ ] Accessibility testing & WCAG2 compliance (manual/auto TBD)
- [ ] Stakeholder/PO review
- [ ] CHANGELOG updated
| <!--
# Title Line Template: [Brief statement describing what this pull request fixes.]
Use the title line as the title of your pull request, then delete these lines.
-->
## Description
Include a high-level description for what the pull request fixes and links to Github issues it resolves.
## Additional information
* Relevant research and support documents
* Screen shot images
* Notes
* etc.
## Definition of Done
- [ ] Content/documentation reviewed by Julian or someone in the Content Team
- [ ] UX reviewed by Gary or someone the Design team
- [ ] Code reviewed by one of the core developers
- [ ] Acceptance Testing
- [ ] Cross-browser tested against standard browser matrix (TBD)
- [ ] Tested on multiple devices (TBD)
- [ ] HTML5 validation (CircleCI)
- [ ] Accessibility testing & WCAG2 compliance (`gulp test`)
- [ ] Stakeholder/PO review
- [ ] CHANGELOG updated
| Update DoD checklist on PR template to include Pa11y tests | Update DoD checklist on PR template to include Pa11y tests
| Markdown | mit | AusDTO/gov-au-ui-kit,AusDTO/gov-au-ui-kit,AusDTO/gov-au-ui-kit | markdown | ## Code Before:
<!--
# Title Line Template: [Brief statement describing what this pull request fixes.]
Use the title line as the title of your pull request, then delete these lines.
-->
## Description
Include a high-level description for what the pull request fixes and links to Github issues it resolves.
## Additional information
* Relevant research and support documents
* Screen shot images
* Notes
* etc.
## Definition of Done
- [ ] Content/documentation reviewed by Julian or someone in the Content Team
- [ ] UX reviewed by Gary or someone the Design team
- [ ] Code reviewed by one of the core developers
- [ ] Acceptance Testing
- [ ] Cross-browser tested against standard browser matrix (TBD)
- [ ] Tested on multiple devices (TBD)
- [ ] HTML5 validation (CircleCI)
- [ ] Accessibility testing & WCAG2 compliance (manual/auto TBD)
- [ ] Stakeholder/PO review
- [ ] CHANGELOG updated
## Instruction:
Update DoD checklist on PR template to include Pa11y tests
## Code After:
<!--
# Title Line Template: [Brief statement describing what this pull request fixes.]
Use the title line as the title of your pull request, then delete these lines.
-->
## Description
Include a high-level description for what the pull request fixes and links to Github issues it resolves.
## Additional information
* Relevant research and support documents
* Screen shot images
* Notes
* etc.
## Definition of Done
- [ ] Content/documentation reviewed by Julian or someone in the Content Team
- [ ] UX reviewed by Gary or someone the Design team
- [ ] Code reviewed by one of the core developers
- [ ] Acceptance Testing
- [ ] Cross-browser tested against standard browser matrix (TBD)
- [ ] Tested on multiple devices (TBD)
- [ ] HTML5 validation (CircleCI)
- [ ] Accessibility testing & WCAG2 compliance (`gulp test`)
- [ ] Stakeholder/PO review
- [ ] CHANGELOG updated
| <!--
# Title Line Template: [Brief statement describing what this pull request fixes.]
Use the title line as the title of your pull request, then delete these lines.
-->
## Description
Include a high-level description for what the pull request fixes and links to Github issues it resolves.
## Additional information
* Relevant research and support documents
* Screen shot images
* Notes
* etc.
## Definition of Done
- [ ] Content/documentation reviewed by Julian or someone in the Content Team
- [ ] UX reviewed by Gary or someone the Design team
- [ ] Code reviewed by one of the core developers
- [ ] Acceptance Testing
- [ ] Cross-browser tested against standard browser matrix (TBD)
- [ ] Tested on multiple devices (TBD)
- [ ] HTML5 validation (CircleCI)
- - [ ] Accessibility testing & WCAG2 compliance (manual/auto TBD)
? ^^^ - ^^^ ^^^^^
+ - [ ] Accessibility testing & WCAG2 compliance (`gulp test`)
? ^^ ^^ ^^^^
- [ ] Stakeholder/PO review
- [ ] CHANGELOG updated | 2 | 0.064516 | 1 | 1 |
cfdeb4cabc409fecb1b45d31a89d7c8ec2e49f2b | create_release.sh | create_release.sh |
SCALA_MAJOR_VERSION="$1"
SCALA_MINOR_VERSION="$2"
REPO_FULL_NAME="$3"
TOKEN="$4"
releaseVersion="$(mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision=$(git show -s --format=%ct.%h) help:evaluate -Dexpression=project.version -q -DforceStdout)"
message=$(git log -1 --pretty=%B)
generate_post_data()
{
cat <<EOF
{
"tag_name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"target_commitish": "master",
"name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"body": "$message",
"draft": false,
"prerelease": false
}
EOF
}
tag_release() {
mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision="$(git show -s --format=%ct.%h)" scm:tag
}
echo "Tagging release"
echo tag_release
echo "Create release $releaseVersion for repo: $REPO_FULL_NAME branch: master"
curl -H "Authorization: token $TOKEN" --data "$(generate_post_data)" "https://api.github.com/repos/$REPO_FULL_NAME/releases" |
SCALA_MAJOR_VERSION="$1"
SCALA_MINOR_VERSION="$2"
REPO_FULL_NAME="$3"
TOKEN="$4"
releaseVersion="$(mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision=$(git show -s --format=%ct.%h) help:evaluate -Dexpression=project.version -q -DforceStdout)"
message=$(git log -n 1 --pretty=format:'%s')
generate_post_data()
{
cat <<EOF
{
"tag_name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"target_commitish": "master",
"name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"body": "$message",
"draft": false,
"prerelease": false
}
EOF
}
tag_release() {
mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision="$(git show -s --format=%ct.%h)" scm:tag
}
echo "Tagging release"
echo tag_release
echo "Create release $releaseVersion for repo: $REPO_FULL_NAME branch: master"
curl -H "Authorization: token $TOKEN" --data "$(generate_post_data)" "https://api.github.com/repos/$REPO_FULL_NAME/releases"
| Fix for issue with release script silently failing | Fix for issue with release script silently failing
| Shell | apache-2.0 | SimonJPegg/mvn_scalafmt,SimonJPegg/mvn_scalafmt | shell | ## Code Before:
SCALA_MAJOR_VERSION="$1"
SCALA_MINOR_VERSION="$2"
REPO_FULL_NAME="$3"
TOKEN="$4"
releaseVersion="$(mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision=$(git show -s --format=%ct.%h) help:evaluate -Dexpression=project.version -q -DforceStdout)"
message=$(git log -1 --pretty=%B)
generate_post_data()
{
cat <<EOF
{
"tag_name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"target_commitish": "master",
"name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"body": "$message",
"draft": false,
"prerelease": false
}
EOF
}
tag_release() {
mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision="$(git show -s --format=%ct.%h)" scm:tag
}
echo "Tagging release"
echo tag_release
echo "Create release $releaseVersion for repo: $REPO_FULL_NAME branch: master"
curl -H "Authorization: token $TOKEN" --data "$(generate_post_data)" "https://api.github.com/repos/$REPO_FULL_NAME/releases"
## Instruction:
Fix for issue with release script silently failing
## Code After:
SCALA_MAJOR_VERSION="$1"
SCALA_MINOR_VERSION="$2"
REPO_FULL_NAME="$3"
TOKEN="$4"
releaseVersion="$(mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision=$(git show -s --format=%ct.%h) help:evaluate -Dexpression=project.version -q -DforceStdout)"
message=$(git log -n 1 --pretty=format:'%s')
generate_post_data()
{
cat <<EOF
{
"tag_name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"target_commitish": "master",
"name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"body": "$message",
"draft": false,
"prerelease": false
}
EOF
}
tag_release() {
mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision="$(git show -s --format=%ct.%h)" scm:tag
}
echo "Tagging release"
echo tag_release
echo "Create release $releaseVersion for repo: $REPO_FULL_NAME branch: master"
curl -H "Authorization: token $TOKEN" --data "$(generate_post_data)" "https://api.github.com/repos/$REPO_FULL_NAME/releases"
|
SCALA_MAJOR_VERSION="$1"
SCALA_MINOR_VERSION="$2"
REPO_FULL_NAME="$3"
TOKEN="$4"
releaseVersion="$(mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision=$(git show -s --format=%ct.%h) help:evaluate -Dexpression=project.version -q -DforceStdout)"
- message=$(git log -1 --pretty=%B)
? ^
+ message=$(git log -n 1 --pretty=format:'%s')
? ++ ++++++++ ^^
generate_post_data()
{
cat <<EOF
{
"tag_name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"target_commitish": "master",
"name": "$SCALA_MAJOR_VERSION-$releaseVersion",
"body": "$message",
"draft": false,
"prerelease": false
}
EOF
}
tag_release() {
mvn -Dversion.scala.major="$SCALA_MAJOR_VERSION" -Dversion.scala.minor="$SCALA_MINOR_VERSION" -Drevision="$(git show -s --format=%ct.%h)" scm:tag
}
echo "Tagging release"
echo tag_release
echo "Create release $releaseVersion for repo: $REPO_FULL_NAME branch: master"
curl -H "Authorization: token $TOKEN" --data "$(generate_post_data)" "https://api.github.com/repos/$REPO_FULL_NAME/releases" | 2 | 0.064516 | 1 | 1 |
a513c8525a89f495ff6fd90535c966948b0113d8 | docs/web_modules/Footer/index.css | docs/web_modules/Footer/index.css | .footer {
padding: 2rem 0;
font: 1rem/1.5 Georgia;
text-align: center;
}
| .footer {
padding: 2rem 0;
text-align: center;
}
| Remove serif font from the footer. | Remove serif font from the footer.
| CSS | mit | ben-eb/cssnano | css | ## Code Before:
.footer {
padding: 2rem 0;
font: 1rem/1.5 Georgia;
text-align: center;
}
## Instruction:
Remove serif font from the footer.
## Code After:
.footer {
padding: 2rem 0;
text-align: center;
}
| .footer {
padding: 2rem 0;
- font: 1rem/1.5 Georgia;
text-align: center;
} | 1 | 0.2 | 0 | 1 |
a9400893a488a401e6e333a555378922ae230025 | server/server.php | server/server.php | <?php
define("SECONDS_BETWEEN_ALERTS", 10);
date_default_timezone_set("Europe/Madrid");
header("Content-Type: text/event-stream\n\n");
while (true) {
sendAlert("Test alert");
ob_end_flush();
flush();
sleep(SECONDS_BETWEEN_ALERTS);
}
function sendAlert($message) {
$date = date_create();
$timestamp = date_timestamp_get($date);
echo "data: { \"message\": \"$message\", \"timestamp\": $timestamp }\n\n";
}
?>
| <?php
define("SECONDS_BETWEEN_ALERTS", rand(5, 15));
$alerts = array(
"Coldest Air of the Season Sweeping Through Central and Southern States",
"Belgium on 'high alert'",
"Multiple raids in Brussels as police seek ISIS terrorists",
"Syria fighters may be fueled by amphetamines",
"Alien invasion? Strange sightings in Hong Kong",
"Experts criticise WHO delay in sounding alarm over Ebola outbreak"
);
date_default_timezone_set("Europe/Madrid");
header("Content-Type: text/event-stream\n\n");
while (true) {
sendAlert(rand(0, 5));
ob_end_flush();
flush();
sleep(SECONDS_BETWEEN_ALERTS);
}
function sendAlert($message) {
$date = date_create();
$timestamp = date_timestamp_get($date);
echo "data: { \"message\": \"$message\", \"timestamp\": $timestamp }\n\n";
}
?>
| Add alerts messages and randomize time between alerts | Add alerts messages and randomize time between alerts
| PHP | mit | davidmogar/server-sent-events,davidmogar/server-sent-events,davidmogar/server-sent-events | php | ## Code Before:
<?php
define("SECONDS_BETWEEN_ALERTS", 10);
date_default_timezone_set("Europe/Madrid");
header("Content-Type: text/event-stream\n\n");
while (true) {
sendAlert("Test alert");
ob_end_flush();
flush();
sleep(SECONDS_BETWEEN_ALERTS);
}
function sendAlert($message) {
$date = date_create();
$timestamp = date_timestamp_get($date);
echo "data: { \"message\": \"$message\", \"timestamp\": $timestamp }\n\n";
}
?>
## Instruction:
Add alerts messages and randomize time between alerts
## Code After:
<?php
define("SECONDS_BETWEEN_ALERTS", rand(5, 15));
$alerts = array(
"Coldest Air of the Season Sweeping Through Central and Southern States",
"Belgium on 'high alert'",
"Multiple raids in Brussels as police seek ISIS terrorists",
"Syria fighters may be fueled by amphetamines",
"Alien invasion? Strange sightings in Hong Kong",
"Experts criticise WHO delay in sounding alarm over Ebola outbreak"
);
date_default_timezone_set("Europe/Madrid");
header("Content-Type: text/event-stream\n\n");
while (true) {
sendAlert(rand(0, 5));
ob_end_flush();
flush();
sleep(SECONDS_BETWEEN_ALERTS);
}
function sendAlert($message) {
$date = date_create();
$timestamp = date_timestamp_get($date);
echo "data: { \"message\": \"$message\", \"timestamp\": $timestamp }\n\n";
}
?>
| <?php
- define("SECONDS_BETWEEN_ALERTS", 10);
? ^
+ define("SECONDS_BETWEEN_ALERTS", rand(5, 15));
? ++++++++ ^^
+
+ $alerts = array(
+ "Coldest Air of the Season Sweeping Through Central and Southern States",
+ "Belgium on 'high alert'",
+ "Multiple raids in Brussels as police seek ISIS terrorists",
+ "Syria fighters may be fueled by amphetamines",
+ "Alien invasion? Strange sightings in Hong Kong",
+ "Experts criticise WHO delay in sounding alarm over Ebola outbreak"
+ );
date_default_timezone_set("Europe/Madrid");
header("Content-Type: text/event-stream\n\n");
while (true) {
- sendAlert("Test alert");
+ sendAlert(rand(0, 5));
ob_end_flush();
flush();
sleep(SECONDS_BETWEEN_ALERTS);
}
function sendAlert($message) {
$date = date_create();
$timestamp = date_timestamp_get($date);
echo "data: { \"message\": \"$message\", \"timestamp\": $timestamp }\n\n";
}
?> | 13 | 0.565217 | 11 | 2 |
4ded6812f02132c590dab7e2924b13321c193322 | src/CMakeLists.txt | src/CMakeLists.txt | find_package(CUDA REQUIRED)
include_directories(../include)
find_package(CUDA REQUIRED)
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}")
file(GLOB STEREOSRCS "*.cu" "*.cpp")
if(LIBSGM_SHARED)
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} SHARED)
target_link_libraries(sgm ${CUDA_LIBRARIES})
else()
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} STATIC)
endif()
install(
TARGETS sgm
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX}
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)
install(
FILES ${CMAKE_SOURCE_DIR}/FindLibSGM.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
| find_package(CUDA REQUIRED)
include_directories(../include)
find_package(CUDA REQUIRED)
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall")
endif()
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}")
file(GLOB STEREOSRCS "*.cu" "*.cpp")
if(LIBSGM_SHARED)
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} SHARED)
target_link_libraries(sgm ${CUDA_LIBRARIES})
else()
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} STATIC)
endif()
install(
TARGETS sgm
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX}
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)
install(
FILES ${CMAKE_SOURCE_DIR}/FindLibSGM.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
| Fix build error in Linux | Fix build error in Linux
| Text | apache-2.0 | fixstars-jp/libSGM,fixstars/libSGM | text | ## Code Before:
find_package(CUDA REQUIRED)
include_directories(../include)
find_package(CUDA REQUIRED)
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}")
file(GLOB STEREOSRCS "*.cu" "*.cpp")
if(LIBSGM_SHARED)
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} SHARED)
target_link_libraries(sgm ${CUDA_LIBRARIES})
else()
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} STATIC)
endif()
install(
TARGETS sgm
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX}
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)
install(
FILES ${CMAKE_SOURCE_DIR}/FindLibSGM.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
## Instruction:
Fix build error in Linux
## Code After:
find_package(CUDA REQUIRED)
include_directories(../include)
find_package(CUDA REQUIRED)
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall")
endif()
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}")
file(GLOB STEREOSRCS "*.cu" "*.cpp")
if(LIBSGM_SHARED)
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} SHARED)
target_link_libraries(sgm ${CUDA_LIBRARIES})
else()
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} STATIC)
endif()
install(
TARGETS sgm
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX}
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)
install(
FILES ${CMAKE_SOURCE_DIR}/FindLibSGM.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
| find_package(CUDA REQUIRED)
include_directories(../include)
find_package(CUDA REQUIRED)
+ if (CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall")
+ endif()
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}")
file(GLOB STEREOSRCS "*.cu" "*.cpp")
if(LIBSGM_SHARED)
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} SHARED)
target_link_libraries(sgm ${CUDA_LIBRARIES})
else()
CUDA_ADD_LIBRARY(sgm stereo_sgm.cpp ${STEREOSRCS} STATIC)
endif()
install(
TARGETS sgm
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX}
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)
install(
FILES ${CMAKE_SOURCE_DIR}/FindLibSGM.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}
) | 3 | 0.085714 | 3 | 0 |
7fdc478ab6b4993224139d5b00291e6e02655ba7 | examples/adc_lpc17xx/Cargo.toml | examples/adc_lpc17xx/Cargo.toml | [package]
name = "adc"
version = "0.0.1"
[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
rust-libcore = "*"
| [package]
name = "adc"
version = "0.0.1"
[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
rust-libcore = "*"
[profile.release]
lto = true
| Add LTO to new example | Add LTO to new example
| TOML | apache-2.0 | troplin/zinc,troplin/zinc,troplin/zinc,troplin/zinc,troplin/zinc | toml | ## Code Before:
[package]
name = "adc"
version = "0.0.1"
[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
rust-libcore = "*"
## Instruction:
Add LTO to new example
## Code After:
[package]
name = "adc"
version = "0.0.1"
[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
rust-libcore = "*"
[profile.release]
lto = true
| [package]
name = "adc"
version = "0.0.1"
[features]
default = ["mcu_lpc17xx"]
mcu_lpc17xx = ["zinc/mcu_lpc17xx"]
[dependencies]
zinc = { path = "../.." }
macro_platformtree = { path = "../../macro_platformtree" }
rust-libcore = "*"
+
+ [profile.release]
+ lto = true | 3 | 0.25 | 3 | 0 |
db6bbc428d87d207241c43dba434946e9fe2b709 | packages/ne/network-run.yaml | packages/ne/network-run.yaml | homepage: ''
changelog-type: markdown
hash: e625dfb65dfefaae30309cc8e9761213cb246b38b2d8d17d20b44a5acdcc05df
test-bench-deps: {}
maintainer: kazu@iij.ad.jp
synopsis: Simple network runner library
changelog: |
# Revision history for network-run
## 0.0.0
* First version.
basic-deps:
bytestring: -any
base: '>=4 && <5'
network: '>=3.1.0'
all-versions:
- 0.0.0
- 0.0.1
- 0.1.0
- 0.2.0
- 0.2.1
- 0.2.2
- 0.2.3
author: Kazu Yamamoto
latest: 0.2.3
description-type: haddock
description: Simple functions to run network clients and servers.
license-name: BSD-3-Clause
| homepage: ''
changelog-type: markdown
hash: 7dbb06def522dab413bce4a46af476820bffdff2071974736b06f52f4ab57c96
test-bench-deps: {}
maintainer: kazu@iij.ad.jp
synopsis: Simple network runner library
changelog: |
# Revision history for network-run
## 0.0.0
* First version.
basic-deps:
bytestring: -any
base: '>=4 && <5'
network: '>=3.1.0'
all-versions:
- 0.0.0
- 0.0.1
- 0.1.0
- 0.2.0
- 0.2.1
- 0.2.2
- 0.2.3
- 0.2.4
author: Kazu Yamamoto
latest: 0.2.4
description-type: haddock
description: Simple functions to run network clients and servers.
license-name: BSD-3-Clause
| Update from Hackage at 2020-08-18T02:32:19Z | Update from Hackage at 2020-08-18T02:32:19Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: markdown
hash: e625dfb65dfefaae30309cc8e9761213cb246b38b2d8d17d20b44a5acdcc05df
test-bench-deps: {}
maintainer: kazu@iij.ad.jp
synopsis: Simple network runner library
changelog: |
# Revision history for network-run
## 0.0.0
* First version.
basic-deps:
bytestring: -any
base: '>=4 && <5'
network: '>=3.1.0'
all-versions:
- 0.0.0
- 0.0.1
- 0.1.0
- 0.2.0
- 0.2.1
- 0.2.2
- 0.2.3
author: Kazu Yamamoto
latest: 0.2.3
description-type: haddock
description: Simple functions to run network clients and servers.
license-name: BSD-3-Clause
## Instruction:
Update from Hackage at 2020-08-18T02:32:19Z
## Code After:
homepage: ''
changelog-type: markdown
hash: 7dbb06def522dab413bce4a46af476820bffdff2071974736b06f52f4ab57c96
test-bench-deps: {}
maintainer: kazu@iij.ad.jp
synopsis: Simple network runner library
changelog: |
# Revision history for network-run
## 0.0.0
* First version.
basic-deps:
bytestring: -any
base: '>=4 && <5'
network: '>=3.1.0'
all-versions:
- 0.0.0
- 0.0.1
- 0.1.0
- 0.2.0
- 0.2.1
- 0.2.2
- 0.2.3
- 0.2.4
author: Kazu Yamamoto
latest: 0.2.4
description-type: haddock
description: Simple functions to run network clients and servers.
license-name: BSD-3-Clause
| homepage: ''
changelog-type: markdown
- hash: e625dfb65dfefaae30309cc8e9761213cb246b38b2d8d17d20b44a5acdcc05df
+ hash: 7dbb06def522dab413bce4a46af476820bffdff2071974736b06f52f4ab57c96
test-bench-deps: {}
maintainer: kazu@iij.ad.jp
synopsis: Simple network runner library
changelog: |
# Revision history for network-run
## 0.0.0
* First version.
basic-deps:
bytestring: -any
base: '>=4 && <5'
network: '>=3.1.0'
all-versions:
- 0.0.0
- 0.0.1
- 0.1.0
- 0.2.0
- 0.2.1
- 0.2.2
- 0.2.3
+ - 0.2.4
author: Kazu Yamamoto
- latest: 0.2.3
? ^
+ latest: 0.2.4
? ^
description-type: haddock
description: Simple functions to run network clients and servers.
license-name: BSD-3-Clause | 5 | 0.172414 | 3 | 2 |
68567dde41f0b5897b1142a8e1e651b084abd60f | README.md | README.md | <!-- Nikita Kouevda -->
<!-- 2014/03/29 -->
# albumr
Command-line Imgur album downloader.
## Usage
```bash
python3 albumr.py [-h] [-n] [-t] [-v] album [album ...]
```
## Examples
```bash
python3 albumr.py -ntv adkET
```
```bash
python3 albumr.py http://imgur.com/a/adkET
```
## License
Licensed under the [MIT License](http://www.opensource.org/licenses/MIT).
| <!-- Nikita Kouevda -->
<!-- 2014/03/29 -->
# albumr
Command-line Imgur album downloader.
## Usage
```bash
./albumr.py [-h] [-n] [-t] [-v] album [album ...]
```
## Examples
```bash
./albumr.py -ntv adkET
```
```bash
./albumr.py http://imgur.com/a/adkET
```
## License
Licensed under the [MIT License](http://www.opensource.org/licenses/MIT).
| Remove python3 command from usage and examples. | Remove python3 command from usage and examples.
| Markdown | mit | nkouevda/albumr | markdown | ## Code Before:
<!-- Nikita Kouevda -->
<!-- 2014/03/29 -->
# albumr
Command-line Imgur album downloader.
## Usage
```bash
python3 albumr.py [-h] [-n] [-t] [-v] album [album ...]
```
## Examples
```bash
python3 albumr.py -ntv adkET
```
```bash
python3 albumr.py http://imgur.com/a/adkET
```
## License
Licensed under the [MIT License](http://www.opensource.org/licenses/MIT).
## Instruction:
Remove python3 command from usage and examples.
## Code After:
<!-- Nikita Kouevda -->
<!-- 2014/03/29 -->
# albumr
Command-line Imgur album downloader.
## Usage
```bash
./albumr.py [-h] [-n] [-t] [-v] album [album ...]
```
## Examples
```bash
./albumr.py -ntv adkET
```
```bash
./albumr.py http://imgur.com/a/adkET
```
## License
Licensed under the [MIT License](http://www.opensource.org/licenses/MIT).
| <!-- Nikita Kouevda -->
<!-- 2014/03/29 -->
# albumr
Command-line Imgur album downloader.
## Usage
```bash
- python3 albumr.py [-h] [-n] [-t] [-v] album [album ...]
? ^^^^^^^^
+ ./albumr.py [-h] [-n] [-t] [-v] album [album ...]
? ^^
```
## Examples
```bash
- python3 albumr.py -ntv adkET
? ^^^^^^^^
+ ./albumr.py -ntv adkET
? ^^
```
```bash
- python3 albumr.py http://imgur.com/a/adkET
? ^^^^^^^^
+ ./albumr.py http://imgur.com/a/adkET
? ^^
```
## License
Licensed under the [MIT License](http://www.opensource.org/licenses/MIT). | 6 | 0.230769 | 3 | 3 |
cfb5bf7140e595b63a3e6e702237f6e103f1b543 | closed_issues.rb | closed_issues.rb | MILESTONE = 36
ACCESS_TOKEN = "your github access token"
require 'octokit'
o = Octokit::Client.new(:access_token => ACCESS_TOKEN)
results = []
page = 1
loop do
response = o.issues("ManageIQ/manageiq", :milestone => MILESTONE, :state => "closed", :page => page)
break if response == []
results += response
page += 1
end
# Reject issues that are not Pull Requests
results.reject { |i| !i.pull_request? }
puts "Milestone Statistics for: #{results.first.milestone.title}"
puts "NUMBER,AUTHOR,ASSIGNEE,LABELS"
puts "--------------------------------------------------"
results.each do |i|
puts "#{i.number},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}"
end
| MILESTONE = 36
ACCESS_TOKEN = "your github access token"
require 'octokit'
o = Octokit::Client.new(:access_token => ACCESS_TOKEN)
results = []
page = 1
loop do
response = o.issues("ManageIQ/manageiq", :milestone => MILESTONE, :state => "closed", :page => page)
break if response == []
results += response
page += 1
end
# Reject issues that are not Pull Requests
results.reject { |i| !i.pull_request? }
puts "Milestone Statistics for: #{results.first.milestone.title}"
puts "NUMBER,TITLE,AUTHOR,ASSIGNEE,LABELS"
puts "--------------------------------------------------"
results.each do |i|
puts "#{i.number},#{i.title},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}"
end
| Add Title of PR to output | Add Title of PR to output
Need the Title of the PR to figure out what might be able to go in the changelog.
| Ruby | mit | gmcculloug/sprint_statistics | ruby | ## Code Before:
MILESTONE = 36
ACCESS_TOKEN = "your github access token"
require 'octokit'
o = Octokit::Client.new(:access_token => ACCESS_TOKEN)
results = []
page = 1
loop do
response = o.issues("ManageIQ/manageiq", :milestone => MILESTONE, :state => "closed", :page => page)
break if response == []
results += response
page += 1
end
# Reject issues that are not Pull Requests
results.reject { |i| !i.pull_request? }
puts "Milestone Statistics for: #{results.first.milestone.title}"
puts "NUMBER,AUTHOR,ASSIGNEE,LABELS"
puts "--------------------------------------------------"
results.each do |i|
puts "#{i.number},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}"
end
## Instruction:
Add Title of PR to output
Need the Title of the PR to figure out what might be able to go in the changelog.
## Code After:
MILESTONE = 36
ACCESS_TOKEN = "your github access token"
require 'octokit'
o = Octokit::Client.new(:access_token => ACCESS_TOKEN)
results = []
page = 1
loop do
response = o.issues("ManageIQ/manageiq", :milestone => MILESTONE, :state => "closed", :page => page)
break if response == []
results += response
page += 1
end
# Reject issues that are not Pull Requests
results.reject { |i| !i.pull_request? }
puts "Milestone Statistics for: #{results.first.milestone.title}"
puts "NUMBER,TITLE,AUTHOR,ASSIGNEE,LABELS"
puts "--------------------------------------------------"
results.each do |i|
puts "#{i.number},#{i.title},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}"
end
| MILESTONE = 36
ACCESS_TOKEN = "your github access token"
require 'octokit'
o = Octokit::Client.new(:access_token => ACCESS_TOKEN)
results = []
page = 1
loop do
response = o.issues("ManageIQ/manageiq", :milestone => MILESTONE, :state => "closed", :page => page)
break if response == []
results += response
page += 1
end
# Reject issues that are not Pull Requests
results.reject { |i| !i.pull_request? }
puts "Milestone Statistics for: #{results.first.milestone.title}"
- puts "NUMBER,AUTHOR,ASSIGNEE,LABELS"
+ puts "NUMBER,TITLE,AUTHOR,ASSIGNEE,LABELS"
? ++++++
puts "--------------------------------------------------"
results.each do |i|
- puts "#{i.number},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}"
+ puts "#{i.number},#{i.title},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}"
? +++++++++++
end | 4 | 0.16 | 2 | 2 |
bb50e22fd3ad82381dbf750a790b8380a1a1bba5 | src/get_load.c | src/get_load.c | // vim:ts=8:expandtab
#include "i3status.h"
const char *get_load() {
static char part[512];
/* Get load */
#ifdef LINUX
slurp("/proc/loadavg", part, sizeof(part));
*skip_character(part, ' ', 3) = '\0';
#else
/* TODO: correctly check for NetBSD, check if it works the same on *BSD */
struct loadavg load;
size_t length = sizeof(struct loadavg);
int mib[2] = { CTL_VM, VM_LOADAVG };
if (sysctl(mib, 2, &load, &length, NULL, 0) < 0)
die("Could not sysctl({ CTL_VM, VM_LOADAVG })\n");
double scale = load.fscale;
(void)snprintf(part, sizeof(part), "%.02f %.02f %.02f",
(double)load.ldavg[0] / scale,
(double)load.ldavg[1] / scale,
(double)load.ldavg[2] / scale);
#endif
return part;
}
| // vim:ts=8:expandtab
#include "i3status.h"
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
const char *get_load() {
static char part[512];
/* Get load */
#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(sun)
double loadavg[3];
if (getloadavg(loadavg, 3) == -1)
errx(-1, "getloadavg() failed\n");
(void)snprintf(part, sizeof(part), "%1.2f %1.2f %1.2f", loadavg[0], loadavg[1], loadavg[2]);
#else
part[0] = '\0';
#endif
return part;
}
| Use getloadavg() instead of using /proc, patch by Baptiste Daroussin | Use getloadavg() instead of using /proc, patch by Baptiste Daroussin
| C | bsd-3-clause | mkroman/i3status,dj95/i3status,lexszero/i3status,DSMan195276/i3status,afh/i3status,opntr/i3status,Watcom/i3status,lastorset/i3status,Yuhta/i3status,opntr/i3status,rpetrano/i3status,JSmith-BitFlipper/i3status,Gravemind/i3status,puiterwijk/i3status,rpetrano/i3status,i3/i3status,stettberger/i3status,lexszero/i3status,lahwaacz/i3status,dj95/i3status,Dettorer/i3status,Gravemind/i3status,rpetrano/i3status,ixjlyons/i3status,puiterwijk/i3status,KarboniteKream/i3status,Gravemind/i3status,jasperla/i3status,puiterwijk/i3status,Watcom/i3status,ixjlyons/i3status,lbonn/i3status,lahwaacz/i3status,Detegr/i3status,mkroman/i3status,puiterwijk/i3status,Dettorer/i3status,i3/i3status,afh/i3status,glittershark/i3status,bsdjhb/i3status,DSMan195276/i3status,Gravemind/i3status,afh/i3status,KarboniteKream/i3status,jasperla/i3status,dj95/i3status,lastorset/i3status,i3/i3status,Detegr/i3status,glittershark/i3status,jasperla/i3status,ghedamat/i3status,peder2tm/i3status-netdev,rpetrano/i3status,bsdjhb/i3status,ghedamat/i3status,Airblader/i3status,lahwaacz/i3status,JSmith-BitFlipper/i3status,Yuhta/i3status,lbonn/i3status,lahwaacz/i3status,flammi/i3status,stettberger/i3status,peder2tm/i3status-netdev,opntr/i3status,KarboniteKream/i3status,DSMan195276/i3status,ixjlyons/i3status,mkroman/i3status,dj95/i3status,lbonn/i3status,Dettorer/i3status,Airblader/i3status,mkroman/i3status,Detegr/i3status,JSmith-BitFlipper/i3status,i3/i3status,ghedamat/i3status,Yuhta/i3status,flammi/i3status,glittershark/i3status,lbonn/i3status,Airblader/i3status,Yuhta/i3status,bsdjhb/i3status,flammi/i3status,Watcom/i3status,KarboniteKream/i3status,jasperla/i3status,ghedamat/i3status,lexszero/i3status,DSMan195276/i3status,peder2tm/i3status-netdev,peder2tm/i3status-netdev,glittershark/i3status,ixjlyons/i3status,JSmith-BitFlipper/i3status,lexszero/i3status,Dettorer/i3status,afh/i3status,Detegr/i3status,bsdjhb/i3status,Airblader/i3status,opntr/i3status,Watcom/i3status,flammi/i3status | c | ## Code Before:
// vim:ts=8:expandtab
#include "i3status.h"
const char *get_load() {
static char part[512];
/* Get load */
#ifdef LINUX
slurp("/proc/loadavg", part, sizeof(part));
*skip_character(part, ' ', 3) = '\0';
#else
/* TODO: correctly check for NetBSD, check if it works the same on *BSD */
struct loadavg load;
size_t length = sizeof(struct loadavg);
int mib[2] = { CTL_VM, VM_LOADAVG };
if (sysctl(mib, 2, &load, &length, NULL, 0) < 0)
die("Could not sysctl({ CTL_VM, VM_LOADAVG })\n");
double scale = load.fscale;
(void)snprintf(part, sizeof(part), "%.02f %.02f %.02f",
(double)load.ldavg[0] / scale,
(double)load.ldavg[1] / scale,
(double)load.ldavg[2] / scale);
#endif
return part;
}
## Instruction:
Use getloadavg() instead of using /proc, patch by Baptiste Daroussin
## Code After:
// vim:ts=8:expandtab
#include "i3status.h"
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
const char *get_load() {
static char part[512];
/* Get load */
#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(sun)
double loadavg[3];
if (getloadavg(loadavg, 3) == -1)
errx(-1, "getloadavg() failed\n");
(void)snprintf(part, sizeof(part), "%1.2f %1.2f %1.2f", loadavg[0], loadavg[1], loadavg[2]);
#else
part[0] = '\0';
#endif
return part;
}
| // vim:ts=8:expandtab
#include "i3status.h"
+ #include <err.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
const char *get_load() {
static char part[512];
/* Get load */
- #ifdef LINUX
- slurp("/proc/loadavg", part, sizeof(part));
- *skip_character(part, ' ', 3) = '\0';
+ #if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(sun)
+ double loadavg[3];
+ if (getloadavg(loadavg, 3) == -1)
+ errx(-1, "getloadavg() failed\n");
+ (void)snprintf(part, sizeof(part), "%1.2f %1.2f %1.2f", loadavg[0], loadavg[1], loadavg[2]);
#else
+ part[0] = '\0';
- /* TODO: correctly check for NetBSD, check if it works the same on *BSD */
- struct loadavg load;
- size_t length = sizeof(struct loadavg);
- int mib[2] = { CTL_VM, VM_LOADAVG };
- if (sysctl(mib, 2, &load, &length, NULL, 0) < 0)
- die("Could not sysctl({ CTL_VM, VM_LOADAVG })\n");
- double scale = load.fscale;
- (void)snprintf(part, sizeof(part), "%.02f %.02f %.02f",
- (double)load.ldavg[0] / scale,
- (double)load.ldavg[1] / scale,
- (double)load.ldavg[2] / scale);
#endif
return part;
} | 24 | 0.923077 | 10 | 14 |
c85d0b94118e8b6765859dc157fd3b7e54d9fd9a | js/app/modules/social/social.tpl.html | js/app/modules/social/social.tpl.html | <div class="container">
<div class="row clearfix">
<div class="col-md-3 column" style="border-right: 1px solid #ddd;padding: 10px;">
<div id="profile_pic_container" width="200px" height="300px" style="overflow: hidden">
<img src="images/profile_pic_dummy.png" />
</div>
<p style="margin-top: 50px">
<h3>{{label}}</h3>
<p>Email: <a>demo@tugraz.at</a></p>
</p>
</div>
<div class="col-md-9 column">
<tabset >
<tab style="cursor: pointer;" heading = "Groups" ui-sref="app.social.groups" ui-sref-active="active">
</tab>
<tab style="cursor: pointer;" heading = "Friends" ui-sref="app.social.friends">
</tab>
</tabset>
<div id="content" ui-view autoscroll="false">
</div>
</div>
</div>
</div>
| <div class="container">
<div class="row clearfix">
<div class="col-md-3 column" style="border-right: 1px solid #ddd;padding: 10px;">
<span class="btn btn-success" style="margin-bottom:20px;"><span class="glyphicon glyphicon-plus"></span><span class="glyphicon glyphicon-user"></span> Add as friend</span>
<div id="profile_pic_container" width="200px" height="300px" style="overflow: hidden">
<img src="images/profile_pic_dummy.png" />
</div>
<p style="margin-top: 50px">
<h3>{{label}}</h3>
<p>Email: <a>demo@tugraz.at</a></p>
</p>
</div>
<div class="col-md-9 column">
<tabset >
<tab style="cursor: pointer;" heading = "Groups" ui-sref="app.social.groups" ui-sref-active="active">
</tab>
<tab style="cursor: pointer;" heading = "Friends" ui-sref="app.social.friends">
</tab>
</tabset>
<div id="content" ui-view autoscroll="false">
</div>
</div>
</div>
</div>
| Add as friend button added | Add as friend button added
| HTML | apache-2.0 | learning-layers/KnowBrain,learning-layers/KnowBrain | html | ## Code Before:
<div class="container">
<div class="row clearfix">
<div class="col-md-3 column" style="border-right: 1px solid #ddd;padding: 10px;">
<div id="profile_pic_container" width="200px" height="300px" style="overflow: hidden">
<img src="images/profile_pic_dummy.png" />
</div>
<p style="margin-top: 50px">
<h3>{{label}}</h3>
<p>Email: <a>demo@tugraz.at</a></p>
</p>
</div>
<div class="col-md-9 column">
<tabset >
<tab style="cursor: pointer;" heading = "Groups" ui-sref="app.social.groups" ui-sref-active="active">
</tab>
<tab style="cursor: pointer;" heading = "Friends" ui-sref="app.social.friends">
</tab>
</tabset>
<div id="content" ui-view autoscroll="false">
</div>
</div>
</div>
</div>
## Instruction:
Add as friend button added
## Code After:
<div class="container">
<div class="row clearfix">
<div class="col-md-3 column" style="border-right: 1px solid #ddd;padding: 10px;">
<span class="btn btn-success" style="margin-bottom:20px;"><span class="glyphicon glyphicon-plus"></span><span class="glyphicon glyphicon-user"></span> Add as friend</span>
<div id="profile_pic_container" width="200px" height="300px" style="overflow: hidden">
<img src="images/profile_pic_dummy.png" />
</div>
<p style="margin-top: 50px">
<h3>{{label}}</h3>
<p>Email: <a>demo@tugraz.at</a></p>
</p>
</div>
<div class="col-md-9 column">
<tabset >
<tab style="cursor: pointer;" heading = "Groups" ui-sref="app.social.groups" ui-sref-active="active">
</tab>
<tab style="cursor: pointer;" heading = "Friends" ui-sref="app.social.friends">
</tab>
</tabset>
<div id="content" ui-view autoscroll="false">
</div>
</div>
</div>
</div>
| <div class="container">
<div class="row clearfix">
<div class="col-md-3 column" style="border-right: 1px solid #ddd;padding: 10px;">
+ <span class="btn btn-success" style="margin-bottom:20px;"><span class="glyphicon glyphicon-plus"></span><span class="glyphicon glyphicon-user"></span> Add as friend</span>
<div id="profile_pic_container" width="200px" height="300px" style="overflow: hidden">
<img src="images/profile_pic_dummy.png" />
</div>
<p style="margin-top: 50px">
<h3>{{label}}</h3>
<p>Email: <a>demo@tugraz.at</a></p>
</p>
</div>
<div class="col-md-9 column">
<tabset >
<tab style="cursor: pointer;" heading = "Groups" ui-sref="app.social.groups" ui-sref-active="active">
</tab>
<tab style="cursor: pointer;" heading = "Friends" ui-sref="app.social.friends">
</tab>
</tabset>
<div id="content" ui-view autoscroll="false">
</div>
</div>
</div>
</div>
| 1 | 0.034483 | 1 | 0 |
0d884a6cfefe27720c0c4f5e5692cab8442f323c | src/index.tsx | src/index.tsx | import { createRoot } from "react-dom/client";
import App from "./App";
if (process.env.NODE_ENV === "production") {
if (window.location.host === "www.npcgenerator.com") {
console.log("you are accessing us via www. Redirecting you to non-www.");
window.location.href = window.location.href.replace("www.", "");
}
// if (window.location.protocol === "http:") {
// console.log("you are accessing us via an insecure protocol (HTTP). Redirecting you to HTTPS.");
// window.location.href = window.location.href.replace("http:", "https:");
// }
}
createRoot(document.getElementById("root")!).render(<App />);
| import { createRoot } from "react-dom/client";
import App from "./App";
createRoot(document.getElementById("root")!).render(<App />);
| Revert "Javascript redirect of www.npcgenerator.com to npcgenerator.com" | Revert "Javascript redirect of www.npcgenerator.com to npcgenerator.com"
This reverts commit ed519b129e223d8ab1c58face022dbfa0868d995.
| TypeScript | mit | Cellule/dndGenerator,Cellule/dndGenerator,Cellule/dndGenerator | typescript | ## Code Before:
import { createRoot } from "react-dom/client";
import App from "./App";
if (process.env.NODE_ENV === "production") {
if (window.location.host === "www.npcgenerator.com") {
console.log("you are accessing us via www. Redirecting you to non-www.");
window.location.href = window.location.href.replace("www.", "");
}
// if (window.location.protocol === "http:") {
// console.log("you are accessing us via an insecure protocol (HTTP). Redirecting you to HTTPS.");
// window.location.href = window.location.href.replace("http:", "https:");
// }
}
createRoot(document.getElementById("root")!).render(<App />);
## Instruction:
Revert "Javascript redirect of www.npcgenerator.com to npcgenerator.com"
This reverts commit ed519b129e223d8ab1c58face022dbfa0868d995.
## Code After:
import { createRoot } from "react-dom/client";
import App from "./App";
createRoot(document.getElementById("root")!).render(<App />);
| import { createRoot } from "react-dom/client";
import App from "./App";
- if (process.env.NODE_ENV === "production") {
- if (window.location.host === "www.npcgenerator.com") {
- console.log("you are accessing us via www. Redirecting you to non-www.");
- window.location.href = window.location.href.replace("www.", "");
- }
- // if (window.location.protocol === "http:") {
- // console.log("you are accessing us via an insecure protocol (HTTP). Redirecting you to HTTPS.");
- // window.location.href = window.location.href.replace("http:", "https:");
- // }
- }
-
createRoot(document.getElementById("root")!).render(<App />); | 11 | 0.733333 | 0 | 11 |
0191d1bba88c98eb6e4627301e02c3750af2ed42 | init-extension/init-evil-plugins.el | init-extension/init-evil-plugins.el | (use-package evil-little-word)
(use-package evil-operator-moccur
:init
(global-evil-operator-moccur-mode 1))
(use-package evil-operator-comment
:init
(global-evil-operator-comment-mode 1))
| (use-package evil-little-word)
(use-package evil-operator-comment
:init
(global-evil-operator-comment-mode 1))
| Remove unused evil plugin for mocur | Remove unused evil plugin for mocur
| Emacs Lisp | mit | tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs | emacs-lisp | ## Code Before:
(use-package evil-little-word)
(use-package evil-operator-moccur
:init
(global-evil-operator-moccur-mode 1))
(use-package evil-operator-comment
:init
(global-evil-operator-comment-mode 1))
## Instruction:
Remove unused evil plugin for mocur
## Code After:
(use-package evil-little-word)
(use-package evil-operator-comment
:init
(global-evil-operator-comment-mode 1))
| (use-package evil-little-word)
-
- (use-package evil-operator-moccur
- :init
- (global-evil-operator-moccur-mode 1))
(use-package evil-operator-comment
:init
(global-evil-operator-comment-mode 1)) | 4 | 0.444444 | 0 | 4 |
d814b9f49a59292a585fb6342bf5975dfca5b136 | css/style.css | css/style.css |
body {
font-size: 1.2rem;
font-family: Arial;
background-color: #555;
padding-top: 20px;
position: relative;
}
#container {
display: flex;
justify-content: space-around;
}
.column {
width: 45%;
position: relative;
}
#sourceTA {
width: 100%;
font-size: 1.2rem;
font-family: Arial;
padding: 20px;
height: 92vh;
background-color: #EEE;
box-sizing: border-box;
}
#targetDiv {
border: 1px dashed #333333;
height: 92vh;
box-sizing: border-box;
padding: 0 20px 20px;
background-color: white;
}
.toggle {
position: absolute;
top: -10px;
right: -10px;
font-size: .9rem;
width: 10rem;
padding: 8px;
box-sizing: border-box;
}
|
body {
font-size: 1.2rem;
font-family: Arial;
background-color: #555;
padding-top: 20px;
position: relative;
}
#container {
display: flex;
justify-content: space-around;
}
.column {
width: 45%;
position: relative;
}
#sourceTA {
width: 100%;
font-size: 1.2rem;
font-family: Arial;
padding: 20px;
height: 92vh;
background-color: #EEE;
box-sizing: border-box;
}
#targetDiv {
border: 1px dashed #333333;
height: 92vh;
overflow:scroll;
box-sizing: border-box;
padding: 0 20px 20px;
background-color: white;
}
.toggle {
position: absolute;
top: -10px;
right: -10px;
font-size: .9rem;
width: 10rem;
padding: 8px;
box-sizing: border-box;
}
| Add overflow scroll to display div | Add overflow scroll to display div
| CSS | mit | treehouse-projects/markdown-previewer,treehouse-projects/markdown-previewer | css | ## Code Before:
body {
font-size: 1.2rem;
font-family: Arial;
background-color: #555;
padding-top: 20px;
position: relative;
}
#container {
display: flex;
justify-content: space-around;
}
.column {
width: 45%;
position: relative;
}
#sourceTA {
width: 100%;
font-size: 1.2rem;
font-family: Arial;
padding: 20px;
height: 92vh;
background-color: #EEE;
box-sizing: border-box;
}
#targetDiv {
border: 1px dashed #333333;
height: 92vh;
box-sizing: border-box;
padding: 0 20px 20px;
background-color: white;
}
.toggle {
position: absolute;
top: -10px;
right: -10px;
font-size: .9rem;
width: 10rem;
padding: 8px;
box-sizing: border-box;
}
## Instruction:
Add overflow scroll to display div
## Code After:
body {
font-size: 1.2rem;
font-family: Arial;
background-color: #555;
padding-top: 20px;
position: relative;
}
#container {
display: flex;
justify-content: space-around;
}
.column {
width: 45%;
position: relative;
}
#sourceTA {
width: 100%;
font-size: 1.2rem;
font-family: Arial;
padding: 20px;
height: 92vh;
background-color: #EEE;
box-sizing: border-box;
}
#targetDiv {
border: 1px dashed #333333;
height: 92vh;
overflow:scroll;
box-sizing: border-box;
padding: 0 20px 20px;
background-color: white;
}
.toggle {
position: absolute;
top: -10px;
right: -10px;
font-size: .9rem;
width: 10rem;
padding: 8px;
box-sizing: border-box;
}
|
body {
font-size: 1.2rem;
font-family: Arial;
background-color: #555;
padding-top: 20px;
position: relative;
}
#container {
display: flex;
justify-content: space-around;
}
.column {
width: 45%;
position: relative;
}
#sourceTA {
width: 100%;
font-size: 1.2rem;
font-family: Arial;
padding: 20px;
height: 92vh;
background-color: #EEE;
box-sizing: border-box;
}
#targetDiv {
border: 1px dashed #333333;
height: 92vh;
+ overflow:scroll;
box-sizing: border-box;
padding: 0 20px 20px;
background-color: white;
}
.toggle {
position: absolute;
top: -10px;
right: -10px;
font-size: .9rem;
width: 10rem;
padding: 8px;
box-sizing: border-box;
} | 1 | 0.020833 | 1 | 0 |
49243c55a4c0a9dd82d3ba95f111bc2df430b587 | changelog.d/6329.feature | changelog.d/6329.feature | Implement label-based filtering on `/sync` and `/messages` ([MSC2326](https://github.com/matrix-org/matrix-doc/pull/2326)).
| Filter state, events_before and events_after in /context requests.
| Update changelog since this isn't going to be featured in 1.6.0 | Update changelog since this isn't going to be featured in 1.6.0
| Cucumber | apache-2.0 | matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse | cucumber | ## Code Before:
Implement label-based filtering on `/sync` and `/messages` ([MSC2326](https://github.com/matrix-org/matrix-doc/pull/2326)).
## Instruction:
Update changelog since this isn't going to be featured in 1.6.0
## Code After:
Filter state, events_before and events_after in /context requests.
| - Implement label-based filtering on `/sync` and `/messages` ([MSC2326](https://github.com/matrix-org/matrix-doc/pull/2326)).
+ Filter state, events_before and events_after in /context requests. | 2 | 2 | 1 | 1 |
d49157ae5db27a78827b983c8a7cba3c8752e494 | .github/workflows/custom.yml | .github/workflows/custom.yml | name: Custom CI
on:
workflow_dispatch:
inputs:
image:
description: Container image to run with
type: string
required: true
nightly:
description: Run in nightly mode (include slow tests, no dependent projects)
type: boolean
required: true
afl:
description: Set parameters for AFL
type: boolean
required: true
jobs:
ci:
uses: angr/ci-settings/.github/workflows/angr-ci.yml@master
with:
image: ${{ inputs.image }}
nightly: ${{ inputs.nightly }}
afl: ${{ inputs.afl }}
| name: Custom CI
on:
workflow_dispatch:
inputs:
image:
description: Container image to run with
type: string
required: true
nightly:
description: Run in nightly mode (include slow tests, no dependent projects)
type: boolean
required: true
afl:
description: Set parameters for AFL
type: boolean
required: true
jobs:
ci:
uses: angr/ci-settings/.github/workflows/angr-ci.yml@master
with:
container_image: ${{ inputs.image }}
nightly: ${{ inputs.nightly }}
afl: ${{ inputs.afl }}
| Fix typo in container_image parameter | Fix typo in container_image parameter
| YAML | bsd-2-clause | angr/pyvex,angr/pyvex | yaml | ## Code Before:
name: Custom CI
on:
workflow_dispatch:
inputs:
image:
description: Container image to run with
type: string
required: true
nightly:
description: Run in nightly mode (include slow tests, no dependent projects)
type: boolean
required: true
afl:
description: Set parameters for AFL
type: boolean
required: true
jobs:
ci:
uses: angr/ci-settings/.github/workflows/angr-ci.yml@master
with:
image: ${{ inputs.image }}
nightly: ${{ inputs.nightly }}
afl: ${{ inputs.afl }}
## Instruction:
Fix typo in container_image parameter
## Code After:
name: Custom CI
on:
workflow_dispatch:
inputs:
image:
description: Container image to run with
type: string
required: true
nightly:
description: Run in nightly mode (include slow tests, no dependent projects)
type: boolean
required: true
afl:
description: Set parameters for AFL
type: boolean
required: true
jobs:
ci:
uses: angr/ci-settings/.github/workflows/angr-ci.yml@master
with:
container_image: ${{ inputs.image }}
nightly: ${{ inputs.nightly }}
afl: ${{ inputs.afl }}
| name: Custom CI
on:
workflow_dispatch:
inputs:
image:
description: Container image to run with
type: string
required: true
nightly:
description: Run in nightly mode (include slow tests, no dependent projects)
type: boolean
required: true
afl:
description: Set parameters for AFL
type: boolean
required: true
jobs:
ci:
uses: angr/ci-settings/.github/workflows/angr-ci.yml@master
with:
- image: ${{ inputs.image }}
+ container_image: ${{ inputs.image }}
? ++++++++++
nightly: ${{ inputs.nightly }}
afl: ${{ inputs.afl }}
| 2 | 0.071429 | 1 | 1 |
248110080721c137f3b9a864c08f90156a34699c | os/osx.sh | os/osx.sh | defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# ----------------------------------------------------------------------------
# Finder
# ----------------------------------------------------------------------------
# Display the full POSIX path as the Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# ----------------------------------------------------------------------------
# Messages
# ----------------------------------------------------------------------------
# Disable automatic emoji substitution.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
| defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# ----------------------------------------------------------------------------
# Finder
# ----------------------------------------------------------------------------
# Display the full POSIX path as the Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# ----------------------------------------------------------------------------
# Messages
# ----------------------------------------------------------------------------
# Disable automatic emoji substitution.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
# ----------------------------------------------------------------------------
# Brew
# ----------------------------------------------------------------------------
# Update brew installation and packages.
if is_installed brew; then
e_arrow "Updating brew..." && brew update &> /dev/null
e_arrow "Upgrading brew packages..." && brew upgrade --all &> /dev/null
fi
| Update brew when reinitializing an OSX installation | Update brew when reinitializing an OSX installation
| Shell | unlicense | dmulholland/dotfiles,dmulholland/dotfiles | shell | ## Code Before:
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# ----------------------------------------------------------------------------
# Finder
# ----------------------------------------------------------------------------
# Display the full POSIX path as the Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# ----------------------------------------------------------------------------
# Messages
# ----------------------------------------------------------------------------
# Disable automatic emoji substitution.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
## Instruction:
Update brew when reinitializing an OSX installation
## Code After:
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# ----------------------------------------------------------------------------
# Finder
# ----------------------------------------------------------------------------
# Display the full POSIX path as the Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# ----------------------------------------------------------------------------
# Messages
# ----------------------------------------------------------------------------
# Disable automatic emoji substitution.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
# ----------------------------------------------------------------------------
# Brew
# ----------------------------------------------------------------------------
# Update brew installation and packages.
if is_installed brew; then
e_arrow "Updating brew..." && brew update &> /dev/null
e_arrow "Upgrading brew packages..." && brew upgrade --all &> /dev/null
fi
| defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# ----------------------------------------------------------------------------
# Finder
# ----------------------------------------------------------------------------
# Display the full POSIX path as the Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# ----------------------------------------------------------------------------
# Messages
# ----------------------------------------------------------------------------
# Disable automatic emoji substitution.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
+
+
+ # ----------------------------------------------------------------------------
+ # Brew
+ # ----------------------------------------------------------------------------
+
+ # Update brew installation and packages.
+ if is_installed brew; then
+ e_arrow "Updating brew..." && brew update &> /dev/null
+ e_arrow "Upgrading brew packages..." && brew upgrade --all &> /dev/null
+ fi | 11 | 0.37931 | 11 | 0 |
88e054ce90c2598357148a3ca333cd8ddbade7de | src/main/resources/application.properties | src/main/resources/application.properties | logging.level.org.hibernate=off
logging.level.org.ow2.proactive.workflow_catalog.rest=info
logging.level.org.springframework.web=info
# Buckets that must be created on first run
pa.workflow_catalog.default.buckets=Catalog, Templates
# Embedded server configuration
server.compression.enabled=true
server.contextPath=/
server.port=8090
# DataSource settings: set here your own configurations for the database connection.
#spring.datasource.driverClassName=org.hsqldb.jdbc.JDBCDriver
#spring.datasource.url=jdbc:hsqldb:file:/tmp/proactive/workflow-catalog;create=true;hsqldb.tx=mvcc;hsqldb.applog=1;hsqldb.sqllog=0;hsqldb.write_delay=false
#spring.datasource.username=root
#spring.datasource.password=
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto=update
# Show or not log for each sql query
spring.jpa.show-sql=false
# Disable Spring banner
spring.main.banner_mode=off
| logging.level.org.hibernate=off
logging.level.org.ow2.proactive.workflow_catalog.rest=info
logging.level.org.springframework.web=info
# Buckets that must be created on first run
pa.workflow_catalog.default.buckets=Catalog, Templates
# Embedded server configuration
server.compression.enabled=true
server.contextPath=/
# DataSource settings: set here your own configurations for the database connection.
#spring.datasource.driverClassName=org.hsqldb.jdbc.JDBCDriver
#spring.datasource.url=jdbc:hsqldb:file:/tmp/proactive/workflow-catalog;create=true;hsqldb.tx=mvcc;hsqldb.applog=1;hsqldb.sqllog=0;hsqldb.write_delay=false
#spring.datasource.username=root
#spring.datasource.password=
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto=update
# Show or not log for each sql query
spring.jpa.show-sql=false
# Disable Spring banner
spring.main.banner_mode=off
| Revert "Change default port number to 8090 from 8080" | Revert "Change default port number to 8090 from 8080"
This reverts commit 321860b686aa88bcc3f10d58b8ee0a05fb98ddb8.
| INI | agpl-3.0 | laurianed/catalog,ShatalovYaroslav/catalog,gparanthoen/workflow-catalog,laurianed/catalog,laurianed/catalog,ow2-proactive/catalog,ow2-proactive/workflow-catalog,yinan-liu/workflow-catalog,paraita/workflow-catalog,ow2-proactive/catalog,ow2-proactive/catalog,laurianed/workflow-catalog,ShatalovYaroslav/catalog,ShatalovYaroslav/catalog | ini | ## Code Before:
logging.level.org.hibernate=off
logging.level.org.ow2.proactive.workflow_catalog.rest=info
logging.level.org.springframework.web=info
# Buckets that must be created on first run
pa.workflow_catalog.default.buckets=Catalog, Templates
# Embedded server configuration
server.compression.enabled=true
server.contextPath=/
server.port=8090
# DataSource settings: set here your own configurations for the database connection.
#spring.datasource.driverClassName=org.hsqldb.jdbc.JDBCDriver
#spring.datasource.url=jdbc:hsqldb:file:/tmp/proactive/workflow-catalog;create=true;hsqldb.tx=mvcc;hsqldb.applog=1;hsqldb.sqllog=0;hsqldb.write_delay=false
#spring.datasource.username=root
#spring.datasource.password=
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto=update
# Show or not log for each sql query
spring.jpa.show-sql=false
# Disable Spring banner
spring.main.banner_mode=off
## Instruction:
Revert "Change default port number to 8090 from 8080"
This reverts commit 321860b686aa88bcc3f10d58b8ee0a05fb98ddb8.
## Code After:
logging.level.org.hibernate=off
logging.level.org.ow2.proactive.workflow_catalog.rest=info
logging.level.org.springframework.web=info
# Buckets that must be created on first run
pa.workflow_catalog.default.buckets=Catalog, Templates
# Embedded server configuration
server.compression.enabled=true
server.contextPath=/
# DataSource settings: set here your own configurations for the database connection.
#spring.datasource.driverClassName=org.hsqldb.jdbc.JDBCDriver
#spring.datasource.url=jdbc:hsqldb:file:/tmp/proactive/workflow-catalog;create=true;hsqldb.tx=mvcc;hsqldb.applog=1;hsqldb.sqllog=0;hsqldb.write_delay=false
#spring.datasource.username=root
#spring.datasource.password=
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto=update
# Show or not log for each sql query
spring.jpa.show-sql=false
# Disable Spring banner
spring.main.banner_mode=off
| logging.level.org.hibernate=off
logging.level.org.ow2.proactive.workflow_catalog.rest=info
logging.level.org.springframework.web=info
# Buckets that must be created on first run
pa.workflow_catalog.default.buckets=Catalog, Templates
# Embedded server configuration
server.compression.enabled=true
server.contextPath=/
- server.port=8090
# DataSource settings: set here your own configurations for the database connection.
#spring.datasource.driverClassName=org.hsqldb.jdbc.JDBCDriver
#spring.datasource.url=jdbc:hsqldb:file:/tmp/proactive/workflow-catalog;create=true;hsqldb.tx=mvcc;hsqldb.applog=1;hsqldb.sqllog=0;hsqldb.write_delay=false
#spring.datasource.username=root
#spring.datasource.password=
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto=update
# Show or not log for each sql query
spring.jpa.show-sql=false
# Disable Spring banner
spring.main.banner_mode=off | 1 | 0.04 | 0 | 1 |
90d5ba0c3bbfe7cc6ce5572053459dedea19ed2e | composer.json | composer.json | {
"name": "srmklive/flash-notifications",
"type": "library",
"description": "Elegant Flash Notifications For Laravel",
"minimum-stability": "dev",
"license": "MIT",
"authors": [
{
"name": "Raza Mehdi",
"email": "srmk@outlook.com"
}
],
"autoload":{
"psr-4": {
"Srmklive\\FlashAlert\\": "src/"
}
}
} | {
"name": "srmklive/flash-notifications",
"type": "library",
"description": "Elegant Flash Notifications For Laravel",
"minimum-stability": "dev",
"license": "MIT",
"authors": [
{
"name": "Raza Mehdi",
"email": "srmk@outlook.com"
}
],
"autoload":{
"psr-4": {
"Srmklive\\FlashAlert\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Srmklive\\FlashAlert\\FlashAlertServiceProvider"
],
"aliases": {
"FlashAlert": "Srmklive\\FlashAlert\\Facades\\FlashAlert"
}
}
}
} | Add Laravel 5.5 application files | Add Laravel 5.5 application files
| JSON | mit | srmklive/flash-notifications,srmklive/flash-notifications | json | ## Code Before:
{
"name": "srmklive/flash-notifications",
"type": "library",
"description": "Elegant Flash Notifications For Laravel",
"minimum-stability": "dev",
"license": "MIT",
"authors": [
{
"name": "Raza Mehdi",
"email": "srmk@outlook.com"
}
],
"autoload":{
"psr-4": {
"Srmklive\\FlashAlert\\": "src/"
}
}
}
## Instruction:
Add Laravel 5.5 application files
## Code After:
{
"name": "srmklive/flash-notifications",
"type": "library",
"description": "Elegant Flash Notifications For Laravel",
"minimum-stability": "dev",
"license": "MIT",
"authors": [
{
"name": "Raza Mehdi",
"email": "srmk@outlook.com"
}
],
"autoload":{
"psr-4": {
"Srmklive\\FlashAlert\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Srmklive\\FlashAlert\\FlashAlertServiceProvider"
],
"aliases": {
"FlashAlert": "Srmklive\\FlashAlert\\Facades\\FlashAlert"
}
}
}
} | {
"name": "srmklive/flash-notifications",
"type": "library",
"description": "Elegant Flash Notifications For Laravel",
"minimum-stability": "dev",
"license": "MIT",
"authors": [
{
"name": "Raza Mehdi",
"email": "srmk@outlook.com"
}
],
"autoload":{
"psr-4": {
"Srmklive\\FlashAlert\\": "src/"
}
+ },
+ "extra": {
+ "laravel": {
+ "providers": [
+ "Srmklive\\FlashAlert\\FlashAlertServiceProvider"
+ ],
+ "aliases": {
+ "FlashAlert": "Srmklive\\FlashAlert\\Facades\\FlashAlert"
+ }
+ }
}
} | 10 | 0.555556 | 10 | 0 |
f635dd18af1b170197f33b2c0da6ce23966b4c0c | footer.php | footer.php | <!-- footer -->
<footer class="footer" role="contentinfo">
<!-- copyright -->
<p class="copyright">
© <?php echo date("Y"); ?> Copyright <?php bloginfo('name'); ?>. <?php _e('Powered by', 'html5blank'); ?>
<a href="//wordpress.org" title="WordPress">WordPress</a> & <a href="//html5blank.com" title="HTML5 Blank">HTML5 Blank</a>.
</p>
<!-- /copyright -->
</footer>
<!-- /footer -->
</div>
<!-- /wrapper -->
<?php wp_footer(); ?>
<!-- analytics -->
<script>
var _gaq=[['_setAccount','UA-XXXXXXXX-XX'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)})(document,'script');
</script>
</body>
</html> | <!-- footer -->
<footer class="footer" role="contentinfo">
<!-- copyright -->
<p class="copyright">
© <?php echo date("Y"); ?> Copyright <?php bloginfo('name'); ?>. <?php _e('Powered by', 'html5blank'); ?>
<a href="//wordpress.org" title="WordPress">WordPress</a> & <a href="//html5blank.com" title="HTML5 Blank">HTML5 Blank</a>.
</p>
<!-- /copyright -->
</footer>
<!-- /footer -->
</div>
<!-- /wrapper -->
<?php wp_footer(); ?>
<!-- analytics -->
<script>
(function(f,i,r,e,s,h,l){i['GoogleAnalyticsObject']=s;f[s]=f[s]||function(){
(f[s].q=f[s].q||[]).push(arguments)},f[s].l=1*new Date();h=i.createElement(r),
l=i.getElementsByTagName(r)[0];h.async=1;h.src=e;l.parentNode.insertBefore(h,l)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-XX', 'yourdomain.com');
ga('send', 'pageview');
</script>
</body>
</html>
| Update to universal Google Analytics | Update to universal Google Analytics | PHP | mit | parkermaughan/meetthemaughans,LA1CH3/QuillXrpm,Acrata/vvoil,dydx/html5blank,EricWVGG/html5blank,grischka/html5blank,sqmunson/xpat,LandslideCreative/ls-boilerplate,Montana-Studio/Mediakit,jeromelachaud/kristenpelou,toddmotto/html5blank,LA1CH3/obxsurfinfoXrpm,grischka/html5blank,martinleopold/prcs-website,Hemisphere-Project/Hemisphere-WPTheme,jdheeter/Distribit.Net,parkermaughan/meetthemaughans,solutionio/html5blank,parkermaughan/meetthemaughans,EricWVGG/html5blank,alessiosantocs/wp-maison,PlusPort/PlusPort-Theme,Acrata/voilarts,alessiosantocs/woopstrapblank,LA1CH3/obxsurfinfoXrpm,GuiHarrison/siteArtOuro,Acrata/voilarts,Acrata/voilarts,alessiosantocs/wp-maison,Acrata/voilarts,GuiHarrison/siteArtOuro,PlusPort/PlusPort-Theme,Acrata/vvoil,LA1CH3/ChildSaversXrpm,LA1CH3/obxsurfinfoXrpm,johngibbons/adesigncouple,alessiosantocs/dental-studio,LA1CH3/ChildSaversXrpm,toddmotto/html5blank,Hemisphere-Project/html5blank,EricWVGG/html5blank,johngibbons/creativebasis,sqmunson/xpat,Acrata/vvoil,johngibbons/adesigncouple,LA1CH3/ChildSaversXrpm,alessiosantocs/wp-maison,LA1CH3/ChildSaversXrpm,LA1CH3/QuillXrpm,johngibbons/creativebasis,dydx/html5blank,dydx/html5blank,solutionio/html5blank,alessiosantocs/dental-studio,Montana-Studio/Mediakit,GuiHarrison/siteArtOuro,LA1CH3/obxsurfinfoXrpm,toddmotto/html5blank,Hemisphere-Project/html5blank,solutionio/html5blank,grischka/html5blank,Hemisphere-Project/html5blank,alessiosantocs/woopstrapblank,LandslideCreative/ls-boilerplate,Montana-Studio/Mediakit,LA1CH3/QuillXrpm,jeromelachaud/S2A-WP-Theme,Hemisphere-Project/Hemisphere-WPTheme,celsoyh/html5blank,alessiosantocs/dental-studio,jeromelachaud/kristenpelou,alessiosantocs/woopstrapblank,johngibbons/adesigncouple,Hemisphere-Project/Hemisphere-WPTheme,jeromelachaud/S2A-WP-Theme,celsoyh/html5blank,sqmunson/xpat,johngibbons/creativebasis,Acrata/vvoil,jdheeter/Distribit.Net,jdheeter/Distribit.Net,celsoyh/html5blank,martinleopold/prcs-website | php | ## Code Before:
<!-- footer -->
<footer class="footer" role="contentinfo">
<!-- copyright -->
<p class="copyright">
© <?php echo date("Y"); ?> Copyright <?php bloginfo('name'); ?>. <?php _e('Powered by', 'html5blank'); ?>
<a href="//wordpress.org" title="WordPress">WordPress</a> & <a href="//html5blank.com" title="HTML5 Blank">HTML5 Blank</a>.
</p>
<!-- /copyright -->
</footer>
<!-- /footer -->
</div>
<!-- /wrapper -->
<?php wp_footer(); ?>
<!-- analytics -->
<script>
var _gaq=[['_setAccount','UA-XXXXXXXX-XX'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)})(document,'script');
</script>
</body>
</html>
## Instruction:
Update to universal Google Analytics
## Code After:
<!-- footer -->
<footer class="footer" role="contentinfo">
<!-- copyright -->
<p class="copyright">
© <?php echo date("Y"); ?> Copyright <?php bloginfo('name'); ?>. <?php _e('Powered by', 'html5blank'); ?>
<a href="//wordpress.org" title="WordPress">WordPress</a> & <a href="//html5blank.com" title="HTML5 Blank">HTML5 Blank</a>.
</p>
<!-- /copyright -->
</footer>
<!-- /footer -->
</div>
<!-- /wrapper -->
<?php wp_footer(); ?>
<!-- analytics -->
<script>
(function(f,i,r,e,s,h,l){i['GoogleAnalyticsObject']=s;f[s]=f[s]||function(){
(f[s].q=f[s].q||[]).push(arguments)},f[s].l=1*new Date();h=i.createElement(r),
l=i.getElementsByTagName(r)[0];h.async=1;h.src=e;l.parentNode.insertBefore(h,l)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-XX', 'yourdomain.com');
ga('send', 'pageview');
</script>
</body>
</html>
| <!-- footer -->
<footer class="footer" role="contentinfo">
<!-- copyright -->
<p class="copyright">
© <?php echo date("Y"); ?> Copyright <?php bloginfo('name'); ?>. <?php _e('Powered by', 'html5blank'); ?>
<a href="//wordpress.org" title="WordPress">WordPress</a> & <a href="//html5blank.com" title="HTML5 Blank">HTML5 Blank</a>.
</p>
<!-- /copyright -->
</footer>
<!-- /footer -->
</div>
<!-- /wrapper -->
<?php wp_footer(); ?>
<!-- analytics -->
<script>
- var _gaq=[['_setAccount','UA-XXXXXXXX-XX'],['_trackPageview']];
- (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
- g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
- s.parentNode.insertBefore(g,s)})(document,'script');
+ (function(f,i,r,e,s,h,l){i['GoogleAnalyticsObject']=s;f[s]=f[s]||function(){
+ (f[s].q=f[s].q||[]).push(arguments)},f[s].l=1*new Date();h=i.createElement(r),
+ l=i.getElementsByTagName(r)[0];h.async=1;h.src=e;l.parentNode.insertBefore(h,l)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-XXXXXXXX-XX', 'yourdomain.com');
+ ga('send', 'pageview');
</script>
</body>
</html> | 10 | 0.357143 | 6 | 4 |
5d0ace12fdb78395ab3cea081b386c2792539bcf | requirements.txt | requirements.txt | Django
South
django-crispy-forms
django-nose
# Force the 1.7 compatible version of django-registration until the
# pypi situation gets sorted out.
django-registration-redux
pillow
pyLibravatar
pydns
pytz
requests
markdown
django-medusa
# markitup 2.2 breaks on python 2 with module level imports, which we
# need to use for markdown, so avoid using that
django-markitup<=2.1,>2.2
| Django
South
django-crispy-forms
django-nose
django-registration-redux
pillow
pyLibravatar
pydns
pytz
requests
markdown
django-medusa
# markitup 2.2 breaks on python 2 with module level imports, which we
# need to use for markdown, so avoid using that
django-markitup<=2.1,>2.2
| Drop outdated comment on django-registration | Drop outdated comment on django-registration
| Text | isc | CarlFK/wafer,CarlFK/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer | text | ## Code Before:
Django
South
django-crispy-forms
django-nose
# Force the 1.7 compatible version of django-registration until the
# pypi situation gets sorted out.
django-registration-redux
pillow
pyLibravatar
pydns
pytz
requests
markdown
django-medusa
# markitup 2.2 breaks on python 2 with module level imports, which we
# need to use for markdown, so avoid using that
django-markitup<=2.1,>2.2
## Instruction:
Drop outdated comment on django-registration
## Code After:
Django
South
django-crispy-forms
django-nose
django-registration-redux
pillow
pyLibravatar
pydns
pytz
requests
markdown
django-medusa
# markitup 2.2 breaks on python 2 with module level imports, which we
# need to use for markdown, so avoid using that
django-markitup<=2.1,>2.2
| Django
South
django-crispy-forms
django-nose
- # Force the 1.7 compatible version of django-registration until the
- # pypi situation gets sorted out.
django-registration-redux
pillow
pyLibravatar
pydns
pytz
requests
markdown
django-medusa
# markitup 2.2 breaks on python 2 with module level imports, which we
# need to use for markdown, so avoid using that
django-markitup<=2.1,>2.2 | 2 | 0.117647 | 0 | 2 |
bfea0832be8fd6a29de00e8e0b770518545dcf59 | src/main/java/nl/tudelft/dnainator/DNAinator.java | src/main/java/nl/tudelft/dnainator/DNAinator.java | package nl.tudelft.dnainator;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import nl.tudelft.dnainator.ui.Window;
/**
* DNAinator's entry point. This class merely sets the UI's look and feel
* and then creates a window.
*/
public final class DNAinator {
private DNAinator() {
super();
}
/**
* DNAinator entry point.
* @param args Command-line arguments, unused for now.
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
/* Be thread-safe. */
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Window();
}
});
}
}
| package nl.tudelft.dnainator;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import nl.tudelft.dnainator.ui.Window;
/**
* DNAinator's entry point. This class merely sets the UI's look and feel
* and then creates a window.
*/
public final class DNAinator {
private DNAinator() {
super();
}
/**
* DNAinator entry point.
*
* @param args Command-line arguments, unused for now.
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
if (System.getProperty("os.name").equals("Mac OS X")) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
} catch (Exception e) {
e.printStackTrace();
}
/* Be thread-safe. */
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Window();
}
});
}
}
| Use native menubar when using OS X | Use native menubar when using OS X
| Java | bsd-3-clause | AbeelLab/dnainator | java | ## Code Before:
package nl.tudelft.dnainator;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import nl.tudelft.dnainator.ui.Window;
/**
* DNAinator's entry point. This class merely sets the UI's look and feel
* and then creates a window.
*/
public final class DNAinator {
private DNAinator() {
super();
}
/**
* DNAinator entry point.
* @param args Command-line arguments, unused for now.
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
/* Be thread-safe. */
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Window();
}
});
}
}
## Instruction:
Use native menubar when using OS X
## Code After:
package nl.tudelft.dnainator;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import nl.tudelft.dnainator.ui.Window;
/**
* DNAinator's entry point. This class merely sets the UI's look and feel
* and then creates a window.
*/
public final class DNAinator {
private DNAinator() {
super();
}
/**
* DNAinator entry point.
*
* @param args Command-line arguments, unused for now.
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
if (System.getProperty("os.name").equals("Mac OS X")) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
} catch (Exception e) {
e.printStackTrace();
}
/* Be thread-safe. */
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Window();
}
});
}
}
| package nl.tudelft.dnainator;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import nl.tudelft.dnainator.ui.Window;
/**
* DNAinator's entry point. This class merely sets the UI's look and feel
* and then creates a window.
*/
public final class DNAinator {
private DNAinator() {
super();
}
/**
* DNAinator entry point.
+ *
* @param args Command-line arguments, unused for now.
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ if (System.getProperty("os.name").equals("Mac OS X")) {
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+ }
} catch (Exception e) {
e.printStackTrace();
}
/* Be thread-safe. */
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Window();
}
});
}
} | 4 | 0.111111 | 4 | 0 |
898838d70d87e018779ecd6225b605493e14b85f | README.md | README.md | A declarative view framework in Swift
[](https://www.bitrise.io/app/95ae9c6da72a4ec1)
## This is a WIP repo. Come back in the next few weeks as it approaches the alpha stage.
| A declarative view framework in Swift
[](https://travis-ci.org/TheodoliteGroup/Theodolite)
## This is a WIP repo. Come back in the next few weeks as it approaches the alpha stage.
| Switch back to Travis for build image | Switch back to Travis for build image
The bitrise link broke, unclear why.
| Markdown | mit | ocrickard/Theodolite,ocrickard/Theodolite,ocrickard/Theodolite | markdown | ## Code Before:
A declarative view framework in Swift
[](https://www.bitrise.io/app/95ae9c6da72a4ec1)
## This is a WIP repo. Come back in the next few weeks as it approaches the alpha stage.
## Instruction:
Switch back to Travis for build image
The bitrise link broke, unclear why.
## Code After:
A declarative view framework in Swift
[](https://travis-ci.org/TheodoliteGroup/Theodolite)
## This is a WIP repo. Come back in the next few weeks as it approaches the alpha stage.
| A declarative view framework in Swift
- [](https://www.bitrise.io/app/95ae9c6da72a4ec1)
+ [](https://travis-ci.org/TheodoliteGroup/Theodolite)
## This is a WIP repo. Come back in the next few weeks as it approaches the alpha stage. | 2 | 0.4 | 1 | 1 |
c32acd7a55f529de742f82ff602d51d9cedecad9 | app/views/progress_updates/_form.html.erb | app/views/progress_updates/_form.html.erb | <%= form_for [project,update] do |f| %>
<h3>How's it going?</h3>
<div class="form-group">
<%= f.text_area :content, class: "form-control", rows: 6 %>
</div>
<h3>Record your progress:</h3>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="words-label">Words</span>
<%= f.text_field :words, class: "form-control" %>
</div>
<%= radio_button_tag(:word_format, "new") %>
<%= label_tag(:word_format_new, "New words added") %><br>
<%= radio_button_tag(:word_format, "total") %>
<%= label_tag(:word_format_total, "Total project words") %>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="hours-label">Hours</span>
<%= f.text_field :hours, class: "form-control" %>
</div>
</div>
</div>
</div>
<%= f.submit "Submit Update", class: "btn btn-primary" %>
<% end %> | <%= form_for [project,update] do |f| %>
<h3>How's it going?</h3>
<div class="form-group">
<%= f.text_area :content, class: "form-control", rows: 6 %>
</div>
<% if !update.persisted? %>
<h3>Record your progress:</h3>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="words-label">Words</span>
<%= f.text_field :words, class: "form-control" %>
</div>
<%= radio_button_tag(:word_format, "new") %>
<%= label_tag(:word_format_new, "New words added") %><br>
<%= radio_button_tag(:word_format, "total") %>
<%= label_tag(:word_format_total, "Total project words") %>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="hours-label">Hours</span>
<%= f.text_field :hours, class: "form-control" %>
</div>
</div>
</div>
</div>
<% end %>
<%= f.submit "Submit Update", class: "btn btn-primary" %>
<% end %> | Hide word count/hours fields when editing progress update | Hide word count/hours fields when editing progress update
| HTML+ERB | mit | Cecily2/writing-project-tracker,Cecily2/writing-project-tracker,Cecily2/writing-project-tracker | html+erb | ## Code Before:
<%= form_for [project,update] do |f| %>
<h3>How's it going?</h3>
<div class="form-group">
<%= f.text_area :content, class: "form-control", rows: 6 %>
</div>
<h3>Record your progress:</h3>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="words-label">Words</span>
<%= f.text_field :words, class: "form-control" %>
</div>
<%= radio_button_tag(:word_format, "new") %>
<%= label_tag(:word_format_new, "New words added") %><br>
<%= radio_button_tag(:word_format, "total") %>
<%= label_tag(:word_format_total, "Total project words") %>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="hours-label">Hours</span>
<%= f.text_field :hours, class: "form-control" %>
</div>
</div>
</div>
</div>
<%= f.submit "Submit Update", class: "btn btn-primary" %>
<% end %>
## Instruction:
Hide word count/hours fields when editing progress update
## Code After:
<%= form_for [project,update] do |f| %>
<h3>How's it going?</h3>
<div class="form-group">
<%= f.text_area :content, class: "form-control", rows: 6 %>
</div>
<% if !update.persisted? %>
<h3>Record your progress:</h3>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="words-label">Words</span>
<%= f.text_field :words, class: "form-control" %>
</div>
<%= radio_button_tag(:word_format, "new") %>
<%= label_tag(:word_format_new, "New words added") %><br>
<%= radio_button_tag(:word_format, "total") %>
<%= label_tag(:word_format_total, "Total project words") %>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="hours-label">Hours</span>
<%= f.text_field :hours, class: "form-control" %>
</div>
</div>
</div>
</div>
<% end %>
<%= f.submit "Submit Update", class: "btn btn-primary" %>
<% end %> | <%= form_for [project,update] do |f| %>
<h3>How's it going?</h3>
<div class="form-group">
<%= f.text_area :content, class: "form-control", rows: 6 %>
</div>
+ <% if !update.persisted? %>
<h3>Record your progress:</h3>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="words-label">Words</span>
<%= f.text_field :words, class: "form-control" %>
</div>
<%= radio_button_tag(:word_format, "new") %>
<%= label_tag(:word_format_new, "New words added") %><br>
<%= radio_button_tag(:word_format, "total") %>
<%= label_tag(:word_format_total, "Total project words") %>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="hours-label">Hours</span>
<%= f.text_field :hours, class: "form-control" %>
</div>
</div>
</div>
</div>
+ <% end %>
<%= f.submit "Submit Update", class: "btn btn-primary" %>
<% end %> | 2 | 0.058824 | 2 | 0 |
f8ec3939a5c1d443ee6a800f47d28ab918d8f647 | app/controllers/users_controller.rb | app/controllers/users_controller.rb | class UsersController < SecuredController
def edit
user = User.find(params[:id])
if user == current_user
render "edit"
else
redirect '/'
end
end
end | class UsersController < SecuredController
def edit
@user = current_user
render "edit"
end
end | Fix route so it will only return the current user's edit path | Fix route so it will only return the current user's edit path
| Ruby | mit | theresaboard/theres-a-board,theresaboard/theres-a-board,theresaboard/theres-a-board | ruby | ## Code Before:
class UsersController < SecuredController
def edit
user = User.find(params[:id])
if user == current_user
render "edit"
else
redirect '/'
end
end
end
## Instruction:
Fix route so it will only return the current user's edit path
## Code After:
class UsersController < SecuredController
def edit
@user = current_user
render "edit"
end
end | class UsersController < SecuredController
-
def edit
- user = User.find(params[:id])
- if user == current_user
? ^^^ -
+ @user = current_user
? ^
- render "edit"
? --
+ render "edit"
- else
- redirect '/'
- end
end
-
end | 10 | 0.833333 | 2 | 8 |
bfdbf300c15d64b63044f5dac9248413b345eede | src/main/java/fr/alecharp/picshare/http/EventController.java | src/main/java/fr/alecharp/picshare/http/EventController.java | package fr.alecharp.picshare.http;
import fr.alecharp.picshare.domain.Event;
import fr.alecharp.picshare.service.EventService;
import net.codestory.http.annotations.Post;
import net.codestory.http.annotations.Prefix;
import net.codestory.http.payload.Payload;
import javax.inject.Inject;
import java.util.Optional;
/**
* @author Adrien Lecharpentier
*/
@Prefix("/api/event")
public class EventController {
private final EventService eventService;
@Inject
public EventController(EventService eventService) {
this.eventService = eventService;
}
@Post
public Payload create(Event event) {
Optional<Event> save = eventService.save(event);
return save.isPresent() ? Payload.created("/api/event/" + save.get().id()) :
Payload.badRequest();
}
}
| package fr.alecharp.picshare.http;
import fr.alecharp.picshare.domain.Event;
import fr.alecharp.picshare.domain.Picture;
import fr.alecharp.picshare.service.EventService;
import fr.alecharp.picshare.service.PictureService;
import net.codestory.http.Request;
import net.codestory.http.annotations.Post;
import net.codestory.http.annotations.Prefix;
import net.codestory.http.annotations.Put;
import net.codestory.http.payload.Payload;
import javax.inject.Inject;
import java.util.Optional;
import java.util.Set;
import static java.util.stream.Collectors.toSet;
/**
* @author Adrien Lecharpentier
*/
@Prefix("/api/event")
public class EventController {
private final EventService eventService;
private final PictureService pictureService;
@Inject
public EventController(EventService eventService, PictureService pictureService) {
this.eventService = eventService;
this.pictureService = pictureService;
}
@Post
public Payload create(Event event) {
Optional<Event> save = eventService.save(event);
return save.isPresent() ? Payload.created("/api/event/" + save.get().id()) :
Payload.badRequest();
}
@Put("/:id/pictures")
public Payload attachPicture(String id, Request req) {
Set<Picture> pictures = req.parts().stream()
.filter(part -> part.name().equals("picture"))
.map(part -> pictureService.upload(id, part))
.filter(Optional::isPresent).map(Optional::get)
.collect(toSet());
Optional<Event> event = eventService.attachPictures(id, pictures);
if (!event.isPresent()) {
return Payload.notFound();
}
return Payload.ok().withHeader("Location", "/api/event/" + event.get().id());
}
}
| Update even HTTP API to upload images into events | Update even HTTP API to upload images into events
| Java | apache-2.0 | obourgain/PicShare,obourgain/PicShare | java | ## Code Before:
package fr.alecharp.picshare.http;
import fr.alecharp.picshare.domain.Event;
import fr.alecharp.picshare.service.EventService;
import net.codestory.http.annotations.Post;
import net.codestory.http.annotations.Prefix;
import net.codestory.http.payload.Payload;
import javax.inject.Inject;
import java.util.Optional;
/**
* @author Adrien Lecharpentier
*/
@Prefix("/api/event")
public class EventController {
private final EventService eventService;
@Inject
public EventController(EventService eventService) {
this.eventService = eventService;
}
@Post
public Payload create(Event event) {
Optional<Event> save = eventService.save(event);
return save.isPresent() ? Payload.created("/api/event/" + save.get().id()) :
Payload.badRequest();
}
}
## Instruction:
Update even HTTP API to upload images into events
## Code After:
package fr.alecharp.picshare.http;
import fr.alecharp.picshare.domain.Event;
import fr.alecharp.picshare.domain.Picture;
import fr.alecharp.picshare.service.EventService;
import fr.alecharp.picshare.service.PictureService;
import net.codestory.http.Request;
import net.codestory.http.annotations.Post;
import net.codestory.http.annotations.Prefix;
import net.codestory.http.annotations.Put;
import net.codestory.http.payload.Payload;
import javax.inject.Inject;
import java.util.Optional;
import java.util.Set;
import static java.util.stream.Collectors.toSet;
/**
* @author Adrien Lecharpentier
*/
@Prefix("/api/event")
public class EventController {
private final EventService eventService;
private final PictureService pictureService;
@Inject
public EventController(EventService eventService, PictureService pictureService) {
this.eventService = eventService;
this.pictureService = pictureService;
}
@Post
public Payload create(Event event) {
Optional<Event> save = eventService.save(event);
return save.isPresent() ? Payload.created("/api/event/" + save.get().id()) :
Payload.badRequest();
}
@Put("/:id/pictures")
public Payload attachPicture(String id, Request req) {
Set<Picture> pictures = req.parts().stream()
.filter(part -> part.name().equals("picture"))
.map(part -> pictureService.upload(id, part))
.filter(Optional::isPresent).map(Optional::get)
.collect(toSet());
Optional<Event> event = eventService.attachPictures(id, pictures);
if (!event.isPresent()) {
return Payload.notFound();
}
return Payload.ok().withHeader("Location", "/api/event/" + event.get().id());
}
}
| package fr.alecharp.picshare.http;
import fr.alecharp.picshare.domain.Event;
+ import fr.alecharp.picshare.domain.Picture;
import fr.alecharp.picshare.service.EventService;
+ import fr.alecharp.picshare.service.PictureService;
+ import net.codestory.http.Request;
import net.codestory.http.annotations.Post;
import net.codestory.http.annotations.Prefix;
+ import net.codestory.http.annotations.Put;
import net.codestory.http.payload.Payload;
import javax.inject.Inject;
import java.util.Optional;
+ import java.util.Set;
+
+ import static java.util.stream.Collectors.toSet;
/**
* @author Adrien Lecharpentier
*/
@Prefix("/api/event")
public class EventController {
private final EventService eventService;
+ private final PictureService pictureService;
@Inject
- public EventController(EventService eventService) {
+ public EventController(EventService eventService, PictureService pictureService) {
? +++++++++++++++++++++++++++++++
this.eventService = eventService;
+ this.pictureService = pictureService;
}
@Post
public Payload create(Event event) {
Optional<Event> save = eventService.save(event);
return save.isPresent() ? Payload.created("/api/event/" + save.get().id()) :
Payload.badRequest();
}
+
+ @Put("/:id/pictures")
+ public Payload attachPicture(String id, Request req) {
+ Set<Picture> pictures = req.parts().stream()
+ .filter(part -> part.name().equals("picture"))
+ .map(part -> pictureService.upload(id, part))
+ .filter(Optional::isPresent).map(Optional::get)
+ .collect(toSet());
+ Optional<Event> event = eventService.attachPictures(id, pictures);
+ if (!event.isPresent()) {
+ return Payload.notFound();
+ }
+ return Payload.ok().withHeader("Location", "/api/event/" + event.get().id());
+ }
} | 25 | 0.833333 | 24 | 1 |
56619b8493681b033d4ae479ca97461ff7b97d61 | lib/ecrire/app/assets/stylesheets/admin/posts/editor.scss | lib/ecrire/app/assets/stylesheets/admin/posts/editor.scss | body.edit.posts main > section {
width: 80vw;
}
| body.edit.posts main > section {
width: 80vw;
padding-bottom: 10rem;
}
| Add bottom padding so it's easier to handle writing at the end | Add bottom padding so it's easier to handle writing at the end
| SCSS | mit | pothibo/ecrire,pothibo/ecrire,pothibo/ecrire | scss | ## Code Before:
body.edit.posts main > section {
width: 80vw;
}
## Instruction:
Add bottom padding so it's easier to handle writing at the end
## Code After:
body.edit.posts main > section {
width: 80vw;
padding-bottom: 10rem;
}
| body.edit.posts main > section {
width: 80vw;
+ padding-bottom: 10rem;
} | 1 | 0.333333 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.