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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22246fb5f376b240d504c7ad37c5be0fff94a65a | extend.php | extend.php | <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Extend;
use Flarum\Frontend\Document;
use Psr\Http\Message\ServerRequestInterface as Request;
return [
(new Extend\Frontend('forum'))
->route(
'/embed/{id:\d+(?:-[^/]*)?}[/{near:[^/]*}]',
'embed.discussion',
function (Document $document, Request $request) {
// Add the discussion content to the document so that the
// payload will be included on the page and the JS app will be
// able to render the discussion immediately.
app(Flarum\Forum\Content\Discussion::class)($document, $request);
app(Flarum\Frontend\Content\Assets::class)->forFrontend('embed')($document, $request);
}
),
(new Extend\Frontend('embed'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less')
];
| <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Extend;
use Flarum\Frontend\Document;
use Psr\Http\Message\ServerRequestInterface as Request;
return [
(new Extend\Frontend('forum'))
->route(
'/embed/{id:\d+(?:-[^/]*)?}[/{near:[^/]*}]',
'embed.discussion',
function (Document $document, Request $request) {
// Add the discussion content to the document so that the
// payload will be included on the page and the JS app will be
// able to render the discussion immediately.
resolve(Flarum\Forum\Content\Discussion::class)($document, $request);
resolve(Flarum\Frontend\Content\Assets::class)->forFrontend('embed')($document, $request);
}
),
(new Extend\Frontend('embed'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less')
];
| Use resolve helper instead of app | Use resolve helper instead of app
| PHP | mit | flarum/embed,flarum/embed | php | ## Code Before:
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Extend;
use Flarum\Frontend\Document;
use Psr\Http\Message\ServerRequestInterface as Request;
return [
(new Extend\Frontend('forum'))
->route(
'/embed/{id:\d+(?:-[^/]*)?}[/{near:[^/]*}]',
'embed.discussion',
function (Document $document, Request $request) {
// Add the discussion content to the document so that the
// payload will be included on the page and the JS app will be
// able to render the discussion immediately.
app(Flarum\Forum\Content\Discussion::class)($document, $request);
app(Flarum\Frontend\Content\Assets::class)->forFrontend('embed')($document, $request);
}
),
(new Extend\Frontend('embed'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less')
];
## Instruction:
Use resolve helper instead of app
## Code After:
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Extend;
use Flarum\Frontend\Document;
use Psr\Http\Message\ServerRequestInterface as Request;
return [
(new Extend\Frontend('forum'))
->route(
'/embed/{id:\d+(?:-[^/]*)?}[/{near:[^/]*}]',
'embed.discussion',
function (Document $document, Request $request) {
// Add the discussion content to the document so that the
// payload will be included on the page and the JS app will be
// able to render the discussion immediately.
resolve(Flarum\Forum\Content\Discussion::class)($document, $request);
resolve(Flarum\Frontend\Content\Assets::class)->forFrontend('embed')($document, $request);
}
),
(new Extend\Frontend('embed'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less')
];
| <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Extend;
use Flarum\Frontend\Document;
use Psr\Http\Message\ServerRequestInterface as Request;
return [
(new Extend\Frontend('forum'))
->route(
'/embed/{id:\d+(?:-[^/]*)?}[/{near:[^/]*}]',
'embed.discussion',
function (Document $document, Request $request) {
// Add the discussion content to the document so that the
// payload will be included on the page and the JS app will be
// able to render the discussion immediately.
- app(Flarum\Forum\Content\Discussion::class)($document, $request);
? ^^^
+ resolve(Flarum\Forum\Content\Discussion::class)($document, $request);
? ^^^^^^^
- app(Flarum\Frontend\Content\Assets::class)->forFrontend('embed')($document, $request);
? ^^^
+ resolve(Flarum\Frontend\Content\Assets::class)->forFrontend('embed')($document, $request);
? ^^^^^^^
}
),
(new Extend\Frontend('embed'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less')
]; | 4 | 0.125 | 2 | 2 |
6fddef320cad38ce5b5e282738c520eb77d56a2a | recipes/service.rb | recipes/service.rb | include_recipe 'marathon::install'
start_command = "#{node['marathon']['path']}/bin/start"
node['marathon']['options'].each do |opt, value|
start_command << " --#{opt} #{value}"
end
case node['marathon']['init']
when 'systemd'
systemd_service 'marathon' do
after 'network.target'
wants 'network.target'
description 'Marathon framework'
exec_start start_command
restart 'always'
restart_sec node['marathon']['restart_sec']
action [:create, :enable, :start]
end
when 'upstart'
chefstart = "#{node['marathon']['path']}/bin/chef-start"
file chefstart do
content start_command
mode '0755'
owner 'root'
group 'root'
end
template '/etc/init/marathon.conf' do
source 'upstart.erb'
variables(command: chefstart)
end
service 'marathon' do
action [:enable, :start]
end
end
| include_recipe 'marathon::install'
start_command = "#{node['marathon']['path']}/bin/start"
node['marathon']['options'].each do |opt, value|
start_command << " --#{opt} #{value}"
end
chefstart = "#{node['marathon']['path']}/bin/chef-start"
file chefstart do
content start_command
mode '0755'
owner 'root'
group 'root'
notifies :restart, 'service[marathon]', :delayed
end
case node['marathon']['init']
when 'systemd'
systemd_service 'marathon' do
after 'network.target'
wants 'network.target'
description 'Marathon framework'
exec_start chefstart
restart 'always'
restart_sec node['marathon']['restart_sec']
action [:create, :enable, :start]
end
service 'marathon' do
action [:nothing]
end
when 'upstart'
template '/etc/init/marathon.conf' do
source 'upstart.erb'
variables(command: chefstart)
end
service 'marathon' do
action [:enable, :start]
end
end
| Use chefstart file for systemd as well | Use chefstart file for systemd as well
| Ruby | apache-2.0 | mcoffin/cookbook-marathon,mcoffin/cookbook-marathon | ruby | ## Code Before:
include_recipe 'marathon::install'
start_command = "#{node['marathon']['path']}/bin/start"
node['marathon']['options'].each do |opt, value|
start_command << " --#{opt} #{value}"
end
case node['marathon']['init']
when 'systemd'
systemd_service 'marathon' do
after 'network.target'
wants 'network.target'
description 'Marathon framework'
exec_start start_command
restart 'always'
restart_sec node['marathon']['restart_sec']
action [:create, :enable, :start]
end
when 'upstart'
chefstart = "#{node['marathon']['path']}/bin/chef-start"
file chefstart do
content start_command
mode '0755'
owner 'root'
group 'root'
end
template '/etc/init/marathon.conf' do
source 'upstart.erb'
variables(command: chefstart)
end
service 'marathon' do
action [:enable, :start]
end
end
## Instruction:
Use chefstart file for systemd as well
## Code After:
include_recipe 'marathon::install'
start_command = "#{node['marathon']['path']}/bin/start"
node['marathon']['options'].each do |opt, value|
start_command << " --#{opt} #{value}"
end
chefstart = "#{node['marathon']['path']}/bin/chef-start"
file chefstart do
content start_command
mode '0755'
owner 'root'
group 'root'
notifies :restart, 'service[marathon]', :delayed
end
case node['marathon']['init']
when 'systemd'
systemd_service 'marathon' do
after 'network.target'
wants 'network.target'
description 'Marathon framework'
exec_start chefstart
restart 'always'
restart_sec node['marathon']['restart_sec']
action [:create, :enable, :start]
end
service 'marathon' do
action [:nothing]
end
when 'upstart'
template '/etc/init/marathon.conf' do
source 'upstart.erb'
variables(command: chefstart)
end
service 'marathon' do
action [:enable, :start]
end
end
| include_recipe 'marathon::install'
start_command = "#{node['marathon']['path']}/bin/start"
node['marathon']['options'].each do |opt, value|
start_command << " --#{opt} #{value}"
+ end
+
+ chefstart = "#{node['marathon']['path']}/bin/chef-start"
+ file chefstart do
+ content start_command
+ mode '0755'
+ owner 'root'
+ group 'root'
+ notifies :restart, 'service[marathon]', :delayed
end
case node['marathon']['init']
when 'systemd'
systemd_service 'marathon' do
after 'network.target'
wants 'network.target'
description 'Marathon framework'
- exec_start start_command
? --------
+ exec_start chefstart
? ++++
restart 'always'
restart_sec node['marathon']['restart_sec']
action [:create, :enable, :start]
end
+ service 'marathon' do
+ action [:nothing]
+ end
when 'upstart'
- chefstart = "#{node['marathon']['path']}/bin/chef-start"
- file chefstart do
- content start_command
- mode '0755'
- owner 'root'
- group 'root'
- end
template '/etc/init/marathon.conf' do
source 'upstart.erb'
variables(command: chefstart)
end
service 'marathon' do
action [:enable, :start]
end
end | 21 | 0.617647 | 13 | 8 |
d0cbf21f79d197db28c11d0d79571f86d704e41c | wagtailnews/templates/wagtailnews/choose.html | wagtailnews/templates/wagtailnews/choose.html | {% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "News" %}{% endblock %}
{% block bodyclass %}menu-news{% endblock %}
{% block content %}
{% include "wagtailadmin/shared/header.html" with title="News" icon="news" %}
<div class="nice-padding">
{% if has_news %}
<ul class="listing">
{% for newsindex, model_type in newsindex_list %}
<li>
<div class="row row-flush title">
<h2>
<a href="{% url 'wagtailnews_index' pk=newsindex.pk %}" class="col6">
{{ newsindex.title }}
</a>
</h2>
<small class="col6">{{ model_type|title }}</small>
</div>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no news pages yet - go add one!</p>
{% endif %}
</div>
{% endblock %}
| {% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "News" %}{% endblock %}
{% block bodyclass %}menu-news{% endblock %}
{% block content %}
{% include "wagtailadmin/shared/header.html" with title="News" icon="news" %}
<div class="nice-padding">
{% if has_news %}
<ul class="listing">
{% for newsindex, model_type in newsindex_list %}
<li>
<div class="row row-flush title">
<h2>
<a href="{% url 'wagtailnews_index' pk=newsindex.pk %}" class="col4">
{{ newsindex.title }}
</a>
</h2>
<a class="col6" href="{{ newsindex.url }}">{{ newsindex.url }}</a>
<small class="col2">{{ model_type|title }}</small>
</div>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no news pages yet - go add one!</p>
{% endif %}
</div>
{% endblock %}
| Add the URL of the news page, since the name might not be unique | Add the URL of the news page, since the name might not be unique
| HTML | bsd-2-clause | takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews | html | ## Code Before:
{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "News" %}{% endblock %}
{% block bodyclass %}menu-news{% endblock %}
{% block content %}
{% include "wagtailadmin/shared/header.html" with title="News" icon="news" %}
<div class="nice-padding">
{% if has_news %}
<ul class="listing">
{% for newsindex, model_type in newsindex_list %}
<li>
<div class="row row-flush title">
<h2>
<a href="{% url 'wagtailnews_index' pk=newsindex.pk %}" class="col6">
{{ newsindex.title }}
</a>
</h2>
<small class="col6">{{ model_type|title }}</small>
</div>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no news pages yet - go add one!</p>
{% endif %}
</div>
{% endblock %}
## Instruction:
Add the URL of the news page, since the name might not be unique
## Code After:
{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "News" %}{% endblock %}
{% block bodyclass %}menu-news{% endblock %}
{% block content %}
{% include "wagtailadmin/shared/header.html" with title="News" icon="news" %}
<div class="nice-padding">
{% if has_news %}
<ul class="listing">
{% for newsindex, model_type in newsindex_list %}
<li>
<div class="row row-flush title">
<h2>
<a href="{% url 'wagtailnews_index' pk=newsindex.pk %}" class="col4">
{{ newsindex.title }}
</a>
</h2>
<a class="col6" href="{{ newsindex.url }}">{{ newsindex.url }}</a>
<small class="col2">{{ model_type|title }}</small>
</div>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no news pages yet - go add one!</p>
{% endif %}
</div>
{% endblock %}
| {% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "News" %}{% endblock %}
{% block bodyclass %}menu-news{% endblock %}
{% block content %}
{% include "wagtailadmin/shared/header.html" with title="News" icon="news" %}
<div class="nice-padding">
{% if has_news %}
<ul class="listing">
{% for newsindex, model_type in newsindex_list %}
<li>
<div class="row row-flush title">
<h2>
- <a href="{% url 'wagtailnews_index' pk=newsindex.pk %}" class="col6">
? ^
+ <a href="{% url 'wagtailnews_index' pk=newsindex.pk %}" class="col4">
? ^
{{ newsindex.title }}
</a>
</h2>
+ <a class="col6" href="{{ newsindex.url }}">{{ newsindex.url }}</a>
- <small class="col6">{{ model_type|title }}</small>
? ^
+ <small class="col2">{{ model_type|title }}</small>
? ^
</div>
</li>
{% endfor %}
</ul>
{% else %}
<p>There are no news pages yet - go add one!</p>
{% endif %}
</div>
{% endblock %} | 5 | 0.166667 | 3 | 2 |
b2c27f3dbc150749732b6f6e593d1312f0e17979 | lib/noam-lemma/lemma.rb | lib/noam-lemma/lemma.rb | module Noam
class Lemma
attr_reader :listener, :player, :name, :hears, :plays
# Initialize a new Lemma instance.
#
def initialize(name, dev_type, response_port, hears, plays)
@name = name
@dev_type = dev_type
@response_port = response_port
@hears = hears
@plays = plays
@player = nil
@listener = nil
end
def discover(beacon=nil)
beacon ||= Beacon.discover
begin_operation(beacon.host, beacon.noam_port)
end
def advertise(room_name)
m = Noam::Message::Marco.new(room_name, @name, @response_port, "ruby-script")
polo = m.start
begin_operation(polo.host, polo.port)
end
def play(event, value)
if @player
@player.put(Noam::Message::Playable.new(@name, event, value))
true
else
false
end
end
def listen
@listener.take
end
def stop
@player.stop if @player
@listener.stop if @listener
@player = nil
@listener = nil
end
private
def begin_operation(host, port)
@listener = Listener.new(@response_port)
@player = Player.new(host, port)
@player.put(Message::Register.new(
@name, @response_port, @hears, @plays, @dev_type))
end
end
end
| module Noam
class Lemma
attr_reader :listener, :player, :name, :hears, :plays
# Initialize a new Lemma instance.
#
def initialize(name, dev_type, response_port, hears, plays)
@name = name
@dev_type = dev_type
@response_port = response_port
@hears = hears
@plays = plays
@player = nil
@listener = nil
end
def discover(beacon=nil)
beacon ||= Beacon.discover
start(beacon.host, beacon.noam_port)
end
def advertise(room_name)
m = Noam::Message::Marco.new(room_name, @name, @response_port, "ruby-script")
polo = m.start
start(polo.host, polo.port)
end
def start(host, port)
@listener = Listener.new(@response_port)
@player = Player.new(host, port)
@player.put(Message::Register.new(
@name, @response_port, @hears, @plays, @dev_type))
end
def play(event, value)
if @player
@player.put(Noam::Message::Playable.new(@name, event, value))
true
else
false
end
end
def listen
@listener.take
end
def stop
@player.stop if @player
@listener.stop if @listener
@player = nil
@listener = nil
end
end
end
| Rename being_operation to start and make it public. | Rename being_operation to start and make it public.
| Ruby | mit | noam-io/lemma-ruby | ruby | ## Code Before:
module Noam
class Lemma
attr_reader :listener, :player, :name, :hears, :plays
# Initialize a new Lemma instance.
#
def initialize(name, dev_type, response_port, hears, plays)
@name = name
@dev_type = dev_type
@response_port = response_port
@hears = hears
@plays = plays
@player = nil
@listener = nil
end
def discover(beacon=nil)
beacon ||= Beacon.discover
begin_operation(beacon.host, beacon.noam_port)
end
def advertise(room_name)
m = Noam::Message::Marco.new(room_name, @name, @response_port, "ruby-script")
polo = m.start
begin_operation(polo.host, polo.port)
end
def play(event, value)
if @player
@player.put(Noam::Message::Playable.new(@name, event, value))
true
else
false
end
end
def listen
@listener.take
end
def stop
@player.stop if @player
@listener.stop if @listener
@player = nil
@listener = nil
end
private
def begin_operation(host, port)
@listener = Listener.new(@response_port)
@player = Player.new(host, port)
@player.put(Message::Register.new(
@name, @response_port, @hears, @plays, @dev_type))
end
end
end
## Instruction:
Rename being_operation to start and make it public.
## Code After:
module Noam
class Lemma
attr_reader :listener, :player, :name, :hears, :plays
# Initialize a new Lemma instance.
#
def initialize(name, dev_type, response_port, hears, plays)
@name = name
@dev_type = dev_type
@response_port = response_port
@hears = hears
@plays = plays
@player = nil
@listener = nil
end
def discover(beacon=nil)
beacon ||= Beacon.discover
start(beacon.host, beacon.noam_port)
end
def advertise(room_name)
m = Noam::Message::Marco.new(room_name, @name, @response_port, "ruby-script")
polo = m.start
start(polo.host, polo.port)
end
def start(host, port)
@listener = Listener.new(@response_port)
@player = Player.new(host, port)
@player.put(Message::Register.new(
@name, @response_port, @hears, @plays, @dev_type))
end
def play(event, value)
if @player
@player.put(Noam::Message::Playable.new(@name, event, value))
true
else
false
end
end
def listen
@listener.take
end
def stop
@player.stop if @player
@listener.stop if @listener
@player = nil
@listener = nil
end
end
end
| module Noam
class Lemma
attr_reader :listener, :player, :name, :hears, :plays
# Initialize a new Lemma instance.
#
def initialize(name, dev_type, response_port, hears, plays)
@name = name
@dev_type = dev_type
@response_port = response_port
@hears = hears
@plays = plays
@player = nil
@listener = nil
end
def discover(beacon=nil)
beacon ||= Beacon.discover
- begin_operation(beacon.host, beacon.noam_port)
? ^^^^^^^^^ - ---
+ start(beacon.host, beacon.noam_port)
? ^^^
end
def advertise(room_name)
m = Noam::Message::Marco.new(room_name, @name, @response_port, "ruby-script")
polo = m.start
- begin_operation(polo.host, polo.port)
? ^^^^^^^^^ - ---
+ start(polo.host, polo.port)
? ^^^
+ end
+
+ def start(host, port)
+ @listener = Listener.new(@response_port)
+ @player = Player.new(host, port)
+ @player.put(Message::Register.new(
+ @name, @response_port, @hears, @plays, @dev_type))
end
def play(event, value)
if @player
@player.put(Noam::Message::Playable.new(@name, event, value))
true
else
false
end
end
def listen
@listener.take
end
def stop
@player.stop if @player
@listener.stop if @listener
@player = nil
@listener = nil
end
-
- private
-
- def begin_operation(host, port)
- @listener = Listener.new(@response_port)
- @player = Player.new(host, port)
- @player.put(Message::Register.new(
- @name, @response_port, @hears, @plays, @dev_type))
- end
end
end | 20 | 0.338983 | 9 | 11 |
83406db629abd389da85666dc79925f8e03a22f4 | lms/djangoapps/courseware/__init__.py | lms/djangoapps/courseware/__init__.py | from __future__ import absolute_import
import warnings
if __name__ == 'courseware':
warnings.warn("Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported", DeprecationWarning)
| from __future__ import absolute_import
import inspect
import warnings
if __name__ == 'courseware':
# pylint: disable=unicode-format-string
# Show the call stack that imported us wrong.
stack = "\n".join("%30s : %s:%d" % (t[3], t[1], t[2]) for t in inspect.stack()[:0:-1])
msg = "Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported:\n" + stack
warnings.warn(msg, DeprecationWarning)
| Add more diagnostics to the courseware import warning | Add more diagnostics to the courseware import warning
| Python | agpl-3.0 | angelapper/edx-platform,angelapper/edx-platform,cpennington/edx-platform,edx-solutions/edx-platform,mitocw/edx-platform,edx/edx-platform,cpennington/edx-platform,angelapper/edx-platform,arbrandes/edx-platform,edx/edx-platform,EDUlib/edx-platform,arbrandes/edx-platform,edx-solutions/edx-platform,stvstnfrd/edx-platform,arbrandes/edx-platform,EDUlib/edx-platform,eduNEXT/edx-platform,cpennington/edx-platform,msegado/edx-platform,mitocw/edx-platform,msegado/edx-platform,stvstnfrd/edx-platform,edx/edx-platform,stvstnfrd/edx-platform,cpennington/edx-platform,msegado/edx-platform,ESOedX/edx-platform,ESOedX/edx-platform,ESOedX/edx-platform,angelapper/edx-platform,msegado/edx-platform,arbrandes/edx-platform,appsembler/edx-platform,stvstnfrd/edx-platform,appsembler/edx-platform,edx/edx-platform,edx-solutions/edx-platform,eduNEXT/edx-platform,ESOedX/edx-platform,eduNEXT/edx-platform,EDUlib/edx-platform,mitocw/edx-platform,eduNEXT/edunext-platform,eduNEXT/edunext-platform,eduNEXT/edx-platform,appsembler/edx-platform,mitocw/edx-platform,eduNEXT/edunext-platform,appsembler/edx-platform,EDUlib/edx-platform,edx-solutions/edx-platform,eduNEXT/edunext-platform,msegado/edx-platform | python | ## Code Before:
from __future__ import absolute_import
import warnings
if __name__ == 'courseware':
warnings.warn("Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported", DeprecationWarning)
## Instruction:
Add more diagnostics to the courseware import warning
## Code After:
from __future__ import absolute_import
import inspect
import warnings
if __name__ == 'courseware':
# pylint: disable=unicode-format-string
# Show the call stack that imported us wrong.
stack = "\n".join("%30s : %s:%d" % (t[3], t[1], t[2]) for t in inspect.stack()[:0:-1])
msg = "Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported:\n" + stack
warnings.warn(msg, DeprecationWarning)
| from __future__ import absolute_import
+ import inspect
import warnings
if __name__ == 'courseware':
+ # pylint: disable=unicode-format-string
+ # Show the call stack that imported us wrong.
+ stack = "\n".join("%30s : %s:%d" % (t[3], t[1], t[2]) for t in inspect.stack()[:0:-1])
- warnings.warn("Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported", DeprecationWarning)
? ^^^^^^ ^^^^^^^ - ^^^^^ ^^^^^^^^^^^^^
+ msg = "Importing 'lms.djangoapps.courseware' as 'courseware' is no longer supported:\n" + stack
? ^^ ^^^ +++ ^^^^^ ^
+ warnings.warn(msg, DeprecationWarning) | 7 | 1.166667 | 6 | 1 |
2c9b76297c9a6905eaeccd4e06ef85188f246d96 | .travis.yml | .travis.yml | language: objective-c
before_install:
- gem install slather -N
script:
- xctool -project libPhoneNumber.xcodeproj -scheme libPhoneNumber -sdk iphonesimulator clean build test ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
after_success: slather
| language: objective-c
before_install:
- gem install slather -N
script:
- xctool -project libPhoneNumber.xcodeproj -scheme libPhoneNumber -destination "platform=iOS Simulator,name=iPhone 6" -sdk iphonesimulator clean build test ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
after_success: slather
| Add destination option for testing | Add destination option for testing
| YAML | apache-2.0 | dmaclach/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,dmaclach/libPhoneNumber-iOS,wheniwork/libPhoneNumber-iOS,dmaclach/libPhoneNumber-iOS,wheniwork/libPhoneNumber-iOS,opentable/libPhoneNumber-iOS,opentable/libPhoneNumber-iOS,wheniwork/libPhoneNumber-iOS,dmaclach/libPhoneNumber-iOS,wheniwork/libPhoneNumber-iOS,wheniwork/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,dmaclach/libPhoneNumber-iOS,iziz/libPhoneNumber-iOS,opentable/libPhoneNumber-iOS | yaml | ## Code Before:
language: objective-c
before_install:
- gem install slather -N
script:
- xctool -project libPhoneNumber.xcodeproj -scheme libPhoneNumber -sdk iphonesimulator clean build test ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
after_success: slather
## Instruction:
Add destination option for testing
## Code After:
language: objective-c
before_install:
- gem install slather -N
script:
- xctool -project libPhoneNumber.xcodeproj -scheme libPhoneNumber -destination "platform=iOS Simulator,name=iPhone 6" -sdk iphonesimulator clean build test ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
after_success: slather
| language: objective-c
before_install:
- gem install slather -N
script:
- - xctool -project libPhoneNumber.xcodeproj -scheme libPhoneNumber -sdk iphonesimulator clean build test ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
+ - xctool -project libPhoneNumber.xcodeproj -scheme libPhoneNumber -destination "platform=iOS Simulator,name=iPhone 6" -sdk iphonesimulator clean build test ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
? ++++++++++++++++++++++++++++++++++++++++++++++++++++
after_success: slather | 2 | 0.222222 | 1 | 1 |
ec70339b4aef7f6067392d277bc5b5aa906b12b4 | README.adoc | README.adoc | = Mongo Client
image:https://vertx.ci.cloudbees.com/buildStatus/icon?job=vert.x3-mongo-client["Build Status",link="https://vertx.ci.cloudbees.com/view/vert.x-3/job/vert.x3-mongo-client/"]
An asynchronous client for interacting with a MongoDB database
Please see the in source asciidoc documentation or the main documentation on the web-site for a full description
of Mongo service:
* Web-site docs
* link:vertx-mongo-client/src/main/asciidoc/java/index.adoc[Java in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/js/index.adoc[JavaScript in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/groovy/index.adoc[Groovy in-source docs]
| = Mongo Client
image:https://vertx.ci.cloudbees.com/buildStatus/icon?job=vert.x3-mongo-client["Build Status",link="https://vertx.ci.cloudbees.com/view/vert.x-3/job/vert.x3-mongo-client/"]
An asynchronous client for interacting with a MongoDB database
Please see the in source asciidoc documentation or the main documentation on the web-site for a full description
of Mongo service:
* Web-site docs
* link:vertx-mongo-client/src/main/asciidoc/java/index.adoc[Java in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/js/index.adoc[JavaScript in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/groovy/index.adoc[Groovy in-source docs]
```
docker run --rm --name vertx-mongo -p 27017:27017 mongo
```
| Update readme with how to run docker for tests | Update readme with how to run docker for tests
| AsciiDoc | apache-2.0 | diabolicallabs/vertx-mongo-client,diabolicallabs/vertx-mongo-client | asciidoc | ## Code Before:
= Mongo Client
image:https://vertx.ci.cloudbees.com/buildStatus/icon?job=vert.x3-mongo-client["Build Status",link="https://vertx.ci.cloudbees.com/view/vert.x-3/job/vert.x3-mongo-client/"]
An asynchronous client for interacting with a MongoDB database
Please see the in source asciidoc documentation or the main documentation on the web-site for a full description
of Mongo service:
* Web-site docs
* link:vertx-mongo-client/src/main/asciidoc/java/index.adoc[Java in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/js/index.adoc[JavaScript in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/groovy/index.adoc[Groovy in-source docs]
## Instruction:
Update readme with how to run docker for tests
## Code After:
= Mongo Client
image:https://vertx.ci.cloudbees.com/buildStatus/icon?job=vert.x3-mongo-client["Build Status",link="https://vertx.ci.cloudbees.com/view/vert.x-3/job/vert.x3-mongo-client/"]
An asynchronous client for interacting with a MongoDB database
Please see the in source asciidoc documentation or the main documentation on the web-site for a full description
of Mongo service:
* Web-site docs
* link:vertx-mongo-client/src/main/asciidoc/java/index.adoc[Java in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/js/index.adoc[JavaScript in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/groovy/index.adoc[Groovy in-source docs]
```
docker run --rm --name vertx-mongo -p 27017:27017 mongo
```
| = Mongo Client
image:https://vertx.ci.cloudbees.com/buildStatus/icon?job=vert.x3-mongo-client["Build Status",link="https://vertx.ci.cloudbees.com/view/vert.x-3/job/vert.x3-mongo-client/"]
An asynchronous client for interacting with a MongoDB database
Please see the in source asciidoc documentation or the main documentation on the web-site for a full description
of Mongo service:
* Web-site docs
* link:vertx-mongo-client/src/main/asciidoc/java/index.adoc[Java in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/js/index.adoc[JavaScript in-source docs]
* link:vertx-mongo-client/src/main/asciidoc/groovy/index.adoc[Groovy in-source docs]
+
+ ```
+ docker run --rm --name vertx-mongo -p 27017:27017 mongo
+ ``` | 4 | 0.307692 | 4 | 0 |
90053e9db8522d33879b267357d2dc9ffc4fe100 | grafted_solution/README.md | grafted_solution/README.md |
Requires that otcetera tools be on your PATH.
One artifact:
* `grafted_solution.tre`: A newick tree file containing a single tree. Labels are ottid.
All subproblem solutions are read (`subproblem_solutions/ott######-solution.tre`)
and then assembled into a single tree.
Here is some shell code to perform this:
```sh
otc-graft-solutions ../subproblem_solutions/*.tre > grafted_solution.tre
```
Also see documentation for `otc-graft-solution` in otcetera/README.md.
|
Requires that otcetera tools be on your PATH.
Two artifacts:
* `grafted_solution.tre`: A newick tree file containing a single tree. Labels are ottid.
* `grafted_solution_ottnames.tre`: A newick tree file containing a single tree. This is the same tree as `grafted_solution.tre` but more friendly to tree viewers. Monotypic nodes have been removed and Labels are 'ottname ottid'.
All subproblem solutions are read (`subproblem_solutions/ott######-solution.tre`)
and then assembled into a single tree.
Here is some shell code to perform this:
```sh
otc-graft-solutions ../subproblem_solutions/*.tre > grafted_solution.tre
```
Also see documentation for `otc-graft-solution` in otcetera/README.md.
| Revert "removed line about user friendly grafted tree, since we aren't generating that" | Revert "removed line about user friendly grafted tree, since we aren't generating that"
This reverts commit 4a5756e75f45c186a620c9a470eaaa5efadae7e5.
| Markdown | bsd-2-clause | mtholder/propinquity,OpenTreeOfLife/propinquity,mtholder/propinquity,mtholder/propinquity,OpenTreeOfLife/propinquity,OpenTreeOfLife/propinquity | markdown | ## Code Before:
Requires that otcetera tools be on your PATH.
One artifact:
* `grafted_solution.tre`: A newick tree file containing a single tree. Labels are ottid.
All subproblem solutions are read (`subproblem_solutions/ott######-solution.tre`)
and then assembled into a single tree.
Here is some shell code to perform this:
```sh
otc-graft-solutions ../subproblem_solutions/*.tre > grafted_solution.tre
```
Also see documentation for `otc-graft-solution` in otcetera/README.md.
## Instruction:
Revert "removed line about user friendly grafted tree, since we aren't generating that"
This reverts commit 4a5756e75f45c186a620c9a470eaaa5efadae7e5.
## Code After:
Requires that otcetera tools be on your PATH.
Two artifacts:
* `grafted_solution.tre`: A newick tree file containing a single tree. Labels are ottid.
* `grafted_solution_ottnames.tre`: A newick tree file containing a single tree. This is the same tree as `grafted_solution.tre` but more friendly to tree viewers. Monotypic nodes have been removed and Labels are 'ottname ottid'.
All subproblem solutions are read (`subproblem_solutions/ott######-solution.tre`)
and then assembled into a single tree.
Here is some shell code to perform this:
```sh
otc-graft-solutions ../subproblem_solutions/*.tre > grafted_solution.tre
```
Also see documentation for `otc-graft-solution` in otcetera/README.md.
|
Requires that otcetera tools be on your PATH.
- One artifact:
+ Two artifacts:
* `grafted_solution.tre`: A newick tree file containing a single tree. Labels are ottid.
+ * `grafted_solution_ottnames.tre`: A newick tree file containing a single tree. This is the same tree as `grafted_solution.tre` but more friendly to tree viewers. Monotypic nodes have been removed and Labels are 'ottname ottid'.
All subproblem solutions are read (`subproblem_solutions/ott######-solution.tre`)
and then assembled into a single tree.
Here is some shell code to perform this:
```sh
otc-graft-solutions ../subproblem_solutions/*.tre > grafted_solution.tre
```
Also see documentation for `otc-graft-solution` in otcetera/README.md. | 3 | 0.2 | 2 | 1 |
524230ffd2b4e01e11dcd4b7da3d25d7c49f9565 | lib/range-finder.coffee | lib/range-finder.coffee | {_, Range} = require 'atom'
module.exports =
class RangeFinder
# Public
@rangesFor: (editor) ->
new RangeFinder(editor).ranges()
# Public
constructor: (@editor) ->
# Public
ranges: ->
selectionRanges = @selectionRanges()
if _.isEmpty(selectionRanges)
[@sortableRangeForEntireBuffer()]
else
_.map selectionRanges, (selectionRange) =>
@sortableRangeFrom(selectionRange)
# Internal
selectionRanges: ->
_.reject @editor.getSelectedBufferRanges(), (range) ->
range.isEmpty()
# Internal
sortableRangeForEntireBuffer: ->
@editor.getBuffer().getRange()
# Internal
sortableRangeFrom: (selectionRange) ->
startRow = selectionRange.start.row
startCol = 0
endRow = if selectionRange.end.column == 0
selectionRange.end.row - 1
else
selectionRange.end.row
endCol = @editor.lineLengthForBufferRow(endRow)
new Range [startRow, startCol], [endRow, endCol]
| {Range} = require 'atom'
module.exports =
class RangeFinder
# Public
@rangesFor: (editor) ->
new RangeFinder(editor).ranges()
# Public
constructor: (@editor) ->
# Public
ranges: ->
selectionRanges = @selectionRanges()
if selectionRanges.length is 0
[@sortableRangeForEntireBuffer()]
else
selectionRanges.map (selectionRange) =>
@sortableRangeFrom(selectionRange)
# Internal
selectionRanges: ->
@editor.getSelectedBufferRanges().filter (range) ->
not range.isEmpty()
# Internal
sortableRangeForEntireBuffer: ->
@editor.getBuffer().getRange()
# Internal
sortableRangeFrom: (selectionRange) ->
startRow = selectionRange.start.row
startCol = 0
endRow = if selectionRange.end.column == 0
selectionRange.end.row - 1
else
selectionRange.end.row
endCol = @editor.lineLengthForBufferRow(endRow)
new Range [startRow, startCol], [endRow, endCol]
| Use built-in array methods instead of underscore | Use built-in array methods instead of underscore
| CoffeeScript | mit | garethbjohnson/sort-css,atom/sort-lines | coffeescript | ## Code Before:
{_, Range} = require 'atom'
module.exports =
class RangeFinder
# Public
@rangesFor: (editor) ->
new RangeFinder(editor).ranges()
# Public
constructor: (@editor) ->
# Public
ranges: ->
selectionRanges = @selectionRanges()
if _.isEmpty(selectionRanges)
[@sortableRangeForEntireBuffer()]
else
_.map selectionRanges, (selectionRange) =>
@sortableRangeFrom(selectionRange)
# Internal
selectionRanges: ->
_.reject @editor.getSelectedBufferRanges(), (range) ->
range.isEmpty()
# Internal
sortableRangeForEntireBuffer: ->
@editor.getBuffer().getRange()
# Internal
sortableRangeFrom: (selectionRange) ->
startRow = selectionRange.start.row
startCol = 0
endRow = if selectionRange.end.column == 0
selectionRange.end.row - 1
else
selectionRange.end.row
endCol = @editor.lineLengthForBufferRow(endRow)
new Range [startRow, startCol], [endRow, endCol]
## Instruction:
Use built-in array methods instead of underscore
## Code After:
{Range} = require 'atom'
module.exports =
class RangeFinder
# Public
@rangesFor: (editor) ->
new RangeFinder(editor).ranges()
# Public
constructor: (@editor) ->
# Public
ranges: ->
selectionRanges = @selectionRanges()
if selectionRanges.length is 0
[@sortableRangeForEntireBuffer()]
else
selectionRanges.map (selectionRange) =>
@sortableRangeFrom(selectionRange)
# Internal
selectionRanges: ->
@editor.getSelectedBufferRanges().filter (range) ->
not range.isEmpty()
# Internal
sortableRangeForEntireBuffer: ->
@editor.getBuffer().getRange()
# Internal
sortableRangeFrom: (selectionRange) ->
startRow = selectionRange.start.row
startCol = 0
endRow = if selectionRange.end.column == 0
selectionRange.end.row - 1
else
selectionRange.end.row
endCol = @editor.lineLengthForBufferRow(endRow)
new Range [startRow, startCol], [endRow, endCol]
| - {_, Range} = require 'atom'
? ---
+ {Range} = require 'atom'
module.exports =
class RangeFinder
-
# Public
@rangesFor: (editor) ->
new RangeFinder(editor).ranges()
# Public
constructor: (@editor) ->
# Public
ranges: ->
selectionRanges = @selectionRanges()
- if _.isEmpty(selectionRanges)
+ if selectionRanges.length is 0
[@sortableRangeForEntireBuffer()]
else
- _.map selectionRanges, (selectionRange) =>
? ------ ^
+ selectionRanges.map (selectionRange) =>
? ^^^^
@sortableRangeFrom(selectionRange)
# Internal
selectionRanges: ->
- _.reject @editor.getSelectedBufferRanges(), (range) ->
? --------- ^
+ @editor.getSelectedBufferRanges().filter (range) ->
? ^^^^^^^
- range.isEmpty()
+ not range.isEmpty()
? ++++
# Internal
sortableRangeForEntireBuffer: ->
@editor.getBuffer().getRange()
# Internal
sortableRangeFrom: (selectionRange) ->
startRow = selectionRange.start.row
startCol = 0
endRow = if selectionRange.end.column == 0
selectionRange.end.row - 1
else
selectionRange.end.row
endCol = @editor.lineLengthForBufferRow(endRow)
new Range [startRow, startCol], [endRow, endCol] | 11 | 0.268293 | 5 | 6 |
85ffe172eb00c25d35990bab313be7a0194dddb1 | setup.py | setup.py | from distutils.core import setup
setup(name='Pipeless',
version='1.0',
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
for building a data pipeline.
It's an advanced version of this:
function4(function3(function2(function1(0))))
It looks like this:
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function
... def up_one(): return lambda item: item+1
>>> list(run([0, 1, 3]))
[1, 2, 4]
>>> @function
... def twofer(): return lambda item: [item, item]
>>> list(run([0, 1, 3]))
[1, 1, 2, 2, 4, 4]
* Pipelines operate over sources
* Functions can return 1 Item, None to drop the item, or
a generator to expand the item.
Also provides a simple Optionally-Argumented NamedTuple and a Commmand Line Generator.
""",
author='Andy Chase',
author_email='andy@asperous.us',
url='http://github.com/asperous/pipeless',
download_url="https://github.com/asperous/pipeless/archive/master.zip",
license="MIT",
py_modules=['pipeless']
) | from distutils.core import setup
setup(name='Pipeless',
version='1.0.1',
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
for building a data pipeline.
It's an advanced version of this:
function4(function3(function2(function1(0))))
It looks like this:
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function
... def up_one(): return lambda item: item+1
>>> list(run([0, 1, 3]))
[1, 2, 4]
>>> @function
... def twofer(): return lambda item: [item, item]
>>> list(run([0, 1, 3]))
[1, 1, 2, 2, 4, 4]
* Pipelines operate over sources
* Functions can return 1 Item, None to drop the item, or
a generator to expand the item.
Also provides a simple Optionally-Argumented NamedTuple and a Commmand Line Generator.
""",
author='Andy Chase',
author_email='andy@asperous.us',
url='http://asperous.github.io/pipeless',
download_url="https://github.com/asperous/pipeless/archive/master.zip",
license="MIT",
py_modules=['pipeless']
) | Add version number to reflect orderedict bug | Add version number to reflect orderedict bug
| Python | mit | andychase/pipeless | python | ## Code Before:
from distutils.core import setup
setup(name='Pipeless',
version='1.0',
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
for building a data pipeline.
It's an advanced version of this:
function4(function3(function2(function1(0))))
It looks like this:
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function
... def up_one(): return lambda item: item+1
>>> list(run([0, 1, 3]))
[1, 2, 4]
>>> @function
... def twofer(): return lambda item: [item, item]
>>> list(run([0, 1, 3]))
[1, 1, 2, 2, 4, 4]
* Pipelines operate over sources
* Functions can return 1 Item, None to drop the item, or
a generator to expand the item.
Also provides a simple Optionally-Argumented NamedTuple and a Commmand Line Generator.
""",
author='Andy Chase',
author_email='andy@asperous.us',
url='http://github.com/asperous/pipeless',
download_url="https://github.com/asperous/pipeless/archive/master.zip",
license="MIT",
py_modules=['pipeless']
)
## Instruction:
Add version number to reflect orderedict bug
## Code After:
from distutils.core import setup
setup(name='Pipeless',
version='1.0.1',
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
for building a data pipeline.
It's an advanced version of this:
function4(function3(function2(function1(0))))
It looks like this:
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function
... def up_one(): return lambda item: item+1
>>> list(run([0, 1, 3]))
[1, 2, 4]
>>> @function
... def twofer(): return lambda item: [item, item]
>>> list(run([0, 1, 3]))
[1, 1, 2, 2, 4, 4]
* Pipelines operate over sources
* Functions can return 1 Item, None to drop the item, or
a generator to expand the item.
Also provides a simple Optionally-Argumented NamedTuple and a Commmand Line Generator.
""",
author='Andy Chase',
author_email='andy@asperous.us',
url='http://asperous.github.io/pipeless',
download_url="https://github.com/asperous/pipeless/archive/master.zip",
license="MIT",
py_modules=['pipeless']
) | from distutils.core import setup
setup(name='Pipeless',
- version='1.0',
+ version='1.0.1',
? ++
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
for building a data pipeline.
It's an advanced version of this:
function4(function3(function2(function1(0))))
It looks like this:
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function
... def up_one(): return lambda item: item+1
>>> list(run([0, 1, 3]))
[1, 2, 4]
>>> @function
... def twofer(): return lambda item: [item, item]
>>> list(run([0, 1, 3]))
[1, 1, 2, 2, 4, 4]
* Pipelines operate over sources
* Functions can return 1 Item, None to drop the item, or
a generator to expand the item.
Also provides a simple Optionally-Argumented NamedTuple and a Commmand Line Generator.
""",
author='Andy Chase',
author_email='andy@asperous.us',
- url='http://github.com/asperous/pipeless',
? -----------
+ url='http://asperous.github.io/pipeless',
? ++++++++++
download_url="https://github.com/asperous/pipeless/archive/master.zip",
license="MIT",
py_modules=['pipeless']
) | 4 | 0.108108 | 2 | 2 |
f791a71163791a03158bead4e6cce34f903271e8 | git/install.sh | git/install.sh | if [ "$(uname -s)" = "Darwin" ]; then
git config --global user.helper osxkeychain
else
git config --global user.helper cache
fi
# better diffs
if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
fi
| if [ "$(uname -s)" = "Darwin" ]; then
git config --global credential.helper osxkeychain
else
git config --global credential.helper cache
fi
# better diffs
if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
fi
| Fix typo in git config command | Fix typo in git config command
As best I can tell `user.helper` should be `credential.helper`.
See: https://git-scm.com/docs/gitcredentials and https://git-scm.com/docs/git-config | Shell | mit | caarlos0/dotfiles,dennari/dotfiles-new,mattmahn/dotfiles,mattmahn/dotfiles | shell | ## Code Before:
if [ "$(uname -s)" = "Darwin" ]; then
git config --global user.helper osxkeychain
else
git config --global user.helper cache
fi
# better diffs
if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
fi
## Instruction:
Fix typo in git config command
As best I can tell `user.helper` should be `credential.helper`.
See: https://git-scm.com/docs/gitcredentials and https://git-scm.com/docs/git-config
## Code After:
if [ "$(uname -s)" = "Darwin" ]; then
git config --global credential.helper osxkeychain
else
git config --global credential.helper cache
fi
# better diffs
if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
fi
| if [ "$(uname -s)" = "Darwin" ]; then
- git config --global user.helper osxkeychain
? ^^ ^
+ git config --global credential.helper osxkeychain
? ^^ ^^^^^^^
else
- git config --global user.helper cache
? ^^ ^
+ git config --global credential.helper cache
? ^^ ^^^^^^^
fi
# better diffs
if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
fi | 4 | 0.4 | 2 | 2 |
967676628382bf0eccf48cfb7646ece5277d13cd | docs/structure.rst | docs/structure.rst | User model: Customers, Users, Roles and Projects
++++++++++++++++++++++++++++++++++++++++++++++++++++
NodeConductor's user model includes several core models described below.
.. glossary::
Customer
A standalone entity. Represents a company or a department. Responsible for paying for consumed resources.
Project
A project is an entity within an customer. Project is managed by users having different roles. Project
aggregates and separates resources.
User
An account in NodeConductor belonging to a person or robot. A user can have at most a single role in the project.
A user can work in different projects with different roles. User's Customer is derived based on what projects
a user has access to.
Role
A grouping of permissions for performing actions on the managed objects. Currently supported are two roles:
a more technical 'Administrator' role and less technical 'Manager' role.
Project roles
=============
.. glossary::
Administrator
Role responsible for the day-to-day technical operations within a project. Limited access to project management and billing.
Manager
A non-technical role with access to user management, accounting, billing and reporting. | User model: Organisations, Users, Roles and Projects
++++++++++++++++++++++++++++++++++++++++++++++++++++
NodeConductor's user model includes several core models described below.
.. glossary::
Organisation
A standalone entity. Represents a company or a department. Responsible for paying for consumed resources.
Project
A project is an entity within an organisation. Project is managed by users having different roles. Project
aggregates and separates resources.
User
An account in NodeConductor belonging to a person or robot. A user can have at most a single role in the project.
A user can work in different projects with different roles. User's Organisation is derived based on what projects
a user has access to.
Role
A grouping of permissions for performing actions on the managed objects. Currently supported are two roles:
a more technical 'Administrator' role and less technical 'Manager' role.
Project roles
=============
.. glossary::
Administrator
Role responsible for the day-to-day technical operations within a project. Limited access to project management and billing.
Manager
A non-technical role with access to user management, accounting, billing and reporting. | Revert "Organisation renamed to Customer" | Revert "Organisation renamed to Customer"
This reverts commit e634de18ceefed737213b36d3939a2b3ad0242e1.
| reStructuredText | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | restructuredtext | ## Code Before:
User model: Customers, Users, Roles and Projects
++++++++++++++++++++++++++++++++++++++++++++++++++++
NodeConductor's user model includes several core models described below.
.. glossary::
Customer
A standalone entity. Represents a company or a department. Responsible for paying for consumed resources.
Project
A project is an entity within an customer. Project is managed by users having different roles. Project
aggregates and separates resources.
User
An account in NodeConductor belonging to a person or robot. A user can have at most a single role in the project.
A user can work in different projects with different roles. User's Customer is derived based on what projects
a user has access to.
Role
A grouping of permissions for performing actions on the managed objects. Currently supported are two roles:
a more technical 'Administrator' role and less technical 'Manager' role.
Project roles
=============
.. glossary::
Administrator
Role responsible for the day-to-day technical operations within a project. Limited access to project management and billing.
Manager
A non-technical role with access to user management, accounting, billing and reporting.
## Instruction:
Revert "Organisation renamed to Customer"
This reverts commit e634de18ceefed737213b36d3939a2b3ad0242e1.
## Code After:
User model: Organisations, Users, Roles and Projects
++++++++++++++++++++++++++++++++++++++++++++++++++++
NodeConductor's user model includes several core models described below.
.. glossary::
Organisation
A standalone entity. Represents a company or a department. Responsible for paying for consumed resources.
Project
A project is an entity within an organisation. Project is managed by users having different roles. Project
aggregates and separates resources.
User
An account in NodeConductor belonging to a person or robot. A user can have at most a single role in the project.
A user can work in different projects with different roles. User's Organisation is derived based on what projects
a user has access to.
Role
A grouping of permissions for performing actions on the managed objects. Currently supported are two roles:
a more technical 'Administrator' role and less technical 'Manager' role.
Project roles
=============
.. glossary::
Administrator
Role responsible for the day-to-day technical operations within a project. Limited access to project management and billing.
Manager
A non-technical role with access to user management, accounting, billing and reporting. | - User model: Customers, Users, Roles and Projects
? ^^ ^^^
+ User model: Organisations, Users, Roles and Projects
? ^^^^^^ + + ^
++++++++++++++++++++++++++++++++++++++++++++++++++++
NodeConductor's user model includes several core models described below.
.. glossary::
- Customer
+ Organisation
A standalone entity. Represents a company or a department. Responsible for paying for consumed resources.
Project
- A project is an entity within an customer. Project is managed by users having different roles. Project
? ^^ ^^^
+ A project is an entity within an organisation. Project is managed by users having different roles. Project
? ^^^^^^ + + ^
aggregates and separates resources.
User
An account in NodeConductor belonging to a person or robot. A user can have at most a single role in the project.
- A user can work in different projects with different roles. User's Customer is derived based on what projects
? ^^ ^^^
+ A user can work in different projects with different roles. User's Organisation is derived based on what projects
? ^^^^^^ + + ^
a user has access to.
Role
A grouping of permissions for performing actions on the managed objects. Currently supported are two roles:
a more technical 'Administrator' role and less technical 'Manager' role.
Project roles
=============
.. glossary::
Administrator
Role responsible for the day-to-day technical operations within a project. Limited access to project management and billing.
Manager
A non-technical role with access to user management, accounting, billing and reporting. | 8 | 0.228571 | 4 | 4 |
a5ddaf98fe32dd53819c7a796f433096f10f3ea8 | lib/filepreviews/cli.rb | lib/filepreviews/cli.rb | require 'optparse'
module Filepreviews
# @author Jonah Ruiz <jonah@pixelhipsters.com>
# A Simple class for the executable version of the gem
class CLI
BANNER = <<MSG
Usage: filepreviews [OPTION] [URL]
Description:
Filepreviews.io - Thumbnails and metadata for almost any kind of file
Options:
MSG
# Passes arguments from ARGV and sets metadata flag
# @param args [Array<String>] The command-line arguments
def initialize(args)
@args, @metadata = args, false
end
# Configures the arguments for the command
# @param opts [OptionParser]
def options(opts)
opts.version = Filepreviews::VERSION
opts.banner = BANNER
opts.set_program_name 'Filepreviews.io'
opts.on('-m', '--metadata', 'load metadata response') do
@metadata = true
end
opts.on_tail('-v', '--version', 'display the version of Filepreviews') do
puts opts.version
exit
end
opts.on_tail('-h', '--help', 'print this help') do
puts opts.help
exit
end
end
# Parses options sent from command-line
def parse
opts = OptionParser.new(&method(:options))
opts.parse!(@args)
return opts.help if @args.last.nil?
file_preview = Filepreviews.generate(@args.last)
@metadata ? file_preview.metadata(js: true) : file_preview
end
end
end
| require 'optparse'
module Filepreviews
# @author Jonah Ruiz <jonah@pixelhipsters.com>
# A Simple class for the executable version of the gem
class CLI
BANNER = <<MSG
Usage: filepreviews [OPTION] [URL]
Description:
Filepreviews.io - Thumbnails and metadata for almost any kind of file
Options:
MSG
# Passes arguments from ARGV and sets metadata flag
# @param args [Array<String>] The command-line arguments
def initialize(args)
@args, @metadata = args, false
end
# Configures the arguments for the command
# @param opts [OptionParser]
def options(opts)
opts.version = Filepreviews::VERSION
opts.banner = BANNER
opts.set_program_name 'Filepreviews.io'
opts.on('-k', '--api_key [key]', String,
'use API key from Filepreviews.io') do |key|
Filepreviews.api_key = key
end
opts.on('-m', '--metadata', 'load metadata response') do
@metadata = true
end
opts.on_tail('-v', '--version', 'display the version of Filepreviews') do
puts opts.version
exit
end
opts.on_tail('-h', '--help', 'print this help') do
puts opts.help
exit
end
end
# Parses options sent from command-line
def parse
opts = OptionParser.new(&method(:options))
opts.parse!(@args)
return opts.help if @args.last.nil?
file_preview = Filepreviews.generate(@args.last)
@metadata ? file_preview.metadata(js: true) : file_preview
end
end
end
| Add api_key argument and description to CLI | Add api_key argument and description to CLI
| Ruby | mit | GetBlimp/filepreviews-ruby,jonahoffline/filepreviews-ruby | ruby | ## Code Before:
require 'optparse'
module Filepreviews
# @author Jonah Ruiz <jonah@pixelhipsters.com>
# A Simple class for the executable version of the gem
class CLI
BANNER = <<MSG
Usage: filepreviews [OPTION] [URL]
Description:
Filepreviews.io - Thumbnails and metadata for almost any kind of file
Options:
MSG
# Passes arguments from ARGV and sets metadata flag
# @param args [Array<String>] The command-line arguments
def initialize(args)
@args, @metadata = args, false
end
# Configures the arguments for the command
# @param opts [OptionParser]
def options(opts)
opts.version = Filepreviews::VERSION
opts.banner = BANNER
opts.set_program_name 'Filepreviews.io'
opts.on('-m', '--metadata', 'load metadata response') do
@metadata = true
end
opts.on_tail('-v', '--version', 'display the version of Filepreviews') do
puts opts.version
exit
end
opts.on_tail('-h', '--help', 'print this help') do
puts opts.help
exit
end
end
# Parses options sent from command-line
def parse
opts = OptionParser.new(&method(:options))
opts.parse!(@args)
return opts.help if @args.last.nil?
file_preview = Filepreviews.generate(@args.last)
@metadata ? file_preview.metadata(js: true) : file_preview
end
end
end
## Instruction:
Add api_key argument and description to CLI
## Code After:
require 'optparse'
module Filepreviews
# @author Jonah Ruiz <jonah@pixelhipsters.com>
# A Simple class for the executable version of the gem
class CLI
BANNER = <<MSG
Usage: filepreviews [OPTION] [URL]
Description:
Filepreviews.io - Thumbnails and metadata for almost any kind of file
Options:
MSG
# Passes arguments from ARGV and sets metadata flag
# @param args [Array<String>] The command-line arguments
def initialize(args)
@args, @metadata = args, false
end
# Configures the arguments for the command
# @param opts [OptionParser]
def options(opts)
opts.version = Filepreviews::VERSION
opts.banner = BANNER
opts.set_program_name 'Filepreviews.io'
opts.on('-k', '--api_key [key]', String,
'use API key from Filepreviews.io') do |key|
Filepreviews.api_key = key
end
opts.on('-m', '--metadata', 'load metadata response') do
@metadata = true
end
opts.on_tail('-v', '--version', 'display the version of Filepreviews') do
puts opts.version
exit
end
opts.on_tail('-h', '--help', 'print this help') do
puts opts.help
exit
end
end
# Parses options sent from command-line
def parse
opts = OptionParser.new(&method(:options))
opts.parse!(@args)
return opts.help if @args.last.nil?
file_preview = Filepreviews.generate(@args.last)
@metadata ? file_preview.metadata(js: true) : file_preview
end
end
end
| require 'optparse'
module Filepreviews
# @author Jonah Ruiz <jonah@pixelhipsters.com>
# A Simple class for the executable version of the gem
class CLI
BANNER = <<MSG
Usage: filepreviews [OPTION] [URL]
Description:
Filepreviews.io - Thumbnails and metadata for almost any kind of file
Options:
MSG
# Passes arguments from ARGV and sets metadata flag
# @param args [Array<String>] The command-line arguments
def initialize(args)
@args, @metadata = args, false
end
# Configures the arguments for the command
# @param opts [OptionParser]
def options(opts)
opts.version = Filepreviews::VERSION
opts.banner = BANNER
opts.set_program_name 'Filepreviews.io'
+
+ opts.on('-k', '--api_key [key]', String,
+ 'use API key from Filepreviews.io') do |key|
+ Filepreviews.api_key = key
+ end
opts.on('-m', '--metadata', 'load metadata response') do
@metadata = true
end
opts.on_tail('-v', '--version', 'display the version of Filepreviews') do
puts opts.version
exit
end
opts.on_tail('-h', '--help', 'print this help') do
puts opts.help
exit
end
end
# Parses options sent from command-line
def parse
opts = OptionParser.new(&method(:options))
opts.parse!(@args)
return opts.help if @args.last.nil?
file_preview = Filepreviews.generate(@args.last)
@metadata ? file_preview.metadata(js: true) : file_preview
end
end
end | 5 | 0.096154 | 5 | 0 |
08082d5413d9d96edefed1d2b124008567793e06 | app/assets/stylesheets/videos.css | app/assets/stylesheets/videos.css | .filters {
display: flex;
flex-direction: row;
.filters-left {
display: flex;
flex: 4;
justify-content: flex-start;
.sort {
margin-right: 10px;
.form-control {
width: auto;
height: 46px;
}
}
.add-filter {
margin-right: 10px;
align-self: flex-start;
height: 46px;
}
.dropdown-menu {
top: 50px;
}
.filters-active {
display: flex;
flex-wrap: wrap;
}
.filter {
display: flex;
background-color: #F0F0F0;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
margin-right: 10px;
margin-bottom: 10px;
.filter-label {
display: flex;
align-items: center;
justify-content: center;
}
.Select {
min-width: 125px;
margin-left: 5px;
margin-right: 5px;
}
.glyphicon-remove {
display: flex;
align-items: center;
justify-content: center;
&:hover {
cursor: pointer;
}
}
}
}
.search {
flex: 1;
align-self: flex-start;
min-width: 75px;
input {
height: 46px;
}
}
}
| .filters {
display: flex;
flex-direction: row;
.filters-left {
display: flex;
flex: 4;
justify-content: flex-start;
.sort {
margin-right: 10px;
margin-bottom: 10px;
.form-control {
width: auto;
height: 46px;
}
}
.add-filter {
margin-right: 10px;
align-self: flex-start;
height: 46px;
}
.dropdown-menu {
top: 50px;
}
.filters-active {
display: flex;
flex-wrap: wrap;
}
.filter {
display: flex;
background-color: #F0F0F0;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
margin-right: 10px;
margin-bottom: 10px;
.filter-label {
display: flex;
align-items: center;
justify-content: center;
}
.Select {
min-width: 125px;
margin-left: 5px;
margin-right: 5px;
}
.glyphicon-remove {
display: flex;
align-items: center;
justify-content: center;
&:hover {
cursor: pointer;
}
}
}
}
.search {
flex: 1;
align-self: flex-start;
min-width: 75px;
input {
height: 46px;
}
}
}
| Add margin to sort to prevent jumping when adding filter | Add margin to sort to prevent jumping when adding filter
| CSS | mit | schneidmaster/debatevid.io,schneidmaster/debatevid.io,schneidmaster/debatevid.io | css | ## Code Before:
.filters {
display: flex;
flex-direction: row;
.filters-left {
display: flex;
flex: 4;
justify-content: flex-start;
.sort {
margin-right: 10px;
.form-control {
width: auto;
height: 46px;
}
}
.add-filter {
margin-right: 10px;
align-self: flex-start;
height: 46px;
}
.dropdown-menu {
top: 50px;
}
.filters-active {
display: flex;
flex-wrap: wrap;
}
.filter {
display: flex;
background-color: #F0F0F0;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
margin-right: 10px;
margin-bottom: 10px;
.filter-label {
display: flex;
align-items: center;
justify-content: center;
}
.Select {
min-width: 125px;
margin-left: 5px;
margin-right: 5px;
}
.glyphicon-remove {
display: flex;
align-items: center;
justify-content: center;
&:hover {
cursor: pointer;
}
}
}
}
.search {
flex: 1;
align-self: flex-start;
min-width: 75px;
input {
height: 46px;
}
}
}
## Instruction:
Add margin to sort to prevent jumping when adding filter
## Code After:
.filters {
display: flex;
flex-direction: row;
.filters-left {
display: flex;
flex: 4;
justify-content: flex-start;
.sort {
margin-right: 10px;
margin-bottom: 10px;
.form-control {
width: auto;
height: 46px;
}
}
.add-filter {
margin-right: 10px;
align-self: flex-start;
height: 46px;
}
.dropdown-menu {
top: 50px;
}
.filters-active {
display: flex;
flex-wrap: wrap;
}
.filter {
display: flex;
background-color: #F0F0F0;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
margin-right: 10px;
margin-bottom: 10px;
.filter-label {
display: flex;
align-items: center;
justify-content: center;
}
.Select {
min-width: 125px;
margin-left: 5px;
margin-right: 5px;
}
.glyphicon-remove {
display: flex;
align-items: center;
justify-content: center;
&:hover {
cursor: pointer;
}
}
}
}
.search {
flex: 1;
align-self: flex-start;
min-width: 75px;
input {
height: 46px;
}
}
}
| .filters {
display: flex;
flex-direction: row;
.filters-left {
display: flex;
flex: 4;
justify-content: flex-start;
.sort {
margin-right: 10px;
+ margin-bottom: 10px;
.form-control {
width: auto;
height: 46px;
}
}
.add-filter {
margin-right: 10px;
align-self: flex-start;
height: 46px;
}
.dropdown-menu {
top: 50px;
}
.filters-active {
display: flex;
flex-wrap: wrap;
}
.filter {
display: flex;
background-color: #F0F0F0;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
margin-right: 10px;
margin-bottom: 10px;
.filter-label {
display: flex;
align-items: center;
justify-content: center;
}
.Select {
min-width: 125px;
margin-left: 5px;
margin-right: 5px;
}
.glyphicon-remove {
display: flex;
align-items: center;
justify-content: center;
&:hover {
cursor: pointer;
}
}
}
}
.search {
flex: 1;
align-self: flex-start;
min-width: 75px;
input {
height: 46px;
}
}
} | 1 | 0.012987 | 1 | 0 |
5a785f725d68733561a7e5e82c57655e25439ec8 | indra/tests/test_grounding_resources.py | indra/tests/test_grounding_resources.py | import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions = ['CLO']
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in default_misgrounding_map.items():
if not validate_db_refs(db_refs):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
def test_grounding_map_entries():
bad_entries = []
for text, db_refs in default_grounding_map.items():
if (not validate_db_refs(db_refs) and
not (set(exceptions) & db_refs.keys())):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
def test_exceptional_unhandled():
"""Test that exceptional namespaces actually aren't handled.
This will catch if we make an update that makes an exceptional namespace
become a handled namespace. That way we can update the tests.
"""
actually_handled = []
for ns in exceptions:
if validate_ns(ns):
actually_handled.append(ns)
assert not actually_handled, actually_handled
| import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in default_misgrounding_map.items():
if not validate_db_refs(db_refs):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
def test_grounding_map_entries():
bad_entries = []
for text, db_refs in default_grounding_map.items():
if (not validate_db_refs(db_refs) and
not (set(exceptions) & db_refs.keys())):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
| Remove exceptional namespaces from test | Remove exceptional namespaces from test
| Python | bsd-2-clause | johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/belpy | python | ## Code Before:
import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
# Namespaces that are not currently handled but still appear in statements
exceptions = ['CLO']
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in default_misgrounding_map.items():
if not validate_db_refs(db_refs):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
def test_grounding_map_entries():
bad_entries = []
for text, db_refs in default_grounding_map.items():
if (not validate_db_refs(db_refs) and
not (set(exceptions) & db_refs.keys())):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
def test_exceptional_unhandled():
"""Test that exceptional namespaces actually aren't handled.
This will catch if we make an update that makes an exceptional namespace
become a handled namespace. That way we can update the tests.
"""
actually_handled = []
for ns in exceptions:
if validate_ns(ns):
actually_handled.append(ns)
assert not actually_handled, actually_handled
## Instruction:
Remove exceptional namespaces from test
## Code After:
import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in default_misgrounding_map.items():
if not validate_db_refs(db_refs):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
def test_grounding_map_entries():
bad_entries = []
for text, db_refs in default_grounding_map.items():
if (not validate_db_refs(db_refs) and
not (set(exceptions) & db_refs.keys())):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
| import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map
-
- # Namespaces that are not currently handled but still appear in statements
- exceptions = ['CLO']
def test_misgrounding_map_entries():
bad_entries = []
for text, db_refs in default_misgrounding_map.items():
if not validate_db_refs(db_refs):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
def test_grounding_map_entries():
bad_entries = []
for text, db_refs in default_grounding_map.items():
if (not validate_db_refs(db_refs) and
not (set(exceptions) & db_refs.keys())):
bad_entries.append([text, db_refs])
assert not bad_entries, bad_entries
-
-
- def test_exceptional_unhandled():
- """Test that exceptional namespaces actually aren't handled.
-
- This will catch if we make an update that makes an exceptional namespace
- become a handled namespace. That way we can update the tests.
- """
- actually_handled = []
- for ns in exceptions:
- if validate_ns(ns):
- actually_handled.append(ns)
- assert not actually_handled, actually_handled
-
-
-
-
-
- | 22 | 0.5 | 0 | 22 |
09fda59bea4e6498d592837ba5d5331201ffe73c | app.json | app.json | {
"name": "Respoke Sample Push Server",
"description": "A sample server for receiving webhook events from Respoke and responding to push notification events",
"keywords": [ "Respoke" ],
"website": "https://www.respoke.io",
"repository": "https://github.com/chadxz/sample-push-server",
"logo": "http://community.respoke.io/uploads/db2818/10/2f9b5ce409f806e0.png",
"env": {
"APP_ID": {
"description": "The id of the Respoke application you want to handle push notifications for.",
"value": ""
},
"APP_SECRET": {
"description": "The Respoke application secret for the app you want to handle push notifications for.",
"value": ""
}
}
}
| {
"name": "Respoke Sample Push Server",
"description": "A sample server for receiving webhook events from Respoke and responding to push notification events",
"keywords": [ "Respoke" ],
"website": "https://www.respoke.io",
"repository": "https://github.com/chadxz/sample-push-server",
"logo": "http://community.respoke.io/uploads/db2818/10/2f9b5ce409f806e0.png",
"env": {
"APP_SECRET": {
"description": "The Respoke application secret for the app you want to handle push notifications for. This can be retrieved from your Respoke Developer Console.",
"value": ""
}
}
}
| Remove the requirement for APP_ID env var | Remove the requirement for APP_ID env var
| JSON | mit | respoke/sample-push-server | json | ## Code Before:
{
"name": "Respoke Sample Push Server",
"description": "A sample server for receiving webhook events from Respoke and responding to push notification events",
"keywords": [ "Respoke" ],
"website": "https://www.respoke.io",
"repository": "https://github.com/chadxz/sample-push-server",
"logo": "http://community.respoke.io/uploads/db2818/10/2f9b5ce409f806e0.png",
"env": {
"APP_ID": {
"description": "The id of the Respoke application you want to handle push notifications for.",
"value": ""
},
"APP_SECRET": {
"description": "The Respoke application secret for the app you want to handle push notifications for.",
"value": ""
}
}
}
## Instruction:
Remove the requirement for APP_ID env var
## Code After:
{
"name": "Respoke Sample Push Server",
"description": "A sample server for receiving webhook events from Respoke and responding to push notification events",
"keywords": [ "Respoke" ],
"website": "https://www.respoke.io",
"repository": "https://github.com/chadxz/sample-push-server",
"logo": "http://community.respoke.io/uploads/db2818/10/2f9b5ce409f806e0.png",
"env": {
"APP_SECRET": {
"description": "The Respoke application secret for the app you want to handle push notifications for. This can be retrieved from your Respoke Developer Console.",
"value": ""
}
}
}
| {
"name": "Respoke Sample Push Server",
"description": "A sample server for receiving webhook events from Respoke and responding to push notification events",
"keywords": [ "Respoke" ],
"website": "https://www.respoke.io",
"repository": "https://github.com/chadxz/sample-push-server",
"logo": "http://community.respoke.io/uploads/db2818/10/2f9b5ce409f806e0.png",
"env": {
- "APP_ID": {
- "description": "The id of the Respoke application you want to handle push notifications for.",
- "value": ""
- },
"APP_SECRET": {
- "description": "The Respoke application secret for the app you want to handle push notifications for.",
+ "description": "The Respoke application secret for the app you want to handle push notifications for. This can be retrieved from your Respoke Developer Console.",
? +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"value": ""
}
}
} | 6 | 0.333333 | 1 | 5 |
79638c6353c4da63a0d9aad2fc6a14a055d2c371 | css/README.md | css/README.md |
This section contains css that should be liked to or added to your University's CSS file.
## Icon Font
Google provides the icons as a font. Instructions on how to install that are located [on their site](http://google.github.io/material-design-icons/).
At a bare minimum, add this:
```
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
```
## Customizations
The code in [icons.css](icons.css) is additional code that is used for sizes and colors of the icons. It needs to be added to the page's CSS.
### Additional Sizes
To add additional sizes, add an additional style to the [icons.css](icons.css) file with the `font-size`. Then add an additional object in the [size.json](../gadget/dist/settings/size.json) file with the format below. the class name should match the class name in the [icons.css](icons.css) file.
```
{
"name" : "DisplayName",
"class" : "xl"
}
```
### Additional Colors
Same process as the sizes. Add colors to [icons.css](icons.css) then add an object to [colors.json](../gadget/dist/settings/colors.json) with the format below:
```
{
"name" : "DisplayColor",
"class" : "yellow"
}
``` |
This section contains css that should be liked to or added to your University's CSS file.
## Icon Font
Google provides the icons as a font. Instructions on how to install that are located [on their site](http://google.github.io/material-design-icons/).
At a bare minimum, add this:
```
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link href="https://jessgusclark.github.io/gadget-material-icons/css/icons.css" rel="stylesheet" />
```
## Customizations
The code in [icons.css](icons.css) is additional code that is used for sizes and colors of the icons. It needs to be added to the page's CSS.
### Additional Sizes
To add additional sizes, add an additional style to the [icons.css](icons.css) file with the `font-size`. Then add an additional object in the [size.json](../gadget/dist/settings/size.json) file with the format below. the class name should match the class name in the [icons.css](icons.css) file.
```
{
"name" : "DisplayName",
"class" : "xl"
}
```
### Additional Colors
Same process as the sizes. Add colors to [icons.css](icons.css) then add an object to [colors.json](../gadget/dist/settings/colors.json) with the format below:
```
{
"name" : "DisplayColor",
"class" : "yellow"
}
``` | Add stylesheet link to icons.css | Add stylesheet link to icons.css
| Markdown | mit | jessgusclark/gadget-material-icons | markdown | ## Code Before:
This section contains css that should be liked to or added to your University's CSS file.
## Icon Font
Google provides the icons as a font. Instructions on how to install that are located [on their site](http://google.github.io/material-design-icons/).
At a bare minimum, add this:
```
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
```
## Customizations
The code in [icons.css](icons.css) is additional code that is used for sizes and colors of the icons. It needs to be added to the page's CSS.
### Additional Sizes
To add additional sizes, add an additional style to the [icons.css](icons.css) file with the `font-size`. Then add an additional object in the [size.json](../gadget/dist/settings/size.json) file with the format below. the class name should match the class name in the [icons.css](icons.css) file.
```
{
"name" : "DisplayName",
"class" : "xl"
}
```
### Additional Colors
Same process as the sizes. Add colors to [icons.css](icons.css) then add an object to [colors.json](../gadget/dist/settings/colors.json) with the format below:
```
{
"name" : "DisplayColor",
"class" : "yellow"
}
```
## Instruction:
Add stylesheet link to icons.css
## Code After:
This section contains css that should be liked to or added to your University's CSS file.
## Icon Font
Google provides the icons as a font. Instructions on how to install that are located [on their site](http://google.github.io/material-design-icons/).
At a bare minimum, add this:
```
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link href="https://jessgusclark.github.io/gadget-material-icons/css/icons.css" rel="stylesheet" />
```
## Customizations
The code in [icons.css](icons.css) is additional code that is used for sizes and colors of the icons. It needs to be added to the page's CSS.
### Additional Sizes
To add additional sizes, add an additional style to the [icons.css](icons.css) file with the `font-size`. Then add an additional object in the [size.json](../gadget/dist/settings/size.json) file with the format below. the class name should match the class name in the [icons.css](icons.css) file.
```
{
"name" : "DisplayName",
"class" : "xl"
}
```
### Additional Colors
Same process as the sizes. Add colors to [icons.css](icons.css) then add an object to [colors.json](../gadget/dist/settings/colors.json) with the format below:
```
{
"name" : "DisplayColor",
"class" : "yellow"
}
``` |
This section contains css that should be liked to or added to your University's CSS file.
## Icon Font
Google provides the icons as a font. Instructions on how to install that are located [on their site](http://google.github.io/material-design-icons/).
At a bare minimum, add this:
```
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
+ <link href="https://jessgusclark.github.io/gadget-material-icons/css/icons.css" rel="stylesheet" />
```
## Customizations
The code in [icons.css](icons.css) is additional code that is used for sizes and colors of the icons. It needs to be added to the page's CSS.
### Additional Sizes
To add additional sizes, add an additional style to the [icons.css](icons.css) file with the `font-size`. Then add an additional object in the [size.json](../gadget/dist/settings/size.json) file with the format below. the class name should match the class name in the [icons.css](icons.css) file.
```
{
"name" : "DisplayName",
"class" : "xl"
}
```
### Additional Colors
Same process as the sizes. Add colors to [icons.css](icons.css) then add an object to [colors.json](../gadget/dist/settings/colors.json) with the format below:
```
{
"name" : "DisplayColor",
"class" : "yellow"
}
``` | 1 | 0.025641 | 1 | 0 |
71cf8c5bffd63a53d7272cb9bd3837862fa7467a | src/constants.js | src/constants.js | // render modes
export const NO_RENDER = { render: false };
export const SYNC_RENDER = { renderSync: true };
export const DOM_RENDER = { build: true };
export const EMPTY = {};
export const EMPTY_BASE = '';
// is this a DOM environment
export const HAS_DOM = typeof document!=='undefined';
export const TEXT_CONTENT = !HAS_DOM || 'textContent' in document ? 'textContent' : 'nodeValue';
export const ATTR_KEY = '__preactattr_';
export const UNDEFINED_ELEMENT = 'x-undefined-element';
// DOM properties that should NOT have "px" added when numeric
export const NON_DIMENSION_PROPS = {
boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,
flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,
opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1
};
| // render modes
export const NO_RENDER = { render: false };
export const SYNC_RENDER = { renderSync: true };
export const DOM_RENDER = { build: true };
export const EMPTY = {};
export const EMPTY_BASE = '';
// is this a DOM environment
export const HAS_DOM = typeof document!=='undefined';
export const TEXT_CONTENT = !HAS_DOM || 'textContent' in document ? 'textContent' : 'nodeValue';
export const ATTR_KEY = typeof Symbol!=='undefined' ? Symbol('preactattr') : '__preactattr_';
export const UNDEFINED_ELEMENT = 'x-undefined-element';
// DOM properties that should NOT have "px" added when numeric
export const NON_DIMENSION_PROPS = {
boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,
flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,
opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1
};
| Use a Symbol for storing the prop cache where available. | Use a Symbol for storing the prop cache where available.
| JavaScript | mit | neeharv/preact,developit/preact,developit/preact,gogoyqj/preact,neeharv/preact | javascript | ## Code Before:
// render modes
export const NO_RENDER = { render: false };
export const SYNC_RENDER = { renderSync: true };
export const DOM_RENDER = { build: true };
export const EMPTY = {};
export const EMPTY_BASE = '';
// is this a DOM environment
export const HAS_DOM = typeof document!=='undefined';
export const TEXT_CONTENT = !HAS_DOM || 'textContent' in document ? 'textContent' : 'nodeValue';
export const ATTR_KEY = '__preactattr_';
export const UNDEFINED_ELEMENT = 'x-undefined-element';
// DOM properties that should NOT have "px" added when numeric
export const NON_DIMENSION_PROPS = {
boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,
flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,
opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1
};
## Instruction:
Use a Symbol for storing the prop cache where available.
## Code After:
// render modes
export const NO_RENDER = { render: false };
export const SYNC_RENDER = { renderSync: true };
export const DOM_RENDER = { build: true };
export const EMPTY = {};
export const EMPTY_BASE = '';
// is this a DOM environment
export const HAS_DOM = typeof document!=='undefined';
export const TEXT_CONTENT = !HAS_DOM || 'textContent' in document ? 'textContent' : 'nodeValue';
export const ATTR_KEY = typeof Symbol!=='undefined' ? Symbol('preactattr') : '__preactattr_';
export const UNDEFINED_ELEMENT = 'x-undefined-element';
// DOM properties that should NOT have "px" added when numeric
export const NON_DIMENSION_PROPS = {
boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,
flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,
opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1
};
| // render modes
export const NO_RENDER = { render: false };
export const SYNC_RENDER = { renderSync: true };
export const DOM_RENDER = { build: true };
export const EMPTY = {};
export const EMPTY_BASE = '';
// is this a DOM environment
export const HAS_DOM = typeof document!=='undefined';
export const TEXT_CONTENT = !HAS_DOM || 'textContent' in document ? 'textContent' : 'nodeValue';
- export const ATTR_KEY = '__preactattr_';
+ export const ATTR_KEY = typeof Symbol!=='undefined' ? Symbol('preactattr') : '__preactattr_';
export const UNDEFINED_ELEMENT = 'x-undefined-element';
// DOM properties that should NOT have "px" added when numeric
export const NON_DIMENSION_PROPS = {
boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,
flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,
opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1
}; | 2 | 0.090909 | 1 | 1 |
996ed3e9977489df473230cadc3973ba24d0ea6d | tests/controllers/reverseControllerTests.js | tests/controllers/reverseControllerTests.js | describe("ReverseController", function () {
var fakeReverseFilter;
// See: https://docs.angularjs.org/api/ng/provider/$filterProvider
beforeEach(module("app.controllers", function ($filterProvider) {
console.log($filterProvider);
fakeReverseFilter = jasmine.createSpy("fakeReverseFilter");
$filterProvider.register("reverse", function () {
return fakeReverseFilter;
});
}));
beforeEach(inject(function ($controller) {
reverseController = $controller("ReverseController");
}));
describe("reverse() method", function () {
it("delegates to the reverse filter", function () {
var value = "reverse";
var expectedValue = "esrever";
fakeReverseFilter.and.returnValue(expectedValue);
var actualValue = reverseController.reverse(value);
expect(fakeReverseFilter).toHaveBeenCalledWith(value);
expect(actualValue).toBe(expectedValue);
});
});
}); | describe("ReverseController", function () {
var fakeReverseFilter;
// See: https://docs.angularjs.org/api/ng/provider/$filterProvider
beforeEach(module("app.controllers", function ($filterProvider) {
fakeReverseFilter = jasmine.createSpy("fakeReverseFilter");
$filterProvider.register("reverse", function () {
return fakeReverseFilter;
});
}));
beforeEach(inject(function ($controller) {
reverseController = $controller("ReverseController");
}));
describe("reverse() method", function () {
it("delegates to the reverse filter", function () {
var value = "reverse";
var expectedValue = "esrever";
fakeReverseFilter.and.returnValue(expectedValue);
var actualValue = reverseController.reverse(value);
expect(fakeReverseFilter).toHaveBeenCalledWith(value);
expect(actualValue).toBe(expectedValue);
});
});
}); | Add example of faking a filter | Add example of faking a filter
| JavaScript | mit | mariojvargas/angularjs-stringcalc,mariojvargas/angularjs-stringcalc | javascript | ## Code Before:
describe("ReverseController", function () {
var fakeReverseFilter;
// See: https://docs.angularjs.org/api/ng/provider/$filterProvider
beforeEach(module("app.controllers", function ($filterProvider) {
console.log($filterProvider);
fakeReverseFilter = jasmine.createSpy("fakeReverseFilter");
$filterProvider.register("reverse", function () {
return fakeReverseFilter;
});
}));
beforeEach(inject(function ($controller) {
reverseController = $controller("ReverseController");
}));
describe("reverse() method", function () {
it("delegates to the reverse filter", function () {
var value = "reverse";
var expectedValue = "esrever";
fakeReverseFilter.and.returnValue(expectedValue);
var actualValue = reverseController.reverse(value);
expect(fakeReverseFilter).toHaveBeenCalledWith(value);
expect(actualValue).toBe(expectedValue);
});
});
});
## Instruction:
Add example of faking a filter
## Code After:
describe("ReverseController", function () {
var fakeReverseFilter;
// See: https://docs.angularjs.org/api/ng/provider/$filterProvider
beforeEach(module("app.controllers", function ($filterProvider) {
fakeReverseFilter = jasmine.createSpy("fakeReverseFilter");
$filterProvider.register("reverse", function () {
return fakeReverseFilter;
});
}));
beforeEach(inject(function ($controller) {
reverseController = $controller("ReverseController");
}));
describe("reverse() method", function () {
it("delegates to the reverse filter", function () {
var value = "reverse";
var expectedValue = "esrever";
fakeReverseFilter.and.returnValue(expectedValue);
var actualValue = reverseController.reverse(value);
expect(fakeReverseFilter).toHaveBeenCalledWith(value);
expect(actualValue).toBe(expectedValue);
});
});
}); | describe("ReverseController", function () {
var fakeReverseFilter;
// See: https://docs.angularjs.org/api/ng/provider/$filterProvider
beforeEach(module("app.controllers", function ($filterProvider) {
- console.log($filterProvider);
fakeReverseFilter = jasmine.createSpy("fakeReverseFilter");
$filterProvider.register("reverse", function () {
return fakeReverseFilter;
});
}));
beforeEach(inject(function ($controller) {
reverseController = $controller("ReverseController");
}));
describe("reverse() method", function () {
it("delegates to the reverse filter", function () {
var value = "reverse";
var expectedValue = "esrever";
fakeReverseFilter.and.returnValue(expectedValue);
var actualValue = reverseController.reverse(value);
expect(fakeReverseFilter).toHaveBeenCalledWith(value);
expect(actualValue).toBe(expectedValue);
});
});
}); | 1 | 0.032258 | 0 | 1 |
a5130e32bffa1dbc4d83f349fc3653b690154d71 | vumi/workers/vas2nets/workers.py | vumi/workers/vas2nets/workers.py |
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(self):
"""called by the Worker class when the AMQP connections been established"""
self.publisher = yield self.publish_to('sms.outbound.%(transport_name)s' % self.config)
self.consumer = yield self.consume('sms.inbound.%(transport_name)s.%(shortcode)s' % self.config,
self.handle_inbound_message)
def handle_inbound_message(self, message):
log.msg("Received: %s" % (message.payload,))
"""Reply to the message with the same content"""
data = message.payload
reply = {
'to_msisdn': data['from_msisdn'],
'from_msisdn': data['to_msisdn'],
'message': data['message'],
'id': data['transport_message_id'],
'transport_network_id': data['transport_network_id'],
}
return self.publisher.publish_message(Message(**reply))
def stopWorker(self):
"""shutdown"""
pass
|
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(self):
"""called by the Worker class when the AMQP connections been established"""
self.publisher = yield self.publish_to('sms.outbound.%(transport_name)s' % self.config)
self.consumer = yield self.consume('sms.inbound.%(transport_name)s.%(shortcode)s' % self.config,
self.handle_inbound_message)
def handle_inbound_message(self, message):
log.msg("Received: %s" % (message.payload,))
"""Reply to the message with the same content"""
data = message.payload
reply = {
'to_msisdn': data['from_msisdn'],
'from_msisdn': data['to_msisdn'],
'message': data['message'],
'id': data['transport_message_id'],
'transport_network_id': data['transport_network_id'],
'transport_keyword': data['transport_keyword'],
}
return self.publisher.publish_message(Message(**reply))
def stopWorker(self):
"""shutdown"""
pass
| Add keyword to echo worker. | Add keyword to echo worker.
| Python | bsd-3-clause | TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi | python | ## Code Before:
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(self):
"""called by the Worker class when the AMQP connections been established"""
self.publisher = yield self.publish_to('sms.outbound.%(transport_name)s' % self.config)
self.consumer = yield self.consume('sms.inbound.%(transport_name)s.%(shortcode)s' % self.config,
self.handle_inbound_message)
def handle_inbound_message(self, message):
log.msg("Received: %s" % (message.payload,))
"""Reply to the message with the same content"""
data = message.payload
reply = {
'to_msisdn': data['from_msisdn'],
'from_msisdn': data['to_msisdn'],
'message': data['message'],
'id': data['transport_message_id'],
'transport_network_id': data['transport_network_id'],
}
return self.publisher.publish_message(Message(**reply))
def stopWorker(self):
"""shutdown"""
pass
## Instruction:
Add keyword to echo worker.
## Code After:
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(self):
"""called by the Worker class when the AMQP connections been established"""
self.publisher = yield self.publish_to('sms.outbound.%(transport_name)s' % self.config)
self.consumer = yield self.consume('sms.inbound.%(transport_name)s.%(shortcode)s' % self.config,
self.handle_inbound_message)
def handle_inbound_message(self, message):
log.msg("Received: %s" % (message.payload,))
"""Reply to the message with the same content"""
data = message.payload
reply = {
'to_msisdn': data['from_msisdn'],
'from_msisdn': data['to_msisdn'],
'message': data['message'],
'id': data['transport_message_id'],
'transport_network_id': data['transport_network_id'],
'transport_keyword': data['transport_keyword'],
}
return self.publisher.publish_message(Message(**reply))
def stopWorker(self):
"""shutdown"""
pass
|
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(self):
"""called by the Worker class when the AMQP connections been established"""
self.publisher = yield self.publish_to('sms.outbound.%(transport_name)s' % self.config)
self.consumer = yield self.consume('sms.inbound.%(transport_name)s.%(shortcode)s' % self.config,
self.handle_inbound_message)
def handle_inbound_message(self, message):
log.msg("Received: %s" % (message.payload,))
"""Reply to the message with the same content"""
data = message.payload
reply = {
'to_msisdn': data['from_msisdn'],
'from_msisdn': data['to_msisdn'],
'message': data['message'],
'id': data['transport_message_id'],
'transport_network_id': data['transport_network_id'],
+ 'transport_keyword': data['transport_keyword'],
}
return self.publisher.publish_message(Message(**reply))
def stopWorker(self):
"""shutdown"""
pass | 1 | 0.028571 | 1 | 0 |
c575404b12d3b3f7ce9906ae7b0edc243ccbe450 | src/helpers/expeditions.js | src/helpers/expeditions.js | import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.startsWith(group));
export function recentExpeditions(allWorkflows, classifications) {
const recent = classifications.map(c => c.links.workflow)
.filter((v, i, self) => self.indexOf(v) === i)
.map(id => {
const workflow = allWorkflows.find(w => w.id === id);
const expedition = findExpedition(workflow.display_name);
expedition.id = workflow.id;
expedition.active = workflow.active;
return expedition;
});
if (recent.length > RECENT_EXPEDITIONS_LENGTH) { recent.length = RECENT_EXPEDITIONS_LENGTH; }
return recent;
}
| import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.startsWith(group));
export function recentExpeditions(allWorkflows, classifications) {
const recent = classifications.map(c => c.links.workflow)
.filter((v, i, self) => self.indexOf(v) === i)
.map(id => {
const workflow = allWorkflows.find(w => w.id === id);
if (workflow) {
const expedition = findExpedition(workflow.display_name);
expedition.id = workflow.id;
expedition.active = workflow.active;
return expedition;
}
});
if (recent.length > RECENT_EXPEDITIONS_LENGTH) { recent.length = RECENT_EXPEDITIONS_LENGTH; }
return recent;
}
| Add another check for missing workflow | Add another check for missing workflow
| JavaScript | apache-2.0 | zooniverse/notes-from-nature-landing,zooniverse/notes-from-nature-landing | javascript | ## Code Before:
import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.startsWith(group));
export function recentExpeditions(allWorkflows, classifications) {
const recent = classifications.map(c => c.links.workflow)
.filter((v, i, self) => self.indexOf(v) === i)
.map(id => {
const workflow = allWorkflows.find(w => w.id === id);
const expedition = findExpedition(workflow.display_name);
expedition.id = workflow.id;
expedition.active = workflow.active;
return expedition;
});
if (recent.length > RECENT_EXPEDITIONS_LENGTH) { recent.length = RECENT_EXPEDITIONS_LENGTH; }
return recent;
}
## Instruction:
Add another check for missing workflow
## Code After:
import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.startsWith(group));
export function recentExpeditions(allWorkflows, classifications) {
const recent = classifications.map(c => c.links.workflow)
.filter((v, i, self) => self.indexOf(v) === i)
.map(id => {
const workflow = allWorkflows.find(w => w.id === id);
if (workflow) {
const expedition = findExpedition(workflow.display_name);
expedition.id = workflow.id;
expedition.active = workflow.active;
return expedition;
}
});
if (recent.length > RECENT_EXPEDITIONS_LENGTH) { recent.length = RECENT_EXPEDITIONS_LENGTH; }
return recent;
}
| import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.startsWith(group));
export function recentExpeditions(allWorkflows, classifications) {
const recent = classifications.map(c => c.links.workflow)
.filter((v, i, self) => self.indexOf(v) === i)
.map(id => {
const workflow = allWorkflows.find(w => w.id === id);
+ if (workflow) {
- const expedition = findExpedition(workflow.display_name);
+ const expedition = findExpedition(workflow.display_name);
? ++
- expedition.id = workflow.id;
+ expedition.id = workflow.id;
? ++
- expedition.active = workflow.active;
+ expedition.active = workflow.active;
? ++
- return expedition;
+ return expedition;
? ++
+ }
});
if (recent.length > RECENT_EXPEDITIONS_LENGTH) { recent.length = RECENT_EXPEDITIONS_LENGTH; }
return recent;
} | 10 | 0.416667 | 6 | 4 |
e352a60b3b0ea4d540eef8e11b2a348dd7fce44c | src/http/requestparser.cpp | src/http/requestparser.cpp |
std::vector<std::string> ApiMock::RequestParser::projectToCollection(std::string const& request) {
std::vector<std::string> fromRequest;
std::string::size_type pos = 0;
std::string::size_type prev = 0;
while ((pos = request.find('\n', prev)) != std::string::npos) {
fromRequest.push_back(request.substr(prev, pos - prev));
prev = pos + 1;
}
fromRequest.push_back(request.substr(prev));
return fromRequest;
}
ApiMock::RequestData ApiMock::RequestParser::parse(std::string const& requestBuffer) {
std::vector<std::string> entireRequest = projectToCollection(requestBuffer);
RequestData request;
return request;
} |
std::vector<std::string> ApiMock::RequestParser::projectToCollection(std::string const& request) {
const std::string CRLF = "\r\n";
std::vector<std::string> fromRequest;
std::string::size_type pos = 0;
std::string::size_type prev = 0;
while ((pos = request.find(CRLF, prev)) != std::string::npos) {
fromRequest.push_back(request.substr(prev, pos - prev));
prev = pos + 1;
}
fromRequest.push_back(request.substr(prev));
return fromRequest;
}
ApiMock::RequestData ApiMock::RequestParser::parse(std::string const& requestBuffer) {
std::vector<std::string> entireRequest = projectToCollection(requestBuffer);
RequestData request;
return request;
} | Use CRLF in requests instead of just LF | Use CRLF in requests instead of just LF
| C++ | mit | Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock | c++ | ## Code Before:
std::vector<std::string> ApiMock::RequestParser::projectToCollection(std::string const& request) {
std::vector<std::string> fromRequest;
std::string::size_type pos = 0;
std::string::size_type prev = 0;
while ((pos = request.find('\n', prev)) != std::string::npos) {
fromRequest.push_back(request.substr(prev, pos - prev));
prev = pos + 1;
}
fromRequest.push_back(request.substr(prev));
return fromRequest;
}
ApiMock::RequestData ApiMock::RequestParser::parse(std::string const& requestBuffer) {
std::vector<std::string> entireRequest = projectToCollection(requestBuffer);
RequestData request;
return request;
}
## Instruction:
Use CRLF in requests instead of just LF
## Code After:
std::vector<std::string> ApiMock::RequestParser::projectToCollection(std::string const& request) {
const std::string CRLF = "\r\n";
std::vector<std::string> fromRequest;
std::string::size_type pos = 0;
std::string::size_type prev = 0;
while ((pos = request.find(CRLF, prev)) != std::string::npos) {
fromRequest.push_back(request.substr(prev, pos - prev));
prev = pos + 1;
}
fromRequest.push_back(request.substr(prev));
return fromRequest;
}
ApiMock::RequestData ApiMock::RequestParser::parse(std::string const& requestBuffer) {
std::vector<std::string> entireRequest = projectToCollection(requestBuffer);
RequestData request;
return request;
} |
std::vector<std::string> ApiMock::RequestParser::projectToCollection(std::string const& request) {
+ const std::string CRLF = "\r\n";
std::vector<std::string> fromRequest;
std::string::size_type pos = 0;
std::string::size_type prev = 0;
- while ((pos = request.find('\n', prev)) != std::string::npos) {
? ^^^^
+ while ((pos = request.find(CRLF, prev)) != std::string::npos) {
? ^^^^
fromRequest.push_back(request.substr(prev, pos - prev));
prev = pos + 1;
}
fromRequest.push_back(request.substr(prev));
return fromRequest;
}
ApiMock::RequestData ApiMock::RequestParser::parse(std::string const& requestBuffer) {
std::vector<std::string> entireRequest = projectToCollection(requestBuffer);
RequestData request;
return request;
} | 3 | 0.142857 | 2 | 1 |
b76762f598615a6f6b383300c0495f9a492abd3e | app/models/constitution_proposal.rb | app/models/constitution_proposal.rb | class ConstitutionProposal < Proposal
def voting_system
organisation.constitution.voting_system(:membership)
end
def decision_notification_message
"If you have previously printed/saved a PDF copy of the member list, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest member list for your records."
end
end
| class ConstitutionProposal < Proposal
def voting_system
organisation.constitution.voting_system(:constitution)
end
def decision_notification_message
"If you have previously printed/saved a PDF copy of the constitution, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest constitution for your records."
end
end
| Fix poor copy-and-paste skills in setting up new ConstitutionProposal class. | Fix poor copy-and-paste skills in setting up new ConstitutionProposal class.
| Ruby | agpl-3.0 | oneclickorgs/one-click-orgs,oneclickorgs/one-click-orgs-deployment,oneclickorgs/one-click-orgs-deployment,oneclickorgs/one-click-orgs-deployment,oneclickorgs/one-click-orgs,oneclickorgs/one-click-orgs,oneclickorgs/one-click-orgs | ruby | ## Code Before:
class ConstitutionProposal < Proposal
def voting_system
organisation.constitution.voting_system(:membership)
end
def decision_notification_message
"If you have previously printed/saved a PDF copy of the member list, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest member list for your records."
end
end
## Instruction:
Fix poor copy-and-paste skills in setting up new ConstitutionProposal class.
## Code After:
class ConstitutionProposal < Proposal
def voting_system
organisation.constitution.voting_system(:constitution)
end
def decision_notification_message
"If you have previously printed/saved a PDF copy of the constitution, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest constitution for your records."
end
end
| class ConstitutionProposal < Proposal
def voting_system
- organisation.constitution.voting_system(:membership)
? ^^^^^^ ^ ^
+ organisation.constitution.voting_system(:constitution)
? ^^^ ^ ^^^^^^
end
def decision_notification_message
- "If you have previously printed/saved a PDF copy of the member list, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest member list for your records."
? ^^^^^^^^^ ^^^^^^^^^
+ "If you have previously printed/saved a PDF copy of the constitution, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest constitution for your records."
? ^^^ +++++++ ^^^ +++++++
end
end | 4 | 0.444444 | 2 | 2 |
603cfbe46f99949f2dd17984772d73c211463d04 | example/src/main/java/io/github/jakriz/derrick/example/DocsMethods.java | example/src/main/java/io/github/jakriz/derrick/example/DocsMethods.java | package io.github.jakriz.derrick.example;
import io.github.jakriz.derrick.annotation.DerrickInterface;
import io.github.jakriz.derrick.annotation.SourceFrom;
@DerrickInterface(baseUrl = "https://github.com/jakriz/derrick", imports = {"io.github.jakriz.derrick.example.*"})
public interface DocsMethods {
@SourceFrom(selector = "#sample-math-wizard-add", addReturn = true)
int add(MathWizard mathWizard);
}
| package io.github.jakriz.derrick.example;
import io.github.jakriz.derrick.annotation.DerrickInterface;
import io.github.jakriz.derrick.annotation.SourceFrom;
@DerrickInterface(baseUrl = "https://github.com/jakriz/derrick", imports = {"io.github.jakriz.derrick.example.*"})
public interface DocsMethods {
@SourceFrom(selector = "#user-content-sample-math-wizard-add", addReturn = true)
int add(MathWizard mathWizard);
}
| Change example id to fit github's naming | Change example id to fit github's naming
| Java | mit | jakriz/derrick,jakriz/derrick | java | ## Code Before:
package io.github.jakriz.derrick.example;
import io.github.jakriz.derrick.annotation.DerrickInterface;
import io.github.jakriz.derrick.annotation.SourceFrom;
@DerrickInterface(baseUrl = "https://github.com/jakriz/derrick", imports = {"io.github.jakriz.derrick.example.*"})
public interface DocsMethods {
@SourceFrom(selector = "#sample-math-wizard-add", addReturn = true)
int add(MathWizard mathWizard);
}
## Instruction:
Change example id to fit github's naming
## Code After:
package io.github.jakriz.derrick.example;
import io.github.jakriz.derrick.annotation.DerrickInterface;
import io.github.jakriz.derrick.annotation.SourceFrom;
@DerrickInterface(baseUrl = "https://github.com/jakriz/derrick", imports = {"io.github.jakriz.derrick.example.*"})
public interface DocsMethods {
@SourceFrom(selector = "#user-content-sample-math-wizard-add", addReturn = true)
int add(MathWizard mathWizard);
}
| package io.github.jakriz.derrick.example;
import io.github.jakriz.derrick.annotation.DerrickInterface;
import io.github.jakriz.derrick.annotation.SourceFrom;
@DerrickInterface(baseUrl = "https://github.com/jakriz/derrick", imports = {"io.github.jakriz.derrick.example.*"})
public interface DocsMethods {
- @SourceFrom(selector = "#sample-math-wizard-add", addReturn = true)
+ @SourceFrom(selector = "#user-content-sample-math-wizard-add", addReturn = true)
? +++++++++++++
int add(MathWizard mathWizard);
} | 2 | 0.166667 | 1 | 1 |
85c2f6da8e0606f972111b897752c9655b951777 | bin/generate-buffers.sh | bin/generate-buffers.sh | protoc -I=./api/pokemon --go_out=./api/pokemon ./api/pokemon/pokemon.proto | protoc -I=./api/pokemon --go_out=plugins=grpc:./api/pokemon ./api/pokemon/pokemon.proto | Use the grpc plugin for protobuf generation | Use the grpc plugin for protobuf generation
| Shell | mit | atuleu/pogo | shell | ## Code Before:
protoc -I=./api/pokemon --go_out=./api/pokemon ./api/pokemon/pokemon.proto
## Instruction:
Use the grpc plugin for protobuf generation
## Code After:
protoc -I=./api/pokemon --go_out=plugins=grpc:./api/pokemon ./api/pokemon/pokemon.proto | - protoc -I=./api/pokemon --go_out=./api/pokemon ./api/pokemon/pokemon.proto
+ protoc -I=./api/pokemon --go_out=plugins=grpc:./api/pokemon ./api/pokemon/pokemon.proto
? +++++++++++++
| 2 | 2 | 1 | 1 |
b326646fe5822cd2a3cfcb09ddd161e8401a9ace | .github/workflows/spectesting.yml | .github/workflows/spectesting.yml | on:
push:
branches:
- 'spec-test-*'
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
jobs:
spec-tests:
if: github.repository == 'hashicorp/vagrant'
runs-on: self-hosted
strategy:
matrix:
host_os: ["hashicorp/bionic64"]
guest_os: ["hashicorp/bionic64", "hashicorp-vagrant/ubuntu-16.04"]
name: Vagrant-Spec Tests
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: vagrant-spec Code Checkout and Build
working-directory: ${{github.workspace}}
run: .ci/spec/build-vagrant-spec.sh
- name: Run Tests
run: .ci/spec/run-test.sh
working-directory: ${{github.workspace}}
env:
VAGRANT_HOST_BOXES: ${{ matrix.host_os }}
VAGRANT_GUEST_BOXES: ${{ matrix.guest_os }}
- name: Clean Workspace
if: always()
run: rm -rf ${{ github.workspace }}
| on:
push:
branches:
- 'spec-test-*'
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
jobs:
spec-tests:
if: github.repository == 'hashicorp/vagrant'
runs-on: self-hosted
strategy:
matrix:
host_os: ["hashicorp/bionic64"]
guest_os: ["hashicorp/bionic64", "hashicorp-vagrant/ubuntu-16.04"]
name: Vagrant-Spec Tests
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: vagrant-spec Code Checkout and Build
working-directory: ${{github.workspace}}
run: .ci/spec/build-vagrant-spec.sh
- name: Run Tests on ${{ matrix.host_os }} with guest ${{ matrix.guest_os }}
run: .ci/spec/run-test.sh
working-directory: ${{github.workspace}}
env:
VAGRANT_HOST_BOXES: ${{ matrix.host_os }}
VAGRANT_GUEST_BOXES: ${{ matrix.guest_os }}
- name: Clean Workspace
if: always()
run: rm -rf ${{ github.workspace }}
| Add more descriptive title to job | Add more descriptive title to job
| YAML | mit | sni/vagrant,mitchellh/vagrant,marxarelli/vagrant,chrisroberts/vagrant,mitchellh/vagrant,marxarelli/vagrant,chrisroberts/vagrant,marxarelli/vagrant,sni/vagrant,mitchellh/vagrant,sni/vagrant,marxarelli/vagrant,chrisroberts/vagrant,sni/vagrant,chrisroberts/vagrant,mitchellh/vagrant | yaml | ## Code Before:
on:
push:
branches:
- 'spec-test-*'
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
jobs:
spec-tests:
if: github.repository == 'hashicorp/vagrant'
runs-on: self-hosted
strategy:
matrix:
host_os: ["hashicorp/bionic64"]
guest_os: ["hashicorp/bionic64", "hashicorp-vagrant/ubuntu-16.04"]
name: Vagrant-Spec Tests
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: vagrant-spec Code Checkout and Build
working-directory: ${{github.workspace}}
run: .ci/spec/build-vagrant-spec.sh
- name: Run Tests
run: .ci/spec/run-test.sh
working-directory: ${{github.workspace}}
env:
VAGRANT_HOST_BOXES: ${{ matrix.host_os }}
VAGRANT_GUEST_BOXES: ${{ matrix.guest_os }}
- name: Clean Workspace
if: always()
run: rm -rf ${{ github.workspace }}
## Instruction:
Add more descriptive title to job
## Code After:
on:
push:
branches:
- 'spec-test-*'
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
jobs:
spec-tests:
if: github.repository == 'hashicorp/vagrant'
runs-on: self-hosted
strategy:
matrix:
host_os: ["hashicorp/bionic64"]
guest_os: ["hashicorp/bionic64", "hashicorp-vagrant/ubuntu-16.04"]
name: Vagrant-Spec Tests
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: vagrant-spec Code Checkout and Build
working-directory: ${{github.workspace}}
run: .ci/spec/build-vagrant-spec.sh
- name: Run Tests on ${{ matrix.host_os }} with guest ${{ matrix.guest_os }}
run: .ci/spec/run-test.sh
working-directory: ${{github.workspace}}
env:
VAGRANT_HOST_BOXES: ${{ matrix.host_os }}
VAGRANT_GUEST_BOXES: ${{ matrix.guest_os }}
- name: Clean Workspace
if: always()
run: rm -rf ${{ github.workspace }}
| on:
push:
branches:
- 'spec-test-*'
paths-ignore:
- 'CHANGELOG.md'
- 'website/**'
jobs:
spec-tests:
if: github.repository == 'hashicorp/vagrant'
runs-on: self-hosted
strategy:
matrix:
host_os: ["hashicorp/bionic64"]
guest_os: ["hashicorp/bionic64", "hashicorp-vagrant/ubuntu-16.04"]
name: Vagrant-Spec Tests
steps:
- name: Code Checkout
uses: actions/checkout@v1
- name: vagrant-spec Code Checkout and Build
working-directory: ${{github.workspace}}
run: .ci/spec/build-vagrant-spec.sh
- - name: Run Tests
+ - name: Run Tests on ${{ matrix.host_os }} with guest ${{ matrix.guest_os }}
run: .ci/spec/run-test.sh
working-directory: ${{github.workspace}}
env:
VAGRANT_HOST_BOXES: ${{ matrix.host_os }}
VAGRANT_GUEST_BOXES: ${{ matrix.guest_os }}
- name: Clean Workspace
if: always()
run: rm -rf ${{ github.workspace }} | 2 | 0.0625 | 1 | 1 |
1d235af2e226fd2f8ab8fd1f869eba217e4751df | SCAPI/js/soundcloud.js | SCAPI/js/soundcloud.js |
$(function () {
SC.initialize({client_id: '28b05a26f8f8bec9d27bea7c938337ff'});
getTracks();
var timer = setInterval(getTracks, 10000);
})
function getTracks() {
$('ul').html('');
SC.get('/tracks')
.then(function (response) {
response.forEach(function (track) {
$('ul').append('<li>' + track.created_at + ' - <a data-id="' + track.id + '" href="#">' + track.title + '</a></li>');
});
$('li a').on('click', function () {
loadTrack($(this).attr('data-id'));
});
});
}
function loadTrack(track) {
console.log('Track loaded:' + track);
var stream;
SC.stream('/tracks/' + track).then(function(player){
stream = player;
stream.play();
});
return stream;
}
|
$(function () {
SC.initialize({client_id: '28b05a26f8f8bec9d27bea7c938337ff'});
getTracks();
var timer = setInterval(getTracks, 100000);
})
function getTracks() {
$('ul').html('');
SC.get('/tracks')
.then(function (response) {
console.log(response);
response.forEach(function (track) {
$('ul').append('<li>' + track.created_at + ' - <a data-id="' + track.id + '" href="#">' + track.title + '</a></li>');
});
$('li a').on('click', function () {
loadTrack($(this).attr('data-id'));
});
console.log(response[0].artwork_url);
// $('.art-display').css('background-image', 'url(' + response[0].artwork_url + ')');
});
}
function loadTrack(trackId) {
var stream;
SC.get('/tracks/' + trackId).then(function (resource) {
if (resource.artwork_url) {
$('.art-display').css('background-image', 'url(' + resource.artwork_url + ')');
}
});
// console.log(SC.get('/tracks/' + trackId + '/artwork_url'));
SC.stream('/tracks/' + trackId).then(function(player){
stream = player;
stream.play();
});
console.log('Track loaded:' + trackId);
return stream;
}
| Add ability to load album art | Add ability to load album art
| JavaScript | mit | Smona/vrtest,Smona/vrtest | javascript | ## Code Before:
$(function () {
SC.initialize({client_id: '28b05a26f8f8bec9d27bea7c938337ff'});
getTracks();
var timer = setInterval(getTracks, 10000);
})
function getTracks() {
$('ul').html('');
SC.get('/tracks')
.then(function (response) {
response.forEach(function (track) {
$('ul').append('<li>' + track.created_at + ' - <a data-id="' + track.id + '" href="#">' + track.title + '</a></li>');
});
$('li a').on('click', function () {
loadTrack($(this).attr('data-id'));
});
});
}
function loadTrack(track) {
console.log('Track loaded:' + track);
var stream;
SC.stream('/tracks/' + track).then(function(player){
stream = player;
stream.play();
});
return stream;
}
## Instruction:
Add ability to load album art
## Code After:
$(function () {
SC.initialize({client_id: '28b05a26f8f8bec9d27bea7c938337ff'});
getTracks();
var timer = setInterval(getTracks, 100000);
})
function getTracks() {
$('ul').html('');
SC.get('/tracks')
.then(function (response) {
console.log(response);
response.forEach(function (track) {
$('ul').append('<li>' + track.created_at + ' - <a data-id="' + track.id + '" href="#">' + track.title + '</a></li>');
});
$('li a').on('click', function () {
loadTrack($(this).attr('data-id'));
});
console.log(response[0].artwork_url);
// $('.art-display').css('background-image', 'url(' + response[0].artwork_url + ')');
});
}
function loadTrack(trackId) {
var stream;
SC.get('/tracks/' + trackId).then(function (resource) {
if (resource.artwork_url) {
$('.art-display').css('background-image', 'url(' + resource.artwork_url + ')');
}
});
// console.log(SC.get('/tracks/' + trackId + '/artwork_url'));
SC.stream('/tracks/' + trackId).then(function(player){
stream = player;
stream.play();
});
console.log('Track loaded:' + trackId);
return stream;
}
|
$(function () {
SC.initialize({client_id: '28b05a26f8f8bec9d27bea7c938337ff'});
getTracks();
- var timer = setInterval(getTracks, 10000);
+ var timer = setInterval(getTracks, 100000);
? +
})
function getTracks() {
$('ul').html('');
SC.get('/tracks')
.then(function (response) {
+ console.log(response);
response.forEach(function (track) {
$('ul').append('<li>' + track.created_at + ' - <a data-id="' + track.id + '" href="#">' + track.title + '</a></li>');
});
$('li a').on('click', function () {
loadTrack($(this).attr('data-id'));
});
+ console.log(response[0].artwork_url);
+ // $('.art-display').css('background-image', 'url(' + response[0].artwork_url + ')');
});
}
- function loadTrack(track) {
+ function loadTrack(trackId) {
? ++
- console.log('Track loaded:' + track);
var stream;
+ SC.get('/tracks/' + trackId).then(function (resource) {
+ if (resource.artwork_url) {
+ $('.art-display').css('background-image', 'url(' + resource.artwork_url + ')');
+ }
+ });
+ // console.log(SC.get('/tracks/' + trackId + '/artwork_url'));
- SC.stream('/tracks/' + track).then(function(player){
+ SC.stream('/tracks/' + trackId).then(function(player){
? ++
stream = player;
stream.play();
});
+ console.log('Track loaded:' + trackId);
return stream;
} | 17 | 0.586207 | 13 | 4 |
00d71f62169b2739b43715670e3d83eb0205e4cc | cmake/today.cmake | cmake/today.cmake | MACRO (TODAY RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C date +%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
if (DEFINED ENV{SOURCE_DATE_EPOCH})
EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
else ()
EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
endif ()
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 000000)
ENDIF (WIN32)
ENDMACRO (TODAY)
| MACRO (TODAY RESULT)
if (DEFINED ENV{SOURCE_DATE_EPOCH} AND NOT WIN32)
EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d"
OUTPUT_VARIABLE ${RESULT} OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
STRING(TIMESTAMP ${RESULT} "%Y-%m-%d" UTC)
endif()
ENDMACRO (TODAY)
| Use CMake TIMESTAMP, remove newline from TODAY | Use CMake TIMESTAMP, remove newline from TODAY
| CMake | apache-2.0 | nfedera/FreeRDP,awakecoding/FreeRDP,chipitsine/FreeRDP,ilammy/FreeRDP,cedrozor/FreeRDP,rjcorrig/FreeRDP,nfedera/FreeRDP,akallabeth/FreeRDP,cloudbase/FreeRDP-dev,yurashek/FreeRDP,yurashek/FreeRDP,nanxiongchao/FreeRDP,nanxiongchao/FreeRDP,cloudbase/FreeRDP-dev,FreeRDP/FreeRDP,yurashek/FreeRDP,DavBfr/FreeRDP,oshogbo/FreeRDP,eledoux/FreeRDP,DavBfr/FreeRDP,erbth/FreeRDP,Devolutions/FreeRDP,oshogbo/FreeRDP,Devolutions/FreeRDP,yurashek/FreeRDP,yurashek/FreeRDP,rjcorrig/FreeRDP,awakecoding/FreeRDP,bmiklautz/FreeRDP,bjcollins/FreeRDP,ivan-83/FreeRDP,erbth/FreeRDP,mfleisz/FreeRDP,FreeRDP/FreeRDP,awakecoding/FreeRDP,bmiklautz/FreeRDP,rjcorrig/FreeRDP,cloudbase/FreeRDP-dev,FreeRDP/FreeRDP,FreeRDP/FreeRDP,ivan-83/FreeRDP,ilammy/FreeRDP,cloudbase/FreeRDP-dev,ondrejholy/FreeRDP,chipitsine/FreeRDP,nanxiongchao/FreeRDP,akallabeth/FreeRDP,mfleisz/FreeRDP,chipitsine/FreeRDP,nfedera/FreeRDP,bjcollins/FreeRDP,akallabeth/FreeRDP,eledoux/FreeRDP,eledoux/FreeRDP,FreeRDP/FreeRDP,mfleisz/FreeRDP,bmiklautz/FreeRDP,bjcollins/FreeRDP,ondrejholy/FreeRDP,DavBfr/FreeRDP,RangeeGmbH/FreeRDP,oshogbo/FreeRDP,FreeRDP/FreeRDP,ilammy/FreeRDP,cloudbase/FreeRDP-dev,chipitsine/FreeRDP,oshogbo/FreeRDP,ivan-83/FreeRDP,cedrozor/FreeRDP,bjcollins/FreeRDP,mfleisz/FreeRDP,cedrozor/FreeRDP,nfedera/FreeRDP,bjcollins/FreeRDP,ondrejholy/FreeRDP,bjcollins/FreeRDP,bmiklautz/FreeRDP,nanxiongchao/FreeRDP,ondrejholy/FreeRDP,nanxiongchao/FreeRDP,akallabeth/FreeRDP,Devolutions/FreeRDP,oshogbo/FreeRDP,akallabeth/FreeRDP,rjcorrig/FreeRDP,cloudbase/FreeRDP-dev,chipitsine/FreeRDP,awakecoding/FreeRDP,bmiklautz/FreeRDP,nfedera/FreeRDP,cedrozor/FreeRDP,yurashek/FreeRDP,yurashek/FreeRDP,eledoux/FreeRDP,RangeeGmbH/FreeRDP,Devolutions/FreeRDP,awakecoding/FreeRDP,ondrejholy/FreeRDP,rjcorrig/FreeRDP,RangeeGmbH/FreeRDP,FreeRDP/FreeRDP,ondrejholy/FreeRDP,DavBfr/FreeRDP,RangeeGmbH/FreeRDP,ilammy/FreeRDP,Devolutions/FreeRDP,chipitsine/FreeRDP,awakecoding/FreeRDP,RangeeGmbH/FreeRDP,Devolutions/FreeRDP,yurashek/FreeRDP,ilammy/FreeRDP,ilammy/FreeRDP,nfedera/FreeRDP,bjcollins/FreeRDP,akallabeth/FreeRDP,awakecoding/FreeRDP,oshogbo/FreeRDP,cedrozor/FreeRDP,awakecoding/FreeRDP,ivan-83/FreeRDP,eledoux/FreeRDP,cedrozor/FreeRDP,DavBfr/FreeRDP,eledoux/FreeRDP,erbth/FreeRDP,erbth/FreeRDP,erbth/FreeRDP,ivan-83/FreeRDP,Devolutions/FreeRDP,oshogbo/FreeRDP,nanxiongchao/FreeRDP,ivan-83/FreeRDP,rjcorrig/FreeRDP,cloudbase/FreeRDP-dev,erbth/FreeRDP,eledoux/FreeRDP,DavBfr/FreeRDP,ilammy/FreeRDP,RangeeGmbH/FreeRDP,mfleisz/FreeRDP,rjcorrig/FreeRDP,nanxiongchao/FreeRDP,RangeeGmbH/FreeRDP,cedrozor/FreeRDP,rjcorrig/FreeRDP,oshogbo/FreeRDP,DavBfr/FreeRDP,nfedera/FreeRDP,chipitsine/FreeRDP,erbth/FreeRDP,ivan-83/FreeRDP,bmiklautz/FreeRDP,mfleisz/FreeRDP,bmiklautz/FreeRDP,akallabeth/FreeRDP,ivan-83/FreeRDP,nfedera/FreeRDP,ondrejholy/FreeRDP,chipitsine/FreeRDP,mfleisz/FreeRDP,nanxiongchao/FreeRDP,bmiklautz/FreeRDP,akallabeth/FreeRDP,RangeeGmbH/FreeRDP,bjcollins/FreeRDP,FreeRDP/FreeRDP,erbth/FreeRDP,cedrozor/FreeRDP,Devolutions/FreeRDP,eledoux/FreeRDP,ilammy/FreeRDP,ondrejholy/FreeRDP,mfleisz/FreeRDP,DavBfr/FreeRDP | cmake | ## Code Before:
MACRO (TODAY RESULT)
IF (WIN32)
EXECUTE_PROCESS(COMMAND "cmd" " /C date +%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
ELSEIF(UNIX)
if (DEFINED ENV{SOURCE_DATE_EPOCH})
EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
else ()
EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
endif ()
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 000000)
ENDIF (WIN32)
ENDMACRO (TODAY)
## Instruction:
Use CMake TIMESTAMP, remove newline from TODAY
## Code After:
MACRO (TODAY RESULT)
if (DEFINED ENV{SOURCE_DATE_EPOCH} AND NOT WIN32)
EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d"
OUTPUT_VARIABLE ${RESULT} OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
STRING(TIMESTAMP ${RESULT} "%Y-%m-%d" UTC)
endif()
ENDMACRO (TODAY)
| MACRO (TODAY RESULT)
- IF (WIN32)
- EXECUTE_PROCESS(COMMAND "cmd" " /C date +%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
- string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
- ELSEIF(UNIX)
- if (DEFINED ENV{SOURCE_DATE_EPOCH})
? ----
+ if (DEFINED ENV{SOURCE_DATE_EPOCH} AND NOT WIN32)
? ++++++++++++++
- EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
? ---- ---------------------------
+ EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d"
+ OUTPUT_VARIABLE ${RESULT} OUTPUT_STRIP_TRAILING_WHITESPACE)
- else ()
? ---- -
+ else()
- EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
+ STRING(TIMESTAMP ${RESULT} "%Y-%m-%d" UTC)
- endif ()
? ---- -
+ endif()
- string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
- ELSE (WIN32)
- MESSAGE(SEND_ERROR "date not implemented")
- SET(${RESULT} 000000)
- ENDIF (WIN32)
ENDMACRO (TODAY) | 20 | 1.25 | 6 | 14 |
0219a48b7dcde94d133c6bbdd904d1e417583a9a | lib/urlmaker.js | lib/urlmaker.js | // urlmaker.js
//
// URLs just like Mama used to make
//
// Copyright 2011-2012, E14N https://e14n.com/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var url = require("url"),
querystring = require("querystring");
var URLMaker = {
hostname: null,
port: 80,
makeURL: function(relative, params) {
var obj = {
protocol: (this.port === 443) ? "https:" : "http:",
hostname: this.hostname,
pathname: relative
};
if (!this.hostname) {
throw new Error("No hostname");
}
if (this.port !== 80 && this.port !== 443) {
obj.port = this.port;
}
if (params) {
obj.search = querystring.stringify(params);
}
return url.format(obj);
}
};
exports.URLMaker = URLMaker;
| // urlmaker.js
//
// URLs just like Mama used to make
//
// Copyright 2011-2012, E14N https://e14n.com/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var url = require("url"),
querystring = require("querystring");
var URLMaker = {
hostname: null,
port: 80,
path: null,
makeURL: function(relative, params) {
var obj = {
protocol: (this.port === 443) ? "https:" : "http:",
hostname: this.hostname,
pathname: (this.path) ? this.path + "/" + relative : relative
};
if (!this.hostname) {
throw new Error("No hostname");
}
if (this.port !== 80 && this.port !== 443) {
obj.port = this.port;
}
if (params) {
obj.search = querystring.stringify(params);
}
return url.format(obj);
}
};
exports.URLMaker = URLMaker;
| Allow a path prefix in URLMaker | Allow a path prefix in URLMaker
| JavaScript | apache-2.0 | e14n/pump.io,stephensekula/pump.io,pump-io/pump.io,gabrielsr/pump.io,stephensekula/pump.io,profOnno/pump.io,e14n/pump.io,detrout/pump.io,landsurveyorsunited/pump.io,Acidburn0zzz/pump.io,e14n/pump.io,strugee/pump.io,stephensekula/pump.io,pump-io/pump.io,profOnno/pump.io,gabrielsr/pump.io,detrout/pump.io,OpenSocial/pump.io,pump-io/pump.io,strugee/pump.io,landsurveyorsunited/pump.io,Acidburn0zzz/pump.io,OpenSocial/pump.io | javascript | ## Code Before:
// urlmaker.js
//
// URLs just like Mama used to make
//
// Copyright 2011-2012, E14N https://e14n.com/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var url = require("url"),
querystring = require("querystring");
var URLMaker = {
hostname: null,
port: 80,
makeURL: function(relative, params) {
var obj = {
protocol: (this.port === 443) ? "https:" : "http:",
hostname: this.hostname,
pathname: relative
};
if (!this.hostname) {
throw new Error("No hostname");
}
if (this.port !== 80 && this.port !== 443) {
obj.port = this.port;
}
if (params) {
obj.search = querystring.stringify(params);
}
return url.format(obj);
}
};
exports.URLMaker = URLMaker;
## Instruction:
Allow a path prefix in URLMaker
## Code After:
// urlmaker.js
//
// URLs just like Mama used to make
//
// Copyright 2011-2012, E14N https://e14n.com/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var url = require("url"),
querystring = require("querystring");
var URLMaker = {
hostname: null,
port: 80,
path: null,
makeURL: function(relative, params) {
var obj = {
protocol: (this.port === 443) ? "https:" : "http:",
hostname: this.hostname,
pathname: (this.path) ? this.path + "/" + relative : relative
};
if (!this.hostname) {
throw new Error("No hostname");
}
if (this.port !== 80 && this.port !== 443) {
obj.port = this.port;
}
if (params) {
obj.search = querystring.stringify(params);
}
return url.format(obj);
}
};
exports.URLMaker = URLMaker;
| // urlmaker.js
//
// URLs just like Mama used to make
//
// Copyright 2011-2012, E14N https://e14n.com/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var url = require("url"),
querystring = require("querystring");
var URLMaker = {
hostname: null,
port: 80,
+ path: null,
makeURL: function(relative, params) {
var obj = {
protocol: (this.port === 443) ? "https:" : "http:",
hostname: this.hostname,
- pathname: relative
+ pathname: (this.path) ? this.path + "/" + relative : relative
};
if (!this.hostname) {
throw new Error("No hostname");
}
if (this.port !== 80 && this.port !== 443) {
obj.port = this.port;
}
if (params) {
obj.search = querystring.stringify(params);
}
return url.format(obj);
}
};
exports.URLMaker = URLMaker;
| 3 | 0.066667 | 2 | 1 |
7320481fde8cee5faf8bc8e2cc9fb5ce09533405 | update.sh | update.sh |
(cd ~/Dotfiles && git checkout master && git pull origin master) > /dev/null 2>&1 && echo "Updated" || echo "Update failed"
echo "Type 'reload' to reload updates"
echo "You may need to logout of the terminal and login for changes to take full effect"
|
(cd ~/Dotfiles \
&& git checkout master \
&& git pull origin master) && echo "Updated" || echo "Update failed"
echo "Type 'reload' to reload updates"
echo "You may need to logout of the terminal and login for changes to take full effect"
which brew > /dev/null 2>&1 && brew bundle check
| Check for brew dependencies when updating | Check for brew dependencies when updating
The "which" guard ensures that systems without brew don't try to run
brew, like a Linux server
Part of #32
| Shell | mit | benknoble/Dotfiles,benknoble/Dotfiles,benknoble/Dotfiles,benknoble/Dotfiles,benknoble/Dotfiles | shell | ## Code Before:
(cd ~/Dotfiles && git checkout master && git pull origin master) > /dev/null 2>&1 && echo "Updated" || echo "Update failed"
echo "Type 'reload' to reload updates"
echo "You may need to logout of the terminal and login for changes to take full effect"
## Instruction:
Check for brew dependencies when updating
The "which" guard ensures that systems without brew don't try to run
brew, like a Linux server
Part of #32
## Code After:
(cd ~/Dotfiles \
&& git checkout master \
&& git pull origin master) && echo "Updated" || echo "Update failed"
echo "Type 'reload' to reload updates"
echo "You may need to logout of the terminal and login for changes to take full effect"
which brew > /dev/null 2>&1 && brew bundle check
|
- (cd ~/Dotfiles && git checkout master && git pull origin master) > /dev/null 2>&1 && echo "Updated" || echo "Update failed"
+ (cd ~/Dotfiles \
+ && git checkout master \
+ && git pull origin master) && echo "Updated" || echo "Update failed"
echo "Type 'reload' to reload updates"
echo "You may need to logout of the terminal and login for changes to take full effect"
+ which brew > /dev/null 2>&1 && brew bundle check | 5 | 1.25 | 4 | 1 |
80dfd1af393acd0e34a920bf9d25e2c5015ceb24 | modules/fluentd/spec/source_journald/spec.rb | modules/fluentd/spec/source_journald/spec.rb | require 'spec_helper'
describe 'fluentd:source-journald' do
describe service('fluentd') do
it { should be_running }
end
describe file('/var/lib/fluentd/journald_pos_systemd') do
it { should be_directory }
end
describe command('logger -p local0.error foo') do
its(:exit_status) { should eq 0 }
end
# see http://docs.fluentd.org/v0.14/articles/signals#sigusr1
describe command('sudo pkill -SIGUSR1 fluentd') do
its(:exit_status) { should eq 0 }
end
describe command('timeout --signal=9 3 bash -c "while ! (grep -e message...foo /tmp/dump/*.log | grep -v grep); do sleep 0.5; done"') do
its(:exit_status) { should eq 0 }
its(:stdout) do
is_expected.to include_json(
level: 'error',
message: 'foo',
journal: {
transport: 'syslog',
unit: 'ssh.service',
uid: '0',
})
end
end
end
| require 'spec_helper'
describe 'fluentd:source-journald' do
describe service('fluentd') do
it { should be_running }
end
describe file('/var/lib/fluentd/journald_pos_systemd') do
it { should be_directory }
end
describe command('logger -p local0.error foo') do
its(:exit_status) { should eq 0 }
end
# see http://docs.fluentd.org/v0.14/articles/signals#sigusr1
describe command('sudo pkill -SIGUSR1 fluentd') do
its(:exit_status) { should eq 0 }
end
describe command('timeout --signal=9 3 bash -c "while ! (grep -e message...foo /tmp/dump/*.log | grep -v grep); do sleep 0.5; done"') do
its(:exit_status) { should eq 0 }
its(:stdout) do
is_expected.to include_json(
level: 'error',
message: 'foo',
timestamp: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}[+-]\d{2}:\d{2}$/,
journal: {
transport: 'syslog',
unit: /.+/,
uid: /\d+/,
pid: /\d+/,
})
end
end
end
| Use regex for fluentd:source-journald json checks | Use regex for fluentd:source-journald json checks
| Ruby | mit | cargomedia/puppet-packages,njam/puppet-packages,njam/puppet-packages,njam/puppet-packages,cargomedia/puppet-packages,cargomedia/puppet-packages,ppp0/puppet-packages,ppp0/puppet-packages,ppp0/puppet-packages,njam/puppet-packages,ppp0/puppet-packages,ppp0/puppet-packages,njam/puppet-packages,cargomedia/puppet-packages,cargomedia/puppet-packages | ruby | ## Code Before:
require 'spec_helper'
describe 'fluentd:source-journald' do
describe service('fluentd') do
it { should be_running }
end
describe file('/var/lib/fluentd/journald_pos_systemd') do
it { should be_directory }
end
describe command('logger -p local0.error foo') do
its(:exit_status) { should eq 0 }
end
# see http://docs.fluentd.org/v0.14/articles/signals#sigusr1
describe command('sudo pkill -SIGUSR1 fluentd') do
its(:exit_status) { should eq 0 }
end
describe command('timeout --signal=9 3 bash -c "while ! (grep -e message...foo /tmp/dump/*.log | grep -v grep); do sleep 0.5; done"') do
its(:exit_status) { should eq 0 }
its(:stdout) do
is_expected.to include_json(
level: 'error',
message: 'foo',
journal: {
transport: 'syslog',
unit: 'ssh.service',
uid: '0',
})
end
end
end
## Instruction:
Use regex for fluentd:source-journald json checks
## Code After:
require 'spec_helper'
describe 'fluentd:source-journald' do
describe service('fluentd') do
it { should be_running }
end
describe file('/var/lib/fluentd/journald_pos_systemd') do
it { should be_directory }
end
describe command('logger -p local0.error foo') do
its(:exit_status) { should eq 0 }
end
# see http://docs.fluentd.org/v0.14/articles/signals#sigusr1
describe command('sudo pkill -SIGUSR1 fluentd') do
its(:exit_status) { should eq 0 }
end
describe command('timeout --signal=9 3 bash -c "while ! (grep -e message...foo /tmp/dump/*.log | grep -v grep); do sleep 0.5; done"') do
its(:exit_status) { should eq 0 }
its(:stdout) do
is_expected.to include_json(
level: 'error',
message: 'foo',
timestamp: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}[+-]\d{2}:\d{2}$/,
journal: {
transport: 'syslog',
unit: /.+/,
uid: /\d+/,
pid: /\d+/,
})
end
end
end
| require 'spec_helper'
describe 'fluentd:source-journald' do
describe service('fluentd') do
it { should be_running }
end
describe file('/var/lib/fluentd/journald_pos_systemd') do
it { should be_directory }
end
describe command('logger -p local0.error foo') do
its(:exit_status) { should eq 0 }
end
# see http://docs.fluentd.org/v0.14/articles/signals#sigusr1
describe command('sudo pkill -SIGUSR1 fluentd') do
its(:exit_status) { should eq 0 }
end
describe command('timeout --signal=9 3 bash -c "while ! (grep -e message...foo /tmp/dump/*.log | grep -v grep); do sleep 0.5; done"') do
its(:exit_status) { should eq 0 }
its(:stdout) do
is_expected.to include_json(
level: 'error',
message: 'foo',
+ timestamp: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}[+-]\d{2}:\d{2}$/,
journal: {
transport: 'syslog',
- unit: 'ssh.service',
? ^^^^ ^^^^^^^^
+ unit: /.+/,
? ^ ^^
- uid: '0',
? ^^^
+ uid: /\d+/,
? ^^^^^
+ pid: /\d+/,
})
end
end
end | 6 | 0.171429 | 4 | 2 |
5462c9ec142da52c7204a3639f7b146bec66a007 | metadata/cc.rainwave.android.txt | metadata/cc.rainwave.android.txt | Categories:Multimedia
License:NewBSD
Web Site:http://rainwave.cc
Source Code:https://github.com/OEP/rainwave-android
Issue Tracker:https://github.com/OEP/rainwave-android/issues
Donate:http://rainwave.cc/pages/tip_jar
Auto Name:Rainwave
Summary:Client for music station
Description:
Listen to music on rainwave.cc, an icecast music station, via music players
like [[com.android.music]] or [[net.sourceforge.servestream]]. You can also
log in to vote and request tracks to be played.
.
Repo Type:git
Repo:https://github.com/OEP/rainwave-android.git
Build:1.1,4
commit=36477326ec80e
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.2,9
commit=v1.1.2
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.4,11
commit=v1.1.4
rm=libs/gson.jar
srclibs=Google-Gson@gson-2.2.4
prebuild=cp -r $$Google-Gson$$/src/main/java/com/ src/
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.1.4
Current Version Code:11
| Categories:Multimedia
License:NewBSD
Web Site:http://rainwave.cc
Source Code:https://github.com/OEP/rainwave-android
Issue Tracker:https://github.com/OEP/rainwave-android/issues
Donate:http://rainwave.cc/pages/tip_jar
Auto Name:Rainwave
Summary:Client for music station
Description:
Listen to music on rainwave.cc, an icecast music station, via music players
like [[com.android.music]] or [[net.sourceforge.servestream]]. You can also
log in to vote and request tracks to be played.
.
Repo Type:git
Repo:https://github.com/OEP/rainwave-android.git
Build:1.1,4
commit=36477326ec80e
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.2,9
commit=v1.1.2
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.4,11
commit=v1.1.4
srclibs=Google-Gson@gson-2.2.4
rm=libs/gson.jar
prebuild=cp -r $$Google-Gson$$/src/main/java/com/ src/
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.1.5
Current Version Code:12
| Update CV of Rainwave to 1.1.5 (12) | Update CV of Rainwave to 1.1.5 (12)
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata,f-droid/fdroid-data | text | ## Code Before:
Categories:Multimedia
License:NewBSD
Web Site:http://rainwave.cc
Source Code:https://github.com/OEP/rainwave-android
Issue Tracker:https://github.com/OEP/rainwave-android/issues
Donate:http://rainwave.cc/pages/tip_jar
Auto Name:Rainwave
Summary:Client for music station
Description:
Listen to music on rainwave.cc, an icecast music station, via music players
like [[com.android.music]] or [[net.sourceforge.servestream]]. You can also
log in to vote and request tracks to be played.
.
Repo Type:git
Repo:https://github.com/OEP/rainwave-android.git
Build:1.1,4
commit=36477326ec80e
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.2,9
commit=v1.1.2
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.4,11
commit=v1.1.4
rm=libs/gson.jar
srclibs=Google-Gson@gson-2.2.4
prebuild=cp -r $$Google-Gson$$/src/main/java/com/ src/
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.1.4
Current Version Code:11
## Instruction:
Update CV of Rainwave to 1.1.5 (12)
## Code After:
Categories:Multimedia
License:NewBSD
Web Site:http://rainwave.cc
Source Code:https://github.com/OEP/rainwave-android
Issue Tracker:https://github.com/OEP/rainwave-android/issues
Donate:http://rainwave.cc/pages/tip_jar
Auto Name:Rainwave
Summary:Client for music station
Description:
Listen to music on rainwave.cc, an icecast music station, via music players
like [[com.android.music]] or [[net.sourceforge.servestream]]. You can also
log in to vote and request tracks to be played.
.
Repo Type:git
Repo:https://github.com/OEP/rainwave-android.git
Build:1.1,4
commit=36477326ec80e
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.2,9
commit=v1.1.2
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.4,11
commit=v1.1.4
srclibs=Google-Gson@gson-2.2.4
rm=libs/gson.jar
prebuild=cp -r $$Google-Gson$$/src/main/java/com/ src/
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.1.5
Current Version Code:12
| Categories:Multimedia
License:NewBSD
Web Site:http://rainwave.cc
Source Code:https://github.com/OEP/rainwave-android
Issue Tracker:https://github.com/OEP/rainwave-android/issues
Donate:http://rainwave.cc/pages/tip_jar
Auto Name:Rainwave
Summary:Client for music station
Description:
Listen to music on rainwave.cc, an icecast music station, via music players
like [[com.android.music]] or [[net.sourceforge.servestream]]. You can also
log in to vote and request tracks to be played.
.
Repo Type:git
Repo:https://github.com/OEP/rainwave-android.git
Build:1.1,4
commit=36477326ec80e
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.2,9
commit=v1.1.2
init=sed -i 's/minSdkVersion="3"/minSdkVersion="4"/g' AndroidManifest.xml
target=android-8
Build:1.1.4,11
commit=v1.1.4
+ srclibs=Google-Gson@gson-2.2.4
rm=libs/gson.jar
- srclibs=Google-Gson@gson-2.2.4
prebuild=cp -r $$Google-Gson$$/src/main/java/com/ src/
Auto Update Mode:None
Update Check Mode:Tags
- Current Version:1.1.4
? ^
+ Current Version:1.1.5
? ^
- Current Version Code:11
? ^
+ Current Version Code:12
? ^
| 6 | 0.153846 | 3 | 3 |
736e6cc0d1f2f1888cf0bb3bd077a873bca7832c | sync.sh | sync.sh |
TMPDIR=$(mktemp -d /var/tmp/yangmodules)
if [ $? -ne 0 ]; then
echo "$0: Can't create temp file, exiting..."
exit 1
fi
echo "Fetching files into $TMPDIR"
rsync -az --no-l --include="draft*.txt" --exclude="*" --delete rsync.ietf.org::internet-drafts $TMPDIR/my-id-mirror
rsync -az --no-l --include="rfc*.txt" --exclude="*" --delete rsync.ietf.org::rfc $TMPDIR/my-rfc-mirror
mkdir $TMPDIR/all-yang
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-id-mirror/*) ; do xym --dstdir $TMPDIR/all-yang --strict True $file; done
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-rfc-mirror/*) ; do xym --dstdir $TMPDIR/all-yang --strict True $file; done
# Should probably exclude more weird non-useful modules here
tar --exclude="example*" -zcvf ./all-yang.tgz -C $TMPDIR all-yang
rm -rf mkdir $TMPDIR/all-yang | TMPDIR=/var/tmp/yangmodules/work
EXTRACTDIR=/var/tmp/yangmodules/extracted
mkdir -pv $TMPDIR
mkdir -pv $EXTRACTDIR
if [ $? -ne 0 ]; then
echo "$0: Can't create temp directory, exiting..."
exit 1
fi
echo "Fetching files into $TMPDIR"
rsync -az --no-l --include="draft*.txt" --exclude="*" --delete rsync.ietf.org::internet-drafts $TMPDIR/my-id-mirror
rsync -az --no-l --include="rfc*.txt" --exclude="*" --delete rsync.ietf.org::rfc $TMPDIR/my-rfc-mirror
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-id-mirror/*) ; do xym --dstdir $EXTRACTDIR --strict True $file; done
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-rfc-mirror/*) ; do xym --dstdir $EXTRACTDIR --strict True $file; done
| Stop packing up things, just dump the modules in a known directory | Stop packing up things, just dump the modules in a known directory
| Shell | bsd-3-clause | cmoberg/bottle-yang-extractor-validator,cmoberg/bottle-yang-extractor-validator | shell | ## Code Before:
TMPDIR=$(mktemp -d /var/tmp/yangmodules)
if [ $? -ne 0 ]; then
echo "$0: Can't create temp file, exiting..."
exit 1
fi
echo "Fetching files into $TMPDIR"
rsync -az --no-l --include="draft*.txt" --exclude="*" --delete rsync.ietf.org::internet-drafts $TMPDIR/my-id-mirror
rsync -az --no-l --include="rfc*.txt" --exclude="*" --delete rsync.ietf.org::rfc $TMPDIR/my-rfc-mirror
mkdir $TMPDIR/all-yang
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-id-mirror/*) ; do xym --dstdir $TMPDIR/all-yang --strict True $file; done
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-rfc-mirror/*) ; do xym --dstdir $TMPDIR/all-yang --strict True $file; done
# Should probably exclude more weird non-useful modules here
tar --exclude="example*" -zcvf ./all-yang.tgz -C $TMPDIR all-yang
rm -rf mkdir $TMPDIR/all-yang
## Instruction:
Stop packing up things, just dump the modules in a known directory
## Code After:
TMPDIR=/var/tmp/yangmodules/work
EXTRACTDIR=/var/tmp/yangmodules/extracted
mkdir -pv $TMPDIR
mkdir -pv $EXTRACTDIR
if [ $? -ne 0 ]; then
echo "$0: Can't create temp directory, exiting..."
exit 1
fi
echo "Fetching files into $TMPDIR"
rsync -az --no-l --include="draft*.txt" --exclude="*" --delete rsync.ietf.org::internet-drafts $TMPDIR/my-id-mirror
rsync -az --no-l --include="rfc*.txt" --exclude="*" --delete rsync.ietf.org::rfc $TMPDIR/my-rfc-mirror
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-id-mirror/*) ; do xym --dstdir $EXTRACTDIR --strict True $file; done
for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-rfc-mirror/*) ; do xym --dstdir $EXTRACTDIR --strict True $file; done
| + TMPDIR=/var/tmp/yangmodules/work
+ EXTRACTDIR=/var/tmp/yangmodules/extracted
+ mkdir -pv $TMPDIR
+ mkdir -pv $EXTRACTDIR
- TMPDIR=$(mktemp -d /var/tmp/yangmodules)
if [ $? -ne 0 ]; then
- echo "$0: Can't create temp file, exiting..."
? ^ ^
+ echo "$0: Can't create temp directory, exiting..."
? ^ ^ +++++
exit 1
fi
echo "Fetching files into $TMPDIR"
rsync -az --no-l --include="draft*.txt" --exclude="*" --delete rsync.ietf.org::internet-drafts $TMPDIR/my-id-mirror
rsync -az --no-l --include="rfc*.txt" --exclude="*" --delete rsync.ietf.org::rfc $TMPDIR/my-rfc-mirror
- mkdir $TMPDIR/all-yang
+ for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-id-mirror/*) ; do xym --dstdir $EXTRACTDIR --strict True $file; done
+ for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-rfc-mirror/*) ; do xym --dstdir $EXTRACTDIR --strict True $file; done
- for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-id-mirror/*) ; do xym --dstdir $TMPDIR/all-yang --strict True $file; done
- for file in $(egrep -l '^[ \t]*(sub)?module +[\\'\"]?[-A-Za-z0-9]*[\\'\"]? *\{.*$' $TMPDIR/my-rfc-mirror/*) ; do xym --dstdir $TMPDIR/all-yang --strict True $file; done
-
- # Should probably exclude more weird non-useful modules here
- tar --exclude="example*" -zcvf ./all-yang.tgz -C $TMPDIR all-yang
-
- rm -rf mkdir $TMPDIR/all-yang | 17 | 0.809524 | 7 | 10 |
64dad0f6ef98ce568cf6e6bcc966b05e8b66596a | lib/musicality/composition/note_generation.rb | lib/musicality/composition/note_generation.rb | module Musicality
def make_note dur, pitch_group
if dur > 0
Musicality::Note.new(dur,pitch_group)
else
Musicality::Note.new(-dur)
end
end
module_function :make_note
# Whichever is longer, rhythm or pitch_groups, is iterated over once while
# the smaller will cycle as necessary.
def make_notes rhythm, pitch_groups
m,n = rhythm.size, pitch_groups.size
raise EmptyError, "rhythm is empty" if m == 0
raise EmptyError, "pitch_groups is empty" if n == 0
if m > n
Array.new(m) do |i|
make_note(rhythm[i],pitch_groups[i % n])
end
else
Array.new(n) do |i|
make_note(rhythm[i % m],pitch_groups[i])
end
end
end
module_function :make_notes
end
| module Musicality
def make_note dur, pitch_group
if dur > 0
Musicality::Note.new(dur,pitch_group)
else
Musicality::Note.new(-dur)
end
end
module_function :make_note
# Whichever is longer, rhythm or pitch_groups, is iterated over once while
# the smaller will cycle as necessary.
def make_notes rhythm, pitch_groups
m,n = rhythm.size, pitch_groups.size
raise EmptyError, "rhythm is empty" if m == 0
raise EmptyError, "pitch_groups is empty" if n == 0
if m > n
Array.new(m) do |i|
make_note(rhythm[i],pitch_groups[i % n])
end
else
Array.new(n) do |i|
make_note(rhythm[i % m],pitch_groups[i])
end
end
end
module_function :make_notes
def e(pitch_groups)
pitch_groups.map {|pg| Note.eighth(pg) }
end
module_function :e
def q(pitch_groups)
pitch_groups.map {|pg| Note.quarter(pg) }
end
module_function :q
def dq(pitch_groups)
pitch_groups.map {|pg| Note.dotted_quarter(pg) }
end
module_function :dq
end
| Add convenience methods for generating eighth, quarter, and dotted-quarter notes | Add convenience methods for generating eighth, quarter, and dotted-quarter notes
| Ruby | mit | jamestunnell/musicality | ruby | ## Code Before:
module Musicality
def make_note dur, pitch_group
if dur > 0
Musicality::Note.new(dur,pitch_group)
else
Musicality::Note.new(-dur)
end
end
module_function :make_note
# Whichever is longer, rhythm or pitch_groups, is iterated over once while
# the smaller will cycle as necessary.
def make_notes rhythm, pitch_groups
m,n = rhythm.size, pitch_groups.size
raise EmptyError, "rhythm is empty" if m == 0
raise EmptyError, "pitch_groups is empty" if n == 0
if m > n
Array.new(m) do |i|
make_note(rhythm[i],pitch_groups[i % n])
end
else
Array.new(n) do |i|
make_note(rhythm[i % m],pitch_groups[i])
end
end
end
module_function :make_notes
end
## Instruction:
Add convenience methods for generating eighth, quarter, and dotted-quarter notes
## Code After:
module Musicality
def make_note dur, pitch_group
if dur > 0
Musicality::Note.new(dur,pitch_group)
else
Musicality::Note.new(-dur)
end
end
module_function :make_note
# Whichever is longer, rhythm or pitch_groups, is iterated over once while
# the smaller will cycle as necessary.
def make_notes rhythm, pitch_groups
m,n = rhythm.size, pitch_groups.size
raise EmptyError, "rhythm is empty" if m == 0
raise EmptyError, "pitch_groups is empty" if n == 0
if m > n
Array.new(m) do |i|
make_note(rhythm[i],pitch_groups[i % n])
end
else
Array.new(n) do |i|
make_note(rhythm[i % m],pitch_groups[i])
end
end
end
module_function :make_notes
def e(pitch_groups)
pitch_groups.map {|pg| Note.eighth(pg) }
end
module_function :e
def q(pitch_groups)
pitch_groups.map {|pg| Note.quarter(pg) }
end
module_function :q
def dq(pitch_groups)
pitch_groups.map {|pg| Note.dotted_quarter(pg) }
end
module_function :dq
end
| module Musicality
def make_note dur, pitch_group
if dur > 0
Musicality::Note.new(dur,pitch_group)
else
Musicality::Note.new(-dur)
end
end
module_function :make_note
# Whichever is longer, rhythm or pitch_groups, is iterated over once while
# the smaller will cycle as necessary.
def make_notes rhythm, pitch_groups
m,n = rhythm.size, pitch_groups.size
raise EmptyError, "rhythm is empty" if m == 0
raise EmptyError, "pitch_groups is empty" if n == 0
if m > n
Array.new(m) do |i|
make_note(rhythm[i],pitch_groups[i % n])
end
else
Array.new(n) do |i|
make_note(rhythm[i % m],pitch_groups[i])
end
end
end
module_function :make_notes
+ def e(pitch_groups)
+ pitch_groups.map {|pg| Note.eighth(pg) }
end
+ module_function :e
+
+ def q(pitch_groups)
+ pitch_groups.map {|pg| Note.quarter(pg) }
+ end
+ module_function :q
+
+ def dq(pitch_groups)
+ pitch_groups.map {|pg| Note.dotted_quarter(pg) }
+ end
+ module_function :dq
+
+ end | 15 | 0.483871 | 15 | 0 |
43e6a2e3bf90f5edee214d1511a6805a67f79595 | stl/__init__.py | stl/__init__.py |
import stl.ascii
import stl.binary
def parse_ascii_file(file):
return stl.ascii.parse(file)
def parse_binary_file(file):
return stl.binary.parse(file)
def parse_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
def parse_binary_string(data):
from StringIO import StringIO
return parse_binary_file(StringIO(data))
|
import stl.ascii
import stl.binary
def read_ascii_file(file):
return stl.ascii.parse(file)
def read_binary_file(file):
return stl.binary.parse(file)
def read_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
def read_binary_string(data):
from StringIO import StringIO
return parse_binary_file(StringIO(data))
| Rename the reading functions "read_" rather than "parse_". | Rename the reading functions "read_" rather than "parse_".
"Parsing" is what they do internally, but "read" is a better opposite to
"write" and matches the name of the underlying raw file operation.
| Python | mit | apparentlymart/python-stl,zachwick/python-stl,ng110/python-stl | python | ## Code Before:
import stl.ascii
import stl.binary
def parse_ascii_file(file):
return stl.ascii.parse(file)
def parse_binary_file(file):
return stl.binary.parse(file)
def parse_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
def parse_binary_string(data):
from StringIO import StringIO
return parse_binary_file(StringIO(data))
## Instruction:
Rename the reading functions "read_" rather than "parse_".
"Parsing" is what they do internally, but "read" is a better opposite to
"write" and matches the name of the underlying raw file operation.
## Code After:
import stl.ascii
import stl.binary
def read_ascii_file(file):
return stl.ascii.parse(file)
def read_binary_file(file):
return stl.binary.parse(file)
def read_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
def read_binary_string(data):
from StringIO import StringIO
return parse_binary_file(StringIO(data))
|
import stl.ascii
import stl.binary
- def parse_ascii_file(file):
? ^ ^^^
+ def read_ascii_file(file):
? ^^ ^
return stl.ascii.parse(file)
- def parse_binary_file(file):
? ^ ^^^
+ def read_binary_file(file):
? ^^ ^
return stl.binary.parse(file)
- def parse_ascii_string(data):
? ^ ^^^
+ def read_ascii_string(data):
? ^^ ^
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
- def parse_binary_string(data):
? ^ ^^^
+ def read_binary_string(data):
? ^^ ^
from StringIO import StringIO
return parse_binary_file(StringIO(data)) | 8 | 0.380952 | 4 | 4 |
2fcf279ad177f727648bff54f4984cd0488f06a2 | hdinsight-templates/createUiDefinition.json | hdinsight-templates/createUiDefinition.json | {
"handler": "Microsoft.HDInsight",
"version": "0.0.1-preview",
"clusterFilters": {
"types": ["Hadoop", "HBase", "Spark"],
"tiers": ["Standard", "Premium"],
"versions": ["3.6"]
}
}
| {
"handler": "Microsoft.HDInsight",
"version": "0.0.1-preview",
"clusterFilters": {
"types": ["Hadoop", "HBase","Storm" ,"Spark","Kafka"],
"tiers": ["Standard", "Premium"],
"versions": ["3.6"]
}
}
| Support HDInsight solution for Kafka and Storm | DEV-12985: Support HDInsight solution for Kafka and Storm
| JSON | mit | striim/azure-solution-template,striim/azure-solution-template | json | ## Code Before:
{
"handler": "Microsoft.HDInsight",
"version": "0.0.1-preview",
"clusterFilters": {
"types": ["Hadoop", "HBase", "Spark"],
"tiers": ["Standard", "Premium"],
"versions": ["3.6"]
}
}
## Instruction:
DEV-12985: Support HDInsight solution for Kafka and Storm
## Code After:
{
"handler": "Microsoft.HDInsight",
"version": "0.0.1-preview",
"clusterFilters": {
"types": ["Hadoop", "HBase","Storm" ,"Spark","Kafka"],
"tiers": ["Standard", "Premium"],
"versions": ["3.6"]
}
}
| {
"handler": "Microsoft.HDInsight",
"version": "0.0.1-preview",
"clusterFilters": {
- "types": ["Hadoop", "HBase", "Spark"],
+ "types": ["Hadoop", "HBase","Storm" ,"Spark","Kafka"],
? +++++++ + ++++++++
"tiers": ["Standard", "Premium"],
"versions": ["3.6"]
}
} | 2 | 0.222222 | 1 | 1 |
4080a227ecaf50d6ff7dc2054b27cbcecef63306 | .github/workflows/phpunit.yaml | .github/workflows/phpunit.yaml | name: PHPUnit
on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
branches:
- master
jobs:
Build:
runs-on: 'ubuntu-latest'
container: 'byjg/php:${{ matrix.php-version }}-cli'
strategy:
matrix:
php-version:
# - "8.1"
# - "8.0"
- "7.4"
- "7.3"
# - "7.2"
# - "7.1"
# - "7.0"
# - "5.6"
steps:
- uses: actions/checkout@v2
- name: Spin up databases
run: |
apk add --no-cache python3 python3-dev py3-pip build-base libffi-dev
pip3 install --upgrade pip
pip3 install docker-compose
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community docker
docker-compose up -d postgres mysql
- run: composer install
- run: ./vendor/bin/phpunit
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
- run: ./wait-for-db.sh postgres && ./vendor/bin/phpunit tests/PostgresDatabase*
- run: ./wait-for-db.sh mysql && ./vendor/bin/phpunit tests/MysqlDatabase*
# - run: ./wait-for-db.sh mssql && ./vendor/bin/phpunit tests/SqlServer*
| name: PHPUnit
on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
branches:
- master
jobs:
Build:
runs-on: 'ubuntu-latest'
container: 'byjg/php:${{ matrix.php-version }}-cli'
strategy:
matrix:
php-version:
# - "8.1"
# - "8.0"
- "7.4"
- "7.3"
# - "7.2"
# - "7.1"
# - "7.0"
# - "5.6"
steps:
- uses: actions/checkout@v2
- name: Spin up databases
run: |
apk add --no-cache python3 python3-dev py3-pip build-base libffi-dev
pip3 install --upgrade pip
pip3 install docker-compose
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community docker
docker-compose up -d postgres mysql
- run: composer install
- run: ./vendor/bin/phpunit
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
- run: ./wait-for-db.sh mysql && ./vendor/bin/phpunit tests/MysqlDatabase*
- run: ./wait-for-db.sh postgres && ./vendor/bin/phpunit tests/PostgresDatabase*
# - run: ./wait-for-db.sh mssql && ./vendor/bin/phpunit tests/SqlServer*
| Fix tests with PHPUnit 9 (+2) | Fix tests with PHPUnit 9 (+2)
| YAML | mit | byjg/migration,byjg/migration | yaml | ## Code Before:
name: PHPUnit
on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
branches:
- master
jobs:
Build:
runs-on: 'ubuntu-latest'
container: 'byjg/php:${{ matrix.php-version }}-cli'
strategy:
matrix:
php-version:
# - "8.1"
# - "8.0"
- "7.4"
- "7.3"
# - "7.2"
# - "7.1"
# - "7.0"
# - "5.6"
steps:
- uses: actions/checkout@v2
- name: Spin up databases
run: |
apk add --no-cache python3 python3-dev py3-pip build-base libffi-dev
pip3 install --upgrade pip
pip3 install docker-compose
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community docker
docker-compose up -d postgres mysql
- run: composer install
- run: ./vendor/bin/phpunit
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
- run: ./wait-for-db.sh postgres && ./vendor/bin/phpunit tests/PostgresDatabase*
- run: ./wait-for-db.sh mysql && ./vendor/bin/phpunit tests/MysqlDatabase*
# - run: ./wait-for-db.sh mssql && ./vendor/bin/phpunit tests/SqlServer*
## Instruction:
Fix tests with PHPUnit 9 (+2)
## Code After:
name: PHPUnit
on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
branches:
- master
jobs:
Build:
runs-on: 'ubuntu-latest'
container: 'byjg/php:${{ matrix.php-version }}-cli'
strategy:
matrix:
php-version:
# - "8.1"
# - "8.0"
- "7.4"
- "7.3"
# - "7.2"
# - "7.1"
# - "7.0"
# - "5.6"
steps:
- uses: actions/checkout@v2
- name: Spin up databases
run: |
apk add --no-cache python3 python3-dev py3-pip build-base libffi-dev
pip3 install --upgrade pip
pip3 install docker-compose
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community docker
docker-compose up -d postgres mysql
- run: composer install
- run: ./vendor/bin/phpunit
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
- run: ./wait-for-db.sh mysql && ./vendor/bin/phpunit tests/MysqlDatabase*
- run: ./wait-for-db.sh postgres && ./vendor/bin/phpunit tests/PostgresDatabase*
# - run: ./wait-for-db.sh mssql && ./vendor/bin/phpunit tests/SqlServer*
| name: PHPUnit
on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
branches:
- master
jobs:
Build:
runs-on: 'ubuntu-latest'
container: 'byjg/php:${{ matrix.php-version }}-cli'
strategy:
matrix:
php-version:
# - "8.1"
# - "8.0"
- "7.4"
- "7.3"
# - "7.2"
# - "7.1"
# - "7.0"
# - "5.6"
steps:
- uses: actions/checkout@v2
- name: Spin up databases
run: |
apk add --no-cache python3 python3-dev py3-pip build-base libffi-dev
pip3 install --upgrade pip
pip3 install docker-compose
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community docker
docker-compose up -d postgres mysql
- run: composer install
- run: ./vendor/bin/phpunit
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
+ - run: ./wait-for-db.sh mysql && ./vendor/bin/phpunit tests/MysqlDatabase*
- run: ./wait-for-db.sh postgres && ./vendor/bin/phpunit tests/PostgresDatabase*
- - run: ./wait-for-db.sh mysql && ./vendor/bin/phpunit tests/MysqlDatabase*
# - run: ./wait-for-db.sh mssql && ./vendor/bin/phpunit tests/SqlServer* | 2 | 0.047619 | 1 | 1 |
7cb30e18e2868332d67c1b3606523b260140c3d8 | tasks/dependo.js | tasks/dependo.js | /*
* Grunt Task File
* ---------------
*
* Task: dependo
* Description: Generate graph for CommonJS or AMD module dependencies.
*
*/
'use strict';
module.exports = function (grunt) {
grunt.registerMultiTask("dependo", "Run dependo", function () {
var Dependo = require("dependo");
var path = require('path');
var options = this.options({
outputPath: './',
fileName: 'index.html',
format: 'amd',
targetPath: './',
exclude: ''
});
// Paths
var targetPath = grunt.file.isPathAbsolute(options.targetPath) ? options.targetPath : path.resolve(options.targetPath);
var baseOutputPath = grunt.file.isPathAbsolute(options.outputPath) ? options.outputPath : path.resolve(options.outputPath);
var outputPath = path.join(baseOutputPath, options.fileName);
// Fire up an dependo instance
var dependo = new Dependo(targetPath, options);
// Write HTML
var html = dependo.generateHtml();
grunt.file.write(outputPath, html);
// Done
grunt.log.ok("Generated graph into " + outputPath + " - Check.");
});
};
| /*
* Grunt Task File
* ---------------
*
* Task: dependo
* Description: Generate graph for CommonJS or AMD module dependencies.
*
*/
'use strict';
module.exports = function (grunt) {
grunt.registerMultiTask("dependo", "Run dependo", function () {
var Dependo = require("dependo");
var path = require('path');
var options = this.options({
outputPath: './',
fileName: 'index.html',
format: 'amd',
targetPath: './',
exclude: ''
});
// Paths
vat targetPath;
if (options.targetPath instanceof Array) {
targetPath = options.targetPath.map(function(target) {
return grunt.file.isPathAbsolute(target) ? target : path.resolve(target);
});
} else {
targetPath = grunt.file.isPathAbsolute(options.targetPath) ? options.targetPath : path.resolve(options.targetPath);
}
var baseOutputPath = grunt.file.isPathAbsolute(options.outputPath) ? options.outputPath : path.resolve(options.outputPath);
var outputPath = path.join(baseOutputPath, options.fileName);
// Fire up an dependo instance
var dependo = new Dependo(targetPath, options);
// Write HTML
var html = dependo.generateHtml();
grunt.file.write(outputPath, html);
// Done
grunt.log.ok("Generated graph into " + outputPath + " - Check.");
});
};
| Add support for Array type targetPath | Add support for Array type targetPath
| JavaScript | mit | auchenberg/grunt-dependo | javascript | ## Code Before:
/*
* Grunt Task File
* ---------------
*
* Task: dependo
* Description: Generate graph for CommonJS or AMD module dependencies.
*
*/
'use strict';
module.exports = function (grunt) {
grunt.registerMultiTask("dependo", "Run dependo", function () {
var Dependo = require("dependo");
var path = require('path');
var options = this.options({
outputPath: './',
fileName: 'index.html',
format: 'amd',
targetPath: './',
exclude: ''
});
// Paths
var targetPath = grunt.file.isPathAbsolute(options.targetPath) ? options.targetPath : path.resolve(options.targetPath);
var baseOutputPath = grunt.file.isPathAbsolute(options.outputPath) ? options.outputPath : path.resolve(options.outputPath);
var outputPath = path.join(baseOutputPath, options.fileName);
// Fire up an dependo instance
var dependo = new Dependo(targetPath, options);
// Write HTML
var html = dependo.generateHtml();
grunt.file.write(outputPath, html);
// Done
grunt.log.ok("Generated graph into " + outputPath + " - Check.");
});
};
## Instruction:
Add support for Array type targetPath
## Code After:
/*
* Grunt Task File
* ---------------
*
* Task: dependo
* Description: Generate graph for CommonJS or AMD module dependencies.
*
*/
'use strict';
module.exports = function (grunt) {
grunt.registerMultiTask("dependo", "Run dependo", function () {
var Dependo = require("dependo");
var path = require('path');
var options = this.options({
outputPath: './',
fileName: 'index.html',
format: 'amd',
targetPath: './',
exclude: ''
});
// Paths
vat targetPath;
if (options.targetPath instanceof Array) {
targetPath = options.targetPath.map(function(target) {
return grunt.file.isPathAbsolute(target) ? target : path.resolve(target);
});
} else {
targetPath = grunt.file.isPathAbsolute(options.targetPath) ? options.targetPath : path.resolve(options.targetPath);
}
var baseOutputPath = grunt.file.isPathAbsolute(options.outputPath) ? options.outputPath : path.resolve(options.outputPath);
var outputPath = path.join(baseOutputPath, options.fileName);
// Fire up an dependo instance
var dependo = new Dependo(targetPath, options);
// Write HTML
var html = dependo.generateHtml();
grunt.file.write(outputPath, html);
// Done
grunt.log.ok("Generated graph into " + outputPath + " - Check.");
});
};
| /*
* Grunt Task File
* ---------------
*
* Task: dependo
* Description: Generate graph for CommonJS or AMD module dependencies.
*
*/
'use strict';
module.exports = function (grunt) {
grunt.registerMultiTask("dependo", "Run dependo", function () {
var Dependo = require("dependo");
var path = require('path');
var options = this.options({
outputPath: './',
fileName: 'index.html',
format: 'amd',
targetPath: './',
exclude: ''
});
// Paths
+ vat targetPath;
+ if (options.targetPath instanceof Array) {
+ targetPath = options.targetPath.map(function(target) {
+ return grunt.file.isPathAbsolute(target) ? target : path.resolve(target);
+ });
+ } else {
- var targetPath = grunt.file.isPathAbsolute(options.targetPath) ? options.targetPath : path.resolve(options.targetPath);
? ^^^
+ targetPath = grunt.file.isPathAbsolute(options.targetPath) ? options.targetPath : path.resolve(options.targetPath);
? ^
+ }
var baseOutputPath = grunt.file.isPathAbsolute(options.outputPath) ? options.outputPath : path.resolve(options.outputPath);
var outputPath = path.join(baseOutputPath, options.fileName);
// Fire up an dependo instance
var dependo = new Dependo(targetPath, options);
// Write HTML
var html = dependo.generateHtml();
grunt.file.write(outputPath, html);
// Done
grunt.log.ok("Generated graph into " + outputPath + " - Check.");
});
}; | 9 | 0.209302 | 8 | 1 |
505d49c3454f7d745de036e38a6f38d0c87d95e0 | spec/git_tracker/commit_message_spec.rb | spec/git_tracker/commit_message_spec.rb | require 'git_tracker/commit_message'
require 'commit_message_helper'
describe GitTracker::CommitMessage do
include CommitMessageHelper
it "requires path to the temporary commit message file" do
-> { GitTracker::CommitMessage.new }.should raise_error ArgumentError
end
describe "#contains?" do
subject { described_class.new(file) }
let(:file) { "COMMIT_EDITMSG" }
before do
File.stub(:read).with(file) { example_commit_message("[#8675309]") }
end
context "commit message contains the special Pivotal Tracker story syntax" do
it { subject.should be_contains("[#8675309]") }
end
end
end
| require 'git_tracker/commit_message'
require 'commit_message_helper'
describe GitTracker::CommitMessage do
include CommitMessageHelper
it "requires path to the temporary commit message file" do
-> { GitTracker::CommitMessage.new }.should raise_error ArgumentError
end
describe "#contains?" do
subject { described_class.new(file) }
let(:file) { "COMMIT_EDITMSG" }
before do
File.stub(:read).with(file) { commit_message_text }
end
context "commit message contains the special Pivotal Tracker story syntax" do
let(:commit_message_text) { example_commit_message("[#8675309]") }
it { subject.should be_contains("[#8675309]") }
end
context "commit message doesn't contain the special Pivotal Tracker story syntax" do
let(:commit_message_text) { example_commit_message("[#not_it]") }
it { subject.should_not be_contains("[#8675309]") }
end
end
end
| Add test for NOT finding PT story number | Add test for NOT finding PT story number
in the temporary commit message. Just to cover all of our bases!
[#26437519]
| Ruby | mit | KensoDev/git_tracker,KensoDev/git_tracker,stevenharman/git_tracker,stevenharman/git_tracker | ruby | ## Code Before:
require 'git_tracker/commit_message'
require 'commit_message_helper'
describe GitTracker::CommitMessage do
include CommitMessageHelper
it "requires path to the temporary commit message file" do
-> { GitTracker::CommitMessage.new }.should raise_error ArgumentError
end
describe "#contains?" do
subject { described_class.new(file) }
let(:file) { "COMMIT_EDITMSG" }
before do
File.stub(:read).with(file) { example_commit_message("[#8675309]") }
end
context "commit message contains the special Pivotal Tracker story syntax" do
it { subject.should be_contains("[#8675309]") }
end
end
end
## Instruction:
Add test for NOT finding PT story number
in the temporary commit message. Just to cover all of our bases!
[#26437519]
## Code After:
require 'git_tracker/commit_message'
require 'commit_message_helper'
describe GitTracker::CommitMessage do
include CommitMessageHelper
it "requires path to the temporary commit message file" do
-> { GitTracker::CommitMessage.new }.should raise_error ArgumentError
end
describe "#contains?" do
subject { described_class.new(file) }
let(:file) { "COMMIT_EDITMSG" }
before do
File.stub(:read).with(file) { commit_message_text }
end
context "commit message contains the special Pivotal Tracker story syntax" do
let(:commit_message_text) { example_commit_message("[#8675309]") }
it { subject.should be_contains("[#8675309]") }
end
context "commit message doesn't contain the special Pivotal Tracker story syntax" do
let(:commit_message_text) { example_commit_message("[#not_it]") }
it { subject.should_not be_contains("[#8675309]") }
end
end
end
| require 'git_tracker/commit_message'
require 'commit_message_helper'
describe GitTracker::CommitMessage do
include CommitMessageHelper
it "requires path to the temporary commit message file" do
-> { GitTracker::CommitMessage.new }.should raise_error ArgumentError
end
describe "#contains?" do
subject { described_class.new(file) }
let(:file) { "COMMIT_EDITMSG" }
before do
- File.stub(:read).with(file) { example_commit_message("[#8675309]") }
? -------- ^^^^^^^^^^^^^^
+ File.stub(:read).with(file) { commit_message_text }
? ^^^^^
end
context "commit message contains the special Pivotal Tracker story syntax" do
+ let(:commit_message_text) { example_commit_message("[#8675309]") }
it { subject.should be_contains("[#8675309]") }
+ end
+
+ context "commit message doesn't contain the special Pivotal Tracker story syntax" do
+ let(:commit_message_text) { example_commit_message("[#not_it]") }
+ it { subject.should_not be_contains("[#8675309]") }
end
end
end | 8 | 0.347826 | 7 | 1 |
98c6022c6fdcd5d52b2d2cb14438f20f69bf62c1 | js/src/index.js | js/src/index.js | function load_ipython_extension() {
var extensionLoaded = false;
function loadScript( host, name ) {
var script = document.createElement( 'script' );
script.src = name
? host + `/juno/${name}.js`
: host;
document.head.appendChild( script );
return script;
}
function loadJuno( host ) {
if ( extensionLoaded ) { return; }
var reqReact = window.requirejs.config({
paths: {
'react': host + '/juno/react',
'react-dom': host + '/juno/react-dom'
}
});
reqReact([ 'react', 'react-dom' ], () => {
reqReact([ host + '/juno/vendor.js'], () => {
reqReact([ host + '/juno/nbextension.js'], () => {});
});
});
}
requirejs( [
"base/js/namespace",
"base/js/events"
], function( Jupyter, Events ) {
// On new kernel session create new comm managers
if ( Jupyter.notebook && Jupyter.notebook.kernel ) {
loadJuno( '//' + window.location.host )
}
Events.on( 'kernel_created.Kernel kernel_created.Session', ( event, data ) => {
handleKernel( data.kernel );
});
});
}
module.exports = {
load_ipython_extension: load_ipython_extension
};
| function load_ipython_extension() {
var extensionLoaded = false;
function loadScript( host, name ) {
var script = document.createElement( 'script' );
script.src = name
? host + `/juno/${name}.js`
: host;
document.head.appendChild( script );
return script;
}
function loadJuno( host ) {
if ( extensionLoaded ) { return; }
var reqReact = window.requirejs.config({
paths: {
'react': host + '/juno/react',
'react-dom': host + '/juno/react-dom'
}
});
reqReact([ 'react', 'react-dom' ], () => {
reqReact([ host + '/juno/vendor.js'], () => {
reqReact([ host + '/juno/nbextension.js'], () => {});
});
});
}
requirejs( [
"base/js/namespace",
"base/js/events"
], function( Jupyter, Events ) {
// On new kernel session create new comm managers
if ( Jupyter.notebook && Jupyter.notebook.kernel ) {
loadJuno( '//' + window.location.host )
}
Events.on( 'kernel_created.Kernel kernel_created.Session', ( event, data ) => {
loadJuno( '//' + window.location.host );
});
});
}
module.exports = {
load_ipython_extension: load_ipython_extension
};
| FIX calling loadJuno in place of handleKernel on kernel, session creation | FIX calling loadJuno in place of handleKernel on kernel, session creation
| JavaScript | mit | DigitalGlobe/juno-magic,timbr-io/juno-magic,DigitalGlobe/juno-magic,timbr-io/juno-magic | javascript | ## Code Before:
function load_ipython_extension() {
var extensionLoaded = false;
function loadScript( host, name ) {
var script = document.createElement( 'script' );
script.src = name
? host + `/juno/${name}.js`
: host;
document.head.appendChild( script );
return script;
}
function loadJuno( host ) {
if ( extensionLoaded ) { return; }
var reqReact = window.requirejs.config({
paths: {
'react': host + '/juno/react',
'react-dom': host + '/juno/react-dom'
}
});
reqReact([ 'react', 'react-dom' ], () => {
reqReact([ host + '/juno/vendor.js'], () => {
reqReact([ host + '/juno/nbextension.js'], () => {});
});
});
}
requirejs( [
"base/js/namespace",
"base/js/events"
], function( Jupyter, Events ) {
// On new kernel session create new comm managers
if ( Jupyter.notebook && Jupyter.notebook.kernel ) {
loadJuno( '//' + window.location.host )
}
Events.on( 'kernel_created.Kernel kernel_created.Session', ( event, data ) => {
handleKernel( data.kernel );
});
});
}
module.exports = {
load_ipython_extension: load_ipython_extension
};
## Instruction:
FIX calling loadJuno in place of handleKernel on kernel, session creation
## Code After:
function load_ipython_extension() {
var extensionLoaded = false;
function loadScript( host, name ) {
var script = document.createElement( 'script' );
script.src = name
? host + `/juno/${name}.js`
: host;
document.head.appendChild( script );
return script;
}
function loadJuno( host ) {
if ( extensionLoaded ) { return; }
var reqReact = window.requirejs.config({
paths: {
'react': host + '/juno/react',
'react-dom': host + '/juno/react-dom'
}
});
reqReact([ 'react', 'react-dom' ], () => {
reqReact([ host + '/juno/vendor.js'], () => {
reqReact([ host + '/juno/nbextension.js'], () => {});
});
});
}
requirejs( [
"base/js/namespace",
"base/js/events"
], function( Jupyter, Events ) {
// On new kernel session create new comm managers
if ( Jupyter.notebook && Jupyter.notebook.kernel ) {
loadJuno( '//' + window.location.host )
}
Events.on( 'kernel_created.Kernel kernel_created.Session', ( event, data ) => {
loadJuno( '//' + window.location.host );
});
});
}
module.exports = {
load_ipython_extension: load_ipython_extension
};
| function load_ipython_extension() {
var extensionLoaded = false;
function loadScript( host, name ) {
var script = document.createElement( 'script' );
script.src = name
? host + `/juno/${name}.js`
: host;
document.head.appendChild( script );
return script;
}
function loadJuno( host ) {
if ( extensionLoaded ) { return; }
var reqReact = window.requirejs.config({
paths: {
'react': host + '/juno/react',
'react-dom': host + '/juno/react-dom'
}
});
reqReact([ 'react', 'react-dom' ], () => {
reqReact([ host + '/juno/vendor.js'], () => {
reqReact([ host + '/juno/nbextension.js'], () => {});
});
});
}
requirejs( [
"base/js/namespace",
"base/js/events"
], function( Jupyter, Events ) {
// On new kernel session create new comm managers
if ( Jupyter.notebook && Jupyter.notebook.kernel ) {
loadJuno( '//' + window.location.host )
}
Events.on( 'kernel_created.Kernel kernel_created.Session', ( event, data ) => {
- handleKernel( data.kernel );
+ loadJuno( '//' + window.location.host );
});
});
}
module.exports = {
load_ipython_extension: load_ipython_extension
}; | 2 | 0.042553 | 1 | 1 |
21bcb3105c9c3884f2a369a75408d91cdca5992e | tests/core/test_extensions.py | tests/core/test_extensions.py | from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs.get_variable('local_town_child_allowance') is None
def walk_and_count(node):
c = 0
for item_name, item in node.children.items():
if isinstance(item, ParameterNode):
c += walk_and_count(item)
else:
c += 1
return c
def test_load_extension():
assert len(tbs.variables) == 16
assert walk_and_count(tbs.parameters) == 8
tbs.load_extension('openfisca_extension_template')
assert len(tbs.variables) == 17
assert tbs.get_variable('local_town_child_allowance') is not None
assert walk_and_count(tbs.parameters) == 9
assert tbs.parameters.local_town.child_allowance.amount is not None
def test_unload_extensions():
tbs = CountryTaxBenefitSystem()
assert tbs.get_variable('local_town_child_allowance') is None
@raises(ValueError)
def test_failure_to_load_extension_when_directory_doesnt_exist():
tbs.load_extension('/this/is/not/a/real/path')
| from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs.get_variable('local_town_child_allowance') is None
def walk_and_count(node):
c = 0
for item_name, item in node.children.items():
if isinstance(item, ParameterNode):
c += walk_and_count(item)
else:
c += 1
return c
def test_load_extension():
assert len(tbs.variables) == 16
assert walk_and_count(tbs.parameters) == 8
tbs.load_extension('openfisca_extension_template')
assert len(tbs.variables) == 17
assert tbs.get_variable('local_town_child_allowance') is not None
assert walk_and_count(tbs.parameters) == 9
assert tbs.parameters('2016-01').local_town.child_allowance.amount == 100.0
assert tbs.parameters.local_town.child_allowance.amount is not None
def test_unload_extensions():
tbs = CountryTaxBenefitSystem()
assert tbs.get_variable('local_town_child_allowance') is None
@raises(ValueError)
def test_failure_to_load_extension_when_directory_doesnt_exist():
tbs.load_extension('/this/is/not/a/real/path')
| Test extension's parameter access for a given period | Test extension's parameter access for a given period
| Python | agpl-3.0 | openfisca/openfisca-core,openfisca/openfisca-core | python | ## Code Before:
from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs.get_variable('local_town_child_allowance') is None
def walk_and_count(node):
c = 0
for item_name, item in node.children.items():
if isinstance(item, ParameterNode):
c += walk_and_count(item)
else:
c += 1
return c
def test_load_extension():
assert len(tbs.variables) == 16
assert walk_and_count(tbs.parameters) == 8
tbs.load_extension('openfisca_extension_template')
assert len(tbs.variables) == 17
assert tbs.get_variable('local_town_child_allowance') is not None
assert walk_and_count(tbs.parameters) == 9
assert tbs.parameters.local_town.child_allowance.amount is not None
def test_unload_extensions():
tbs = CountryTaxBenefitSystem()
assert tbs.get_variable('local_town_child_allowance') is None
@raises(ValueError)
def test_failure_to_load_extension_when_directory_doesnt_exist():
tbs.load_extension('/this/is/not/a/real/path')
## Instruction:
Test extension's parameter access for a given period
## Code After:
from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs.get_variable('local_town_child_allowance') is None
def walk_and_count(node):
c = 0
for item_name, item in node.children.items():
if isinstance(item, ParameterNode):
c += walk_and_count(item)
else:
c += 1
return c
def test_load_extension():
assert len(tbs.variables) == 16
assert walk_and_count(tbs.parameters) == 8
tbs.load_extension('openfisca_extension_template')
assert len(tbs.variables) == 17
assert tbs.get_variable('local_town_child_allowance') is not None
assert walk_and_count(tbs.parameters) == 9
assert tbs.parameters('2016-01').local_town.child_allowance.amount == 100.0
assert tbs.parameters.local_town.child_allowance.amount is not None
def test_unload_extensions():
tbs = CountryTaxBenefitSystem()
assert tbs.get_variable('local_town_child_allowance') is None
@raises(ValueError)
def test_failure_to_load_extension_when_directory_doesnt_exist():
tbs.load_extension('/this/is/not/a/real/path')
| from __future__ import unicode_literals, print_function, division, absolute_import
from nose.tools import raises
from openfisca_core.parameters import ParameterNode
from openfisca_country_template import CountryTaxBenefitSystem
tbs = CountryTaxBenefitSystem()
def test_extension_not_already_loaded():
assert tbs.get_variable('local_town_child_allowance') is None
def walk_and_count(node):
c = 0
for item_name, item in node.children.items():
if isinstance(item, ParameterNode):
c += walk_and_count(item)
else:
c += 1
return c
def test_load_extension():
assert len(tbs.variables) == 16
assert walk_and_count(tbs.parameters) == 8
tbs.load_extension('openfisca_extension_template')
assert len(tbs.variables) == 17
assert tbs.get_variable('local_town_child_allowance') is not None
assert walk_and_count(tbs.parameters) == 9
+ assert tbs.parameters('2016-01').local_town.child_allowance.amount == 100.0
assert tbs.parameters.local_town.child_allowance.amount is not None
def test_unload_extensions():
tbs = CountryTaxBenefitSystem()
assert tbs.get_variable('local_town_child_allowance') is None
@raises(ValueError)
def test_failure_to_load_extension_when_directory_doesnt_exist():
tbs.load_extension('/this/is/not/a/real/path') | 1 | 0.022727 | 1 | 0 |
10e61b6e288e77c4964cf256b52e1a0b1769dc40 | sbin/backup-backup.sh | sbin/backup-backup.sh | set -x
exec sudo \
ionice -c 3 \
nice rsync \
-vrtpAXlHogS \
--progress \
--delete-before \
--exclude=temporary/ \
"$@" -- /media/archive/* "/media/${1:-extern}"
| set -x
readonly backup_dir="/media/${1:-extern}"
if [[ ! -d $backup_dir ]]; then
echo >&2 "No such directory: $backup_dir"
exit 1
fi
exec sudo \
ionice -c 3 \
nice rsync \
-vrtpAXlHogS \
--progress \
--delete-before \
--exclude=temporary/ \
"$@" -- /media/archive/* "$backup_dir"
| Add check to prevent root backups. | Add check to prevent root backups.
| Shell | mit | ammongit/scripts,ammongit/scripts,ammongit/scripts,ammongit/scripts | shell | ## Code Before:
set -x
exec sudo \
ionice -c 3 \
nice rsync \
-vrtpAXlHogS \
--progress \
--delete-before \
--exclude=temporary/ \
"$@" -- /media/archive/* "/media/${1:-extern}"
## Instruction:
Add check to prevent root backups.
## Code After:
set -x
readonly backup_dir="/media/${1:-extern}"
if [[ ! -d $backup_dir ]]; then
echo >&2 "No such directory: $backup_dir"
exit 1
fi
exec sudo \
ionice -c 3 \
nice rsync \
-vrtpAXlHogS \
--progress \
--delete-before \
--exclude=temporary/ \
"$@" -- /media/archive/* "$backup_dir"
| set -x
+
+ readonly backup_dir="/media/${1:-extern}"
+
+ if [[ ! -d $backup_dir ]]; then
+ echo >&2 "No such directory: $backup_dir"
+ exit 1
+ fi
exec sudo \
ionice -c 3 \
nice rsync \
-vrtpAXlHogS \
--progress \
--delete-before \
--exclude=temporary/ \
- "$@" -- /media/archive/* "/media/${1:-extern}"
+ "$@" -- /media/archive/* "$backup_dir" | 9 | 0.9 | 8 | 1 |
e1f27f099e44720dc1b5600bd488a1e4e1861945 | src/plugins/comments/comments.css | src/plugins/comments/comments.css | .htCommentCell {
position: relative;
}
.htCommentCell:after {
content: '';
position: absolute;
top: 0;
right: 0;
border-left: 6px solid transparent;
border-top: 6px solid black;
}
.htComments {
display: none;
z-index: 1059;
position: absolute;
}
.htCommentTextArea {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px;
border: none;
border-left: 3px solid #ccc;
background-color: #fff;
width: 215px;
height: 90px;
font-size: 12px;
padding: 5px;
outline: 0px !important;
-webkit-appearance: none;
}
.htCommentTextArea:focus {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px, inset 0 0 0 1px #5292f7;
border-left: 3px solid #5292f7;
}
| .htCommentCell {
position: relative;
}
.htCommentCell:after {
content: '';
position: absolute;
top: 0;
right: 0;
border-left: 6px solid transparent;
border-top: 6px solid black;
}
.htComments {
display: none;
z-index: 1059;
position: absolute;
}
.htCommentTextArea {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: none;
border-left: 3px solid #ccc;
background-color: #fff;
width: 215px;
height: 90px;
font-size: 12px;
padding: 5px;
outline: 0px !important;
-webkit-appearance: none;
}
.htCommentTextArea:focus {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px, inset 0 0 0 1px #5292f7;
border-left: 3px solid #5292f7;
}
| Add box-sizing:border-box to the Comments editor. | Add box-sizing:border-box to the Comments editor.
| CSS | mit | floribon/handsontable,floribon/handsontable,rjansen72/handsontable,rjansen72/handsontable,floribon/handsontable | css | ## Code Before:
.htCommentCell {
position: relative;
}
.htCommentCell:after {
content: '';
position: absolute;
top: 0;
right: 0;
border-left: 6px solid transparent;
border-top: 6px solid black;
}
.htComments {
display: none;
z-index: 1059;
position: absolute;
}
.htCommentTextArea {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px;
border: none;
border-left: 3px solid #ccc;
background-color: #fff;
width: 215px;
height: 90px;
font-size: 12px;
padding: 5px;
outline: 0px !important;
-webkit-appearance: none;
}
.htCommentTextArea:focus {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px, inset 0 0 0 1px #5292f7;
border-left: 3px solid #5292f7;
}
## Instruction:
Add box-sizing:border-box to the Comments editor.
## Code After:
.htCommentCell {
position: relative;
}
.htCommentCell:after {
content: '';
position: absolute;
top: 0;
right: 0;
border-left: 6px solid transparent;
border-top: 6px solid black;
}
.htComments {
display: none;
z-index: 1059;
position: absolute;
}
.htCommentTextArea {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: none;
border-left: 3px solid #ccc;
background-color: #fff;
width: 215px;
height: 90px;
font-size: 12px;
padding: 5px;
outline: 0px !important;
-webkit-appearance: none;
}
.htCommentTextArea:focus {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px, inset 0 0 0 1px #5292f7;
border-left: 3px solid #5292f7;
}
| .htCommentCell {
position: relative;
}
.htCommentCell:after {
content: '';
position: absolute;
top: 0;
right: 0;
border-left: 6px solid transparent;
border-top: 6px solid black;
}
.htComments {
display: none;
z-index: 1059;
position: absolute;
}
.htCommentTextArea {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
border: none;
border-left: 3px solid #ccc;
background-color: #fff;
width: 215px;
height: 90px;
font-size: 12px;
padding: 5px;
outline: 0px !important;
-webkit-appearance: none;
}
.htCommentTextArea:focus {
box-shadow: rgba(0, 0, 0, 0.117647) 0 1px 3px, rgba(0, 0, 0, 0.239216) 0 1px 2px, inset 0 0 0 1px #5292f7;
border-left: 3px solid #5292f7;
} | 3 | 0.083333 | 3 | 0 |
b00fef938e2fac4599bb22ef110038d76dc88f79 | setup.py | setup.py | from setuptools import setup
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=open('README.rst', 'rb').read().decode('utf-8'),
author='Ryan Hiebert',
author_email='ryan@ryanhiebert.com',
url='https://github.com/ryanhiebert/tox-travis',
license='MIT',
version='0.1',
py_modules=['tox_travis'],
entry_points={
'tox': ['travis = tox_travis'],
},
install_requires=['tox>=2.0'],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| from setuptools import setup
def fread(fn):
return open(fn, 'rb').read().decode('utf-8')
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=fread('README.rst') + '\n\n' + fread('HISTORY.rst'),
author='Ryan Hiebert',
author_email='ryan@ryanhiebert.com',
url='https://github.com/ryanhiebert/tox-travis',
license='MIT',
version='0.1',
py_modules=['tox_travis'],
entry_points={
'tox': ['travis = tox_travis'],
},
install_requires=['tox>=2.0'],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| Append HISTORY to long description on PyPI | Append HISTORY to long description on PyPI
| Python | mit | rpkilby/tox-travis,ryanhiebert/tox-travis,tox-dev/tox-travis | python | ## Code Before:
from setuptools import setup
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=open('README.rst', 'rb').read().decode('utf-8'),
author='Ryan Hiebert',
author_email='ryan@ryanhiebert.com',
url='https://github.com/ryanhiebert/tox-travis',
license='MIT',
version='0.1',
py_modules=['tox_travis'],
entry_points={
'tox': ['travis = tox_travis'],
},
install_requires=['tox>=2.0'],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
## Instruction:
Append HISTORY to long description on PyPI
## Code After:
from setuptools import setup
def fread(fn):
return open(fn, 'rb').read().decode('utf-8')
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=fread('README.rst') + '\n\n' + fread('HISTORY.rst'),
author='Ryan Hiebert',
author_email='ryan@ryanhiebert.com',
url='https://github.com/ryanhiebert/tox-travis',
license='MIT',
version='0.1',
py_modules=['tox_travis'],
entry_points={
'tox': ['travis = tox_travis'],
},
install_requires=['tox>=2.0'],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| from setuptools import setup
+
+
+ def fread(fn):
+ return open(fn, 'rb').read().decode('utf-8')
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
- long_description=open('README.rst', 'rb').read().decode('utf-8'),
+ long_description=fread('README.rst') + '\n\n' + fread('HISTORY.rst'),
author='Ryan Hiebert',
author_email='ryan@ryanhiebert.com',
url='https://github.com/ryanhiebert/tox-travis',
license='MIT',
version='0.1',
py_modules=['tox_travis'],
entry_points={
'tox': ['travis = tox_travis'],
},
install_requires=['tox>=2.0'],
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
) | 6 | 0.222222 | 5 | 1 |
ed5695de6ff6a8e4e77346bdfddbaebd57d55c93 | assets/js/components/organisms/SurveyQuestion.jsx | assets/js/components/organisms/SurveyQuestion.jsx | import React, { Component, PropTypes } from 'react'
import {
Well,
Input
} from 'react-bootstrap'
import {
selectSurveyQuestionResponse
} from './../../redux/survey/survey-actions'
class SurveyQuestion extends Component {
makeSelection(questionId, answer, event) {
this.props.dispatch(selectSurveyQuestionResponse(questionId, answer))
}
getValue(answer) {
if (this.props.question.selectedAnswer === answer.id) {
return 'on'
}
}
render() {
return (
<section>
{
<Well>
<label>{this.props.question.questionText}</label>
{
this.props.question.answers.map(answer => {
return (
<Input
checked={this.getValue.call(this, answer)}
onClick={this.makeSelection.bind(this, this.props.question.id, answer)}
type="radio"
label={answer.answerLabel} />
)
})
}
</Well>
}
</section>
)
}
}
SurveyQuestion.propTypes = {
question: PropTypes.object,
dispatch: PropTypes.func
}
export default SurveyQuestion
| import React, { Component, PropTypes } from 'react'
import {
Well,
Input
} from 'react-bootstrap'
import {
selectSurveyQuestionResponse
} from './../../redux/survey/survey-actions'
class SurveyQuestion extends Component {
makeSelection(questionId, answer, event) {
this.props.dispatch(selectSurveyQuestionResponse(questionId, answer))
}
getChecked(answer) {
return this.props.question.selectedAnswer === answer.id
}
render() {
return (
<section>
{
<Well>
<label>{this.props.question.questionText}</label>
{
this.props.question.answers.map(answer => {
return (
<Input
checked={this.getChecked.call(this, answer)}
onClick={this.makeSelection.bind(this, this.props.question.id, answer)}
type="radio"
label={answer.answerLabel} />
)
})
}
</Well>
}
</section>
)
}
}
SurveyQuestion.propTypes = {
question: PropTypes.object,
dispatch: PropTypes.func
}
export default SurveyQuestion
| Simplify function that checks if the radio button is checked on. | Simplify function that checks if the radio button is checked on.
| JSX | mit | wbprice/okcandidate,kmcurry/okcandidate,Code4HR/okcandidate,stanzheng/okcandidate | jsx | ## Code Before:
import React, { Component, PropTypes } from 'react'
import {
Well,
Input
} from 'react-bootstrap'
import {
selectSurveyQuestionResponse
} from './../../redux/survey/survey-actions'
class SurveyQuestion extends Component {
makeSelection(questionId, answer, event) {
this.props.dispatch(selectSurveyQuestionResponse(questionId, answer))
}
getValue(answer) {
if (this.props.question.selectedAnswer === answer.id) {
return 'on'
}
}
render() {
return (
<section>
{
<Well>
<label>{this.props.question.questionText}</label>
{
this.props.question.answers.map(answer => {
return (
<Input
checked={this.getValue.call(this, answer)}
onClick={this.makeSelection.bind(this, this.props.question.id, answer)}
type="radio"
label={answer.answerLabel} />
)
})
}
</Well>
}
</section>
)
}
}
SurveyQuestion.propTypes = {
question: PropTypes.object,
dispatch: PropTypes.func
}
export default SurveyQuestion
## Instruction:
Simplify function that checks if the radio button is checked on.
## Code After:
import React, { Component, PropTypes } from 'react'
import {
Well,
Input
} from 'react-bootstrap'
import {
selectSurveyQuestionResponse
} from './../../redux/survey/survey-actions'
class SurveyQuestion extends Component {
makeSelection(questionId, answer, event) {
this.props.dispatch(selectSurveyQuestionResponse(questionId, answer))
}
getChecked(answer) {
return this.props.question.selectedAnswer === answer.id
}
render() {
return (
<section>
{
<Well>
<label>{this.props.question.questionText}</label>
{
this.props.question.answers.map(answer => {
return (
<Input
checked={this.getChecked.call(this, answer)}
onClick={this.makeSelection.bind(this, this.props.question.id, answer)}
type="radio"
label={answer.answerLabel} />
)
})
}
</Well>
}
</section>
)
}
}
SurveyQuestion.propTypes = {
question: PropTypes.object,
dispatch: PropTypes.func
}
export default SurveyQuestion
| import React, { Component, PropTypes } from 'react'
import {
Well,
Input
} from 'react-bootstrap'
import {
selectSurveyQuestionResponse
} from './../../redux/survey/survey-actions'
class SurveyQuestion extends Component {
makeSelection(questionId, answer, event) {
this.props.dispatch(selectSurveyQuestionResponse(questionId, answer))
}
- getValue(answer) {
? ^^^^
+ getChecked(answer) {
? ^^ ++++
- if (this.props.question.selectedAnswer === answer.id) {
? ^^ - ---
+ return this.props.question.selectedAnswer === answer.id
? ^^^^^^
- return 'on'
- }
}
render() {
return (
<section>
{
<Well>
<label>{this.props.question.questionText}</label>
{
this.props.question.answers.map(answer => {
return (
<Input
- checked={this.getValue.call(this, answer)}
? ^^^^
+ checked={this.getChecked.call(this, answer)}
? ^^ ++++
onClick={this.makeSelection.bind(this, this.props.question.id, answer)}
type="radio"
label={answer.answerLabel} />
)
})
}
</Well>
}
</section>
)
}
}
SurveyQuestion.propTypes = {
question: PropTypes.object,
dispatch: PropTypes.func
}
export default SurveyQuestion | 8 | 0.150943 | 3 | 5 |
7c76b7df25454cd2ca4dfe6c3920bbc956dfe8d6 | .circleci/config.yml | .circleci/config.yml | version: 2
jobs:
build:
working_directory: ~/danger
docker:
- image: ruby:2.3
environment:
- RAILS_ENV=test
- RACK_ENV=test
steps:
- checkout
- run: gem update --system 2.4.8
- run: gem install bundler
- restore_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
paths:
- vendor/bundle
- run: git config --global user.email "danger@example.com"
- run: git config --global user.name "Danger McShane"
- run: bundle exec rake specs
- run: '[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger || echo "Skipping Danger for External Contributor"'
- run: bundle exec danger init --mousey --impatient
| version: 2
jobs:
build:
working_directory: ~/danger
docker:
- image: ruby:2.3
environment:
- RAILS_ENV=test
- RACK_ENV=test
steps:
- checkout
- run: gem update --system 2.4.8
- run: gem install bundler -v '1.17.3'
- restore_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
paths:
- vendor/bundle
- run: git config --global user.email "danger@example.com"
- run: git config --global user.name "Danger McShane"
- run: bundle exec rake specs
- run: '[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger || echo "Skipping Danger for External Contributor"'
- run: bundle exec danger init --mousey --impatient
| Update bundler version for CircleCI | Update bundler version for CircleCI
| YAML | mit | danger/danger,KrauseFx/danger,danger/danger,KrauseFx/danger,danger/danger | yaml | ## Code Before:
version: 2
jobs:
build:
working_directory: ~/danger
docker:
- image: ruby:2.3
environment:
- RAILS_ENV=test
- RACK_ENV=test
steps:
- checkout
- run: gem update --system 2.4.8
- run: gem install bundler
- restore_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
paths:
- vendor/bundle
- run: git config --global user.email "danger@example.com"
- run: git config --global user.name "Danger McShane"
- run: bundle exec rake specs
- run: '[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger || echo "Skipping Danger for External Contributor"'
- run: bundle exec danger init --mousey --impatient
## Instruction:
Update bundler version for CircleCI
## Code After:
version: 2
jobs:
build:
working_directory: ~/danger
docker:
- image: ruby:2.3
environment:
- RAILS_ENV=test
- RACK_ENV=test
steps:
- checkout
- run: gem update --system 2.4.8
- run: gem install bundler -v '1.17.3'
- restore_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
paths:
- vendor/bundle
- run: git config --global user.email "danger@example.com"
- run: git config --global user.name "Danger McShane"
- run: bundle exec rake specs
- run: '[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger || echo "Skipping Danger for External Contributor"'
- run: bundle exec danger init --mousey --impatient
| version: 2
jobs:
build:
working_directory: ~/danger
docker:
- image: ruby:2.3
environment:
- RAILS_ENV=test
- RACK_ENV=test
steps:
- checkout
- run: gem update --system 2.4.8
- - run: gem install bundler
+ - run: gem install bundler -v '1.17.3'
? ++++++++++++
- restore_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile" }}
paths:
- vendor/bundle
- run: git config --global user.email "danger@example.com"
- run: git config --global user.name "Danger McShane"
- run: bundle exec rake specs
- run: '[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger || echo "Skipping Danger for External Contributor"'
- run: bundle exec danger init --mousey --impatient | 2 | 0.08 | 1 | 1 |
fa7ef5281cadaf8e2fd5685aca1d92b41a5c96e6 | util/ansible/roles/azuracast-user/tasks/main.yml | util/ansible/roles/azuracast-user/tasks/main.yml | ---
- name: (Prod) Generate AzuraCast Password
command: pwgen 8 -sn 1
register: prod_azuracast_user_password
when: app_env == "production"
- name: Assign User Password
set_fact:
azuracast_user_password: "{{ prod_azuracast_user_password.stdout if app_env == 'production' else dev_azuracast_user_password }}"
- name: Create AzuraCast User
become: true
user:
name: azuracast
home: "{{ app_base }}"
comment: "AzuraCast"
shell: /bin/bash
groups: 'sudo,admin,www-data'
password: "{{ azuracast_user_password|password_hash('sha512') }}"
- name: Create www-data group
become: true
group: name=www-data state=present
- name: Modify www-data User
become: true
user: name=www-data groups="azuracast" append=yes
- name: (Dev) Modify vagrant User
become: true
user: name=vagrant groups="www-data" append=yes
when: app_env == "development"
- name: (Dev) Modify www-data User
become: true
user: name=www-data groups="vagrant" append=yes
when: app_env == "development"
- name: (Dev) Add azuracast User to vagrant Group
become: true
user: name=azuracast groups="vagrant" append=yes
when: app_env == "development" | ---
- name: (Prod) Generate AzuraCast Password
command: pwgen 8 -sn 1
register: prod_azuracast_user_password
when: app_env == "production"
- name: Create Groups
become: true
group: name="{{ item }}" state=present
with_items:
- www-data
- admin
- name: Assign User Password
set_fact:
azuracast_user_password: "{{ prod_azuracast_user_password.stdout if app_env == 'production' else dev_azuracast_user_password }}"
- name: Create AzuraCast User
become: true
user:
name: azuracast
home: "{{ app_base }}"
comment: "AzuraCast"
shell: /bin/bash
groups: 'sudo,admin,www-data'
password: "{{ azuracast_user_password|password_hash('sha512') }}"
- name: Modify www-data User
become: true
user: name=www-data groups="azuracast" append=yes
- name: (Dev) Modify vagrant User
become: true
user: name=vagrant groups="www-data" append=yes
when: app_env == "development"
- name: (Dev) Modify www-data User
become: true
user: name=www-data groups="vagrant" append=yes
when: app_env == "development"
- name: (Dev) Add azuracast User to vagrant Group
become: true
user: name=azuracast groups="vagrant" append=yes
when: app_env == "development" | Move group creation up and ensure existence of "admin" group. | Move group creation up and ensure existence of "admin" group.
| YAML | agpl-3.0 | SlvrEagle23/AzuraCast,AzuraCast/AzuraCast,SlvrEagle23/AzuraCast,AzuraCast/AzuraCast,SlvrEagle23/AzuraCast,SlvrEagle23/AzuraCast,AzuraCast/AzuraCast,SlvrEagle23/AzuraCast,AzuraCast/AzuraCast | yaml | ## Code Before:
---
- name: (Prod) Generate AzuraCast Password
command: pwgen 8 -sn 1
register: prod_azuracast_user_password
when: app_env == "production"
- name: Assign User Password
set_fact:
azuracast_user_password: "{{ prod_azuracast_user_password.stdout if app_env == 'production' else dev_azuracast_user_password }}"
- name: Create AzuraCast User
become: true
user:
name: azuracast
home: "{{ app_base }}"
comment: "AzuraCast"
shell: /bin/bash
groups: 'sudo,admin,www-data'
password: "{{ azuracast_user_password|password_hash('sha512') }}"
- name: Create www-data group
become: true
group: name=www-data state=present
- name: Modify www-data User
become: true
user: name=www-data groups="azuracast" append=yes
- name: (Dev) Modify vagrant User
become: true
user: name=vagrant groups="www-data" append=yes
when: app_env == "development"
- name: (Dev) Modify www-data User
become: true
user: name=www-data groups="vagrant" append=yes
when: app_env == "development"
- name: (Dev) Add azuracast User to vagrant Group
become: true
user: name=azuracast groups="vagrant" append=yes
when: app_env == "development"
## Instruction:
Move group creation up and ensure existence of "admin" group.
## Code After:
---
- name: (Prod) Generate AzuraCast Password
command: pwgen 8 -sn 1
register: prod_azuracast_user_password
when: app_env == "production"
- name: Create Groups
become: true
group: name="{{ item }}" state=present
with_items:
- www-data
- admin
- name: Assign User Password
set_fact:
azuracast_user_password: "{{ prod_azuracast_user_password.stdout if app_env == 'production' else dev_azuracast_user_password }}"
- name: Create AzuraCast User
become: true
user:
name: azuracast
home: "{{ app_base }}"
comment: "AzuraCast"
shell: /bin/bash
groups: 'sudo,admin,www-data'
password: "{{ azuracast_user_password|password_hash('sha512') }}"
- name: Modify www-data User
become: true
user: name=www-data groups="azuracast" append=yes
- name: (Dev) Modify vagrant User
become: true
user: name=vagrant groups="www-data" append=yes
when: app_env == "development"
- name: (Dev) Modify www-data User
become: true
user: name=www-data groups="vagrant" append=yes
when: app_env == "development"
- name: (Dev) Add azuracast User to vagrant Group
become: true
user: name=azuracast groups="vagrant" append=yes
when: app_env == "development" | ---
- name: (Prod) Generate AzuraCast Password
command: pwgen 8 -sn 1
register: prod_azuracast_user_password
when: app_env == "production"
+
+ - name: Create Groups
+ become: true
+ group: name="{{ item }}" state=present
+ with_items:
+ - www-data
+ - admin
- name: Assign User Password
set_fact:
azuracast_user_password: "{{ prod_azuracast_user_password.stdout if app_env == 'production' else dev_azuracast_user_password }}"
- name: Create AzuraCast User
become: true
user:
name: azuracast
home: "{{ app_base }}"
comment: "AzuraCast"
shell: /bin/bash
groups: 'sudo,admin,www-data'
password: "{{ azuracast_user_password|password_hash('sha512') }}"
-
- - name: Create www-data group
- become: true
- group: name=www-data state=present
- name: Modify www-data User
become: true
user: name=www-data groups="azuracast" append=yes
- name: (Dev) Modify vagrant User
become: true
user: name=vagrant groups="www-data" append=yes
when: app_env == "development"
- name: (Dev) Modify www-data User
become: true
user: name=www-data groups="vagrant" append=yes
when: app_env == "development"
- name: (Dev) Add azuracast User to vagrant Group
become: true
user: name=azuracast groups="vagrant" append=yes
when: app_env == "development" | 11 | 0.261905 | 7 | 4 |
c27e07e1fc8c300e286686427db590f6cb70728f | openfisca_france/parameters/prelevements_sociaux/cotisations_sociales/fds/indice_majore_de_reference.yaml | openfisca_france/parameters/prelevements_sociaux/cotisations_sociales/fds/indice_majore_de_reference.yaml | reference: https://www.ipp.eu/outils/baremes-ipp/
values:
1989-09-01:
value: 254.0
1991-02-01:
value: 259.0
1991-08-01:
value: 261.0
1998-01-01:
value: 280.0
1998-07-01:
value: 282.0
1999-04-01:
value: 283.0
1999-07-01:
value: 285.0
1999-12-01:
value: 286.0
2001-05-01:
value: 288.0
2006-11-01:
value: 289.0
2008-07-01:
value: 290.0
2009-07-01:
value: 292.0
2011-01-01:
value: 295.0
2012-01-01:
value: 302.0
2012-07-01:
value: 308.0
2013-01-01:
value: 309.0
| reference: https://www.ipp.eu/outils/baremes-ipp/
values:
1989-09-01:
value: 254.0
1991-02-01:
value: 259.0
1991-08-01:
value: 261.0
1998-01-01:
value: 280.0
1998-07-01:
value: 282.0
1999-04-01:
value: 283.0
1999-07-01:
value: 285.0
1999-12-01:
value: 286.0
2001-05-01:
value: 288.0
2006-11-01:
value: 289.0
2008-07-01:
value: 290.0
2009-07-01:
value: 292.0
2011-01-01:
value: 295.0
2012-01-01:
value: 302.0
2012-07-01:
value: 308.0
2013-01-01:
value: 309.0
2017-03-01:
value: 313.0
| Improve parameters cotisation exceptionnelle de solidarite | Improve parameters cotisation exceptionnelle de solidarite
| YAML | agpl-3.0 | sgmap/openfisca-france,sgmap/openfisca-france | yaml | ## Code Before:
reference: https://www.ipp.eu/outils/baremes-ipp/
values:
1989-09-01:
value: 254.0
1991-02-01:
value: 259.0
1991-08-01:
value: 261.0
1998-01-01:
value: 280.0
1998-07-01:
value: 282.0
1999-04-01:
value: 283.0
1999-07-01:
value: 285.0
1999-12-01:
value: 286.0
2001-05-01:
value: 288.0
2006-11-01:
value: 289.0
2008-07-01:
value: 290.0
2009-07-01:
value: 292.0
2011-01-01:
value: 295.0
2012-01-01:
value: 302.0
2012-07-01:
value: 308.0
2013-01-01:
value: 309.0
## Instruction:
Improve parameters cotisation exceptionnelle de solidarite
## Code After:
reference: https://www.ipp.eu/outils/baremes-ipp/
values:
1989-09-01:
value: 254.0
1991-02-01:
value: 259.0
1991-08-01:
value: 261.0
1998-01-01:
value: 280.0
1998-07-01:
value: 282.0
1999-04-01:
value: 283.0
1999-07-01:
value: 285.0
1999-12-01:
value: 286.0
2001-05-01:
value: 288.0
2006-11-01:
value: 289.0
2008-07-01:
value: 290.0
2009-07-01:
value: 292.0
2011-01-01:
value: 295.0
2012-01-01:
value: 302.0
2012-07-01:
value: 308.0
2013-01-01:
value: 309.0
2017-03-01:
value: 313.0
| reference: https://www.ipp.eu/outils/baremes-ipp/
values:
1989-09-01:
value: 254.0
1991-02-01:
value: 259.0
1991-08-01:
value: 261.0
1998-01-01:
value: 280.0
1998-07-01:
value: 282.0
1999-04-01:
value: 283.0
1999-07-01:
value: 285.0
1999-12-01:
value: 286.0
2001-05-01:
value: 288.0
2006-11-01:
value: 289.0
2008-07-01:
value: 290.0
2009-07-01:
value: 292.0
2011-01-01:
value: 295.0
2012-01-01:
value: 302.0
2012-07-01:
value: 308.0
2013-01-01:
value: 309.0
+ 2017-03-01:
+ value: 313.0 | 2 | 0.058824 | 2 | 0 |
f8b46b3bd38088cf15385dc1c3d238bc45e94a8d | lib/arjdbc/relativity/connection_methods.rb | lib/arjdbc/relativity/connection_methods.rb | class ActiveRecord::Base
class << self
def relativity_connection( config )
config[:port] ||= 1583
config[:url] ||= "jdbc:relativity://#{config[:host]}:#{config[:port]}/#{ config[:database]}"
config[:driver] ||= 'relativity.jdbc.Driver'
config[:adapter_spec] ||= ::ArJdbc::Relativity
config[:adapter_class] = ActiveRecord::ConnectionAdapters::RelativityAdapter unless config.key?(:adapter_class)
if config.key?(:adapter_class) && config[:adapter_class].class == String
config[:adapter_class] = config[:adapter_class].constantize
elsif config.key?(:adapter_class)
config[:adapter_class] = config[:adapter_class]
else
config[:adapter_class] = ActiveRecord::ConnectionAdapters::RelativityAdapter
end
jdbc_connection(config)
end
end
end
| class ActiveRecord::Base
class << self
def relativity_connection( config )
config[:port] ||= 1583
config[:url] ||= "jdbc:relativity://#{config[:host]}:#{config[:port]}/#{ config[:database]}"
config[:driver] ||= 'relativity.jdbc.Driver'
config[:adapter_spec] ||= ::ArJdbc::Relativity
config[:adapter_class] = if config.key?(:adapter_class) && config[:adapter_class].class == String
config[:adapter_class].constantize
elsif config.key?(:adapter_class)
config[:adapter_class]
else
ActiveRecord::ConnectionAdapters::RelativityAdapter
end
jdbc_connection(config)
end
end
end
| Clean up adapter class code ID:866 | Clean up adapter class code ID:866
| Ruby | mit | josephbridgwaterrowe/activerecord-relativity-adapter | ruby | ## Code Before:
class ActiveRecord::Base
class << self
def relativity_connection( config )
config[:port] ||= 1583
config[:url] ||= "jdbc:relativity://#{config[:host]}:#{config[:port]}/#{ config[:database]}"
config[:driver] ||= 'relativity.jdbc.Driver'
config[:adapter_spec] ||= ::ArJdbc::Relativity
config[:adapter_class] = ActiveRecord::ConnectionAdapters::RelativityAdapter unless config.key?(:adapter_class)
if config.key?(:adapter_class) && config[:adapter_class].class == String
config[:adapter_class] = config[:adapter_class].constantize
elsif config.key?(:adapter_class)
config[:adapter_class] = config[:adapter_class]
else
config[:adapter_class] = ActiveRecord::ConnectionAdapters::RelativityAdapter
end
jdbc_connection(config)
end
end
end
## Instruction:
Clean up adapter class code ID:866
## Code After:
class ActiveRecord::Base
class << self
def relativity_connection( config )
config[:port] ||= 1583
config[:url] ||= "jdbc:relativity://#{config[:host]}:#{config[:port]}/#{ config[:database]}"
config[:driver] ||= 'relativity.jdbc.Driver'
config[:adapter_spec] ||= ::ArJdbc::Relativity
config[:adapter_class] = if config.key?(:adapter_class) && config[:adapter_class].class == String
config[:adapter_class].constantize
elsif config.key?(:adapter_class)
config[:adapter_class]
else
ActiveRecord::ConnectionAdapters::RelativityAdapter
end
jdbc_connection(config)
end
end
end
| class ActiveRecord::Base
class << self
def relativity_connection( config )
config[:port] ||= 1583
config[:url] ||= "jdbc:relativity://#{config[:host]}:#{config[:port]}/#{ config[:database]}"
config[:driver] ||= 'relativity.jdbc.Driver'
config[:adapter_spec] ||= ::ArJdbc::Relativity
- config[:adapter_class] = ActiveRecord::ConnectionAdapters::RelativityAdapter unless config.key?(:adapter_class)
- if config.key?(:adapter_class) && config[:adapter_class].class == String
+ config[:adapter_class] = if config.key?(:adapter_class) && config[:adapter_class].class == String
? +++++++++++++++++++++++++
- config[:adapter_class] = config[:adapter_class].constantize
+ config[:adapter_class].constantize
- elsif config.key?(:adapter_class)
+ elsif config.key?(:adapter_class)
? +++++++++++++++++++++++++
- config[:adapter_class] = config[:adapter_class]
- else
- config[:adapter_class] = ActiveRecord::ConnectionAdapters::RelativityAdapter
- end
+ config[:adapter_class]
+ else
+ ActiveRecord::ConnectionAdapters::RelativityAdapter
+ end
jdbc_connection(config)
end
end
end | 15 | 0.75 | 7 | 8 |
766c1c9e05400064476149e50ea808a539bcb96d | pubspec.yaml | pubspec.yaml | name: async
version: 2.2.0
description: Utility functions and classes related to the 'dart:async' library.
author: Dart Team <misc@dartlang.org>
homepage: https://www.github.com/dart-lang/async
environment:
sdk: '>=2.0.0 <3.0.0'
dependencies:
collection: ^1.5.0
dev_dependencies:
fake_async: ^1.0.0
stack_trace: ^1.0.0
test: ^1.0.0
# For building and testing with DDC
build_runner: ^1.0.0
build_web_compilers: ^1.0.0
build_test: ^0.10.1
| name: async
version: 2.2.0
description: Utility functions and classes related to the 'dart:async' library.
author: Dart Team <misc@dartlang.org>
homepage: https://www.github.com/dart-lang/async
environment:
sdk: '>=2.0.0 <3.0.0'
dependencies:
collection: ^1.5.0
dev_dependencies:
fake_async: ^1.0.0
stack_trace: ^1.0.0
test: ^1.0.0
| Drop dependencies on build_runner, etc – not used! | Drop dependencies on build_runner, etc – not used!
| YAML | bsd-3-clause | dart-lang/async | yaml | ## Code Before:
name: async
version: 2.2.0
description: Utility functions and classes related to the 'dart:async' library.
author: Dart Team <misc@dartlang.org>
homepage: https://www.github.com/dart-lang/async
environment:
sdk: '>=2.0.0 <3.0.0'
dependencies:
collection: ^1.5.0
dev_dependencies:
fake_async: ^1.0.0
stack_trace: ^1.0.0
test: ^1.0.0
# For building and testing with DDC
build_runner: ^1.0.0
build_web_compilers: ^1.0.0
build_test: ^0.10.1
## Instruction:
Drop dependencies on build_runner, etc – not used!
## Code After:
name: async
version: 2.2.0
description: Utility functions and classes related to the 'dart:async' library.
author: Dart Team <misc@dartlang.org>
homepage: https://www.github.com/dart-lang/async
environment:
sdk: '>=2.0.0 <3.0.0'
dependencies:
collection: ^1.5.0
dev_dependencies:
fake_async: ^1.0.0
stack_trace: ^1.0.0
test: ^1.0.0
| name: async
version: 2.2.0
description: Utility functions and classes related to the 'dart:async' library.
author: Dart Team <misc@dartlang.org>
homepage: https://www.github.com/dart-lang/async
environment:
sdk: '>=2.0.0 <3.0.0'
dependencies:
collection: ^1.5.0
dev_dependencies:
fake_async: ^1.0.0
stack_trace: ^1.0.0
test: ^1.0.0
- # For building and testing with DDC
- build_runner: ^1.0.0
- build_web_compilers: ^1.0.0
- build_test: ^0.10.1 | 4 | 0.190476 | 0 | 4 |
12da4f825cf10ae7e81b0514d0aa80b8c5975158 | app/models/mixins/deprecation_mixin.rb | app/models/mixins/deprecation_mixin.rb | module DeprecationMixin
extend ActiveSupport::Concern
module ClassMethods
private
def deprecate_belongs_to(old_belongs_to, new_belongs_to)
deprecate_attribute_methods(old_belongs_to, new_belongs_to)
["_id", "_id=", "_id?"].each do |suffix|
define_method("#{old_belongs_to}#{suffix}") do |*args|
args.present? ? send("#{new_belongs_to}#{suffix}", *args) : send("#{new_belongs_to}#{suffix}")
end
Vmdb::Deprecation.deprecate_methods(self, "#{old_belongs_to}#{suffix}" => "#{new_belongs_to}#{suffix}")
end
virtual_belongs_to(old_belongs_to)
end
def deprecate_attribute(old_attribute, new_attribute)
deprecate_attribute_methods(old_attribute, new_attribute)
virtual_column(old_attribute, :type => column_types[new_attribute.to_s].type)
end
def deprecate_attribute_methods(old_attribute, new_attribute)
alias_attribute old_attribute, new_attribute
["", "=", "?"].each { |suffix| Vmdb::Deprecation.deprecate_methods(self, "#{old_attribute}#{suffix}" => "#{new_attribute}#{suffix}") }
end
end
end
| module DeprecationMixin
extend ActiveSupport::Concern
module ClassMethods
private
def deprecate_belongs_to(old_belongs_to, new_belongs_to)
deprecate_attribute_methods(old_belongs_to, new_belongs_to)
["_id", "_id=", "_id?"].each do |suffix|
define_method("#{old_belongs_to}#{suffix}") do |*args|
args.present? ? send("#{new_belongs_to}#{suffix}", *args) : send("#{new_belongs_to}#{suffix}")
end
Vmdb::Deprecation.deprecate_methods(self, "#{old_belongs_to}#{suffix}" => "#{new_belongs_to}#{suffix}")
end
virtual_belongs_to(old_belongs_to)
end
def deprecate_attribute(old_attribute, new_attribute)
deprecate_attribute_methods(old_attribute, new_attribute)
virtual_column(old_attribute, :type => type_for_attribute(new_attribute.to_s).type)
end
def deprecate_attribute_methods(old_attribute, new_attribute)
alias_attribute old_attribute, new_attribute
["", "=", "?"].each { |suffix| Vmdb::Deprecation.deprecate_methods(self, "#{old_attribute}#{suffix}" => "#{new_attribute}#{suffix}") }
end
end
end
| Use the type_for_attribute helper instead of direct hash access | Use the type_for_attribute helper instead of direct hash access
| Ruby | apache-2.0 | mkanoor/manageiq,KevinLoiseau/manageiq,maas-ufcg/manageiq,andyvesel/manageiq,jvlcek/manageiq,juliancheal/manageiq,branic/manageiq,jameswnl/manageiq,jntullo/manageiq,andyvesel/manageiq,d-m-u/manageiq,mfeifer/manageiq,maas-ufcg/manageiq,chessbyte/manageiq,djberg96/manageiq,romaintb/manageiq,lpichler/manageiq,jvlcek/manageiq,agrare/manageiq,jvlcek/manageiq,josejulio/manageiq,romaintb/manageiq,NaNi-Z/manageiq,aufi/manageiq,ManageIQ/manageiq,yaacov/manageiq,borod108/manageiq,ilackarms/manageiq,juliancheal/manageiq,chessbyte/manageiq,lpichler/manageiq,fbladilo/manageiq,mkanoor/manageiq,mzazrivec/manageiq,matobet/manageiq,NickLaMuro/manageiq,maas-ufcg/manageiq,branic/manageiq,ManageIQ/manageiq,jameswnl/manageiq,mfeifer/manageiq,israel-hdez/manageiq,israel-hdez/manageiq,andyvesel/manageiq,agrare/manageiq,ailisp/manageiq,gerikis/manageiq,skateman/manageiq,romaintb/manageiq,ilackarms/manageiq,kbrock/manageiq,KevinLoiseau/manageiq,tinaafitz/manageiq,matobet/manageiq,mresti/manageiq,mzazrivec/manageiq,lpichler/manageiq,jrafanie/manageiq,d-m-u/manageiq,fbladilo/manageiq,gerikis/manageiq,NickLaMuro/manageiq,mfeifer/manageiq,tzumainn/manageiq,skateman/manageiq,fbladilo/manageiq,KevinLoiseau/manageiq,mkanoor/manageiq,NaNi-Z/manageiq,KevinLoiseau/manageiq,ManageIQ/manageiq,jntullo/manageiq,durandom/manageiq,gmcculloug/manageiq,maas-ufcg/manageiq,hstastna/manageiq,romaintb/manageiq,KevinLoiseau/manageiq,ManageIQ/manageiq,syncrou/manageiq,jntullo/manageiq,mresti/manageiq,andyvesel/manageiq,romanblanco/manageiq,tzumainn/manageiq,josejulio/manageiq,romaintb/manageiq,jvlcek/manageiq,syncrou/manageiq,hstastna/manageiq,mfeifer/manageiq,NickLaMuro/manageiq,mresti/manageiq,pkomanek/manageiq,hstastna/manageiq,israel-hdez/manageiq,billfitzgerald0120/manageiq,billfitzgerald0120/manageiq,jrafanie/manageiq,jameswnl/manageiq,josejulio/manageiq,jrafanie/manageiq,billfitzgerald0120/manageiq,romanblanco/manageiq,borod108/manageiq,yaacov/manageiq,ailisp/manageiq,pkomanek/manageiq,NickLaMuro/manageiq,NaNi-Z/manageiq,kbrock/manageiq,tzumainn/manageiq,ailisp/manageiq,branic/manageiq,kbrock/manageiq,djberg96/manageiq,durandom/manageiq,tzumainn/manageiq,gmcculloug/manageiq,pkomanek/manageiq,gmcculloug/manageiq,pkomanek/manageiq,matobet/manageiq,ailisp/manageiq,branic/manageiq,jrafanie/manageiq,mresti/manageiq,maas-ufcg/manageiq,romanblanco/manageiq,aufi/manageiq,maas-ufcg/manageiq,djberg96/manageiq,durandom/manageiq,matobet/manageiq,romaintb/manageiq,aufi/manageiq,ilackarms/manageiq,gerikis/manageiq,yaacov/manageiq,agrare/manageiq,skateman/manageiq,jntullo/manageiq,borod108/manageiq,israel-hdez/manageiq,mzazrivec/manageiq,hstastna/manageiq,gmcculloug/manageiq,syncrou/manageiq,chessbyte/manageiq,aufi/manageiq,skateman/manageiq,borod108/manageiq,chessbyte/manageiq,josejulio/manageiq,tinaafitz/manageiq,syncrou/manageiq,NaNi-Z/manageiq,kbrock/manageiq,agrare/manageiq,d-m-u/manageiq,ilackarms/manageiq,yaacov/manageiq,gerikis/manageiq,mzazrivec/manageiq,KevinLoiseau/manageiq,mkanoor/manageiq,tinaafitz/manageiq,durandom/manageiq,tinaafitz/manageiq,jameswnl/manageiq,fbladilo/manageiq,djberg96/manageiq,d-m-u/manageiq,juliancheal/manageiq,billfitzgerald0120/manageiq,juliancheal/manageiq,lpichler/manageiq,romanblanco/manageiq | ruby | ## Code Before:
module DeprecationMixin
extend ActiveSupport::Concern
module ClassMethods
private
def deprecate_belongs_to(old_belongs_to, new_belongs_to)
deprecate_attribute_methods(old_belongs_to, new_belongs_to)
["_id", "_id=", "_id?"].each do |suffix|
define_method("#{old_belongs_to}#{suffix}") do |*args|
args.present? ? send("#{new_belongs_to}#{suffix}", *args) : send("#{new_belongs_to}#{suffix}")
end
Vmdb::Deprecation.deprecate_methods(self, "#{old_belongs_to}#{suffix}" => "#{new_belongs_to}#{suffix}")
end
virtual_belongs_to(old_belongs_to)
end
def deprecate_attribute(old_attribute, new_attribute)
deprecate_attribute_methods(old_attribute, new_attribute)
virtual_column(old_attribute, :type => column_types[new_attribute.to_s].type)
end
def deprecate_attribute_methods(old_attribute, new_attribute)
alias_attribute old_attribute, new_attribute
["", "=", "?"].each { |suffix| Vmdb::Deprecation.deprecate_methods(self, "#{old_attribute}#{suffix}" => "#{new_attribute}#{suffix}") }
end
end
end
## Instruction:
Use the type_for_attribute helper instead of direct hash access
## Code After:
module DeprecationMixin
extend ActiveSupport::Concern
module ClassMethods
private
def deprecate_belongs_to(old_belongs_to, new_belongs_to)
deprecate_attribute_methods(old_belongs_to, new_belongs_to)
["_id", "_id=", "_id?"].each do |suffix|
define_method("#{old_belongs_to}#{suffix}") do |*args|
args.present? ? send("#{new_belongs_to}#{suffix}", *args) : send("#{new_belongs_to}#{suffix}")
end
Vmdb::Deprecation.deprecate_methods(self, "#{old_belongs_to}#{suffix}" => "#{new_belongs_to}#{suffix}")
end
virtual_belongs_to(old_belongs_to)
end
def deprecate_attribute(old_attribute, new_attribute)
deprecate_attribute_methods(old_attribute, new_attribute)
virtual_column(old_attribute, :type => type_for_attribute(new_attribute.to_s).type)
end
def deprecate_attribute_methods(old_attribute, new_attribute)
alias_attribute old_attribute, new_attribute
["", "=", "?"].each { |suffix| Vmdb::Deprecation.deprecate_methods(self, "#{old_attribute}#{suffix}" => "#{new_attribute}#{suffix}") }
end
end
end
| module DeprecationMixin
extend ActiveSupport::Concern
module ClassMethods
private
def deprecate_belongs_to(old_belongs_to, new_belongs_to)
deprecate_attribute_methods(old_belongs_to, new_belongs_to)
["_id", "_id=", "_id?"].each do |suffix|
define_method("#{old_belongs_to}#{suffix}") do |*args|
args.present? ? send("#{new_belongs_to}#{suffix}", *args) : send("#{new_belongs_to}#{suffix}")
end
Vmdb::Deprecation.deprecate_methods(self, "#{old_belongs_to}#{suffix}" => "#{new_belongs_to}#{suffix}")
end
virtual_belongs_to(old_belongs_to)
end
def deprecate_attribute(old_attribute, new_attribute)
deprecate_attribute_methods(old_attribute, new_attribute)
- virtual_column(old_attribute, :type => column_types[new_attribute.to_s].type)
? ------- ^^ ^
+ virtual_column(old_attribute, :type => type_for_attribute(new_attribute.to_s).type)
? ^^^^^^^^^^^^^^^ ^
end
def deprecate_attribute_methods(old_attribute, new_attribute)
alias_attribute old_attribute, new_attribute
["", "=", "?"].each { |suffix| Vmdb::Deprecation.deprecate_methods(self, "#{old_attribute}#{suffix}" => "#{new_attribute}#{suffix}") }
end
end
end | 2 | 0.071429 | 1 | 1 |
081708999045ff49f270614f23bb472d0e3c061f | src/SclZfCartPayment/PaymentMethodInterface.php | src/SclZfCartPayment/PaymentMethodInterface.php | <?php
namespace SclZfCartPayment;
use SclZfCart\Entity\OrderInterface;
use SclZfCartPayment\Entity\PaymentInterface;
use Zend\Form\Form;
/**
* The interface that a payment method must implement to integrate with this
* payment module.
*
* @author Tom Oram <tom@scl.co.uk>
*/
interface PaymentMethodInterface
{
/**
* The name of the payment method.
*
* @return string
*/
public function name();
/**
* The payment method may update the confirm form.
*
* @param Form $form
* @param OrderInteface $cart
* @param PaymentInterface $cart
* @return void
*/
public function updateCompleteForm(
Form $form,
OrderInterface $cart,
PaymentInterface $payment
);
/**
* Takes the values returned from the payment method and completes the payment.
*
* @param array $data
* @return boolean Return true if the payment was successful
*/
public function complete(array $data);
}
| <?php
namespace SclZfCartPayment;
use SclZfCart\Entity\OrderInterface;
use SclZfCartPayment\Entity\PaymentInterface;
use Zend\Form\Form;
/**
* The interface that a payment method must implement to integrate with this
* payment module.
*
* @author Tom Oram <tom@scl.co.uk>
*/
interface PaymentMethodInterface
{
/**
* The name of the payment method.
*
* @return string
*/
public function name();
/**
* The payment method may update the confirm form.
*
* @param Form $form
* @param OrderInteface $order
* @param PaymentInterface $payment
* @return void
*/
public function updateCompleteForm(
Form $form,
OrderInterface $order,
PaymentInterface $payment
);
/**
* Takes the values returned from the payment method and completes the payment.
*
* @param array $data
* @return boolean Return true if the payment was successful
*/
public function complete(array $data);
}
| Fix the param names for updateCompleteForm() | Fix the param names for updateCompleteForm()
| PHP | mit | SCLInternet/SclZfCartPayment,SCLInternet/SclZfCartPayment | php | ## Code Before:
<?php
namespace SclZfCartPayment;
use SclZfCart\Entity\OrderInterface;
use SclZfCartPayment\Entity\PaymentInterface;
use Zend\Form\Form;
/**
* The interface that a payment method must implement to integrate with this
* payment module.
*
* @author Tom Oram <tom@scl.co.uk>
*/
interface PaymentMethodInterface
{
/**
* The name of the payment method.
*
* @return string
*/
public function name();
/**
* The payment method may update the confirm form.
*
* @param Form $form
* @param OrderInteface $cart
* @param PaymentInterface $cart
* @return void
*/
public function updateCompleteForm(
Form $form,
OrderInterface $cart,
PaymentInterface $payment
);
/**
* Takes the values returned from the payment method and completes the payment.
*
* @param array $data
* @return boolean Return true if the payment was successful
*/
public function complete(array $data);
}
## Instruction:
Fix the param names for updateCompleteForm()
## Code After:
<?php
namespace SclZfCartPayment;
use SclZfCart\Entity\OrderInterface;
use SclZfCartPayment\Entity\PaymentInterface;
use Zend\Form\Form;
/**
* The interface that a payment method must implement to integrate with this
* payment module.
*
* @author Tom Oram <tom@scl.co.uk>
*/
interface PaymentMethodInterface
{
/**
* The name of the payment method.
*
* @return string
*/
public function name();
/**
* The payment method may update the confirm form.
*
* @param Form $form
* @param OrderInteface $order
* @param PaymentInterface $payment
* @return void
*/
public function updateCompleteForm(
Form $form,
OrderInterface $order,
PaymentInterface $payment
);
/**
* Takes the values returned from the payment method and completes the payment.
*
* @param array $data
* @return boolean Return true if the payment was successful
*/
public function complete(array $data);
}
| <?php
namespace SclZfCartPayment;
use SclZfCart\Entity\OrderInterface;
use SclZfCartPayment\Entity\PaymentInterface;
use Zend\Form\Form;
/**
* The interface that a payment method must implement to integrate with this
* payment module.
*
* @author Tom Oram <tom@scl.co.uk>
*/
interface PaymentMethodInterface
{
/**
* The name of the payment method.
*
* @return string
*/
public function name();
/**
* The payment method may update the confirm form.
*
* @param Form $form
- * @param OrderInteface $cart
? ^^ ^
+ * @param OrderInteface $order
? ^ ^^^
- * @param PaymentInterface $cart
? ^ ^
+ * @param PaymentInterface $payment
? ^ ^^^^
* @return void
*/
public function updateCompleteForm(
Form $form,
- OrderInterface $cart,
? ^^ ^
+ OrderInterface $order,
? ^ ^^^
PaymentInterface $payment
);
/**
* Takes the values returned from the payment method and completes the payment.
*
* @param array $data
* @return boolean Return true if the payment was successful
*/
public function complete(array $data);
} | 6 | 0.136364 | 3 | 3 |
c664a48499978f469e4ca3a11716f4fd7cb0267a | app/src/journeyTest/resources/dependency-container-with-setup-command/batect.yml | app/src/journeyTest/resources/dependency-container-with-setup-command/batect.yml | project_name: dependency-container-with-setup-command-test
containers:
server:
image: nginx:1.17.5
setup_commands:
- command: sh -c "echo 'This is some output from the task' && echo -n 'This is another line'"
working_directory: /usr/share/nginx/html
task-env:
build_directory: task-env
dependencies:
- server
tasks:
the-task:
run:
container: task-env
command: sh -c "curl --fail --show-error --silent http://server/message.txt && exit 123"
| project_name: dependency-container-with-setup-command-test
containers:
server:
image: nginx:1.17.5
setup_commands:
- command: sh -c "echo 'This is some output from the task' > message.txt"
working_directory: /usr/share/nginx/html
task-env:
build_directory: task-env
dependencies:
- server
tasks:
the-task:
run:
container: task-env
command: sh -c "curl --fail --show-error --silent http://server/message.txt && exit 123"
| Fix journey test file accidentally committed in previous commit. | Fix journey test file accidentally committed in previous commit.
| YAML | apache-2.0 | charleskorn/batect,charleskorn/batect,charleskorn/batect,charleskorn/batect,charleskorn/batect | yaml | ## Code Before:
project_name: dependency-container-with-setup-command-test
containers:
server:
image: nginx:1.17.5
setup_commands:
- command: sh -c "echo 'This is some output from the task' && echo -n 'This is another line'"
working_directory: /usr/share/nginx/html
task-env:
build_directory: task-env
dependencies:
- server
tasks:
the-task:
run:
container: task-env
command: sh -c "curl --fail --show-error --silent http://server/message.txt && exit 123"
## Instruction:
Fix journey test file accidentally committed in previous commit.
## Code After:
project_name: dependency-container-with-setup-command-test
containers:
server:
image: nginx:1.17.5
setup_commands:
- command: sh -c "echo 'This is some output from the task' > message.txt"
working_directory: /usr/share/nginx/html
task-env:
build_directory: task-env
dependencies:
- server
tasks:
the-task:
run:
container: task-env
command: sh -c "curl --fail --show-error --silent http://server/message.txt && exit 123"
| project_name: dependency-container-with-setup-command-test
containers:
server:
image: nginx:1.17.5
setup_commands:
- - command: sh -c "echo 'This is some output from the task' && echo -n 'This is another line'"
? ^^ ----------- -- - ^^ ^^^^^^^^^
+ - command: sh -c "echo 'This is some output from the task' > message.txt"
? ^ + ^^^ ^^
working_directory: /usr/share/nginx/html
task-env:
build_directory: task-env
dependencies:
- server
tasks:
the-task:
run:
container: task-env
command: sh -c "curl --fail --show-error --silent http://server/message.txt && exit 123" | 2 | 0.105263 | 1 | 1 |
d9c7b95b51b6636fcdd5f5269b4a7346549c3578 | layouts/_default/single.html | layouts/_default/single.html | {{ define "main" }}
<article class="post">
<h3>{{ .Title }}</h3>
<h4>by <span class="author">{{ .Site.Params.Owner }}</span>
on <time datetime="{{ .Page.Date }}">{{ .Date.Format "January 2, 2006" }}</time> </h4>
<h5>Category: {{ partial "categories" . }}</h5>
<h6>Tags: {{ partial "tags" . }}</h6>
{{ .Content }}
</article>
{{ end }} | {{ define "main" }}
<article class="post">
<header>
<h3>{{ .Title }}</h3>
<div class="byline">
by <span class="author">{{ .Site.Params.Owner }}</span>
on <time datetime="{{ .Page.Date }}">{{ .Date.Format "January 2, 2006" }}</time>
</div>
{{ if .Param "categories" }}
<div class="category">Category: {{ partial "categories" . }}</div>
{{ end }}
{{ if .Param "tags" }}
<div class="tags">Tags: {{ partial "tags" . }}</div>
{{ end }}
</header>
{{ .Content }}
</article>
{{ end }} | Fix layout to blog posts | Fix layout to blog posts
| HTML | mit | imaginationac/imaginationac.github.com | html | ## Code Before:
{{ define "main" }}
<article class="post">
<h3>{{ .Title }}</h3>
<h4>by <span class="author">{{ .Site.Params.Owner }}</span>
on <time datetime="{{ .Page.Date }}">{{ .Date.Format "January 2, 2006" }}</time> </h4>
<h5>Category: {{ partial "categories" . }}</h5>
<h6>Tags: {{ partial "tags" . }}</h6>
{{ .Content }}
</article>
{{ end }}
## Instruction:
Fix layout to blog posts
## Code After:
{{ define "main" }}
<article class="post">
<header>
<h3>{{ .Title }}</h3>
<div class="byline">
by <span class="author">{{ .Site.Params.Owner }}</span>
on <time datetime="{{ .Page.Date }}">{{ .Date.Format "January 2, 2006" }}</time>
</div>
{{ if .Param "categories" }}
<div class="category">Category: {{ partial "categories" . }}</div>
{{ end }}
{{ if .Param "tags" }}
<div class="tags">Tags: {{ partial "tags" . }}</div>
{{ end }}
</header>
{{ .Content }}
</article>
{{ end }} | {{ define "main" }}
<article class="post">
+ <header>
- <h3>{{ .Title }}</h3>
+ <h3>{{ .Title }}</h3>
? +++
+ <div class="byline">
- <h4>by <span class="author">{{ .Site.Params.Owner }}</span>
? ^^^^ -
+ by <span class="author">{{ .Site.Params.Owner }}</span>
? ^^^^^^
- on <time datetime="{{ .Page.Date }}">{{ .Date.Format "January 2, 2006" }}</time> </h4>
? ------
+ on <time datetime="{{ .Page.Date }}">{{ .Date.Format "January 2, 2006" }}</time>
? +++
+ </div>
+ {{ if .Param "categories" }}
- <h5>Category: {{ partial "categories" . }}</h5>
? ^^ ^^
+ <div class="category">Category: {{ partial "categories" . }}</div>
? +++ ^^^^^^^^^^^^^^^^^^^^ ^^^
-
- <h6>Tags: {{ partial "tags" . }}</h6>
+ {{ end }}
+ {{ if .Param "tags" }}
+ <div class="tags">Tags: {{ partial "tags" . }}</div>
+ {{ end }}
+ </header>
- {{ .Content }}
? -
+ {{ .Content }}
</article>
{{ end }} | 21 | 1.909091 | 14 | 7 |
72dc01a189517b3477f3e587c035da1d2416a463 | src/org.xtuml.bp.doc/build.properties | src/org.xtuml.bp.doc/build.properties | bin.includes = plugin.xml,\
plugin.properties,\
toc.xml,\
topics_GettingStarted.xml,\
topics_Reference.xml,\
Reference/,\
TipsAndTricks/,\
GettingStarted/,\
techpub.css,\
topics_license.xml,\
license/,\
bp_relnotes.txt,\
about.html,\
ReleaseNotes/,\
WhatsNew/,\
GPMigrationGuide/,\
BridgePointAndConfigurationManagement/,\
LinuxGuide/,\
META-INF/,\
github-pandoc.css
| bin.includes = plugin.xml,\
plugin.properties,\
toc.xml,\
topics_GettingStarted.xml,\
topics_Reference.xml,\
Reference/,\
TipsAndTricks/,\
GettingStarted/,\
techpub.css,\
topics_license.xml,\
license/,\
bp_relnotes.txt,\
about.html,\
ReleaseNotes/,\
WhatsNew/,\
GPMigrationGuide/,\
BridgePointAndConfigurationManagement/,\
LinuxGuide/,\
META-INF/,\
github-pandoc.css,\
asciidoctor-default.css
| Include new stylesheet used by some docs | Include new stylesheet used by some docs | INI | apache-2.0 | xtuml/bridgepoint,cortlandstarrett/bridgepoint,xtuml/bridgepoint,xtuml/bridgepoint,cortlandstarrett/bridgepoint,cortlandstarrett/bridgepoint,cortlandstarrett/bridgepoint,travislondon/bridgepoint,rmulvey/bridgepoint,keithbrown/bridgepoint,xtuml/bridgepoint,travislondon/bridgepoint,keithbrown/bridgepoint,rmulvey/bridgepoint,cortlandstarrett/bridgepoint,keithbrown/bridgepoint,lwriemen/bridgepoint,xtuml/bridgepoint,perojonsson/bridgepoint,travislondon/bridgepoint,travislondon/bridgepoint,cortlandstarrett/bridgepoint,xtuml/bridgepoint,leviathan747/bridgepoint,rmulvey/bridgepoint,keithbrown/bridgepoint,lwriemen/bridgepoint,lwriemen/bridgepoint,perojonsson/bridgepoint,leviathan747/bridgepoint,leviathan747/bridgepoint,rmulvey/bridgepoint,rmulvey/bridgepoint,perojonsson/bridgepoint,cortlandstarrett/bridgepoint,travislondon/bridgepoint,xtuml/bridgepoint,leviathan747/bridgepoint,keithbrown/bridgepoint,cortlandstarrett/bridgepoint,xtuml/bridgepoint,keithbrown/bridgepoint,perojonsson/bridgepoint,leviathan747/bridgepoint,lwriemen/bridgepoint,perojonsson/bridgepoint,leviathan747/bridgepoint,perojonsson/bridgepoint,travislondon/bridgepoint,perojonsson/bridgepoint,lwriemen/bridgepoint,lwriemen/bridgepoint,leviathan747/bridgepoint,leviathan747/bridgepoint,lwriemen/bridgepoint,travislondon/bridgepoint,rmulvey/bridgepoint,lwriemen/bridgepoint,rmulvey/bridgepoint,travislondon/bridgepoint,keithbrown/bridgepoint | ini | ## Code Before:
bin.includes = plugin.xml,\
plugin.properties,\
toc.xml,\
topics_GettingStarted.xml,\
topics_Reference.xml,\
Reference/,\
TipsAndTricks/,\
GettingStarted/,\
techpub.css,\
topics_license.xml,\
license/,\
bp_relnotes.txt,\
about.html,\
ReleaseNotes/,\
WhatsNew/,\
GPMigrationGuide/,\
BridgePointAndConfigurationManagement/,\
LinuxGuide/,\
META-INF/,\
github-pandoc.css
## Instruction:
Include new stylesheet used by some docs
## Code After:
bin.includes = plugin.xml,\
plugin.properties,\
toc.xml,\
topics_GettingStarted.xml,\
topics_Reference.xml,\
Reference/,\
TipsAndTricks/,\
GettingStarted/,\
techpub.css,\
topics_license.xml,\
license/,\
bp_relnotes.txt,\
about.html,\
ReleaseNotes/,\
WhatsNew/,\
GPMigrationGuide/,\
BridgePointAndConfigurationManagement/,\
LinuxGuide/,\
META-INF/,\
github-pandoc.css,\
asciidoctor-default.css
| bin.includes = plugin.xml,\
plugin.properties,\
toc.xml,\
topics_GettingStarted.xml,\
topics_Reference.xml,\
Reference/,\
TipsAndTricks/,\
GettingStarted/,\
techpub.css,\
topics_license.xml,\
license/,\
bp_relnotes.txt,\
about.html,\
ReleaseNotes/,\
WhatsNew/,\
GPMigrationGuide/,\
BridgePointAndConfigurationManagement/,\
LinuxGuide/,\
META-INF/,\
- github-pandoc.css
+ github-pandoc.css,\
? ++
+ asciidoctor-default.css
| 3 | 0.142857 | 2 | 1 |
ca8e5ce6786dfb6ac2b619149a517eee02c9056c | .travis.yml | .travis.yml | language: php
php:
- 5.5
- 5.6
- 7.0
before_script:
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- composer self-update
- composer install
- composer require "doctrine/mongodb-odm"
script:
- cd $TRAVIS_BUILD_DIR/test
- phpunit --configuration phpunit.xml.ci
- cd $TRAVIS_BUILD_DIR
- ./vendor/squizlabs/php_codesniffer/scripts/phpcs --standard=PSR2 -s -p --extensions=php ./src ./test
after_script:
- php vendor/bin/coveralls
| language: php
matrix:
fast_finish: true
include:
- php: 5.5
env:
- MONGO_EXTENSION_SUPPORTED=true
- php: 5.6
env:
- MONGO_EXTENSION_SUPPORTED=true
- php: 7.0
env:
- MONGO_EXTENSION_SUPPORTED=false
before_script:
- if [[ $MONGO_EXTENSION_SUPPORTED == 'true' ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi
- composer self-update
- if [[ $MONGO_EXTENSION_SUPPORTED == true ]]; then composer install ; fi
- if [[ $MONGO_EXTENSION_SUPPORTED == false ]]; then composer install --ignore-platform-reqs ; fi
script:
- cd $TRAVIS_BUILD_DIR/test
- phpunit --configuration phpunit.xml.ci
- cd $TRAVIS_BUILD_DIR
- ./vendor/squizlabs/php_codesniffer/scripts/phpcs --standard=PSR2 -s -p --extensions=php ./src ./test
after_script:
- php vendor/bin/coveralls
| Use --ignore-platform-reqs for the PHP 7 tests | Use --ignore-platform-reqs for the PHP 7 tests
The code works, but the Mongo extension is not supported in PHP 7 yet,
which prevents the doctrine/mongo* packages from being installed.
This is all being done to support installation in PHP 7 for folks using
this library for the ORM query builder mock, which doesn't have this
issue.
| YAML | mit | michaelmoussa/doctrine-qbmocker,theorx/doctrine-qbmocker | yaml | ## Code Before:
language: php
php:
- 5.5
- 5.6
- 7.0
before_script:
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- composer self-update
- composer install
- composer require "doctrine/mongodb-odm"
script:
- cd $TRAVIS_BUILD_DIR/test
- phpunit --configuration phpunit.xml.ci
- cd $TRAVIS_BUILD_DIR
- ./vendor/squizlabs/php_codesniffer/scripts/phpcs --standard=PSR2 -s -p --extensions=php ./src ./test
after_script:
- php vendor/bin/coveralls
## Instruction:
Use --ignore-platform-reqs for the PHP 7 tests
The code works, but the Mongo extension is not supported in PHP 7 yet,
which prevents the doctrine/mongo* packages from being installed.
This is all being done to support installation in PHP 7 for folks using
this library for the ORM query builder mock, which doesn't have this
issue.
## Code After:
language: php
matrix:
fast_finish: true
include:
- php: 5.5
env:
- MONGO_EXTENSION_SUPPORTED=true
- php: 5.6
env:
- MONGO_EXTENSION_SUPPORTED=true
- php: 7.0
env:
- MONGO_EXTENSION_SUPPORTED=false
before_script:
- if [[ $MONGO_EXTENSION_SUPPORTED == 'true' ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi
- composer self-update
- if [[ $MONGO_EXTENSION_SUPPORTED == true ]]; then composer install ; fi
- if [[ $MONGO_EXTENSION_SUPPORTED == false ]]; then composer install --ignore-platform-reqs ; fi
script:
- cd $TRAVIS_BUILD_DIR/test
- phpunit --configuration phpunit.xml.ci
- cd $TRAVIS_BUILD_DIR
- ./vendor/squizlabs/php_codesniffer/scripts/phpcs --standard=PSR2 -s -p --extensions=php ./src ./test
after_script:
- php vendor/bin/coveralls
| language: php
- php:
+ matrix:
+ fast_finish: true
+ include:
- - 5.5
+ - php: 5.5
? +++++
+ env:
+ - MONGO_EXTENSION_SUPPORTED=true
- - 5.6
+ - php: 5.6
? +++++
+ env:
+ - MONGO_EXTENSION_SUPPORTED=true
- - 7.0
+ - php: 7.0
? +++++
+ env:
+ - MONGO_EXTENSION_SUPPORTED=false
before_script:
- - echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+ - if [[ $MONGO_EXTENSION_SUPPORTED == 'true' ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi
? ++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++
- composer self-update
- - composer install
- - composer require "doctrine/mongodb-odm"
+ - if [[ $MONGO_EXTENSION_SUPPORTED == true ]]; then composer install ; fi
+ - if [[ $MONGO_EXTENSION_SUPPORTED == false ]]; then composer install --ignore-platform-reqs ; fi
script:
- cd $TRAVIS_BUILD_DIR/test
- phpunit --configuration phpunit.xml.ci
- cd $TRAVIS_BUILD_DIR
- ./vendor/squizlabs/php_codesniffer/scripts/phpcs --standard=PSR2 -s -p --extensions=php ./src ./test
after_script:
- php vendor/bin/coveralls | 22 | 1.047619 | 15 | 7 |
11e14460bd02e88a90ff1513ff853230e69ab314 | app/jobs/discover_runner_job.rb | app/jobs/discover_runner_job.rb | class DiscoverRunnerJob < ApplicationJob
queue_as :discover_runner
def perform(run)
srdc_runner_id = SpeedrunDotCom::Run.runner_id(run.srdc_id)
return if srdc_runner_id.nil?
twitch_login = SpeedrunDotCom::User.twitch_login(srdc_runner_id)
return if twitch_login.blank?
run.update(user: User.joins(:twitch).find_by(twitch_users: {name: twitch_login}))
end
end
| class DiscoverRunnerJob < ApplicationJob
queue_as :discover_runner
def perform(run)
return if run.srdc_id.nil?
srdc_runner_id = SpeedrunDotCom::Run.runner_id(run.srdc_id)
return if srdc_runner_id.nil?
twitch_login = SpeedrunDotCom::User.twitch_login(srdc_runner_id)
return if twitch_login.blank?
run.update(user: User.joins(:twitch).find_by(twitch_users: {name: twitch_login}))
end
end
| Fix DiscoverRunnerJob when srdc_id is nil | Fix DiscoverRunnerJob when srdc_id is nil
| Ruby | agpl-3.0 | BatedUrGonnaDie/splits-io,glacials/splits-io,glacials/splits-io,glacials/splits-io,BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io | ruby | ## Code Before:
class DiscoverRunnerJob < ApplicationJob
queue_as :discover_runner
def perform(run)
srdc_runner_id = SpeedrunDotCom::Run.runner_id(run.srdc_id)
return if srdc_runner_id.nil?
twitch_login = SpeedrunDotCom::User.twitch_login(srdc_runner_id)
return if twitch_login.blank?
run.update(user: User.joins(:twitch).find_by(twitch_users: {name: twitch_login}))
end
end
## Instruction:
Fix DiscoverRunnerJob when srdc_id is nil
## Code After:
class DiscoverRunnerJob < ApplicationJob
queue_as :discover_runner
def perform(run)
return if run.srdc_id.nil?
srdc_runner_id = SpeedrunDotCom::Run.runner_id(run.srdc_id)
return if srdc_runner_id.nil?
twitch_login = SpeedrunDotCom::User.twitch_login(srdc_runner_id)
return if twitch_login.blank?
run.update(user: User.joins(:twitch).find_by(twitch_users: {name: twitch_login}))
end
end
| class DiscoverRunnerJob < ApplicationJob
queue_as :discover_runner
def perform(run)
+ return if run.srdc_id.nil?
+
srdc_runner_id = SpeedrunDotCom::Run.runner_id(run.srdc_id)
return if srdc_runner_id.nil?
twitch_login = SpeedrunDotCom::User.twitch_login(srdc_runner_id)
return if twitch_login.blank?
run.update(user: User.joins(:twitch).find_by(twitch_users: {name: twitch_login}))
end
end | 2 | 0.153846 | 2 | 0 |
d81d6f163f5d5d24136920a1cc2f69803b78b1c7 | powerline/config_files/themes/vim/quickfix.json | powerline/config_files/themes/vim/quickfix.json | {
"segment_data": {
"file_name": {
"contents": "Location List"
}
},
"segments": {
"left": [
{
"type": "string",
"name": "file_name",
"draw_soft_divider": false
},
{
"type": "string",
"highlight_group": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
],
"right": [
{
"type": "string",
"name": "line_current_symbol",
"highlight_group": ["line_current_symbol", "line_current"]
},
{
"name": "line_current",
"draw_soft_divider": false,
"width": 3,
"align": "r"
}
]
}
}
| {
"segment_data": {
"buffer_name": {
"contents": "Location List"
}
},
"segments": {
"left": [
{
"type": "string",
"name": "buffer_name",
"highlight_group": ["file_name"],
"draw_soft_divider": false
},
{
"type": "string",
"highlight_group": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
],
"right": [
{
"type": "string",
"name": "line_current_symbol",
"highlight_group": ["line_current_symbol", "line_current"]
},
{
"name": "line_current",
"draw_soft_divider": false,
"width": 3,
"align": "r"
}
]
}
}
| Fix missing qf buffer highlighting | vim: Fix missing qf buffer highlighting
| JSON | mit | keelerm84/powerline,darac/powerline,lukw00/powerline,QuLogic/powerline,dragon788/powerline,DoctorJellyface/powerline,firebitsbr/powerline,xfumihiro/powerline,lukw00/powerline,Luffin/powerline,russellb/powerline,EricSB/powerline,kenrachynski/powerline,xfumihiro/powerline,IvanAli/powerline,Luffin/powerline,wfscheper/powerline,darac/powerline,xxxhycl2010/powerline,s0undt3ch/powerline,seanfisk/powerline,darac/powerline,Liangjianghao/powerline,QuLogic/powerline,junix/powerline,cyrixhero/powerline,kenrachynski/powerline,prvnkumar/powerline,Liangjianghao/powerline,wfscheper/powerline,russellb/powerline,russellb/powerline,firebitsbr/powerline,DoctorJellyface/powerline,s0undt3ch/powerline,EricSB/powerline,S0lll0s/powerline,bezhermoso/powerline,xfumihiro/powerline,kenrachynski/powerline,xxxhycl2010/powerline,bartvm/powerline,firebitsbr/powerline,areteix/powerline,Luffin/powerline,junix/powerline,Liangjianghao/powerline,magus424/powerline,magus424/powerline,bezhermoso/powerline,magus424/powerline,EricSB/powerline,areteix/powerline,lukw00/powerline,bartvm/powerline,s0undt3ch/powerline,DoctorJellyface/powerline,bezhermoso/powerline,prvnkumar/powerline,blindFS/powerline,cyrixhero/powerline,bartvm/powerline,blindFS/powerline,seanfisk/powerline,dragon788/powerline,areteix/powerline,IvanAli/powerline,keelerm84/powerline,junix/powerline,S0lll0s/powerline,prvnkumar/powerline,cyrixhero/powerline,seanfisk/powerline,wfscheper/powerline,xxxhycl2010/powerline,dragon788/powerline,blindFS/powerline,S0lll0s/powerline,IvanAli/powerline,QuLogic/powerline | json | ## Code Before:
{
"segment_data": {
"file_name": {
"contents": "Location List"
}
},
"segments": {
"left": [
{
"type": "string",
"name": "file_name",
"draw_soft_divider": false
},
{
"type": "string",
"highlight_group": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
],
"right": [
{
"type": "string",
"name": "line_current_symbol",
"highlight_group": ["line_current_symbol", "line_current"]
},
{
"name": "line_current",
"draw_soft_divider": false,
"width": 3,
"align": "r"
}
]
}
}
## Instruction:
vim: Fix missing qf buffer highlighting
## Code After:
{
"segment_data": {
"buffer_name": {
"contents": "Location List"
}
},
"segments": {
"left": [
{
"type": "string",
"name": "buffer_name",
"highlight_group": ["file_name"],
"draw_soft_divider": false
},
{
"type": "string",
"highlight_group": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
],
"right": [
{
"type": "string",
"name": "line_current_symbol",
"highlight_group": ["line_current_symbol", "line_current"]
},
{
"name": "line_current",
"draw_soft_divider": false,
"width": 3,
"align": "r"
}
]
}
}
| {
"segment_data": {
- "file_name": {
? ^^
+ "buffer_name": {
? ++ ^ +
"contents": "Location List"
}
},
"segments": {
"left": [
{
"type": "string",
- "name": "file_name",
? ^^
+ "name": "buffer_name",
? ++ ^ +
+ "highlight_group": ["file_name"],
"draw_soft_divider": false
},
{
"type": "string",
"highlight_group": ["background"],
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
],
"right": [
{
"type": "string",
"name": "line_current_symbol",
"highlight_group": ["line_current_symbol", "line_current"]
},
{
"name": "line_current",
"draw_soft_divider": false,
"width": 3,
"align": "r"
}
]
}
} | 5 | 0.138889 | 3 | 2 |
d4319d8567a8e33942fd05351b0d45def5b7861e | phpunit.xml.dist | phpunit.xml.dist | <?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/phpunit/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">tests/phpunit/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="tmp" />
<log type="coverage-clover" target="clover.xml"/>
</logging>
</phpunit>
| <?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/phpunit/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">tests/phpunit/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="tmp" />
<log type="coverage-clover" target="clover.xml"/>
</logging>
</phpunit>
| Add pretty printer for easier read of tests | Add pretty printer for easier read of tests | unknown | mit | bueltge/marksimple,bueltge/marksimple | unknown | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/phpunit/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">tests/phpunit/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="tmp" />
<log type="coverage-clover" target="clover.xml"/>
</logging>
</phpunit>
## Instruction:
Add pretty printer for easier read of tests
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/phpunit/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">tests/phpunit/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="tmp" />
<log type="coverage-clover" target="clover.xml"/>
</logging>
</phpunit>
| <?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/phpunit/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
- stopOnFailure="false">
? -
+ stopOnFailure="false"
+ printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">tests/phpunit/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="tmp" />
<log type="coverage-clover" target="clover.xml"/>
</logging>
</phpunit> | 3 | 0.09375 | 2 | 1 |
43d3272db3b344a107d9ad574abe4d38bf696a23 | README.md | README.md | A single page application that prints pdfs using AirPrint
| A single page application that prints pdfs using AirPrint.
http://codetipping.weebly.com/blog/airprinting-in-swift
| Add a blog post reference. | Add a blog post reference. | Markdown | mit | RussVanBert/AirPrint_Swift | markdown | ## Code Before:
A single page application that prints pdfs using AirPrint
## Instruction:
Add a blog post reference.
## Code After:
A single page application that prints pdfs using AirPrint.
http://codetipping.weebly.com/blog/airprinting-in-swift
| - A single page application that prints pdfs using AirPrint
+ A single page application that prints pdfs using AirPrint.
? +
+
+ http://codetipping.weebly.com/blog/airprinting-in-swift | 4 | 4 | 3 | 1 |
f1afc32efaf0df2a2f8a0b474dc367c1eba8681d | salt/renderers/jinja.py | salt/renderers/jinja.py | from __future__ import absolute_import
# Import python libs
from StringIO import StringIO
# Import salt libs
from salt.exceptions import SaltRenderError
import salt.utils.templates
def render(template_file, env='', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
from_str = argline=='-s'
if not from_str and argline:
raise SaltRenderError(
'Unknown renderer option: {opt}'.format(opt=argline)
)
tmp_data = salt.utils.templates.JINJA(template_file, to_str=True,
salt=__salt__,
grains=__grains__,
opts=__opts__,
pillar=__pillar__,
env=env,
sls=sls,
context=context,
tmplpath=tmplpath,
**kws)
if not tmp_data.get('result', False):
raise SaltRenderError(tmp_data.get('data',
'Unknown render error in jinja renderer'))
return StringIO(tmp_data['data'])
| from __future__ import absolute_import
# Import python libs
from StringIO import StringIO
# Import salt libs
from salt.exceptions import SaltRenderError
import salt.utils.templates
def render(template_file, env='', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
from_str = argline == '-s'
if not from_str and argline:
raise SaltRenderError(
'Unknown renderer option: {opt}'.format(opt=argline)
)
tmp_data = salt.utils.templates.JINJA(template_file,
to_str=True,
salt=__salt__,
grains=__grains__,
opts=__opts__,
pillar=__pillar__,
env=env,
sls=sls,
context=context,
tmplpath=tmplpath,
**kws)
if not tmp_data.get('result', False):
raise SaltRenderError(
tmp_data.get('data', 'Unknown render error in jinja renderer')
)
return StringIO(tmp_data['data'])
| Clean up some PEP8 stuff | Clean up some PEP8 stuff
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | python | ## Code Before:
from __future__ import absolute_import
# Import python libs
from StringIO import StringIO
# Import salt libs
from salt.exceptions import SaltRenderError
import salt.utils.templates
def render(template_file, env='', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
from_str = argline=='-s'
if not from_str and argline:
raise SaltRenderError(
'Unknown renderer option: {opt}'.format(opt=argline)
)
tmp_data = salt.utils.templates.JINJA(template_file, to_str=True,
salt=__salt__,
grains=__grains__,
opts=__opts__,
pillar=__pillar__,
env=env,
sls=sls,
context=context,
tmplpath=tmplpath,
**kws)
if not tmp_data.get('result', False):
raise SaltRenderError(tmp_data.get('data',
'Unknown render error in jinja renderer'))
return StringIO(tmp_data['data'])
## Instruction:
Clean up some PEP8 stuff
## Code After:
from __future__ import absolute_import
# Import python libs
from StringIO import StringIO
# Import salt libs
from salt.exceptions import SaltRenderError
import salt.utils.templates
def render(template_file, env='', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
from_str = argline == '-s'
if not from_str and argline:
raise SaltRenderError(
'Unknown renderer option: {opt}'.format(opt=argline)
)
tmp_data = salt.utils.templates.JINJA(template_file,
to_str=True,
salt=__salt__,
grains=__grains__,
opts=__opts__,
pillar=__pillar__,
env=env,
sls=sls,
context=context,
tmplpath=tmplpath,
**kws)
if not tmp_data.get('result', False):
raise SaltRenderError(
tmp_data.get('data', 'Unknown render error in jinja renderer')
)
return StringIO(tmp_data['data'])
| from __future__ import absolute_import
# Import python libs
from StringIO import StringIO
# Import salt libs
from salt.exceptions import SaltRenderError
import salt.utils.templates
def render(template_file, env='', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
- from_str = argline=='-s'
+ from_str = argline == '-s'
? + +
if not from_str and argline:
raise SaltRenderError(
- 'Unknown renderer option: {opt}'.format(opt=argline)
? --
+ 'Unknown renderer option: {opt}'.format(opt=argline)
- )
? ------
+ )
- tmp_data = salt.utils.templates.JINJA(template_file, to_str=True,
? -------------
+ tmp_data = salt.utils.templates.JINJA(template_file,
+ to_str=True,
- salt=__salt__,
+ salt=__salt__,
? ++++++++++++++++++++++
- grains=__grains__,
+ grains=__grains__,
? ++++++++++++++++++++++
- opts=__opts__,
+ opts=__opts__,
? ++++++++++++++++++++++
- pillar=__pillar__,
+ pillar=__pillar__,
? ++++++++++++++++++++++
- env=env,
- sls=sls,
+ env=env,
+ sls=sls,
- context=context,
+ context=context,
? ++++++++++++++++++++++
- tmplpath=tmplpath,
+ tmplpath=tmplpath,
? ++++++++++++++++++++++
- **kws)
+ **kws)
if not tmp_data.get('result', False):
- raise SaltRenderError(tmp_data.get('data',
? --------------------
+ raise SaltRenderError(
- 'Unknown render error in jinja renderer'))
? -
+ tmp_data.get('data', 'Unknown render error in jinja renderer')
? +++++++++++++++++++++++++
+ )
return StringIO(tmp_data['data'])
- | 33 | 0.868421 | 17 | 16 |
7ee40072cda05e656a3695d8ce02205cfbd9e35c | src/js/googleOauth.js | src/js/googleOauth.js | 'use strict';
/**
* A module to include instead of `angularOauth` for a service preconfigured
* for Google OAuth authentication.
*
* Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent
*/
angular.module('googleOauth', ['angularOauth']).
constant('GoogleTokenVerifier', function($http) {
return function(config, accessToken, deferred) {
var verificationEndpoint = 'https://www.googleapis.com/oauth2/v1/tokeninfo';
$http.get(verificationEndpoint, {params: {access_token: accessToken}}).
success(function(data) {
if (data.audience == config.clientId) {
deferred.resolve(data);
} else {
deferred.reject({name: 'invalid_audience'});
}
}).
error(function(data, status, headers, config) {
deferred.reject({
name: 'error_response',
data: data,
status: status,
headers: headers,
config: config
});
});
}
}).
config(function(TokenProvider, GoogleTokenVerifier) {
TokenProvider.extendConfig({
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
tokenVerifierEndpoint: 'https://www.googleapis.com/oauth2/v1/tokeninfo',
scopes: ["https://www.googleapis.com/auth/userinfo.email"],
verifyFunc: GoogleTokenVerifier
});
});
| 'use strict';
/**
* A module to include instead of `angularOauth` for a service preconfigured
* for Google OAuth authentication.
*
* Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent
*/
angular.module('googleOauth', ['angularOauth']).
constant('GoogleTokenVerifier', function(config, accessToken, deferred) {
var $injector = angular.injector(['ng']);
return $injector.invoke(['$http', '$rootScope', function($http, $rootScope) {
var verificationEndpoint = 'https://www.googleapis.com/oauth2/v1/tokeninfo';
$rootScope.$apply(function() {
$http({method: 'GET', url: verificationEndpoint, params: {access_token: accessToken}}).
success(function(data) {
if (data.audience == config.clientId) {
deferred.resolve(data);
} else {
deferred.reject({name: 'invalid_audience'});
}
}).
error(function(data, status, headers, config) {
deferred.reject({
name: 'error_response',
data: data,
status: status,
headers: headers,
config: config
});
});
});
return deferred;
}]);
}).
config(function(TokenProvider, GoogleTokenVerifier) {
TokenProvider.extendConfig({
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
scopes: ["https://www.googleapis.com/auth/userinfo.email"],
verifyFunc: GoogleTokenVerifier
});
});
| Fix bug in GoogleTokenVerifier causing it never to work. | Fix bug in GoogleTokenVerifier causing it never to work.
Apparently, I was horribly misusing constants. Comprehensive tests would have uncovered this. I'm not convinced that I'm doing the right thing by injecting services inside the verification function, and this particular section (the verification function and how best to make that customizable) could really use a second pair of eyes.
It would help to know a pattern for configuring functions that use services inside providers.
| JavaScript | mit | mutualmobile/angular-oauth,mutualmobile/angular-oauth,angular-oauth/angular-oauth | javascript | ## Code Before:
'use strict';
/**
* A module to include instead of `angularOauth` for a service preconfigured
* for Google OAuth authentication.
*
* Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent
*/
angular.module('googleOauth', ['angularOauth']).
constant('GoogleTokenVerifier', function($http) {
return function(config, accessToken, deferred) {
var verificationEndpoint = 'https://www.googleapis.com/oauth2/v1/tokeninfo';
$http.get(verificationEndpoint, {params: {access_token: accessToken}}).
success(function(data) {
if (data.audience == config.clientId) {
deferred.resolve(data);
} else {
deferred.reject({name: 'invalid_audience'});
}
}).
error(function(data, status, headers, config) {
deferred.reject({
name: 'error_response',
data: data,
status: status,
headers: headers,
config: config
});
});
}
}).
config(function(TokenProvider, GoogleTokenVerifier) {
TokenProvider.extendConfig({
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
tokenVerifierEndpoint: 'https://www.googleapis.com/oauth2/v1/tokeninfo',
scopes: ["https://www.googleapis.com/auth/userinfo.email"],
verifyFunc: GoogleTokenVerifier
});
});
## Instruction:
Fix bug in GoogleTokenVerifier causing it never to work.
Apparently, I was horribly misusing constants. Comprehensive tests would have uncovered this. I'm not convinced that I'm doing the right thing by injecting services inside the verification function, and this particular section (the verification function and how best to make that customizable) could really use a second pair of eyes.
It would help to know a pattern for configuring functions that use services inside providers.
## Code After:
'use strict';
/**
* A module to include instead of `angularOauth` for a service preconfigured
* for Google OAuth authentication.
*
* Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent
*/
angular.module('googleOauth', ['angularOauth']).
constant('GoogleTokenVerifier', function(config, accessToken, deferred) {
var $injector = angular.injector(['ng']);
return $injector.invoke(['$http', '$rootScope', function($http, $rootScope) {
var verificationEndpoint = 'https://www.googleapis.com/oauth2/v1/tokeninfo';
$rootScope.$apply(function() {
$http({method: 'GET', url: verificationEndpoint, params: {access_token: accessToken}}).
success(function(data) {
if (data.audience == config.clientId) {
deferred.resolve(data);
} else {
deferred.reject({name: 'invalid_audience'});
}
}).
error(function(data, status, headers, config) {
deferred.reject({
name: 'error_response',
data: data,
status: status,
headers: headers,
config: config
});
});
});
return deferred;
}]);
}).
config(function(TokenProvider, GoogleTokenVerifier) {
TokenProvider.extendConfig({
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
scopes: ["https://www.googleapis.com/auth/userinfo.email"],
verifyFunc: GoogleTokenVerifier
});
});
| 'use strict';
/**
* A module to include instead of `angularOauth` for a service preconfigured
* for Google OAuth authentication.
*
* Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent
*/
angular.module('googleOauth', ['angularOauth']).
- constant('GoogleTokenVerifier', function($http) {
- return function(config, accessToken, deferred) {
+ constant('GoogleTokenVerifier', function(config, accessToken, deferred) {
+ var $injector = angular.injector(['ng']);
+ return $injector.invoke(['$http', '$rootScope', function($http, $rootScope) {
var verificationEndpoint = 'https://www.googleapis.com/oauth2/v1/tokeninfo';
+
+ $rootScope.$apply(function() {
- $http.get(verificationEndpoint, {params: {access_token: accessToken}}).
? ^^ ^ -
+ $http({method: 'GET', url: verificationEndpoint, params: {access_token: accessToken}}).
? ++ ^^^ ^^^^^^^^^^^^^^^^^
- success(function(data) {
+ success(function(data) {
? ++
- if (data.audience == config.clientId) {
+ if (data.audience == config.clientId) {
? ++
- deferred.resolve(data);
+ deferred.resolve(data);
? ++
- } else {
+ } else {
? ++
- deferred.reject({name: 'invalid_audience'});
+ deferred.reject({name: 'invalid_audience'});
? ++
- }
+ }
? ++
- }).
+ }).
? ++
- error(function(data, status, headers, config) {
+ error(function(data, status, headers, config) {
? ++
- deferred.reject({
+ deferred.reject({
? ++
- name: 'error_response',
+ name: 'error_response',
? ++
- data: data,
+ data: data,
? ++
- status: status,
+ status: status,
? ++
- headers: headers,
+ headers: headers,
? ++
- config: config
+ config: config
? ++
+ });
});
- });
? --
+ });
+
+ return deferred;
- }
+ }]);
? +++
}).
config(function(TokenProvider, GoogleTokenVerifier) {
TokenProvider.extendConfig({
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
- tokenVerifierEndpoint: 'https://www.googleapis.com/oauth2/v1/tokeninfo',
scopes: ["https://www.googleapis.com/auth/userinfo.email"],
verifyFunc: GoogleTokenVerifier
});
});
| 45 | 1.071429 | 25 | 20 |
9b7b65e49057b0baf39c96426f22b1d9d17a17e8 | csc/cmd/controller_get_capacity.go | csc/cmd/controller_get_capacity.go | package cmd
import (
"context"
"fmt"
"github.com/spf13/cobra"
"github.com/container-storage-interface/spec/lib/go/csi"
)
var getCapacity struct {
caps volumeCapabilitySliceArg
}
var getCapacityCmd = &cobra.Command{
Use: "get-capacity",
Aliases: []string{"capacity"},
Short: `invokes the rpc "GetCapacity"`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(root.ctx, root.timeout)
defer cancel()
rep, err := controller.client.GetCapacity(
ctx,
&csi.GetCapacityRequest{
Version: &root.version.Version,
VolumeCapabilities: getCapacity.caps.data,
})
if err != nil {
return err
}
fmt.Println(rep.AvailableCapacity)
return nil
},
}
func init() {
controllerCmd.AddCommand(getCapacityCmd)
flagVolumeCapabilities(getCapacityCmd.Flags(), &getCapacity.caps)
}
| package cmd
import (
"context"
"fmt"
"github.com/spf13/cobra"
"github.com/container-storage-interface/spec/lib/go/csi"
)
var getCapacity struct {
caps volumeCapabilitySliceArg
params mapOfStringArg
}
var getCapacityCmd = &cobra.Command{
Use: "get-capacity",
Aliases: []string{"capacity"},
Short: `invokes the rpc "GetCapacity"`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(root.ctx, root.timeout)
defer cancel()
rep, err := controller.client.GetCapacity(
ctx,
&csi.GetCapacityRequest{
Version: &root.version.Version,
VolumeCapabilities: getCapacity.caps.data,
Parameters: getCapacity.params.data,
})
if err != nil {
return err
}
fmt.Println(rep.AvailableCapacity)
return nil
},
}
func init() {
controllerCmd.AddCommand(getCapacityCmd)
flagVolumeCapabilities(getCapacityCmd.Flags(), &getCapacity.caps)
getCapacityCmd.Flags().Var(
&getCapacity.params,
"params",
`One or more key/value pairs may be specified to send with
the request as its Parameters field:
--params key1=val1,key2=val2 --params=key3=val3`)
}
| Add --params flag to get-capacity | Add --params flag to get-capacity
| Go | apache-2.0 | akutz/gocsi,akutz/gocsi | go | ## Code Before:
package cmd
import (
"context"
"fmt"
"github.com/spf13/cobra"
"github.com/container-storage-interface/spec/lib/go/csi"
)
var getCapacity struct {
caps volumeCapabilitySliceArg
}
var getCapacityCmd = &cobra.Command{
Use: "get-capacity",
Aliases: []string{"capacity"},
Short: `invokes the rpc "GetCapacity"`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(root.ctx, root.timeout)
defer cancel()
rep, err := controller.client.GetCapacity(
ctx,
&csi.GetCapacityRequest{
Version: &root.version.Version,
VolumeCapabilities: getCapacity.caps.data,
})
if err != nil {
return err
}
fmt.Println(rep.AvailableCapacity)
return nil
},
}
func init() {
controllerCmd.AddCommand(getCapacityCmd)
flagVolumeCapabilities(getCapacityCmd.Flags(), &getCapacity.caps)
}
## Instruction:
Add --params flag to get-capacity
## Code After:
package cmd
import (
"context"
"fmt"
"github.com/spf13/cobra"
"github.com/container-storage-interface/spec/lib/go/csi"
)
var getCapacity struct {
caps volumeCapabilitySliceArg
params mapOfStringArg
}
var getCapacityCmd = &cobra.Command{
Use: "get-capacity",
Aliases: []string{"capacity"},
Short: `invokes the rpc "GetCapacity"`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(root.ctx, root.timeout)
defer cancel()
rep, err := controller.client.GetCapacity(
ctx,
&csi.GetCapacityRequest{
Version: &root.version.Version,
VolumeCapabilities: getCapacity.caps.data,
Parameters: getCapacity.params.data,
})
if err != nil {
return err
}
fmt.Println(rep.AvailableCapacity)
return nil
},
}
func init() {
controllerCmd.AddCommand(getCapacityCmd)
flagVolumeCapabilities(getCapacityCmd.Flags(), &getCapacity.caps)
getCapacityCmd.Flags().Var(
&getCapacity.params,
"params",
`One or more key/value pairs may be specified to send with
the request as its Parameters field:
--params key1=val1,key2=val2 --params=key3=val3`)
}
| package cmd
import (
"context"
"fmt"
"github.com/spf13/cobra"
"github.com/container-storage-interface/spec/lib/go/csi"
)
var getCapacity struct {
- caps volumeCapabilitySliceArg
+ caps volumeCapabilitySliceArg
? ++
+ params mapOfStringArg
}
var getCapacityCmd = &cobra.Command{
Use: "get-capacity",
Aliases: []string{"capacity"},
Short: `invokes the rpc "GetCapacity"`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(root.ctx, root.timeout)
defer cancel()
rep, err := controller.client.GetCapacity(
ctx,
&csi.GetCapacityRequest{
Version: &root.version.Version,
VolumeCapabilities: getCapacity.caps.data,
+ Parameters: getCapacity.params.data,
})
if err != nil {
return err
}
fmt.Println(rep.AvailableCapacity)
return nil
},
}
func init() {
controllerCmd.AddCommand(getCapacityCmd)
flagVolumeCapabilities(getCapacityCmd.Flags(), &getCapacity.caps)
+ getCapacityCmd.Flags().Var(
+ &getCapacity.params,
+ "params",
+ `One or more key/value pairs may be specified to send with
+ the request as its Parameters field:
+
+ --params key1=val1,key2=val2 --params=key3=val3`)
+
} | 12 | 0.27907 | 11 | 1 |
e4aec91e11ccbcc5300fe7c2bf59d6b14ed6d896 | tools/keywords2c.sh | tools/keywords2c.sh | xxd -i keywords.txt > RuC/keywords.c
| keywords_file="RuC/keywords.c"
keywords_source="keywords.txt"
# Back off if script is running not from project root
if [ ! -f "${keywords_file}" ] || [ ! -f "${keywords_source}" ] ; then
echo "${keywords_source} or ${keywords_file} don't exist."
echo "Is script called from project root?"
exit 1
fi
# Now create the file
echo "char keywords_txt[] ="> "${keywords_file}"
first_appended=
cat "${keywords_source}" | while read line
do
if [ "${first_appended}" == "" ] ; then
first_appended=1
else
echo -n -e '\n' >> "${keywords_file}"
fi
echo -n " \"$line\n\"" >> "${keywords_file}"
done
echo ";" >> "${keywords_file}"
| Make a converter for human-readable keywords This patch fixes keywords-to-c converter to produce human-readable representation based on regular strings. | Make a converter for human-readable keywords
This patch fixes keywords-to-c converter to produce human-readable
representation based on regular strings.
| Shell | apache-2.0 | andrey-terekhov/RuC,andrey-terekhov/RuC,andrey-terekhov/RuC | shell | ## Code Before:
xxd -i keywords.txt > RuC/keywords.c
## Instruction:
Make a converter for human-readable keywords
This patch fixes keywords-to-c converter to produce human-readable
representation based on regular strings.
## Code After:
keywords_file="RuC/keywords.c"
keywords_source="keywords.txt"
# Back off if script is running not from project root
if [ ! -f "${keywords_file}" ] || [ ! -f "${keywords_source}" ] ; then
echo "${keywords_source} or ${keywords_file} don't exist."
echo "Is script called from project root?"
exit 1
fi
# Now create the file
echo "char keywords_txt[] ="> "${keywords_file}"
first_appended=
cat "${keywords_source}" | while read line
do
if [ "${first_appended}" == "" ] ; then
first_appended=1
else
echo -n -e '\n' >> "${keywords_file}"
fi
echo -n " \"$line\n\"" >> "${keywords_file}"
done
echo ";" >> "${keywords_file}"
| - xxd -i keywords.txt > RuC/keywords.c
+ keywords_file="RuC/keywords.c"
+ keywords_source="keywords.txt"
+
+ # Back off if script is running not from project root
+ if [ ! -f "${keywords_file}" ] || [ ! -f "${keywords_source}" ] ; then
+ echo "${keywords_source} or ${keywords_file} don't exist."
+ echo "Is script called from project root?"
+ exit 1
+ fi
+
+ # Now create the file
+ echo "char keywords_txt[] ="> "${keywords_file}"
+ first_appended=
+ cat "${keywords_source}" | while read line
+ do
+ if [ "${first_appended}" == "" ] ; then
+ first_appended=1
+ else
+ echo -n -e '\n' >> "${keywords_file}"
+ fi
+ echo -n " \"$line\n\"" >> "${keywords_file}"
+ done
+ echo ";" >> "${keywords_file}" | 24 | 24 | 23 | 1 |
5aaed65185d536f5d22aa398c58c3155a9a61ea1 | src/index.js | src/index.js | import './styles/index.scss';
// Visual elements
import BasicRow from './BasicRow';
import Icon from './Icon';
import StatusIcon from './StatusIcon';
import Tag from './Tag';
import Text from './Text';
import EditableText from './EditableText';
import Tooltip from './Tooltip';
import AnchoredTooltip from './AnchoredTooltip';
import SwitchIcon from './SwitchIcon';
// Layout helpers
import FlexCell from './FlexCell';
import IconLayout from './IconLayout';
import TextEllipsis from './TextEllipsis';
// Row components
import TextLabel from './TextLabel';
import EditableTextLabel from './EditableTextLabel';
import Button from './Button';
import IconButton from './IconButton';
import Checkbox from './Checkbox';
import IconCheckbox from './IconCheckbox';
import Switch from './Switch';
import TextInput from './TextInput';
import SearchInput from './SearchInput';
// Containers
import InfiniteScroll from './InfiniteScroll';
export {
BasicRow,
Icon,
StatusIcon,
Tag,
Text,
EditableText,
Tooltip,
AnchoredTooltip,
SwitchIcon,
FlexCell,
IconLayout,
TextEllipsis,
TextLabel,
EditableTextLabel,
Button,
IconButton,
Checkbox,
IconCheckbox,
Switch,
TextInput,
SearchInput,
InfiniteScroll,
};
| import './styles/index.scss';
// Visual elements
import BasicRow from './BasicRow';
import EditableBasicRow from './EditableBasicRow';
import Icon from './Icon';
import StatusIcon from './StatusIcon';
import Tag from './Tag';
import Text from './Text';
import EditableText from './EditableText';
import Tooltip from './Tooltip';
import AnchoredTooltip from './AnchoredTooltip';
import SwitchIcon from './SwitchIcon';
// Layout helpers
import FlexCell from './FlexCell';
import IconLayout from './IconLayout';
import TextEllipsis from './TextEllipsis';
// Row components
import TextLabel from './TextLabel';
import EditableTextLabel from './EditableTextLabel';
import Button from './Button';
import IconButton from './IconButton';
import Checkbox from './Checkbox';
import IconCheckbox from './IconCheckbox';
import Switch from './Switch';
import TextInput from './TextInput';
import SearchInput from './SearchInput';
// Containers
import InfiniteScroll from './InfiniteScroll';
export {
BasicRow,
EditableBasicRow,
Icon,
StatusIcon,
Tag,
Text,
EditableText,
Tooltip,
AnchoredTooltip,
SwitchIcon,
FlexCell,
IconLayout,
TextEllipsis,
TextLabel,
EditableTextLabel,
Button,
IconButton,
Checkbox,
IconCheckbox,
Switch,
TextInput,
SearchInput,
InfiniteScroll,
};
| Fix <EditableBasicRow> isn't exported to bundle | Fix <EditableBasicRow> isn't exported to bundle
| JavaScript | apache-2.0 | iCHEF/gypcrete,iCHEF/gypcrete | javascript | ## Code Before:
import './styles/index.scss';
// Visual elements
import BasicRow from './BasicRow';
import Icon from './Icon';
import StatusIcon from './StatusIcon';
import Tag from './Tag';
import Text from './Text';
import EditableText from './EditableText';
import Tooltip from './Tooltip';
import AnchoredTooltip from './AnchoredTooltip';
import SwitchIcon from './SwitchIcon';
// Layout helpers
import FlexCell from './FlexCell';
import IconLayout from './IconLayout';
import TextEllipsis from './TextEllipsis';
// Row components
import TextLabel from './TextLabel';
import EditableTextLabel from './EditableTextLabel';
import Button from './Button';
import IconButton from './IconButton';
import Checkbox from './Checkbox';
import IconCheckbox from './IconCheckbox';
import Switch from './Switch';
import TextInput from './TextInput';
import SearchInput from './SearchInput';
// Containers
import InfiniteScroll from './InfiniteScroll';
export {
BasicRow,
Icon,
StatusIcon,
Tag,
Text,
EditableText,
Tooltip,
AnchoredTooltip,
SwitchIcon,
FlexCell,
IconLayout,
TextEllipsis,
TextLabel,
EditableTextLabel,
Button,
IconButton,
Checkbox,
IconCheckbox,
Switch,
TextInput,
SearchInput,
InfiniteScroll,
};
## Instruction:
Fix <EditableBasicRow> isn't exported to bundle
## Code After:
import './styles/index.scss';
// Visual elements
import BasicRow from './BasicRow';
import EditableBasicRow from './EditableBasicRow';
import Icon from './Icon';
import StatusIcon from './StatusIcon';
import Tag from './Tag';
import Text from './Text';
import EditableText from './EditableText';
import Tooltip from './Tooltip';
import AnchoredTooltip from './AnchoredTooltip';
import SwitchIcon from './SwitchIcon';
// Layout helpers
import FlexCell from './FlexCell';
import IconLayout from './IconLayout';
import TextEllipsis from './TextEllipsis';
// Row components
import TextLabel from './TextLabel';
import EditableTextLabel from './EditableTextLabel';
import Button from './Button';
import IconButton from './IconButton';
import Checkbox from './Checkbox';
import IconCheckbox from './IconCheckbox';
import Switch from './Switch';
import TextInput from './TextInput';
import SearchInput from './SearchInput';
// Containers
import InfiniteScroll from './InfiniteScroll';
export {
BasicRow,
EditableBasicRow,
Icon,
StatusIcon,
Tag,
Text,
EditableText,
Tooltip,
AnchoredTooltip,
SwitchIcon,
FlexCell,
IconLayout,
TextEllipsis,
TextLabel,
EditableTextLabel,
Button,
IconButton,
Checkbox,
IconCheckbox,
Switch,
TextInput,
SearchInput,
InfiniteScroll,
};
| import './styles/index.scss';
// Visual elements
import BasicRow from './BasicRow';
+ import EditableBasicRow from './EditableBasicRow';
import Icon from './Icon';
import StatusIcon from './StatusIcon';
import Tag from './Tag';
import Text from './Text';
import EditableText from './EditableText';
import Tooltip from './Tooltip';
import AnchoredTooltip from './AnchoredTooltip';
import SwitchIcon from './SwitchIcon';
// Layout helpers
import FlexCell from './FlexCell';
import IconLayout from './IconLayout';
import TextEllipsis from './TextEllipsis';
// Row components
import TextLabel from './TextLabel';
import EditableTextLabel from './EditableTextLabel';
import Button from './Button';
import IconButton from './IconButton';
import Checkbox from './Checkbox';
import IconCheckbox from './IconCheckbox';
import Switch from './Switch';
import TextInput from './TextInput';
import SearchInput from './SearchInput';
// Containers
import InfiniteScroll from './InfiniteScroll';
export {
BasicRow,
+ EditableBasicRow,
Icon,
StatusIcon,
Tag,
Text,
EditableText,
Tooltip,
AnchoredTooltip,
SwitchIcon,
FlexCell,
IconLayout,
TextEllipsis,
TextLabel,
EditableTextLabel,
Button,
IconButton,
Checkbox,
IconCheckbox,
Switch,
TextInput,
SearchInput,
InfiniteScroll,
}; | 2 | 0.033898 | 2 | 0 |
a3ab513306614393f901e4991886ba93b6ed26a3 | cardboard/frontend/testing.py | cardboard/frontend/testing.py |
import contextlib
from twisted.python import log
from zope.interface import implements
from cardboard.frontend import FrontendMixin, IFrontend
def mock_selector(name):
selections = [()]
@contextlib.contextmanager
def will_return(*selection):
selections.append(selection)
yield
selections.pop()
def select(self, *args, **kwargs):
return selections[-1]
select.__name__ = name
select.will_return = will_return
return select
class TestingFrontend(FrontendMixin):
implements(IFrontend)
select = mock_selector("select")
select_cards = mock_selector("select_cards")
select_players = mock_selector("select_players")
select_combined = mock_selector("select_combined")
select_range = mock_selector("select_range")
def prompt(self, msg):
log.msg(msg)
def priority_granted(self):
pass
|
import contextlib
from twisted.python import log
from zope.interface import implements
from cardboard.frontend import FrontendMixin, IFrontend
def mock_selector(name):
selections = [()]
@contextlib.contextmanager
def will_return(*selection):
selections.append(selection)
yield
selections.pop()
def select(self, *args, **kwargs):
return selections[-1]
select.__name__ = name
select.will_return = will_return
return select
class TestingSelector(object):
choice = mock_selector("choice")
cards = mock_selector("cards")
players = mock_selector("players")
combined = mock_selector("combined")
range = mock_selector("range")
def __init__(self, frontend):
super(TestingSelector, self).__init__()
class TestingFrontend(FrontendMixin):
implements(IFrontend)
info = lambda _, __ : None
select = TestingSelector
def prompt(self, msg):
log.msg(msg)
def priority_granted(self):
pass
| Make TestingFrontend not blow up from info and move select to TestingSelector. | Make TestingFrontend not blow up from info and move select to TestingSelector.
| Python | mit | Julian/cardboard,Julian/cardboard | python | ## Code Before:
import contextlib
from twisted.python import log
from zope.interface import implements
from cardboard.frontend import FrontendMixin, IFrontend
def mock_selector(name):
selections = [()]
@contextlib.contextmanager
def will_return(*selection):
selections.append(selection)
yield
selections.pop()
def select(self, *args, **kwargs):
return selections[-1]
select.__name__ = name
select.will_return = will_return
return select
class TestingFrontend(FrontendMixin):
implements(IFrontend)
select = mock_selector("select")
select_cards = mock_selector("select_cards")
select_players = mock_selector("select_players")
select_combined = mock_selector("select_combined")
select_range = mock_selector("select_range")
def prompt(self, msg):
log.msg(msg)
def priority_granted(self):
pass
## Instruction:
Make TestingFrontend not blow up from info and move select to TestingSelector.
## Code After:
import contextlib
from twisted.python import log
from zope.interface import implements
from cardboard.frontend import FrontendMixin, IFrontend
def mock_selector(name):
selections = [()]
@contextlib.contextmanager
def will_return(*selection):
selections.append(selection)
yield
selections.pop()
def select(self, *args, **kwargs):
return selections[-1]
select.__name__ = name
select.will_return = will_return
return select
class TestingSelector(object):
choice = mock_selector("choice")
cards = mock_selector("cards")
players = mock_selector("players")
combined = mock_selector("combined")
range = mock_selector("range")
def __init__(self, frontend):
super(TestingSelector, self).__init__()
class TestingFrontend(FrontendMixin):
implements(IFrontend)
info = lambda _, __ : None
select = TestingSelector
def prompt(self, msg):
log.msg(msg)
def priority_granted(self):
pass
|
import contextlib
from twisted.python import log
from zope.interface import implements
from cardboard.frontend import FrontendMixin, IFrontend
def mock_selector(name):
selections = [()]
@contextlib.contextmanager
def will_return(*selection):
selections.append(selection)
yield
selections.pop()
def select(self, *args, **kwargs):
return selections[-1]
select.__name__ = name
select.will_return = will_return
return select
+ class TestingSelector(object):
+
+ choice = mock_selector("choice")
+ cards = mock_selector("cards")
+ players = mock_selector("players")
+ combined = mock_selector("combined")
+ range = mock_selector("range")
+
+ def __init__(self, frontend):
+ super(TestingSelector, self).__init__()
+
+
class TestingFrontend(FrontendMixin):
implements(IFrontend)
+ info = lambda _, __ : None
+ select = TestingSelector
- select = mock_selector("select")
- select_cards = mock_selector("select_cards")
- select_players = mock_selector("select_players")
- select_combined = mock_selector("select_combined")
- select_range = mock_selector("select_range")
def prompt(self, msg):
log.msg(msg)
def priority_granted(self):
pass | 19 | 0.44186 | 14 | 5 |
3ccddf180c939351fa8074144d9e2a4c97f60621 | src/features/unitInfo/unitInfoReducer.js | src/features/unitInfo/unitInfoReducer.js | import {createReducer} from "common/utils/reducerUtils";
const initialState = {
name : "Black Widow Company",
affiliation : "wd",
};
export default createReducer(initialState, {
}); | import {createReducer} from "common/utils/reducerUtils";
import {DATA_LOADED} from "features/tools/toolConstants";
const initialState = {
name : "N/A",
affiliation : "",
};
function dataLoaded(state, payload) {
const {unit} = payload;
return unit;
}
export default createReducer(initialState, {
[DATA_LOADED] : dataLoaded,
}); | Load unit details from sample data | Load unit details from sample data
| JavaScript | mit | markerikson/project-minimek,markerikson/project-minimek | javascript | ## Code Before:
import {createReducer} from "common/utils/reducerUtils";
const initialState = {
name : "Black Widow Company",
affiliation : "wd",
};
export default createReducer(initialState, {
});
## Instruction:
Load unit details from sample data
## Code After:
import {createReducer} from "common/utils/reducerUtils";
import {DATA_LOADED} from "features/tools/toolConstants";
const initialState = {
name : "N/A",
affiliation : "",
};
function dataLoaded(state, payload) {
const {unit} = payload;
return unit;
}
export default createReducer(initialState, {
[DATA_LOADED] : dataLoaded,
}); | import {createReducer} from "common/utils/reducerUtils";
+ import {DATA_LOADED} from "features/tools/toolConstants";
const initialState = {
- name : "Black Widow Company",
+ name : "N/A",
- affiliation : "wd",
? --
+ affiliation : "",
};
+ function dataLoaded(state, payload) {
+ const {unit} = payload;
+
+ return unit;
+ }
export default createReducer(initialState, {
-
+ [DATA_LOADED] : dataLoaded,
}); | 12 | 1 | 9 | 3 |
9109db2a1b68cbd5f1ab9ae2fda84b07e6811b26 | sources/Curse/dungeonsdragonsandspaceshuttles.json | sources/Curse/dungeonsdragonsandspaceshuttles.json | {
"name": "dungeonsdragonsandspaceshuttles",
"site_url": "https://www.curseforge.com/minecraft/modpacks/dungeons-dragons-and-space-shuttles",
"description": "Hardcore Adventure & Expert Quest-Pack",
"channels": [
{
"name": "build",
"interface": "json",
"mirror": true,
"releases": [
{
"version": "5.5a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.5a.zip",
"build": 55
},
{
"version": "5.6a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.6a.zip",
"build": 56
}
]
}
]
} | {
"name": "dungeonsdragonsandspaceshuttles",
"site_url": "https://www.curseforge.com/minecraft/modpacks/dungeons-dragons-and-space-shuttles",
"description": "Hardcore Adventure & Expert Quest-Pack",
"channels": [
{
"name": "build",
"interface": "json",
"mirror": true,
"releases": [
{
"version": "5.5a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.5a.zip",
"build": 55
},
{
"version": "5.6a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.6a.zip",
"build": 56
},
{
"version": "6.2",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-6.2.zip",
"build": 62
}
]
}
]
} | Update Dungeons, Dragons, and Space Shuttles to 6.2 | Update Dungeons, Dragons, and Space Shuttles to 6.2
| JSON | mpl-2.0 | MCProHosting/SpaceGDN,MCProHosting/SpaceGDN,MCProHosting/SpaceGDN | json | ## Code Before:
{
"name": "dungeonsdragonsandspaceshuttles",
"site_url": "https://www.curseforge.com/minecraft/modpacks/dungeons-dragons-and-space-shuttles",
"description": "Hardcore Adventure & Expert Quest-Pack",
"channels": [
{
"name": "build",
"interface": "json",
"mirror": true,
"releases": [
{
"version": "5.5a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.5a.zip",
"build": 55
},
{
"version": "5.6a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.6a.zip",
"build": 56
}
]
}
]
}
## Instruction:
Update Dungeons, Dragons, and Space Shuttles to 6.2
## Code After:
{
"name": "dungeonsdragonsandspaceshuttles",
"site_url": "https://www.curseforge.com/minecraft/modpacks/dungeons-dragons-and-space-shuttles",
"description": "Hardcore Adventure & Expert Quest-Pack",
"channels": [
{
"name": "build",
"interface": "json",
"mirror": true,
"releases": [
{
"version": "5.5a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.5a.zip",
"build": 55
},
{
"version": "5.6a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.6a.zip",
"build": 56
},
{
"version": "6.2",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-6.2.zip",
"build": 62
}
]
}
]
} | {
"name": "dungeonsdragonsandspaceshuttles",
"site_url": "https://www.curseforge.com/minecraft/modpacks/dungeons-dragons-and-space-shuttles",
"description": "Hardcore Adventure & Expert Quest-Pack",
"channels": [
{
"name": "build",
"interface": "json",
"mirror": true,
"releases": [
{
"version": "5.5a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.5a.zip",
"build": 55
},
{
"version": "5.6a",
"url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-5.6a.zip",
"build": 56
+ },
+ {
+ "version": "6.2",
+ "url": "https://s3.amazonaws.com/MCProHosting-Misc/Curse/DungeonsDragonsAndSpaceShuttles-1.12.2-6.2.zip",
+ "build": 62
}
]
}
]
} | 5 | 0.208333 | 5 | 0 |
e5da8e8bae91c567a08bd32f98dedf8d0b723493 | core/lib/spree/localized_number.rb | core/lib/spree/localized_number.rb | module Spree
class LocalizedNumber
# Given a string, strips all non-price-like characters from it,
# taking into account locale settings. Returns the input given anything
# else.
#
# @param number [String, anything] the number to be parsed or anything else
# @return [BigDecimal, anything] the number parsed from the string passed
# in, or whatever you passed in
def self.parse(number)
return number unless number.is_a?(String)
# I18n.t('number.currency.format.delimiter') could be useful here, but is
# unnecessary as it is stripped by the non_number_characters gsub.
separator = I18n.t(:'number.currency.format.separator')
non_number_characters = /[^0-9\-#{separator}]/
# strip everything else first
number.gsub!(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number.gsub!(separator, '.') unless separator == '.'
number.to_d
end
end
end
| module Spree
class LocalizedNumber
# Given a string, strips all non-price-like characters from it,
# taking into account locale settings. Returns the input given anything
# else.
#
# @param number [String, anything] the number to be parsed or anything else
# @return [BigDecimal, anything] the number parsed from the string passed
# in, or whatever you passed in
def self.parse(number)
return number unless number.is_a?(String)
# I18n.t('number.currency.format.delimiter') could be useful here, but is
# unnecessary as it is stripped by the non_number_characters gsub.
separator = I18n.t(:'number.currency.format.separator')
non_number_characters = /[^0-9\-#{separator}]/
# strip everything else first
number = number.gsub(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number = number.gsub(separator, '.') unless separator == '.'
number.to_d
end
end
end
| Stop mutating input in LocalizedNumber.parse | Stop mutating input in LocalizedNumber.parse
Previously, LocalizedNumber.parse would perform it's gsub!
replacements directly on the string passed in.
| Ruby | bsd-3-clause | pervino/solidus,Arpsara/solidus,Arpsara/solidus,pervino/solidus,Arpsara/solidus,Arpsara/solidus,pervino/solidus,pervino/solidus | ruby | ## Code Before:
module Spree
class LocalizedNumber
# Given a string, strips all non-price-like characters from it,
# taking into account locale settings. Returns the input given anything
# else.
#
# @param number [String, anything] the number to be parsed or anything else
# @return [BigDecimal, anything] the number parsed from the string passed
# in, or whatever you passed in
def self.parse(number)
return number unless number.is_a?(String)
# I18n.t('number.currency.format.delimiter') could be useful here, but is
# unnecessary as it is stripped by the non_number_characters gsub.
separator = I18n.t(:'number.currency.format.separator')
non_number_characters = /[^0-9\-#{separator}]/
# strip everything else first
number.gsub!(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number.gsub!(separator, '.') unless separator == '.'
number.to_d
end
end
end
## Instruction:
Stop mutating input in LocalizedNumber.parse
Previously, LocalizedNumber.parse would perform it's gsub!
replacements directly on the string passed in.
## Code After:
module Spree
class LocalizedNumber
# Given a string, strips all non-price-like characters from it,
# taking into account locale settings. Returns the input given anything
# else.
#
# @param number [String, anything] the number to be parsed or anything else
# @return [BigDecimal, anything] the number parsed from the string passed
# in, or whatever you passed in
def self.parse(number)
return number unless number.is_a?(String)
# I18n.t('number.currency.format.delimiter') could be useful here, but is
# unnecessary as it is stripped by the non_number_characters gsub.
separator = I18n.t(:'number.currency.format.separator')
non_number_characters = /[^0-9\-#{separator}]/
# strip everything else first
number = number.gsub(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number = number.gsub(separator, '.') unless separator == '.'
number.to_d
end
end
end
| module Spree
class LocalizedNumber
# Given a string, strips all non-price-like characters from it,
# taking into account locale settings. Returns the input given anything
# else.
#
# @param number [String, anything] the number to be parsed or anything else
# @return [BigDecimal, anything] the number parsed from the string passed
# in, or whatever you passed in
def self.parse(number)
return number unless number.is_a?(String)
# I18n.t('number.currency.format.delimiter') could be useful here, but is
# unnecessary as it is stripped by the non_number_characters gsub.
separator = I18n.t(:'number.currency.format.separator')
non_number_characters = /[^0-9\-#{separator}]/
# strip everything else first
- number.gsub!(non_number_characters, '')
? -
+ number = number.gsub(non_number_characters, '')
? +++++++++
+
# then replace the locale-specific decimal separator with the standard separator if necessary
- number.gsub!(separator, '.') unless separator == '.'
? -
+ number = number.gsub(separator, '.') unless separator == '.'
? +++++++++
number.to_d
end
end
end | 5 | 0.192308 | 3 | 2 |
0f7d8975a3b273ab5a90214156d2572c92858369 | Profiler/ProfilerStorageInterface.php | Profiler/ProfilerStorageInterface.php | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Profiler;
/**
* ProfilerStorageInterface.
*
* This interface exists for historical reasons. The only supported
* implementation is FileProfilerStorage.
*
* As the profiler must only be used on non-production servers, the file storage
* is more than enough and no other implementations will ever be supported.
*
* @internal
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface ProfilerStorageInterface
{
/**
* Finds profiler tokens for the given criteria.
*
* @param int|null $limit The maximum number of tokens to return
* @param int|null $start The start date to search from
* @param int|null $end The end date to search to
*
* @return array
*/
public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;
/**
* Reads data associated with the given token.
*
* The method returns false if the token does not exist in the storage.
*
* @return Profile|null
*/
public function read(string $token): ?Profile;
/**
* Saves a Profile.
*
* @return bool
*/
public function write(Profile $profile): bool;
/**
* Purges all data from the database.
*/
public function purge();
}
| <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Profiler;
/**
* ProfilerStorageInterface.
*
* This interface exists for historical reasons. The only supported
* implementation is FileProfilerStorage.
*
* As the profiler must only be used on non-production servers, the file storage
* is more than enough and no other implementations will ever be supported.
*
* @internal
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface ProfilerStorageInterface
{
/**
* Finds profiler tokens for the given criteria.
*
* @param int|null $limit The maximum number of tokens to return
* @param int|null $start The start date to search from
* @param int|null $end The end date to search to
*/
public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;
/**
* Reads data associated with the given token.
*
* The method returns false if the token does not exist in the storage.
*/
public function read(string $token): ?Profile;
/**
* Saves a Profile.
*/
public function write(Profile $profile): bool;
/**
* Purges all data from the database.
*/
public function purge();
}
| Fix some redundant @return phpdoc | Fix some redundant @return phpdoc
| PHP | mit | symfony/http-kernel | php | ## Code Before:
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Profiler;
/**
* ProfilerStorageInterface.
*
* This interface exists for historical reasons. The only supported
* implementation is FileProfilerStorage.
*
* As the profiler must only be used on non-production servers, the file storage
* is more than enough and no other implementations will ever be supported.
*
* @internal
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface ProfilerStorageInterface
{
/**
* Finds profiler tokens for the given criteria.
*
* @param int|null $limit The maximum number of tokens to return
* @param int|null $start The start date to search from
* @param int|null $end The end date to search to
*
* @return array
*/
public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;
/**
* Reads data associated with the given token.
*
* The method returns false if the token does not exist in the storage.
*
* @return Profile|null
*/
public function read(string $token): ?Profile;
/**
* Saves a Profile.
*
* @return bool
*/
public function write(Profile $profile): bool;
/**
* Purges all data from the database.
*/
public function purge();
}
## Instruction:
Fix some redundant @return phpdoc
## Code After:
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Profiler;
/**
* ProfilerStorageInterface.
*
* This interface exists for historical reasons. The only supported
* implementation is FileProfilerStorage.
*
* As the profiler must only be used on non-production servers, the file storage
* is more than enough and no other implementations will ever be supported.
*
* @internal
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface ProfilerStorageInterface
{
/**
* Finds profiler tokens for the given criteria.
*
* @param int|null $limit The maximum number of tokens to return
* @param int|null $start The start date to search from
* @param int|null $end The end date to search to
*/
public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;
/**
* Reads data associated with the given token.
*
* The method returns false if the token does not exist in the storage.
*/
public function read(string $token): ?Profile;
/**
* Saves a Profile.
*/
public function write(Profile $profile): bool;
/**
* Purges all data from the database.
*/
public function purge();
}
| <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Profiler;
/**
* ProfilerStorageInterface.
*
* This interface exists for historical reasons. The only supported
* implementation is FileProfilerStorage.
*
* As the profiler must only be used on non-production servers, the file storage
* is more than enough and no other implementations will ever be supported.
*
* @internal
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface ProfilerStorageInterface
{
/**
* Finds profiler tokens for the given criteria.
*
* @param int|null $limit The maximum number of tokens to return
* @param int|null $start The start date to search from
* @param int|null $end The end date to search to
- *
- * @return array
*/
public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;
/**
* Reads data associated with the given token.
*
* The method returns false if the token does not exist in the storage.
- *
- * @return Profile|null
*/
public function read(string $token): ?Profile;
/**
* Saves a Profile.
- *
- * @return bool
*/
public function write(Profile $profile): bool;
/**
* Purges all data from the database.
*/
public function purge();
} | 6 | 0.1 | 0 | 6 |
98325551394c519a6c349fc0235ac4effaa8a5a4 | README.md | README.md | gomutexperf
===========
Testing mutex performance in Golang.
| gomutexperf
===========
Running 5000 threads for 900 seconds
best 16184645 worst 13326574 99PCTL 16115223
| Add results from a run. | Add results from a run.
| Markdown | mit | nfisher/gomutexperf | markdown | ## Code Before:
gomutexperf
===========
Testing mutex performance in Golang.
## Instruction:
Add results from a run.
## Code After:
gomutexperf
===========
Running 5000 threads for 900 seconds
best 16184645 worst 13326574 99PCTL 16115223
| gomutexperf
===========
- Testing mutex performance in Golang.
+ Running 5000 threads for 900 seconds
+ best 16184645 worst 13326574 99PCTL 16115223 | 3 | 0.75 | 2 | 1 |
f7b975618d35836a9621468e6eddc3505b7e70c8 | src/Concerns/HandlesAnnotations.php | src/Concerns/HandlesAnnotations.php | <?php
namespace Orchestra\Testbench\Concerns;
use Illuminate\Support\Collection;
use PHPUnit\Framework\TestCase;
use PHPUnit\Util\Test as TestUtil;
trait HandlesAnnotations
{
/**
* Parse test method annotations.
*
* @param \Illuminate\Foundation\Application $app
* @param string $name
*/
protected function parseTestMethodAnnotations($app, string $name): void
{
if (! $this instanceof TestCase) {
return;
}
$annotations = TestUtil::parseTestMethodAnnotations(
static::class, $this->getName(false)
);
Collection::make($annotations)->each(function ($location) use ($name, $app) {
Collection::make($location[$name] ?? [])
->filter(function ($method) {
return ! \is_null($method) && \method_exists($this, $method);
})->each(function ($method) use ($app) {
$this->{$method}($app);
});
});
}
}
| <?php
namespace Orchestra\Testbench\Concerns;
use Illuminate\Support\Collection;
use PHPUnit\Framework\TestCase;
use PHPUnit\Metadata\Annotation\Parser\Registry as AnnotationRegistry;
use PHPUnit\Runner\Version;
use PHPUnit\Util\Test as TestUtil;
trait HandlesAnnotations
{
/**
* Parse test method annotations.
*
* @param \Illuminate\Foundation\Application $app
* @param string $name
*/
protected function parseTestMethodAnnotations($app, string $name): void
{
if (! $this instanceof TestCase) {
return;
}
if (\class_exists(Version::class) && \version_compare(Version::id(), '10', '>=')) {
$annotations = \rescue(function () {
return AnnotationRegistry::getInstance()->forMethod(static::class, $this->getName(false))->symbolAnnotations();
}, [], false);
Collection::make($annotations)->filter(function ($location, $key) use ($name) {
return $key === $name;
})->each(function ($location) use ($app) {
Collection::make($location ?? [])
->filter(function ($method) {
return ! \is_null($method) && \method_exists($this, $method);
})->each(function ($method) use ($app) {
$this->{$method}($app);
});
});
return;
}
$annotations = TestUtil::parseTestMethodAnnotations(
static::class, $this->getName(false)
);
Collection::make($annotations)->each(function ($location) use ($name, $app) {
Collection::make($location[$name] ?? [])
->filter(function ($method) {
return ! \is_null($method) && \method_exists($this, $method);
})->each(function ($method) use ($app) {
$this->{$method}($app);
});
});
}
}
| Use new AnnotationRegistery for PHPUnit 10. | Use new AnnotationRegistery for PHPUnit 10.
Signed-off-by: Mior Muhammad Zaki <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
| PHP | mit | orchestral/testbench-core,orchestral/testbench-core | php | ## Code Before:
<?php
namespace Orchestra\Testbench\Concerns;
use Illuminate\Support\Collection;
use PHPUnit\Framework\TestCase;
use PHPUnit\Util\Test as TestUtil;
trait HandlesAnnotations
{
/**
* Parse test method annotations.
*
* @param \Illuminate\Foundation\Application $app
* @param string $name
*/
protected function parseTestMethodAnnotations($app, string $name): void
{
if (! $this instanceof TestCase) {
return;
}
$annotations = TestUtil::parseTestMethodAnnotations(
static::class, $this->getName(false)
);
Collection::make($annotations)->each(function ($location) use ($name, $app) {
Collection::make($location[$name] ?? [])
->filter(function ($method) {
return ! \is_null($method) && \method_exists($this, $method);
})->each(function ($method) use ($app) {
$this->{$method}($app);
});
});
}
}
## Instruction:
Use new AnnotationRegistery for PHPUnit 10.
Signed-off-by: Mior Muhammad Zaki <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
## Code After:
<?php
namespace Orchestra\Testbench\Concerns;
use Illuminate\Support\Collection;
use PHPUnit\Framework\TestCase;
use PHPUnit\Metadata\Annotation\Parser\Registry as AnnotationRegistry;
use PHPUnit\Runner\Version;
use PHPUnit\Util\Test as TestUtil;
trait HandlesAnnotations
{
/**
* Parse test method annotations.
*
* @param \Illuminate\Foundation\Application $app
* @param string $name
*/
protected function parseTestMethodAnnotations($app, string $name): void
{
if (! $this instanceof TestCase) {
return;
}
if (\class_exists(Version::class) && \version_compare(Version::id(), '10', '>=')) {
$annotations = \rescue(function () {
return AnnotationRegistry::getInstance()->forMethod(static::class, $this->getName(false))->symbolAnnotations();
}, [], false);
Collection::make($annotations)->filter(function ($location, $key) use ($name) {
return $key === $name;
})->each(function ($location) use ($app) {
Collection::make($location ?? [])
->filter(function ($method) {
return ! \is_null($method) && \method_exists($this, $method);
})->each(function ($method) use ($app) {
$this->{$method}($app);
});
});
return;
}
$annotations = TestUtil::parseTestMethodAnnotations(
static::class, $this->getName(false)
);
Collection::make($annotations)->each(function ($location) use ($name, $app) {
Collection::make($location[$name] ?? [])
->filter(function ($method) {
return ! \is_null($method) && \method_exists($this, $method);
})->each(function ($method) use ($app) {
$this->{$method}($app);
});
});
}
}
| <?php
namespace Orchestra\Testbench\Concerns;
use Illuminate\Support\Collection;
use PHPUnit\Framework\TestCase;
+ use PHPUnit\Metadata\Annotation\Parser\Registry as AnnotationRegistry;
+ use PHPUnit\Runner\Version;
use PHPUnit\Util\Test as TestUtil;
trait HandlesAnnotations
{
/**
* Parse test method annotations.
*
* @param \Illuminate\Foundation\Application $app
* @param string $name
*/
protected function parseTestMethodAnnotations($app, string $name): void
{
if (! $this instanceof TestCase) {
+ return;
+ }
+
+ if (\class_exists(Version::class) && \version_compare(Version::id(), '10', '>=')) {
+ $annotations = \rescue(function () {
+ return AnnotationRegistry::getInstance()->forMethod(static::class, $this->getName(false))->symbolAnnotations();
+ }, [], false);
+
+ Collection::make($annotations)->filter(function ($location, $key) use ($name) {
+ return $key === $name;
+ })->each(function ($location) use ($app) {
+ Collection::make($location ?? [])
+ ->filter(function ($method) {
+ return ! \is_null($method) && \method_exists($this, $method);
+ })->each(function ($method) use ($app) {
+ $this->{$method}($app);
+ });
+ });
+
return;
}
$annotations = TestUtil::parseTestMethodAnnotations(
static::class, $this->getName(false)
);
Collection::make($annotations)->each(function ($location) use ($name, $app) {
Collection::make($location[$name] ?? [])
->filter(function ($method) {
return ! \is_null($method) && \method_exists($this, $method);
})->each(function ($method) use ($app) {
$this->{$method}($app);
});
});
}
} | 21 | 0.583333 | 21 | 0 |
d7bbddb367c81582a572e5504b5cbc8407852bfd | lib/geocoder/models/base.rb | lib/geocoder/models/base.rb | require 'geocoder'
module Geocoder
##
# Methods for invoking Geocoder in a model.
#
module Model
module Base
def geocoder_options
if defined?(@geocoder_options)
@geocoder_options
elsif superclass.respond_to?(:geocoder_options)
superclass.geocoder_options
end
end
def geocoded_by
fail
end
def reverse_geocoded_by
fail
end
private # ----------------------------------------------------------------
def geocoder_init(options)
unless geocoder_initialized?
@geocoder_options = {}
require "geocoder/stores/#{geocoder_file_name}"
include eval("Geocoder::Store::" + geocoder_module_name)
end
@geocoder_options.merge! options
end
def geocoder_initialized?
begin
included_modules.include? eval("Geocoder::Store::" + geocoder_module_name)
rescue NameError
false
end
end
end
end
end
| require 'geocoder'
module Geocoder
##
# Methods for invoking Geocoder in a model.
#
module Model
module Base
def geocoder_options
if defined?(@geocoder_options)
@geocoder_options
elsif superclass.respond_to?(:geocoder_options)
superclass.geocoder_options
end
end
def geocoded_by
fail
end
def reverse_geocoded_by
fail
end
private # ----------------------------------------------------------------
def geocoder_init(options)
unless @geocoder_options
@geocoder_options = {}
require "geocoder/stores/#{geocoder_file_name}"
include eval("Geocoder::Store::" + geocoder_module_name)
end
@geocoder_options.merge! options
end
def geocoder_initialized?
begin
included_modules.include? eval("Geocoder::Store::" + geocoder_module_name)
rescue NameError
false
end
end
end
end
end
| Fix for geocoding with STI models | Fix for geocoding with STI models
| Ruby | mit | 3mundi/geocoder,jgrciv/geocoder,tiramizoo/geocoder,ivanzotov/geocoder,rios1993/geocoder,sr-education/geocoder,brian-ewell/geocoder,jaigouk/geocoder-olleh,Devetzis/geocoder,davydovanton/geocoder,andreamazz/geocoder,sjaveed/geocoder,mehlah/geocoder,rdlugosz/geocoder,FanaHOVA/geocoder,TrangPham/geocoder,mveer99/geocoder,alexreisner/geocoder,eugenehp/ruby-geocoder,epyatopal/geocoder,aceunreal/geocoder,gogovan/geocoder-olleh,donbobka/geocoder,ankane/geocoder,guavapass/geocoder,crdunwel/geocoder,boone/geocoder,tortuba/geocoder,john/geocoder,rayzeller/geocoder,sideci-sample/sideci-sample-geocoder,nerdyglasses/geocoder,mdebo/geocoder,gogovan/geocoder-olleh,moofish32/geocoder,GermanDZ/geocoder,jonathanleone/geocoder,StudioMelipone/geocoder,malandrina/geocoder,jaigouk/geocoder-olleh,AndyDangerous/geocoder | ruby | ## Code Before:
require 'geocoder'
module Geocoder
##
# Methods for invoking Geocoder in a model.
#
module Model
module Base
def geocoder_options
if defined?(@geocoder_options)
@geocoder_options
elsif superclass.respond_to?(:geocoder_options)
superclass.geocoder_options
end
end
def geocoded_by
fail
end
def reverse_geocoded_by
fail
end
private # ----------------------------------------------------------------
def geocoder_init(options)
unless geocoder_initialized?
@geocoder_options = {}
require "geocoder/stores/#{geocoder_file_name}"
include eval("Geocoder::Store::" + geocoder_module_name)
end
@geocoder_options.merge! options
end
def geocoder_initialized?
begin
included_modules.include? eval("Geocoder::Store::" + geocoder_module_name)
rescue NameError
false
end
end
end
end
end
## Instruction:
Fix for geocoding with STI models
## Code After:
require 'geocoder'
module Geocoder
##
# Methods for invoking Geocoder in a model.
#
module Model
module Base
def geocoder_options
if defined?(@geocoder_options)
@geocoder_options
elsif superclass.respond_to?(:geocoder_options)
superclass.geocoder_options
end
end
def geocoded_by
fail
end
def reverse_geocoded_by
fail
end
private # ----------------------------------------------------------------
def geocoder_init(options)
unless @geocoder_options
@geocoder_options = {}
require "geocoder/stores/#{geocoder_file_name}"
include eval("Geocoder::Store::" + geocoder_module_name)
end
@geocoder_options.merge! options
end
def geocoder_initialized?
begin
included_modules.include? eval("Geocoder::Store::" + geocoder_module_name)
rescue NameError
false
end
end
end
end
end
| require 'geocoder'
module Geocoder
##
# Methods for invoking Geocoder in a model.
#
module Model
module Base
def geocoder_options
if defined?(@geocoder_options)
@geocoder_options
elsif superclass.respond_to?(:geocoder_options)
superclass.geocoder_options
end
end
def geocoded_by
fail
end
def reverse_geocoded_by
fail
end
private # ----------------------------------------------------------------
def geocoder_init(options)
- unless geocoder_initialized?
? ^^^ ^^^^^^^
+ unless @geocoder_options
? + ^^ ^^^
@geocoder_options = {}
require "geocoder/stores/#{geocoder_file_name}"
include eval("Geocoder::Store::" + geocoder_module_name)
end
@geocoder_options.merge! options
end
def geocoder_initialized?
begin
included_modules.include? eval("Geocoder::Store::" + geocoder_module_name)
rescue NameError
false
end
end
end
end
end | 2 | 0.041667 | 1 | 1 |
c33a446759c4a33bb898581c5e64f4fecd0f9433 | packages/rocketchat-ui/lib/cordova/urls.coffee | packages/rocketchat-ui/lib/cordova/urls.coffee | Meteor.startup ->
return unless Meteor.isCordova
# Handle click events for all external URLs
$(document).on 'deviceready', ->
platform = device.platform.toLowerCase()
$(document).on 'click', (e) ->
$link = $(e.target).closest('a[href]')
return unless $link.length > 0
url = $link.attr('href')
if /^https?:\/\/.+/.test(url) is true
switch platform
when 'ios'
window.open url, '_system'
when 'android'
navigator.app.loadUrl url, {openExternal: true}
e.preventDefault() | Meteor.startup ->
return unless Meteor.isCordova
# Handle click events for all external URLs
$(document).on 'deviceready', ->
platform = device.platform.toLowerCase()
$(document).on 'click', (e) ->
$link = $(e.target).closest('a[href]')
return unless $link.length > 0
url = $link.attr('href')
if /^https?:\/\/.+/.test(url) is true
window.open url, '_system'
e.preventDefault()
| Fix open links for Android | Fix open links for Android
| CoffeeScript | mit | LeonardOliveros/Rocket.Chat,subesokun/Rocket.Chat,nishimaki10/Rocket.Chat,amaapp/ama,Deepakkothandan/Rocket.Chat,NMandapaty/Rocket.Chat,org100h1/Rocket.Panda,mrinaldhar/Rocket.Chat,Movile/Rocket.Chat,Kiran-Rao/Rocket.Chat,jbsavoy18/rocketchat-1,AlecTroemel/Rocket.Chat,karlprieb/Rocket.Chat,inoxth/Rocket.Chat,Sing-Li/Rocket.Chat,karlprieb/Rocket.Chat,fatihwk/Rocket.Chat,LearnersGuild/echo-chat,trt15-ssci-organization/Rocket.Chat,mrinaldhar/Rocket.Chat,OtkurBiz/Rocket.Chat,yuyixg/Rocket.Chat,capensisma/Rocket.Chat,fatihwk/Rocket.Chat,ziedmahdi/Rocket.Chat,ealbers/Rocket.Chat,Deepakkothandan/Rocket.Chat,mwharrison/Rocket.Chat,ziedmahdi/Rocket.Chat,org100h1/Rocket.Panda,pitamar/Rocket.Chat,abduljanjua/TheHub,linnovate/hi,acaronmd/Rocket.Chat,intelradoux/Rocket.Chat,OtkurBiz/Rocket.Chat,pkgodara/Rocket.Chat,galrotem1993/Rocket.Chat,Gyubin/Rocket.Chat,LeonardOliveros/Rocket.Chat,BorntraegerMarc/Rocket.Chat,haoyixin/Rocket.Chat,PavelVanecek/Rocket.Chat,Gudii/Rocket.Chat,Sing-Li/Rocket.Chat,xasx/Rocket.Chat,Kiran-Rao/Rocket.Chat,abhishekshukla0302/trico,litewhatever/Rocket.Chat,danielbressan/Rocket.Chat,Achaikos/Rocket.Chat,capensisma/Rocket.Chat,xboston/Rocket.Chat,VoiSmart/Rocket.Chat,4thParty/Rocket.Chat,klatys/Rocket.Chat,Gyubin/Rocket.Chat,flaviogrossi/Rocket.Chat,liuliming2008/Rocket.Chat,abhishekshukla0302/trico,ziedmahdi/Rocket.Chat,Gudii/Rocket.Chat,ahmadassaf/Rocket.Chat,pkgodara/Rocket.Chat,Gyubin/Rocket.Chat,tlongren/Rocket.Chat,igorstajic/Rocket.Chat,TribeMedia/Rocket.Chat,ut7/Rocket.Chat,pitamar/Rocket.Chat,linnovate/hi,litewhatever/Rocket.Chat,LearnersGuild/echo-chat,ziedmahdi/Rocket.Chat,BorntraegerMarc/Rocket.Chat,ealbers/Rocket.Chat,4thParty/Rocket.Chat,mrinaldhar/Rocket.Chat,haoyixin/Rocket.Chat,4thParty/Rocket.Chat,NMandapaty/Rocket.Chat,flaviogrossi/Rocket.Chat,JamesHGreen/Rocket.Chat,xboston/Rocket.Chat,liuliming2008/Rocket.Chat,timkinnane/Rocket.Chat,ggazzo/Rocket.Chat,mccambridge/Rocket.Chat,nishimaki10/Rocket.Chat,jbsavoy18/rocketchat-1,Achaikos/Rocket.Chat,Gudii/Rocket.Chat,Gudii/Rocket.Chat,ut7/Rocket.Chat,VoiSmart/Rocket.Chat,mccambridge/Rocket.Chat,Deepakkothandan/Rocket.Chat,Movile/Rocket.Chat,mwharrison/Rocket.Chat,intelradoux/Rocket.Chat,pitamar/Rocket.Chat,4thParty/Rocket.Chat,tlongren/Rocket.Chat,subesokun/Rocket.Chat,Gyubin/Rocket.Chat,Achaikos/Rocket.Chat,LearnersGuild/echo-chat,subesokun/Rocket.Chat,NMandapaty/Rocket.Chat,Flitterkill/Rocket.Chat,ahmadassaf/Rocket.Chat,pachox/Rocket.Chat,matthewshirley/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,klatys/Rocket.Chat,inoio/Rocket.Chat,snaiperskaya96/Rocket.Chat,klatys/Rocket.Chat,steedos/chat,Flitterkill/Rocket.Chat,abduljanjua/TheHub,AlecTroemel/Rocket.Chat,pkgodara/Rocket.Chat,igorstajic/Rocket.Chat,intelradoux/Rocket.Chat,TribeMedia/Rocket.Chat,acaronmd/Rocket.Chat,litewhatever/Rocket.Chat,AlecTroemel/Rocket.Chat,mrinaldhar/Rocket.Chat,PavelVanecek/Rocket.Chat,yuyixg/Rocket.Chat,liuliming2008/Rocket.Chat,JamesHGreen/Rocket_API,mrsimpson/Rocket.Chat,marzieh312/Rocket.Chat,fatihwk/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,org100h1/Rocket.Panda,cnash/Rocket.Chat,acaronmd/Rocket.Chat,karlprieb/Rocket.Chat,alexbrazier/Rocket.Chat,inoxth/Rocket.Chat,amaapp/ama,ahmadassaf/Rocket.Chat,wicked539/Rocket.Chat,danielbressan/Rocket.Chat,igorstajic/Rocket.Chat,marzieh312/Rocket.Chat,LeonardOliveros/Rocket.Chat,ut7/Rocket.Chat,JamesHGreen/Rocket.Chat,marzieh312/Rocket.Chat,abhishekshukla0302/trico,AimenJoe/Rocket.Chat,steedos/chat,mrsimpson/Rocket.Chat,bt/Rocket.Chat,Movile/Rocket.Chat,cdwv/Rocket.Chat,ealbers/Rocket.Chat,Flitterkill/Rocket.Chat,mccambridge/Rocket.Chat,mccambridge/Rocket.Chat,snaiperskaya96/Rocket.Chat,wtsarchive/Rocket.Chat,Sing-Li/Rocket.Chat,abduljanjua/TheHub,JamesHGreen/Rocket_API,xboston/Rocket.Chat,OtkurBiz/Rocket.Chat,LearnersGuild/echo-chat,BorntraegerMarc/Rocket.Chat,galrotem1993/Rocket.Chat,LearnersGuild/Rocket.Chat,yuyixg/Rocket.Chat,wtsarchive/Rocket.Chat,danielbressan/Rocket.Chat,bt/Rocket.Chat,xasx/Rocket.Chat,cdwv/Rocket.Chat,amaapp/ama,Dianoga/Rocket.Chat,acaronmd/Rocket.Chat,matthewshirley/Rocket.Chat,BorntraegerMarc/Rocket.Chat,Sing-Li/Rocket.Chat,VoiSmart/Rocket.Chat,ealbers/Rocket.Chat,pitamar/Rocket.Chat,LeonardOliveros/Rocket.Chat,mrsimpson/Rocket.Chat,Movile/Rocket.Chat,yuyixg/Rocket.Chat,bt/Rocket.Chat,k0nsl/Rocket.Chat,ggazzo/Rocket.Chat,AimenJoe/Rocket.Chat,xasx/Rocket.Chat,PavelVanecek/Rocket.Chat,alexbrazier/Rocket.Chat,org100h1/Rocket.Panda,trt15-ssci-organization/Rocket.Chat,matthewshirley/Rocket.Chat,wicked539/Rocket.Chat,k0nsl/Rocket.Chat,Dianoga/Rocket.Chat,OtkurBiz/Rocket.Chat,jbsavoy18/rocketchat-1,JamesHGreen/Rocket_API,tntobias/Rocket.Chat,AimenJoe/Rocket.Chat,steedos/chat,Kiran-Rao/Rocket.Chat,tlongren/Rocket.Chat,tntobias/Rocket.Chat,timkinnane/Rocket.Chat,bt/Rocket.Chat,inoio/Rocket.Chat,ggazzo/Rocket.Chat,intelradoux/Rocket.Chat,jbsavoy18/rocketchat-1,ggazzo/Rocket.Chat,ut7/Rocket.Chat,mwharrison/Rocket.Chat,mwharrison/Rocket.Chat,abhishekshukla0302/trico,cnash/Rocket.Chat,haoyixin/Rocket.Chat,flaviogrossi/Rocket.Chat,fatihwk/Rocket.Chat,inoio/Rocket.Chat,haoyixin/Rocket.Chat,TribeMedia/Rocket.Chat,wicked539/Rocket.Chat,nishimaki10/Rocket.Chat,pachox/Rocket.Chat,Dianoga/Rocket.Chat,LearnersGuild/Rocket.Chat,igorstajic/Rocket.Chat,AimenJoe/Rocket.Chat,wicked539/Rocket.Chat,timkinnane/Rocket.Chat,TribeMedia/Rocket.Chat,alexbrazier/Rocket.Chat,inoxth/Rocket.Chat,danielbressan/Rocket.Chat,cdwv/Rocket.Chat,ahmadassaf/Rocket.Chat,timkinnane/Rocket.Chat,xboston/Rocket.Chat,AlecTroemel/Rocket.Chat,nishimaki10/Rocket.Chat,wtsarchive/Rocket.Chat,Kiran-Rao/Rocket.Chat,pachox/Rocket.Chat,inoxth/Rocket.Chat,matthewshirley/Rocket.Chat,fduraibi/Rocket.Chat,abduljanjua/TheHub,JamesHGreen/Rocket.Chat,mrsimpson/Rocket.Chat,wtsarchive/Rocket.Chat,alexbrazier/Rocket.Chat,snaiperskaya96/Rocket.Chat,JamesHGreen/Rocket.Chat,cdwv/Rocket.Chat,tlongren/Rocket.Chat,fduraibi/Rocket.Chat,tntobias/Rocket.Chat,amaapp/ama,cnash/Rocket.Chat,LearnersGuild/Rocket.Chat,Achaikos/Rocket.Chat,steedos/chat,k0nsl/Rocket.Chat,NMandapaty/Rocket.Chat,xasx/Rocket.Chat,PavelVanecek/Rocket.Chat,cnash/Rocket.Chat,karlprieb/Rocket.Chat,Dianoga/Rocket.Chat,galrotem1993/Rocket.Chat,liuliming2008/Rocket.Chat,pkgodara/Rocket.Chat,snaiperskaya96/Rocket.Chat,fduraibi/Rocket.Chat,capensisma/Rocket.Chat,galrotem1993/Rocket.Chat,LearnersGuild/Rocket.Chat,litewhatever/Rocket.Chat,flaviogrossi/Rocket.Chat,JamesHGreen/Rocket_API,tntobias/Rocket.Chat,k0nsl/Rocket.Chat,marzieh312/Rocket.Chat,Deepakkothandan/Rocket.Chat,Flitterkill/Rocket.Chat,klatys/Rocket.Chat,fduraibi/Rocket.Chat,pachox/Rocket.Chat,subesokun/Rocket.Chat | coffeescript | ## Code Before:
Meteor.startup ->
return unless Meteor.isCordova
# Handle click events for all external URLs
$(document).on 'deviceready', ->
platform = device.platform.toLowerCase()
$(document).on 'click', (e) ->
$link = $(e.target).closest('a[href]')
return unless $link.length > 0
url = $link.attr('href')
if /^https?:\/\/.+/.test(url) is true
switch platform
when 'ios'
window.open url, '_system'
when 'android'
navigator.app.loadUrl url, {openExternal: true}
e.preventDefault()
## Instruction:
Fix open links for Android
## Code After:
Meteor.startup ->
return unless Meteor.isCordova
# Handle click events for all external URLs
$(document).on 'deviceready', ->
platform = device.platform.toLowerCase()
$(document).on 'click', (e) ->
$link = $(e.target).closest('a[href]')
return unless $link.length > 0
url = $link.attr('href')
if /^https?:\/\/.+/.test(url) is true
window.open url, '_system'
e.preventDefault()
| Meteor.startup ->
return unless Meteor.isCordova
# Handle click events for all external URLs
$(document).on 'deviceready', ->
platform = device.platform.toLowerCase()
$(document).on 'click', (e) ->
$link = $(e.target).closest('a[href]')
return unless $link.length > 0
url = $link.attr('href')
if /^https?:\/\/.+/.test(url) is true
- switch platform
- when 'ios'
- window.open url, '_system'
? --
+ window.open url, '_system'
- when 'android'
- navigator.app.loadUrl url, {openExternal: true}
e.preventDefault() | 6 | 0.333333 | 1 | 5 |
4af7fa032f57f41558bfe36bf65f75aa32de9922 | stack.ghc-8.0.yaml | stack.ghc-8.0.yaml | resolver: lts-9.0
packages:
- .
# This new version of `setgame` went up on Hackage today, but Stackage
# doesn't know about it yet :P
- location:
git: git@github.com:glguy/set-game.git
commit: e1565930ec9cb09fb3735775ed52b85bfc5335c8
extra-dep: true
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- cryptonite-0.18
- memory-0.13
- directory-1.2.7.1
- setgame-1.2
- vty-5.17
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []
| resolver: lts-9.0
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- cryptonite-0.18
- memory-0.13
- directory-1.2.7.1
- setgame-1.1
- vty-5.17
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []
| Use the version of `setgame` available on Hackage. | Use the version of `setgame` available on Hackage.
I thought Stack was just taking a long time to update, but actually
`setgame-1.2` is not on Hackage, just GitHub.
| YAML | bsd-3-clause | glguy/ssh-hans | yaml | ## Code Before:
resolver: lts-9.0
packages:
- .
# This new version of `setgame` went up on Hackage today, but Stackage
# doesn't know about it yet :P
- location:
git: git@github.com:glguy/set-game.git
commit: e1565930ec9cb09fb3735775ed52b85bfc5335c8
extra-dep: true
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- cryptonite-0.18
- memory-0.13
- directory-1.2.7.1
- setgame-1.2
- vty-5.17
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []
## Instruction:
Use the version of `setgame` available on Hackage.
I thought Stack was just taking a long time to update, but actually
`setgame-1.2` is not on Hackage, just GitHub.
## Code After:
resolver: lts-9.0
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- cryptonite-0.18
- memory-0.13
- directory-1.2.7.1
- setgame-1.1
- vty-5.17
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []
| resolver: lts-9.0
packages:
- .
- # This new version of `setgame` went up on Hackage today, but Stackage
- # doesn't know about it yet :P
- - location:
- git: git@github.com:glguy/set-game.git
- commit: e1565930ec9cb09fb3735775ed52b85bfc5335c8
- extra-dep: true
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- cryptonite-0.18
- memory-0.13
- directory-1.2.7.1
- - setgame-1.2
? ^
+ - setgame-1.1
? ^
- vty-5.17
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: [] | 8 | 0.32 | 1 | 7 |
0004bde0d40dfea167d76a83c20acfffc0abfa28 | poyo/__init__.py | poyo/__init__.py |
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
__all__ = ['parse_string', 'PoyoException']
|
import logging
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
logging.getLogger(__name__).addHandler(logging.NullHandler())
__all__ = ['parse_string', 'PoyoException']
| Add NullHandler to poyo root logger | Add NullHandler to poyo root logger
| Python | mit | hackebrot/poyo | python | ## Code Before:
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
__all__ = ['parse_string', 'PoyoException']
## Instruction:
Add NullHandler to poyo root logger
## Code After:
import logging
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
logging.getLogger(__name__).addHandler(logging.NullHandler())
__all__ = ['parse_string', 'PoyoException']
| +
+ import logging
from .exceptions import PoyoException
from .parser import parse_string
__author__ = 'Raphael Pierzina'
__email__ = 'raphael@hackebrot.de'
__version__ = '0.3.0'
+ logging.getLogger(__name__).addHandler(logging.NullHandler())
+
__all__ = ['parse_string', 'PoyoException'] | 4 | 0.444444 | 4 | 0 |
470fbbe32934834e8b5cc983e021fc3e7f7c9594 | test/core_spec.js | test/core_spec.js | import {List} from 'immutable';
import {expect} from 'chai';
import {createPlayer} from '../src/core';
describe('createPlayer', () => {
it('sets name properly', () => {
const name = 'someName';
const player = createPlayer(name);
expect(player.name).to.equal(name);
});
it('sets a non-empty ID', () => {
const player = createPlayer('someName');
expect(player.id).to.not.be.empty;
});
it('initializes an empty hand', () => {
const player = createPlayer('someName');
expect(player.hand).to.equal(List.of());
});
}
); | import {List} from 'immutable';
import {expect} from 'chai';
import {createPlayer} from '../src/core';
describe('createPlayer', () => {
it('sets name properly', () => {
const name = 'someName';
const player = createPlayer(name);
expect(player.name).to.equal(name);
});
it('sets a non-empty ID', () => {
const player = createPlayer('someName');
expect(player.id).to.exist;
});
it('initializes an empty hand', () => {
const player = createPlayer('someName');
expect(player.hand).to.equal(List.of());
});
}
);
| Simplify assertion from to.not.be.empty to to.exist | Simplify assertion from to.not.be.empty to to.exist
| JavaScript | apache-2.0 | evanepio/NodejsWarOServer | javascript | ## Code Before:
import {List} from 'immutable';
import {expect} from 'chai';
import {createPlayer} from '../src/core';
describe('createPlayer', () => {
it('sets name properly', () => {
const name = 'someName';
const player = createPlayer(name);
expect(player.name).to.equal(name);
});
it('sets a non-empty ID', () => {
const player = createPlayer('someName');
expect(player.id).to.not.be.empty;
});
it('initializes an empty hand', () => {
const player = createPlayer('someName');
expect(player.hand).to.equal(List.of());
});
}
);
## Instruction:
Simplify assertion from to.not.be.empty to to.exist
## Code After:
import {List} from 'immutable';
import {expect} from 'chai';
import {createPlayer} from '../src/core';
describe('createPlayer', () => {
it('sets name properly', () => {
const name = 'someName';
const player = createPlayer(name);
expect(player.name).to.equal(name);
});
it('sets a non-empty ID', () => {
const player = createPlayer('someName');
expect(player.id).to.exist;
});
it('initializes an empty hand', () => {
const player = createPlayer('someName');
expect(player.hand).to.equal(List.of());
});
}
);
| import {List} from 'immutable';
import {expect} from 'chai';
import {createPlayer} from '../src/core';
describe('createPlayer', () => {
it('sets name properly', () => {
const name = 'someName';
const player = createPlayer(name);
expect(player.name).to.equal(name);
});
it('sets a non-empty ID', () => {
const player = createPlayer('someName');
- expect(player.id).to.not.be.empty;
? ^^ ---------
+ expect(player.id).to.exist;
? ^^^^
});
it('initializes an empty hand', () => {
const player = createPlayer('someName');
expect(player.hand).to.equal(List.of());
});
}
); | 2 | 0.076923 | 1 | 1 |
072d5634a14559128d4132b018cb54c01fab7bf7 | app/assets/stylesheets/components/cms/_media.scss | app/assets/stylesheets/components/cms/_media.scss | img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
.video-wrapper {
//http://alistapart.com/article/creating-intrinsic-ratios-for-video
clear: both;
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
margin: $baseline-unit*4 0;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
| img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
| Remove video wrapper from CMS did | Remove video wrapper from CMS did
| SCSS | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | scss | ## Code Before:
img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
.video-wrapper {
//http://alistapart.com/article/creating-intrinsic-ratios-for-video
clear: both;
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
margin: $baseline-unit*4 0;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
## Instruction:
Remove video wrapper from CMS did
## Code After:
img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
| img {
max-width: 100%;
margin-bottom: $baseline-unit*4;
}
-
- .video-wrapper {
- //http://alistapart.com/article/creating-intrinsic-ratios-for-video
- clear: both;
- position: relative;
- padding-bottom: 56.25%; /* 16:9 */
- padding-top: 25px;
- height: 0;
- margin: $baseline-unit*4 0;
-
- iframe {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- } | 18 | 0.818182 | 0 | 18 |
b2ae5dc7d45483d4ba73353f120a6aa633324ca7 | client/src/components/customer/SelectedRestaurant.jsx | client/src/components/customer/SelectedRestaurant.jsx | import React from 'react';
import RestaurantLogoBanner from './RestaurantLogoBanner.jsx';
import CustomerInfoForm from './CustomerInfoForm.jsx';
import CustomerQueueInfo from './CustomerQueueInfo.jsx';
import RestaurantInformation from './RestaurantInformation.jsx';
class SelectedRestaurant extends React.Component {
constructor(props) {
super(props);
this.customerInfoSubmitted = this.customerInfoSubmitted.bind(this);
this.state = {
infoSubmitted: false,
queueId: 0,
queuePosition: 0
}
}
customerInfoSubmitted(id, position) {
// this.setState({
// infoSubmitted: true,
// queueId: id,
// queuePosition: position
// })
console.log('SelectedRestaurant customerInfoSubmitted', id, position, this.props.groupSize)
}
render() {
let image;
this.props.currentRestaurant.image === '../images/blank.png' ? image = '../images/randomrestaurant.jpg' : image = this.props.currentRestaurant.image;
const restaurantImg = {
backgroundImage: `url(${image})`
};
return (
<div className="selected-restaurant">
<RestaurantLogoBanner style={restaurantImg} />
<RestaurantInformation restaurant={this.props.currentRestaurant}/>
{this.state.infoSubmitted === false ? <CustomerInfoForm currentRestaurantId={this.props.currentRestaurant.id} customerInfoSubmitted={this.customerInfoSubmitted} groupSize={this.props.groupSize}/> : <CustomerQueueInfo />}
</div>
)
}
}
export default SelectedRestaurant; | import React from 'react';
import RestaurantLogoBanner from './RestaurantLogoBanner.jsx';
import CustomerInfoForm from './CustomerInfoForm.jsx';
import CustomerQueueInfo from './CustomerQueueInfo.jsx';
import RestaurantInformation from './RestaurantInformation.jsx';
class SelectedRestaurant extends React.Component {
constructor(props) {
super(props);
this.customerInfoSubmitted = this.customerInfoSubmitted.bind(this);
this.state = {
infoSubmitted: false,
queueId: 0,
queuePosition: 0
}
}
customerInfoSubmitted(id, position) {
this.setState({
infoSubmitted: true,
queueId: id,
queuePosition: position
})
}
render() {
let image;
this.props.currentRestaurant.image === '../images/blank.png' ? image = '../images/randomrestaurant.jpg' : image = this.props.currentRestaurant.image;
const restaurantImg = {
backgroundImage: `url(${image})`
};
return (
<div className="selected-restaurant">
<RestaurantLogoBanner style={restaurantImg} />
<RestaurantInformation restaurant={this.props.currentRestaurant}/>
{this.state.infoSubmitted === false ? <CustomerInfoForm currentRestaurantId={this.props.currentRestaurant.id} customerInfoSubmitted={this.customerInfoSubmitted} groupSize={this.props.groupSize}/> : <CustomerQueueInfo />}
</div>
)
}
}
export default SelectedRestaurant; | Fix POST request for customer info to add to queue | Fix POST request for customer info to add to queue
| JSX | mit | Lynne-Daniels/q-dot,Pegaiur/q-dot,nehacp/q-dot,q-dot/q-dot | jsx | ## Code Before:
import React from 'react';
import RestaurantLogoBanner from './RestaurantLogoBanner.jsx';
import CustomerInfoForm from './CustomerInfoForm.jsx';
import CustomerQueueInfo from './CustomerQueueInfo.jsx';
import RestaurantInformation from './RestaurantInformation.jsx';
class SelectedRestaurant extends React.Component {
constructor(props) {
super(props);
this.customerInfoSubmitted = this.customerInfoSubmitted.bind(this);
this.state = {
infoSubmitted: false,
queueId: 0,
queuePosition: 0
}
}
customerInfoSubmitted(id, position) {
// this.setState({
// infoSubmitted: true,
// queueId: id,
// queuePosition: position
// })
console.log('SelectedRestaurant customerInfoSubmitted', id, position, this.props.groupSize)
}
render() {
let image;
this.props.currentRestaurant.image === '../images/blank.png' ? image = '../images/randomrestaurant.jpg' : image = this.props.currentRestaurant.image;
const restaurantImg = {
backgroundImage: `url(${image})`
};
return (
<div className="selected-restaurant">
<RestaurantLogoBanner style={restaurantImg} />
<RestaurantInformation restaurant={this.props.currentRestaurant}/>
{this.state.infoSubmitted === false ? <CustomerInfoForm currentRestaurantId={this.props.currentRestaurant.id} customerInfoSubmitted={this.customerInfoSubmitted} groupSize={this.props.groupSize}/> : <CustomerQueueInfo />}
</div>
)
}
}
export default SelectedRestaurant;
## Instruction:
Fix POST request for customer info to add to queue
## Code After:
import React from 'react';
import RestaurantLogoBanner from './RestaurantLogoBanner.jsx';
import CustomerInfoForm from './CustomerInfoForm.jsx';
import CustomerQueueInfo from './CustomerQueueInfo.jsx';
import RestaurantInformation from './RestaurantInformation.jsx';
class SelectedRestaurant extends React.Component {
constructor(props) {
super(props);
this.customerInfoSubmitted = this.customerInfoSubmitted.bind(this);
this.state = {
infoSubmitted: false,
queueId: 0,
queuePosition: 0
}
}
customerInfoSubmitted(id, position) {
this.setState({
infoSubmitted: true,
queueId: id,
queuePosition: position
})
}
render() {
let image;
this.props.currentRestaurant.image === '../images/blank.png' ? image = '../images/randomrestaurant.jpg' : image = this.props.currentRestaurant.image;
const restaurantImg = {
backgroundImage: `url(${image})`
};
return (
<div className="selected-restaurant">
<RestaurantLogoBanner style={restaurantImg} />
<RestaurantInformation restaurant={this.props.currentRestaurant}/>
{this.state.infoSubmitted === false ? <CustomerInfoForm currentRestaurantId={this.props.currentRestaurant.id} customerInfoSubmitted={this.customerInfoSubmitted} groupSize={this.props.groupSize}/> : <CustomerQueueInfo />}
</div>
)
}
}
export default SelectedRestaurant; | import React from 'react';
import RestaurantLogoBanner from './RestaurantLogoBanner.jsx';
import CustomerInfoForm from './CustomerInfoForm.jsx';
import CustomerQueueInfo from './CustomerQueueInfo.jsx';
import RestaurantInformation from './RestaurantInformation.jsx';
class SelectedRestaurant extends React.Component {
constructor(props) {
super(props);
this.customerInfoSubmitted = this.customerInfoSubmitted.bind(this);
this.state = {
infoSubmitted: false,
queueId: 0,
queuePosition: 0
}
}
customerInfoSubmitted(id, position) {
- // this.setState({
? ---
+ this.setState({
- // infoSubmitted: true,
? ---
+ infoSubmitted: true,
- // queueId: id,
? ---
+ queueId: id,
- // queuePosition: position
? ---
+ queuePosition: position
- // })
? ---
+ })
- console.log('SelectedRestaurant customerInfoSubmitted', id, position, this.props.groupSize)
}
render() {
let image;
this.props.currentRestaurant.image === '../images/blank.png' ? image = '../images/randomrestaurant.jpg' : image = this.props.currentRestaurant.image;
const restaurantImg = {
backgroundImage: `url(${image})`
};
return (
<div className="selected-restaurant">
<RestaurantLogoBanner style={restaurantImg} />
<RestaurantInformation restaurant={this.props.currentRestaurant}/>
{this.state.infoSubmitted === false ? <CustomerInfoForm currentRestaurantId={this.props.currentRestaurant.id} customerInfoSubmitted={this.customerInfoSubmitted} groupSize={this.props.groupSize}/> : <CustomerQueueInfo />}
</div>
)
}
}
export default SelectedRestaurant; | 11 | 0.244444 | 5 | 6 |
23ac6dad5762288d36f5379a20adfbcd6f0f8628 | main.go | main.go | package main
import (
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
var createUsers = `
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name VARCHAR
);
`
var insertUser = `INSERT INTO users (id, name) VALUES (?, ?)`
var selectUser = `SELECT id, name FROM users`
func main() {
db, err := sql.Open("sqlite3", ":memory:")
if err != nil {
panic(err)
}
defer db.Close()
if _, err := db.Exec(createUsers); err != nil {
panic(err)
}
if _, err := db.Exec(insertUser, 23, "skidoo"); err != nil {
panic(err)
}
var id int64
var name string
row := db.QueryRow(selectUser)
if err = row.Scan(&id, &name); err != nil {
panic(err)
}
log.Println(id, name)
} | package main
import (
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
var createUsers = `
CREATE TABLE users (
id INTEGER,
name VARCHAR
);
`
var insertUser = `INSERT INTO users (id, name) VALUES (?, ?)`
var selectUser = `SELECT id, name FROM users`
type User struct {
ID int64
Name sql.NullString
}
func (u User) String() string {
if u.Name.Valid {
return u.Name.String
}
return "No name"
}
func main() {
// Connect to an in-memory sqlite3 instance
db, err := sql.Open("sqlite3", ":memory:")
if err != nil {
panic(err)
}
defer db.Close()
// Create the table
if _, err := db.Exec(createUsers); err != nil {
panic(err)
}
// Insert a user without a name
if _, err := db.Exec(insertUser, 1, nil); err != nil {
panic(err)
}
// Select a user
var user User
row := db.QueryRow(selectUser)
if err = row.Scan(&user.ID, &user.Name); err != nil {
panic(err)
}
log.Println(user)
}
| INSERT a NULL value and SELECT it back out | INSERT a NULL value and SELECT it back out
| Go | mit | aodin/gophersql | go | ## Code Before:
package main
import (
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
var createUsers = `
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name VARCHAR
);
`
var insertUser = `INSERT INTO users (id, name) VALUES (?, ?)`
var selectUser = `SELECT id, name FROM users`
func main() {
db, err := sql.Open("sqlite3", ":memory:")
if err != nil {
panic(err)
}
defer db.Close()
if _, err := db.Exec(createUsers); err != nil {
panic(err)
}
if _, err := db.Exec(insertUser, 23, "skidoo"); err != nil {
panic(err)
}
var id int64
var name string
row := db.QueryRow(selectUser)
if err = row.Scan(&id, &name); err != nil {
panic(err)
}
log.Println(id, name)
}
## Instruction:
INSERT a NULL value and SELECT it back out
## Code After:
package main
import (
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
var createUsers = `
CREATE TABLE users (
id INTEGER,
name VARCHAR
);
`
var insertUser = `INSERT INTO users (id, name) VALUES (?, ?)`
var selectUser = `SELECT id, name FROM users`
type User struct {
ID int64
Name sql.NullString
}
func (u User) String() string {
if u.Name.Valid {
return u.Name.String
}
return "No name"
}
func main() {
// Connect to an in-memory sqlite3 instance
db, err := sql.Open("sqlite3", ":memory:")
if err != nil {
panic(err)
}
defer db.Close()
// Create the table
if _, err := db.Exec(createUsers); err != nil {
panic(err)
}
// Insert a user without a name
if _, err := db.Exec(insertUser, 1, nil); err != nil {
panic(err)
}
// Select a user
var user User
row := db.QueryRow(selectUser)
if err = row.Scan(&user.ID, &user.Name); err != nil {
panic(err)
}
log.Println(user)
}
| package main
import (
- "database/sql"
? ^^^^
+ "database/sql"
? ^
- "log"
+ "log"
- _ "github.com/mattn/go-sqlite3"
? ^^^^
+ _ "github.com/mattn/go-sqlite3"
? ^
)
var createUsers = `
CREATE TABLE users (
- id INTEGER PRIMARY KEY,
+ id INTEGER,
name VARCHAR
);
`
var insertUser = `INSERT INTO users (id, name) VALUES (?, ?)`
var selectUser = `SELECT id, name FROM users`
+ type User struct {
+ ID int64
+ Name sql.NullString
+ }
+
+ func (u User) String() string {
+ if u.Name.Valid {
+ return u.Name.String
+ }
+ return "No name"
+ }
+
func main() {
-
+ // Connect to an in-memory sqlite3 instance
- db, err := sql.Open("sqlite3", ":memory:")
? ^^^^
+ db, err := sql.Open("sqlite3", ":memory:")
? ^
- if err != nil {
? ^^^^
+ if err != nil {
? ^
- panic(err)
- }
+ panic(err)
+ }
- defer db.Close()
? ^^^^
+ defer db.Close()
? ^
+ // Create the table
- if _, err := db.Exec(createUsers); err != nil {
? ^^^^
+ if _, err := db.Exec(createUsers); err != nil {
? ^
- panic(err)
- }
+ panic(err)
+ }
+ // Insert a user without a name
- if _, err := db.Exec(insertUser, 23, "skidoo"); err != nil {
? ^^^^ ^^ ^^^ ^^^^
+ if _, err := db.Exec(insertUser, 1, nil); err != nil {
? ^ ^ ^ ^
- panic(err)
- }
+ panic(err)
+ }
- var id int64
- var name string
+ // Select a user
+ var user User
- row := db.QueryRow(selectUser)
? ^^^^
+ row := db.QueryRow(selectUser)
? ^
-
- if err = row.Scan(&id, &name); err != nil {
? ^^^^ ^^ ^
+ if err = row.Scan(&user.ID, &user.Name); err != nil {
? ^ ^^^^^^^ ^^^^^^
+ panic(err)
+ }
+ log.Println(user)
- panic(err)
- }
-
- log.Println(id, name)
-
-
-
-
-
} | 67 | 1.313725 | 37 | 30 |
f71ce7795e9204d7b8db08f46ec50c2ec56b5c31 | loader.c | loader.c | // This will load a lorito bytecode file into a lorito codeseg
| // This will load a lorito bytecode file into a lorito codeseg
// Since this is temporary, and we'll end up throwing it away in favor of
// integrating with parrot's packfile format, this will be real simple.
//
// Integer: segment type (0 = code, 1 = data)
// Integer: Size of segement name
// String: segment name, null terminated
// Integer: Count (in 8 bytes, so a count of 1 == 8 bytes)
// Data
| Document the mini pack format. | Document the mini pack format.
Sadly, I mangled some nomenclature and called something a segment that
isn't in the parrot world. Will need to fix that sometime. Sorry.
| C | artistic-2.0 | atrodo/lorito,atrodo/lorito | c | ## Code Before:
// This will load a lorito bytecode file into a lorito codeseg
## Instruction:
Document the mini pack format.
Sadly, I mangled some nomenclature and called something a segment that
isn't in the parrot world. Will need to fix that sometime. Sorry.
## Code After:
// This will load a lorito bytecode file into a lorito codeseg
// Since this is temporary, and we'll end up throwing it away in favor of
// integrating with parrot's packfile format, this will be real simple.
//
// Integer: segment type (0 = code, 1 = data)
// Integer: Size of segement name
// String: segment name, null terminated
// Integer: Count (in 8 bytes, so a count of 1 == 8 bytes)
// Data
| // This will load a lorito bytecode file into a lorito codeseg
-
+ // Since this is temporary, and we'll end up throwing it away in favor of
+ // integrating with parrot's packfile format, this will be real simple.
+ //
+ // Integer: segment type (0 = code, 1 = data)
+ // Integer: Size of segement name
+ // String: segment name, null terminated
+ // Integer: Count (in 8 bytes, so a count of 1 == 8 bytes)
+ // Data | 9 | 3 | 8 | 1 |
72655de9283671e32f81456a49f9d5776380241f | src/main/scala/Sockets.scala | src/main/scala/Sockets.scala | package org.refptr.iscala
import org.zeromq.ZMQ
class Sockets(profile: Profile) {
val ctx = ZMQ.context(1)
val publish = ctx.socket(ZMQ.PUB)
val raw_input = ctx.socket(ZMQ.ROUTER)
val requests = ctx.socket(ZMQ.ROUTER)
val control = ctx.socket(ZMQ.ROUTER)
val heartbeat = ctx.socket(ZMQ.REP)
private def toURI(port: Int) =
s"${profile.transport}://${profile.ip}:$port"
publish.bind(toURI(profile.iopub_port))
requests.bind(toURI(profile.shell_port))
control.bind(toURI(profile.control_port))
raw_input.bind(toURI(profile.stdin_port))
heartbeat.bind(toURI(profile.hb_port))
def terminate() {
publish.close()
raw_input.close()
requests.close()
control.close()
heartbeat.close()
ctx.term()
}
}
| package org.refptr.iscala
import org.zeromq.ZMQ
class Sockets(profile: Profile) {
val ctx = ZMQ.context(1)
val publish = ctx.socket(ZMQ.PUB)
val requests = ctx.socket(ZMQ.ROUTER)
val control = ctx.socket(ZMQ.ROUTER)
val stdin = ctx.socket(ZMQ.ROUTER)
val heartbeat = ctx.socket(ZMQ.REP)
private def toURI(port: Int) =
s"${profile.transport}://${profile.ip}:$port"
publish.bind(toURI(profile.iopub_port))
requests.bind(toURI(profile.shell_port))
control.bind(toURI(profile.control_port))
stdin.bind(toURI(profile.stdin_port))
heartbeat.bind(toURI(profile.hb_port))
def terminate() {
publish.close()
requests.close()
control.close()
stdin.close()
heartbeat.close()
ctx.term()
}
}
| Rename raw_input socket to stdin | Rename raw_input socket to stdin
| Scala | mit | nkhuyu/IScala,nkhuyu/IScala,mattpap/IScala,mattpap/IScala | scala | ## Code Before:
package org.refptr.iscala
import org.zeromq.ZMQ
class Sockets(profile: Profile) {
val ctx = ZMQ.context(1)
val publish = ctx.socket(ZMQ.PUB)
val raw_input = ctx.socket(ZMQ.ROUTER)
val requests = ctx.socket(ZMQ.ROUTER)
val control = ctx.socket(ZMQ.ROUTER)
val heartbeat = ctx.socket(ZMQ.REP)
private def toURI(port: Int) =
s"${profile.transport}://${profile.ip}:$port"
publish.bind(toURI(profile.iopub_port))
requests.bind(toURI(profile.shell_port))
control.bind(toURI(profile.control_port))
raw_input.bind(toURI(profile.stdin_port))
heartbeat.bind(toURI(profile.hb_port))
def terminate() {
publish.close()
raw_input.close()
requests.close()
control.close()
heartbeat.close()
ctx.term()
}
}
## Instruction:
Rename raw_input socket to stdin
## Code After:
package org.refptr.iscala
import org.zeromq.ZMQ
class Sockets(profile: Profile) {
val ctx = ZMQ.context(1)
val publish = ctx.socket(ZMQ.PUB)
val requests = ctx.socket(ZMQ.ROUTER)
val control = ctx.socket(ZMQ.ROUTER)
val stdin = ctx.socket(ZMQ.ROUTER)
val heartbeat = ctx.socket(ZMQ.REP)
private def toURI(port: Int) =
s"${profile.transport}://${profile.ip}:$port"
publish.bind(toURI(profile.iopub_port))
requests.bind(toURI(profile.shell_port))
control.bind(toURI(profile.control_port))
stdin.bind(toURI(profile.stdin_port))
heartbeat.bind(toURI(profile.hb_port))
def terminate() {
publish.close()
requests.close()
control.close()
stdin.close()
heartbeat.close()
ctx.term()
}
}
| package org.refptr.iscala
import org.zeromq.ZMQ
class Sockets(profile: Profile) {
val ctx = ZMQ.context(1)
val publish = ctx.socket(ZMQ.PUB)
- val raw_input = ctx.socket(ZMQ.ROUTER)
val requests = ctx.socket(ZMQ.ROUTER)
val control = ctx.socket(ZMQ.ROUTER)
+ val stdin = ctx.socket(ZMQ.ROUTER)
val heartbeat = ctx.socket(ZMQ.REP)
private def toURI(port: Int) =
s"${profile.transport}://${profile.ip}:$port"
publish.bind(toURI(profile.iopub_port))
requests.bind(toURI(profile.shell_port))
control.bind(toURI(profile.control_port))
- raw_input.bind(toURI(profile.stdin_port))
? ^^^^ ---
+ stdin.bind(toURI(profile.stdin_port))
? ^^^
heartbeat.bind(toURI(profile.hb_port))
def terminate() {
publish.close()
- raw_input.close()
requests.close()
control.close()
+ stdin.close()
heartbeat.close()
ctx.term()
}
} | 6 | 0.1875 | 3 | 3 |
62c37ac94210699b3a6f77acb9aaedcf4807ce9f | src/History.js | src/History.js | import { replace } from './actions'
import { NAVIGATE } from './constants'
export default class History {
constructor (store) {
this.store = store
}
listen () {
window.addEventListener('popstate', event => {
this.onPopHref(event.state)
}, false)
}
update (action) {
const href = this.getCurrentHref()
if (action.type === NAVIGATE) {
if (href && action.href !== href) {
this.pushHref(action.href)
} else {
this.replaceHref(action.href)
}
}
}
pushHref (href) {
window.history.pushState(href, null, href)
}
replaceHref (href) {
window.history.replaceState(href, null, href)
}
onPopHref (href) {
this.store.dispatch(replace(href))
}
getCurrentHref () {
return window.history.state
}
}
| import { replace } from './actions'
import { NAVIGATE } from './constants'
export default class History {
constructor (store) {
this.store = store
}
listen () {
window.addEventListener('popstate', event => {
const { state } = event
if (typeof state === 'string') {
this.onPopHref(state)
}
}, false)
}
update (action) {
const href = this.getCurrentHref()
if (action.type === NAVIGATE) {
if (href && action.href !== href) {
this.pushHref(action.href)
} else {
this.replaceHref(action.href)
}
}
}
pushHref (href) {
window.history.pushState(href, null, href)
}
replaceHref (href) {
window.history.replaceState(href, null, href)
}
onPopHref (href) {
this.store.dispatch(replace(href))
}
getCurrentHref () {
return window.history.state
}
}
| Fix popstate issue in Safari | Fix popstate issue in Safari
| JavaScript | isc | callum/redux-routing,callum/redux-routing | javascript | ## Code Before:
import { replace } from './actions'
import { NAVIGATE } from './constants'
export default class History {
constructor (store) {
this.store = store
}
listen () {
window.addEventListener('popstate', event => {
this.onPopHref(event.state)
}, false)
}
update (action) {
const href = this.getCurrentHref()
if (action.type === NAVIGATE) {
if (href && action.href !== href) {
this.pushHref(action.href)
} else {
this.replaceHref(action.href)
}
}
}
pushHref (href) {
window.history.pushState(href, null, href)
}
replaceHref (href) {
window.history.replaceState(href, null, href)
}
onPopHref (href) {
this.store.dispatch(replace(href))
}
getCurrentHref () {
return window.history.state
}
}
## Instruction:
Fix popstate issue in Safari
## Code After:
import { replace } from './actions'
import { NAVIGATE } from './constants'
export default class History {
constructor (store) {
this.store = store
}
listen () {
window.addEventListener('popstate', event => {
const { state } = event
if (typeof state === 'string') {
this.onPopHref(state)
}
}, false)
}
update (action) {
const href = this.getCurrentHref()
if (action.type === NAVIGATE) {
if (href && action.href !== href) {
this.pushHref(action.href)
} else {
this.replaceHref(action.href)
}
}
}
pushHref (href) {
window.history.pushState(href, null, href)
}
replaceHref (href) {
window.history.replaceState(href, null, href)
}
onPopHref (href) {
this.store.dispatch(replace(href))
}
getCurrentHref () {
return window.history.state
}
}
| import { replace } from './actions'
import { NAVIGATE } from './constants'
export default class History {
constructor (store) {
this.store = store
}
listen () {
window.addEventListener('popstate', event => {
+ const { state } = event
+
+ if (typeof state === 'string') {
- this.onPopHref(event.state)
? ------
+ this.onPopHref(state)
? ++
+ }
}, false)
}
update (action) {
const href = this.getCurrentHref()
if (action.type === NAVIGATE) {
if (href && action.href !== href) {
this.pushHref(action.href)
} else {
this.replaceHref(action.href)
}
}
}
pushHref (href) {
window.history.pushState(href, null, href)
}
replaceHref (href) {
window.history.replaceState(href, null, href)
}
onPopHref (href) {
this.store.dispatch(replace(href))
}
getCurrentHref () {
return window.history.state
}
} | 6 | 0.142857 | 5 | 1 |
0a2e0798dcd257d1c0f3b9cf923af38487d3adde | setup.py | setup.py | from setuptools import setup
# To set __version__
__version__ = '0.0.2'
setup(name="socketconsole",
version=__version__,
py_modules=['socketconsole'],
description="Unix socket access to python thread dump",
zip_safe=False,
entry_points={
'console_scripts': [
'socketreader=socketreader:main',
]
}
)
| from setuptools import setup
# To set __version__
__version__ = '0.0.3'
setup(name="socketconsole",
version=__version__,
py_modules=['socketconsole', 'socketreader'],
description="Unix socket access to python thread dump",
zip_safe=False,
entry_points={
'console_scripts': [
'socketreader=socketreader:main',
]
}
)
| Make sure script is included | Make sure script is included
| Python | bsd-3-clause | robotadam/socketconsole | python | ## Code Before:
from setuptools import setup
# To set __version__
__version__ = '0.0.2'
setup(name="socketconsole",
version=__version__,
py_modules=['socketconsole'],
description="Unix socket access to python thread dump",
zip_safe=False,
entry_points={
'console_scripts': [
'socketreader=socketreader:main',
]
}
)
## Instruction:
Make sure script is included
## Code After:
from setuptools import setup
# To set __version__
__version__ = '0.0.3'
setup(name="socketconsole",
version=__version__,
py_modules=['socketconsole', 'socketreader'],
description="Unix socket access to python thread dump",
zip_safe=False,
entry_points={
'console_scripts': [
'socketreader=socketreader:main',
]
}
)
| from setuptools import setup
# To set __version__
- __version__ = '0.0.2'
? ^
+ __version__ = '0.0.3'
? ^
setup(name="socketconsole",
version=__version__,
- py_modules=['socketconsole'],
+ py_modules=['socketconsole', 'socketreader'],
? ++++++++++++++++
description="Unix socket access to python thread dump",
zip_safe=False,
entry_points={
'console_scripts': [
'socketreader=socketreader:main',
]
}
) | 4 | 0.235294 | 2 | 2 |
73d328d6c14ef9e10aa8f5309ffbabf9b6282339 | app/views/petitions/index.html.erb | app/views/petitions/index.html.erb | <details class="lists-of-petitions">
<summary><span class="summary">Other lists of petitions</span></summary>
<div>
<ul>
<% public_petition_facets_with_counts(@petitions).each do |facet, count| %>
<li>
<%= link_to petitions_url(state: facet) do %>
<%= t(facet, scope: :"petitions.lists", quantity: number_with_delimiter(count)) %>
<% end %>
</li>
<% end %>
</ul>
</div>
</details>
<h1 class="page-title"><%= t(@petitions.scope, scope: :"petitions.page_titles") %></h1>
<% if petition_list_header? %>
<p class="text-secondary"><%= petition_list_header %></p>
<% end %>
<%= form_tag petitions_path, class: 'search-inline', method: 'get', enforce_utf8: false do %>
<%= search_field_tag 'q', @petitions.query, class: 'form-control', id: 'search' %>
<%= hidden_field_tag 'state', @petitions.scope %>
<%= submit_tag 'Search', class: 'inline-submit' %>
<% end %>
<p class="filtered-petition-count"><%= filtered_petition_count(@petitions) %></p>
<%= render 'petitions/search/results' %>
<%= render 'petitions/search/filter_nav' %>
| <details class="lists-of-petitions">
<summary><span class="summary">Other lists of petitions</span></summary>
<div>
<ul>
<% public_petition_facets_with_counts(@petitions).each do |facet, count| %>
<li>
<%= link_to petitions_url(state: facet) do %>
<%= t(facet, scope: :"petitions.lists", quantity: number_with_delimiter(count)) %>
<% end %>
</li>
<% end %>
</ul>
</div>
</details>
<h1 class="page-title"><%= t(@petitions.scope, scope: :"petitions.page_titles") %></h1>
<% if petition_list_header? %>
<p class="text-secondary"><%= petition_list_header %></p>
<% end %>
<%= form_tag petitions_path, class: 'search-inline', method: 'get', enforce_utf8: false do %>
<%= search_field_tag 'q', @petitions.query, class: 'form-control', id: 'search' %>
<%= hidden_field_tag 'state', @petitions.scope %>
<%= submit_tag 'Search', name: nil, class: 'inline-submit' %>
<% end %>
<p class="filtered-petition-count"><%= filtered_petition_count(@petitions) %></p>
<%= render 'petitions/search/results' %>
<%= render 'petitions/search/filter_nav' %>
| Remove name from the search form submit button | Remove name from the search form submit button
We don't need the value for the submit button in the form params so
by removing the name we will force the browser not to send it and
reduce visual noise in the search urls.
| HTML+ERB | mit | oskarpearson/e-petitions,StatesOfJersey/e-petitions,alphagov/e-petitions,alphagov/e-petitions,joelanman/e-petitions,StatesOfJersey/e-petitions,StatesOfJersey/e-petitions,unboxed/e-petitions,StatesOfJersey/e-petitions,unboxed/e-petitions,unboxed/e-petitions,oskarpearson/e-petitions,joelanman/e-petitions,oskarpearson/e-petitions,joelanman/e-petitions,alphagov/e-petitions,alphagov/e-petitions,unboxed/e-petitions | html+erb | ## Code Before:
<details class="lists-of-petitions">
<summary><span class="summary">Other lists of petitions</span></summary>
<div>
<ul>
<% public_petition_facets_with_counts(@petitions).each do |facet, count| %>
<li>
<%= link_to petitions_url(state: facet) do %>
<%= t(facet, scope: :"petitions.lists", quantity: number_with_delimiter(count)) %>
<% end %>
</li>
<% end %>
</ul>
</div>
</details>
<h1 class="page-title"><%= t(@petitions.scope, scope: :"petitions.page_titles") %></h1>
<% if petition_list_header? %>
<p class="text-secondary"><%= petition_list_header %></p>
<% end %>
<%= form_tag petitions_path, class: 'search-inline', method: 'get', enforce_utf8: false do %>
<%= search_field_tag 'q', @petitions.query, class: 'form-control', id: 'search' %>
<%= hidden_field_tag 'state', @petitions.scope %>
<%= submit_tag 'Search', class: 'inline-submit' %>
<% end %>
<p class="filtered-petition-count"><%= filtered_petition_count(@petitions) %></p>
<%= render 'petitions/search/results' %>
<%= render 'petitions/search/filter_nav' %>
## Instruction:
Remove name from the search form submit button
We don't need the value for the submit button in the form params so
by removing the name we will force the browser not to send it and
reduce visual noise in the search urls.
## Code After:
<details class="lists-of-petitions">
<summary><span class="summary">Other lists of petitions</span></summary>
<div>
<ul>
<% public_petition_facets_with_counts(@petitions).each do |facet, count| %>
<li>
<%= link_to petitions_url(state: facet) do %>
<%= t(facet, scope: :"petitions.lists", quantity: number_with_delimiter(count)) %>
<% end %>
</li>
<% end %>
</ul>
</div>
</details>
<h1 class="page-title"><%= t(@petitions.scope, scope: :"petitions.page_titles") %></h1>
<% if petition_list_header? %>
<p class="text-secondary"><%= petition_list_header %></p>
<% end %>
<%= form_tag petitions_path, class: 'search-inline', method: 'get', enforce_utf8: false do %>
<%= search_field_tag 'q', @petitions.query, class: 'form-control', id: 'search' %>
<%= hidden_field_tag 'state', @petitions.scope %>
<%= submit_tag 'Search', name: nil, class: 'inline-submit' %>
<% end %>
<p class="filtered-petition-count"><%= filtered_petition_count(@petitions) %></p>
<%= render 'petitions/search/results' %>
<%= render 'petitions/search/filter_nav' %>
| <details class="lists-of-petitions">
<summary><span class="summary">Other lists of petitions</span></summary>
<div>
<ul>
<% public_petition_facets_with_counts(@petitions).each do |facet, count| %>
<li>
<%= link_to petitions_url(state: facet) do %>
<%= t(facet, scope: :"petitions.lists", quantity: number_with_delimiter(count)) %>
<% end %>
</li>
<% end %>
</ul>
</div>
</details>
<h1 class="page-title"><%= t(@petitions.scope, scope: :"petitions.page_titles") %></h1>
<% if petition_list_header? %>
<p class="text-secondary"><%= petition_list_header %></p>
<% end %>
<%= form_tag petitions_path, class: 'search-inline', method: 'get', enforce_utf8: false do %>
<%= search_field_tag 'q', @petitions.query, class: 'form-control', id: 'search' %>
<%= hidden_field_tag 'state', @petitions.scope %>
- <%= submit_tag 'Search', class: 'inline-submit' %>
+ <%= submit_tag 'Search', name: nil, class: 'inline-submit' %>
? +++++++++++
<% end %>
<p class="filtered-petition-count"><%= filtered_petition_count(@petitions) %></p>
<%= render 'petitions/search/results' %>
<%= render 'petitions/search/filter_nav' %> | 2 | 0.064516 | 1 | 1 |
d13f6a27a5f05ed61031658df9c32f1257bd11b6 | docs/moment/04-displaying/12-as-iso-string.md | docs/moment/04-displaying/12-as-iso-string.md | ---
title: As ISO 8601 String
version: 2.1.0
signature: |
moment().toISOString();
---
Formats a string to the ISO8601 standard.
```javascript
moment().toISOString() // 2013-02-04T22:44:30.652Z
```
| ---
title: As ISO 8601 String
version: 2.1.0
signature: |
moment().toISOString();
---
Formats a string to the ISO8601 standard.
```javascript
moment().toISOString() // 2013-02-04T22:44:30.652Z
```
From version **2.8.4** the native `Date.prototype.toISOString` is used if
available, for performance reasons.
| Add info about toISOString using native impl | Add info about toISOString using native impl
| Markdown | mit | A----/momentjs.com,hulbert/momentjs.com,bbodenmiller/momentjs.com,peterbecker/momentjs.com,moment/momentjs.com,A----/momentjs.com,moment/momentjs.com,peterbecker/momentjs.com,mibcadet/momentjs.com,maximveksler/momentjs.com,jeyraof/momentjs.com,interactivellama/momentjs.com | markdown | ## Code Before:
---
title: As ISO 8601 String
version: 2.1.0
signature: |
moment().toISOString();
---
Formats a string to the ISO8601 standard.
```javascript
moment().toISOString() // 2013-02-04T22:44:30.652Z
```
## Instruction:
Add info about toISOString using native impl
## Code After:
---
title: As ISO 8601 String
version: 2.1.0
signature: |
moment().toISOString();
---
Formats a string to the ISO8601 standard.
```javascript
moment().toISOString() // 2013-02-04T22:44:30.652Z
```
From version **2.8.4** the native `Date.prototype.toISOString` is used if
available, for performance reasons.
| ---
title: As ISO 8601 String
version: 2.1.0
signature: |
moment().toISOString();
---
-
Formats a string to the ISO8601 standard.
```javascript
moment().toISOString() // 2013-02-04T22:44:30.652Z
```
+
+ From version **2.8.4** the native `Date.prototype.toISOString` is used if
+ available, for performance reasons. | 4 | 0.307692 | 3 | 1 |
bd1432aa6951b1610a816cc02d48d8926491ba04 | lib/pronto/formatter/github_formatter.rb | lib/pronto/formatter/github_formatter.rb | require 'octokit'
module Pronto
module Formatter
class GithubFormatter
attr_writer :client
def format(messages)
messages.each do |message|
@client.create_commit_comment(github_slug(message),
sha(message),
message.msg,
message.path,
message.line.new_lineno)
end
"#{messages.count} pronto messages posted to GitHub"
end
private
def github_slug(message)
message.repo.remotes.map(&:github_slug).compact.first
end
def sha(message)
blamelines = blame(message).lines
lineno = message.line.new_lineno
blameline = blamelines.detect { |line| line.lineno == lineno }
blameline.commit.id if blameline
end
def blame(message)
@blames ||= {}
@blames[message.path] ||= message.repo.blame(message.path)
@blames[message.path]
end
end
end
end
| require 'octokit'
module Pronto
module Formatter
class GithubFormatter
attr_writer :client
def format(messages)
messages.each do |message|
@client.create_commit_comment(github_slug(message),
sha(message),
message.msg,
message.path,
message.line.new_lineno)
end
end
private
def github_slug(message)
message.repo.remotes.map(&:github_slug).compact.first
end
def sha(message)
blamelines = blame(message).lines
lineno = message.line.new_lineno
blameline = blamelines.detect { |line| line.lineno == lineno }
blameline.commit.id if blameline
end
def blame(message)
@blames ||= {}
@blames[message.path] ||= message.repo.blame(message.path)
@blames[message.path]
end
end
end
end
| Remove output message in GitHub formatter | Remove output message in GitHub formatter
| Ruby | mit | HaiTo/pronto,jhass/pronto,mmozuras/pronto,mvz/pronto,prontolabs/pronto,treble37/pronto,aergonaut/pronto,gussan/pronto,Zauberstuhl/pronto | ruby | ## Code Before:
require 'octokit'
module Pronto
module Formatter
class GithubFormatter
attr_writer :client
def format(messages)
messages.each do |message|
@client.create_commit_comment(github_slug(message),
sha(message),
message.msg,
message.path,
message.line.new_lineno)
end
"#{messages.count} pronto messages posted to GitHub"
end
private
def github_slug(message)
message.repo.remotes.map(&:github_slug).compact.first
end
def sha(message)
blamelines = blame(message).lines
lineno = message.line.new_lineno
blameline = blamelines.detect { |line| line.lineno == lineno }
blameline.commit.id if blameline
end
def blame(message)
@blames ||= {}
@blames[message.path] ||= message.repo.blame(message.path)
@blames[message.path]
end
end
end
end
## Instruction:
Remove output message in GitHub formatter
## Code After:
require 'octokit'
module Pronto
module Formatter
class GithubFormatter
attr_writer :client
def format(messages)
messages.each do |message|
@client.create_commit_comment(github_slug(message),
sha(message),
message.msg,
message.path,
message.line.new_lineno)
end
end
private
def github_slug(message)
message.repo.remotes.map(&:github_slug).compact.first
end
def sha(message)
blamelines = blame(message).lines
lineno = message.line.new_lineno
blameline = blamelines.detect { |line| line.lineno == lineno }
blameline.commit.id if blameline
end
def blame(message)
@blames ||= {}
@blames[message.path] ||= message.repo.blame(message.path)
@blames[message.path]
end
end
end
end
| require 'octokit'
module Pronto
module Formatter
class GithubFormatter
attr_writer :client
def format(messages)
messages.each do |message|
@client.create_commit_comment(github_slug(message),
sha(message),
message.msg,
message.path,
message.line.new_lineno)
end
-
- "#{messages.count} pronto messages posted to GitHub"
end
private
def github_slug(message)
message.repo.remotes.map(&:github_slug).compact.first
end
def sha(message)
blamelines = blame(message).lines
lineno = message.line.new_lineno
blameline = blamelines.detect { |line| line.lineno == lineno }
blameline.commit.id if blameline
end
def blame(message)
@blames ||= {}
@blames[message.path] ||= message.repo.blame(message.path)
@blames[message.path]
end
end
end
end | 2 | 0.047619 | 0 | 2 |
df0859429f61b6e051c01a4b500c86104c3c6b32 | homebrew/install.sh | homebrew/install.sh |
set -e
# Set up taps before installing
TAPS=(
"homebrew/completions"
"homebrew/dupes"
"homebrew/php"
"homebrew/versions"
)
# Packages to install
PACKAGES=(
"archey"
"bash-completion"
"coreutils"
"editorconfig"
"gem-completion"
"git"
"grc"
"htop-osx"
"mysql"
"nginx"
"node"
"php54"
"python"
"ruby-completion"
"tidy-html5"
"tmux"
"tree"
"unrar"
"wget"
"youtube-dl"
)
# Check for Homebrew
if test ! $(which brew) && uname === "Darwin" ; then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Tap the taps (unless we already have them tapped)
echo "Checking for any taps to tap..."
for TAP in ${TAPS[@]} ; do
if ! brew tap | grep -q "^${TAPS}\$" ; then
brew tap $TAP
fi
done
# Install if packages are not already installed
echo "Checking for packages to install..."
for PACKAGE in ${PACKAGES[@]} ; do
if ! brew list -1 | grep -q "^${PACKAGE}\$" ; then
brew install $PACKAGE
fi
done
exit 0
|
set -e
# Set up taps before installing
TAPS=(
"homebrew/completions"
"homebrew/dupes"
"homebrew/php"
"homebrew/versions"
)
# Packages to install
PACKAGES=(
"archey"
"bash-completion"
"coreutils"
"editorconfig"
"gem-completion"
"git"
"grc"
"htop-osx"
"mysql"
"nginx"
"node"
"php54"
"python"
"ruby-completion"
"tidy-html5"
"tmux"
"tree"
"unrar"
"wget"
"youtube-dl"
)
# Check for Homebrew
if uname | grep -q "Darwin" ; then
if test ! $(which brew) ; then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
fi
# Tap the taps (unless we already have them tapped)
echo "Checking for any taps to tap..."
for TAP in ${TAPS[@]} ; do
if ! brew tap | grep -q "^${TAPS}\$" ; then
brew tap $TAP
fi
done
# Install if packages are not already installed
echo "Checking for packages to install..."
for PACKAGE in ${PACKAGES[@]} ; do
if ! brew list -1 | grep -q "^${PACKAGE}\$" ; then
brew install $PACKAGE
fi
done
exit 0
| Check if we're on Darwin before checking for Homebrew | Check if we're on Darwin before checking for Homebrew
| Shell | isc | frippz/dotfiles,frippz/dotfiles,frippz/dotfiles,katarinahallberg/dotfiles | shell | ## Code Before:
set -e
# Set up taps before installing
TAPS=(
"homebrew/completions"
"homebrew/dupes"
"homebrew/php"
"homebrew/versions"
)
# Packages to install
PACKAGES=(
"archey"
"bash-completion"
"coreutils"
"editorconfig"
"gem-completion"
"git"
"grc"
"htop-osx"
"mysql"
"nginx"
"node"
"php54"
"python"
"ruby-completion"
"tidy-html5"
"tmux"
"tree"
"unrar"
"wget"
"youtube-dl"
)
# Check for Homebrew
if test ! $(which brew) && uname === "Darwin" ; then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Tap the taps (unless we already have them tapped)
echo "Checking for any taps to tap..."
for TAP in ${TAPS[@]} ; do
if ! brew tap | grep -q "^${TAPS}\$" ; then
brew tap $TAP
fi
done
# Install if packages are not already installed
echo "Checking for packages to install..."
for PACKAGE in ${PACKAGES[@]} ; do
if ! brew list -1 | grep -q "^${PACKAGE}\$" ; then
brew install $PACKAGE
fi
done
exit 0
## Instruction:
Check if we're on Darwin before checking for Homebrew
## Code After:
set -e
# Set up taps before installing
TAPS=(
"homebrew/completions"
"homebrew/dupes"
"homebrew/php"
"homebrew/versions"
)
# Packages to install
PACKAGES=(
"archey"
"bash-completion"
"coreutils"
"editorconfig"
"gem-completion"
"git"
"grc"
"htop-osx"
"mysql"
"nginx"
"node"
"php54"
"python"
"ruby-completion"
"tidy-html5"
"tmux"
"tree"
"unrar"
"wget"
"youtube-dl"
)
# Check for Homebrew
if uname | grep -q "Darwin" ; then
if test ! $(which brew) ; then
echo " Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
fi
# Tap the taps (unless we already have them tapped)
echo "Checking for any taps to tap..."
for TAP in ${TAPS[@]} ; do
if ! brew tap | grep -q "^${TAPS}\$" ; then
brew tap $TAP
fi
done
# Install if packages are not already installed
echo "Checking for packages to install..."
for PACKAGE in ${PACKAGES[@]} ; do
if ! brew list -1 | grep -q "^${PACKAGE}\$" ; then
brew install $PACKAGE
fi
done
exit 0
|
set -e
# Set up taps before installing
TAPS=(
"homebrew/completions"
"homebrew/dupes"
"homebrew/php"
"homebrew/versions"
)
# Packages to install
PACKAGES=(
"archey"
"bash-completion"
"coreutils"
"editorconfig"
"gem-completion"
"git"
"grc"
"htop-osx"
"mysql"
"nginx"
"node"
"php54"
"python"
"ruby-completion"
"tidy-html5"
"tmux"
"tree"
"unrar"
"wget"
"youtube-dl"
)
# Check for Homebrew
- if test ! $(which brew) && uname === "Darwin" ; then
+ if uname | grep -q "Darwin" ; then
+ if test ! $(which brew) ; then
- echo " Installing Homebrew for you."
+ echo " Installing Homebrew for you."
? ++
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
? ++
+ fi
fi
# Tap the taps (unless we already have them tapped)
echo "Checking for any taps to tap..."
for TAP in ${TAPS[@]} ; do
if ! brew tap | grep -q "^${TAPS}\$" ; then
brew tap $TAP
fi
done
# Install if packages are not already installed
echo "Checking for packages to install..."
for PACKAGE in ${PACKAGES[@]} ; do
if ! brew list -1 | grep -q "^${PACKAGE}\$" ; then
brew install $PACKAGE
fi
done
exit 0 | 8 | 0.137931 | 5 | 3 |
68f4d883eb9dd59b3a4560f53657d80cf572104e | pfasst/__init__.py | pfasst/__init__.py |
from pfasst import PFASST
__all__ = []
|
try:
from pfasst import PFASST
except:
print 'WARNING: Unable to import PFASST.'
__all__ = []
| Add warning when unable to import PFASST. | PFASST: Add warning when unable to import PFASST.
| Python | bsd-2-clause | memmett/PyPFASST,memmett/PyPFASST | python | ## Code Before:
from pfasst import PFASST
__all__ = []
## Instruction:
PFASST: Add warning when unable to import PFASST.
## Code After:
try:
from pfasst import PFASST
except:
print 'WARNING: Unable to import PFASST.'
__all__ = []
|
+ try:
- from pfasst import PFASST
+ from pfasst import PFASST
? ++++
+ except:
+ print 'WARNING: Unable to import PFASST.'
__all__ = []
| 5 | 0.833333 | 4 | 1 |
7d8d46f95fcdc7455043a16d10de96a043f8b88b | examples/helloworld/docker-compose.yml | examples/helloworld/docker-compose.yml | sample:
image: amazon/amazon-ecs-sample
ports:
- 80:80
mem_limit: 100 | version: '2'
services:
sample:
image: amazon/amazon-ecs-sample
ports:
- 80:80
mem_limit: 100 | Convert helloworld to format v2 | Convert helloworld to format v2
| YAML | mit | lox/ecsy,lox/ecsy | yaml | ## Code Before:
sample:
image: amazon/amazon-ecs-sample
ports:
- 80:80
mem_limit: 100
## Instruction:
Convert helloworld to format v2
## Code After:
version: '2'
services:
sample:
image: amazon/amazon-ecs-sample
ports:
- 80:80
mem_limit: 100 | + version: '2'
+
+ services:
- sample:
+ sample:
? ++
- image: amazon/amazon-ecs-sample
+ image: amazon/amazon-ecs-sample
? ++
- ports:
+ ports:
? ++
- - 80:80
+ - 80:80
? ++
- mem_limit: 100
+ mem_limit: 100
? ++
| 13 | 2.6 | 8 | 5 |
1c1f65f198b67dbf3475924c7ebcf6b42aeeb240 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
- "pypy"
# Someday...
#- "3.4"
install: pip install -e .
before_script: pokedex setup -v
script: py.test
| language: python
python:
- "2.7"
- "pypy"
# Someday...
#- "3.4"
install: pip install -e .
before_script: pokedex setup -v
script: py.test
sudo: false
| Declare that we don't use sudo | Travis: Declare that we don't use sudo
This will apparently allow us to build on Travis's new container-based build
system, which is supposed to lead to faster builds. The catch is that we
don't get root access, but we don't need it anyway.
http://docs.travis-ci.com/user/migrating-from-legacy/
| YAML | mit | veekun/pokedex,mschex1/pokedex,veekun/pokedex,DaMouse404/pokedex,RK905/pokedex-1,xfix/pokedex | yaml | ## Code Before:
language: python
python:
- "2.7"
- "pypy"
# Someday...
#- "3.4"
install: pip install -e .
before_script: pokedex setup -v
script: py.test
## Instruction:
Travis: Declare that we don't use sudo
This will apparently allow us to build on Travis's new container-based build
system, which is supposed to lead to faster builds. The catch is that we
don't get root access, but we don't need it anyway.
http://docs.travis-ci.com/user/migrating-from-legacy/
## Code After:
language: python
python:
- "2.7"
- "pypy"
# Someday...
#- "3.4"
install: pip install -e .
before_script: pokedex setup -v
script: py.test
sudo: false
| language: python
python:
- "2.7"
- "pypy"
# Someday...
#- "3.4"
install: pip install -e .
before_script: pokedex setup -v
script: py.test
+ sudo: false | 1 | 0.090909 | 1 | 0 |
ea9dafe8e8ebd427c61edc53f4ff6b48249dee25 | test/store/localStorage-test.js | test/store/localStorage-test.js | var assert = require('chai').assert;
var sinon = require('sinon');
var localStorage = require('../../store/localStorage');
describe("storage/localStorage()", function() {
var mockLocalStorageData = null, mockLocalStorage = {
setItem: function (data) { mockLocalStorageData = data },
getItem: function () { return mockLocalStorageData; },
removeItem: function () { mockLocalStorageData = null }
}, mock;
beforeEach(function() {
mock = sinon.mock(mockLocalStorage)
});
it("is enabled", function() {
var storage = localStorage(null, mockLocalStorage);
assert(storage.enabled());
});
it("saves data", function() {
mock.expects('setItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.save(['Item']);
mock.verify();
});
it("loads data", function() {
mock.expects('getItem').once().returns('[]');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads invalid data", function() {
mock.expects('getItem').once().returns('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads when storage throws", function() {
mock.expects('getItem').once().throws('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("clears store", function() {
mock.expects('removeItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.clear();
mock.verify();
});
});
| var assert = require('chai').assert;
var sinon = require('sinon');
var localStorage = require('../../store/localStorage');
describe("storage/localStorage()", function() {
var mockLocalStorageData = null, mockLocalStorage = {
setItem: function (data) { mockLocalStorageData = data },
getItem: function () { return mockLocalStorageData; },
removeItem: function () { mockLocalStorageData = null }
}, mock;
beforeEach(function() {
mock = sinon.mock(mockLocalStorage)
});
it("is enabled", function() {
var storage = localStorage(null, mockLocalStorage);
assert(storage.enabled());
});
it("is not enabled", function() {
var storage = localStorage();
assert.isFalse(storage.enabled());
});
it("saves data", function() {
mock.expects('setItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.save(['Item']);
mock.verify();
});
it("loads data", function() {
mock.expects('getItem').once().returns('[]');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads invalid data", function() {
mock.expects('getItem').once().returns('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads when storage throws", function() {
mock.expects('getItem').once().throws('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("clears store", function() {
mock.expects('removeItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.clear();
mock.verify();
});
});
| Add test for disabled localstorage | Add test for disabled localstorage
| JavaScript | mit | jsor/carty,jsor/carty | javascript | ## Code Before:
var assert = require('chai').assert;
var sinon = require('sinon');
var localStorage = require('../../store/localStorage');
describe("storage/localStorage()", function() {
var mockLocalStorageData = null, mockLocalStorage = {
setItem: function (data) { mockLocalStorageData = data },
getItem: function () { return mockLocalStorageData; },
removeItem: function () { mockLocalStorageData = null }
}, mock;
beforeEach(function() {
mock = sinon.mock(mockLocalStorage)
});
it("is enabled", function() {
var storage = localStorage(null, mockLocalStorage);
assert(storage.enabled());
});
it("saves data", function() {
mock.expects('setItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.save(['Item']);
mock.verify();
});
it("loads data", function() {
mock.expects('getItem').once().returns('[]');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads invalid data", function() {
mock.expects('getItem').once().returns('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads when storage throws", function() {
mock.expects('getItem').once().throws('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("clears store", function() {
mock.expects('removeItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.clear();
mock.verify();
});
});
## Instruction:
Add test for disabled localstorage
## Code After:
var assert = require('chai').assert;
var sinon = require('sinon');
var localStorage = require('../../store/localStorage');
describe("storage/localStorage()", function() {
var mockLocalStorageData = null, mockLocalStorage = {
setItem: function (data) { mockLocalStorageData = data },
getItem: function () { return mockLocalStorageData; },
removeItem: function () { mockLocalStorageData = null }
}, mock;
beforeEach(function() {
mock = sinon.mock(mockLocalStorage)
});
it("is enabled", function() {
var storage = localStorage(null, mockLocalStorage);
assert(storage.enabled());
});
it("is not enabled", function() {
var storage = localStorage();
assert.isFalse(storage.enabled());
});
it("saves data", function() {
mock.expects('setItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.save(['Item']);
mock.verify();
});
it("loads data", function() {
mock.expects('getItem').once().returns('[]');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads invalid data", function() {
mock.expects('getItem').once().returns('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads when storage throws", function() {
mock.expects('getItem').once().throws('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("clears store", function() {
mock.expects('removeItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.clear();
mock.verify();
});
});
| var assert = require('chai').assert;
var sinon = require('sinon');
var localStorage = require('../../store/localStorage');
describe("storage/localStorage()", function() {
var mockLocalStorageData = null, mockLocalStorage = {
setItem: function (data) { mockLocalStorageData = data },
getItem: function () { return mockLocalStorageData; },
removeItem: function () { mockLocalStorageData = null }
}, mock;
beforeEach(function() {
mock = sinon.mock(mockLocalStorage)
});
it("is enabled", function() {
var storage = localStorage(null, mockLocalStorage);
assert(storage.enabled());
+ });
+
+ it("is not enabled", function() {
+ var storage = localStorage();
+
+ assert.isFalse(storage.enabled());
});
it("saves data", function() {
mock.expects('setItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.save(['Item']);
mock.verify();
});
it("loads data", function() {
mock.expects('getItem').once().returns('[]');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads invalid data", function() {
mock.expects('getItem').once().returns('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("loads when storage throws", function() {
mock.expects('getItem').once().throws('foo');
var storage = localStorage(null, mockLocalStorage);
storage.load();
mock.verify();
});
it("clears store", function() {
mock.expects('removeItem').once();
var storage = localStorage(null, mockLocalStorage);
storage.clear();
mock.verify();
});
}); | 6 | 0.084507 | 6 | 0 |
10b13b65173207d274ffa9570ec77a1aed6bc7e8 | src/pygame_sdl2/error.pyx | src/pygame_sdl2/error.pyx |
from sdl2 cimport *
class error(RuntimeError):
def __init__(self, message=None):
if message is None:
message = str(SDL_GetError())
RuntimeError.__init__(self, message)
def get_error():
cdef const char *message = SDL_GetError()
if message:
return str(message)
else:
return ''
def set_error(message):
message = bytes(message)
SDL_SetError(message)
|
from sdl2 cimport *
class error(RuntimeError):
def __init__(self, message=None):
if message is None:
message = str(SDL_GetError())
RuntimeError.__init__(self, message)
def get_error():
cdef const char *message = SDL_GetError()
if message:
return str(message)
else:
return ''
def set_error(message):
message = bytes(message)
SDL_SetError("%s", <char *> message)
| Use format string with SDL_SetError. | Use format string with SDL_SetError.
Fixes #26, although the fix wasn't tested.
| Cython | lgpl-2.1 | renpy/pygame_sdl2,renpy/pygame_sdl2,renpy/pygame_sdl2,renpy/pygame_sdl2 | cython | ## Code Before:
from sdl2 cimport *
class error(RuntimeError):
def __init__(self, message=None):
if message is None:
message = str(SDL_GetError())
RuntimeError.__init__(self, message)
def get_error():
cdef const char *message = SDL_GetError()
if message:
return str(message)
else:
return ''
def set_error(message):
message = bytes(message)
SDL_SetError(message)
## Instruction:
Use format string with SDL_SetError.
Fixes #26, although the fix wasn't tested.
## Code After:
from sdl2 cimport *
class error(RuntimeError):
def __init__(self, message=None):
if message is None:
message = str(SDL_GetError())
RuntimeError.__init__(self, message)
def get_error():
cdef const char *message = SDL_GetError()
if message:
return str(message)
else:
return ''
def set_error(message):
message = bytes(message)
SDL_SetError("%s", <char *> message)
|
from sdl2 cimport *
class error(RuntimeError):
def __init__(self, message=None):
if message is None:
message = str(SDL_GetError())
RuntimeError.__init__(self, message)
def get_error():
cdef const char *message = SDL_GetError()
if message:
return str(message)
else:
return ''
def set_error(message):
message = bytes(message)
- SDL_SetError(message)
+ SDL_SetError("%s", <char *> message)
? +++++++++++++++
| 2 | 0.090909 | 1 | 1 |
e9d2da3b2b424c5352c4361309eac2ed4974c34b | .travis.yml | .travis.yml | language: java
jdk:
- oraclejdk8
- oraclejdk9
after_success:
- mvn clean test jacoco:report coveralls:report
| language: java
jdk:
- oraclejdk8
- oraclejdk9
- oraclejdk10
after_success:
- mvn clean test jacoco:report coveralls:report
| Add JDK10 to continuous integration | Add JDK10 to continuous integration | YAML | apache-2.0 | michelole/abbres | yaml | ## Code Before:
language: java
jdk:
- oraclejdk8
- oraclejdk9
after_success:
- mvn clean test jacoco:report coveralls:report
## Instruction:
Add JDK10 to continuous integration
## Code After:
language: java
jdk:
- oraclejdk8
- oraclejdk9
- oraclejdk10
after_success:
- mvn clean test jacoco:report coveralls:report
| language: java
jdk:
- oraclejdk8
- oraclejdk9
+ - oraclejdk10
after_success:
- mvn clean test jacoco:report coveralls:report | 1 | 0.166667 | 1 | 0 |
016c7c59b8aa69094fa03a3b786a17f9af73bdff | .travis.yml | .travis.yml | sudo: required
dist: trusty
language: node_js
services:
- docker
node_js:
- '8.2.1'
cache:
directories:
- node_modules
- server/node_modules
env:
- NODE_ENV=production
install:
- npm install --dev
script:
- npm test
- npm run build
after_success:
- export REPO=martijnhols/wowanalyzer
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi else echo pr-$TRAVIS_PULL_REQUEST_BRANCH; fi | sed -r 's/\//-/g')
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -f .dockerfile -t $REPO:$BRANCH .
- docker push $REPO:$BRANCH
| sudo: required
dist: trusty
language: node_js
services:
- docker
node_js:
- '8.2.1'
cache:
directories:
- node_modules
- server/node_modules
env:
- NODE_ENV=production
install:
- npm install --dev
script:
- npm test
- npm run build
after_success:
- export REPO=martijnhols/wowanalyzer
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi else echo pr-$TRAVIS_PULL_REQUEST-$TRAVIS_PULL_REQUEST_BRANCH; fi | sed -r 's/\//-/g')
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -f .dockerfile -t $REPO:$BRANCH .
- docker push $REPO:$BRANCH
| Include PR number in docker tag | Include PR number in docker tag
| YAML | agpl-3.0 | enragednuke/WoWAnalyzer,Juko8/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,yajinni/WoWAnalyzer,enragednuke/WoWAnalyzer,mwwscott0/WoWAnalyzer,Juko8/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,ronaldpereira/WoWAnalyzer,ronaldpereira/WoWAnalyzer,sMteX/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,ronaldpereira/WoWAnalyzer,Yuyz0112/WoWAnalyzer,hasseboulen/WoWAnalyzer,yajinni/WoWAnalyzer,anom0ly/WoWAnalyzer,sMteX/WoWAnalyzer,enragednuke/WoWAnalyzer,Yuyz0112/WoWAnalyzer,sMteX/WoWAnalyzer,anom0ly/WoWAnalyzer,Juko8/WoWAnalyzer,hasseboulen/WoWAnalyzer,FaideWW/WoWAnalyzer,fyruna/WoWAnalyzer,FaideWW/WoWAnalyzer,yajinni/WoWAnalyzer,anom0ly/WoWAnalyzer,anom0ly/WoWAnalyzer,FaideWW/WoWAnalyzer,hasseboulen/WoWAnalyzer,yajinni/WoWAnalyzer,mwwscott0/WoWAnalyzer,fyruna/WoWAnalyzer,fyruna/WoWAnalyzer | yaml | ## Code Before:
sudo: required
dist: trusty
language: node_js
services:
- docker
node_js:
- '8.2.1'
cache:
directories:
- node_modules
- server/node_modules
env:
- NODE_ENV=production
install:
- npm install --dev
script:
- npm test
- npm run build
after_success:
- export REPO=martijnhols/wowanalyzer
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi else echo pr-$TRAVIS_PULL_REQUEST_BRANCH; fi | sed -r 's/\//-/g')
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -f .dockerfile -t $REPO:$BRANCH .
- docker push $REPO:$BRANCH
## Instruction:
Include PR number in docker tag
## Code After:
sudo: required
dist: trusty
language: node_js
services:
- docker
node_js:
- '8.2.1'
cache:
directories:
- node_modules
- server/node_modules
env:
- NODE_ENV=production
install:
- npm install --dev
script:
- npm test
- npm run build
after_success:
- export REPO=martijnhols/wowanalyzer
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi else echo pr-$TRAVIS_PULL_REQUEST-$TRAVIS_PULL_REQUEST_BRANCH; fi | sed -r 's/\//-/g')
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -f .dockerfile -t $REPO:$BRANCH .
- docker push $REPO:$BRANCH
| sudo: required
dist: trusty
language: node_js
services:
- docker
node_js:
- '8.2.1'
cache:
directories:
- node_modules
- server/node_modules
env:
- NODE_ENV=production
install:
- npm install --dev
script:
- npm test
- npm run build
after_success:
- export REPO=martijnhols/wowanalyzer
- - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi else echo pr-$TRAVIS_PULL_REQUEST_BRANCH; fi | sed -r 's/\//-/g')
+ - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH; fi else echo pr-$TRAVIS_PULL_REQUEST-$TRAVIS_PULL_REQUEST_BRANCH; fi | sed -r 's/\//-/g')
? +++++++++++++++++++++
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -f .dockerfile -t $REPO:$BRANCH .
- docker push $REPO:$BRANCH | 2 | 0.083333 | 1 | 1 |
5dc25e4110f066604bd518616ba23202e6d11cef | Tests/ZapicTests.swift | Tests/ZapicTests.swift | //
// ZapicTests.swift
// ZapicTests
//
// Created by Daniel Sarfati on 6/30/17.
// Copyright © 2017 Zapic. All rights reserved.
//
import XCTest
@testable import Zapic
class ZapicTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssert(1 == 2)
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
| //
// ZapicTests.swift
// ZapicTests
//
// Created by Daniel Sarfati on 6/30/17.
// Copyright © 2017 Zapic. All rights reserved.
//
import XCTest
@testable import Zapic
class ZapicTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
| Test cases should pass now | Test cases should pass now
| Swift | mit | ZapicInc/Zapic-SDK-iOS,ZapicInc/Zapic-SDK-iOS,ZapicInc/Zapic-SDK-iOS | swift | ## Code Before:
//
// ZapicTests.swift
// ZapicTests
//
// Created by Daniel Sarfati on 6/30/17.
// Copyright © 2017 Zapic. All rights reserved.
//
import XCTest
@testable import Zapic
class ZapicTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssert(1 == 2)
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
## Instruction:
Test cases should pass now
## Code After:
//
// ZapicTests.swift
// ZapicTests
//
// Created by Daniel Sarfati on 6/30/17.
// Copyright © 2017 Zapic. All rights reserved.
//
import XCTest
@testable import Zapic
class ZapicTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
| //
// ZapicTests.swift
// ZapicTests
//
// Created by Daniel Sarfati on 6/30/17.
// Copyright © 2017 Zapic. All rights reserved.
//
import XCTest
@testable import Zapic
class ZapicTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
- XCTAssert(1 == 2)
+
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
} | 2 | 0.054054 | 1 | 1 |
933e7b61f5d7c73924ea89a6ce17acf39e4f9c8d | packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py | packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py | import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.decorators import *
class TestUnicodeSymbols(TestBase):
mydir = TestBase.compute_mydir(__file__)
@expectedFailureAll(compiler="clang", compiler_version=['<', '7.0'])
def test_union_members(self):
self.build()
spec = lldb.SBModuleSpec()
spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out")))
module = lldb.SBModule(spec)
self.assertTrue(module.IsValid())
mytype = module.FindFirstType("foobár")
self.assertTrue(mytype.IsValid())
self.assertTrue(mytype.IsPointerType())
| import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.decorators import *
class TestUnicodeSymbols(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test_union_members(self):
self.build()
spec = lldb.SBModuleSpec()
spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out")))
module = lldb.SBModule(spec)
self.assertTrue(module.IsValid())
mytype = module.FindFirstType("foobár")
self.assertTrue(mytype.IsValid())
self.assertTrue(mytype.IsPointerType())
| Change xfail to skipIf. The exact condition is really difficult to get right and doesn't add much signal. | Change xfail to skipIf. The exact condition is really difficult to get
right and doesn't add much signal.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@340574 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb | python | ## Code Before:
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.decorators import *
class TestUnicodeSymbols(TestBase):
mydir = TestBase.compute_mydir(__file__)
@expectedFailureAll(compiler="clang", compiler_version=['<', '7.0'])
def test_union_members(self):
self.build()
spec = lldb.SBModuleSpec()
spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out")))
module = lldb.SBModule(spec)
self.assertTrue(module.IsValid())
mytype = module.FindFirstType("foobár")
self.assertTrue(mytype.IsValid())
self.assertTrue(mytype.IsPointerType())
## Instruction:
Change xfail to skipIf. The exact condition is really difficult to get
right and doesn't add much signal.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@340574 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.decorators import *
class TestUnicodeSymbols(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test_union_members(self):
self.build()
spec = lldb.SBModuleSpec()
spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out")))
module = lldb.SBModule(spec)
self.assertTrue(module.IsValid())
mytype = module.FindFirstType("foobár")
self.assertTrue(mytype.IsValid())
self.assertTrue(mytype.IsPointerType())
| import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.decorators import *
class TestUnicodeSymbols(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureAll(compiler="clang", compiler_version=['<', '7.0'])
? ^^ ^^^^^^^^^^^^^^^
+ @skipIf(compiler="clang", compiler_version=['<', '7.0'])
? ^^^ ^^
def test_union_members(self):
self.build()
spec = lldb.SBModuleSpec()
spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out")))
module = lldb.SBModule(spec)
self.assertTrue(module.IsValid())
mytype = module.FindFirstType("foobár")
self.assertTrue(mytype.IsValid())
self.assertTrue(mytype.IsPointerType()) | 2 | 0.1 | 1 | 1 |
f3c1c87498c5573fb422a1f243cd6e754e116002 | README.md | README.md |
- Clone the repository.
```
git clone https://github.com/jhuapl-boss/substrate.git
```
- Install all dependencies.
```
npm install
```
## Testing
- Install eslint and its react plugin:
```
npm i --global eslint eslint-plugin-react@latest --save-dev
```
- Run the tests:
```
./run-lint
```
## Usage
- Run the server:
```
./run-server
```
- Now open your browser and navigate to `http://localhost:8003/`.
Navigate by clicking and dragging. Use <kbd>1</kbd>, <kbd>3</kbd>, and <kbd>7</kbd> to snap to cardinal axis views. Press <kbd>D</kbd> while dragging to pan instead of tilt. Scroll to zoom. (These keyboard controls are defined by the end-develoer )
### Using `substrate`
This system exposes inheritable `Layer`s that can be extended to provide a visualization engine for independent 3D or 2D objects in order to combine them efficiently in the same scene.
More documentation forthcoming... In the meantime, see the inline documentation, or get in touch with @j6k4m8.
## License
If not otherwise marked, all code in this repository falls under the license granted in LICENSE.md.
|
CircleCI: [](https://circleci.com/gh/jhuapl-boss/substrate/tree/master)
## Installation and Configuration
- Clone the repository.
```
git clone https://github.com/jhuapl-boss/substrate.git
```
- Install all dependencies.
```
npm install
```
## Testing
- Install eslint and its react plugin:
```
npm i --global eslint eslint-plugin-react@latest --save-dev
```
- Run the tests:
```
./run-lint
```
## Usage
- Run the server:
```
./run-server
```
- Now open your browser and navigate to `http://localhost:8003/`.
Navigate by clicking and dragging. Use <kbd>1</kbd>, <kbd>3</kbd>, and <kbd>7</kbd> to snap to cardinal axis views. Press <kbd>D</kbd> while dragging to pan instead of tilt. Scroll to zoom. (These keyboard controls are defined by the end-develoer )
### Using `substrate`
This system exposes inheritable `Layer`s that can be extended to provide a visualization engine for independent 3D or 2D objects in order to combine them efficiently in the same scene.
More documentation forthcoming... In the meantime, see the inline documentation, or get in touch with @j6k4m8.
## License
If not otherwise marked, all code in this repository falls under the license granted in LICENSE.md.
| Add CircleCI badge to readme | Add CircleCI badge to readme | Markdown | apache-2.0 | jhuapl-boss/substrate,jhuapl-boss/substrate | markdown | ## Code Before:
- Clone the repository.
```
git clone https://github.com/jhuapl-boss/substrate.git
```
- Install all dependencies.
```
npm install
```
## Testing
- Install eslint and its react plugin:
```
npm i --global eslint eslint-plugin-react@latest --save-dev
```
- Run the tests:
```
./run-lint
```
## Usage
- Run the server:
```
./run-server
```
- Now open your browser and navigate to `http://localhost:8003/`.
Navigate by clicking and dragging. Use <kbd>1</kbd>, <kbd>3</kbd>, and <kbd>7</kbd> to snap to cardinal axis views. Press <kbd>D</kbd> while dragging to pan instead of tilt. Scroll to zoom. (These keyboard controls are defined by the end-develoer )
### Using `substrate`
This system exposes inheritable `Layer`s that can be extended to provide a visualization engine for independent 3D or 2D objects in order to combine them efficiently in the same scene.
More documentation forthcoming... In the meantime, see the inline documentation, or get in touch with @j6k4m8.
## License
If not otherwise marked, all code in this repository falls under the license granted in LICENSE.md.
## Instruction:
Add CircleCI badge to readme
## Code After:
CircleCI: [](https://circleci.com/gh/jhuapl-boss/substrate/tree/master)
## Installation and Configuration
- Clone the repository.
```
git clone https://github.com/jhuapl-boss/substrate.git
```
- Install all dependencies.
```
npm install
```
## Testing
- Install eslint and its react plugin:
```
npm i --global eslint eslint-plugin-react@latest --save-dev
```
- Run the tests:
```
./run-lint
```
## Usage
- Run the server:
```
./run-server
```
- Now open your browser and navigate to `http://localhost:8003/`.
Navigate by clicking and dragging. Use <kbd>1</kbd>, <kbd>3</kbd>, and <kbd>7</kbd> to snap to cardinal axis views. Press <kbd>D</kbd> while dragging to pan instead of tilt. Scroll to zoom. (These keyboard controls are defined by the end-develoer )
### Using `substrate`
This system exposes inheritable `Layer`s that can be extended to provide a visualization engine for independent 3D or 2D objects in order to combine them efficiently in the same scene.
More documentation forthcoming... In the meantime, see the inline documentation, or get in touch with @j6k4m8.
## License
If not otherwise marked, all code in this repository falls under the license granted in LICENSE.md.
| +
+ CircleCI: [](https://circleci.com/gh/jhuapl-boss/substrate/tree/master)
+
+ ## Installation and Configuration
- Clone the repository.
```
git clone https://github.com/jhuapl-boss/substrate.git
```
- Install all dependencies.
```
npm install
```
## Testing
- Install eslint and its react plugin:
```
npm i --global eslint eslint-plugin-react@latest --save-dev
```
- Run the tests:
```
./run-lint
```
## Usage
- Run the server:
```
./run-server
```
- Now open your browser and navigate to `http://localhost:8003/`.
Navigate by clicking and dragging. Use <kbd>1</kbd>, <kbd>3</kbd>, and <kbd>7</kbd> to snap to cardinal axis views. Press <kbd>D</kbd> while dragging to pan instead of tilt. Scroll to zoom. (These keyboard controls are defined by the end-develoer )
### Using `substrate`
This system exposes inheritable `Layer`s that can be extended to provide a visualization engine for independent 3D or 2D objects in order to combine them efficiently in the same scene.
More documentation forthcoming... In the meantime, see the inline documentation, or get in touch with @j6k4m8.
## License
If not otherwise marked, all code in this repository falls under the license granted in LICENSE.md. | 4 | 0.108108 | 4 | 0 |
055f3ddc96692ba11a412ddca650e3909c01f868 | app/contributions-count.php | app/contributions-count.php | <?php
$githubProfile = file_get_contents('https://github.com/controversial');
$contributionsIndex = preg_match(
'/contributions\s+in the last year/',
$githubProfile,
$matches,
PREG_OFFSET_CAPTURE
);
$index = $matches[0][1];
printf($index);
printf(substr($githubProfile, $index-20, 50));
?>
| <?php
$githubProfile = file_get_contents('https://github.com/controversial');
$contributionsIndex = preg_match(
'/contributions\s+in the last year/',
$githubProfile,
$matches,
PREG_OFFSET_CAPTURE
);
$index = $matches[0][1];
$oldIndex = $index;
while (is_numeric($githubProfile[$index-2]) || $githubProfile[$index-2] == ',') {
$index--;
}
echo(substr($githubProfile, $index-1, $oldIndex-$index));
?>
| Isolate the contributions count number | Isolate the contributions count number
| PHP | mit | controversial/controversial.io,controversial/controversial.io,controversial/controversial.io | php | ## Code Before:
<?php
$githubProfile = file_get_contents('https://github.com/controversial');
$contributionsIndex = preg_match(
'/contributions\s+in the last year/',
$githubProfile,
$matches,
PREG_OFFSET_CAPTURE
);
$index = $matches[0][1];
printf($index);
printf(substr($githubProfile, $index-20, 50));
?>
## Instruction:
Isolate the contributions count number
## Code After:
<?php
$githubProfile = file_get_contents('https://github.com/controversial');
$contributionsIndex = preg_match(
'/contributions\s+in the last year/',
$githubProfile,
$matches,
PREG_OFFSET_CAPTURE
);
$index = $matches[0][1];
$oldIndex = $index;
while (is_numeric($githubProfile[$index-2]) || $githubProfile[$index-2] == ',') {
$index--;
}
echo(substr($githubProfile, $index-1, $oldIndex-$index));
?>
| <?php
$githubProfile = file_get_contents('https://github.com/controversial');
$contributionsIndex = preg_match(
'/contributions\s+in the last year/',
$githubProfile,
$matches,
PREG_OFFSET_CAPTURE
);
$index = $matches[0][1];
+ $oldIndex = $index;
- printf($index);
- printf(substr($githubProfile, $index-20, 50));
+ while (is_numeric($githubProfile[$index-2]) || $githubProfile[$index-2] == ',') {
+ $index--;
+ }
+
+ echo(substr($githubProfile, $index-1, $oldIndex-$index));
?> | 8 | 0.533333 | 6 | 2 |
28cc17cad16dd96b3771c82a7b78c8d7840a41ff | docs/plugins/extra-host-names.md | docs/plugins/extra-host-names.md |
The idea of this plugin is to reproduce a feature that is extremely useful using Vagrant: fixed arbitrary domain names
for the running VMs. The interest of this feature come from the "easy-to-use" point of view to the fact that it is
needed using OAuth2 servers to have a fixed address for instance.
In order to configure the domain names of your components, you'll have to put this configuration in your project's
`composer.json` file.
If you have a `docker-compose.yml` file that defines the components `api` and `ui` for instance, you can then configure
domain names like that in your `composer.json` file:
```json
{
"extra": {
"dock-cli": {
"extra-hostname": {
"api": ["my-api.acme.tld", "local.api.acme.tld"],
"ui": ["local.acme.tld"]
}
}
}
}
```
Each time you'll run the `dock-cli start` command, a corresponding line in your `/etc/hosts` file will be created or
updated with the IP address of the running container.
|
The idea of this plugin is to reproduce a feature that is extremely useful using Vagrant: fixed arbitrary domain names
for the running VMs. The interest of this feature come from the "easy-to-use" point of view to the fact that it is
needed using OAuth2 servers to have a fixed address for instance.
In order to configure the domain names of your components, you'll have to put this configuration in your project's
`composer.json` file.
If you have a `docker-compose.yml` file that defines the components `api` and `ui` for instance, you can then configure
domain names like that in your `composer.json` file:
```json
{
"extra": {
"dock-cli": {
"extra-hostname": {
"api": ["my-api.acme.tld", "local.api.acme.tld"],
"ui": ["local.acme.tld"]
}
}
}
}
```
Each time you'll run the `dock-cli start` command, a corresponding line in your `/etc/hosts` file will be created or
updated with the IP address of the running container.
| Use 4-tabs for JSON in docs | Use 4-tabs for JSON in docs
| Markdown | mit | sroze/dock-cli,sroze/dock-cli,inviqa/dock-cli,inviqa/dock-cli | markdown | ## Code Before:
The idea of this plugin is to reproduce a feature that is extremely useful using Vagrant: fixed arbitrary domain names
for the running VMs. The interest of this feature come from the "easy-to-use" point of view to the fact that it is
needed using OAuth2 servers to have a fixed address for instance.
In order to configure the domain names of your components, you'll have to put this configuration in your project's
`composer.json` file.
If you have a `docker-compose.yml` file that defines the components `api` and `ui` for instance, you can then configure
domain names like that in your `composer.json` file:
```json
{
"extra": {
"dock-cli": {
"extra-hostname": {
"api": ["my-api.acme.tld", "local.api.acme.tld"],
"ui": ["local.acme.tld"]
}
}
}
}
```
Each time you'll run the `dock-cli start` command, a corresponding line in your `/etc/hosts` file will be created or
updated with the IP address of the running container.
## Instruction:
Use 4-tabs for JSON in docs
## Code After:
The idea of this plugin is to reproduce a feature that is extremely useful using Vagrant: fixed arbitrary domain names
for the running VMs. The interest of this feature come from the "easy-to-use" point of view to the fact that it is
needed using OAuth2 servers to have a fixed address for instance.
In order to configure the domain names of your components, you'll have to put this configuration in your project's
`composer.json` file.
If you have a `docker-compose.yml` file that defines the components `api` and `ui` for instance, you can then configure
domain names like that in your `composer.json` file:
```json
{
"extra": {
"dock-cli": {
"extra-hostname": {
"api": ["my-api.acme.tld", "local.api.acme.tld"],
"ui": ["local.acme.tld"]
}
}
}
}
```
Each time you'll run the `dock-cli start` command, a corresponding line in your `/etc/hosts` file will be created or
updated with the IP address of the running container.
|
The idea of this plugin is to reproduce a feature that is extremely useful using Vagrant: fixed arbitrary domain names
for the running VMs. The interest of this feature come from the "easy-to-use" point of view to the fact that it is
needed using OAuth2 servers to have a fixed address for instance.
In order to configure the domain names of your components, you'll have to put this configuration in your project's
`composer.json` file.
If you have a `docker-compose.yml` file that defines the components `api` and `ui` for instance, you can then configure
domain names like that in your `composer.json` file:
```json
{
- "extra": {
+ "extra": {
? ++
- "dock-cli": {
+ "dock-cli": {
? ++++
- "extra-hostname": {
+ "extra-hostname": {
? ++++++
- "api": ["my-api.acme.tld", "local.api.acme.tld"],
+ "api": ["my-api.acme.tld", "local.api.acme.tld"],
? ++++++++
- "ui": ["local.acme.tld"]
+ "ui": ["local.acme.tld"]
? ++++++++
+ }
- }
+ }
? ++
}
- }
}
```
Each time you'll run the `dock-cli start` command, a corresponding line in your `/etc/hosts` file will be created or
updated with the IP address of the running container. | 14 | 0.538462 | 7 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.