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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9ebd7c3edb90d421a769ada7543f03d127321b63 | lib/rspec/request_describer.rb | lib/rspec/request_describer.rb | require "rspec/request_describer/version"
module RSpec
module RequestDescriber
RESERVED_HEADER_NAMES = %w(
Content-Type
Host
HTTPS
)
SUPPORTED_METHODS = %w(
GET
POST
PUT
PATCH
DELETE
)
def self.included(base)
base.instance_eval do
subject do
send method, path, request_body, env
end
let(:request_body) do
if headers["Content-Type"] == "application/json"
params.to_json
else
params
end
end
let(:headers) do
{}
end
let(:params) do
{}
end
let(:env) do
headers.inject({}) do |result, (key, value)|
key = "HTTP_" + key unless RESERVED_HEADER_NAMES.include?(key)
key = key.gsub("-", "_").upcase
result.merge(key => value)
end
end
let(:endpoint_segments) do
current_example = RSpec.respond_to?(:current_example) ? RSpec.current_example : example
current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) ([\/a-z0-9_:\-]+)/).to_a
end
let(:method) do
endpoint_segments[1].downcase
end
let(:path) do
endpoint_segments[2].gsub(/:([^\s\/]+)/) { send($1) }
end
end
end
end
end
| require "rspec/request_describer/version"
module RSpec
module RequestDescriber
RESERVED_HEADER_NAMES = %w(
Content-Type
Host
HTTPS
)
SUPPORTED_METHODS = %w(
GET
POST
PUT
PATCH
DELETE
)
def self.included(base)
base.instance_eval do
subject do
send method, path, request_body, env
end
let(:request_body) do
if headers["Content-Type"] == "application/json"
params.to_json
else
params
end
end
let(:headers) do
{}
end
let(:params) do
{}
end
let(:env) do
headers.inject({}) do |result, (key, value)|
key = "HTTP_" + key unless RESERVED_HEADER_NAMES.include?(key)
key = key.gsub("-", "_").upcase
result.merge(key => value)
end
end
let(:endpoint_segments) do
current_example = RSpec.respond_to?(:current_example) ? RSpec.current_example : example
current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) (\S+)/).to_a
end
let(:method) do
endpoint_segments[1].downcase
end
let(:path) do
endpoint_segments[2].gsub(/:([^\s\/]+)/) { send($1) }
end
end
end
end
end
| Allow any non-space characters in URL path | Allow any non-space characters in URL path
| Ruby | mit | yujinakayama/rspec-request_describer,r7kamura/rspec-request_describer | ruby | ## Code Before:
require "rspec/request_describer/version"
module RSpec
module RequestDescriber
RESERVED_HEADER_NAMES = %w(
Content-Type
Host
HTTPS
)
SUPPORTED_METHODS = %w(
GET
POST
PUT
PATCH
DELETE
)
def self.included(base)
base.instance_eval do
subject do
send method, path, request_body, env
end
let(:request_body) do
if headers["Content-Type"] == "application/json"
params.to_json
else
params
end
end
let(:headers) do
{}
end
let(:params) do
{}
end
let(:env) do
headers.inject({}) do |result, (key, value)|
key = "HTTP_" + key unless RESERVED_HEADER_NAMES.include?(key)
key = key.gsub("-", "_").upcase
result.merge(key => value)
end
end
let(:endpoint_segments) do
current_example = RSpec.respond_to?(:current_example) ? RSpec.current_example : example
current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) ([\/a-z0-9_:\-]+)/).to_a
end
let(:method) do
endpoint_segments[1].downcase
end
let(:path) do
endpoint_segments[2].gsub(/:([^\s\/]+)/) { send($1) }
end
end
end
end
end
## Instruction:
Allow any non-space characters in URL path
## Code After:
require "rspec/request_describer/version"
module RSpec
module RequestDescriber
RESERVED_HEADER_NAMES = %w(
Content-Type
Host
HTTPS
)
SUPPORTED_METHODS = %w(
GET
POST
PUT
PATCH
DELETE
)
def self.included(base)
base.instance_eval do
subject do
send method, path, request_body, env
end
let(:request_body) do
if headers["Content-Type"] == "application/json"
params.to_json
else
params
end
end
let(:headers) do
{}
end
let(:params) do
{}
end
let(:env) do
headers.inject({}) do |result, (key, value)|
key = "HTTP_" + key unless RESERVED_HEADER_NAMES.include?(key)
key = key.gsub("-", "_").upcase
result.merge(key => value)
end
end
let(:endpoint_segments) do
current_example = RSpec.respond_to?(:current_example) ? RSpec.current_example : example
current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) (\S+)/).to_a
end
let(:method) do
endpoint_segments[1].downcase
end
let(:path) do
endpoint_segments[2].gsub(/:([^\s\/]+)/) { send($1) }
end
end
end
end
end
| require "rspec/request_describer/version"
module RSpec
module RequestDescriber
RESERVED_HEADER_NAMES = %w(
Content-Type
Host
HTTPS
)
SUPPORTED_METHODS = %w(
GET
POST
PUT
PATCH
DELETE
)
def self.included(base)
base.instance_eval do
subject do
send method, path, request_body, env
end
let(:request_body) do
if headers["Content-Type"] == "application/json"
params.to_json
else
params
end
end
let(:headers) do
{}
end
let(:params) do
{}
end
let(:env) do
headers.inject({}) do |result, (key, value)|
key = "HTTP_" + key unless RESERVED_HEADER_NAMES.include?(key)
key = key.gsub("-", "_").upcase
result.merge(key => value)
end
end
let(:endpoint_segments) do
current_example = RSpec.respond_to?(:current_example) ? RSpec.current_example : example
- current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) ([\/a-z0-9_:\-]+)/).to_a
? - ^^^^^^^^^^^^
+ current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) (\S+)/).to_a
? ^
end
let(:method) do
endpoint_segments[1].downcase
end
let(:path) do
endpoint_segments[2].gsub(/:([^\s\/]+)/) { send($1) }
end
end
end
end
end | 2 | 0.03125 | 1 | 1 |
75fd0102d670b5f6d153399a5295c4148684ee84 | lib/shinseibank/cli/subcommand.rb | lib/shinseibank/cli/subcommand.rb | class ShinseiBank
class CLI < Thor
class Subcommand < Thor
class_option :credentials, required: true, type: :string
private
def shinseibank
@_shinseibank ||= ShinseiBank.new
end
def login
shinseibank.login(options[:credentials])
end
end
end
end
| class ShinseiBank
class CLI < Thor
class Subcommand < Thor
DEFAULT_CREDENTIALS_PATH = "./shinsei_bank.yaml".freeze
class_option :credentials, required: true, type: :string, aliases: "-c", default: DEFAULT_CREDENTIALS_PATH
private
def shinseibank
@_shinseibank ||= ShinseiBank.new
end
def login
shinseibank.login(options[:credentials])
end
end
end
end
| Set default option and shorter alias for --credentials option | Set default option and shorter alias for --credentials option
| Ruby | mit | knshiro/shinseibank-ruby,knshiro/shinseibank-ruby | ruby | ## Code Before:
class ShinseiBank
class CLI < Thor
class Subcommand < Thor
class_option :credentials, required: true, type: :string
private
def shinseibank
@_shinseibank ||= ShinseiBank.new
end
def login
shinseibank.login(options[:credentials])
end
end
end
end
## Instruction:
Set default option and shorter alias for --credentials option
## Code After:
class ShinseiBank
class CLI < Thor
class Subcommand < Thor
DEFAULT_CREDENTIALS_PATH = "./shinsei_bank.yaml".freeze
class_option :credentials, required: true, type: :string, aliases: "-c", default: DEFAULT_CREDENTIALS_PATH
private
def shinseibank
@_shinseibank ||= ShinseiBank.new
end
def login
shinseibank.login(options[:credentials])
end
end
end
end
| class ShinseiBank
class CLI < Thor
class Subcommand < Thor
- class_option :credentials, required: true, type: :string
+ DEFAULT_CREDENTIALS_PATH = "./shinsei_bank.yaml".freeze
+
+ class_option :credentials, required: true, type: :string, aliases: "-c", default: DEFAULT_CREDENTIALS_PATH
private
def shinseibank
@_shinseibank ||= ShinseiBank.new
end
def login
shinseibank.login(options[:credentials])
end
end
end
end | 4 | 0.235294 | 3 | 1 |
2bca59da20121b8ec4a441a0aa2485bc76182fa0 | aii-freeipa/README.md | aii-freeipa/README.md | For now, the pom.xml has the python version hardcoded to 2.7 for EL7
(for EL6, change the pyversion.short property)
## Run tests
```bash
PERL5LIB=/usr/lib/perl:$PWD/target/dependency/build-scripts/:$PWD/src/test/perl mvn test
```
|
For now, the pom.xml has the python version hardcoded to 2.6 for EL6.
For EL7, change the `pyversion.short` property, like this:
```bash
mvn -Dpyversion.short=2.7 <goal1> [<goal2> ...]
```
## Run tests
```bash
PERL5LIB=/usr/lib/perl:$PWD/target/dependency/build-scripts/:$PWD/src/test/perl mvn test
```
| Document how to build on EL7 | Document how to build on EL7
| Markdown | apache-2.0 | stdweird/aii,jrha/aii,jouvin/aii,stdweird/aii,quattor/aii,jrha/aii,jouvin/aii,alvarosimon/aii,alvarosimon/aii | markdown | ## Code Before:
For now, the pom.xml has the python version hardcoded to 2.7 for EL7
(for EL6, change the pyversion.short property)
## Run tests
```bash
PERL5LIB=/usr/lib/perl:$PWD/target/dependency/build-scripts/:$PWD/src/test/perl mvn test
```
## Instruction:
Document how to build on EL7
## Code After:
For now, the pom.xml has the python version hardcoded to 2.6 for EL6.
For EL7, change the `pyversion.short` property, like this:
```bash
mvn -Dpyversion.short=2.7 <goal1> [<goal2> ...]
```
## Run tests
```bash
PERL5LIB=/usr/lib/perl:$PWD/target/dependency/build-scripts/:$PWD/src/test/perl mvn test
```
| +
- For now, the pom.xml has the python version hardcoded to 2.7 for EL7
? ^ ^^
+ For now, the pom.xml has the python version hardcoded to 2.6 for EL6.
? ^ ^^
- (for EL6, change the pyversion.short property)
? ^^ ^ ^
+ For EL7, change the `pyversion.short` property, like this:
? ^ ^ + + ^^^^^^^^^^^^
+
+ ```bash
+ mvn -Dpyversion.short=2.7 <goal1> [<goal2> ...]
+ ```
+
## Run tests
+
```bash
PERL5LIB=/usr/lib/perl:$PWD/target/dependency/build-scripts/:$PWD/src/test/perl mvn test
``` | 11 | 1.833333 | 9 | 2 |
8e45eb77394ad47579f5726e8f2e63794b8e10c5 | farnsworth/wsgi.py | farnsworth/wsgi.py | import os
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "farnsworth.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "farnsworth.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
| import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "farnsworth.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "farnsworth.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
| Fix python-path when WSGIPythonPath is not defined | Fix python-path when WSGIPythonPath is not defined
| Python | bsd-2-clause | knagra/farnsworth,knagra/farnsworth,knagra/farnsworth,knagra/farnsworth | python | ## Code Before:
import os
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "farnsworth.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "farnsworth.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
## Instruction:
Fix python-path when WSGIPythonPath is not defined
## Code After:
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "farnsworth.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "farnsworth.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
| import os
+ import sys
+ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "farnsworth.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "farnsworth.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application) | 2 | 0.117647 | 2 | 0 |
3fed81cd933163818160ca5b4abb026a86b44f63 | README.md | README.md | Proof of concepts/examples/investigations in .NET.
StripWhiteSpace: Remove unnecessary white space in ASPX and ASCX files when they are parsed and converted to classes. | Proof of concepts/examples/investigations in .NET.
StripWhiteSpace: Remove unnecessary white space in ASPX and ASCX files when they are parsed and converted to classes.
DISetupOnPageParse: Add code to the class that renders the page to perform property base dependency injection for ASCXs, ASPXs, and server controls. | Update readme with explanation of DISetupOnPageParse. | Update readme with explanation of DISetupOnPageParse.
| Markdown | unlicense | jmatysczak/DotNETPOCs,jmatysczak/DotNETPOCs | markdown | ## Code Before:
Proof of concepts/examples/investigations in .NET.
StripWhiteSpace: Remove unnecessary white space in ASPX and ASCX files when they are parsed and converted to classes.
## Instruction:
Update readme with explanation of DISetupOnPageParse.
## Code After:
Proof of concepts/examples/investigations in .NET.
StripWhiteSpace: Remove unnecessary white space in ASPX and ASCX files when they are parsed and converted to classes.
DISetupOnPageParse: Add code to the class that renders the page to perform property base dependency injection for ASCXs, ASPXs, and server controls. | Proof of concepts/examples/investigations in .NET.
StripWhiteSpace: Remove unnecessary white space in ASPX and ASCX files when they are parsed and converted to classes.
+
+ DISetupOnPageParse: Add code to the class that renders the page to perform property base dependency injection for ASCXs, ASPXs, and server controls. | 2 | 0.666667 | 2 | 0 |
ab6803d36ef0b679dca50bd8a8bcac364d159901 | lib/StreamIterator.js | lib/StreamIterator.js | const util = require('util'),
{ AsyncIterator } = require('asynciterator'),
EventEmitter = require('events').EventEmitter;
var StreamIterator = function (stream) {
this._iterator = AsyncIterator.wrap(stream);
this._streamEnded = false;
this._currentCB;
this._currentPromise;
this._iterator.on("end", () => {
this._streamEnded = true;
if(this._currentPromise) {
this._currentPromise();
}
if (this._currentCB) {
this._currentCB();
}
});
};
util.inherits(StreamIterator, EventEmitter);
StreamIterator.prototype.getCurrentObject = function () {
return this._currentObject;
};
StreamIterator.prototype.next = function (callback) {
return new Promise(async (resolve, reject) => {
this._currentCB = callback;
this._currentPromise = resolve;
var object = this._iterator.read();
if (!object && !this._streamEnded) {
this._iterator.once("readable", async () => {
object = await this.next(callback)
resolve(object);
});
//Filter our object on the date property and check whether it’s in our interval.
} else if (object) {
this._currentObject = object;
if (callback)
callback(object);
resolve(object);
} else if (!object) {
//stream ended
this._currentObject = null;
if (callback)
callback(null);
resolve(null);
} else {
//We didn't find a solution this time, let's find it next time
resolve(await this.next(callback));
}
});
};
module.exports = StreamIterator;
| const util = require('util'),
{ AsyncIterator } = require('asynciterator'),
EventEmitter = require('events').EventEmitter;
var StreamIterator = function (stream) {
this._iterator = AsyncIterator.wrap(stream);
this._currentCB;
this._currentPromise;
};
util.inherits(StreamIterator, EventEmitter);
StreamIterator.prototype.getCurrentObject = function () {
return this._currentObject;
};
StreamIterator.prototype.next = function (callback) {
return new Promise(async (resolve, reject) => {
this._currentCB = callback;
this._currentPromise = resolve;
var object = this._iterator.read();
if (!object && !this._iterator.ended && this._iterator._state < 2) {
this._iterator.once("readable", async () => {
object = await this.next(callback)
resolve(object);
});
//Filter our object on the date property and check whether it’s in our interval.
} else if (object) {
this._currentObject = object;
if (callback)
callback(object);
resolve(object);
} else if (!object) {
//stream ended
this._currentObject = null;
if (callback)
callback(null);
resolve(null);
} else {
//We didn't find a solution this time, let's find it next time
resolve(await this.next(callback));
}
});
};
module.exports = StreamIterator;
| Fix for calendar_dates iterator end event interfering with sequential transform process of calendar. | Fix for calendar_dates iterator end event interfering with sequential transform process of calendar.
| JavaScript | mit | linkedconnections/gtfs2lc,linkedconnections/gtfs2lc | javascript | ## Code Before:
const util = require('util'),
{ AsyncIterator } = require('asynciterator'),
EventEmitter = require('events').EventEmitter;
var StreamIterator = function (stream) {
this._iterator = AsyncIterator.wrap(stream);
this._streamEnded = false;
this._currentCB;
this._currentPromise;
this._iterator.on("end", () => {
this._streamEnded = true;
if(this._currentPromise) {
this._currentPromise();
}
if (this._currentCB) {
this._currentCB();
}
});
};
util.inherits(StreamIterator, EventEmitter);
StreamIterator.prototype.getCurrentObject = function () {
return this._currentObject;
};
StreamIterator.prototype.next = function (callback) {
return new Promise(async (resolve, reject) => {
this._currentCB = callback;
this._currentPromise = resolve;
var object = this._iterator.read();
if (!object && !this._streamEnded) {
this._iterator.once("readable", async () => {
object = await this.next(callback)
resolve(object);
});
//Filter our object on the date property and check whether it’s in our interval.
} else if (object) {
this._currentObject = object;
if (callback)
callback(object);
resolve(object);
} else if (!object) {
//stream ended
this._currentObject = null;
if (callback)
callback(null);
resolve(null);
} else {
//We didn't find a solution this time, let's find it next time
resolve(await this.next(callback));
}
});
};
module.exports = StreamIterator;
## Instruction:
Fix for calendar_dates iterator end event interfering with sequential transform process of calendar.
## Code After:
const util = require('util'),
{ AsyncIterator } = require('asynciterator'),
EventEmitter = require('events').EventEmitter;
var StreamIterator = function (stream) {
this._iterator = AsyncIterator.wrap(stream);
this._currentCB;
this._currentPromise;
};
util.inherits(StreamIterator, EventEmitter);
StreamIterator.prototype.getCurrentObject = function () {
return this._currentObject;
};
StreamIterator.prototype.next = function (callback) {
return new Promise(async (resolve, reject) => {
this._currentCB = callback;
this._currentPromise = resolve;
var object = this._iterator.read();
if (!object && !this._iterator.ended && this._iterator._state < 2) {
this._iterator.once("readable", async () => {
object = await this.next(callback)
resolve(object);
});
//Filter our object on the date property and check whether it’s in our interval.
} else if (object) {
this._currentObject = object;
if (callback)
callback(object);
resolve(object);
} else if (!object) {
//stream ended
this._currentObject = null;
if (callback)
callback(null);
resolve(null);
} else {
//We didn't find a solution this time, let's find it next time
resolve(await this.next(callback));
}
});
};
module.exports = StreamIterator;
| const util = require('util'),
{ AsyncIterator } = require('asynciterator'),
EventEmitter = require('events').EventEmitter;
var StreamIterator = function (stream) {
this._iterator = AsyncIterator.wrap(stream);
- this._streamEnded = false;
this._currentCB;
this._currentPromise;
- this._iterator.on("end", () => {
- this._streamEnded = true;
- if(this._currentPromise) {
- this._currentPromise();
- }
- if (this._currentCB) {
- this._currentCB();
- }
- });
};
util.inherits(StreamIterator, EventEmitter);
StreamIterator.prototype.getCurrentObject = function () {
return this._currentObject;
};
StreamIterator.prototype.next = function (callback) {
return new Promise(async (resolve, reject) => {
this._currentCB = callback;
this._currentPromise = resolve;
var object = this._iterator.read();
- if (!object && !this._streamEnded) {
+ if (!object && !this._iterator.ended && this._iterator._state < 2) {
this._iterator.once("readable", async () => {
object = await this.next(callback)
resolve(object);
});
//Filter our object on the date property and check whether it’s in our interval.
} else if (object) {
this._currentObject = object;
if (callback)
callback(object);
resolve(object);
} else if (!object) {
//stream ended
this._currentObject = null;
if (callback)
callback(null);
resolve(null);
} else {
//We didn't find a solution this time, let's find it next time
resolve(await this.next(callback));
}
});
};
module.exports = StreamIterator;
| 12 | 0.210526 | 1 | 11 |
270656c7cec639e69d728df8b2e2f1001c1e2ee2 | index.html | index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Shards Multiply</title>
<style media="screen">
body {
background: #147;
text-align: center;
}
main {
margin: 0;
padding: 0;
position: fixed;
width: 100%;
top: 0;
left: 0;
}
#canvas {
background: #0AA;
margin: 1rem auto;
position: relative;
cursor: none;
}
</style>
</head>
<body>
<main>
<canvas id="canvas" width="1024" height="768"></canvas>
</main>
</body>
<script type="text/javascript" src="/base.js"></script>
<script type="text/javascript" src="/render.js"></script>
<script type="text/javascript" src="/input.js"></script>
<script type="text/javascript" src="/weapons.js"></script>
<script type="text/javascript" src="/player.js"></script>
<script type="text/javascript" src="/target.js"></script>
<script type="text/javascript" src="/camera.js"></script>
<script type="text/javascript" src="/scene.js"></script>
<script type="text/javascript" src="/audio.js"></script>
<script type="text/javascript" src="/game.js"></script>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Shards Multiply</title>
<style media="screen">
body {
background: #147;
text-align: center;
}
main {
margin: 0;
padding: 0;
position: fixed;
width: 100%;
top: 0;
left: 0;
}
#canvas {
background: #0AA;
margin: 1rem auto;
position: relative;
cursor: none;
max-height: 94vh;
}
</style>
</head>
<body>
<main>
<canvas id="canvas" width="1024" height="768"></canvas>
</main>
</body>
<script type="text/javascript" src="/base.js"></script>
<script type="text/javascript" src="/render.js"></script>
<script type="text/javascript" src="/input.js"></script>
<script type="text/javascript" src="/weapons.js"></script>
<script type="text/javascript" src="/player.js"></script>
<script type="text/javascript" src="/target.js"></script>
<script type="text/javascript" src="/camera.js"></script>
<script type="text/javascript" src="/scene.js"></script>
<script type="text/javascript" src="/audio.js"></script>
<script type="text/javascript" src="/game.js"></script>
</html>
| Add max-height to canvas to keep within viewport | Add max-height to canvas to keep within viewport
| HTML | mit | peternatewood/shmup,peternatewood/shmup,peternatewood/shmup | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Shards Multiply</title>
<style media="screen">
body {
background: #147;
text-align: center;
}
main {
margin: 0;
padding: 0;
position: fixed;
width: 100%;
top: 0;
left: 0;
}
#canvas {
background: #0AA;
margin: 1rem auto;
position: relative;
cursor: none;
}
</style>
</head>
<body>
<main>
<canvas id="canvas" width="1024" height="768"></canvas>
</main>
</body>
<script type="text/javascript" src="/base.js"></script>
<script type="text/javascript" src="/render.js"></script>
<script type="text/javascript" src="/input.js"></script>
<script type="text/javascript" src="/weapons.js"></script>
<script type="text/javascript" src="/player.js"></script>
<script type="text/javascript" src="/target.js"></script>
<script type="text/javascript" src="/camera.js"></script>
<script type="text/javascript" src="/scene.js"></script>
<script type="text/javascript" src="/audio.js"></script>
<script type="text/javascript" src="/game.js"></script>
</html>
## Instruction:
Add max-height to canvas to keep within viewport
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Shards Multiply</title>
<style media="screen">
body {
background: #147;
text-align: center;
}
main {
margin: 0;
padding: 0;
position: fixed;
width: 100%;
top: 0;
left: 0;
}
#canvas {
background: #0AA;
margin: 1rem auto;
position: relative;
cursor: none;
max-height: 94vh;
}
</style>
</head>
<body>
<main>
<canvas id="canvas" width="1024" height="768"></canvas>
</main>
</body>
<script type="text/javascript" src="/base.js"></script>
<script type="text/javascript" src="/render.js"></script>
<script type="text/javascript" src="/input.js"></script>
<script type="text/javascript" src="/weapons.js"></script>
<script type="text/javascript" src="/player.js"></script>
<script type="text/javascript" src="/target.js"></script>
<script type="text/javascript" src="/camera.js"></script>
<script type="text/javascript" src="/scene.js"></script>
<script type="text/javascript" src="/audio.js"></script>
<script type="text/javascript" src="/game.js"></script>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Shards Multiply</title>
<style media="screen">
body {
background: #147;
text-align: center;
}
main {
margin: 0;
padding: 0;
position: fixed;
width: 100%;
top: 0;
left: 0;
}
#canvas {
background: #0AA;
margin: 1rem auto;
position: relative;
cursor: none;
+ max-height: 94vh;
}
</style>
</head>
<body>
<main>
<canvas id="canvas" width="1024" height="768"></canvas>
</main>
</body>
<script type="text/javascript" src="/base.js"></script>
<script type="text/javascript" src="/render.js"></script>
<script type="text/javascript" src="/input.js"></script>
<script type="text/javascript" src="/weapons.js"></script>
<script type="text/javascript" src="/player.js"></script>
<script type="text/javascript" src="/target.js"></script>
<script type="text/javascript" src="/camera.js"></script>
<script type="text/javascript" src="/scene.js"></script>
<script type="text/javascript" src="/audio.js"></script>
<script type="text/javascript" src="/game.js"></script>
</html> | 1 | 0.02381 | 1 | 0 |
829d636c9ec69d518690b1be2c56ef1f7134b44a | src/main/java/com/dragonheart/dijkstra/DijkstraGraph.java | src/main/java/com/dragonheart/dijkstra/DijkstraGraph.java | package com.dragonheart.dijkstra;
import java.util.ArrayList;
public class DijkstraGraph {
private ArrayList<Edge> listOfEdges;
private ArrayList<Point> listOfPoints, sourceNodes;
public DijkstraGraph() {
this.listOfEdges = new ArrayList<Edge>();
this.listOfPoints = new ArrayList<Point>();
this.sourceNodes = new ArrayList<Point>();
}
public void addPoint(Point point) {
listOfPoints.add(point);
}
public void addEdge(Edge edge) {
listOfEdges.add(edge);
}
}
| package com.dragonheart.dijkstra;
import java.util.ArrayList;
import java.util.List;
public class DijkstraGraph {
private ArrayList<Edge> listOfEdges;
private ArrayList<Point> listOfPoints, sourcePoints;
public DijkstraGraph() {
this.listOfEdges = new ArrayList<Edge>();
this.listOfPoints = new ArrayList<Point>();
this.sourcePoints = new ArrayList<Point>();
}
public void addPoint(Point point) {
listOfPoints.add(point);
}
public void addEdge(Edge edge) {
listOfEdges.add(edge);
}
public void addSource(Point point, Double cost) {
if(listOfPoints.contains(point)) {
point.aggregateCost = cost;
sourcePoints.add(point);
}
}
public void addSources(List<Point> points, Double cost) {
for(Point point : points) {
addSource(point, cost);
}
}
public void setSource(Point point, Double cost) {
sourcePoints = new ArrayList<Point>();
addSource(point, cost);
}
public void setSources(List<Point> points, Double cost) {
sourcePoints = new ArrayList<Point>();
addSources(points, cost);
}
}
| Add sources 4 different ways! | Add sources 4 different ways!
| Java | mit | Akhier/Java-DijkstraAlgorithm | java | ## Code Before:
package com.dragonheart.dijkstra;
import java.util.ArrayList;
public class DijkstraGraph {
private ArrayList<Edge> listOfEdges;
private ArrayList<Point> listOfPoints, sourceNodes;
public DijkstraGraph() {
this.listOfEdges = new ArrayList<Edge>();
this.listOfPoints = new ArrayList<Point>();
this.sourceNodes = new ArrayList<Point>();
}
public void addPoint(Point point) {
listOfPoints.add(point);
}
public void addEdge(Edge edge) {
listOfEdges.add(edge);
}
}
## Instruction:
Add sources 4 different ways!
## Code After:
package com.dragonheart.dijkstra;
import java.util.ArrayList;
import java.util.List;
public class DijkstraGraph {
private ArrayList<Edge> listOfEdges;
private ArrayList<Point> listOfPoints, sourcePoints;
public DijkstraGraph() {
this.listOfEdges = new ArrayList<Edge>();
this.listOfPoints = new ArrayList<Point>();
this.sourcePoints = new ArrayList<Point>();
}
public void addPoint(Point point) {
listOfPoints.add(point);
}
public void addEdge(Edge edge) {
listOfEdges.add(edge);
}
public void addSource(Point point, Double cost) {
if(listOfPoints.contains(point)) {
point.aggregateCost = cost;
sourcePoints.add(point);
}
}
public void addSources(List<Point> points, Double cost) {
for(Point point : points) {
addSource(point, cost);
}
}
public void setSource(Point point, Double cost) {
sourcePoints = new ArrayList<Point>();
addSource(point, cost);
}
public void setSources(List<Point> points, Double cost) {
sourcePoints = new ArrayList<Point>();
addSources(points, cost);
}
}
| package com.dragonheart.dijkstra;
import java.util.ArrayList;
+ import java.util.List;
public class DijkstraGraph {
private ArrayList<Edge> listOfEdges;
- private ArrayList<Point> listOfPoints, sourceNodes;
? ^ ^^
+ private ArrayList<Point> listOfPoints, sourcePoints;
? ^ ^^^
public DijkstraGraph() {
this.listOfEdges = new ArrayList<Edge>();
this.listOfPoints = new ArrayList<Point>();
- this.sourceNodes = new ArrayList<Point>();
? ^ ^^
+ this.sourcePoints = new ArrayList<Point>();
? ^ ^^^
}
public void addPoint(Point point) {
listOfPoints.add(point);
}
public void addEdge(Edge edge) {
listOfEdges.add(edge);
}
+
+ public void addSource(Point point, Double cost) {
+ if(listOfPoints.contains(point)) {
+ point.aggregateCost = cost;
+ sourcePoints.add(point);
+ }
+ }
+
+ public void addSources(List<Point> points, Double cost) {
+ for(Point point : points) {
+ addSource(point, cost);
+ }
+ }
+
+ public void setSource(Point point, Double cost) {
+ sourcePoints = new ArrayList<Point>();
+ addSource(point, cost);
+ }
+
+ public void setSources(List<Point> points, Double cost) {
+ sourcePoints = new ArrayList<Point>();
+ addSources(points, cost);
+ }
} | 28 | 1.272727 | 26 | 2 |
03d8b2ca0b070f9247376c40e1f3a4655e579dd0 | kibitzr/notifier/telegram-split.py | kibitzr/notifier/telegram-split.py | from __future__ import absolute_import
import logging
from .telegram import TelegramBot
logger = logging.getLogger(__name__)
class TelegramBotSplit(TelegramBot):
def __init__(self, chat_id=None, split_on="\n"):
self.split_on = split_on
super(TelegramBotSplit, self).__init__(chat_id=chat_id)
def post(self, report, **kwargs):
"""Overwrite post to split message on token"""
for m in report.split(self.split_on):
self.bot.send_message(
self.chat_id,
m,
parse_mode='Markdown',
)
def notify_factory(conf, value):
try:
chat_id = value['chat-id']
except (TypeError, KeyError):
chat_id = value
try:
split_on = value['split-on']
except (TypeError, KeyError):
split_on = "\n"
print(split_on)
return TelegramBotSplit(chat_id=chat_id, split_on=split_on).post
def chat_id():
bot = TelegramBotSplit()
print(bot.chat_id)
| from __future__ import absolute_import
import logging
from .telegram import TelegramBot
logger = logging.getLogger(__name__)
class TelegramBotSplit(TelegramBot):
def __init__(self, chat_id=None, split_on="\n"):
self.split_on = split_on
super(TelegramBotSplit, self).__init__(chat_id=chat_id)
def post(self, report, **kwargs):
"""Overwrite post to split message on token"""
for m in report.split(self.split_on):
super(TelegramBotSplit, self).post(m)
def notify_factory(conf, value):
try:
chat_id = value['chat-id']
except (TypeError, KeyError):
chat_id = value
try:
split_on = value['split-on']
except (TypeError, KeyError):
split_on = "\n"
return TelegramBotSplit(chat_id=chat_id, split_on=split_on).post
def chat_id():
bot = TelegramBotSplit()
print(bot.chat_id)
| Use parent 'post' function to actually send message | Use parent 'post' function to actually send message
| Python | mit | kibitzr/kibitzr,kibitzr/kibitzr | python | ## Code Before:
from __future__ import absolute_import
import logging
from .telegram import TelegramBot
logger = logging.getLogger(__name__)
class TelegramBotSplit(TelegramBot):
def __init__(self, chat_id=None, split_on="\n"):
self.split_on = split_on
super(TelegramBotSplit, self).__init__(chat_id=chat_id)
def post(self, report, **kwargs):
"""Overwrite post to split message on token"""
for m in report.split(self.split_on):
self.bot.send_message(
self.chat_id,
m,
parse_mode='Markdown',
)
def notify_factory(conf, value):
try:
chat_id = value['chat-id']
except (TypeError, KeyError):
chat_id = value
try:
split_on = value['split-on']
except (TypeError, KeyError):
split_on = "\n"
print(split_on)
return TelegramBotSplit(chat_id=chat_id, split_on=split_on).post
def chat_id():
bot = TelegramBotSplit()
print(bot.chat_id)
## Instruction:
Use parent 'post' function to actually send message
## Code After:
from __future__ import absolute_import
import logging
from .telegram import TelegramBot
logger = logging.getLogger(__name__)
class TelegramBotSplit(TelegramBot):
def __init__(self, chat_id=None, split_on="\n"):
self.split_on = split_on
super(TelegramBotSplit, self).__init__(chat_id=chat_id)
def post(self, report, **kwargs):
"""Overwrite post to split message on token"""
for m in report.split(self.split_on):
super(TelegramBotSplit, self).post(m)
def notify_factory(conf, value):
try:
chat_id = value['chat-id']
except (TypeError, KeyError):
chat_id = value
try:
split_on = value['split-on']
except (TypeError, KeyError):
split_on = "\n"
return TelegramBotSplit(chat_id=chat_id, split_on=split_on).post
def chat_id():
bot = TelegramBotSplit()
print(bot.chat_id)
| from __future__ import absolute_import
import logging
from .telegram import TelegramBot
logger = logging.getLogger(__name__)
class TelegramBotSplit(TelegramBot):
def __init__(self, chat_id=None, split_on="\n"):
self.split_on = split_on
super(TelegramBotSplit, self).__init__(chat_id=chat_id)
def post(self, report, **kwargs):
"""Overwrite post to split message on token"""
for m in report.split(self.split_on):
+ super(TelegramBotSplit, self).post(m)
- self.bot.send_message(
- self.chat_id,
- m,
- parse_mode='Markdown',
- )
def notify_factory(conf, value):
try:
chat_id = value['chat-id']
except (TypeError, KeyError):
chat_id = value
try:
split_on = value['split-on']
except (TypeError, KeyError):
split_on = "\n"
- print(split_on)
return TelegramBotSplit(chat_id=chat_id, split_on=split_on).post
def chat_id():
bot = TelegramBotSplit()
print(bot.chat_id) | 7 | 0.170732 | 1 | 6 |
415855559410f86056f0848d380034af2dfd8db5 | src/SecucardConnect/Product/Payment/SecupayCreditcardsService.php | src/SecucardConnect/Product/Payment/SecupayCreditcardsService.php | <?php
namespace SecucardConnect\Product\Payment;
use SecucardConnect\Product\Payment\Service\PaymentService;
/**
* Operations for the payment.secupaycreditcard resource.
* @package SecucardConnect\Product\Payment
*/
class SecupayCreditcardsService extends PaymentService
{
/**
* @deprecated v1.1.0 Use now onStatusChange($fn).
*/
public function onSecupayCreditcardChanged($fn)
{
$this->onStatusChange($fn);
}
}
| <?php
namespace SecucardConnect\Product\Payment;
use SecucardConnect\Product\Payment\Service\PaymentService;
/**
* Operations for the payment.secupaycreditcard resource.
* @package SecucardConnect\Product\Payment
*/
class SecupayCreditcardsService extends PaymentService
{
}
| CHANGE remove deprecated function in new code | CHANGE remove deprecated function in new code
| PHP | apache-2.0 | secucard/secucard-connect-php-sdk,secucard/secucard-connect-php-client-lib | php | ## Code Before:
<?php
namespace SecucardConnect\Product\Payment;
use SecucardConnect\Product\Payment\Service\PaymentService;
/**
* Operations for the payment.secupaycreditcard resource.
* @package SecucardConnect\Product\Payment
*/
class SecupayCreditcardsService extends PaymentService
{
/**
* @deprecated v1.1.0 Use now onStatusChange($fn).
*/
public function onSecupayCreditcardChanged($fn)
{
$this->onStatusChange($fn);
}
}
## Instruction:
CHANGE remove deprecated function in new code
## Code After:
<?php
namespace SecucardConnect\Product\Payment;
use SecucardConnect\Product\Payment\Service\PaymentService;
/**
* Operations for the payment.secupaycreditcard resource.
* @package SecucardConnect\Product\Payment
*/
class SecupayCreditcardsService extends PaymentService
{
}
| <?php
namespace SecucardConnect\Product\Payment;
use SecucardConnect\Product\Payment\Service\PaymentService;
/**
* Operations for the payment.secupaycreditcard resource.
* @package SecucardConnect\Product\Payment
*/
class SecupayCreditcardsService extends PaymentService
{
- /**
- * @deprecated v1.1.0 Use now onStatusChange($fn).
- */
- public function onSecupayCreditcardChanged($fn)
- {
- $this->onStatusChange($fn);
- }
}
| 7 | 0.333333 | 0 | 7 |
2bd14f768ce7d82f7ef84d1e67d61afda5044581 | st2common/st2common/constants/logging.py | st2common/st2common/constants/logging.py |
import os
__all__ = [
'DEFAULT_LOGGING_CONF_PATH'
]
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
DEFAULT_LOGGING_CONF_PATH = os.path.join(BASE_PATH, '../conf/base.logging.conf')
DEFAULT_LOGGING_CONF_PATH = os.path.abspath(DEFAULT_LOGGING_CONF_PATH)
|
import os
__all__ = [
'DEFAULT_LOGGING_CONF_PATH'
]
BASE_PATH = os.path.dirname(os.path.abspath((__file__)))
DEFAULT_LOGGING_CONF_PATH = os.path.join(BASE_PATH, '../conf/base.logging.conf')
DEFAULT_LOGGING_CONF_PATH = os.path.abspath(DEFAULT_LOGGING_CONF_PATH)
| Use the correct base path. | Use the correct base path.
| Python | apache-2.0 | punalpatel/st2,lakshmi-kannan/st2,Plexxi/st2,jtopjian/st2,Plexxi/st2,grengojbo/st2,emedvedev/st2,punalpatel/st2,peak6/st2,dennybaa/st2,alfasin/st2,Plexxi/st2,Itxaka/st2,pinterb/st2,StackStorm/st2,nzlosh/st2,grengojbo/st2,nzlosh/st2,Itxaka/st2,pixelrebel/st2,Plexxi/st2,tonybaloney/st2,peak6/st2,StackStorm/st2,jtopjian/st2,lakshmi-kannan/st2,Itxaka/st2,StackStorm/st2,alfasin/st2,emedvedev/st2,grengojbo/st2,pinterb/st2,pixelrebel/st2,pixelrebel/st2,dennybaa/st2,StackStorm/st2,nzlosh/st2,tonybaloney/st2,armab/st2,lakshmi-kannan/st2,armab/st2,nzlosh/st2,pinterb/st2,jtopjian/st2,punalpatel/st2,dennybaa/st2,peak6/st2,emedvedev/st2,alfasin/st2,tonybaloney/st2,armab/st2 | python | ## Code Before:
import os
__all__ = [
'DEFAULT_LOGGING_CONF_PATH'
]
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
DEFAULT_LOGGING_CONF_PATH = os.path.join(BASE_PATH, '../conf/base.logging.conf')
DEFAULT_LOGGING_CONF_PATH = os.path.abspath(DEFAULT_LOGGING_CONF_PATH)
## Instruction:
Use the correct base path.
## Code After:
import os
__all__ = [
'DEFAULT_LOGGING_CONF_PATH'
]
BASE_PATH = os.path.dirname(os.path.abspath((__file__)))
DEFAULT_LOGGING_CONF_PATH = os.path.join(BASE_PATH, '../conf/base.logging.conf')
DEFAULT_LOGGING_CONF_PATH = os.path.abspath(DEFAULT_LOGGING_CONF_PATH)
|
import os
__all__ = [
'DEFAULT_LOGGING_CONF_PATH'
]
- BASE_PATH = os.path.abspath(os.path.dirname(__file__))
? ^^^^^^ ---- ^^
+ BASE_PATH = os.path.dirname(os.path.abspath((__file__)))
? ++++ ^^ ^^^^^^^ +
DEFAULT_LOGGING_CONF_PATH = os.path.join(BASE_PATH, '../conf/base.logging.conf')
DEFAULT_LOGGING_CONF_PATH = os.path.abspath(DEFAULT_LOGGING_CONF_PATH) | 2 | 0.181818 | 1 | 1 |
63c3bc05bfffdc43a73b460e96c489522d34f896 | bokehjs/test/test_mapper/test_categorical_mapper.coffee | bokehjs/test/test_mapper/test_categorical_mapper.coffee | {expect} = require "chai"
utils = require "../utils"
{Collections} = utils.require "common/base"
describe "categorical mapper", ->
mapper = null
before ->
mapper = Collections('CategoricalMapper').create(
source_range: Collections('FactorRange').create
factors: ['foo', 'bar', 'baz']
target_range: Collections('Range1d').create
start: 20, 'end': 80
)
it "should map first category to bottom third", ->
expect(mapper.map_to_target "foo").to.equal 30
it "should map second category to middle", ->
expect(mapper.map_to_target "bar").to.equal 50
it "should map third category to upper third", ->
expect(mapper.map_to_target "baz").to.equal 70
| {expect} = require "chai"
utils = require "../utils"
{Collections} = utils.require "common/base"
describe "categorical mapper", ->
factors = ["foo", "bar", "baz"]
start = 20
end = 80
testMapping = (key, expected) ->
mapper = Collections("CategoricalMapper").create
source_range: Collections("FactorRange").create factors: factors
target_range: Collections("Range1d").create start: start, end: end
expect(mapper.map_to_target key).to.equal expected
it "should map first category to bottom third", ->
testMapping "foo", 30
it "should map second category to middle", ->
testMapping "bar", 50
it "should map third category to upper third", ->
testMapping "baz", 70
| Refactor test case around to use a test method for each test | Refactor test case around to use a test method for each test
| CoffeeScript | bsd-3-clause | percyfal/bokeh,satishgoda/bokeh,birdsarah/bokeh,phobson/bokeh,Karel-van-de-Plassche/bokeh,percyfal/bokeh,birdsarah/bokeh,quasiben/bokeh,quasiben/bokeh,aiguofer/bokeh,rothnic/bokeh,saifrahmed/bokeh,maxalbert/bokeh,evidation-health/bokeh,philippjfr/bokeh,justacec/bokeh,KasperPRasmussen/bokeh,srinathv/bokeh,ericmjl/bokeh,akloster/bokeh,roxyboy/bokeh,timothydmorton/bokeh,ericmjl/bokeh,dennisobrien/bokeh,awanke/bokeh,jplourenco/bokeh,schoolie/bokeh,awanke/bokeh,aavanian/bokeh,gpfreitas/bokeh,ptitjano/bokeh,canavandl/bokeh,clairetang6/bokeh,jakirkham/bokeh,satishgoda/bokeh,aiguofer/bokeh,roxyboy/bokeh,carlvlewis/bokeh,DuCorey/bokeh,khkaminska/bokeh,caseyclements/bokeh,daodaoliang/bokeh,clairetang6/bokeh,msarahan/bokeh,maxalbert/bokeh,stonebig/bokeh,xguse/bokeh,draperjames/bokeh,paultcochrane/bokeh,htygithub/bokeh,Karel-van-de-Plassche/bokeh,tacaswell/bokeh,mindriot101/bokeh,dennisobrien/bokeh,philippjfr/bokeh,justacec/bokeh,srinathv/bokeh,gpfreitas/bokeh,ChristosChristofidis/bokeh,KasperPRasmussen/bokeh,stonebig/bokeh,KasperPRasmussen/bokeh,xguse/bokeh,CrazyGuo/bokeh,tacaswell/bokeh,evidation-health/bokeh,paultcochrane/bokeh,rothnic/bokeh,eteq/bokeh,ahmadia/bokeh,PythonCharmers/bokeh,ChinaQuants/bokeh,mutirri/bokeh,rs2/bokeh,tacaswell/bokeh,draperjames/bokeh,laurent-george/bokeh,ChinaQuants/bokeh,tacaswell/bokeh,philippjfr/bokeh,bokeh/bokeh,ChristosChristofidis/bokeh,PythonCharmers/bokeh,birdsarah/bokeh,ChristosChristofidis/bokeh,mutirri/bokeh,DuCorey/bokeh,paultcochrane/bokeh,paultcochrane/bokeh,percyfal/bokeh,ptitjano/bokeh,lukebarnard1/bokeh,evidation-health/bokeh,alan-unravel/bokeh,aiguofer/bokeh,muku42/bokeh,msarahan/bokeh,rhiever/bokeh,carlvlewis/bokeh,roxyboy/bokeh,timsnyder/bokeh,evidation-health/bokeh,khkaminska/bokeh,lukebarnard1/bokeh,clairetang6/bokeh,matbra/bokeh,CrazyGuo/bokeh,alan-unravel/bokeh,DuCorey/bokeh,jplourenco/bokeh,ericmjl/bokeh,stonebig/bokeh,deeplook/bokeh,KasperPRasmussen/bokeh,ericmjl/bokeh,DuCorey/bokeh,daodaoliang/bokeh,htygithub/bokeh,bokeh/bokeh,abele/bokeh,ahmadia/bokeh,aiguofer/bokeh,caseyclements/bokeh,aavanian/bokeh,josherick/bokeh,mindriot101/bokeh,jakirkham/bokeh,aiguofer/bokeh,muku42/bokeh,phobson/bokeh,schoolie/bokeh,abele/bokeh,htygithub/bokeh,Karel-van-de-Plassche/bokeh,khkaminska/bokeh,stuart-knock/bokeh,jakirkham/bokeh,timsnyder/bokeh,Karel-van-de-Plassche/bokeh,aavanian/bokeh,rhiever/bokeh,ptitjano/bokeh,dennisobrien/bokeh,philippjfr/bokeh,msarahan/bokeh,stuart-knock/bokeh,xguse/bokeh,rothnic/bokeh,azjps/bokeh,timothydmorton/bokeh,ericmjl/bokeh,rs2/bokeh,ChinaQuants/bokeh,saifrahmed/bokeh,phobson/bokeh,bokeh/bokeh,rothnic/bokeh,ChristosChristofidis/bokeh,phobson/bokeh,saifrahmed/bokeh,matbra/bokeh,ahmadia/bokeh,ericdill/bokeh,percyfal/bokeh,deeplook/bokeh,eteq/bokeh,bsipocz/bokeh,alan-unravel/bokeh,timsnyder/bokeh,deeplook/bokeh,canavandl/bokeh,bsipocz/bokeh,muku42/bokeh,philippjfr/bokeh,bsipocz/bokeh,caseyclements/bokeh,jakirkham/bokeh,htygithub/bokeh,jplourenco/bokeh,rs2/bokeh,carlvlewis/bokeh,maxalbert/bokeh,rhiever/bokeh,draperjames/bokeh,rs2/bokeh,jakirkham/bokeh,awanke/bokeh,ChinaQuants/bokeh,deeplook/bokeh,stonebig/bokeh,eteq/bokeh,carlvlewis/bokeh,KasperPRasmussen/bokeh,justacec/bokeh,muku42/bokeh,akloster/bokeh,azjps/bokeh,dennisobrien/bokeh,josherick/bokeh,abele/bokeh,stuart-knock/bokeh,schoolie/bokeh,daodaoliang/bokeh,draperjames/bokeh,quasiben/bokeh,jplourenco/bokeh,PythonCharmers/bokeh,maxalbert/bokeh,ericdill/bokeh,matbra/bokeh,justacec/bokeh,bokeh/bokeh,dennisobrien/bokeh,josherick/bokeh,gpfreitas/bokeh,draperjames/bokeh,josherick/bokeh,aavanian/bokeh,laurent-george/bokeh,lukebarnard1/bokeh,PythonCharmers/bokeh,schoolie/bokeh,canavandl/bokeh,bokeh/bokeh,akloster/bokeh,aavanian/bokeh,azjps/bokeh,satishgoda/bokeh,ericdill/bokeh,mutirri/bokeh,matbra/bokeh,ahmadia/bokeh,timothydmorton/bokeh,timsnyder/bokeh,laurent-george/bokeh,mindriot101/bokeh,CrazyGuo/bokeh,timothydmorton/bokeh,abele/bokeh,gpfreitas/bokeh,Karel-van-de-Plassche/bokeh,azjps/bokeh,akloster/bokeh,roxyboy/bokeh,ericdill/bokeh,msarahan/bokeh,srinathv/bokeh,DuCorey/bokeh,percyfal/bokeh,saifrahmed/bokeh,khkaminska/bokeh,rhiever/bokeh,mutirri/bokeh,CrazyGuo/bokeh,eteq/bokeh,awanke/bokeh,ptitjano/bokeh,schoolie/bokeh,rs2/bokeh,canavandl/bokeh,daodaoliang/bokeh,bsipocz/bokeh,azjps/bokeh,alan-unravel/bokeh,ptitjano/bokeh,stuart-knock/bokeh,phobson/bokeh,birdsarah/bokeh,mindriot101/bokeh,caseyclements/bokeh,timsnyder/bokeh,satishgoda/bokeh,lukebarnard1/bokeh,laurent-george/bokeh,xguse/bokeh,clairetang6/bokeh,srinathv/bokeh | coffeescript | ## Code Before:
{expect} = require "chai"
utils = require "../utils"
{Collections} = utils.require "common/base"
describe "categorical mapper", ->
mapper = null
before ->
mapper = Collections('CategoricalMapper').create(
source_range: Collections('FactorRange').create
factors: ['foo', 'bar', 'baz']
target_range: Collections('Range1d').create
start: 20, 'end': 80
)
it "should map first category to bottom third", ->
expect(mapper.map_to_target "foo").to.equal 30
it "should map second category to middle", ->
expect(mapper.map_to_target "bar").to.equal 50
it "should map third category to upper third", ->
expect(mapper.map_to_target "baz").to.equal 70
## Instruction:
Refactor test case around to use a test method for each test
## Code After:
{expect} = require "chai"
utils = require "../utils"
{Collections} = utils.require "common/base"
describe "categorical mapper", ->
factors = ["foo", "bar", "baz"]
start = 20
end = 80
testMapping = (key, expected) ->
mapper = Collections("CategoricalMapper").create
source_range: Collections("FactorRange").create factors: factors
target_range: Collections("Range1d").create start: start, end: end
expect(mapper.map_to_target key).to.equal expected
it "should map first category to bottom third", ->
testMapping "foo", 30
it "should map second category to middle", ->
testMapping "bar", 50
it "should map third category to upper third", ->
testMapping "baz", 70
| {expect} = require "chai"
utils = require "../utils"
{Collections} = utils.require "common/base"
describe "categorical mapper", ->
- mapper = null
- before ->
+ factors = ["foo", "bar", "baz"]
+ start = 20
+ end = 80
+
+ testMapping = (key, expected) ->
- mapper = Collections('CategoricalMapper').create(
? ^ ^ -
+ mapper = Collections("CategoricalMapper").create
? ^ ^
- source_range: Collections('FactorRange').create
? ^ ^
+ source_range: Collections("FactorRange").create factors: factors
? ^ ^ +++++++++++++++++
- factors: ['foo', 'bar', 'baz']
- target_range: Collections('Range1d').create
? ^ ^
+ target_range: Collections("Range1d").create start: start, end: end
? ^ ^ +++++++++++++++++++++++
+ expect(mapper.map_to_target key).to.equal expected
- start: 20, 'end': 80
- )
it "should map first category to bottom third", ->
- expect(mapper.map_to_target "foo").to.equal 30
+ testMapping "foo", 30
it "should map second category to middle", ->
- expect(mapper.map_to_target "bar").to.equal 50
+ testMapping "bar", 50
it "should map third category to upper third", ->
- expect(mapper.map_to_target "baz").to.equal 70
+ testMapping "baz", 70 | 23 | 1 | 12 | 11 |
1ba569ea6e75d47fb05a3eb0f3f30ccbff112515 | lib/mnemosyne/builder.rb | lib/mnemosyne/builder.rb |
module Mnemosyne
class Builder
attr_reader :payload
def initialize(payload)
@payload = payload
end
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def create!
activity = ::Activity.fetch payload.fetch(:transaction)
application = ::Application.fetch payload.fetch(:application)
ActiveRecord::Base.transaction do
trace ||= begin
::Trace.create! \
id: payload[:uuid],
origin_id: payload[:origin],
application: application,
activity: activity,
name: payload[:name],
start: Integer(payload[:start]),
stop: Integer(payload[:stop]),
meta: payload[:meta]
end
Span.bulk_insert do |worker|
Array(payload[:span]).each do |data|
worker.add \
id: data[:uuid],
name: data[:name],
trace_id: trace.id,
start: Integer(data[:start]),
stop: Integer(data[:stop]),
meta: data[:meta]
end
end
end
end
class << self
def create!(payload)
new(payload).create!
end
end
end
end
|
module Mnemosyne
class Builder
attr_reader :payload
def initialize(payload)
@payload = payload
end
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def create!
activity = ::Activity.fetch payload.fetch(:transaction)
application = ::Application.fetch payload.fetch(:application)
ActiveRecord::Base.transaction do
trace ||= begin
::Trace.create! \
id: payload[:uuid],
origin_id: payload[:origin],
application: application,
activity: activity,
name: payload[:name],
start: Integer(payload[:start]),
stop: Integer(payload[:stop]),
meta: payload[:meta]
end
# `Span.column_names` is required to force bulk insert plugin
# to process `id` column too.
Span.bulk_insert(*Span.column_names) do |worker|
Array(payload[:span]).each do |data|
worker.add \
id: data[:uuid],
name: data[:name],
trace_id: trace.id,
start: Integer(data[:start]),
stop: Integer(data[:stop]),
meta: data[:meta]
end
end
end
end
class << self
def create!(payload)
new(payload).create!
end
end
end
end
| Fix issue on bulk insert leaving UUID out | Fix issue on bulk insert leaving UUID out
* Bulk insert plugin ignores given ID column value unless column list
is manually specified and including ID column
| Ruby | agpl-3.0 | jgraichen/mnemosyne-server,jgraichen/mnemosyne-server,jgraichen/mnemosyne-server | ruby | ## Code Before:
module Mnemosyne
class Builder
attr_reader :payload
def initialize(payload)
@payload = payload
end
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def create!
activity = ::Activity.fetch payload.fetch(:transaction)
application = ::Application.fetch payload.fetch(:application)
ActiveRecord::Base.transaction do
trace ||= begin
::Trace.create! \
id: payload[:uuid],
origin_id: payload[:origin],
application: application,
activity: activity,
name: payload[:name],
start: Integer(payload[:start]),
stop: Integer(payload[:stop]),
meta: payload[:meta]
end
Span.bulk_insert do |worker|
Array(payload[:span]).each do |data|
worker.add \
id: data[:uuid],
name: data[:name],
trace_id: trace.id,
start: Integer(data[:start]),
stop: Integer(data[:stop]),
meta: data[:meta]
end
end
end
end
class << self
def create!(payload)
new(payload).create!
end
end
end
end
## Instruction:
Fix issue on bulk insert leaving UUID out
* Bulk insert plugin ignores given ID column value unless column list
is manually specified and including ID column
## Code After:
module Mnemosyne
class Builder
attr_reader :payload
def initialize(payload)
@payload = payload
end
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def create!
activity = ::Activity.fetch payload.fetch(:transaction)
application = ::Application.fetch payload.fetch(:application)
ActiveRecord::Base.transaction do
trace ||= begin
::Trace.create! \
id: payload[:uuid],
origin_id: payload[:origin],
application: application,
activity: activity,
name: payload[:name],
start: Integer(payload[:start]),
stop: Integer(payload[:stop]),
meta: payload[:meta]
end
# `Span.column_names` is required to force bulk insert plugin
# to process `id` column too.
Span.bulk_insert(*Span.column_names) do |worker|
Array(payload[:span]).each do |data|
worker.add \
id: data[:uuid],
name: data[:name],
trace_id: trace.id,
start: Integer(data[:start]),
stop: Integer(data[:stop]),
meta: data[:meta]
end
end
end
end
class << self
def create!(payload)
new(payload).create!
end
end
end
end
|
module Mnemosyne
class Builder
attr_reader :payload
def initialize(payload)
@payload = payload
end
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def create!
activity = ::Activity.fetch payload.fetch(:transaction)
application = ::Application.fetch payload.fetch(:application)
ActiveRecord::Base.transaction do
trace ||= begin
::Trace.create! \
id: payload[:uuid],
origin_id: payload[:origin],
application: application,
activity: activity,
name: payload[:name],
start: Integer(payload[:start]),
stop: Integer(payload[:stop]),
meta: payload[:meta]
end
+ # `Span.column_names` is required to force bulk insert plugin
+ # to process `id` column too.
- Span.bulk_insert do |worker|
+ Span.bulk_insert(*Span.column_names) do |worker|
? ++++++++++++++++++++
Array(payload[:span]).each do |data|
worker.add \
id: data[:uuid],
name: data[:name],
trace_id: trace.id,
start: Integer(data[:start]),
stop: Integer(data[:stop]),
meta: data[:meta]
end
end
end
end
class << self
def create!(payload)
new(payload).create!
end
end
end
end | 4 | 0.081633 | 3 | 1 |
a53577a34016638512d7c83e14bcf5438d3c5d2e | caminae/core/templates/core/path_list.html | caminae/core/templates/core/path_list.html | {% extends "mapentity/entity_list.html" %}
{% load i18n mapentity %}
{% block nav-path %}active{% endblock nav-path %}
{% block mainactions %}
{% if user.profile.is_path_manager %}
<div class="btn-group">
<a class="btn btn-success" href="{{ model.get_add_url }}"><i class="icon-plus"></i> {% trans "Add a path" %}</a>
{% else %}
<span class="btn disabled" href="#"><i class="icon-plus"></i> {% trans "Add a path" %}</span>
{% endif %}
</div>
{% endblock mainactions %}
| {% extends "mapentity/entity_list.html" %}
{% load i18n mapentity %}
{% block nav-path %}active{% endblock nav-path %}
{% block mainactions %}
{% if user.profile.is_path_manager %}
<a class="btn btn-success" href="{{ model.get_add_url }}"><i class="icon-plus"></i> {% trans "Add a path" %}</a>
{% else %}
<span class="btn disabled" href="#"><i class="icon-plus"></i> {% trans "Add a path" %}</span>
{% endif %}
{% endblock mainactions %}
| Fix DOM if not path manager | Fix DOM if not path manager
| HTML | bsd-2-clause | johan--/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,camillemonchicourt/Geotrek,makinacorpus/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,mabhub/Geotrek,camillemonchicourt/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,Anaethelion/Geotrek,camillemonchicourt/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,makinacorpus/Geotrek,mabhub/Geotrek | html | ## Code Before:
{% extends "mapentity/entity_list.html" %}
{% load i18n mapentity %}
{% block nav-path %}active{% endblock nav-path %}
{% block mainactions %}
{% if user.profile.is_path_manager %}
<div class="btn-group">
<a class="btn btn-success" href="{{ model.get_add_url }}"><i class="icon-plus"></i> {% trans "Add a path" %}</a>
{% else %}
<span class="btn disabled" href="#"><i class="icon-plus"></i> {% trans "Add a path" %}</span>
{% endif %}
</div>
{% endblock mainactions %}
## Instruction:
Fix DOM if not path manager
## Code After:
{% extends "mapentity/entity_list.html" %}
{% load i18n mapentity %}
{% block nav-path %}active{% endblock nav-path %}
{% block mainactions %}
{% if user.profile.is_path_manager %}
<a class="btn btn-success" href="{{ model.get_add_url }}"><i class="icon-plus"></i> {% trans "Add a path" %}</a>
{% else %}
<span class="btn disabled" href="#"><i class="icon-plus"></i> {% trans "Add a path" %}</span>
{% endif %}
{% endblock mainactions %}
| {% extends "mapentity/entity_list.html" %}
{% load i18n mapentity %}
{% block nav-path %}active{% endblock nav-path %}
{% block mainactions %}
{% if user.profile.is_path_manager %}
- <div class="btn-group">
<a class="btn btn-success" href="{{ model.get_add_url }}"><i class="icon-plus"></i> {% trans "Add a path" %}</a>
- {% else %}
? ----
+ {% else %}
<span class="btn disabled" href="#"><i class="icon-plus"></i> {% trans "Add a path" %}</span>
- {% endif %}
? ----
+ {% endif %}
- </div>
{% endblock mainactions %} | 6 | 0.428571 | 2 | 4 |
69eae29120f582c6b541eb585cfe33cf37ee95bd | gpt_disk_io/README.md | gpt_disk_io/README.md |
[](https://crates.io/crates/gpt_disk_io)
[](https://docs.rs/gpt_disk_io)
`no_std` library for reading and writing [GPT] (GUID Partition Table)
disk data structures through a block IO interface.
See also the [`gpt_disk_types`] package.
[GPT]: https://en.wikipedia.org/wiki/GUID_Partition_Table
[`gpt_disk_types`]: https://crates.io/crates/gpt_disk_types
## Features
* `std`: Provides `std::error::Error` implementations for all of the
error types. Off by default.
## License
Apache 2.0; see [`LICENSE`] for details.
[`LICENSE`]: https://github.com/google/gpt-disk-rs/blob/HEAD/LICENSE
## Disclaimer
This project is not an official Google project. It is not supported by
Google and Google specifically disclaims all warranties as to its quality,
merchantability, or fitness for a particular purpose.
|
[](https://crates.io/crates/gpt_disk_io)
[](https://docs.rs/gpt_disk_io)
`no_std` library for reading and writing [GPT] (GUID Partition Table)
disk data structures through a block IO interface.
See also the [`gpt_disk_types`] package.
[GPT]: https://en.wikipedia.org/wiki/GUID_Partition_Table
[`gpt_disk_types`]: https://crates.io/crates/gpt_disk_types
## Features
* `std`: Enables the `StdBlockIo` type, as well as `std::error::Error`
implementations for all of the error types. Off by default.
## License
Apache 2.0; see [`LICENSE`] for details.
[`LICENSE`]: https://github.com/google/gpt-disk-rs/blob/HEAD/LICENSE
## Disclaimer
This project is not an official Google project. It is not supported by
Google and Google specifically disclaims all warranties as to its quality,
merchantability, or fitness for a particular purpose.
| Fix description of std feature in gpt_disk_io readme | Fix description of std feature in gpt_disk_io readme
| Markdown | apache-2.0 | google/gpt-disk-rs | markdown | ## Code Before:
[](https://crates.io/crates/gpt_disk_io)
[](https://docs.rs/gpt_disk_io)
`no_std` library for reading and writing [GPT] (GUID Partition Table)
disk data structures through a block IO interface.
See also the [`gpt_disk_types`] package.
[GPT]: https://en.wikipedia.org/wiki/GUID_Partition_Table
[`gpt_disk_types`]: https://crates.io/crates/gpt_disk_types
## Features
* `std`: Provides `std::error::Error` implementations for all of the
error types. Off by default.
## License
Apache 2.0; see [`LICENSE`] for details.
[`LICENSE`]: https://github.com/google/gpt-disk-rs/blob/HEAD/LICENSE
## Disclaimer
This project is not an official Google project. It is not supported by
Google and Google specifically disclaims all warranties as to its quality,
merchantability, or fitness for a particular purpose.
## Instruction:
Fix description of std feature in gpt_disk_io readme
## Code After:
[](https://crates.io/crates/gpt_disk_io)
[](https://docs.rs/gpt_disk_io)
`no_std` library for reading and writing [GPT] (GUID Partition Table)
disk data structures through a block IO interface.
See also the [`gpt_disk_types`] package.
[GPT]: https://en.wikipedia.org/wiki/GUID_Partition_Table
[`gpt_disk_types`]: https://crates.io/crates/gpt_disk_types
## Features
* `std`: Enables the `StdBlockIo` type, as well as `std::error::Error`
implementations for all of the error types. Off by default.
## License
Apache 2.0; see [`LICENSE`] for details.
[`LICENSE`]: https://github.com/google/gpt-disk-rs/blob/HEAD/LICENSE
## Disclaimer
This project is not an official Google project. It is not supported by
Google and Google specifically disclaims all warranties as to its quality,
merchantability, or fitness for a particular purpose.
|
[](https://crates.io/crates/gpt_disk_io)
[](https://docs.rs/gpt_disk_io)
`no_std` library for reading and writing [GPT] (GUID Partition Table)
disk data structures through a block IO interface.
See also the [`gpt_disk_types`] package.
[GPT]: https://en.wikipedia.org/wiki/GUID_Partition_Table
[`gpt_disk_types`]: https://crates.io/crates/gpt_disk_types
## Features
- * `std`: Provides `std::error::Error` implementations for all of the
- error types. Off by default.
+ * `std`: Enables the `StdBlockIo` type, as well as `std::error::Error`
+ implementations for all of the error types. Off by default.
## License
Apache 2.0; see [`LICENSE`] for details.
[`LICENSE`]: https://github.com/google/gpt-disk-rs/blob/HEAD/LICENSE
## Disclaimer
This project is not an official Google project. It is not supported by
Google and Google specifically disclaims all warranties as to its quality,
merchantability, or fitness for a particular purpose. | 4 | 0.142857 | 2 | 2 |
d170a08665a76372c5e9c6a3f669b157211a1d1a | sli/admin-tools/admin-rails/app/views/realm_management/index.html.erb | sli/admin-tools/admin-rails/app/views/realm_management/index.html.erb | <div id="notice">
<%= notice %>
</div>
<div class="page-header">
<h1>Realms for <%= @edorg %></h1>
</div>
<table id="realms" class="table table-hover">
<thead>
<tr>
<th><%= "Name" %></th>
<th><%= "Unique Identifier" %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @realms.each do |realm| %>
<tr id='<%= realm.id %>'>
<td><%= link_to(realm.name, edit_realm_management_path(realm)) %></td>
<td><%= realm.uniqueIdentifier %></td>
<td class="rowAction">
<%= link_to("Custom Roles", custom_role_path(realm), :class => "btn btn-info") %>
<%= link_to '<i class="fa fa-trash-o"></i>'.html_safe + ' Delete', realm_management_path(realm), :method => :delete, :remote => true,
confirm: 'WARNING: Deleting will prevent any user associated with this realm from authenticating and will reset role mapping. Are you sure?', :class => 'btn btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to "Add new", new_realm_management_path, :class => "btn btn-info" %>
| <div class="page-header">
<h1>Realms for <%= @edorg %></h1>
</div>
<table id="realms" class="table table-hover">
<thead>
<tr>
<th><%= "Name" %></th>
<th><%= "Unique Identifier" %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @realms.each do |realm| %>
<tr id='<%= realm.id %>'>
<td><%= link_to(realm.name, edit_realm_management_path(realm)) %></td>
<td><%= realm.uniqueIdentifier %></td>
<td class="rowAction">
<%= link_to("Custom Roles", custom_role_path(realm), :class => "btn btn-info") %>
<%= link_to '<i class="fa fa-trash-o"></i>'.html_safe + ' Delete', realm_management_path(realm), :method => :delete, :remote => true,
confirm: 'WARNING: Deleting will prevent any user associated with this realm from authenticating and will reset role mapping. Are you sure?', :class => 'btn btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to "Add new", new_realm_management_path, :class => "btn btn-info" %>
| Remove extra flash notice div | Remove extra flash notice div
| HTML+ERB | apache-2.0 | inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service | html+erb | ## Code Before:
<div id="notice">
<%= notice %>
</div>
<div class="page-header">
<h1>Realms for <%= @edorg %></h1>
</div>
<table id="realms" class="table table-hover">
<thead>
<tr>
<th><%= "Name" %></th>
<th><%= "Unique Identifier" %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @realms.each do |realm| %>
<tr id='<%= realm.id %>'>
<td><%= link_to(realm.name, edit_realm_management_path(realm)) %></td>
<td><%= realm.uniqueIdentifier %></td>
<td class="rowAction">
<%= link_to("Custom Roles", custom_role_path(realm), :class => "btn btn-info") %>
<%= link_to '<i class="fa fa-trash-o"></i>'.html_safe + ' Delete', realm_management_path(realm), :method => :delete, :remote => true,
confirm: 'WARNING: Deleting will prevent any user associated with this realm from authenticating and will reset role mapping. Are you sure?', :class => 'btn btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to "Add new", new_realm_management_path, :class => "btn btn-info" %>
## Instruction:
Remove extra flash notice div
## Code After:
<div class="page-header">
<h1>Realms for <%= @edorg %></h1>
</div>
<table id="realms" class="table table-hover">
<thead>
<tr>
<th><%= "Name" %></th>
<th><%= "Unique Identifier" %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @realms.each do |realm| %>
<tr id='<%= realm.id %>'>
<td><%= link_to(realm.name, edit_realm_management_path(realm)) %></td>
<td><%= realm.uniqueIdentifier %></td>
<td class="rowAction">
<%= link_to("Custom Roles", custom_role_path(realm), :class => "btn btn-info") %>
<%= link_to '<i class="fa fa-trash-o"></i>'.html_safe + ' Delete', realm_management_path(realm), :method => :delete, :remote => true,
confirm: 'WARNING: Deleting will prevent any user associated with this realm from authenticating and will reset role mapping. Are you sure?', :class => 'btn btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to "Add new", new_realm_management_path, :class => "btn btn-info" %>
| - <div id="notice">
- <%= notice %>
- </div>
-
<div class="page-header">
<h1>Realms for <%= @edorg %></h1>
</div>
<table id="realms" class="table table-hover">
<thead>
<tr>
<th><%= "Name" %></th>
<th><%= "Unique Identifier" %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @realms.each do |realm| %>
<tr id='<%= realm.id %>'>
<td><%= link_to(realm.name, edit_realm_management_path(realm)) %></td>
<td><%= realm.uniqueIdentifier %></td>
<td class="rowAction">
<%= link_to("Custom Roles", custom_role_path(realm), :class => "btn btn-info") %>
<%= link_to '<i class="fa fa-trash-o"></i>'.html_safe + ' Delete', realm_management_path(realm), :method => :delete, :remote => true,
confirm: 'WARNING: Deleting will prevent any user associated with this realm from authenticating and will reset role mapping. Are you sure?', :class => 'btn btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to "Add new", new_realm_management_path, :class => "btn btn-info" %>
| 4 | 0.121212 | 0 | 4 |
7a59999961b67dbd480c80a4a4f95fa6738b2949 | day-20/solution.py | day-20/solution.py | from __future__ import print_function
def findFirst(data, target):
for idx, value in enumerate(data):
if value >= target:
return idx
return None
target = 34000000
# Target is achieved at itself/10, so reasonable upper bound.
upperbound = target // 10
# Use a varation of Erathostenes' sieve to compute the results
sieve1 = [10] * (upperbound + 1)
sieve2 = [10] * (upperbound + 1)
for x in range(1, upperbound):
for y in range(x, upperbound, x):
sieve1[y] += 10 * x
for y in range(x, min(50 * x, upperbound) + 1, x):
sieve2[y] += 11 * x
print("House", findFirst(sieve1, target))
print("House", findFirst(sieve2, target))
| from __future__ import print_function
def findFirst(data, target):
return next(idx for idx, value in enumerate(data) if value >= target)
target = 34000000
# Target is achieved at itself/10, so reasonable upper bound.
upperbound = target // 10
# Use a varation of Erathostenes' sieve to compute the results
sieve1 = [10] * (upperbound + 1)
sieve2 = [10] * (upperbound + 1)
for x in range(1, upperbound):
for y in range(x, upperbound, x):
sieve1[y] += 10 * x
for y in range(x, min(50 * x, upperbound) + 1, x):
sieve2[y] += 11 * x
print("House", findFirst(sieve1, target))
print("House", findFirst(sieve2, target))
| Improve getting the first valid value. | Improve getting the first valid value.
| Python | mit | bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode | python | ## Code Before:
from __future__ import print_function
def findFirst(data, target):
for idx, value in enumerate(data):
if value >= target:
return idx
return None
target = 34000000
# Target is achieved at itself/10, so reasonable upper bound.
upperbound = target // 10
# Use a varation of Erathostenes' sieve to compute the results
sieve1 = [10] * (upperbound + 1)
sieve2 = [10] * (upperbound + 1)
for x in range(1, upperbound):
for y in range(x, upperbound, x):
sieve1[y] += 10 * x
for y in range(x, min(50 * x, upperbound) + 1, x):
sieve2[y] += 11 * x
print("House", findFirst(sieve1, target))
print("House", findFirst(sieve2, target))
## Instruction:
Improve getting the first valid value.
## Code After:
from __future__ import print_function
def findFirst(data, target):
return next(idx for idx, value in enumerate(data) if value >= target)
target = 34000000
# Target is achieved at itself/10, so reasonable upper bound.
upperbound = target // 10
# Use a varation of Erathostenes' sieve to compute the results
sieve1 = [10] * (upperbound + 1)
sieve2 = [10] * (upperbound + 1)
for x in range(1, upperbound):
for y in range(x, upperbound, x):
sieve1[y] += 10 * x
for y in range(x, min(50 * x, upperbound) + 1, x):
sieve2[y] += 11 * x
print("House", findFirst(sieve1, target))
print("House", findFirst(sieve2, target))
| from __future__ import print_function
def findFirst(data, target):
+ return next(idx for idx, value in enumerate(data) if value >= target)
- for idx, value in enumerate(data):
- if value >= target:
- return idx
-
- return None
target = 34000000
# Target is achieved at itself/10, so reasonable upper bound.
upperbound = target // 10
# Use a varation of Erathostenes' sieve to compute the results
sieve1 = [10] * (upperbound + 1)
sieve2 = [10] * (upperbound + 1)
for x in range(1, upperbound):
for y in range(x, upperbound, x):
sieve1[y] += 10 * x
for y in range(x, min(50 * x, upperbound) + 1, x):
sieve2[y] += 11 * x
print("House", findFirst(sieve1, target))
print("House", findFirst(sieve2, target)) | 6 | 0.222222 | 1 | 5 |
ad94abcdd0c7d4d5e22c876ba680f29abe8a4aa7 | index.html | index.html | <html>
<head>
<title>Hello rtc.io World!</title>
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="roomdata">
<div class="controlbar">
<input type="text" id="roomid" placeholder="Create a room" />
<button>Connect</button>
</div>
</div>
<div id="l-video"></div>
<div id="r-video"></div>
<script src="vendor/rtc.js"></script>
<script src="vendor/rtc-ios.js"></script>
<script src="app.js"></script>
</body>
</html>
| <html>
<head>
<title>Hello rtc.io World!</title>
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="roomdata">
<div class="controlbar">
<input type="text" id="roomid" placeholder="Create a room" />
<button>Connect</button>
</div>
</div>
<div id="l-video"></div>
<div id="r-video"></div>
<script src="vendor/rtc.js"></script>
<script src="vendor/rtc-ios.js"></script>
<script src="app.js"></script>
<script src="https://cdn.rawgit.com/rtc-io/rtc-badge/v1.1.1/dist/rtc.badge.js"></script>
</body>
</html>
| Include the badge for the public site | Include the badge for the public site
| HTML | mit | rtc-io/demo-helloworld,rtc-io/demo-helloworld,rtc-io/demo-helloworld | html | ## Code Before:
<html>
<head>
<title>Hello rtc.io World!</title>
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="roomdata">
<div class="controlbar">
<input type="text" id="roomid" placeholder="Create a room" />
<button>Connect</button>
</div>
</div>
<div id="l-video"></div>
<div id="r-video"></div>
<script src="vendor/rtc.js"></script>
<script src="vendor/rtc-ios.js"></script>
<script src="app.js"></script>
</body>
</html>
## Instruction:
Include the badge for the public site
## Code After:
<html>
<head>
<title>Hello rtc.io World!</title>
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="roomdata">
<div class="controlbar">
<input type="text" id="roomid" placeholder="Create a room" />
<button>Connect</button>
</div>
</div>
<div id="l-video"></div>
<div id="r-video"></div>
<script src="vendor/rtc.js"></script>
<script src="vendor/rtc-ios.js"></script>
<script src="app.js"></script>
<script src="https://cdn.rawgit.com/rtc-io/rtc-badge/v1.1.1/dist/rtc.badge.js"></script>
</body>
</html>
| <html>
<head>
<title>Hello rtc.io World!</title>
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="roomdata">
<div class="controlbar">
<input type="text" id="roomid" placeholder="Create a room" />
<button>Connect</button>
</div>
</div>
<div id="l-video"></div>
<div id="r-video"></div>
<script src="vendor/rtc.js"></script>
<script src="vendor/rtc-ios.js"></script>
<script src="app.js"></script>
+ <script src="https://cdn.rawgit.com/rtc-io/rtc-badge/v1.1.1/dist/rtc.badge.js"></script>
</body>
</html> | 1 | 0.052632 | 1 | 0 |
88b1bb60aff339b8b7cc13a564ca7ed04308aad1 | src/ZfcUserList/Controller/Factory/UserListController.php | src/ZfcUserList/Controller/Factory/UserListController.php | <?php
namespace ZfcUserList\Controller\Factory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcUserList\Controller\UserListController;
class UserListController implements FactoryInterface
{
public function createService(ServiceLocatorInterface $sm)
{
$parentLocator = $sm->getServiceLocator();
$controller = new UserListController(
$parentLocator->get("zfcuserlist_module_options"),
$parentLocator->get("zfcuser_user_mapper")
);
return $controller;
}
}
| <?php
namespace ZfcUserList\Controller\Factory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcUserList\Controller\UserListController as controller;
use Interop\Container\ContainerInterface;
class UserListController implements FactoryInterface
{
public function createService(ServiceLocatorInterface $sm)
{
return $this->__invoke($sm, "UserListController");
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$controller = new controller(
$container->get("zfcuserlist_module_options"),
$container->get("zfcuser_user_mapper")
);
return $controller;
}
}
| Fix for zf3 factory interface | Fix for zf3 factory interface | PHP | bsd-3-clause | stijnhau/ZfcUserList,stijnhau/ZfcUserList | php | ## Code Before:
<?php
namespace ZfcUserList\Controller\Factory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcUserList\Controller\UserListController;
class UserListController implements FactoryInterface
{
public function createService(ServiceLocatorInterface $sm)
{
$parentLocator = $sm->getServiceLocator();
$controller = new UserListController(
$parentLocator->get("zfcuserlist_module_options"),
$parentLocator->get("zfcuser_user_mapper")
);
return $controller;
}
}
## Instruction:
Fix for zf3 factory interface
## Code After:
<?php
namespace ZfcUserList\Controller\Factory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcUserList\Controller\UserListController as controller;
use Interop\Container\ContainerInterface;
class UserListController implements FactoryInterface
{
public function createService(ServiceLocatorInterface $sm)
{
return $this->__invoke($sm, "UserListController");
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$controller = new controller(
$container->get("zfcuserlist_module_options"),
$container->get("zfcuser_user_mapper")
);
return $controller;
}
}
| <?php
namespace ZfcUserList\Controller\Factory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
- use ZfcUserList\Controller\UserListController;
+ use ZfcUserList\Controller\UserListController as controller;
? ++++++++++++++
+ use Interop\Container\ContainerInterface;
class UserListController implements FactoryInterface
{
public function createService(ServiceLocatorInterface $sm)
{
- $parentLocator = $sm->getServiceLocator();
+ return $this->__invoke($sm, "UserListController");
+ }
+
+ public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
+ {
- $controller = new UserListController(
? ^^^^^^^^^
+ $controller = new controller(
? ^
- $parentLocator->get("zfcuserlist_module_options"),
? ^^^^ --- ^^
+ $container->get("zfcuserlist_module_options"),
? ^^ ^^^
- $parentLocator->get("zfcuser_user_mapper")
? ^^^^ --- ^^
+ $container->get("zfcuser_user_mapper")
? ^^ ^^^
);
return $controller;
}
} | 15 | 0.75 | 10 | 5 |
1861155258d041d1c4b0c00dfb5b5e7407a37f0c | src/peeracle.js | src/peeracle.js | 'use strict';
(function () {
var Peeracle = {};
Peeracle.Media = require('./media');
Peeracle.Peer = require('./peer');
Peeracle.Tracker = require('./tracker');
module.exports = Peeracle;
})();
| 'use strict';
(function () {
var Peeracle = {};
Peeracle.Media = require('./media');
Peeracle.Metadata = require('./metadata');
Peeracle.Peer = require('./peer');
Peeracle.Tracker = require('./tracker');
Peeracle.Utils = require('./utils');
module.exports = Peeracle;
})();
| Load Metadata and Utils in node | Load Metadata and Utils in node
| JavaScript | mit | peeracle/legacy | javascript | ## Code Before:
'use strict';
(function () {
var Peeracle = {};
Peeracle.Media = require('./media');
Peeracle.Peer = require('./peer');
Peeracle.Tracker = require('./tracker');
module.exports = Peeracle;
})();
## Instruction:
Load Metadata and Utils in node
## Code After:
'use strict';
(function () {
var Peeracle = {};
Peeracle.Media = require('./media');
Peeracle.Metadata = require('./metadata');
Peeracle.Peer = require('./peer');
Peeracle.Tracker = require('./tracker');
Peeracle.Utils = require('./utils');
module.exports = Peeracle;
})();
| 'use strict';
(function () {
var Peeracle = {};
Peeracle.Media = require('./media');
+ Peeracle.Metadata = require('./metadata');
Peeracle.Peer = require('./peer');
Peeracle.Tracker = require('./tracker');
+ Peeracle.Utils = require('./utils');
module.exports = Peeracle;
})(); | 2 | 0.222222 | 2 | 0 |
f2a88e4849876970c29b568b897dff88ffe09306 | djrichtextfield/urls.py | djrichtextfield/urls.py | from django.conf.urls import url
from djrichtextfield.views import InitView
urlpatterns = [
url('^init.js$', InitView.as_view(), name='djrichtextfield_init')
]
| from django.urls import path
from djrichtextfield.views import InitView
urlpatterns = [
path('init.js', InitView.as_view(), name='djrichtextfield_init')
]
| Use path instead of soon to be deprecated url | Use path instead of soon to be deprecated url
| Python | mit | jaap3/django-richtextfield,jaap3/django-richtextfield | python | ## Code Before:
from django.conf.urls import url
from djrichtextfield.views import InitView
urlpatterns = [
url('^init.js$', InitView.as_view(), name='djrichtextfield_init')
]
## Instruction:
Use path instead of soon to be deprecated url
## Code After:
from django.urls import path
from djrichtextfield.views import InitView
urlpatterns = [
path('init.js', InitView.as_view(), name='djrichtextfield_init')
]
| - from django.conf.urls import url
? ----- ^^^
+ from django.urls import path
? ^^^^
from djrichtextfield.views import InitView
urlpatterns = [
- url('^init.js$', InitView.as_view(), name='djrichtextfield_init')
? ^^^ - -
+ path('init.js', InitView.as_view(), name='djrichtextfield_init')
? ^^^^
] | 4 | 0.571429 | 2 | 2 |
d6903ca22f6293d7c47f4786161fbe35afef3882 | README.md | README.md | TV Shows Database
=========================
Single page app that allows the user to search for a TV show and display its synopsis. All data is extracted from [The Movie Database API](https://www.themoviedb.org).
This project was created in 6 hours on December 2013 as part of an assignment for an interview.
# Installation
Install npm dependencies by typing the following in a terminal:
```
$ npm install
```
Compile and build the application:
1) Create a TMDB account and generate a new API Key. More information can be
found in [here](http://docs.themoviedb.apiary.io/)
2) Open `js/tvshows.js` and modify the `api_key` variable.
````js
var api_key = "YOUR_API_KEY";
````
3) Execute the following command in a terminal to build the application:
```
$ grunt
``` | TV Shows Database
=========================
Single page app that allows the user to search for a TV show and display its synopsis. All data is extracted from [The Movie Database API](https://www.themoviedb.org).
This project was created in 6 hours on December 2013 as part of an assignment for an interview.
# Installation
Install npm dependencies by typing the following in a terminal:
```
$ npm install
```
Compile and build the application:
1) Create a TMDB account and generate a new API Key. More information can be
found in [here](http://docs.themoviedb.apiary.io/)
2) Open `js/tvshows.js` and modify the `api_key` variable.
````js
var api_key = 'YOUR_API_KEY';
````
3) Execute the following commands in a terminal to build the application:
```
$ npm install
$ bower install
$ grunt
```
4) Open `build/index.html` with your preferred browser. | Update readme file with new installation process | Update readme file with new installation process
| Markdown | mit | epallerols/tv-shows,epallerols/tv-shows | markdown | ## Code Before:
TV Shows Database
=========================
Single page app that allows the user to search for a TV show and display its synopsis. All data is extracted from [The Movie Database API](https://www.themoviedb.org).
This project was created in 6 hours on December 2013 as part of an assignment for an interview.
# Installation
Install npm dependencies by typing the following in a terminal:
```
$ npm install
```
Compile and build the application:
1) Create a TMDB account and generate a new API Key. More information can be
found in [here](http://docs.themoviedb.apiary.io/)
2) Open `js/tvshows.js` and modify the `api_key` variable.
````js
var api_key = "YOUR_API_KEY";
````
3) Execute the following command in a terminal to build the application:
```
$ grunt
```
## Instruction:
Update readme file with new installation process
## Code After:
TV Shows Database
=========================
Single page app that allows the user to search for a TV show and display its synopsis. All data is extracted from [The Movie Database API](https://www.themoviedb.org).
This project was created in 6 hours on December 2013 as part of an assignment for an interview.
# Installation
Install npm dependencies by typing the following in a terminal:
```
$ npm install
```
Compile and build the application:
1) Create a TMDB account and generate a new API Key. More information can be
found in [here](http://docs.themoviedb.apiary.io/)
2) Open `js/tvshows.js` and modify the `api_key` variable.
````js
var api_key = 'YOUR_API_KEY';
````
3) Execute the following commands in a terminal to build the application:
```
$ npm install
$ bower install
$ grunt
```
4) Open `build/index.html` with your preferred browser. | TV Shows Database
=========================
Single page app that allows the user to search for a TV show and display its synopsis. All data is extracted from [The Movie Database API](https://www.themoviedb.org).
This project was created in 6 hours on December 2013 as part of an assignment for an interview.
# Installation
Install npm dependencies by typing the following in a terminal:
```
$ npm install
```
Compile and build the application:
1) Create a TMDB account and generate a new API Key. More information can be
found in [here](http://docs.themoviedb.apiary.io/)
2) Open `js/tvshows.js` and modify the `api_key` variable.
````js
- var api_key = "YOUR_API_KEY";
? ^ ^
+ var api_key = 'YOUR_API_KEY';
? ^ ^
````
- 3) Execute the following command in a terminal to build the application:
+ 3) Execute the following commands in a terminal to build the application:
? +
```
+ $ npm install
+ $ bower install
$ grunt
```
+ 4) Open `build/index.html` with your preferred browser. | 7 | 0.233333 | 5 | 2 |
e96788053439afec712f5edf07f20fd46b7636ed | recipes/default.rb | recipes/default.rb | node.save
if node['drbd']['custom_repo'] != true
case node['platform']
when 'redhat', 'centos', 'fedora', 'amazon', 'scientific', 'oracle'
include_recipe 'yum-elrepo'
end
end
drbd_packages = value_for_platform_family(
%w(rhel fedora amazon scientific oracle) => %w(kmod-drbd84 drbd84-utils),
%w(default debian) => %w(drbd8-utils)
)
package drbd_packages
service 'drbd' do
supports(
restart: true,
status: true
)
action :nothing
end
| node.save
if node['drbd']['custom_repo'] != true
case node['platform']
when 'redhat', 'centos', 'fedora', 'amazon', 'scientific', 'oracle'
include_recipe 'yum-elrepo'
end
end
drbd_packages = value_for_platform_family(
%w(rhel fedora) => %w(kmod-drbd84 drbd84-utils),
%w(default debian) => %w(drbd8-utils)
)
package drbd_packages
service 'drbd' do
supports(
restart: true,
status: true
)
action :nothing
end
| Correct list of platform families | Correct list of platform families
RHEL includes oracle, scientific, and amazon
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
| Ruby | apache-2.0 | chef-cookbooks/drbd,opscode-cookbooks/drbd,opscode-cookbooks/drbd,chef-cookbooks/drbd | ruby | ## Code Before:
node.save
if node['drbd']['custom_repo'] != true
case node['platform']
when 'redhat', 'centos', 'fedora', 'amazon', 'scientific', 'oracle'
include_recipe 'yum-elrepo'
end
end
drbd_packages = value_for_platform_family(
%w(rhel fedora amazon scientific oracle) => %w(kmod-drbd84 drbd84-utils),
%w(default debian) => %w(drbd8-utils)
)
package drbd_packages
service 'drbd' do
supports(
restart: true,
status: true
)
action :nothing
end
## Instruction:
Correct list of platform families
RHEL includes oracle, scientific, and amazon
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
## Code After:
node.save
if node['drbd']['custom_repo'] != true
case node['platform']
when 'redhat', 'centos', 'fedora', 'amazon', 'scientific', 'oracle'
include_recipe 'yum-elrepo'
end
end
drbd_packages = value_for_platform_family(
%w(rhel fedora) => %w(kmod-drbd84 drbd84-utils),
%w(default debian) => %w(drbd8-utils)
)
package drbd_packages
service 'drbd' do
supports(
restart: true,
status: true
)
action :nothing
end
| node.save
if node['drbd']['custom_repo'] != true
case node['platform']
when 'redhat', 'centos', 'fedora', 'amazon', 'scientific', 'oracle'
include_recipe 'yum-elrepo'
end
end
drbd_packages = value_for_platform_family(
- %w(rhel fedora amazon scientific oracle) => %w(kmod-drbd84 drbd84-utils),
? -------------------------
+ %w(rhel fedora) => %w(kmod-drbd84 drbd84-utils),
%w(default debian) => %w(drbd8-utils)
)
package drbd_packages
service 'drbd' do
supports(
restart: true,
status: true
)
action :nothing
end | 2 | 0.086957 | 1 | 1 |
696be576cc277906b8f30895b74256c609467a51 | apps/common/tfn_lib/CMakeLists.txt | apps/common/tfn_lib/CMakeLists.txt |
CONFIGURE_OSPRAY()
OSPRAY_CREATE_LIBRARY(tfn tfn_lib.cpp LINK ospray_common)
OSPRAY_CREATE_APPLICATION(CvtParaViewTfcn
convertParaViewTfcn.cpp
jsoncpp.cpp
LINK
ospray_common
ospray_tfn
)
|
configure_ospray()
ospray_create_library(tfn tfn_lib.cpp LINK ospray_common)
option(OSPRAY_APPS_PARAVIEW_TFN_CVT
"Build ParaView to OSPRay viewer transfer function converter"
ON)
if (OSPRAY_APPS_PARAVIEW_TFN_CVT)
ospray_create_application(CvtParaViewTfcn
convertParaViewTfcn.cpp
jsoncpp.cpp
LINK
ospray_common
ospray_tfn
)
endif()
| Add CMake option to not build the ParaView transfer fcn converter | Add CMake option to not build the ParaView transfer fcn converter
| Text | apache-2.0 | ospray/OSPRay,wilsonCernWq/ospray,ospray/OSPRay,ospray/OSPRay,MengjiaoH/ospray,MengjiaoH/ospray,MengjiaoH/ospray,MengjiaoH/ospray,wilsonCernWq/ospray,ospray/OSPRay,MengjiaoH/ospray,wilsonCernWq/ospray | text | ## Code Before:
CONFIGURE_OSPRAY()
OSPRAY_CREATE_LIBRARY(tfn tfn_lib.cpp LINK ospray_common)
OSPRAY_CREATE_APPLICATION(CvtParaViewTfcn
convertParaViewTfcn.cpp
jsoncpp.cpp
LINK
ospray_common
ospray_tfn
)
## Instruction:
Add CMake option to not build the ParaView transfer fcn converter
## Code After:
configure_ospray()
ospray_create_library(tfn tfn_lib.cpp LINK ospray_common)
option(OSPRAY_APPS_PARAVIEW_TFN_CVT
"Build ParaView to OSPRay viewer transfer function converter"
ON)
if (OSPRAY_APPS_PARAVIEW_TFN_CVT)
ospray_create_application(CvtParaViewTfcn
convertParaViewTfcn.cpp
jsoncpp.cpp
LINK
ospray_common
ospray_tfn
)
endif()
|
- CONFIGURE_OSPRAY()
+ configure_ospray()
- OSPRAY_CREATE_LIBRARY(tfn tfn_lib.cpp LINK ospray_common)
+ ospray_create_library(tfn tfn_lib.cpp LINK ospray_common)
- OSPRAY_CREATE_APPLICATION(CvtParaViewTfcn
+ option(OSPRAY_APPS_PARAVIEW_TFN_CVT
+ "Build ParaView to OSPRay viewer transfer function converter"
+ ON)
+
+ if (OSPRAY_APPS_PARAVIEW_TFN_CVT)
+ ospray_create_application(CvtParaViewTfcn
- convertParaViewTfcn.cpp
+ convertParaViewTfcn.cpp
? ++
- jsoncpp.cpp
+ jsoncpp.cpp
? ++
- LINK
+ LINK
? ++
- ospray_common
+ ospray_common
? ++
- ospray_tfn
+ ospray_tfn
? ++
- )
+ )
+ endif()
+ | 25 | 2.083333 | 16 | 9 |
00c030b08f8a75def3ce83f85b8645f1707f7576 | plugins/community_track/views/blocks/_track_card.rhtml | plugins/community_track/views/blocks/_track_card.rhtml | <% extend CommunityTrackPlugin::TrackHelper %>
<div class="item_card <%= category_class(track_card) %>">
<a href="<%= url_for track_card.url %>">
<div class="track_content">
<div class="title">
<%= track_card.category_name %>
</div>
<div class="image">
<%= image_tag track_card.image.public_filename if track_card.image %>
</div>
<div class="name">
<%= track_card.name %>
</div>
<div class="lead">
<%= track_card_lead(track_card) %>
</div>
</div>
<div class="track_stats">
<div class="comments">
<%= "#{track_card.comments_count} comments" %>
</div>
<div class="hits">
<%= "#{track_card.hits} hits" %>
</div>
</div>
</a>
</div>
| <% extend CommunityTrackPlugin::TrackHelper %>
<div class="item_card <%= category_class(track_card) %>">
<a href="<%= url_for track_card.url %>">
<div class="track_content">
<div class="title">
<%= track_card.category_name %>
</div>
<div class="image">
<%= image_tag track_card.image.public_filename if track_card.image %>
</div>
<div class="name">
<%= track_card.name %>
</div>
<div class="lead">
<%= track_card_lead(track_card) %>
</div>
</div>
<div class="track_stats">
<div class="comments">
<span class="counter"><%= "#{track_card.comments_count}" %></span>
<span class="label"><%= _('comments') %></span>
</div>
<div class="hits">
<span class="counter"><%= "#{track_card.hits}" %></span>
<span class="label"><%= _('acessos') %></span>
</div>
</div>
</a>
</div>
| Fix layout for track card block | Fix layout for track card block
| RHTML | agpl-3.0 | evandrojr/noosfero,evandrojr/noosferogov,LuisBelo/tccnoosfero,abner/noosfero,evandrojr/noosferogov,evandrojr/noosferogov,blogoosfero/noosfero,marcosronaldo/noosfero,macartur/noosfero,vfcosta/noosfero,hackathon-oscs/cartografias,LuisBelo/tccnoosfero,hebertdougl/noosfero,hackathon-oscs/cartografias,samasti/noosfero,evandrojr/noosfero,larissa/noosfero,AlessandroCaetano/noosfero,abner/noosfero,hebertdougl/noosfero,alexandreab/noosfero,AlessandroCaetano/noosfero,uniteddiversity/noosfero,alexandreab/noosfero,coletivoEITA/noosfero,tallysmartins/noosfero,hackathon-oscs/rede-osc,CIRANDAS/noosfero-ecosol,AlessandroCaetano/noosfero,coletivoEITA/noosfero,AlessandroCaetano/noosfero,alexandreab/noosfero,macartur/noosfero,larissa/noosfero,samasti/noosfero,hebertdougl/noosfero,hackathon-oscs/cartografias,coletivoEITA/noosfero-ecosol,CIRANDAS/noosfero-ecosol,evandrojr/noosfero,larissa/noosfero,macartur/noosfero,alexandreab/noosfero,vfcosta/noosfero,AlessandroCaetano/noosfero,macartur/noosfero,arthurmde/noosfero,coletivoEITA/noosfero,hebertdougl/noosfero,hackathon-oscs/cartografias,larissa/noosfero,vfcosta/noosfero,arthurmde/noosfero,hackathon-oscs/rede-osc,coletivoEITA/noosfero-ecosol,uniteddiversity/noosfero,hackathon-oscs/rede-osc,uniteddiversity/noosfero,tallysmartins/noosfero,samasti/noosfero,LuisBelo/tccnoosfero,uniteddiversity/noosfero,evandrojr/noosferogov,evandrojr/noosfero,abner/noosfero,alexandreab/noosfero,coletivoEITA/noosfero,larissa/noosfero,evandrojr/noosfero,coletivoEITA/noosfero-ecosol,arthurmde/noosfero,hackathon-oscs/rede-osc,blogoosfero/noosfero,abner/noosfero,hackathon-oscs/rede-osc,macartur/noosfero,coletivoEITA/noosfero-ecosol,CIRANDAS/noosfero-ecosol,EcoAlternative/noosfero-ecosol,evandrojr/noosfero,tallysmartins/noosfero,vfcosta/noosfero,hebertdougl/noosfero,evandrojr/noosferogov,EcoAlternative/noosfero-ecosol,CIRANDAS/noosfero-ecosol,hackathon-oscs/cartografias,larissa/noosfero,abner/noosfero,arthurmde/noosfero,LuisBelo/tccnoosfero,uniteddiversity/noosfero,arthurmde/noosfero,alexandreab/noosfero,samasti/noosfero,tallysmartins/noosfero,arthurmde/noosfero,LuisBelo/tccnoosfero,hackathon-oscs/rede-osc,LuisBelo/tccnoosfero,coletivoEITA/noosfero,macartur/noosfero,marcosronaldo/noosfero,alexandreab/noosfero,coletivoEITA/noosfero-ecosol,blogoosfero/noosfero,marcosronaldo/noosfero,EcoAlternative/noosfero-ecosol,marcosronaldo/noosfero,EcoAlternative/noosfero-ecosol,uniteddiversity/noosfero,blogoosfero/noosfero,hebertdougl/noosfero,tallysmartins/noosfero,EcoAlternative/noosfero-ecosol,macartur/noosfero,evandrojr/noosferogov,EcoAlternative/noosfero-ecosol,evandrojr/noosferogov,CIRANDAS/noosfero-ecosol,tallysmartins/noosfero,evandrojr/noosfero,hackathon-oscs/cartografias,abner/noosfero,hackathon-oscs/cartografias,hackathon-oscs/rede-osc,hebertdougl/noosfero,coletivoEITA/noosfero,samasti/noosfero,AlessandroCaetano/noosfero,AlessandroCaetano/noosfero,blogoosfero/noosfero,marcosronaldo/noosfero,larissa/noosfero,vfcosta/noosfero,samasti/noosfero,tallysmartins/noosfero,blogoosfero/noosfero,marcosronaldo/noosfero,blogoosfero/noosfero,marcosronaldo/noosfero,EcoAlternative/noosfero-ecosol,coletivoEITA/noosfero,uniteddiversity/noosfero,abner/noosfero,vfcosta/noosfero,coletivoEITA/noosfero-ecosol,arthurmde/noosfero | rhtml | ## Code Before:
<% extend CommunityTrackPlugin::TrackHelper %>
<div class="item_card <%= category_class(track_card) %>">
<a href="<%= url_for track_card.url %>">
<div class="track_content">
<div class="title">
<%= track_card.category_name %>
</div>
<div class="image">
<%= image_tag track_card.image.public_filename if track_card.image %>
</div>
<div class="name">
<%= track_card.name %>
</div>
<div class="lead">
<%= track_card_lead(track_card) %>
</div>
</div>
<div class="track_stats">
<div class="comments">
<%= "#{track_card.comments_count} comments" %>
</div>
<div class="hits">
<%= "#{track_card.hits} hits" %>
</div>
</div>
</a>
</div>
## Instruction:
Fix layout for track card block
## Code After:
<% extend CommunityTrackPlugin::TrackHelper %>
<div class="item_card <%= category_class(track_card) %>">
<a href="<%= url_for track_card.url %>">
<div class="track_content">
<div class="title">
<%= track_card.category_name %>
</div>
<div class="image">
<%= image_tag track_card.image.public_filename if track_card.image %>
</div>
<div class="name">
<%= track_card.name %>
</div>
<div class="lead">
<%= track_card_lead(track_card) %>
</div>
</div>
<div class="track_stats">
<div class="comments">
<span class="counter"><%= "#{track_card.comments_count}" %></span>
<span class="label"><%= _('comments') %></span>
</div>
<div class="hits">
<span class="counter"><%= "#{track_card.hits}" %></span>
<span class="label"><%= _('acessos') %></span>
</div>
</div>
</a>
</div>
| <% extend CommunityTrackPlugin::TrackHelper %>
<div class="item_card <%= category_class(track_card) %>">
<a href="<%= url_for track_card.url %>">
<div class="track_content">
<div class="title">
<%= track_card.category_name %>
</div>
<div class="image">
<%= image_tag track_card.image.public_filename if track_card.image %>
</div>
<div class="name">
<%= track_card.name %>
</div>
<div class="lead">
<%= track_card_lead(track_card) %>
</div>
</div>
<div class="track_stats">
<div class="comments">
- <%= "#{track_card.comments_count} comments" %>
+ <span class="counter"><%= "#{track_card.comments_count}" %></span>
+ <span class="label"><%= _('comments') %></span>
</div>
<div class="hits">
- <%= "#{track_card.hits} hits" %>
+ <span class="counter"><%= "#{track_card.hits}" %></span>
+ <span class="label"><%= _('acessos') %></span>
</div>
</div>
</a>
</div> | 6 | 0.222222 | 4 | 2 |
b673a136ec2ade4feacd41a049834f9097bc13cf | src/links/_base.scss | src/links/_base.scss | /**
* @file Link
* @module Link
* @overview Link and top of page featured link modules
*/
.link--icon {
fill: currentColor;
}
| /**
* @file Link
* @module Link
* @overview Link and Link with Icon styles
*/
.link--icon {
fill: currentColor;
}
| Edit link overview comment to make sense | Edit link overview comment to make sense
| SCSS | mit | CasperSleep/nightshade-core,CasperSleep/nightshade-core | scss | ## Code Before:
/**
* @file Link
* @module Link
* @overview Link and top of page featured link modules
*/
.link--icon {
fill: currentColor;
}
## Instruction:
Edit link overview comment to make sense
## Code After:
/**
* @file Link
* @module Link
* @overview Link and Link with Icon styles
*/
.link--icon {
fill: currentColor;
}
| /**
* @file Link
* @module Link
- * @overview Link and top of page featured link modules
+ * @overview Link and Link with Icon styles
*/
.link--icon {
fill: currentColor;
} | 2 | 0.222222 | 1 | 1 |
7910ad9cb827d63ff7bdd41006a1558943e6832f | src/main/admin/vm/modules/R/R-3.3.2.bash | src/main/admin/vm/modules/R/R-3.3.2.bash |
curl -L http://$NIC_MIRROR/pub/sci/molbio/chipster/dist/tools_extras/R/R-3.3.2-vmbin/R-3.3.2_ubuntu-16.04_2016-11-28.tar.gz | tar -xz -C ${TOOLS_PATH}/
| curl -L http://$NIC_MIRROR/pub/sci/molbio/chipster/dist/tools_extras/R/R-3.3.2-vmbin/R-3.3.2_ubuntu-16.04_2017-06-16.tar.lz4 | lz4 -d | tar -x -C ${TOOLS_PATH}/
| Install the latest R containing Seurat | Install the latest R containing Seurat | Shell | mit | chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools | shell | ## Code Before:
curl -L http://$NIC_MIRROR/pub/sci/molbio/chipster/dist/tools_extras/R/R-3.3.2-vmbin/R-3.3.2_ubuntu-16.04_2016-11-28.tar.gz | tar -xz -C ${TOOLS_PATH}/
## Instruction:
Install the latest R containing Seurat
## Code After:
curl -L http://$NIC_MIRROR/pub/sci/molbio/chipster/dist/tools_extras/R/R-3.3.2-vmbin/R-3.3.2_ubuntu-16.04_2017-06-16.tar.lz4 | lz4 -d | tar -x -C ${TOOLS_PATH}/
| -
- curl -L http://$NIC_MIRROR/pub/sci/molbio/chipster/dist/tools_extras/R/R-3.3.2-vmbin/R-3.3.2_ubuntu-16.04_2016-11-28.tar.gz | tar -xz -C ${TOOLS_PATH}/
? ^^^^ ^ -
+ curl -L http://$NIC_MIRROR/pub/sci/molbio/chipster/dist/tools_extras/R/R-3.3.2-vmbin/R-3.3.2_ubuntu-16.04_2017-06-16.tar.lz4 | lz4 -d | tar -x -C ${TOOLS_PATH}/
? +++ ^ ^ ++++++++++
| 3 | 1.5 | 1 | 2 |
af59d696dbfbb88e08c9feabef5544325e4acae4 | src/main/java/mcjty/rftools/blocks/screens/modules/ScreenModuleHelper.java | src/main/java/mcjty/rftools/blocks/screens/modules/ScreenModuleHelper.java | package mcjty.rftools.blocks.screens.modules;
public class ScreenModuleHelper {
private boolean showdiff = false;
private long prevMillis = 0;
private long prevContents = 0;
public Object[] getContentsValue(long millis, long contents, long maxContents) {
if (showdiff) {
if (prevMillis == 0 || millis <= prevMillis) {
prevMillis = millis;
prevContents = contents;
return new Object[] { contents, maxContents, 0L };
} else {
long diff = millis - prevMillis;
int ticks = (int) (diff * 20 / 1000);
if (ticks == 0) {
ticks = 1;
}
long diffEnergy = contents - prevContents;
prevMillis = millis;
prevContents = contents;
return new Object[] { contents, maxContents, diffEnergy / ticks };
}
} else {
return new Object[] { contents, maxContents, 0L };
}
}
public void setShowdiff(boolean showdiff) {
this.showdiff = showdiff;
}
}
| package mcjty.rftools.blocks.screens.modules;
public class ScreenModuleHelper {
private boolean showdiff = false;
private long prevMillis = 0;
private long prevContents = 0;
private long lastPerTick = 0;
public Object[] getContentsValue(long millis, long contents, long maxContents) {
if (showdiff) {
if (prevMillis == 0 || millis <= prevMillis + 100) { // <= prevMillis + 100 to make sure we show last value if the timing is too short
prevMillis = millis;
prevContents = contents;
return new Object[] { contents, maxContents, lastPerTick };
} else {
long diff = millis - prevMillis;
int ticks = (int) (diff * 20 / 1000);
if (ticks == 0) {
ticks = 1;
}
long diffEnergy = contents - prevContents;
prevMillis = millis;
prevContents = contents;
lastPerTick = diffEnergy / ticks;
return new Object[] { contents, maxContents, lastPerTick };
}
} else {
return new Object[] { contents, maxContents, 0L };
}
}
public void setShowdiff(boolean showdiff) {
this.showdiff = showdiff;
}
}
| Fix a bug where multiple people looking at the same RF/t energy module in a screen would not see the same thing. | Fix a bug where multiple people looking at the same RF/t energy module in a screen would not see the same thing.
| Java | mit | Elecs-Mods/RFTools,ReneMuetti/RFTools,McJty/RFTools | java | ## Code Before:
package mcjty.rftools.blocks.screens.modules;
public class ScreenModuleHelper {
private boolean showdiff = false;
private long prevMillis = 0;
private long prevContents = 0;
public Object[] getContentsValue(long millis, long contents, long maxContents) {
if (showdiff) {
if (prevMillis == 0 || millis <= prevMillis) {
prevMillis = millis;
prevContents = contents;
return new Object[] { contents, maxContents, 0L };
} else {
long diff = millis - prevMillis;
int ticks = (int) (diff * 20 / 1000);
if (ticks == 0) {
ticks = 1;
}
long diffEnergy = contents - prevContents;
prevMillis = millis;
prevContents = contents;
return new Object[] { contents, maxContents, diffEnergy / ticks };
}
} else {
return new Object[] { contents, maxContents, 0L };
}
}
public void setShowdiff(boolean showdiff) {
this.showdiff = showdiff;
}
}
## Instruction:
Fix a bug where multiple people looking at the same RF/t energy module in a screen would not see the same thing.
## Code After:
package mcjty.rftools.blocks.screens.modules;
public class ScreenModuleHelper {
private boolean showdiff = false;
private long prevMillis = 0;
private long prevContents = 0;
private long lastPerTick = 0;
public Object[] getContentsValue(long millis, long contents, long maxContents) {
if (showdiff) {
if (prevMillis == 0 || millis <= prevMillis + 100) { // <= prevMillis + 100 to make sure we show last value if the timing is too short
prevMillis = millis;
prevContents = contents;
return new Object[] { contents, maxContents, lastPerTick };
} else {
long diff = millis - prevMillis;
int ticks = (int) (diff * 20 / 1000);
if (ticks == 0) {
ticks = 1;
}
long diffEnergy = contents - prevContents;
prevMillis = millis;
prevContents = contents;
lastPerTick = diffEnergy / ticks;
return new Object[] { contents, maxContents, lastPerTick };
}
} else {
return new Object[] { contents, maxContents, 0L };
}
}
public void setShowdiff(boolean showdiff) {
this.showdiff = showdiff;
}
}
| package mcjty.rftools.blocks.screens.modules;
public class ScreenModuleHelper {
private boolean showdiff = false;
private long prevMillis = 0;
private long prevContents = 0;
+ private long lastPerTick = 0;
public Object[] getContentsValue(long millis, long contents, long maxContents) {
if (showdiff) {
- if (prevMillis == 0 || millis <= prevMillis) {
+ if (prevMillis == 0 || millis <= prevMillis + 100) { // <= prevMillis + 100 to make sure we show last value if the timing is too short
prevMillis = millis;
prevContents = contents;
- return new Object[] { contents, maxContents, 0L };
? ^^
+ return new Object[] { contents, maxContents, lastPerTick };
? ^^^^^^^^^^^
} else {
long diff = millis - prevMillis;
int ticks = (int) (diff * 20 / 1000);
if (ticks == 0) {
ticks = 1;
}
long diffEnergy = contents - prevContents;
prevMillis = millis;
prevContents = contents;
+ lastPerTick = diffEnergy / ticks;
- return new Object[] { contents, maxContents, diffEnergy / ticks };
? ^^^^^^ ^^^^^^ -
+ return new Object[] { contents, maxContents, lastPerTick };
? ^^^^^ ^
}
} else {
return new Object[] { contents, maxContents, 0L };
}
}
public void setShowdiff(boolean showdiff) {
this.showdiff = showdiff;
}
} | 8 | 0.242424 | 5 | 3 |
999828bf3be442c46d10114fca3489fa07cfced6 | src/main/resources/assets/steamagerevolution/patchouli_books/guide/en_us/categories/utilities_category.json | src/main/resources/assets/steamagerevolution/patchouli_books/guide/en_us/categories/utilities_category.json | {
"name": "Utilities",
"description": "Various bits and bobs that don't fit in the other categories",
"icon": "steamagerevolution:steam_vent"
}
| {
"name": "Utilities",
"description": "Various bits and bobs that don't fit in the other categories",
"icon": "steamagerevolution:steam_vent",
"sortnum": 10
}
| Move utilties category to the end | Move utilties category to the end
| JSON | mit | BrassGoggledCoders/SteamAgeRevolution | json | ## Code Before:
{
"name": "Utilities",
"description": "Various bits and bobs that don't fit in the other categories",
"icon": "steamagerevolution:steam_vent"
}
## Instruction:
Move utilties category to the end
## Code After:
{
"name": "Utilities",
"description": "Various bits and bobs that don't fit in the other categories",
"icon": "steamagerevolution:steam_vent",
"sortnum": 10
}
| {
"name": "Utilities",
"description": "Various bits and bobs that don't fit in the other categories",
- "icon": "steamagerevolution:steam_vent"
+ "icon": "steamagerevolution:steam_vent",
? +
+ "sortnum": 10
} | 3 | 0.6 | 2 | 1 |
af34d335e9c7da45cb7931c452b3acc4ea7bb143 | RELEASE_NOTES.md | RELEASE_NOTES.md | 0.3
- Support bind(ObjectType).toXXX
0.2
- Add lifecycle manageer
- Reorganize Session, Design classes
- Test coverage improvement
- Depreacted Design.build[X]. Use Design.newSession.build[X]
0.1
- Migrated from wvlet-inject
| 0.4
- Improved binding performance
- Fix FIFO lifecycle hook executor
- Improved injection logging
0.3
- Support bind(ObjectType).toXXX
0.2
- Add lifecycle manageer
- Reorganize Session, Design classes
- Test coverage improvement
- Depreacted Design.build[X]. Use Design.newSession.build[X]
0.1
- Migrated from wvlet-inject
| Add release notes for 0.4 | Add release notes for 0.4
| Markdown | apache-2.0 | wvlet/airframe,wvlet/airframe,wvlet/airframe,wvlet/airframe,wvlet/airframe | markdown | ## Code Before:
0.3
- Support bind(ObjectType).toXXX
0.2
- Add lifecycle manageer
- Reorganize Session, Design classes
- Test coverage improvement
- Depreacted Design.build[X]. Use Design.newSession.build[X]
0.1
- Migrated from wvlet-inject
## Instruction:
Add release notes for 0.4
## Code After:
0.4
- Improved binding performance
- Fix FIFO lifecycle hook executor
- Improved injection logging
0.3
- Support bind(ObjectType).toXXX
0.2
- Add lifecycle manageer
- Reorganize Session, Design classes
- Test coverage improvement
- Depreacted Design.build[X]. Use Design.newSession.build[X]
0.1
- Migrated from wvlet-inject
| + 0.4
+ - Improved binding performance
+ - Fix FIFO lifecycle hook executor
+ - Improved injection logging
+
0.3
- Support bind(ObjectType).toXXX
0.2
- Add lifecycle manageer
- Reorganize Session, Design classes
- Test coverage improvement
- Depreacted Design.build[X]. Use Design.newSession.build[X]
0.1
- Migrated from wvlet-inject | 5 | 0.454545 | 5 | 0 |
460d686d4be59a3c544c65215feced227a582572 | README.md | README.md | GameofLife
==========
JavaScript implementation of Conway's "Game of Life". | GameofLife
==========
JavaScript implementation of Conway's "Game of Life".
[Demo](http://ismyrnow.github.io/GameofLife/) | Add demo link to readme | Add demo link to readme
| Markdown | mit | ismyrnow/GameofLife,ismyrnow/GameofLife | markdown | ## Code Before:
GameofLife
==========
JavaScript implementation of Conway's "Game of Life".
## Instruction:
Add demo link to readme
## Code After:
GameofLife
==========
JavaScript implementation of Conway's "Game of Life".
[Demo](http://ismyrnow.github.io/GameofLife/) | GameofLife
==========
JavaScript implementation of Conway's "Game of Life".
+
+ [Demo](http://ismyrnow.github.io/GameofLife/) | 2 | 0.5 | 2 | 0 |
1c3cd828e13af700e58fe3d06dbd58248b85187f | dash-auth/conf.php | dash-auth/conf.php | <?php
$conf = json_decode(file_get_contents("/etc/conf/local.conf"), 1);
define("DB_USER", $conf["mysql-user"]);
define("DB_HOST", $conf["host"]);
define("HOST", $conf["host"]);
define("DB_PASS", $conf["mysql-password"]);
define("DB_NAME", $conf["db-name"]);
//define("DB_USER", "mysqlUser");
//define("DB_HOST", "dev.xenonapps.com");
//define("DB_PASS", "1k23k4k55j");
//define("DB_NAME", "green_up_vt");
define("BASE_INCLUDE", dirname(__FILE__) );
?>
| <?php
$conf = json_decode(file_get_contents("/etc/conf/local.conf"), 1);
/* Fix for conf['host'] being an IP Address within a VirtualHost by Name setup
*/
$conf['host'] = $_SERVER['SERVER_NAME'];
define("DB_USER", $conf["mysql-user"]);
define("DB_HOST", $conf["host"]);
define("HOST", $conf["host"]);
define("DB_PASS", $conf["mysql-password"]);
define("DB_NAME", $conf["db-name"]);
//define("DB_USER", "mysqlUser");
//define("DB_HOST", "dev.xenonapps.com");
//define("DB_PASS", "1k23k4k55j");
//define("DB_NAME", "green_up_vt");
define("BASE_INCLUDE", dirname(__FILE__) );
?>
| Fix for Host IP in NamedVirtualHost setup | Fix for Host IP in NamedVirtualHost setup
The servers use an IP Address for the host in the configuration details,
but we're running a NamedVirtualHost setup, so we need to have a
resolution for the curl call done by the index.php during login.
Pulling ServerName as the authoritive configuration for host name.
| PHP | mit | EdgeCaseBerg/GreenUp,EdgeCaseBerg/GreenUp,EdgeCaseBerg/GreenUp,EdgeCaseBerg/GreenUp,EdgeCaseBerg/GreenUp,EdgeCaseBerg/GreenUp,EdgeCaseBerg/GreenUp | php | ## Code Before:
<?php
$conf = json_decode(file_get_contents("/etc/conf/local.conf"), 1);
define("DB_USER", $conf["mysql-user"]);
define("DB_HOST", $conf["host"]);
define("HOST", $conf["host"]);
define("DB_PASS", $conf["mysql-password"]);
define("DB_NAME", $conf["db-name"]);
//define("DB_USER", "mysqlUser");
//define("DB_HOST", "dev.xenonapps.com");
//define("DB_PASS", "1k23k4k55j");
//define("DB_NAME", "green_up_vt");
define("BASE_INCLUDE", dirname(__FILE__) );
?>
## Instruction:
Fix for Host IP in NamedVirtualHost setup
The servers use an IP Address for the host in the configuration details,
but we're running a NamedVirtualHost setup, so we need to have a
resolution for the curl call done by the index.php during login.
Pulling ServerName as the authoritive configuration for host name.
## Code After:
<?php
$conf = json_decode(file_get_contents("/etc/conf/local.conf"), 1);
/* Fix for conf['host'] being an IP Address within a VirtualHost by Name setup
*/
$conf['host'] = $_SERVER['SERVER_NAME'];
define("DB_USER", $conf["mysql-user"]);
define("DB_HOST", $conf["host"]);
define("HOST", $conf["host"]);
define("DB_PASS", $conf["mysql-password"]);
define("DB_NAME", $conf["db-name"]);
//define("DB_USER", "mysqlUser");
//define("DB_HOST", "dev.xenonapps.com");
//define("DB_PASS", "1k23k4k55j");
//define("DB_NAME", "green_up_vt");
define("BASE_INCLUDE", dirname(__FILE__) );
?>
| <?php
$conf = json_decode(file_get_contents("/etc/conf/local.conf"), 1);
+ /* Fix for conf['host'] being an IP Address within a VirtualHost by Name setup
+ */
+ $conf['host'] = $_SERVER['SERVER_NAME'];
define("DB_USER", $conf["mysql-user"]);
define("DB_HOST", $conf["host"]);
define("HOST", $conf["host"]);
define("DB_PASS", $conf["mysql-password"]);
define("DB_NAME", $conf["db-name"]);
//define("DB_USER", "mysqlUser");
//define("DB_HOST", "dev.xenonapps.com");
//define("DB_PASS", "1k23k4k55j");
//define("DB_NAME", "green_up_vt");
define("BASE_INCLUDE", dirname(__FILE__) );
?> | 3 | 0.214286 | 3 | 0 |
807265f341dcafbd22d26fdf683e9d90422c1cb8 | app/controllers/search_controller.rb | app/controllers/search_controller.rb |
class SearchController < ApplicationController
def index
permitted = params.require(:search).permit(:email)
raise ActionController::ParameterMissing if permitted.blank?
@matching_users = search_by_email(permitted[:email].strip)
@email_query = permitted[:email]
rescue ActionController::ParameterMissing
redirect_to_path(allies_path)
end
def posts
data_type = params[:search][:data_type]
term = params[:search][:name]
return unless data_type.in?(%w[moment category mood strategy medication])
redirect_to_path(make_path(term, data_type))
end
private
def search_by_email(email)
User.where(email: email).where.not(id: current_user.id, banned: true)
end
def make_path(term, data_type)
send("#{data_type.pluralize}_path", ({ search: term } if term.present?))
end
end
|
class SearchController < ApplicationController
def index
permitted = params.require(:search).permit(:email)
raise ActionController::ParameterMissing if permitted.blank?
@matching_users = search_by_email(permitted[:email].strip)
@email_query = permitted[:email]
rescue ActionController::ParameterMissing
redirect_to_path(allies_path)
end
def posts
data_type = params[:search][:data_type]
term = params[:search][:name]
return unless data_type.in?(%w[moment category mood strategy medication])
redirect_to_path(make_path(term, data_type))
end
private
def search_by_email(email)
User.where(email: email).where.not(id: current_user.id).where.not(banned: true)
end
def make_path(term, data_type)
send("#{data_type.pluralize}_path", ({ search: term } if term.present?))
end
end
| Fix deprecated NOR in where query | Fix deprecated NOR in where query
| Ruby | agpl-3.0 | julianguyen/ifme,julianguyen/ifme,julianguyen/ifme,julianguyen/ifme | ruby | ## Code Before:
class SearchController < ApplicationController
def index
permitted = params.require(:search).permit(:email)
raise ActionController::ParameterMissing if permitted.blank?
@matching_users = search_by_email(permitted[:email].strip)
@email_query = permitted[:email]
rescue ActionController::ParameterMissing
redirect_to_path(allies_path)
end
def posts
data_type = params[:search][:data_type]
term = params[:search][:name]
return unless data_type.in?(%w[moment category mood strategy medication])
redirect_to_path(make_path(term, data_type))
end
private
def search_by_email(email)
User.where(email: email).where.not(id: current_user.id, banned: true)
end
def make_path(term, data_type)
send("#{data_type.pluralize}_path", ({ search: term } if term.present?))
end
end
## Instruction:
Fix deprecated NOR in where query
## Code After:
class SearchController < ApplicationController
def index
permitted = params.require(:search).permit(:email)
raise ActionController::ParameterMissing if permitted.blank?
@matching_users = search_by_email(permitted[:email].strip)
@email_query = permitted[:email]
rescue ActionController::ParameterMissing
redirect_to_path(allies_path)
end
def posts
data_type = params[:search][:data_type]
term = params[:search][:name]
return unless data_type.in?(%w[moment category mood strategy medication])
redirect_to_path(make_path(term, data_type))
end
private
def search_by_email(email)
User.where(email: email).where.not(id: current_user.id).where.not(banned: true)
end
def make_path(term, data_type)
send("#{data_type.pluralize}_path", ({ search: term } if term.present?))
end
end
|
class SearchController < ApplicationController
def index
permitted = params.require(:search).permit(:email)
raise ActionController::ParameterMissing if permitted.blank?
@matching_users = search_by_email(permitted[:email].strip)
@email_query = permitted[:email]
rescue ActionController::ParameterMissing
redirect_to_path(allies_path)
end
def posts
data_type = params[:search][:data_type]
term = params[:search][:name]
return unless data_type.in?(%w[moment category mood strategy medication])
redirect_to_path(make_path(term, data_type))
end
private
def search_by_email(email)
- User.where(email: email).where.not(id: current_user.id, banned: true)
? ^^
+ User.where(email: email).where.not(id: current_user.id).where.not(banned: true)
? ^^^^^^^^^^^^
end
def make_path(term, data_type)
send("#{data_type.pluralize}_path", ({ search: term } if term.present?))
end
end | 2 | 0.064516 | 1 | 1 |
755582cad60b94261f3b6f79bd0be90225b6eb4d | README.md | README.md | [](https://waffle.io/gmacario/learning-arduino)
# learning-arduino
[](https://gitter.im/gmacario/learning-arduino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
My experiments and samples when learning how to best use [Arduino](http://arduino.cc/).
Copyright 2015, [Gianpaolo Macario](http://gmacario.github.io/)
|
[](https://gitter.im/gmacario/learning-arduino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://waffle.io/gmacario/learning-arduino)
My experiments and samples when learning how to best use [Arduino](http://arduino.cc/).
Copyright 2015, [Gianpaolo Macario](http://gmacario.github.io/)
| Align waffle.io badge with the other one | Align waffle.io badge with the other one
Signed-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>
| Markdown | mpl-2.0 | gmacario/learning-arduino | markdown | ## Code Before:
[](https://waffle.io/gmacario/learning-arduino)
# learning-arduino
[](https://gitter.im/gmacario/learning-arduino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
My experiments and samples when learning how to best use [Arduino](http://arduino.cc/).
Copyright 2015, [Gianpaolo Macario](http://gmacario.github.io/)
## Instruction:
Align waffle.io badge with the other one
Signed-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>
## Code After:
[](https://gitter.im/gmacario/learning-arduino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://waffle.io/gmacario/learning-arduino)
My experiments and samples when learning how to best use [Arduino](http://arduino.cc/).
Copyright 2015, [Gianpaolo Macario](http://gmacario.github.io/)
| - [](https://waffle.io/gmacario/learning-arduino)
- # learning-arduino
[](https://gitter.im/gmacario/learning-arduino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+ [](https://waffle.io/gmacario/learning-arduino)
My experiments and samples when learning how to best use [Arduino](http://arduino.cc/).
Copyright 2015, [Gianpaolo Macario](http://gmacario.github.io/) | 3 | 0.375 | 1 | 2 |
b7f35c7bc04bd936d7386fda2c95ac03b7879a64 | packages/am/amqp-utils.yaml | packages/am/amqp-utils.yaml | homepage: ''
changelog-type: markdown
hash: 7785a1ad17c4b912d48fcca19911ec8d20601b7b79f6cc83d744dbb294515bc7
test-bench-deps: {}
maintainer: fd@taz.de
synopsis: Generic Haskell AMQP Consumer
changelog: ! '# Revision history for haskell-amqp-utils
## 0.2.1.4 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
bytestring: -any
base: ! '>=4.6 && <5'
data-default-class: -any
time: -any
amqp: ! '>=0.15'
text: -any
tls: -any
process: -any
connection: -any
containers: -any
x509-system: -any
all-versions:
- '0.2.1.4'
author: Frank Doepper
latest: '0.2.1.4'
description-type: markdown
description: ! '# haskell-amqp-utils
generic Haskell AMQP consumer for use with RabbitMQ
'
license-name: GPL-3
| homepage: ''
changelog-type: markdown
hash: 3c02e20bfa5657adf3d159459dbb70b269cebc918e70e15afe91f0638846c9c7
test-bench-deps: {}
maintainer: fd@taz.de
synopsis: Generic Haskell AMQP Consumer
changelog: ! '# Revision history for haskell-amqp-utils
## 0.2.1.4 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
bytestring: -any
base: ! '>=4.6 && <5'
data-default-class: -any
time: -any
amqp: ! '>=0.17'
text: -any
tls: -any
process: -any
connection: -any
containers: -any
x509-system: -any
all-versions:
- '0.2.1.4'
- '0.2.1.5'
author: Frank Doepper
latest: '0.2.1.5'
description-type: markdown
description: ! '# haskell-amqp-utils
generic Haskell AMQP consumer for use with RabbitMQ
'
license-name: GPL-3
| Update from Hackage at 2017-09-25T17:50:49Z | Update from Hackage at 2017-09-25T17:50:49Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: markdown
hash: 7785a1ad17c4b912d48fcca19911ec8d20601b7b79f6cc83d744dbb294515bc7
test-bench-deps: {}
maintainer: fd@taz.de
synopsis: Generic Haskell AMQP Consumer
changelog: ! '# Revision history for haskell-amqp-utils
## 0.2.1.4 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
bytestring: -any
base: ! '>=4.6 && <5'
data-default-class: -any
time: -any
amqp: ! '>=0.15'
text: -any
tls: -any
process: -any
connection: -any
containers: -any
x509-system: -any
all-versions:
- '0.2.1.4'
author: Frank Doepper
latest: '0.2.1.4'
description-type: markdown
description: ! '# haskell-amqp-utils
generic Haskell AMQP consumer for use with RabbitMQ
'
license-name: GPL-3
## Instruction:
Update from Hackage at 2017-09-25T17:50:49Z
## Code After:
homepage: ''
changelog-type: markdown
hash: 3c02e20bfa5657adf3d159459dbb70b269cebc918e70e15afe91f0638846c9c7
test-bench-deps: {}
maintainer: fd@taz.de
synopsis: Generic Haskell AMQP Consumer
changelog: ! '# Revision history for haskell-amqp-utils
## 0.2.1.4 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
bytestring: -any
base: ! '>=4.6 && <5'
data-default-class: -any
time: -any
amqp: ! '>=0.17'
text: -any
tls: -any
process: -any
connection: -any
containers: -any
x509-system: -any
all-versions:
- '0.2.1.4'
- '0.2.1.5'
author: Frank Doepper
latest: '0.2.1.5'
description-type: markdown
description: ! '# haskell-amqp-utils
generic Haskell AMQP consumer for use with RabbitMQ
'
license-name: GPL-3
| homepage: ''
changelog-type: markdown
- hash: 7785a1ad17c4b912d48fcca19911ec8d20601b7b79f6cc83d744dbb294515bc7
+ hash: 3c02e20bfa5657adf3d159459dbb70b269cebc918e70e15afe91f0638846c9c7
test-bench-deps: {}
maintainer: fd@taz.de
synopsis: Generic Haskell AMQP Consumer
changelog: ! '# Revision history for haskell-amqp-utils
## 0.2.1.4 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
bytestring: -any
base: ! '>=4.6 && <5'
data-default-class: -any
time: -any
- amqp: ! '>=0.15'
? ^
+ amqp: ! '>=0.17'
? ^
text: -any
tls: -any
process: -any
connection: -any
containers: -any
x509-system: -any
all-versions:
- '0.2.1.4'
+ - '0.2.1.5'
author: Frank Doepper
- latest: '0.2.1.4'
? ^
+ latest: '0.2.1.5'
? ^
description-type: markdown
description: ! '# haskell-amqp-utils
generic Haskell AMQP consumer for use with RabbitMQ
'
license-name: GPL-3 | 7 | 0.184211 | 4 | 3 |
1dd681517fd1831f3990caa043ea8220f5d1bb90 | app/app.py | app/app.py | import os,time,asyncio,json
from datetime import datetime
from aiohttp import web
import logging;logging.basicConfig(level=logging.INFO)
from tools.log import Log
from tools.httptools import Middleware,Route
from tools.template import Template
from models import *
from tools.config import Config
@Route.get('/')
def index():
user=yield from User.findall()
print(user)
return Template.render('index.html')
@Route.get('/user/{id}/comment/{comment}')
def user(id,comment):
return '<h1>%s,%s</h1>'%(id,comment)
@asyncio.coroutine
def init(loop):
print(Middleware.allmiddlewares())
app=web.Application(loop=loop,middlewares=Middleware.allmiddlewares())
Template(app)
Route.register_route(app)
pool=yield from create_pool(loop)
srv=yield from loop.create_server(app.make_handler(),'127.0.0.1',8000)
logging.info('server started at http://127.0.0.1:8000')
Log.info("server startd at http://127.0.0.1:8000")
return srv
if __name__=="__main__":
loop=asyncio.get_event_loop()
loop.run_until_complete(init(loop))
loop.run_forever()
| import os,time,asyncio,json
from datetime import datetime
from aiohttp import web
import logging;logging.basicConfig(level=logging.INFO)
from tools.log import Log
from tools.httptools import Middleware,Route
from tools.template import Template
from models import *
from tools.config import Config
@Route.get('/')
def index():
user=yield from User.findall()
print(user)
return Template('index.html').render()
@Route.get('/user/{id}/comment/{comment}')
def user(id,comment):
return '<h1>%s,%s</h1>'%(id,comment)
@asyncio.coroutine
def init(loop):
print(Middleware.allmiddlewares())
app=web.Application(loop=loop,middlewares=Middleware.allmiddlewares())
Template.init(app)
Route.register_route(app)
pool=yield from create_pool(loop)
srv=yield from loop.create_server(app.make_handler(),'127.0.0.1',8000)
logging.info('server started at http://127.0.0.1:8000')
Log.info("server startd at http://127.0.0.1:8000")
return srv
if __name__=="__main__":
loop=asyncio.get_event_loop()
loop.run_until_complete(init(loop))
loop.run_forever()
| Change Template() to Template.init() in init function | Change Template() to Template.init() in init function
| Python | mit | free-free/pyblog,free-free/pyblog,free-free/pyblog,free-free/pyblog | python | ## Code Before:
import os,time,asyncio,json
from datetime import datetime
from aiohttp import web
import logging;logging.basicConfig(level=logging.INFO)
from tools.log import Log
from tools.httptools import Middleware,Route
from tools.template import Template
from models import *
from tools.config import Config
@Route.get('/')
def index():
user=yield from User.findall()
print(user)
return Template.render('index.html')
@Route.get('/user/{id}/comment/{comment}')
def user(id,comment):
return '<h1>%s,%s</h1>'%(id,comment)
@asyncio.coroutine
def init(loop):
print(Middleware.allmiddlewares())
app=web.Application(loop=loop,middlewares=Middleware.allmiddlewares())
Template(app)
Route.register_route(app)
pool=yield from create_pool(loop)
srv=yield from loop.create_server(app.make_handler(),'127.0.0.1',8000)
logging.info('server started at http://127.0.0.1:8000')
Log.info("server startd at http://127.0.0.1:8000")
return srv
if __name__=="__main__":
loop=asyncio.get_event_loop()
loop.run_until_complete(init(loop))
loop.run_forever()
## Instruction:
Change Template() to Template.init() in init function
## Code After:
import os,time,asyncio,json
from datetime import datetime
from aiohttp import web
import logging;logging.basicConfig(level=logging.INFO)
from tools.log import Log
from tools.httptools import Middleware,Route
from tools.template import Template
from models import *
from tools.config import Config
@Route.get('/')
def index():
user=yield from User.findall()
print(user)
return Template('index.html').render()
@Route.get('/user/{id}/comment/{comment}')
def user(id,comment):
return '<h1>%s,%s</h1>'%(id,comment)
@asyncio.coroutine
def init(loop):
print(Middleware.allmiddlewares())
app=web.Application(loop=loop,middlewares=Middleware.allmiddlewares())
Template.init(app)
Route.register_route(app)
pool=yield from create_pool(loop)
srv=yield from loop.create_server(app.make_handler(),'127.0.0.1',8000)
logging.info('server started at http://127.0.0.1:8000')
Log.info("server startd at http://127.0.0.1:8000")
return srv
if __name__=="__main__":
loop=asyncio.get_event_loop()
loop.run_until_complete(init(loop))
loop.run_forever()
| import os,time,asyncio,json
from datetime import datetime
from aiohttp import web
import logging;logging.basicConfig(level=logging.INFO)
from tools.log import Log
from tools.httptools import Middleware,Route
from tools.template import Template
from models import *
from tools.config import Config
@Route.get('/')
def index():
user=yield from User.findall()
print(user)
- return Template.render('index.html')
? -------
+ return Template('index.html').render()
? +++++++++
@Route.get('/user/{id}/comment/{comment}')
def user(id,comment):
return '<h1>%s,%s</h1>'%(id,comment)
@asyncio.coroutine
def init(loop):
print(Middleware.allmiddlewares())
app=web.Application(loop=loop,middlewares=Middleware.allmiddlewares())
- Template(app)
+ Template.init(app)
? +++++
Route.register_route(app)
pool=yield from create_pool(loop)
srv=yield from loop.create_server(app.make_handler(),'127.0.0.1',8000)
logging.info('server started at http://127.0.0.1:8000')
Log.info("server startd at http://127.0.0.1:8000")
return srv
if __name__=="__main__":
loop=asyncio.get_event_loop()
loop.run_until_complete(init(loop))
loop.run_forever()
| 4 | 0.111111 | 2 | 2 |
6301c4adb037e1cdb4efde17cd1c2961b608b9a3 | src/main/scala/io/flow/lint/Main.scala | src/main/scala/io/flow/lint/Main.scala | package io.flow.lint
object Main extends App {
private[this] val linter = Lint()
Downloader.withClient { dl =>
import scala.concurrent.ExecutionContext.Implicits.global
args.foreach { name =>
val (organization, application, version) = name.split("/").map(_.trim).toList match {
case org :: app :: Nil => (org, app, "latest")
case org :: app :: version :: Nil => (org, app, version)
case _ => {
sys.error(s"Invalid name[$name] - expected organization/application (e.g. flow/user)")
}
}
println("")
println(s"$name")
print(s" Downloading...")
dl.service(organization, application, version) match {
case Left(error) => {
println("\n ** ERROR: " + error)
}
case Right(service) => {
print(" Done\n Starting Linter... ")
linter.validate(service) match {
case Nil => println("\n Valid!")
case errors => {
println(" 1 or more errors found:")
errors.foreach { error =>
println(s" - $error")
}
}
}
}
}
}
}
}
| package io.flow.lint
object Main extends App {
private[this] val linter = Lint()
Downloader.withClient { dl =>
import scala.concurrent.ExecutionContext.Implicits.global
args.foreach { name =>
val (organization, application, version) = name.split("/").map(_.trim).toList match {
case org :: app :: Nil => (org, app, "latest")
case org :: app :: version :: Nil => (org, app, version)
case _ => {
sys.error(s"Invalid name[$name] - expected organization/application (e.g. flow/user)")
}
}
println("")
println(s"$name")
print(s" Downloading...")
dl.service(organization, application, version) match {
case Left(error) => {
println("\n ** ERROR: " + error)
}
case Right(service) => {
print(" Done\n Starting Linter... ")
linter.validate(service) match {
case Nil => println("\n Valid!")
case errors => {
errors.size match {
case 1 => println(" 1 error:")
case n => println(s" $n errors:")
}
errors.sorted.foreach { error =>
println(s" - $error")
}
}
}
}
}
}
}
}
| Improve grammar of output to user | Improve grammar of output to user
| Scala | mit | flowcommerce/api-build,flowcommerce/api-lint,flowcommerce/api-build | scala | ## Code Before:
package io.flow.lint
object Main extends App {
private[this] val linter = Lint()
Downloader.withClient { dl =>
import scala.concurrent.ExecutionContext.Implicits.global
args.foreach { name =>
val (organization, application, version) = name.split("/").map(_.trim).toList match {
case org :: app :: Nil => (org, app, "latest")
case org :: app :: version :: Nil => (org, app, version)
case _ => {
sys.error(s"Invalid name[$name] - expected organization/application (e.g. flow/user)")
}
}
println("")
println(s"$name")
print(s" Downloading...")
dl.service(organization, application, version) match {
case Left(error) => {
println("\n ** ERROR: " + error)
}
case Right(service) => {
print(" Done\n Starting Linter... ")
linter.validate(service) match {
case Nil => println("\n Valid!")
case errors => {
println(" 1 or more errors found:")
errors.foreach { error =>
println(s" - $error")
}
}
}
}
}
}
}
}
## Instruction:
Improve grammar of output to user
## Code After:
package io.flow.lint
object Main extends App {
private[this] val linter = Lint()
Downloader.withClient { dl =>
import scala.concurrent.ExecutionContext.Implicits.global
args.foreach { name =>
val (organization, application, version) = name.split("/").map(_.trim).toList match {
case org :: app :: Nil => (org, app, "latest")
case org :: app :: version :: Nil => (org, app, version)
case _ => {
sys.error(s"Invalid name[$name] - expected organization/application (e.g. flow/user)")
}
}
println("")
println(s"$name")
print(s" Downloading...")
dl.service(organization, application, version) match {
case Left(error) => {
println("\n ** ERROR: " + error)
}
case Right(service) => {
print(" Done\n Starting Linter... ")
linter.validate(service) match {
case Nil => println("\n Valid!")
case errors => {
errors.size match {
case 1 => println(" 1 error:")
case n => println(s" $n errors:")
}
errors.sorted.foreach { error =>
println(s" - $error")
}
}
}
}
}
}
}
}
| package io.flow.lint
object Main extends App {
private[this] val linter = Lint()
Downloader.withClient { dl =>
import scala.concurrent.ExecutionContext.Implicits.global
args.foreach { name =>
val (organization, application, version) = name.split("/").map(_.trim).toList match {
case org :: app :: Nil => (org, app, "latest")
case org :: app :: version :: Nil => (org, app, version)
case _ => {
sys.error(s"Invalid name[$name] - expected organization/application (e.g. flow/user)")
}
}
println("")
println(s"$name")
print(s" Downloading...")
dl.service(organization, application, version) match {
case Left(error) => {
println("\n ** ERROR: " + error)
}
case Right(service) => {
print(" Done\n Starting Linter... ")
linter.validate(service) match {
case Nil => println("\n Valid!")
case errors => {
- println(" 1 or more errors found:")
+ errors.size match {
+ case 1 => println(" 1 error:")
+ case n => println(s" $n errors:")
+ }
- errors.foreach { error =>
+ errors.sorted.foreach { error =>
? +++++++
println(s" - $error")
}
}
}
}
}
}
}
} | 7 | 0.162791 | 5 | 2 |
438e897eb9e1d9dd8e9eeffed36a9a636ce752d2 | cmd/migrate_cmd.go | cmd/migrate_cmd.go | package cmd
import (
"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/spf13/cobra"
)
var migrateCmd = cobra.Command{
Use: "migrate",
Long: "Migrate database strucutures. This will create new tables and add missing collumns and indexes.",
Run: func(cmd *cobra.Command, args []string) {
execWithConfig(cmd, migrate)
},
}
func migrate(config *conf.Configuration) {
db, err := models.Connect(config)
if err != nil {
logrus.Fatalf("Error opening database: %+v", err)
}
db.AutoMigrate(models.RefreshToken{})
db.AutoMigrate(models.User{})
}
| package cmd
import (
"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/spf13/cobra"
)
var migrateCmd = cobra.Command{
Use: "migrate",
Long: "Migrate database strucutures. This will create new tables and add missing collumns and indexes.",
Run: func(cmd *cobra.Command, args []string) {
execWithConfig(cmd, migrate)
},
}
func migrate(config *conf.Configuration) {
db, err := models.Connect(config)
if err != nil {
logrus.Fatalf("Error opening database: %+v", err)
}
db.AutoMigrate(models.RefreshToken{})
db.AutoMigrate(models.User{})
db.AutoMigrate(models.Data{})
}
| Add Data model to the migrate command. | Add Data model to the migrate command.
Signed-off-by: David Calavera <b9b0c8e7f90ecf337f6797c4d2e0f1dd0dbc0324@gmail.com>
| Go | mit | netlify/gotrue,netlify/gotrue | go | ## Code Before:
package cmd
import (
"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/spf13/cobra"
)
var migrateCmd = cobra.Command{
Use: "migrate",
Long: "Migrate database strucutures. This will create new tables and add missing collumns and indexes.",
Run: func(cmd *cobra.Command, args []string) {
execWithConfig(cmd, migrate)
},
}
func migrate(config *conf.Configuration) {
db, err := models.Connect(config)
if err != nil {
logrus.Fatalf("Error opening database: %+v", err)
}
db.AutoMigrate(models.RefreshToken{})
db.AutoMigrate(models.User{})
}
## Instruction:
Add Data model to the migrate command.
Signed-off-by: David Calavera <b9b0c8e7f90ecf337f6797c4d2e0f1dd0dbc0324@gmail.com>
## Code After:
package cmd
import (
"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/spf13/cobra"
)
var migrateCmd = cobra.Command{
Use: "migrate",
Long: "Migrate database strucutures. This will create new tables and add missing collumns and indexes.",
Run: func(cmd *cobra.Command, args []string) {
execWithConfig(cmd, migrate)
},
}
func migrate(config *conf.Configuration) {
db, err := models.Connect(config)
if err != nil {
logrus.Fatalf("Error opening database: %+v", err)
}
db.AutoMigrate(models.RefreshToken{})
db.AutoMigrate(models.User{})
db.AutoMigrate(models.Data{})
}
| package cmd
import (
"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/spf13/cobra"
)
var migrateCmd = cobra.Command{
Use: "migrate",
Long: "Migrate database strucutures. This will create new tables and add missing collumns and indexes.",
Run: func(cmd *cobra.Command, args []string) {
execWithConfig(cmd, migrate)
},
}
func migrate(config *conf.Configuration) {
db, err := models.Connect(config)
if err != nil {
logrus.Fatalf("Error opening database: %+v", err)
}
db.AutoMigrate(models.RefreshToken{})
db.AutoMigrate(models.User{})
+ db.AutoMigrate(models.Data{})
} | 1 | 0.038462 | 1 | 0 |
e29eaa10277cf1514dd579973bc72c1182ca3122 | src/components/Treeview/Treeview.scss | src/components/Treeview/Treeview.scss | @import '../../index.scss';
.treeview {
@include baseFont();
font-size: $font-size-m;
margin-left: 19px;
.collapsed {
display: none;
}
.expanded {
display: block;
margin-left: 30px;
}
.treeview-item {
cursor: pointer;
display: flex;
align-items: center;
}
.treeveiw-content{
padding: 2px;
}
.treeveiw-content:hover{
background-color: #eaeaea;
}
.treeveiw-parent-item{
margin-left: -19px;
}
.partial-selected{
label:before{
content: '\025FC';
color: #b9cb34;
font-size: 20px;
}
}
} | @import '../../index.scss';
.treeview {
@include baseFont();
font-size: $font-size-m;
margin-left: 19px;
.collapsed {
display: none;
}
.expanded {
display: block;
margin-left: 30px;
}
.treeview-item {
cursor: pointer;
display: flex;
align-items: center;
}
.treeveiw-content{
padding: 2px;
}
.treeveiw-content:hover {
background-color: $primary-hover-color;
}
.treeveiw-parent-item {
margin-left: -19px;
}
.partial-selected {
label:after {
content: '\025FC';
color: #b9cb34;
font-size: 20px;
position: absolute;
left: 1px;
top: -1px;
}
}
} | Fix css for partial selected parent checkbox | Fix css for partial selected parent checkbox
| SCSS | mit | SysKitTeam/quick-react.ts,SysKitTeam/quick-react.ts,Acceleratio/quick-react.ts,Acceleratio/quick-react.ts | scss | ## Code Before:
@import '../../index.scss';
.treeview {
@include baseFont();
font-size: $font-size-m;
margin-left: 19px;
.collapsed {
display: none;
}
.expanded {
display: block;
margin-left: 30px;
}
.treeview-item {
cursor: pointer;
display: flex;
align-items: center;
}
.treeveiw-content{
padding: 2px;
}
.treeveiw-content:hover{
background-color: #eaeaea;
}
.treeveiw-parent-item{
margin-left: -19px;
}
.partial-selected{
label:before{
content: '\025FC';
color: #b9cb34;
font-size: 20px;
}
}
}
## Instruction:
Fix css for partial selected parent checkbox
## Code After:
@import '../../index.scss';
.treeview {
@include baseFont();
font-size: $font-size-m;
margin-left: 19px;
.collapsed {
display: none;
}
.expanded {
display: block;
margin-left: 30px;
}
.treeview-item {
cursor: pointer;
display: flex;
align-items: center;
}
.treeveiw-content{
padding: 2px;
}
.treeveiw-content:hover {
background-color: $primary-hover-color;
}
.treeveiw-parent-item {
margin-left: -19px;
}
.partial-selected {
label:after {
content: '\025FC';
color: #b9cb34;
font-size: 20px;
position: absolute;
left: 1px;
top: -1px;
}
}
} | @import '../../index.scss';
.treeview {
@include baseFont();
font-size: $font-size-m;
margin-left: 19px;
+
.collapsed {
display: none;
}
.expanded {
display: block;
margin-left: 30px;
}
.treeview-item {
cursor: pointer;
display: flex;
align-items: center;
}
+
.treeveiw-content{
padding: 2px;
}
+
- .treeveiw-content:hover{
+ .treeveiw-content:hover {
? +
- background-color: #eaeaea;
+ background-color: $primary-hover-color;
}
- .treeveiw-parent-item{
+ .treeveiw-parent-item {
? +
margin-left: -19px;
}
+
- .partial-selected{
+ .partial-selected {
? +
- label:before{
? ^ -- ^
+ label:after {
? ^^^ ^
content: '\025FC';
color: #b9cb34;
font-size: 20px;
+ position: absolute;
+ left: 1px;
+ top: -1px;
}
}
} | 17 | 0.459459 | 12 | 5 |
cf9ad110bc8db4ca74edf3f0b5ed23b89b604247 | test-samples/decLiterals.ceylon | test-samples/decLiterals.ceylon | void decLiterals() {
value clM = `module ceylon.language`;
value clP = `package ceylon.language`;
value stringC = `class String`;
value iterableI = `interface Iterable`;
value aliasA = `alias Alias`;
value givenG = `given Given`;
value nullV = `value null`;
value identityF = `function identity`;
value newN = `new Constructor`;
value currentM = `module`;
value currentP = `package`;
value currentC = `class`;
value currentI = `interface`;
}
| void decLiterals() {
value clM = `module ceylon.language`;
value clP = `package ceylon.language`;
value stringC = `class String`;
value iterableI = `interface Iterable`;
value aliasA = `alias Alias`;
value givenG = `given Given`;
value nullV = `value null`;
value identityF = `function identity`;
value newN = `new Constructor`;
value currentM = `module`;
value currentP = `package`;
value currentC = `class`;
value currentI = `interface`;
}
void decLiteralsWithoutBackticks() {
value clM = module ceylon.language;
value clP = package ceylon.language;
value stringC = class String;
value iterableI = interface Iterable;
value aliasA = alias Alias;
value givenG = given Given;
value nullV = value null;
value identityF = function identity;
value newN = new Constructor;
value currentM = module;
value currentP = package;
value currentC = class;
value currentI = interface;
}
| Add test for backtick-less meta literals | Add test for backtick-less meta literals
Just copied from the existing test, with all backticks removed.
Part of #143.
| Ceylon | apache-2.0 | ceylon/ceylon.formatter | ceylon | ## Code Before:
void decLiterals() {
value clM = `module ceylon.language`;
value clP = `package ceylon.language`;
value stringC = `class String`;
value iterableI = `interface Iterable`;
value aliasA = `alias Alias`;
value givenG = `given Given`;
value nullV = `value null`;
value identityF = `function identity`;
value newN = `new Constructor`;
value currentM = `module`;
value currentP = `package`;
value currentC = `class`;
value currentI = `interface`;
}
## Instruction:
Add test for backtick-less meta literals
Just copied from the existing test, with all backticks removed.
Part of #143.
## Code After:
void decLiterals() {
value clM = `module ceylon.language`;
value clP = `package ceylon.language`;
value stringC = `class String`;
value iterableI = `interface Iterable`;
value aliasA = `alias Alias`;
value givenG = `given Given`;
value nullV = `value null`;
value identityF = `function identity`;
value newN = `new Constructor`;
value currentM = `module`;
value currentP = `package`;
value currentC = `class`;
value currentI = `interface`;
}
void decLiteralsWithoutBackticks() {
value clM = module ceylon.language;
value clP = package ceylon.language;
value stringC = class String;
value iterableI = interface Iterable;
value aliasA = alias Alias;
value givenG = given Given;
value nullV = value null;
value identityF = function identity;
value newN = new Constructor;
value currentM = module;
value currentP = package;
value currentC = class;
value currentI = interface;
}
| void decLiterals() {
value clM = `module ceylon.language`;
value clP = `package ceylon.language`;
value stringC = `class String`;
value iterableI = `interface Iterable`;
value aliasA = `alias Alias`;
value givenG = `given Given`;
value nullV = `value null`;
value identityF = `function identity`;
value newN = `new Constructor`;
value currentM = `module`;
value currentP = `package`;
value currentC = `class`;
value currentI = `interface`;
}
+
+ void decLiteralsWithoutBackticks() {
+ value clM = module ceylon.language;
+ value clP = package ceylon.language;
+ value stringC = class String;
+ value iterableI = interface Iterable;
+ value aliasA = alias Alias;
+ value givenG = given Given;
+ value nullV = value null;
+ value identityF = function identity;
+ value newN = new Constructor;
+
+ value currentM = module;
+ value currentP = package;
+ value currentC = class;
+ value currentI = interface;
+ } | 17 | 1.0625 | 17 | 0 |
b1c950623c1356ef631cceaab73c21cf7b14b3de | ChangeLog.md | ChangeLog.md |
* Deprecate FunctorMaybe in favor of Data.Witherable.Filterable. We still export fmapMaybe, ffilter, etc., but they all rely on Filterable now.
* Rename MonadDynamicWriter to DynamicWriter and add a deprecation for the old name.
* Remove many deprecated functions.
* Add a Num instance for Dynamic.
* Add matchRequestsWithResponses to make it easier to use Requester with protocols that don't do this matching for you.
* Add withRequesterT to map functions over the request and response of a RequesterT.
* Suppress nil patches in QueryT as an optimization. The Query type must now have an Eq instance.
|
* Deprecate FunctorMaybe in favor of Data.Witherable.Filterable. We still export fmapMaybe, ffilter, etc., but they all rely on Filterable now.
* Rename MonadDynamicWriter to DynamicWriter and add a deprecation for the old name.
* Remove many deprecated functions.
* Add a Num instance for Dynamic.
* Add matchRequestsWithResponses to make it easier to use Requester with protocols that don't do this matching for you.
* Add withRequesterT to map functions over the request and response of a RequesterT.
* Suppress nil patches in QueryT as an optimization. The Query type must now have an Eq instance.
* Add throttleBatchWithLag to Reflex.Time. See that module for details.
| Add Reflex.Time changes to changelog | Add Reflex.Time changes to changelog
| Markdown | bsd-3-clause | Saulzar/reflex,reflex-frp/reflex,Saulzar/reflex,reflex-frp/reflex | markdown | ## Code Before:
* Deprecate FunctorMaybe in favor of Data.Witherable.Filterable. We still export fmapMaybe, ffilter, etc., but they all rely on Filterable now.
* Rename MonadDynamicWriter to DynamicWriter and add a deprecation for the old name.
* Remove many deprecated functions.
* Add a Num instance for Dynamic.
* Add matchRequestsWithResponses to make it easier to use Requester with protocols that don't do this matching for you.
* Add withRequesterT to map functions over the request and response of a RequesterT.
* Suppress nil patches in QueryT as an optimization. The Query type must now have an Eq instance.
## Instruction:
Add Reflex.Time changes to changelog
## Code After:
* Deprecate FunctorMaybe in favor of Data.Witherable.Filterable. We still export fmapMaybe, ffilter, etc., but they all rely on Filterable now.
* Rename MonadDynamicWriter to DynamicWriter and add a deprecation for the old name.
* Remove many deprecated functions.
* Add a Num instance for Dynamic.
* Add matchRequestsWithResponses to make it easier to use Requester with protocols that don't do this matching for you.
* Add withRequesterT to map functions over the request and response of a RequesterT.
* Suppress nil patches in QueryT as an optimization. The Query type must now have an Eq instance.
* Add throttleBatchWithLag to Reflex.Time. See that module for details.
|
* Deprecate FunctorMaybe in favor of Data.Witherable.Filterable. We still export fmapMaybe, ffilter, etc., but they all rely on Filterable now.
* Rename MonadDynamicWriter to DynamicWriter and add a deprecation for the old name.
* Remove many deprecated functions.
* Add a Num instance for Dynamic.
* Add matchRequestsWithResponses to make it easier to use Requester with protocols that don't do this matching for you.
* Add withRequesterT to map functions over the request and response of a RequesterT.
* Suppress nil patches in QueryT as an optimization. The Query type must now have an Eq instance.
+ * Add throttleBatchWithLag to Reflex.Time. See that module for details. | 1 | 0.125 | 1 | 0 |
6b87150d13b377bfe21a1b3f08183980d8c0df13 | src/main/resources/templates/index.html | src/main/resources/templates/index.html | <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Url Shortner</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<h1>Url Shortner</h1>
<form action="#" th:action="@{/url-shortner}" th:object="${urlShortner}" method="post">
<p><input type="text" th:field="*{originalUrl}" /></p>
<p><input type="submit" value="Submit" /> </p>
</form>
</body>
</html> | <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Url Shortner</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-color: yellow;
}
header {
height: 20%;
}
section {
height: 80%;
}
h1 {
text-align: center;
}
form {
text-align: center;
}
input[type="text"] {
font-size: 25px;
}
input[type="submit"] {
font-size: 25px;
}
</style>
</head>
<body>
<header>
<h1>Url Shortner</h1>
</header>
<section>
<form action="#" th:action="@{/url-shortner}" th:object="${urlShortner}" method="post">
<input type="text" th:field="*{originalUrl}" placeholder="http://www.some-very-long-url.com" size="50" />
<input type="submit" value="Shorten Url" />
</form>
</section>
</body>
</html> | Add basic styling to home page | Add basic styling to home page
| HTML | mit | NabaSadiaSiddiqui/url-shortener,NabaSadiaSiddiqui/url-shortener | html | ## Code Before:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Url Shortner</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<h1>Url Shortner</h1>
<form action="#" th:action="@{/url-shortner}" th:object="${urlShortner}" method="post">
<p><input type="text" th:field="*{originalUrl}" /></p>
<p><input type="submit" value="Submit" /> </p>
</form>
</body>
</html>
## Instruction:
Add basic styling to home page
## Code After:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Url Shortner</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-color: yellow;
}
header {
height: 20%;
}
section {
height: 80%;
}
h1 {
text-align: center;
}
form {
text-align: center;
}
input[type="text"] {
font-size: 25px;
}
input[type="submit"] {
font-size: 25px;
}
</style>
</head>
<body>
<header>
<h1>Url Shortner</h1>
</header>
<section>
<form action="#" th:action="@{/url-shortner}" th:object="${urlShortner}" method="post">
<input type="text" th:field="*{originalUrl}" placeholder="http://www.some-very-long-url.com" size="50" />
<input type="submit" value="Shorten Url" />
</form>
</section>
</body>
</html> | <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
- <head>
+ <head>
? ++++
- <title>Url Shortner</title>
+ <title>Url Shortner</title>
? ++++
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
? ++++
+ <style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ }
+
+ body {
+ background-color: yellow;
+ }
+
+ header {
+ height: 20%;
+ }
+
+ section {
+ height: 80%;
+ }
+
+ h1 {
+ text-align: center;
+ }
+
+ form {
+ text-align: center;
+ }
+
+ input[type="text"] {
+ font-size: 25px;
+ }
+
+ input[type="submit"] {
+ font-size: 25px;
+ }
+ </style>
- </head>
+ </head>
? ++++
- <body>
+ <body>
? ++++
+ <header>
- <h1>Url Shortner</h1>
+ <h1>Url Shortner</h1>
? ++++++++++++
+ </header>
+ <section>
- <form action="#" th:action="@{/url-shortner}" th:object="${urlShortner}" method="post">
+ <form action="#" th:action="@{/url-shortner}" th:object="${urlShortner}" method="post">
? ++++++++++++
- <p><input type="text" th:field="*{originalUrl}" /></p>
- <p><input type="submit" value="Submit" /> </p>
- </form>
+ <input type="text" th:field="*{originalUrl}" placeholder="http://www.some-very-long-url.com" size="50" />
+ <input type="submit" value="Shorten Url" />
+ </form>
+ </section>
- </body>
+ </body>
? ++++
</html> | 62 | 4.428571 | 51 | 11 |
578d81474449b6a7957dcf29fc854ba00e637265 | text_collector_examples/directory-size.sh | text_collector_examples/directory-size.sh | echo "# HELP anarcat_dir_space_bytes Disk space used by some directories"
echo "# TYPE anarcat_dir_space_bytes gauge"
du --block-size=1 --summarize "$@" \
| sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/node_directory_size_bytes{directory="\2"} \1/p'
| echo "# HELP node_directory_size_bytes Disk space used by some directories"
echo "# TYPE node_directory_size_bytes gauge"
du --block-size=1 --summarize "$@" \
| sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/node_directory_size_bytes{directory="\2"} \1/p'
| Fix metric name in directory size text collector example | Fix metric name in directory size text collector example
The directory size text collector example uses the wrong metric name in the HELP and TYPE lines rendering the comments unusable.
This fixes that by using the same metric name.
Signed-off-by: Sandor Zeestraten <d94cc7c664066717a4e0bf25a7d7ac9c9cac9413@zeestrataca.com>
| Shell | apache-2.0 | siavashs/node_exporter,siavashs/node_exporter,prometheus/node_exporter,derekmarcotte/node_exporter,derekmarcotte/node_exporter,prometheus/node_exporter,siavashs/node_exporter,derekmarcotte/node_exporter,derekmarcotte/node_exporter,siavashs/node_exporter,prometheus/node_exporter | shell | ## Code Before:
echo "# HELP anarcat_dir_space_bytes Disk space used by some directories"
echo "# TYPE anarcat_dir_space_bytes gauge"
du --block-size=1 --summarize "$@" \
| sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/node_directory_size_bytes{directory="\2"} \1/p'
## Instruction:
Fix metric name in directory size text collector example
The directory size text collector example uses the wrong metric name in the HELP and TYPE lines rendering the comments unusable.
This fixes that by using the same metric name.
Signed-off-by: Sandor Zeestraten <d94cc7c664066717a4e0bf25a7d7ac9c9cac9413@zeestrataca.com>
## Code After:
echo "# HELP node_directory_size_bytes Disk space used by some directories"
echo "# TYPE node_directory_size_bytes gauge"
du --block-size=1 --summarize "$@" \
| sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/node_directory_size_bytes{directory="\2"} \1/p'
| - echo "# HELP anarcat_dir_space_bytes Disk space used by some directories"
? - ^^^^^ ^^^
+ echo "# HELP node_directory_size_bytes Disk space used by some directories"
? ^^^ ++++++ ^^
- echo "# TYPE anarcat_dir_space_bytes gauge"
? - ^^^^^ ^^^
+ echo "# TYPE node_directory_size_bytes gauge"
? ^^^ ++++++ ^^
du --block-size=1 --summarize "$@" \
| sed -ne 's/\\/\\\\/;s/"/\\"/g;s/^\([0-9]\+\)\t\(.*\)$/node_directory_size_bytes{directory="\2"} \1/p' | 4 | 1 | 2 | 2 |
cab6b61f729202d3635df1b7babb20b83e1d92cc | lib/download_bbc_radio.rb | lib/download_bbc_radio.rb | =begin
In order to fake a radio, we need to stream radio content.
BBC Radio streams are playlist files, which contain
a link to a time-restricted audio stream.
Every few hours, the stream disconnects and you have to
download the playlist again to continue.
This downloads the playlists and parses for the audio end point.
=end
require "radiodan/playlist"
require "rest-client"
class DownloadBBCRadio
URL = "http://www.bbc.co.uk/radio/listen/live/r%s_aaclca.pls"
STATIONS = %w{1 1x 2 3 4 4lw 4x 5l 5lsp 6}
attr_accessor :stations
def run
@stations ||= Hash.new
@threads = []
RestClient.proxy = ENV['HTTP_PROXY']
STATIONS.each do |station|
@threads << Thread.new do
req = RestClient.get(URL % station)
next if req.nil?
url = req.match(/^File1=(.*)$/)[1]
station_name = "bbc_radio_#{station}"
content = Radiodan::Playlist.new tracks: Radiodan::Track.new(:file => url, :id => station_name)
@stations[station_name] = content
end
end
@threads.collect(&:join)
@stations = Hash[@stations.sort]
end
end
| =begin
In order to fake a radio, we need to stream radio content.
BBC Radio streams are playlist files, which contain
a link to a time-restricted audio stream.
Every few hours, the stream disconnects and you have to
download the playlist again to continue.
This downloads the playlists and parses for the audio end point.
=end
require "radiodan/playlist"
require "rest-client"
class DownloadBBCRadio
URL = "http://www.bbc.co.uk/radio/listen/live/r%s_aaclca.pls"
STATIONS = %w{1 1x 2 3 4 4lw 4x 5l 5lsp 6 an}
attr_accessor :stations
def run
@stations ||= Hash.new
@threads = []
RestClient.proxy = ENV['HTTP_PROXY']
STATIONS.each do |station|
@threads << Thread.new do
req = RestClient.get(URL % station)
next if req.nil?
url = req.match(/^File1=(.*)$/)[1]
station_name = "bbc_radio_#{station}"
content = Radiodan::Playlist.new tracks: Radiodan::Track.new(:file => url, :id => station_name)
@stations[station_name] = content
end
end
# World Service stream
@stations["bbc_radio_ws"] = Radiodan::Playlist.new(tracks: Radiodan::Track.new(:file => "http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk", :id => "bbc_radio_ws"))
@threads.collect(&:join)
@stations = Hash[@stations.sort]
end
end
| Add Asian Network and World Service streams | Add Asian Network and World Service streams
| Ruby | apache-2.0 | radiodan/radiodan-example,radiodan/radiodan-example | ruby | ## Code Before:
=begin
In order to fake a radio, we need to stream radio content.
BBC Radio streams are playlist files, which contain
a link to a time-restricted audio stream.
Every few hours, the stream disconnects and you have to
download the playlist again to continue.
This downloads the playlists and parses for the audio end point.
=end
require "radiodan/playlist"
require "rest-client"
class DownloadBBCRadio
URL = "http://www.bbc.co.uk/radio/listen/live/r%s_aaclca.pls"
STATIONS = %w{1 1x 2 3 4 4lw 4x 5l 5lsp 6}
attr_accessor :stations
def run
@stations ||= Hash.new
@threads = []
RestClient.proxy = ENV['HTTP_PROXY']
STATIONS.each do |station|
@threads << Thread.new do
req = RestClient.get(URL % station)
next if req.nil?
url = req.match(/^File1=(.*)$/)[1]
station_name = "bbc_radio_#{station}"
content = Radiodan::Playlist.new tracks: Radiodan::Track.new(:file => url, :id => station_name)
@stations[station_name] = content
end
end
@threads.collect(&:join)
@stations = Hash[@stations.sort]
end
end
## Instruction:
Add Asian Network and World Service streams
## Code After:
=begin
In order to fake a radio, we need to stream radio content.
BBC Radio streams are playlist files, which contain
a link to a time-restricted audio stream.
Every few hours, the stream disconnects and you have to
download the playlist again to continue.
This downloads the playlists and parses for the audio end point.
=end
require "radiodan/playlist"
require "rest-client"
class DownloadBBCRadio
URL = "http://www.bbc.co.uk/radio/listen/live/r%s_aaclca.pls"
STATIONS = %w{1 1x 2 3 4 4lw 4x 5l 5lsp 6 an}
attr_accessor :stations
def run
@stations ||= Hash.new
@threads = []
RestClient.proxy = ENV['HTTP_PROXY']
STATIONS.each do |station|
@threads << Thread.new do
req = RestClient.get(URL % station)
next if req.nil?
url = req.match(/^File1=(.*)$/)[1]
station_name = "bbc_radio_#{station}"
content = Radiodan::Playlist.new tracks: Radiodan::Track.new(:file => url, :id => station_name)
@stations[station_name] = content
end
end
# World Service stream
@stations["bbc_radio_ws"] = Radiodan::Playlist.new(tracks: Radiodan::Track.new(:file => "http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk", :id => "bbc_radio_ws"))
@threads.collect(&:join)
@stations = Hash[@stations.sort]
end
end
| =begin
In order to fake a radio, we need to stream radio content.
BBC Radio streams are playlist files, which contain
a link to a time-restricted audio stream.
Every few hours, the stream disconnects and you have to
download the playlist again to continue.
This downloads the playlists and parses for the audio end point.
=end
require "radiodan/playlist"
require "rest-client"
class DownloadBBCRadio
URL = "http://www.bbc.co.uk/radio/listen/live/r%s_aaclca.pls"
- STATIONS = %w{1 1x 2 3 4 4lw 4x 5l 5lsp 6}
+ STATIONS = %w{1 1x 2 3 4 4lw 4x 5l 5lsp 6 an}
? +++
attr_accessor :stations
def run
@stations ||= Hash.new
@threads = []
RestClient.proxy = ENV['HTTP_PROXY']
STATIONS.each do |station|
@threads << Thread.new do
req = RestClient.get(URL % station)
next if req.nil?
url = req.match(/^File1=(.*)$/)[1]
station_name = "bbc_radio_#{station}"
content = Radiodan::Playlist.new tracks: Radiodan::Track.new(:file => url, :id => station_name)
@stations[station_name] = content
end
end
+ # World Service stream
+ @stations["bbc_radio_ws"] = Radiodan::Playlist.new(tracks: Radiodan::Track.new(:file => "http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk", :id => "bbc_radio_ws"))
+
@threads.collect(&:join)
@stations = Hash[@stations.sort]
end
end | 5 | 0.116279 | 4 | 1 |
678a645f56056ac375692158076abcfdc2a834ac | content/uses/index.md | content/uses/index.md | ---
title: Uses
---
This page contains my current setup
## Personal
### Hardware
- Dell Inspiron
### OS
- [Manjaro](https://manjaro.org/)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [ZSH](https://www.zsh.org/)
- [Oh my zsh](https://ohmyz.sh/)
## Work
### Hardware
- Dell
### OS
- [Microsoft Windows 10](https://www.microsoft.com/pt-br/windows/)
- [WSL2](https://docs.microsoft.com/pt-br/windows/wsl/wsl2-index)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [Windows Terminal](https://github.com/microsoft/terminal)
## Personal & Work
### Hardware
- [LG 25UM58](https://www.lg.com/br/business/monitores-produtos/lg-25UM58)
### Browser
- [Google Chrome](https://www.google.com/intl/pt-BR/chrome/)
- [Mozilla Firefox](https://www.mozilla.org/pt-BR/firefox/new/)
| ---
title: Uses
---
This page contains my current setup. It's inspired on [https://uses.tech/](https://uses.tech/)
## Personal
### Hardware
- Dell Inspiron
### OS
- [Manjaro](https://manjaro.org/)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [ZSH](https://www.zsh.org/)
- [Oh my zsh](https://ohmyz.sh/)
## Work
### Hardware
- Dell
### OS
- [Microsoft Windows 10](https://www.microsoft.com/pt-br/windows/)
- [WSL2](https://docs.microsoft.com/pt-br/windows/wsl/wsl2-index)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [Windows Terminal](https://github.com/microsoft/terminal)
## Personal & Work
### Hardware
- [LG 25UM58](https://www.lg.com/br/business/monitores-produtos/lg-25UM58)
### Browser
- [Google Chrome](https://www.google.com/intl/pt-BR/chrome/)
- [Mozilla Firefox](https://www.mozilla.org/pt-BR/firefox/new/)
| Add inspiration note on uses page | Add inspiration note on uses page
| Markdown | mit | caiquecastro/caiquecastro.github.io,caiquecastro/caiquecastro.github.io,caiquecastro/caiquecastro.github.io | markdown | ## Code Before:
---
title: Uses
---
This page contains my current setup
## Personal
### Hardware
- Dell Inspiron
### OS
- [Manjaro](https://manjaro.org/)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [ZSH](https://www.zsh.org/)
- [Oh my zsh](https://ohmyz.sh/)
## Work
### Hardware
- Dell
### OS
- [Microsoft Windows 10](https://www.microsoft.com/pt-br/windows/)
- [WSL2](https://docs.microsoft.com/pt-br/windows/wsl/wsl2-index)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [Windows Terminal](https://github.com/microsoft/terminal)
## Personal & Work
### Hardware
- [LG 25UM58](https://www.lg.com/br/business/monitores-produtos/lg-25UM58)
### Browser
- [Google Chrome](https://www.google.com/intl/pt-BR/chrome/)
- [Mozilla Firefox](https://www.mozilla.org/pt-BR/firefox/new/)
## Instruction:
Add inspiration note on uses page
## Code After:
---
title: Uses
---
This page contains my current setup. It's inspired on [https://uses.tech/](https://uses.tech/)
## Personal
### Hardware
- Dell Inspiron
### OS
- [Manjaro](https://manjaro.org/)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [ZSH](https://www.zsh.org/)
- [Oh my zsh](https://ohmyz.sh/)
## Work
### Hardware
- Dell
### OS
- [Microsoft Windows 10](https://www.microsoft.com/pt-br/windows/)
- [WSL2](https://docs.microsoft.com/pt-br/windows/wsl/wsl2-index)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [Windows Terminal](https://github.com/microsoft/terminal)
## Personal & Work
### Hardware
- [LG 25UM58](https://www.lg.com/br/business/monitores-produtos/lg-25UM58)
### Browser
- [Google Chrome](https://www.google.com/intl/pt-BR/chrome/)
- [Mozilla Firefox](https://www.mozilla.org/pt-BR/firefox/new/)
| ---
title: Uses
---
- This page contains my current setup
+ This page contains my current setup. It's inspired on [https://uses.tech/](https://uses.tech/)
## Personal
### Hardware
- Dell Inspiron
### OS
- [Manjaro](https://manjaro.org/)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [ZSH](https://www.zsh.org/)
- [Oh my zsh](https://ohmyz.sh/)
## Work
### Hardware
- Dell
### OS
- [Microsoft Windows 10](https://www.microsoft.com/pt-br/windows/)
- [WSL2](https://docs.microsoft.com/pt-br/windows/wsl/wsl2-index)
### Editors and Terminals
- [Visual Studio Code](https://code.visualstudio.com/)
- [Windows Terminal](https://github.com/microsoft/terminal)
## Personal & Work
### Hardware
- [LG 25UM58](https://www.lg.com/br/business/monitores-produtos/lg-25UM58)
### Browser
- [Google Chrome](https://www.google.com/intl/pt-BR/chrome/)
- [Mozilla Firefox](https://www.mozilla.org/pt-BR/firefox/new/) | 2 | 0.038462 | 1 | 1 |
01e4b6c3cbd11058e3d60a635048998c24138ddb | instana/__init__.py | instana/__init__.py | from __future__ import absolute_import
import opentracing
from .sensor import Sensor
from .tracer import InstanaTracer
from .options import Options
# Import & initialize instrumentation
from .instrumentation import urllib3
"""
The Instana package has two core components: the sensor and the tracer.
The sensor is individual to each python process and handles process metric
collection and reporting.
The tracer upholds the OpenTracing API and is responsible for reporting
span data to Instana.
"""
__author__ = 'Instana Inc.'
__copyright__ = 'Copyright 2017 Instana Inc.'
__credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo']
__license__ = 'MIT'
__version__ = '0.7.0'
__maintainer__ = 'Peter Giacomo Lombardo'
__email__ = 'peter.lombardo@instana.com'
# For any given Python process, we only want one sensor as multiple would
# collect/report metrics in duplicate, triplicate etc..
#
# Usage example:
#
# import instana
# instana.global_sensor
#
global_sensor = Sensor(Options())
# The global OpenTracing compatible tracer used internally by
# this package.
#
# Usage example:
#
# import instana
# instana.internal_tracer.start_span(...)
#
internal_tracer = InstanaTracer()
# Set ourselves as the tracer.
opentracing.tracer = internal_tracer
| from __future__ import absolute_import
import os
import opentracing
from .sensor import Sensor
from .tracer import InstanaTracer
from .options import Options
if "INSTANA_DISABLE_AUTO_INSTR" not in os.environ:
# Import & initialize instrumentation
from .instrumentation import urllib3
"""
The Instana package has two core components: the sensor and the tracer.
The sensor is individual to each python process and handles process metric
collection and reporting.
The tracer upholds the OpenTracing API and is responsible for reporting
span data to Instana.
"""
__author__ = 'Instana Inc.'
__copyright__ = 'Copyright 2017 Instana Inc.'
__credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo']
__license__ = 'MIT'
__version__ = '0.7.0'
__maintainer__ = 'Peter Giacomo Lombardo'
__email__ = 'peter.lombardo@instana.com'
# For any given Python process, we only want one sensor as multiple would
# collect/report metrics in duplicate, triplicate etc..
#
# Usage example:
#
# import instana
# instana.global_sensor
#
global_sensor = Sensor(Options())
# The global OpenTracing compatible tracer used internally by
# this package.
#
# Usage example:
#
# import instana
# instana.internal_tracer.start_span(...)
#
internal_tracer = InstanaTracer()
# Set ourselves as the tracer.
opentracing.tracer = internal_tracer
| Add environment variable to disable automatic instrumentation | Add environment variable to disable automatic instrumentation
| Python | mit | instana/python-sensor,instana/python-sensor | python | ## Code Before:
from __future__ import absolute_import
import opentracing
from .sensor import Sensor
from .tracer import InstanaTracer
from .options import Options
# Import & initialize instrumentation
from .instrumentation import urllib3
"""
The Instana package has two core components: the sensor and the tracer.
The sensor is individual to each python process and handles process metric
collection and reporting.
The tracer upholds the OpenTracing API and is responsible for reporting
span data to Instana.
"""
__author__ = 'Instana Inc.'
__copyright__ = 'Copyright 2017 Instana Inc.'
__credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo']
__license__ = 'MIT'
__version__ = '0.7.0'
__maintainer__ = 'Peter Giacomo Lombardo'
__email__ = 'peter.lombardo@instana.com'
# For any given Python process, we only want one sensor as multiple would
# collect/report metrics in duplicate, triplicate etc..
#
# Usage example:
#
# import instana
# instana.global_sensor
#
global_sensor = Sensor(Options())
# The global OpenTracing compatible tracer used internally by
# this package.
#
# Usage example:
#
# import instana
# instana.internal_tracer.start_span(...)
#
internal_tracer = InstanaTracer()
# Set ourselves as the tracer.
opentracing.tracer = internal_tracer
## Instruction:
Add environment variable to disable automatic instrumentation
## Code After:
from __future__ import absolute_import
import os
import opentracing
from .sensor import Sensor
from .tracer import InstanaTracer
from .options import Options
if "INSTANA_DISABLE_AUTO_INSTR" not in os.environ:
# Import & initialize instrumentation
from .instrumentation import urllib3
"""
The Instana package has two core components: the sensor and the tracer.
The sensor is individual to each python process and handles process metric
collection and reporting.
The tracer upholds the OpenTracing API and is responsible for reporting
span data to Instana.
"""
__author__ = 'Instana Inc.'
__copyright__ = 'Copyright 2017 Instana Inc.'
__credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo']
__license__ = 'MIT'
__version__ = '0.7.0'
__maintainer__ = 'Peter Giacomo Lombardo'
__email__ = 'peter.lombardo@instana.com'
# For any given Python process, we only want one sensor as multiple would
# collect/report metrics in duplicate, triplicate etc..
#
# Usage example:
#
# import instana
# instana.global_sensor
#
global_sensor = Sensor(Options())
# The global OpenTracing compatible tracer used internally by
# this package.
#
# Usage example:
#
# import instana
# instana.internal_tracer.start_span(...)
#
internal_tracer = InstanaTracer()
# Set ourselves as the tracer.
opentracing.tracer = internal_tracer
| from __future__ import absolute_import
+ import os
import opentracing
from .sensor import Sensor
from .tracer import InstanaTracer
from .options import Options
+ if "INSTANA_DISABLE_AUTO_INSTR" not in os.environ:
- # Import & initialize instrumentation
+ # Import & initialize instrumentation
? ++++
- from .instrumentation import urllib3
+ from .instrumentation import urllib3
? ++++
"""
The Instana package has two core components: the sensor and the tracer.
The sensor is individual to each python process and handles process metric
collection and reporting.
The tracer upholds the OpenTracing API and is responsible for reporting
span data to Instana.
"""
__author__ = 'Instana Inc.'
__copyright__ = 'Copyright 2017 Instana Inc.'
__credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo']
__license__ = 'MIT'
__version__ = '0.7.0'
__maintainer__ = 'Peter Giacomo Lombardo'
__email__ = 'peter.lombardo@instana.com'
# For any given Python process, we only want one sensor as multiple would
# collect/report metrics in duplicate, triplicate etc..
#
# Usage example:
#
# import instana
# instana.global_sensor
#
global_sensor = Sensor(Options())
# The global OpenTracing compatible tracer used internally by
# this package.
#
# Usage example:
#
# import instana
# instana.internal_tracer.start_span(...)
#
internal_tracer = InstanaTracer()
# Set ourselves as the tracer.
opentracing.tracer = internal_tracer | 6 | 0.122449 | 4 | 2 |
addcd33f711f263e0c6de3e60f5de54e7097cc27 | scripts/main.js | scripts/main.js | $(function() {
// menu initialization
var $menu = $('#menu');
var $menuEntries = $menu.children('div');
$(window).on('hashchange load', function() {
$menuEntries.hide();
var clickedMenuEntry =
$menuEntries.filter(window.location.hash).size() ?
window.location.hash :
'#index';
$(clickedMenuEntry).show();
});
var curBackground = 1;
var backgroundsCount = 10;
var backgroundsExt = '.jpg';
var backgroundsUrlPrefix = 'css/img/backgrounds/';
// simple images preloading
for (var i = curBackground; i <= backgroundsCount; i++) {
$('<img src="' + backgroundsUrlPrefix + i + backgroundsExt + '">');
}
var $backgroundContainer = $('#background');
setInterval(function() {
$backgroundContainer.fadeOut('slow', function() {
$backgroundContainer.css(
'background-image',
'url(' + backgroundsUrlPrefix + curBackground + backgroundsExt + ')'
).fadeIn('slow');
});
curBackground = (curBackground === backgroundsCount) ? 1 : ++curBackground;
}, 5000);
});
| $(function() {
// menu initialization
var $menu = $('#menu');
var $menuEntries = $menu.children('div');
$(window).on('hashchange', function() {
$menuEntries.hide();
var clickedMenuEntry =
$menuEntries.filter(window.location.hash).size() ?
window.location.hash :
'#index';
$(clickedMenuEntry).show();
}).trigger('hashchange'); // initial
});
$(window).load(function() {
var curBackground = 1;
var backgroundsCount = 10;
var backgroundsExt = '.jpg';
var backgroundsUrlPrefix = 'css/img/backgrounds/';
// simple images preloading
for (var i = curBackground; i <= backgroundsCount; i++) {
$('<img src="' + backgroundsUrlPrefix + i + backgroundsExt + '">');
}
var $backgroundContainer = $('#background');
// background images cycling
setInterval(function() {
$backgroundContainer.fadeOut('slow', function() {
$backgroundContainer.css(
'background-image',
'url(' + backgroundsUrlPrefix + curBackground + backgroundsExt + ')'
).fadeIn('slow');
});
curBackground = (curBackground === backgroundsCount) ? 1 : ++curBackground;
}, 5000);
});
| Move images preloading and background cycling start to the "window.load" | Move images preloading and background cycling start to the "window.load"
Also trigger initial "window.hashchange" event immediately.
| JavaScript | apache-2.0 | MovingBlocks/movingblocks.github.com,smsunarto/movingblocks.github.com,MovingBlocks/movingblocks.github.com,smsunarto/movingblocks.github.com,MovingBlocks/movingblocks.github.com,smsunarto/movingblocks.github.com | javascript | ## Code Before:
$(function() {
// menu initialization
var $menu = $('#menu');
var $menuEntries = $menu.children('div');
$(window).on('hashchange load', function() {
$menuEntries.hide();
var clickedMenuEntry =
$menuEntries.filter(window.location.hash).size() ?
window.location.hash :
'#index';
$(clickedMenuEntry).show();
});
var curBackground = 1;
var backgroundsCount = 10;
var backgroundsExt = '.jpg';
var backgroundsUrlPrefix = 'css/img/backgrounds/';
// simple images preloading
for (var i = curBackground; i <= backgroundsCount; i++) {
$('<img src="' + backgroundsUrlPrefix + i + backgroundsExt + '">');
}
var $backgroundContainer = $('#background');
setInterval(function() {
$backgroundContainer.fadeOut('slow', function() {
$backgroundContainer.css(
'background-image',
'url(' + backgroundsUrlPrefix + curBackground + backgroundsExt + ')'
).fadeIn('slow');
});
curBackground = (curBackground === backgroundsCount) ? 1 : ++curBackground;
}, 5000);
});
## Instruction:
Move images preloading and background cycling start to the "window.load"
Also trigger initial "window.hashchange" event immediately.
## Code After:
$(function() {
// menu initialization
var $menu = $('#menu');
var $menuEntries = $menu.children('div');
$(window).on('hashchange', function() {
$menuEntries.hide();
var clickedMenuEntry =
$menuEntries.filter(window.location.hash).size() ?
window.location.hash :
'#index';
$(clickedMenuEntry).show();
}).trigger('hashchange'); // initial
});
$(window).load(function() {
var curBackground = 1;
var backgroundsCount = 10;
var backgroundsExt = '.jpg';
var backgroundsUrlPrefix = 'css/img/backgrounds/';
// simple images preloading
for (var i = curBackground; i <= backgroundsCount; i++) {
$('<img src="' + backgroundsUrlPrefix + i + backgroundsExt + '">');
}
var $backgroundContainer = $('#background');
// background images cycling
setInterval(function() {
$backgroundContainer.fadeOut('slow', function() {
$backgroundContainer.css(
'background-image',
'url(' + backgroundsUrlPrefix + curBackground + backgroundsExt + ')'
).fadeIn('slow');
});
curBackground = (curBackground === backgroundsCount) ? 1 : ++curBackground;
}, 5000);
});
| $(function() {
// menu initialization
var $menu = $('#menu');
var $menuEntries = $menu.children('div');
- $(window).on('hashchange load', function() {
? -----
+ $(window).on('hashchange', function() {
$menuEntries.hide();
var clickedMenuEntry =
$menuEntries.filter(window.location.hash).size() ?
window.location.hash :
'#index';
$(clickedMenuEntry).show();
- });
+ }).trigger('hashchange'); // initial
+ });
+
+ $(window).load(function() {
var curBackground = 1;
var backgroundsCount = 10;
var backgroundsExt = '.jpg';
var backgroundsUrlPrefix = 'css/img/backgrounds/';
// simple images preloading
for (var i = curBackground; i <= backgroundsCount; i++) {
$('<img src="' + backgroundsUrlPrefix + i + backgroundsExt + '">');
}
var $backgroundContainer = $('#background');
+ // background images cycling
setInterval(function() {
$backgroundContainer.fadeOut('slow', function() {
$backgroundContainer.css(
'background-image',
'url(' + backgroundsUrlPrefix + curBackground + backgroundsExt + ')'
).fadeIn('slow');
});
curBackground = (curBackground === backgroundsCount) ? 1 : ++curBackground;
}, 5000);
-
}); | 9 | 0.243243 | 6 | 3 |
19167461c6aa04f4b64870b80f129b6b0c4f92aa | tox.ini | tox.ini | [tox]
envlist =
coverage-erase
test-{py27,py34,py35,py36}-django{18,19,110}
coverage-report
flake8
[testenv]
usedevelop = True
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
coverage>=4.1
requests
pytz
commands =
coverage-erase: coverage erase
test: coverage run tests/manage.py test tests
coverage-report: coverage report
passenv = AWS_*
[testenv:flake8]
basepython = python3.6
deps =
flake8>=2.5.4
commands =
flake8
[flake8]
max-line-length=120
exclude=venv,migrations,.tox
| [tox]
envlist =
coverage-erase
test-{py27,py34,py35,py36}-django{18,19,110,111}
coverage-report
flake8
[testenv]
usedevelop = True
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11,<2.0
coverage>=4.1
requests
pytz
commands =
coverage-erase: coverage erase
test: coverage run tests/manage.py test tests
coverage-report: coverage report
passenv = AWS_*
[testenv:flake8]
basepython = python3.6
deps =
flake8>=2.5.4
commands =
flake8
[flake8]
max-line-length=120
exclude=venv,migrations,.tox
| Add Django 1.11 to test matrix | Add Django 1.11 to test matrix
| INI | bsd-3-clause | etianen/django-s3-storage,sysradium/django-s3-storage | ini | ## Code Before:
[tox]
envlist =
coverage-erase
test-{py27,py34,py35,py36}-django{18,19,110}
coverage-report
flake8
[testenv]
usedevelop = True
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
coverage>=4.1
requests
pytz
commands =
coverage-erase: coverage erase
test: coverage run tests/manage.py test tests
coverage-report: coverage report
passenv = AWS_*
[testenv:flake8]
basepython = python3.6
deps =
flake8>=2.5.4
commands =
flake8
[flake8]
max-line-length=120
exclude=venv,migrations,.tox
## Instruction:
Add Django 1.11 to test matrix
## Code After:
[tox]
envlist =
coverage-erase
test-{py27,py34,py35,py36}-django{18,19,110,111}
coverage-report
flake8
[testenv]
usedevelop = True
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11,<2.0
coverage>=4.1
requests
pytz
commands =
coverage-erase: coverage erase
test: coverage run tests/manage.py test tests
coverage-report: coverage report
passenv = AWS_*
[testenv:flake8]
basepython = python3.6
deps =
flake8>=2.5.4
commands =
flake8
[flake8]
max-line-length=120
exclude=venv,migrations,.tox
| [tox]
envlist =
coverage-erase
- test-{py27,py34,py35,py36}-django{18,19,110}
+ test-{py27,py34,py35,py36}-django{18,19,110,111}
? ++++
coverage-report
flake8
[testenv]
usedevelop = True
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
+ django111: Django>=1.11,<2.0
coverage>=4.1
requests
pytz
commands =
coverage-erase: coverage erase
test: coverage run tests/manage.py test tests
coverage-report: coverage report
passenv = AWS_*
[testenv:flake8]
basepython = python3.6
deps =
flake8>=2.5.4
commands =
flake8
[flake8]
max-line-length=120
exclude=venv,migrations,.tox | 3 | 0.09375 | 2 | 1 |
644b2a98ded16b7268f0cd2f28b20cbfb4814505 | lib/cli/src/generators/REACT/template-csf/.storybook/main.js | lib/cli/src/generators/REACT/template-csf/.storybook/main.js | module.exports = {
stories: ['../stories/**/*.stories.js'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
};
| module.exports = {
stories: ['../stories/**/*.stories.(ts|tsx|js|jsx)'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
};
| Support Both js and jsx or ts and tsx | Support Both js and jsx or ts and tsx
| JavaScript | mit | kadirahq/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook | javascript | ## Code Before:
module.exports = {
stories: ['../stories/**/*.stories.js'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
};
## Instruction:
Support Both js and jsx or ts and tsx
## Code After:
module.exports = {
stories: ['../stories/**/*.stories.(ts|tsx|js|jsx)'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
};
| module.exports = {
- stories: ['../stories/**/*.stories.js'],
+ stories: ['../stories/**/*.stories.(ts|tsx|js|jsx)'],
? ++++++++ +++++
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
}; | 2 | 0.5 | 1 | 1 |
a101b11d5bd3225d78977f9fdacfdb0e44e9e156 | playbooks/common/openshift-cluster/upgrades/upgrade_components.yml | playbooks/common/openshift-cluster/upgrades/upgrade_components.yml | ---
- name: Upgrade Service Catalog
hosts: oo_first_master
vars:
first_master: "{{ groups.oo_first_master[0] }}"
tasks:
- import_role:
name: openshift_service_catalog
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: ansible_service_broker
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: template_service_broker
tasks_from: upgrade.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_playbook: ../../../openshift-monitoring/private/config.yml
when: openshift_monitoring_deploy | default(false) | bool
- import_playbook: ../../../openshift-monitor-availability/private/config.yml
when: openshift_monitor_availability_install | default(false) | bool
| ---
- name: Upgrade Service Catalog
hosts: oo_first_master
vars:
first_master: "{{ groups.oo_first_master[0] }}"
tasks:
- import_role:
name: openshift_service_catalog
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: ansible_service_broker
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: template_service_broker
tasks_from: upgrade.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_playbook: ../../../openshift-monitoring/private/config.yml
when: openshift_monitoring_deploy | default(false) | bool
- import_playbook: ../../../openshift-monitor-availability/private/config.yml
when: openshift_monitor_availability_install | default(false) | bool
- import_playbook: ../../../openshift-node-problem-detector/private/config.yml
when: openshift_node_problem_detector_install | default(false) | bool
| Allow installs of Node Problem Detector during upgrades | Allow installs of Node Problem Detector during upgrades
| YAML | apache-2.0 | maxamillion/openshift-ansible,jwhonce/openshift-ansible,aveshagarwal/openshift-ansible,openshift/openshift-ansible,rhdedgar/openshift-ansible,ewolinetz/openshift-ansible,mwoodson/openshift-ansible,tagliateller/openshift-ansible,rhdedgar/openshift-ansible,tagliateller/openshift-ansible,nak3/openshift-ansible,tagliateller/openshift-ansible,markllama/openshift-ansible,liggitt/openshift-ansible,tagliateller/openshift-ansible,miminar/openshift-ansible,mwoodson/openshift-ansible,aveshagarwal/openshift-ansible,miminar/openshift-ansible,rjhowe/openshift-ansible,liggitt/openshift-ansible,rjhowe/openshift-ansible,ewolinetz/openshift-ansible,gburges/openshift-ansible,maxamillion/openshift-ansible,aveshagarwal/openshift-ansible,akram/openshift-ansible,gburges/openshift-ansible,liggitt/openshift-ansible,jwhonce/openshift-ansible,markllama/openshift-ansible,nak3/openshift-ansible,bparees/openshift-ansible,sdodson/openshift-ansible,liggitt/openshift-ansible,maxamillion/openshift-ansible,miminar/openshift-ansible,sdodson/openshift-ansible,aveshagarwal/openshift-ansible,sdodson/openshift-ansible,jwhonce/openshift-ansible,liggitt/openshift-ansible,rjhowe/openshift-ansible,bparees/openshift-ansible,maxamillion/openshift-ansible,rjhowe/openshift-ansible,tagliateller/openshift-ansible,aveshagarwal/openshift-ansible,markllama/openshift-ansible,ewolinetz/openshift-ansible,markllama/openshift-ansible,openshift/openshift-ansible,miminar/openshift-ansible,kwoodson/openshift-ansible,ewolinetz/openshift-ansible,miminar/openshift-ansible,sdodson/openshift-ansible,sdodson/openshift-ansible,maxamillion/openshift-ansible,rjhowe/openshift-ansible,jwhonce/openshift-ansible,jwhonce/openshift-ansible,kwoodson/openshift-ansible,akram/openshift-ansible,ewolinetz/openshift-ansible,markllama/openshift-ansible | yaml | ## Code Before:
---
- name: Upgrade Service Catalog
hosts: oo_first_master
vars:
first_master: "{{ groups.oo_first_master[0] }}"
tasks:
- import_role:
name: openshift_service_catalog
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: ansible_service_broker
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: template_service_broker
tasks_from: upgrade.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_playbook: ../../../openshift-monitoring/private/config.yml
when: openshift_monitoring_deploy | default(false) | bool
- import_playbook: ../../../openshift-monitor-availability/private/config.yml
when: openshift_monitor_availability_install | default(false) | bool
## Instruction:
Allow installs of Node Problem Detector during upgrades
## Code After:
---
- name: Upgrade Service Catalog
hosts: oo_first_master
vars:
first_master: "{{ groups.oo_first_master[0] }}"
tasks:
- import_role:
name: openshift_service_catalog
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: ansible_service_broker
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: template_service_broker
tasks_from: upgrade.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_playbook: ../../../openshift-monitoring/private/config.yml
when: openshift_monitoring_deploy | default(false) | bool
- import_playbook: ../../../openshift-monitor-availability/private/config.yml
when: openshift_monitor_availability_install | default(false) | bool
- import_playbook: ../../../openshift-node-problem-detector/private/config.yml
when: openshift_node_problem_detector_install | default(false) | bool
| ---
- name: Upgrade Service Catalog
hosts: oo_first_master
vars:
first_master: "{{ groups.oo_first_master[0] }}"
tasks:
- import_role:
name: openshift_service_catalog
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: ansible_service_broker
tasks_from: install.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_role:
name: template_service_broker
tasks_from: upgrade.yml
when:
- openshift_enable_service_catalog | default(true) | bool
- import_playbook: ../../../openshift-monitoring/private/config.yml
when: openshift_monitoring_deploy | default(false) | bool
- import_playbook: ../../../openshift-monitor-availability/private/config.yml
when: openshift_monitor_availability_install | default(false) | bool
+
+ - import_playbook: ../../../openshift-node-problem-detector/private/config.yml
+ when: openshift_node_problem_detector_install | default(false) | bool | 3 | 0.111111 | 3 | 0 |
baad480de1cbcd75c13acb134ce43ef5c65b41f3 | src/utils/getCalendarDaySettings.js | src/utils/getCalendarDaySettings.js | import getPhrase from './getPhrase';
import { BLOCKED_MODIFIER } from '../constants';
export default function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
const {
chooseAvailableDate,
dateIsUnavailable,
dateIsSelected,
} = phrases;
const daySizeStyles = {
width: daySize,
height: daySize - 1,
};
const useDefaultCursor = (
modifiers.has('blocked-minimum-nights')
|| modifiers.has('blocked-calendar')
|| modifiers.has('blocked-out-of-range')
);
const selected = (
modifiers.has('selected')
|| modifiers.has('selected-start')
|| modifiers.has('selected-end')
);
const hoveredSpan = !selected && (
modifiers.has('hovered-span')
|| modifiers.has('after-hovered-start')
);
const isOutsideRange = modifiers.has('blocked-out-of-range');
const formattedDate = { date: day.format(ariaLabelFormat) };
let ariaLabel = getPhrase(chooseAvailableDate, formattedDate);
if (modifiers.has(BLOCKED_MODIFIER)) {
ariaLabel = getPhrase(dateIsUnavailable, formattedDate);
} else if (selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
}
return {
daySizeStyles,
useDefaultCursor,
selected,
hoveredSpan,
isOutsideRange,
ariaLabel,
};
}
| import getPhrase from './getPhrase';
import { BLOCKED_MODIFIER } from '../constants';
export default function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
const {
chooseAvailableDate,
dateIsUnavailable,
dateIsSelected,
} = phrases;
const daySizeStyles = {
width: daySize,
height: daySize - 1,
};
const useDefaultCursor = (
modifiers.has('blocked-minimum-nights')
|| modifiers.has('blocked-calendar')
|| modifiers.has('blocked-out-of-range')
);
const selected = (
modifiers.has('selected')
|| modifiers.has('selected-start')
|| modifiers.has('selected-end')
);
const hoveredSpan = !selected && (
modifiers.has('hovered-span')
|| modifiers.has('after-hovered-start')
);
const isOutsideRange = modifiers.has('blocked-out-of-range');
const formattedDate = { date: day.format(ariaLabelFormat) };
let ariaLabel = getPhrase(chooseAvailableDate, formattedDate);
if (modifiers.has(BLOCKED_MODIFIER) && selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
} else if (modifiers.has(BLOCKED_MODIFIER)) {
ariaLabel = getPhrase(dateIsUnavailable, formattedDate);
} else if (selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
}
return {
daySizeStyles,
useDefaultCursor,
selected,
hoveredSpan,
isOutsideRange,
ariaLabel,
};
}
| Fix incorrect VO for selected check-in date | Fix incorrect VO for selected check-in date
| JavaScript | mit | airbnb/react-dates | javascript | ## Code Before:
import getPhrase from './getPhrase';
import { BLOCKED_MODIFIER } from '../constants';
export default function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
const {
chooseAvailableDate,
dateIsUnavailable,
dateIsSelected,
} = phrases;
const daySizeStyles = {
width: daySize,
height: daySize - 1,
};
const useDefaultCursor = (
modifiers.has('blocked-minimum-nights')
|| modifiers.has('blocked-calendar')
|| modifiers.has('blocked-out-of-range')
);
const selected = (
modifiers.has('selected')
|| modifiers.has('selected-start')
|| modifiers.has('selected-end')
);
const hoveredSpan = !selected && (
modifiers.has('hovered-span')
|| modifiers.has('after-hovered-start')
);
const isOutsideRange = modifiers.has('blocked-out-of-range');
const formattedDate = { date: day.format(ariaLabelFormat) };
let ariaLabel = getPhrase(chooseAvailableDate, formattedDate);
if (modifiers.has(BLOCKED_MODIFIER)) {
ariaLabel = getPhrase(dateIsUnavailable, formattedDate);
} else if (selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
}
return {
daySizeStyles,
useDefaultCursor,
selected,
hoveredSpan,
isOutsideRange,
ariaLabel,
};
}
## Instruction:
Fix incorrect VO for selected check-in date
## Code After:
import getPhrase from './getPhrase';
import { BLOCKED_MODIFIER } from '../constants';
export default function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
const {
chooseAvailableDate,
dateIsUnavailable,
dateIsSelected,
} = phrases;
const daySizeStyles = {
width: daySize,
height: daySize - 1,
};
const useDefaultCursor = (
modifiers.has('blocked-minimum-nights')
|| modifiers.has('blocked-calendar')
|| modifiers.has('blocked-out-of-range')
);
const selected = (
modifiers.has('selected')
|| modifiers.has('selected-start')
|| modifiers.has('selected-end')
);
const hoveredSpan = !selected && (
modifiers.has('hovered-span')
|| modifiers.has('after-hovered-start')
);
const isOutsideRange = modifiers.has('blocked-out-of-range');
const formattedDate = { date: day.format(ariaLabelFormat) };
let ariaLabel = getPhrase(chooseAvailableDate, formattedDate);
if (modifiers.has(BLOCKED_MODIFIER) && selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
} else if (modifiers.has(BLOCKED_MODIFIER)) {
ariaLabel = getPhrase(dateIsUnavailable, formattedDate);
} else if (selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
}
return {
daySizeStyles,
useDefaultCursor,
selected,
hoveredSpan,
isOutsideRange,
ariaLabel,
};
}
| import getPhrase from './getPhrase';
import { BLOCKED_MODIFIER } from '../constants';
export default function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
const {
chooseAvailableDate,
dateIsUnavailable,
dateIsSelected,
} = phrases;
const daySizeStyles = {
width: daySize,
height: daySize - 1,
};
const useDefaultCursor = (
modifiers.has('blocked-minimum-nights')
|| modifiers.has('blocked-calendar')
|| modifiers.has('blocked-out-of-range')
);
const selected = (
modifiers.has('selected')
|| modifiers.has('selected-start')
|| modifiers.has('selected-end')
);
const hoveredSpan = !selected && (
modifiers.has('hovered-span')
|| modifiers.has('after-hovered-start')
);
const isOutsideRange = modifiers.has('blocked-out-of-range');
const formattedDate = { date: day.format(ariaLabelFormat) };
let ariaLabel = getPhrase(chooseAvailableDate, formattedDate);
+ if (modifiers.has(BLOCKED_MODIFIER) && selected) {
+ ariaLabel = getPhrase(dateIsSelected, formattedDate);
- if (modifiers.has(BLOCKED_MODIFIER)) {
+ } else if (modifiers.has(BLOCKED_MODIFIER)) {
? +++++++
ariaLabel = getPhrase(dateIsUnavailable, formattedDate);
} else if (selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
}
return {
daySizeStyles,
useDefaultCursor,
selected,
hoveredSpan,
isOutsideRange,
ariaLabel,
};
} | 4 | 0.076923 | 3 | 1 |
e30fdd809109f78ff9fe09875b6a2a4e700ef48a | src/com/qubling/sidekick/ModuleViewActivity.java | src/com/qubling/sidekick/ModuleViewActivity.java | package com.qubling.sidekick;
import com.qubling.sidekick.metacpan.result.Module;
import com.qubling.sidekick.widget.ModuleHelper;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class ModuleViewActivity extends Activity {
public static final String EXTRA_MODULE = "com.qubling.sidekick.intent.extra.MODULE";
private Module module;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.module_view);
Intent intent = getIntent();
module = (Module) intent.getParcelableExtra(EXTRA_MODULE);
View moduleHeader = findViewById(R.id.module_view_header);
ModuleHelper.updateItem(moduleHeader, module);
}
}
| package com.qubling.sidekick;
import com.qubling.sidekick.metacpan.result.Module;
import com.qubling.sidekick.widget.ModuleHelper;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class ModuleViewActivity extends Activity {
public static final String EXTRA_MODULE = "com.qubling.sidekick.intent.extra.MODULE";
private Module module;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.module_view);
Intent intent = getIntent();
module = (Module) intent.getParcelableExtra(EXTRA_MODULE);
View moduleHeader = findViewById(R.id.module_view_header);
ModuleHelper.updateItem(moduleHeader, module);
setTitle(module.getModuleName());
}
}
| Use the module name as the title | Use the module name as the title
| Java | artistic-2.0 | 1nv4d3r5/CPAN-Sidekick,zostay/CPAN-Sidekick,1nv4d3r5/CPAN-Sidekick,zostay/CPAN-Sidekick | java | ## Code Before:
package com.qubling.sidekick;
import com.qubling.sidekick.metacpan.result.Module;
import com.qubling.sidekick.widget.ModuleHelper;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class ModuleViewActivity extends Activity {
public static final String EXTRA_MODULE = "com.qubling.sidekick.intent.extra.MODULE";
private Module module;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.module_view);
Intent intent = getIntent();
module = (Module) intent.getParcelableExtra(EXTRA_MODULE);
View moduleHeader = findViewById(R.id.module_view_header);
ModuleHelper.updateItem(moduleHeader, module);
}
}
## Instruction:
Use the module name as the title
## Code After:
package com.qubling.sidekick;
import com.qubling.sidekick.metacpan.result.Module;
import com.qubling.sidekick.widget.ModuleHelper;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class ModuleViewActivity extends Activity {
public static final String EXTRA_MODULE = "com.qubling.sidekick.intent.extra.MODULE";
private Module module;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.module_view);
Intent intent = getIntent();
module = (Module) intent.getParcelableExtra(EXTRA_MODULE);
View moduleHeader = findViewById(R.id.module_view_header);
ModuleHelper.updateItem(moduleHeader, module);
setTitle(module.getModuleName());
}
}
| package com.qubling.sidekick;
import com.qubling.sidekick.metacpan.result.Module;
import com.qubling.sidekick.widget.ModuleHelper;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class ModuleViewActivity extends Activity {
public static final String EXTRA_MODULE = "com.qubling.sidekick.intent.extra.MODULE";
private Module module;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.module_view);
Intent intent = getIntent();
module = (Module) intent.getParcelableExtra(EXTRA_MODULE);
View moduleHeader = findViewById(R.id.module_view_header);
ModuleHelper.updateItem(moduleHeader, module);
+
+ setTitle(module.getModuleName());
}
} | 2 | 0.071429 | 2 | 0 |
58366dc23b55c0256633d1d9abb4fba7e475a13c | resource/js/components/UserList.js | resource/js/components/UserList.js | import React from 'react';
import UserPicture from './User/UserPicture';
export default class UserList extends React.Component {
render() {
const users = this.props.users.map((user) => {
return (
<a data-user-id={user._id} href={'/user/' + user.username} title={user.name}>
<UserPicture user={user} size="xs" />
</a>
);
});
return (
<p className="seen-user-list">
{users}
</p>
);
}
}
UserList.propTypes = {
users: React.PropTypes.array,
};
UserList.defaultProps = {
users: [],
};
| import React from 'react';
import UserPicture from './User/UserPicture';
export default class UserList extends React.Component {
render() {
const users = this.props.users.map((user) => {
return (
<a key={user._id} data-user-id={user._id} href={'/user/' + user.username} title={user.name}>
<UserPicture user={user} size="xs" />
</a>
);
});
return (
<p className="seen-user-list">
{users}
</p>
);
}
}
UserList.propTypes = {
users: React.PropTypes.array,
};
UserList.defaultProps = {
users: [],
};
| Add unique key to items | Add unique key to items
| JavaScript | mit | crow-misia/crowi,crowi/crowi,crowi/crowi,crow-misia/crowi,crowi/crowi | javascript | ## Code Before:
import React from 'react';
import UserPicture from './User/UserPicture';
export default class UserList extends React.Component {
render() {
const users = this.props.users.map((user) => {
return (
<a data-user-id={user._id} href={'/user/' + user.username} title={user.name}>
<UserPicture user={user} size="xs" />
</a>
);
});
return (
<p className="seen-user-list">
{users}
</p>
);
}
}
UserList.propTypes = {
users: React.PropTypes.array,
};
UserList.defaultProps = {
users: [],
};
## Instruction:
Add unique key to items
## Code After:
import React from 'react';
import UserPicture from './User/UserPicture';
export default class UserList extends React.Component {
render() {
const users = this.props.users.map((user) => {
return (
<a key={user._id} data-user-id={user._id} href={'/user/' + user.username} title={user.name}>
<UserPicture user={user} size="xs" />
</a>
);
});
return (
<p className="seen-user-list">
{users}
</p>
);
}
}
UserList.propTypes = {
users: React.PropTypes.array,
};
UserList.defaultProps = {
users: [],
};
| import React from 'react';
import UserPicture from './User/UserPicture';
export default class UserList extends React.Component {
render() {
const users = this.props.users.map((user) => {
return (
- <a data-user-id={user._id} href={'/user/' + user.username} title={user.name}>
+ <a key={user._id} data-user-id={user._id} href={'/user/' + user.username} title={user.name}>
? +++++++++++++++
<UserPicture user={user} size="xs" />
</a>
);
});
return (
<p className="seen-user-list">
{users}
</p>
);
}
}
UserList.propTypes = {
users: React.PropTypes.array,
};
UserList.defaultProps = {
users: [],
}; | 2 | 0.068966 | 1 | 1 |
bcbdd12ce1b2ddf7a54ce57e38dc9a3f35353d65 | components/locale-provider/LocaleReceiver.tsx | components/locale-provider/LocaleReceiver.tsx | import * as React from 'react';
import PropTypes from 'prop-types';
export interface LocaleReceiverProps {
componentName: string;
defaultLocale: object | Function;
children: (locale, localeCode?) => React.ReactElement<any>;
}
export interface LocaleReceiverContext {
antLocale?: { [key: string]: any };
}
export default class LocaleReceiver extends React.Component<LocaleReceiverProps> {
static contextTypes = {
antLocale: PropTypes.object,
};
context: LocaleReceiverContext;
getLocale() {
const { componentName, defaultLocale } = this.props;
const { antLocale } = this.context;
const localeFromContext = antLocale && antLocale[componentName];
return {
...(typeof defaultLocale === 'function' ? defaultLocale() : defaultLocale),
...(localeFromContext || {}),
};
}
getLocaleCode() {
const { antLocale } = this.context;
const localeCode = antLocale && antLocale.locale;
// Had use LocaleProvide but didn't set locale
if (antLocale && antLocale.exist && !localeCode) {
return 'en-us';
}
return localeCode;
}
render() {
return this.props.children(this.getLocale(), this.getLocaleCode());
}
}
| import * as React from 'react';
import PropTypes from 'prop-types';
export interface LocaleReceiverProps {
componentName: string;
defaultLocale: object | Function;
children: (locale: object, localeCode?: string) => React.ReactElement<any>;
}
export interface LocaleReceiverContext {
antLocale?: { [key: string]: any };
}
export default class LocaleReceiver extends React.Component<LocaleReceiverProps> {
static contextTypes = {
antLocale: PropTypes.object,
};
context: LocaleReceiverContext;
getLocale() {
const { componentName, defaultLocale } = this.props;
const { antLocale } = this.context;
const localeFromContext = antLocale && antLocale[componentName];
return {
...(typeof defaultLocale === 'function' ? defaultLocale() : defaultLocale),
...(localeFromContext || {}),
};
}
getLocaleCode() {
const { antLocale } = this.context;
const localeCode = antLocale && antLocale.locale;
// Had use LocaleProvide but didn't set locale
if (antLocale && antLocale.exist && !localeCode) {
return 'en-us';
}
return localeCode;
}
render() {
return this.props.children(this.getLocale(), this.getLocaleCode());
}
}
| Fix implicit any error for LocalProvider | Fix implicit any error for LocalProvider
| TypeScript | mit | icaife/ant-design,RaoHai/ant-design,RaoHai/ant-design,elevensky/ant-design,RaoHai/ant-design,ant-design/ant-design,elevensky/ant-design,havefive/ant-design,zheeeng/ant-design,icaife/ant-design,zheeeng/ant-design,havefive/ant-design,icaife/ant-design,zheeeng/ant-design,ant-design/ant-design,elevensky/ant-design,icaife/ant-design,havefive/ant-design,ant-design/ant-design,RaoHai/ant-design,havefive/ant-design,zheeeng/ant-design,elevensky/ant-design,ant-design/ant-design | typescript | ## Code Before:
import * as React from 'react';
import PropTypes from 'prop-types';
export interface LocaleReceiverProps {
componentName: string;
defaultLocale: object | Function;
children: (locale, localeCode?) => React.ReactElement<any>;
}
export interface LocaleReceiverContext {
antLocale?: { [key: string]: any };
}
export default class LocaleReceiver extends React.Component<LocaleReceiverProps> {
static contextTypes = {
antLocale: PropTypes.object,
};
context: LocaleReceiverContext;
getLocale() {
const { componentName, defaultLocale } = this.props;
const { antLocale } = this.context;
const localeFromContext = antLocale && antLocale[componentName];
return {
...(typeof defaultLocale === 'function' ? defaultLocale() : defaultLocale),
...(localeFromContext || {}),
};
}
getLocaleCode() {
const { antLocale } = this.context;
const localeCode = antLocale && antLocale.locale;
// Had use LocaleProvide but didn't set locale
if (antLocale && antLocale.exist && !localeCode) {
return 'en-us';
}
return localeCode;
}
render() {
return this.props.children(this.getLocale(), this.getLocaleCode());
}
}
## Instruction:
Fix implicit any error for LocalProvider
## Code After:
import * as React from 'react';
import PropTypes from 'prop-types';
export interface LocaleReceiverProps {
componentName: string;
defaultLocale: object | Function;
children: (locale: object, localeCode?: string) => React.ReactElement<any>;
}
export interface LocaleReceiverContext {
antLocale?: { [key: string]: any };
}
export default class LocaleReceiver extends React.Component<LocaleReceiverProps> {
static contextTypes = {
antLocale: PropTypes.object,
};
context: LocaleReceiverContext;
getLocale() {
const { componentName, defaultLocale } = this.props;
const { antLocale } = this.context;
const localeFromContext = antLocale && antLocale[componentName];
return {
...(typeof defaultLocale === 'function' ? defaultLocale() : defaultLocale),
...(localeFromContext || {}),
};
}
getLocaleCode() {
const { antLocale } = this.context;
const localeCode = antLocale && antLocale.locale;
// Had use LocaleProvide but didn't set locale
if (antLocale && antLocale.exist && !localeCode) {
return 'en-us';
}
return localeCode;
}
render() {
return this.props.children(this.getLocale(), this.getLocaleCode());
}
}
| import * as React from 'react';
import PropTypes from 'prop-types';
export interface LocaleReceiverProps {
componentName: string;
defaultLocale: object | Function;
- children: (locale, localeCode?) => React.ReactElement<any>;
+ children: (locale: object, localeCode?: string) => React.ReactElement<any>;
? ++++++++ ++++++++
}
export interface LocaleReceiverContext {
antLocale?: { [key: string]: any };
}
export default class LocaleReceiver extends React.Component<LocaleReceiverProps> {
static contextTypes = {
antLocale: PropTypes.object,
};
context: LocaleReceiverContext;
getLocale() {
const { componentName, defaultLocale } = this.props;
const { antLocale } = this.context;
const localeFromContext = antLocale && antLocale[componentName];
return {
...(typeof defaultLocale === 'function' ? defaultLocale() : defaultLocale),
...(localeFromContext || {}),
};
}
getLocaleCode() {
const { antLocale } = this.context;
const localeCode = antLocale && antLocale.locale;
// Had use LocaleProvide but didn't set locale
if (antLocale && antLocale.exist && !localeCode) {
return 'en-us';
}
return localeCode;
}
render() {
return this.props.children(this.getLocale(), this.getLocaleCode());
}
} | 2 | 0.045455 | 1 | 1 |
e3e7a0af436eec99a3bf3004f045f5270add61c1 | .travis.yml | .travis.yml | language: rust
dist: trusty
sudo: true
rust:
- stable
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
global:
- RUST_BACKTRACE="1"
matrix:
- TEST_DIR=core
- TEST_DIR=chain
- TEST_DIR=p2p
- TEST_DIR=api
- TEST_DIR=pool
- RUST_TEST_THREADS=1 TEST_DIR=grin
script: cd $TEST_DIR && cargo test --verbose
| language: rust
dist: trusty
sudo: true
rust:
- stable
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
global:
- RUST_BACKTRACE="1"
matrix:
- TEST_DIR=core
- TEST_DIR=chain
- RUST_TEST_THREADS=1 TEST_DIR=p2p
- TEST_DIR=api
- TEST_DIR=pool
- RUST_TEST_THREADS=1 TEST_DIR=grin
script: cd $TEST_DIR && cargo test --verbose
| Set Sequencial for p2p testing | Set Sequencial for p2p testing
| YAML | apache-2.0 | Latrasis/grin,Latrasis/grin,Latrasis/grin,Latrasis/grin,Latrasis/grin,Latrasis/grin | yaml | ## Code Before:
language: rust
dist: trusty
sudo: true
rust:
- stable
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
global:
- RUST_BACKTRACE="1"
matrix:
- TEST_DIR=core
- TEST_DIR=chain
- TEST_DIR=p2p
- TEST_DIR=api
- TEST_DIR=pool
- RUST_TEST_THREADS=1 TEST_DIR=grin
script: cd $TEST_DIR && cargo test --verbose
## Instruction:
Set Sequencial for p2p testing
## Code After:
language: rust
dist: trusty
sudo: true
rust:
- stable
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
global:
- RUST_BACKTRACE="1"
matrix:
- TEST_DIR=core
- TEST_DIR=chain
- RUST_TEST_THREADS=1 TEST_DIR=p2p
- TEST_DIR=api
- TEST_DIR=pool
- RUST_TEST_THREADS=1 TEST_DIR=grin
script: cd $TEST_DIR && cargo test --verbose
| language: rust
dist: trusty
sudo: true
rust:
- stable
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
global:
- RUST_BACKTRACE="1"
matrix:
- TEST_DIR=core
- TEST_DIR=chain
- - TEST_DIR=p2p
+ - RUST_TEST_THREADS=1 TEST_DIR=p2p
- TEST_DIR=api
- TEST_DIR=pool
- RUST_TEST_THREADS=1 TEST_DIR=grin
script: cd $TEST_DIR && cargo test --verbose | 2 | 0.08 | 1 | 1 |
9d1225f59dab636acdc8233a0dc42f6afe44ecb4 | app/views/contents/edit.html.haml | app/views/contents/edit.html.haml | - title "Правка — #{@content.title || @content.path}"
%article.page.edit-content
%h1
Изменение страницы
- if @content.title
«<a href="#{@content.path}">#{@content.title}</a>»
= form_tag @content.path, method: :put do
%textarea( name="text" role="content-textarea" )= @content.versions.last.try(:text)
- content_for :controls do
.page-controls.edit-content
= button('Сохранить', role: 'save-content')
%a.cancel{ href: @content.path } Отмена
| - title "Правка — #{@content.title || @content.path}"
%article.page.edit-content
%h1
Изменение
- if @content.root?
главной страницы
- else
страницы
- if @content.title
«<a href="#{@content.path}">#{@content.title}</a>»
= form_tag @content.path, method: :put do
%textarea( name="text" role="content-textarea" )= @content.versions.last.try(:text)
- content_for :controls do
.page-controls.edit-content
= button('Сохранить', role: 'save-content')
%a.cancel{ href: @content.path } Отмена
| Change title on root page edit | Change title on root page edit
| Haml | agpl-3.0 | ai/dis.spbstu.ru | haml | ## Code Before:
- title "Правка — #{@content.title || @content.path}"
%article.page.edit-content
%h1
Изменение страницы
- if @content.title
«<a href="#{@content.path}">#{@content.title}</a>»
= form_tag @content.path, method: :put do
%textarea( name="text" role="content-textarea" )= @content.versions.last.try(:text)
- content_for :controls do
.page-controls.edit-content
= button('Сохранить', role: 'save-content')
%a.cancel{ href: @content.path } Отмена
## Instruction:
Change title on root page edit
## Code After:
- title "Правка — #{@content.title || @content.path}"
%article.page.edit-content
%h1
Изменение
- if @content.root?
главной страницы
- else
страницы
- if @content.title
«<a href="#{@content.path}">#{@content.title}</a>»
= form_tag @content.path, method: :put do
%textarea( name="text" role="content-textarea" )= @content.versions.last.try(:text)
- content_for :controls do
.page-controls.edit-content
= button('Сохранить', role: 'save-content')
%a.cancel{ href: @content.path } Отмена
| - title "Правка — #{@content.title || @content.path}"
%article.page.edit-content
%h1
- Изменение страницы
+ Изменение
+ - if @content.root?
+ главной страницы
+ - else
+ страницы
- - if @content.title
+ - if @content.title
? ++
- «<a href="#{@content.path}">#{@content.title}</a>»
+ «<a href="#{@content.path}">#{@content.title}</a>»
? ++
= form_tag @content.path, method: :put do
%textarea( name="text" role="content-textarea" )= @content.versions.last.try(:text)
- content_for :controls do
.page-controls.edit-content
= button('Сохранить', role: 'save-content')
%a.cancel{ href: @content.path } Отмена | 10 | 0.666667 | 7 | 3 |
0f23d7c32669228cbb280d1a40dd43903d677cdd | spec/models/bus_stop_spec.rb | spec/models/bus_stop_spec.rb | require 'spec_helper'
describe BusStop do
describe 'assign_completion_timestamp' do
context 'bus stop is completed' do
# need some time cop up in here
it 'assigns the current time to completed_at' do
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed at' do
end
end
end
describe 'decide_if_completed_by' do
context 'bus stop completed attribute changed' do
context 'bus stop is completed' do
it 'assigns user to completed by' do
stop_1 = create :bus_stop, completed: true
stop_1.update! completed: false
# how to access current user
# stop_1.decide_if_completed_by current_user
# user.fetch(:completed_by).to be current_user
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed by' do
end
end
end
end
end
| require 'spec_helper'
describe BusStop do
describe 'assign_completion_timestamp' do
context 'bus stop is completed' do
# need some time cop up in here
it 'assigns the current time to completed_at' do
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed at' do
end
end
end
describe 'decide_if_completed_by' do
context 'bus stop completed attribute changed' do
context 'bus stop is completed' do
it 'assigns user to completed by' do
stop_1 = create :bus_stop, completed: true
stop_1.update! completed: false
# how to access current user
# stop_1.decide_if_completed_by current_user
# user.fetch(:completed_by).to be current_user
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed by' do
end
end
end
end
describe 'completed scope' do
end
describe 'not_started scope' do
end
describe 'pending scope' do
end
end
| Make sure to test these models | Make sure to test these models
| Ruby | mit | umts/stop-project,umts/stop-project,umts/stop-project | ruby | ## Code Before:
require 'spec_helper'
describe BusStop do
describe 'assign_completion_timestamp' do
context 'bus stop is completed' do
# need some time cop up in here
it 'assigns the current time to completed_at' do
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed at' do
end
end
end
describe 'decide_if_completed_by' do
context 'bus stop completed attribute changed' do
context 'bus stop is completed' do
it 'assigns user to completed by' do
stop_1 = create :bus_stop, completed: true
stop_1.update! completed: false
# how to access current user
# stop_1.decide_if_completed_by current_user
# user.fetch(:completed_by).to be current_user
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed by' do
end
end
end
end
end
## Instruction:
Make sure to test these models
## Code After:
require 'spec_helper'
describe BusStop do
describe 'assign_completion_timestamp' do
context 'bus stop is completed' do
# need some time cop up in here
it 'assigns the current time to completed_at' do
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed at' do
end
end
end
describe 'decide_if_completed_by' do
context 'bus stop completed attribute changed' do
context 'bus stop is completed' do
it 'assigns user to completed by' do
stop_1 = create :bus_stop, completed: true
stop_1.update! completed: false
# how to access current user
# stop_1.decide_if_completed_by current_user
# user.fetch(:completed_by).to be current_user
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed by' do
end
end
end
end
describe 'completed scope' do
end
describe 'not_started scope' do
end
describe 'pending scope' do
end
end
| require 'spec_helper'
describe BusStop do
describe 'assign_completion_timestamp' do
context 'bus stop is completed' do
# need some time cop up in here
it 'assigns the current time to completed_at' do
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed at' do
end
end
end
describe 'decide_if_completed_by' do
context 'bus stop completed attribute changed' do
context 'bus stop is completed' do
it 'assigns user to completed by' do
stop_1 = create :bus_stop, completed: true
stop_1.update! completed: false
# how to access current user
# stop_1.decide_if_completed_by current_user
# user.fetch(:completed_by).to be current_user
end
end
context 'bus stop is not completed' do
it 'assigns nil to completed by' do
end
end
end
end
+
+ describe 'completed scope' do
+ end
+
+ describe 'not_started scope' do
+ end
+
+ describe 'pending scope' do
+ end
end | 9 | 0.272727 | 9 | 0 |
ca5935d1700485dff9623e903ebdf7ed587ac27e | examples/methods/list.rb | examples/methods/list.rb | methods = Mollie::Method.all
# Filter by amount and currency
methods = Mollie::Method.all(amount: { value: '100.00', currency: 'EUR' })
| methods = Mollie::Method.all
# Filter by amount and currency
methods = Mollie::Method.all(amount: { value: '100.00', currency: 'EUR' })
# Retrieve all payment methods that Mollie offers and can be activated by
# the Organization.
methods = Mollie::Method.all_available
| Add example to retrieve all available payment methods | Add example to retrieve all available payment methods
| Ruby | bsd-2-clause | mollie/mollie-api-ruby,mollie/mollie-api-ruby | ruby | ## Code Before:
methods = Mollie::Method.all
# Filter by amount and currency
methods = Mollie::Method.all(amount: { value: '100.00', currency: 'EUR' })
## Instruction:
Add example to retrieve all available payment methods
## Code After:
methods = Mollie::Method.all
# Filter by amount and currency
methods = Mollie::Method.all(amount: { value: '100.00', currency: 'EUR' })
# Retrieve all payment methods that Mollie offers and can be activated by
# the Organization.
methods = Mollie::Method.all_available
| methods = Mollie::Method.all
# Filter by amount and currency
methods = Mollie::Method.all(amount: { value: '100.00', currency: 'EUR' })
+
+ # Retrieve all payment methods that Mollie offers and can be activated by
+ # the Organization.
+ methods = Mollie::Method.all_available | 4 | 1 | 4 | 0 |
7bb0b7d5ecfd8bddd7a865c32df9316a7908c286 | src/post-polyfill.js | src/post-polyfill.js | /**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
(function(scope) {
'use strict';
HTMLImports.whenReady(function() {
requestAnimationFrame(function() {
window.dispatchEvent(new CustomEvent('WebComponentsReady'));
});
});
if (customElements && customElements.polyfillWrapFlushCallback) {
// Here we ensure that the public `HTMLImports.whenReady`
// always comes *after* custom elements have upgraded.
let flushCallback;
function runAndClearCallback() {
if (flushCallback) {
let cb = flushCallback;
flushCallback = null;
cb();
}
}
let origWhenReady = HTMLImports.whenReady;
customElements.polyfillWrapFlushCallback(function(cb) {
flushCallback = cb;
origWhenReady(runAndClearCallback);
});
HTMLImports.whenReady = function(cb) {
origWhenReady(function() {
runAndClearCallback();
cb();
});
}
}
})(window.WebComponents);
| /**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
(function(scope) {
'use strict';
if (customElements && customElements.polyfillWrapFlushCallback) {
// Here we ensure that the public `HTMLImports.whenReady`
// always comes *after* custom elements have upgraded.
let flushCallback;
function runAndClearCallback() {
if (flushCallback) {
let cb = flushCallback;
flushCallback = null;
cb();
}
}
let origWhenReady = HTMLImports.whenReady;
customElements.polyfillWrapFlushCallback(function(cb) {
flushCallback = cb;
origWhenReady(runAndClearCallback);
});
HTMLImports.whenReady = function(cb) {
origWhenReady(function() {
runAndClearCallback();
cb();
});
}
}
HTMLImports.whenReady(function() {
requestAnimationFrame(function() {
window.dispatchEvent(new CustomEvent('WebComponentsReady'));
});
});
})(window.WebComponents);
| Move dispatching WebComponentsReady until after HTMLImports.whenReady is patched. | Move dispatching WebComponentsReady until after HTMLImports.whenReady is patched.
| JavaScript | bsd-3-clause | webcomponents/polyfills,webcomponents/polyfills,webcomponents/polyfills | javascript | ## Code Before:
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
(function(scope) {
'use strict';
HTMLImports.whenReady(function() {
requestAnimationFrame(function() {
window.dispatchEvent(new CustomEvent('WebComponentsReady'));
});
});
if (customElements && customElements.polyfillWrapFlushCallback) {
// Here we ensure that the public `HTMLImports.whenReady`
// always comes *after* custom elements have upgraded.
let flushCallback;
function runAndClearCallback() {
if (flushCallback) {
let cb = flushCallback;
flushCallback = null;
cb();
}
}
let origWhenReady = HTMLImports.whenReady;
customElements.polyfillWrapFlushCallback(function(cb) {
flushCallback = cb;
origWhenReady(runAndClearCallback);
});
HTMLImports.whenReady = function(cb) {
origWhenReady(function() {
runAndClearCallback();
cb();
});
}
}
})(window.WebComponents);
## Instruction:
Move dispatching WebComponentsReady until after HTMLImports.whenReady is patched.
## Code After:
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
(function(scope) {
'use strict';
if (customElements && customElements.polyfillWrapFlushCallback) {
// Here we ensure that the public `HTMLImports.whenReady`
// always comes *after* custom elements have upgraded.
let flushCallback;
function runAndClearCallback() {
if (flushCallback) {
let cb = flushCallback;
flushCallback = null;
cb();
}
}
let origWhenReady = HTMLImports.whenReady;
customElements.polyfillWrapFlushCallback(function(cb) {
flushCallback = cb;
origWhenReady(runAndClearCallback);
});
HTMLImports.whenReady = function(cb) {
origWhenReady(function() {
runAndClearCallback();
cb();
});
}
}
HTMLImports.whenReady(function() {
requestAnimationFrame(function() {
window.dispatchEvent(new CustomEvent('WebComponentsReady'));
});
});
})(window.WebComponents);
| /**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
(function(scope) {
'use strict';
-
- HTMLImports.whenReady(function() {
- requestAnimationFrame(function() {
- window.dispatchEvent(new CustomEvent('WebComponentsReady'));
- });
- });
if (customElements && customElements.polyfillWrapFlushCallback) {
// Here we ensure that the public `HTMLImports.whenReady`
// always comes *after* custom elements have upgraded.
let flushCallback;
function runAndClearCallback() {
if (flushCallback) {
let cb = flushCallback;
flushCallback = null;
cb();
}
}
let origWhenReady = HTMLImports.whenReady;
customElements.polyfillWrapFlushCallback(function(cb) {
flushCallback = cb;
origWhenReady(runAndClearCallback);
});
HTMLImports.whenReady = function(cb) {
origWhenReady(function() {
runAndClearCallback();
cb();
});
}
}
+ HTMLImports.whenReady(function() {
+ requestAnimationFrame(function() {
+ window.dispatchEvent(new CustomEvent('WebComponentsReady'));
+ });
+ });
+
})(window.WebComponents); | 12 | 0.255319 | 6 | 6 |
33719bab88988c72fb07982ef7fc0cdf03c56d51 | build.sbt | build.sbt | sbtPlugin := true
organization := "net.ground5hark.sbt"
name := "sbt-closure"
scalaVersion := "2.10.6"
libraryDependencies += "com.google.javascript" % "closure-compiler" % "v20160517"
addSbtPlugin("com.typesafe.sbt" %% "sbt-web" % "1.4.0")
scriptedSettings
scriptedLaunchOpts ++= Seq(
"-Xmx2048M",
"-XX:MaxPermSize=512M",
s"-Dproject.version=${version.value}"
)
| sbtPlugin := true
organization := "com.26lights"
name := "sbt-closure"
scalaVersion := "2.10.6"
libraryDependencies += "com.google.javascript" % "closure-compiler" % "v20160517"
addSbtPlugin("com.typesafe.sbt" %% "sbt-web" % "1.4.0")
scriptedSettings
scriptedLaunchOpts ++= Seq(
"-Xmx2048M",
"-XX:MaxPermSize=512M",
s"-Dproject.version=${version.value}"
)
| Change organisation to avoid publish clash. | Change organisation to avoid publish clash.
| Scala | mit | margussipria/sbt-closure | scala | ## Code Before:
sbtPlugin := true
organization := "net.ground5hark.sbt"
name := "sbt-closure"
scalaVersion := "2.10.6"
libraryDependencies += "com.google.javascript" % "closure-compiler" % "v20160517"
addSbtPlugin("com.typesafe.sbt" %% "sbt-web" % "1.4.0")
scriptedSettings
scriptedLaunchOpts ++= Seq(
"-Xmx2048M",
"-XX:MaxPermSize=512M",
s"-Dproject.version=${version.value}"
)
## Instruction:
Change organisation to avoid publish clash.
## Code After:
sbtPlugin := true
organization := "com.26lights"
name := "sbt-closure"
scalaVersion := "2.10.6"
libraryDependencies += "com.google.javascript" % "closure-compiler" % "v20160517"
addSbtPlugin("com.typesafe.sbt" %% "sbt-web" % "1.4.0")
scriptedSettings
scriptedLaunchOpts ++= Seq(
"-Xmx2048M",
"-XX:MaxPermSize=512M",
s"-Dproject.version=${version.value}"
)
| sbtPlugin := true
- organization := "net.ground5hark.sbt"
+ organization := "com.26lights"
name := "sbt-closure"
scalaVersion := "2.10.6"
libraryDependencies += "com.google.javascript" % "closure-compiler" % "v20160517"
addSbtPlugin("com.typesafe.sbt" %% "sbt-web" % "1.4.0")
scriptedSettings
scriptedLaunchOpts ++= Seq(
"-Xmx2048M",
"-XX:MaxPermSize=512M",
s"-Dproject.version=${version.value}"
)
| 2 | 0.1 | 1 | 1 |
fa36fc3301e7db47d72d0cd7c47bddf30cd7719d | 06_test/unit_test_func.py | 06_test/unit_test_func.py | import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
res = my_add(1, 2)
self.assertEqual(res, 3)
if __name__ == "__main__":
unittest.main()
| import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
print("Test begin")
res = my_add(1, 2)
self.assertEqual(res, 3)
def setUp(self):
print("Setup")
def tearDown(self):
print("Tear down")
if __name__ == "__main__":
unittest.main()
| Test unit test constructor and destructor | Test unit test constructor and destructor
| Python | bsd-2-clause | zzz0072/Python_Exercises,zzz0072/Python_Exercises | python | ## Code Before:
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
res = my_add(1, 2)
self.assertEqual(res, 3)
if __name__ == "__main__":
unittest.main()
## Instruction:
Test unit test constructor and destructor
## Code After:
import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
print("Test begin")
res = my_add(1, 2)
self.assertEqual(res, 3)
def setUp(self):
print("Setup")
def tearDown(self):
print("Tear down")
if __name__ == "__main__":
unittest.main()
| import unittest
from my_calc import my_add
class test_func(unittest.TestCase):
def test_my_add(self):
+ print("Test begin")
res = my_add(1, 2)
self.assertEqual(res, 3)
+
+ def setUp(self):
+ print("Setup")
+
+ def tearDown(self):
+ print("Tear down")
if __name__ == "__main__":
unittest.main()
| 7 | 0.7 | 7 | 0 |
fbd7da82e8231c025eaaf9dd60f94d104583c02c | crmapp/accounts/urls.py | crmapp/accounts/urls.py | from django.conf.urls import patterns, url
account_urls = patterns('',
url(r'^$',
'crmapp.accounts.views.account_detail', name='account_detail'
),
)
| from django.conf.urls import patterns, url
account_urls = patterns('',
url(r'^$',
'crmapp.accounts.views.account_detail', name='account_detail'
),
url(r'^edit/$',
'crmapp.accounts.views.account_cru', name='account_update'
),
)
| Create the Account Detail Page - Part II > Edit Account - Create URL Conf | Create the Account Detail Page - Part II > Edit Account - Create URL Conf
| Python | mit | tabdon/crmeasyapp,tabdon/crmeasyapp,deenaariff/Django | python | ## Code Before:
from django.conf.urls import patterns, url
account_urls = patterns('',
url(r'^$',
'crmapp.accounts.views.account_detail', name='account_detail'
),
)
## Instruction:
Create the Account Detail Page - Part II > Edit Account - Create URL Conf
## Code After:
from django.conf.urls import patterns, url
account_urls = patterns('',
url(r'^$',
'crmapp.accounts.views.account_detail', name='account_detail'
),
url(r'^edit/$',
'crmapp.accounts.views.account_cru', name='account_update'
),
)
| from django.conf.urls import patterns, url
account_urls = patterns('',
url(r'^$',
'crmapp.accounts.views.account_detail', name='account_detail'
),
+ url(r'^edit/$',
+ 'crmapp.accounts.views.account_cru', name='account_update'
+ ),
) | 3 | 0.375 | 3 | 0 |
6fc609b8577396dda370d68c89af5741b41677db | .travis.yml | .travis.yml | sudo: required
language: python
services:
- docker
before_install:
- docker pull craigrhodes/fs_site
script:
- docker run -e "FS_PORT=8000" -v "$(pwd):/usr/src/fs_site" -p 8000:8000 craigrhodes/fs_site ./docker_test.sh
| sudo: required
language: python
services:
- docker
before_install:
- docker pull craigrhodes/fs_site
- service mysql stop
script:
- docker run -e "FS_PORT=8000" -v "$(pwd):/usr/src/fs_site" -p 8000:8000 craigrhodes/fs_site ./docker_test.sh
| Stop mysql service in test container | Stop mysql service in test container
| YAML | mit | CraigRhodes/fs_site,CraigRhodes/fs_site,CraigRhodes/fs_site,CraigRhodes/fs_site | yaml | ## Code Before:
sudo: required
language: python
services:
- docker
before_install:
- docker pull craigrhodes/fs_site
script:
- docker run -e "FS_PORT=8000" -v "$(pwd):/usr/src/fs_site" -p 8000:8000 craigrhodes/fs_site ./docker_test.sh
## Instruction:
Stop mysql service in test container
## Code After:
sudo: required
language: python
services:
- docker
before_install:
- docker pull craigrhodes/fs_site
- service mysql stop
script:
- docker run -e "FS_PORT=8000" -v "$(pwd):/usr/src/fs_site" -p 8000:8000 craigrhodes/fs_site ./docker_test.sh
| sudo: required
language: python
services:
- docker
before_install:
- docker pull craigrhodes/fs_site
+ - service mysql stop
script:
- docker run -e "FS_PORT=8000" -v "$(pwd):/usr/src/fs_site" -p 8000:8000 craigrhodes/fs_site ./docker_test.sh | 1 | 0.083333 | 1 | 0 |
f37bef00317e754137dcd3b505b6ec9e709cf288 | README.md | README.md | redmine_issues_merge
====================
redmine plugin to merge issues
| redmine_issues_merge
====================
redmine plugin to merge issues
**PLUGIN IS NOT PRODUCTION READY YET. PLEASE DO NOT USE.** | Add warning that plugin is not production ready. | Add warning that plugin is not production ready.
| Markdown | mit | thambley/redmine_issues_merge | markdown | ## Code Before:
redmine_issues_merge
====================
redmine plugin to merge issues
## Instruction:
Add warning that plugin is not production ready.
## Code After:
redmine_issues_merge
====================
redmine plugin to merge issues
**PLUGIN IS NOT PRODUCTION READY YET. PLEASE DO NOT USE.** | redmine_issues_merge
====================
redmine plugin to merge issues
+
+ **PLUGIN IS NOT PRODUCTION READY YET. PLEASE DO NOT USE.** | 2 | 0.5 | 2 | 0 |
513ff9cbf832d5bc674769c3737a85ac2fee6586 | CHANGELOG.md | CHANGELOG.md |
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
18.0.4 (2018-11-20)
===================
- Support OSF signup via ORCiD login
18.0.3 (2018-11-09)
===================
- Add branded login support for ecoevorxiv and banglarxiv
18.0.2 (2018-11-02)
===================
- Fix typo in CHANGELOG.md
18.0.1 (2018-11-02)
===================
- Add CHANGELOG.md
18.0.0 (2018-10-26)
===================
- Fix the infinite loop caused by invalid verification key
|
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
18.0.6 (2018-12-18)
===================
- Add branded login support for mediarxiv
18.0.5 (2018-12-12)
===================
- Allow empty REMOTE\_UESR header during institution auth
18.0.4 (2018-11-20)
===================
- Support OSF signup via ORCiD login
18.0.3 (2018-11-09)
===================
- Add branded login support for ecoevorxiv and banglarxiv
18.0.2 (2018-11-02)
===================
- Fix typo in CHANGELOG.md
18.0.1 (2018-11-02)
===================
- Add CHANGELOG.md
18.0.0 (2018-10-26)
===================
- Fix the infinite loop caused by invalid verification key
| Update changelog for 18.0.5 and 18.0.6 | Update changelog for 18.0.5 and 18.0.6
| Markdown | apache-2.0 | CenterForOpenScience/cas-overlay,CenterForOpenScience/cas-overlay | markdown | ## Code Before:
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
18.0.4 (2018-11-20)
===================
- Support OSF signup via ORCiD login
18.0.3 (2018-11-09)
===================
- Add branded login support for ecoevorxiv and banglarxiv
18.0.2 (2018-11-02)
===================
- Fix typo in CHANGELOG.md
18.0.1 (2018-11-02)
===================
- Add CHANGELOG.md
18.0.0 (2018-10-26)
===================
- Fix the infinite loop caused by invalid verification key
## Instruction:
Update changelog for 18.0.5 and 18.0.6
## Code After:
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
18.0.6 (2018-12-18)
===================
- Add branded login support for mediarxiv
18.0.5 (2018-12-12)
===================
- Allow empty REMOTE\_UESR header during institution auth
18.0.4 (2018-11-20)
===================
- Support OSF signup via ORCiD login
18.0.3 (2018-11-09)
===================
- Add branded login support for ecoevorxiv and banglarxiv
18.0.2 (2018-11-02)
===================
- Fix typo in CHANGELOG.md
18.0.1 (2018-11-02)
===================
- Add CHANGELOG.md
18.0.0 (2018-10-26)
===================
- Fix the infinite loop caused by invalid verification key
|
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
+
+ 18.0.6 (2018-12-18)
+ ===================
+
+ - Add branded login support for mediarxiv
+
+ 18.0.5 (2018-12-12)
+ ===================
+
+ - Allow empty REMOTE\_UESR header during institution auth
18.0.4 (2018-11-20)
===================
- Support OSF signup via ORCiD login
18.0.3 (2018-11-09)
===================
- Add branded login support for ecoevorxiv and banglarxiv
18.0.2 (2018-11-02)
===================
- Fix typo in CHANGELOG.md
18.0.1 (2018-11-02)
===================
- Add CHANGELOG.md
18.0.0 (2018-10-26)
===================
- Fix the infinite loop caused by invalid verification key | 10 | 0.37037 | 10 | 0 |
d86e8330025a9023dd65de9f11d524291d505658 | Demo/Resources/CurrentTest.html | Demo/Resources/CurrentTest.html | <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<h2>Core Text Bugs</h2>
<h3>Bold for Chinese Glyphs</h3>
<p>This is a bug that was present before iOS 6, the Chinese glyphs in the following line would be bold if the locale was set to Chinese due to an incorrect entry in the global font cascade table. Filed as rdar://11262229</p>
<p style='font-size:25.0pt'>English and 中文 -- Chinese characters </p>
<h3>Italic for Chinese Glyphs in Fallback</h3>
<p style="font-size:25px;">东方盖饭</p>
<p style="font-size:25px;font-style:italic;">东方盖饭</p>
<h3>Extra space above lines with whitespace glyphs</h3>
<p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p>
<p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p> | <head>
<style>
a:active {color:#0000FF;} /* selected link */
</style>
</head>
<body>
<p style="font-size:25px">Some text with a <u>Ag</u> <u>Bg</u> <a href="http://www.drobnik.com">Hg Hg Hg</a></p>
<p style="font-size:50px">Some text with a <u>Hg</u> <a href="http://www.drobnik.com">Hg Hg Hg</a></p>
</body> | Test file for hyperlink highlighting | Test file for hyperlink highlighting
| HTML | bsd-2-clause | pegli/DTCoreText,jingchunYuan/DTCoreText,wordnik/DTCoreText,mirego/DTCoreText,pivotaltracker/DTCoreText,ipodishima/DTCoreText,artifacts/DTCoreText,esteluk/DTCoreText,siuying/DTCoreText,yifan/DTCoreText,siuying/DTCoreText,qskycolor/DTCoreText,depl0y/DTCoreText,sidslog/DTCoreText,badoo/DTCoreText,liuslevis/DTCoreText,wordnik/DTCoreText,bnickel/DTCoreText,goodheart/DTCoreText,z8927623/DTCoreText,trispo/DTCoreText,SanjoDeundiak/DTCoreText,ricobeck/DTCoreText,artifacts/DTCoreText,gsempe/DTCoreText,niklassaers/DTCoreText,thusfresh/DTCoreText,liulinjian/DTCoreText,MattKiazyk/DTCoreText,SanjoDeundiak/DTCoreText,yifan/DTCoreText,zulip/DTCoreText,barz/DTCoreText,rgregg/DTCoreText,programming086/DTCoreText,badoo/DTCoreText,beingenious/DTCoreText,wweiradio/DTCoreText,gamma/DTCoreText,tonycn/DTCoreText,yifan/DTCoreText,artifacts/DTCoreText,gank0326/CoreTextWithHTML,jjamminjim/DTCoreText,canyu9512/DTCoreText,siuying/DTCoreText,artifacts/DTCoreText,shuoshi/DTCoreText,depl0y/DTCoreText,cnbin/DTCoreText,qskycolor/DTCoreText,w2592583/DTCoreText,devontech/DTCoreText,Torsph/DTCoreText,devontech/DTCoreText,Cocoanetics/DTCoreText,youprofit/DTCoreText,Cocoanetics/DTCoreText,danielphillips/DTCoreText,canyu9512/DTCoreText,holgersindbaek/DTCoreText,xiaoyanit/DTCoreText,gsempe/DTCoreText,davbeck/DTCoreText,gank0326/CoreTextWithHTML,cnbin/DTCoreText,pegli/DTCoreText,rdougan/DTCoreText,niklassaers/DTCoreText,wangmb/DTCoreText,goodheart/DTCoreText,i-miss-you/DTCoreText,barz/DTCoreText,wangmb/DTCoreText,tonycn/DTCoreText,bnickel/DTCoreText,wordnik/DTCoreText,trispo/DTCoreText,trispo/DTCoreText,thusfresh/DTCoreText,unisontech/DTCoreText,DanGe42/DTCoreText,bastianh/DTCoreText,bastianh/DTCoreText,sujeking/DTCoreText,unisontech/DTCoreText,DanGe42/DTCoreText,Cocoanetics/DTCoreText,i-miss-you/DTCoreText,ipodishima/DTCoreText,rain1988/DTCoreText,ricobeck/DTCoreText,iwakevin/DTCoreText,gamma/DTCoreText,danielphillips/DTCoreText,yaoxiaoyong/DTCoreText,AmberWhiteSky/DTCoreText,shuoshi/DTCoreText,wlisac/DTCoreText,davbeck/DTCoreText,openresearch/DTCoreText,jingchunYuan/DTCoreText,AmberWhiteSky/DTCoreText,pegli/DTCoreText,wweiradio/DTCoreText,mirego/DTCoreText,CoderJWYang/DTCoreText,MattKiazyk/DTCoreText,iwakevin/DTCoreText,wlisac/DTCoreText,beingenious/DTCoreText,rgregg/DTCoreText,rdougan/DTCoreText,smartlogic/DTCoreText,appunite/DTCoreText,rain1988/DTCoreText,1yvT0s/DTCoreText,beingenious/DTCoreText,gnr/DTCoreText,wweiradio/DTCoreText,Akylas/DTCoreText,zulip/DTCoreText,Esdeath/DTCoreText,kemenaran/DTCoreText,appunite/DTCoreText,kemenaran/DTCoreText,danielphillips/DTCoreText,smartlogic/DTCoreText,z8927623/DTCoreText,liulinjian/DTCoreText,1yvT0s/DTCoreText,rdougan/DTCoreText,sujeking/DTCoreText,Akylas/DTCoreText | html | ## Code Before:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<h2>Core Text Bugs</h2>
<h3>Bold for Chinese Glyphs</h3>
<p>This is a bug that was present before iOS 6, the Chinese glyphs in the following line would be bold if the locale was set to Chinese due to an incorrect entry in the global font cascade table. Filed as rdar://11262229</p>
<p style='font-size:25.0pt'>English and 中文 -- Chinese characters </p>
<h3>Italic for Chinese Glyphs in Fallback</h3>
<p style="font-size:25px;">东方盖饭</p>
<p style="font-size:25px;font-style:italic;">东方盖饭</p>
<h3>Extra space above lines with whitespace glyphs</h3>
<p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p>
<p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p>
## Instruction:
Test file for hyperlink highlighting
## Code After:
<head>
<style>
a:active {color:#0000FF;} /* selected link */
</style>
</head>
<body>
<p style="font-size:25px">Some text with a <u>Ag</u> <u>Bg</u> <a href="http://www.drobnik.com">Hg Hg Hg</a></p>
<p style="font-size:50px">Some text with a <u>Hg</u> <a href="http://www.drobnik.com">Hg Hg Hg</a></p>
</body> | + <head>
+ <style>
+ a:active {color:#0000FF;} /* selected link */
+ </style>
+ </head>
+ <body>
+ <p style="font-size:25px">Some text with a <u>Ag</u> <u>Bg</u> <a href="http://www.drobnik.com">Hg Hg Hg</a></p>
+ <p style="font-size:50px">Some text with a <u>Hg</u> <a href="http://www.drobnik.com">Hg Hg Hg</a></p>
+ </body>
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <h2>Core Text Bugs</h2>
- <h3>Bold for Chinese Glyphs</h3>
- <p>This is a bug that was present before iOS 6, the Chinese glyphs in the following line would be bold if the locale was set to Chinese due to an incorrect entry in the global font cascade table. Filed as rdar://11262229</p>
- <p style='font-size:25.0pt'>English and 中文 -- Chinese characters </p>
-
- <h3>Italic for Chinese Glyphs in Fallback</h3>
- <p style="font-size:25px;">东方盖饭</p>
- <p style="font-size:25px;font-style:italic;">东方盖饭</p>
-
- <h3>Extra space above lines with whitespace glyphs</h3>
- <p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p>
- <p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p> | 26 | 1.529412 | 9 | 17 |
fcbcc84de63e9cf6cccae9368d9f43e616046bf1 | templates/menu.html | templates/menu.html | <div data-role="page" id="Menu">
<div data-theme="b" data-role="header" data-position="fixed" data-disable-page-zoom="true" data-tap-toggle="false">
<h1 class="title title-fixed">UW Menu</h1>
</div><!-- header -->
<div data-role="content">
<p id="description" class="info">Weekly menus for the University of Waterloo's on-campus eateries.</p>
<ul data-role="listview" data-inset="true" class="ui-icon-alt ui-icon-nodisc">
<li data-role="list-divider">{{ menu.date.start }} – {{ menu.date.end }}</li>
{% for restaurant in menu.outlets if 'menu' in restaurant %}
<li data-iconshadow="false" onclick="mixpanel.track('Restaurant View', {'Restaurant Name': '{{restaurant.outlet_name}}'})"><a href="#r{{ restaurant.outlet_id }}" data-transition="slidefade">{{ restaurant.outlet_name }}</a></li>
{% else %}
<li>No data has been provided for the current period.</li>
{% endfor %}
</ul>
</div><!-- content -->
{% import 'footer.html' as footer %}
{{ footer.setFooter('Menu') }}
</div><!-- page -->
| <div data-role="page" id="Menu">
<div data-theme="b" data-role="header" data-position="fixed" data-disable-page-zoom="true" data-tap-toggle="false">
<h1 class="title title-fixed">UW Menu</h1>
</div><!-- header -->
<div data-role="content">
<p id="description" class="info">Weekly menus for the University of Waterloo's on-campus eateries.</p>
<ul data-role="listview" data-inset="true" class="ui-icon-alt ui-icon-nodisc">
<li data-role="list-divider">{{ menu.date.start }} – {{ menu.date.end }}</li>
{% for restaurant in menu.outlets if 'menu' in restaurant %}
<li data-iconshadow="false" onclick="mixpanel.track('Restaurant View', {'Restaurant Name': '{{restaurant.outlet_name}}'})"><a href="#r{{ restaurant.outlet_id }}" data-transition="slidefade">{{ restaurant.outlet_name }}</a></li>
{% else %}
<li>No data has been provided for the current period.</li>
<li><a href="https://uwaterloo.ca/food-services/sites/ca.food-services/files/uploads/files/June%202013.pdf">June Hours of Operation</a></li>
{% endfor %}
</ul>
</div><!-- content -->
{% import 'footer.html' as footer %}
{{ footer.setFooter('Menu') }}
</div><!-- page -->
| Add June Hours of Operation on Menu page | Add June Hours of Operation on Menu page
| HTML | mit | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | html | ## Code Before:
<div data-role="page" id="Menu">
<div data-theme="b" data-role="header" data-position="fixed" data-disable-page-zoom="true" data-tap-toggle="false">
<h1 class="title title-fixed">UW Menu</h1>
</div><!-- header -->
<div data-role="content">
<p id="description" class="info">Weekly menus for the University of Waterloo's on-campus eateries.</p>
<ul data-role="listview" data-inset="true" class="ui-icon-alt ui-icon-nodisc">
<li data-role="list-divider">{{ menu.date.start }} – {{ menu.date.end }}</li>
{% for restaurant in menu.outlets if 'menu' in restaurant %}
<li data-iconshadow="false" onclick="mixpanel.track('Restaurant View', {'Restaurant Name': '{{restaurant.outlet_name}}'})"><a href="#r{{ restaurant.outlet_id }}" data-transition="slidefade">{{ restaurant.outlet_name }}</a></li>
{% else %}
<li>No data has been provided for the current period.</li>
{% endfor %}
</ul>
</div><!-- content -->
{% import 'footer.html' as footer %}
{{ footer.setFooter('Menu') }}
</div><!-- page -->
## Instruction:
Add June Hours of Operation on Menu page
## Code After:
<div data-role="page" id="Menu">
<div data-theme="b" data-role="header" data-position="fixed" data-disable-page-zoom="true" data-tap-toggle="false">
<h1 class="title title-fixed">UW Menu</h1>
</div><!-- header -->
<div data-role="content">
<p id="description" class="info">Weekly menus for the University of Waterloo's on-campus eateries.</p>
<ul data-role="listview" data-inset="true" class="ui-icon-alt ui-icon-nodisc">
<li data-role="list-divider">{{ menu.date.start }} – {{ menu.date.end }}</li>
{% for restaurant in menu.outlets if 'menu' in restaurant %}
<li data-iconshadow="false" onclick="mixpanel.track('Restaurant View', {'Restaurant Name': '{{restaurant.outlet_name}}'})"><a href="#r{{ restaurant.outlet_id }}" data-transition="slidefade">{{ restaurant.outlet_name }}</a></li>
{% else %}
<li>No data has been provided for the current period.</li>
<li><a href="https://uwaterloo.ca/food-services/sites/ca.food-services/files/uploads/files/June%202013.pdf">June Hours of Operation</a></li>
{% endfor %}
</ul>
</div><!-- content -->
{% import 'footer.html' as footer %}
{{ footer.setFooter('Menu') }}
</div><!-- page -->
| <div data-role="page" id="Menu">
<div data-theme="b" data-role="header" data-position="fixed" data-disable-page-zoom="true" data-tap-toggle="false">
<h1 class="title title-fixed">UW Menu</h1>
</div><!-- header -->
<div data-role="content">
<p id="description" class="info">Weekly menus for the University of Waterloo's on-campus eateries.</p>
<ul data-role="listview" data-inset="true" class="ui-icon-alt ui-icon-nodisc">
<li data-role="list-divider">{{ menu.date.start }} – {{ menu.date.end }}</li>
{% for restaurant in menu.outlets if 'menu' in restaurant %}
<li data-iconshadow="false" onclick="mixpanel.track('Restaurant View', {'Restaurant Name': '{{restaurant.outlet_name}}'})"><a href="#r{{ restaurant.outlet_id }}" data-transition="slidefade">{{ restaurant.outlet_name }}</a></li>
{% else %}
<li>No data has been provided for the current period.</li>
+ <li><a href="https://uwaterloo.ca/food-services/sites/ca.food-services/files/uploads/files/June%202013.pdf">June Hours of Operation</a></li>
{% endfor %}
</ul>
</div><!-- content -->
{% import 'footer.html' as footer %}
{{ footer.setFooter('Menu') }}
</div><!-- page --> | 1 | 0.055556 | 1 | 0 |
f095f71bd716d4ebc47ce39ca364b88061667d1c | README.md | README.md | Scripts and supporting material to validate QMC codes.
Primarily for QMCPACK (http://qmcpack.org/ ), but could be used more generally useful.
Directories:
* LongRange - Ewald summation on a lattice for long range (Coulomb) potentials.
* StochasticReconfiguration - Stochastic reconfiguration for fixed population diffusion Monte Carlo.
* Variational - Demonstration of variational principle for energy of hydrogen and helium atoms.
* Wavefunctions - Various functional forms for wavefunctions.
| Scripts and supporting material to validate QMC codes.
Primarily for QMCPACK (http://qmcpack.org/ ), but could be used more generally useful.
Directories:
* LongRange - Ewald summation on a lattice for long range (Coulomb) potentials.
* StochasticReconfiguration - Stochastic reconfiguration for fixed population diffusion Monte Carlo.
* Variational - Demonstration of variational principle for energy of hydrogen and helium atoms.
* Wavefunctions - Various functional forms for wavefunctions.
Many of these notebooks use Sympy for symbolic expressions. The notebook [Intro to Sympy](Intro%20to%20Sympy.ipynb) contains a a short guide to Sympy as used in these notebooks.
| Add comment and link about Intro to Sympy | Add comment and link about Intro to Sympy | Markdown | mit | markdewing/qmc_algorithms | markdown | ## Code Before:
Scripts and supporting material to validate QMC codes.
Primarily for QMCPACK (http://qmcpack.org/ ), but could be used more generally useful.
Directories:
* LongRange - Ewald summation on a lattice for long range (Coulomb) potentials.
* StochasticReconfiguration - Stochastic reconfiguration for fixed population diffusion Monte Carlo.
* Variational - Demonstration of variational principle for energy of hydrogen and helium atoms.
* Wavefunctions - Various functional forms for wavefunctions.
## Instruction:
Add comment and link about Intro to Sympy
## Code After:
Scripts and supporting material to validate QMC codes.
Primarily for QMCPACK (http://qmcpack.org/ ), but could be used more generally useful.
Directories:
* LongRange - Ewald summation on a lattice for long range (Coulomb) potentials.
* StochasticReconfiguration - Stochastic reconfiguration for fixed population diffusion Monte Carlo.
* Variational - Demonstration of variational principle for energy of hydrogen and helium atoms.
* Wavefunctions - Various functional forms for wavefunctions.
Many of these notebooks use Sympy for symbolic expressions. The notebook [Intro to Sympy](Intro%20to%20Sympy.ipynb) contains a a short guide to Sympy as used in these notebooks.
| Scripts and supporting material to validate QMC codes.
Primarily for QMCPACK (http://qmcpack.org/ ), but could be used more generally useful.
Directories:
* LongRange - Ewald summation on a lattice for long range (Coulomb) potentials.
* StochasticReconfiguration - Stochastic reconfiguration for fixed population diffusion Monte Carlo.
* Variational - Demonstration of variational principle for energy of hydrogen and helium atoms.
* Wavefunctions - Various functional forms for wavefunctions.
+
+ Many of these notebooks use Sympy for symbolic expressions. The notebook [Intro to Sympy](Intro%20to%20Sympy.ipynb) contains a a short guide to Sympy as used in these notebooks. | 2 | 0.222222 | 2 | 0 |
28812457c083ad149e843a7d36a71bbd0c079f7d | congress_dashboard/templates/admin/base.html | congress_dashboard/templates/admin/base.html | {% extends 'base.html' %}
{% block css %}
{% include "_stylesheets.html" %}
{% load compress %}
{% compress css %}
<link href='{{ STATIC_URL }}horizon/lib/jquery-ui/ui/jquery-ui.css' type='text/css' media='screen' rel='stylesheet' />
<link href='{{ STATIC_URL }}admin/css/policies.css' type='text/css' media='screen' rel='stylesheet' />
{% endcompress %}
{% endblock %}
{% block js %}
{% include "admin/_scripts.html" %}
{% endblock %}
| {% extends 'base.html' %}
{% block css %}
{% include "_stylesheets.html" %}
{% load compress %}
{% compress css %}
<link href='{{ STATIC_URL }}admin/css/policies.css' type='text/css' media='screen' rel='stylesheet' />
{% endcompress %}
{% endblock %}
{% block js %}
{% include "admin/_scripts.html" %}
{% endblock %}
| Fix launching devstack failure in gate | Fix launching devstack failure in gate
During setting up devstack for tempest test, django fails to compress
a css file specified in congress_dashboard and then gate test fails.
This change is quick fix of the gate failure. The {% compress css %} tag
only to improve response performance in django application. So it's not
nessesary. Refer http://django-compressor.readthedocs.io/en/latest/usage/
for the details.
Change-Id: I8c395ba727b0ac8a1ec194828093b97886f907f6
| HTML | apache-2.0 | ramineni/my_congress,openstack/congress,ramineni/my_congress,ramineni/my_congress,ramineni/my_congress,openstack/congress | html | ## Code Before:
{% extends 'base.html' %}
{% block css %}
{% include "_stylesheets.html" %}
{% load compress %}
{% compress css %}
<link href='{{ STATIC_URL }}horizon/lib/jquery-ui/ui/jquery-ui.css' type='text/css' media='screen' rel='stylesheet' />
<link href='{{ STATIC_URL }}admin/css/policies.css' type='text/css' media='screen' rel='stylesheet' />
{% endcompress %}
{% endblock %}
{% block js %}
{% include "admin/_scripts.html" %}
{% endblock %}
## Instruction:
Fix launching devstack failure in gate
During setting up devstack for tempest test, django fails to compress
a css file specified in congress_dashboard and then gate test fails.
This change is quick fix of the gate failure. The {% compress css %} tag
only to improve response performance in django application. So it's not
nessesary. Refer http://django-compressor.readthedocs.io/en/latest/usage/
for the details.
Change-Id: I8c395ba727b0ac8a1ec194828093b97886f907f6
## Code After:
{% extends 'base.html' %}
{% block css %}
{% include "_stylesheets.html" %}
{% load compress %}
{% compress css %}
<link href='{{ STATIC_URL }}admin/css/policies.css' type='text/css' media='screen' rel='stylesheet' />
{% endcompress %}
{% endblock %}
{% block js %}
{% include "admin/_scripts.html" %}
{% endblock %}
| {% extends 'base.html' %}
{% block css %}
{% include "_stylesheets.html" %}
{% load compress %}
{% compress css %}
- <link href='{{ STATIC_URL }}horizon/lib/jquery-ui/ui/jquery-ui.css' type='text/css' media='screen' rel='stylesheet' />
<link href='{{ STATIC_URL }}admin/css/policies.css' type='text/css' media='screen' rel='stylesheet' />
{% endcompress %}
{% endblock %}
{% block js %}
{% include "admin/_scripts.html" %}
{% endblock %} | 1 | 0.066667 | 0 | 1 |
f0f4a2626a2ed08a608b97054f3cc4614edc9305 | composer.json | composer.json | {
"name": "algo-web/podata-laravel",
"description": "Expose Odata services from laravel",
"keywords": ["laravel", "Odata", "services", "POData"],
"license": "MIT",
"require": {
"algo-web/podata": "0.3.*|dev-master",
"doctrine/dbal": "^2.5",
"php": ">=5.6.4",
"laravel/framework": ">=5.1.11",
"illuminate/http": ">=5.1.11",
"voku/anti-xss": "2.1.*",
"symfony/yaml": "^2.7|^3.0|^4.0",
"symfony/http-foundation": "^2.7|^3.0|^4.0"
},
"require-dev": {
"mockery/mockery": "dev-master",
"php-coveralls/php-coveralls": ">=v2.1",
"orchestra/testbench": "3.0.*|3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*"
},
"autoload": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\": "src/"
},
"classmap": [
"tests/"
]
},
"autoload-dev": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\Orchestra\\Tests\\": "testsorchestra/"
}
},
"minimum-stability": "dev"
}
| {
"name": "algo-web/podata-laravel",
"description": "Expose Odata services from laravel",
"keywords": ["laravel", "Odata", "services", "POData"],
"license": "MIT",
"require": {
"algo-web/podata": "0.3.*|dev-master",
"doctrine/dbal": "^2.5",
"php": ">=5.6.4",
"laravel/framework": ">=5.1.11",
"illuminate/http": ">=5.1.11",
"voku/anti-xss": "2.1.*",
"symfony/yaml": "^2.7|^3.0|^4.0",
"symfony/http-foundation": "^2.7|^3.0|^4.0"
},
"require-dev": {
"mockery/mockery": "dev-master",
"php-coveralls/php-coveralls": ">=v2.1",
"phpunit/phpunit": "^5.6|^6.0|^7.0",
"orchestra/testbench": "3.0.*|3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*"
},
"autoload": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\": "src/"
},
"classmap": [
"tests/"
]
},
"autoload-dev": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\Orchestra\\Tests\\": "testsorchestra/"
}
},
"minimum-stability": "dev"
}
| Revert "Remove phpunit as explicit dep - let testbench decide version" | Revert "Remove phpunit as explicit dep - let testbench decide version"
This reverts commit 053359222ae01e472f7cbeac531f8168e27ad673.
| JSON | mit | CyberiaResurrection/POData-Laravel,Algo-Web/POData-Laravel | json | ## Code Before:
{
"name": "algo-web/podata-laravel",
"description": "Expose Odata services from laravel",
"keywords": ["laravel", "Odata", "services", "POData"],
"license": "MIT",
"require": {
"algo-web/podata": "0.3.*|dev-master",
"doctrine/dbal": "^2.5",
"php": ">=5.6.4",
"laravel/framework": ">=5.1.11",
"illuminate/http": ">=5.1.11",
"voku/anti-xss": "2.1.*",
"symfony/yaml": "^2.7|^3.0|^4.0",
"symfony/http-foundation": "^2.7|^3.0|^4.0"
},
"require-dev": {
"mockery/mockery": "dev-master",
"php-coveralls/php-coveralls": ">=v2.1",
"orchestra/testbench": "3.0.*|3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*"
},
"autoload": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\": "src/"
},
"classmap": [
"tests/"
]
},
"autoload-dev": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\Orchestra\\Tests\\": "testsorchestra/"
}
},
"minimum-stability": "dev"
}
## Instruction:
Revert "Remove phpunit as explicit dep - let testbench decide version"
This reverts commit 053359222ae01e472f7cbeac531f8168e27ad673.
## Code After:
{
"name": "algo-web/podata-laravel",
"description": "Expose Odata services from laravel",
"keywords": ["laravel", "Odata", "services", "POData"],
"license": "MIT",
"require": {
"algo-web/podata": "0.3.*|dev-master",
"doctrine/dbal": "^2.5",
"php": ">=5.6.4",
"laravel/framework": ">=5.1.11",
"illuminate/http": ">=5.1.11",
"voku/anti-xss": "2.1.*",
"symfony/yaml": "^2.7|^3.0|^4.0",
"symfony/http-foundation": "^2.7|^3.0|^4.0"
},
"require-dev": {
"mockery/mockery": "dev-master",
"php-coveralls/php-coveralls": ">=v2.1",
"phpunit/phpunit": "^5.6|^6.0|^7.0",
"orchestra/testbench": "3.0.*|3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*"
},
"autoload": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\": "src/"
},
"classmap": [
"tests/"
]
},
"autoload-dev": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\Orchestra\\Tests\\": "testsorchestra/"
}
},
"minimum-stability": "dev"
}
| {
"name": "algo-web/podata-laravel",
"description": "Expose Odata services from laravel",
"keywords": ["laravel", "Odata", "services", "POData"],
"license": "MIT",
"require": {
"algo-web/podata": "0.3.*|dev-master",
"doctrine/dbal": "^2.5",
"php": ">=5.6.4",
"laravel/framework": ">=5.1.11",
"illuminate/http": ">=5.1.11",
"voku/anti-xss": "2.1.*",
"symfony/yaml": "^2.7|^3.0|^4.0",
"symfony/http-foundation": "^2.7|^3.0|^4.0"
},
"require-dev": {
"mockery/mockery": "dev-master",
"php-coveralls/php-coveralls": ">=v2.1",
+ "phpunit/phpunit": "^5.6|^6.0|^7.0",
"orchestra/testbench": "3.0.*|3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*"
},
"autoload": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\": "src/"
},
"classmap": [
"tests/"
]
},
"autoload-dev": {
"psr-4": {
"AlgoWeb\\PODataLaravel\\Orchestra\\Tests\\": "testsorchestra/"
}
},
"minimum-stability": "dev"
} | 1 | 0.028571 | 1 | 0 |
0199b94718b9d9fbefc0b7f048c0f9f8f6d20cb0 | resurse/tutorial/index.html | resurse/tutorial/index.html | ---
title: "Tutoriale"
layout: resources
section-type: blog
categories: [tutorial]
subcategories: [git, vagrant, virtualbox]
permalink: resurse/tutorial/
---
| ---
title: "Tutoriale"
layout: resources
section-type: blog
categories: [tutorial]
subcategories: [git, openstack, vagrant, virtualbox]
permalink: resurse/tutorial/
---
| Add openstack to tutorial menu | Add openstack to tutorial menu
| HTML | mit | alexcoman/teaching.alexcoman.com,alexandrucoman/teaching.alexcoman.com,alexcoman/teaching.alexcoman.com,alexandrucoman/teaching.alexcoman.com | html | ## Code Before:
---
title: "Tutoriale"
layout: resources
section-type: blog
categories: [tutorial]
subcategories: [git, vagrant, virtualbox]
permalink: resurse/tutorial/
---
## Instruction:
Add openstack to tutorial menu
## Code After:
---
title: "Tutoriale"
layout: resources
section-type: blog
categories: [tutorial]
subcategories: [git, openstack, vagrant, virtualbox]
permalink: resurse/tutorial/
---
| ---
title: "Tutoriale"
layout: resources
section-type: blog
categories: [tutorial]
- subcategories: [git, vagrant, virtualbox]
+ subcategories: [git, openstack, vagrant, virtualbox]
? +++++++++++
permalink: resurse/tutorial/
--- | 2 | 0.25 | 1 | 1 |
eb51270c19b54929603a5e55fafa14f57238a4bc | layouts/index.html | layouts/index.html | {{ define "main" }}
{{ if .Site.Params.homeMaxPosts }}
{{ range first .Site.Params.homeMaxPosts (where .Data.Pages.ByDate.Reverse "Type" "post") }}
{{ partial "post-list-item" . }}
{{ end }}
<nav class="pagination" role="pagination">
<a class="archive-link" href="/post/">{{ .Site.Params.archiveStr }}</a>
</nav>
{{ else }}
{{ partial "post-list" . }}
{{ partial "pagination" . }}
{{ end }}
{{ end }} | {{ define "main" }}
{{ partial "post-list" . }}
{{ partial "pagination" . }}
{{ end }} | Return to pagination in post list | Return to pagination in post list
| HTML | mit | TomasTomecek/hugo-steam-theme,digitalcraftsman/hugo-steam-theme,fyears/hugo-steam-cos,Teebusch/hugo-steam-theme,fyears/hugo-steam-cos,digitalcraftsman/hugo-steam-theme,Teebusch/hugo-steam-theme,TomasTomecek/hugo-steam-theme | html | ## Code Before:
{{ define "main" }}
{{ if .Site.Params.homeMaxPosts }}
{{ range first .Site.Params.homeMaxPosts (where .Data.Pages.ByDate.Reverse "Type" "post") }}
{{ partial "post-list-item" . }}
{{ end }}
<nav class="pagination" role="pagination">
<a class="archive-link" href="/post/">{{ .Site.Params.archiveStr }}</a>
</nav>
{{ else }}
{{ partial "post-list" . }}
{{ partial "pagination" . }}
{{ end }}
{{ end }}
## Instruction:
Return to pagination in post list
## Code After:
{{ define "main" }}
{{ partial "post-list" . }}
{{ partial "pagination" . }}
{{ end }} | {{ define "main" }}
- {{ if .Site.Params.homeMaxPosts }}
- {{ range first .Site.Params.homeMaxPosts (where .Data.Pages.ByDate.Reverse "Type" "post") }}
- {{ partial "post-list-item" . }}
- {{ end }}
- <nav class="pagination" role="pagination">
- <a class="archive-link" href="/post/">{{ .Site.Params.archiveStr }}</a>
- </nav>
- {{ else }}
- {{ partial "post-list" . }}
? ----
+ {{ partial "post-list" . }}
- {{ partial "pagination" . }}
? ----
+ {{ partial "pagination" . }}
- {{ end }}
{{ end }} | 13 | 1 | 2 | 11 |
0b6c098946a80ac2656f705563afe973efb38ce6 | app/controllers/demo_controller.rb | app/controllers/demo_controller.rb | class DemoController < ApplicationController
def new
if user_signed_in?
flash[:notice] = "You need to be logged out for this"
else
pass = SecureRandom.hex(8)
user = User.create!(:name => "Demo User", :email => SecureRandom.hex(8) + "@demoaccount.com", :password => pass, :password_confirmation => pass)
user.create_demo_data
sign_in(:user, user)
end
respond_to do |format|
format.js { render :js => "window.location = '#{root_path(:format => :html)}';" }
format.html { redirect_to root_path }
end
end
end
| class DemoController < ApplicationController
def new
if user_signed_in?
flash[:notice] = "You need to be logged out for this"
else
pass = SecureRandom.hex(8)
user = User.create!(:name => "Demo User", :email => SecureRandom.hex(8) + "@demoaccount.com", :password => pass, :password_confirmation => pass, :newsletter => false)
user.create_demo_data
sign_in(:user, user)
end
respond_to do |format|
format.js { render :js => "window.location = '#{root_path(:format => :html)}';" }
format.html { redirect_to root_path }
end
end
end
| Set newsletter to false for demo users. | Set newsletter to false for demo users. | Ruby | mit | kiskolabs/splendidbacon,kiskolabs/splendidbacon | ruby | ## Code Before:
class DemoController < ApplicationController
def new
if user_signed_in?
flash[:notice] = "You need to be logged out for this"
else
pass = SecureRandom.hex(8)
user = User.create!(:name => "Demo User", :email => SecureRandom.hex(8) + "@demoaccount.com", :password => pass, :password_confirmation => pass)
user.create_demo_data
sign_in(:user, user)
end
respond_to do |format|
format.js { render :js => "window.location = '#{root_path(:format => :html)}';" }
format.html { redirect_to root_path }
end
end
end
## Instruction:
Set newsletter to false for demo users.
## Code After:
class DemoController < ApplicationController
def new
if user_signed_in?
flash[:notice] = "You need to be logged out for this"
else
pass = SecureRandom.hex(8)
user = User.create!(:name => "Demo User", :email => SecureRandom.hex(8) + "@demoaccount.com", :password => pass, :password_confirmation => pass, :newsletter => false)
user.create_demo_data
sign_in(:user, user)
end
respond_to do |format|
format.js { render :js => "window.location = '#{root_path(:format => :html)}';" }
format.html { redirect_to root_path }
end
end
end
| class DemoController < ApplicationController
def new
if user_signed_in?
flash[:notice] = "You need to be logged out for this"
else
pass = SecureRandom.hex(8)
- user = User.create!(:name => "Demo User", :email => SecureRandom.hex(8) + "@demoaccount.com", :password => pass, :password_confirmation => pass)
+ user = User.create!(:name => "Demo User", :email => SecureRandom.hex(8) + "@demoaccount.com", :password => pass, :password_confirmation => pass, :newsletter => false)
? ++++++++++++++++++++++
user.create_demo_data
sign_in(:user, user)
end
respond_to do |format|
format.js { render :js => "window.location = '#{root_path(:format => :html)}';" }
format.html { redirect_to root_path }
end
end
end | 2 | 0.105263 | 1 | 1 |
f9c4b8660252b8d0f6c49ba9ba354e157a5da40a | appveyor.yml | appveyor.yml | branches:
only:
- master
version: 0.3.0.{build}
build_script:
- cd build
- Package.build.cmd
artifacts:
- path: releases\*.nupkg
deploy:
provider: NuGet
api_key:
secure: cOErtJQNPk64rHATxlhnmKgYsqvnGwHPo30EtqoAg7e2VES5rmBLfHVoNx4+qoac
skip_symbols: false
artifact: /.*\.nupkg/ | branches:
only:
- master
version: 0.3.0.{build}
build_script:
- cd build
- Package.build.cmd
artifacts:
- path: releases\*.nupkg
deploy:
provider: NuGet
api_key:
secure: cOErtJQNPk64rHATxlhnmKgYsqvnGwHPo30EtqoAg7e2VES5rmBLfHVoNx4+qoac
skip_symbols: false
artifact: /.*\.nupkg/
cache:
- packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified | Use build cache for nuget packages | Use build cache for nuget packages
| YAML | mit | BarFoo/UmbracoContentFiles | yaml | ## Code Before:
branches:
only:
- master
version: 0.3.0.{build}
build_script:
- cd build
- Package.build.cmd
artifacts:
- path: releases\*.nupkg
deploy:
provider: NuGet
api_key:
secure: cOErtJQNPk64rHATxlhnmKgYsqvnGwHPo30EtqoAg7e2VES5rmBLfHVoNx4+qoac
skip_symbols: false
artifact: /.*\.nupkg/
## Instruction:
Use build cache for nuget packages
## Code After:
branches:
only:
- master
version: 0.3.0.{build}
build_script:
- cd build
- Package.build.cmd
artifacts:
- path: releases\*.nupkg
deploy:
provider: NuGet
api_key:
secure: cOErtJQNPk64rHATxlhnmKgYsqvnGwHPo30EtqoAg7e2VES5rmBLfHVoNx4+qoac
skip_symbols: false
artifact: /.*\.nupkg/
cache:
- packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified | branches:
only:
- master
version: 0.3.0.{build}
build_script:
- cd build
- Package.build.cmd
artifacts:
- path: releases\*.nupkg
deploy:
provider: NuGet
api_key:
secure: cOErtJQNPk64rHATxlhnmKgYsqvnGwHPo30EtqoAg7e2VES5rmBLfHVoNx4+qoac
skip_symbols: false
artifact: /.*\.nupkg/
+
+ cache:
+ - packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified | 3 | 0.157895 | 3 | 0 |
aa4b3b8db4173ec642913bee0c2e7737af2a964b | docs/user-guide/routing/vsphere/haproxy-routing.md | docs/user-guide/routing/vsphere/haproxy-routing.md |
When deploying Kubo on vSphere, HAProxy can be used for external access to the Kubernetes Master node (for administration traffic), and the Kubernetes Workers (for application traffic). In order to enable this, configure `director.yml` as follows:
Enable HAProxy routing:
```
routing_mode: proxy
```
Configure master IP address and port number:
```
kubernetes_master_host: 12.34.56.78
kubernetes_master_port: 443
```
Configure front-end and back-end ports for HAProxy TCP pass-through.
```
worker_haproxy_tcp_frontend_port: 1234
worker_haproxy_tcp_backend_port: 4321
```
*Note*: the current implementation of HAProxy routing is a single-port TCP pass-through. In order to route traffic to multiple Kubernetes services, consider using an Ingress Controller (https://github.com/kubernetes/ingress/tree/master/examples).
|
When deploying Kubo on vSphere, HAProxy can be used for external access to the Kubernetes Master node (for administration traffic), and the Kubernetes Workers (for application traffic). This is due to the fact that vSphere does not have first-party load-balancing support. In order to enable this, configure `director.yml` as follows:
Enable HAProxy routing:
```
routing_mode: proxy
```
Configure master IP address and port number:
```
kubernetes_master_host: 12.34.56.78
kubernetes_master_port: 443
```
Configure front-end and back-end ports for HAProxy TCP pass-through.
```
worker_haproxy_tcp_frontend_port: 1234
worker_haproxy_tcp_backend_port: 4321
```
*Note*: the current implementation of HAProxy routing is a single-port TCP pass-through. In order to route traffic to multiple Kubernetes services, consider using an Ingress Controller (https://github.com/kubernetes/ingress/tree/master/examples).
| Add a note about why we use HAProxy | Add a note about why we use HAProxy | Markdown | apache-2.0 | pivotal-cf-experimental/kubo-deployment,jaimegag/kubo-deployment,jaimegag/kubo-deployment,pivotal-cf-experimental/kubo-deployment | markdown | ## Code Before:
When deploying Kubo on vSphere, HAProxy can be used for external access to the Kubernetes Master node (for administration traffic), and the Kubernetes Workers (for application traffic). In order to enable this, configure `director.yml` as follows:
Enable HAProxy routing:
```
routing_mode: proxy
```
Configure master IP address and port number:
```
kubernetes_master_host: 12.34.56.78
kubernetes_master_port: 443
```
Configure front-end and back-end ports for HAProxy TCP pass-through.
```
worker_haproxy_tcp_frontend_port: 1234
worker_haproxy_tcp_backend_port: 4321
```
*Note*: the current implementation of HAProxy routing is a single-port TCP pass-through. In order to route traffic to multiple Kubernetes services, consider using an Ingress Controller (https://github.com/kubernetes/ingress/tree/master/examples).
## Instruction:
Add a note about why we use HAProxy
## Code After:
When deploying Kubo on vSphere, HAProxy can be used for external access to the Kubernetes Master node (for administration traffic), and the Kubernetes Workers (for application traffic). This is due to the fact that vSphere does not have first-party load-balancing support. In order to enable this, configure `director.yml` as follows:
Enable HAProxy routing:
```
routing_mode: proxy
```
Configure master IP address and port number:
```
kubernetes_master_host: 12.34.56.78
kubernetes_master_port: 443
```
Configure front-end and back-end ports for HAProxy TCP pass-through.
```
worker_haproxy_tcp_frontend_port: 1234
worker_haproxy_tcp_backend_port: 4321
```
*Note*: the current implementation of HAProxy routing is a single-port TCP pass-through. In order to route traffic to multiple Kubernetes services, consider using an Ingress Controller (https://github.com/kubernetes/ingress/tree/master/examples).
|
- When deploying Kubo on vSphere, HAProxy can be used for external access to the Kubernetes Master node (for administration traffic), and the Kubernetes Workers (for application traffic). In order to enable this, configure `director.yml` as follows:
+ When deploying Kubo on vSphere, HAProxy can be used for external access to the Kubernetes Master node (for administration traffic), and the Kubernetes Workers (for application traffic). This is due to the fact that vSphere does not have first-party load-balancing support. In order to enable this, configure `director.yml` as follows:
? +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Enable HAProxy routing:
```
routing_mode: proxy
```
Configure master IP address and port number:
```
kubernetes_master_host: 12.34.56.78
kubernetes_master_port: 443
```
Configure front-end and back-end ports for HAProxy TCP pass-through.
```
worker_haproxy_tcp_frontend_port: 1234
worker_haproxy_tcp_backend_port: 4321
```
*Note*: the current implementation of HAProxy routing is a single-port TCP pass-through. In order to route traffic to multiple Kubernetes services, consider using an Ingress Controller (https://github.com/kubernetes/ingress/tree/master/examples). | 2 | 0.095238 | 1 | 1 |
38071cfdf277aa977979c6936b0b3e7171924b7d | meta-ams-bsp/recipes-kernel/linux/files/ruiz/config.cfg | meta-ams-bsp/recipes-kernel/linux/files/ruiz/config.cfg | CONFIG_ADS7846 = y
| CONFIG_ADS7846 = y
# Load custom default edid file for broken hardware
# see https://www.96boards.org/documentation/consumer/dragonboard/dragonboard410c/guides/force-display-res.md.html
# not sure if that helps but offers some more activities to deals with later
# CONFIG_DRM_LOAD_EDID_FIRMWARE=y
| Add some comments of how to deal with broken HDMI connection (EDID) | Add some comments of how to deal with broken HDMI connection (EDID)
| INI | mit | pixmeter/plos | ini | ## Code Before:
CONFIG_ADS7846 = y
## Instruction:
Add some comments of how to deal with broken HDMI connection (EDID)
## Code After:
CONFIG_ADS7846 = y
# Load custom default edid file for broken hardware
# see https://www.96boards.org/documentation/consumer/dragonboard/dragonboard410c/guides/force-display-res.md.html
# not sure if that helps but offers some more activities to deals with later
# CONFIG_DRM_LOAD_EDID_FIRMWARE=y
| CONFIG_ADS7846 = y
+
+ # Load custom default edid file for broken hardware
+ # see https://www.96boards.org/documentation/consumer/dragonboard/dragonboard410c/guides/force-display-res.md.html
+ # not sure if that helps but offers some more activities to deals with later
+ # CONFIG_DRM_LOAD_EDID_FIRMWARE=y | 5 | 5 | 5 | 0 |
68d44f64f0ae473fe0e79034fb671f8e596ad1c9 | ansible/roles/ubuntu.yml | ansible/roles/ubuntu.yml | ---
- hosts: all
remote_user: root
vars:
user: "{{ lookup('env', 'USER') }}"
vars_prompt:
password: "Please enter a password for the remote user to create/set"
tasks:
- name: update/upgrade apt
apt: upgrade=dist update_cache=yes
- name: add primary user
user: name={{ user }} shell=/bin/bash groups=sudo append=yes password={{ password | password_hash('sha512') }}
- name: upload primary user ssh public key
authorized_key: user={{ user }} key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
- name: disable root login (and other sshd_config tweaks)
lineinfile: dest=/etc/ssh/sshd_config state={{ item.state }} line="{{ item.line }}"
with_items:
- { state: absent, line: "PermitRootLogin yes" }
- { state: present, line: "PermitRootLogin without-password" }
- { state: present, line: "UseDNS no" }
- { state: present, line: "AllowUsers {{ user }}" }
notify:
- reload ssh
handlers:
- name: reload ssh
service: name=ssh state=restarted
| ---
- hosts: all
remote_user: root
vars:
user: "{{ lookup('env', 'USER') }}"
vars_prompt:
password: "Please enter a password for the remote user to create/set"
tasks:
- name: update/upgrade apt
apt: upgrade=dist update_cache=yes
- name: add primary user
user: name={{ user }} shell=/bin/bash groups=sudo append=yes password={{ password | password_hash('sha512') }}
- name: upload primary user ssh public key
authorized_key: user={{ user }} key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
- name: disable root ssh login, disallow password authentication (and other sshd_config tweaks)
lineinfile: dest=/etc/ssh/sshd_config state={{ item.state }} line="{{ item.line }}" regex="{{ item.regex }}"
with_items:
- { state: present, line: "PermitRootLogin no", regexp: "^PermitRootLogin" }
- { state: present, line: "PasswordAuthentication no", regexp: "^PasswordAuthentication" }
- { state: present, line: "UseDNS no", regexp: "^UseDNS" }
- { state: present, line: "AllowUsers {{ user }}" ,regexp: "^AllowUsers" }
notify:
- reload ssh
- name: Install fail2ban
apt: pkg=fail2ban state=present
handlers:
- name: reload ssh
service: name=ssh state=restarted
| Install fail2ban package and secure SSH even further | Install fail2ban package and secure SSH even further
| YAML | mit | guw/dotfiles | yaml | ## Code Before:
---
- hosts: all
remote_user: root
vars:
user: "{{ lookup('env', 'USER') }}"
vars_prompt:
password: "Please enter a password for the remote user to create/set"
tasks:
- name: update/upgrade apt
apt: upgrade=dist update_cache=yes
- name: add primary user
user: name={{ user }} shell=/bin/bash groups=sudo append=yes password={{ password | password_hash('sha512') }}
- name: upload primary user ssh public key
authorized_key: user={{ user }} key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
- name: disable root login (and other sshd_config tweaks)
lineinfile: dest=/etc/ssh/sshd_config state={{ item.state }} line="{{ item.line }}"
with_items:
- { state: absent, line: "PermitRootLogin yes" }
- { state: present, line: "PermitRootLogin without-password" }
- { state: present, line: "UseDNS no" }
- { state: present, line: "AllowUsers {{ user }}" }
notify:
- reload ssh
handlers:
- name: reload ssh
service: name=ssh state=restarted
## Instruction:
Install fail2ban package and secure SSH even further
## Code After:
---
- hosts: all
remote_user: root
vars:
user: "{{ lookup('env', 'USER') }}"
vars_prompt:
password: "Please enter a password for the remote user to create/set"
tasks:
- name: update/upgrade apt
apt: upgrade=dist update_cache=yes
- name: add primary user
user: name={{ user }} shell=/bin/bash groups=sudo append=yes password={{ password | password_hash('sha512') }}
- name: upload primary user ssh public key
authorized_key: user={{ user }} key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
- name: disable root ssh login, disallow password authentication (and other sshd_config tweaks)
lineinfile: dest=/etc/ssh/sshd_config state={{ item.state }} line="{{ item.line }}" regex="{{ item.regex }}"
with_items:
- { state: present, line: "PermitRootLogin no", regexp: "^PermitRootLogin" }
- { state: present, line: "PasswordAuthentication no", regexp: "^PasswordAuthentication" }
- { state: present, line: "UseDNS no", regexp: "^UseDNS" }
- { state: present, line: "AllowUsers {{ user }}" ,regexp: "^AllowUsers" }
notify:
- reload ssh
- name: Install fail2ban
apt: pkg=fail2ban state=present
handlers:
- name: reload ssh
service: name=ssh state=restarted
| ---
- hosts: all
remote_user: root
vars:
user: "{{ lookup('env', 'USER') }}"
vars_prompt:
password: "Please enter a password for the remote user to create/set"
tasks:
- name: update/upgrade apt
apt: upgrade=dist update_cache=yes
- name: add primary user
user: name={{ user }} shell=/bin/bash groups=sudo append=yes password={{ password | password_hash('sha512') }}
- name: upload primary user ssh public key
authorized_key: user={{ user }} key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
- - name: disable root login (and other sshd_config tweaks)
+ - name: disable root ssh login, disallow password authentication (and other sshd_config tweaks)
? ++++ ++++++++++++++++++++++++++++++++++
- lineinfile: dest=/etc/ssh/sshd_config state={{ item.state }} line="{{ item.line }}"
+ lineinfile: dest=/etc/ssh/sshd_config state={{ item.state }} line="{{ item.line }}" regex="{{ item.regex }}"
? +++++++++++++++++++++++++
with_items:
- - { state: absent, line: "PermitRootLogin yes" }
- - { state: present, line: "PermitRootLogin without-password" }
? ^ ^ ^ ^^^^^^ ^^
+ - { state: present, line: "PermitRootLogin no", regexp: "^PermitRootLogin" }
? ^^^^^^^^^^^^^^^^^^^ ^ ^ ^ ^^^
+ - { state: present, line: "PasswordAuthentication no", regexp: "^PasswordAuthentication" }
- - { state: present, line: "UseDNS no" }
+ - { state: present, line: "UseDNS no", regexp: "^UseDNS" }
? +++++++++++++++++++
- - { state: present, line: "AllowUsers {{ user }}" }
+ - { state: present, line: "AllowUsers {{ user }}" ,regexp: "^AllowUsers" }
? +++++++++++++++++++++++
notify:
- reload ssh
+
+ - name: Install fail2ban
+ apt: pkg=fail2ban state=present
handlers:
- name: reload ssh
service: name=ssh state=restarted | 15 | 0.5 | 9 | 6 |
8a9b40fd26121ca533f561ad963236f98faeeda0 | app/views/rails_admin/_text.html.erb | app/views/rails_admin/_text.html.erb | <%
property_name = property[:name]
label = property[:pretty_name]
required = !property[:nullable?]
model_name = @abstract_model.to_param
%>
<%= label_tag label %>
<%= text_area model_name, property_name, :cols => 50, :rows => 10, :class => "textField" %>
| <%
property_name = property[:name]
label = property[:pretty_name]
required = !property[:nullable?]
model_name = @abstract_model.to_param
%>
<%= label_tag label %>
<%= text_area model_name, property_name, :cols => 50, :rows => 10, :class => "textField", :value => @object.send(property_name) %>
| Fix a bug that was preventing a textarea to show it's content | Fix a bug that was preventing a textarea to show it's content
| HTML+ERB | mit | sferik/rails_admin,10to1/rails_admin,onursarikaya/rails_admin,CPInc/rails_admin,Balaraju/rails_admin,slawosz/rails_admin,soupmatt/rails_admin,DonCuponesInternet/rails_admin,engel/rails_admin,kjaikeerthi/rails_admin,dmilisic/rails_admin,diowa/rails_admin,markprzepiora-forks/rails_admin,aliada-mx/rails_admin,jcoleman/rails_admin,PhilipCastiglione/rails_admin,l4u/rails_admin,aquajach/rails_admin,josedonizetti/rails_admin,ernestoe/rails_admin,sortlist/rails_admin,Furi/rails_admin,coorasse/rails_admin,mshibuya/rails_admin,VoroninNick/rails_admin_sigma,sortlist/rails_admin,dwbutler/rails_admin,jcoleman/rails_admin,voyera/rails_admin,CPInc/rails_admin,sumitag/rails_admin,patleb/admineer,fjg/rails_admin,amankatoch/rails_admin,dinjas/rails_admin,gdslink/rails_admin,voyera/rails_admin,Vinagility/rails_admin_old,dmitrypol/rails_admin,xinghao/rails_admin,WindStill/rails_admin,corbt/rails_admin,Exygy/rails_admin,lvexiao/magic_admin,ombulabs/rails_admin,l4u/rails_admin,dmilisic/rails_admin,JailtonSampaio/annotations_clone_rails_admin,soupmatt/rails_admin,dinjas/rails_admin,rubiety/rails_admin,dalpo/rails_admin,swipesense/rails_admin,crashlytics/rails_admin,impurist/rails_admin,aravindgd/rails_admin,igorkasyanchuk/rails_admin,cob3/rails_admin,jemcode/rails_admin,sogilis/rails_admin,msobocin/rails_admin,glooko/rails_admin,sogilis/rails_admin,lokalebasen/rails_admin,hut8/rails_admin,onursarikaya/rails_admin,yakovenkodenis/rails_admin,react2media/rails_admin,zoras/rails_admin,bf4/rails_admin,kjaikeerthi/rails_admin,xinghao/rails_admin,laurelandwolf/rails_admin,LevoLeague/rails_admin,hut8/rails_admin,goodinc/rails_admin_for_mag,jemcode/rails_admin,lokalebasen/rails_admin,igorkasyanchuk/rails_admin,ombulabs/rails_admin,react2media/rails_admin,josedonizetti/rails_admin,Versanity/ruby,VoroninNick/rails_admin_sigma,ombulabs/rails_admin,lvexiao/magic_admin,Balaraju/rails_admin,coorasse/rails_admin,Furi/rails_admin,engel/rails_admin,iangels/rails_admin,sideci-sample/sideci-sample-rails_admin,garytaylor/rails_admin,rayzhng/rails_admin,GeorgeZhukov/rails_admin,Furi/rails_admin,arturbrasil/rails_admin,cob3/rails_admin,jcoleman/rails_admin,msobocin/rails_admin,Versanity/ruby,ipmobiletech/rails_admin,amankatoch/rails_admin,ipmobiletech/rails_admin,lvexiao/magic_admin,jemcode/rails_admin,Versanity/ruby,olegantonyan/rails_admin,allori/rails_admin,patleb/admineer,DonCuponesInternet/rails_admin,ryanb/rails_admin,garytaylor/rails_admin,JailtonSampaio/annotations_clone_rails_admin,corbt/rails_admin,zapnap/rails_admin,vanbumi/rails_admin,xinghao/rails_admin,johanneskrtek/rails_admin,jasnow/rails_admin,rayzhng/rails_admin,sumitag/rails_admin,dmitrypol/rails_admin,voyera/rails_admin,vincentwoo/rails_admin,dinjas/rails_admin,johanneskrtek/rails_admin,allori/rails_admin,rubiety/rails_admin,vanbumi/rails_admin,amankatoch/rails_admin,zapnap/rails_admin,CodingZeal/rails_admin,impurist/rails_admin,wkirschbaum/rails_admin,josedonizetti/rails_admin,olegantonyan/rails_admin,JailtonSampaio/annotations_clone_rails_admin,soupmatt/rails_admin,junglefunkyman/rails_admin,johanneskrtek/rails_admin,dwbutler/rails_admin,meghaarora42/rails_admin,fjg/rails_admin,gdslink/rails_admin,junglefunkyman/rails_admin,LevoLeague/rails_admin,zambot/rails_admin,mshibuya/rails_admin,GeorgeZhukov/rails_admin,inaka/rails_admin,ernestoe/rails_admin,jasnow/rails_admin,VoroninNick/rails_admin_sigma,kimquy/rails_admin_062,ecielam/rails_admin,bf4/rails_admin,ecielam/rails_admin,viewthespace/rails_admin,sogilis/rails_admin,Vinagility/rails_admin_old,vanbumi/rails_admin,mshibuya/rails_admin,garytaylor/rails_admin,ubik86/rails_admin,glooko/rails_admin,dmitrypol/rails_admin,zambot/rails_admin,corbt/rails_admin,cheerfulstoic/rails_admin,aravindgd/rails_admin,igorkasyanchuk/rails_admin,iangels/rails_admin,WindStill/rails_admin,dmilisic/rails_admin,zapnap/rails_admin,CodingZeal/rails_admin,rubiety/rails_admin,Exygy/rails_admin,FeipingHunag/admin,laurelandwolf/rails_admin,goodinc/rails_admin_for_mag,rayzhng/rails_admin,quarkstudio/rails_admin,diowa/rails_admin,wkirschbaum/rails_admin,quarkstudio/rails_admin,memaker/rails_admin,cob3/rails_admin,aliada-mx/rails_admin,ubik86/rails_admin,sferik/rails_admin,coorasse/rails_admin,junglefunkyman/rails_admin,widgetworks/rails_admin,memaker/rails_admin,olegantonyan/rails_admin,bf4/rails_admin,cheerfulstoic/rails_admin,crashlytics/rails_admin,markprzepiora-forks/rails_admin,yakovenkodenis/rails_admin,PhilipCastiglione/rails_admin,sideci-sample/sideci-sample-rails_admin,viewthespace/rails_admin,sortlist/rails_admin,ipmobiletech/rails_admin,GeorgeZhukov/rails_admin,FeipingHunag/admin,10to1/rails_admin,hut8/rails_admin,onursarikaya/rails_admin,Balaraju/rails_admin,engel/rails_admin,diowa/rails_admin,cheerfulstoic/rails_admin,laurelandwolf/rails_admin,dwbutler/rails_admin,kimquy/rails_admin_062,meghaarora42/rails_admin,DonCuponesInternet/rails_admin,kimquy/rails_admin_062,widgetworks/rails_admin,goodinc/rails_admin_for_mag,yakovenkodenis/rails_admin,widgetworks/rails_admin,iangels/rails_admin,CPInc/rails_admin,ernestoe/rails_admin,patleb/admineer,Exygy/rails_admin,CodingZeal/rails_admin,FeipingHunag/admin,ubik86/rails_admin,sferik/rails_admin,PhilipCastiglione/rails_admin,vincentwoo/rails_admin,Vinagility/rails_admin_old,gdslink/rails_admin,zambot/rails_admin,dinjas/rails_admin,dalpo/rails_admin,vincentwoo/rails_admin,swipesense/rails_admin,inaka/rails_admin,impurist/rails_admin,glooko/rails_admin,wkirschbaum/rails_admin,lokalebasen/rails_admin,gdslink/rails_admin,viewthespace/rails_admin,aquajach/rails_admin,quarkstudio/rails_admin,react2media/rails_admin,msobocin/rails_admin,allori/rails_admin,ryanb/rails_admin,memaker/rails_admin,dalpo/rails_admin,meghaarora42/rails_admin,aquajach/rails_admin,aliada-mx/rails_admin,arturbrasil/rails_admin,jasnow/rails_admin,markprzepiora-forks/rails_admin,LevoLeague/rails_admin,aravindgd/rails_admin,zoras/rails_admin,slawosz/rails_admin,arturbrasil/rails_admin | html+erb | ## Code Before:
<%
property_name = property[:name]
label = property[:pretty_name]
required = !property[:nullable?]
model_name = @abstract_model.to_param
%>
<%= label_tag label %>
<%= text_area model_name, property_name, :cols => 50, :rows => 10, :class => "textField" %>
## Instruction:
Fix a bug that was preventing a textarea to show it's content
## Code After:
<%
property_name = property[:name]
label = property[:pretty_name]
required = !property[:nullable?]
model_name = @abstract_model.to_param
%>
<%= label_tag label %>
<%= text_area model_name, property_name, :cols => 50, :rows => 10, :class => "textField", :value => @object.send(property_name) %>
| <%
property_name = property[:name]
label = property[:pretty_name]
required = !property[:nullable?]
model_name = @abstract_model.to_param
%>
<%= label_tag label %>
- <%= text_area model_name, property_name, :cols => 50, :rows => 10, :class => "textField" %>
+ <%= text_area model_name, property_name, :cols => 50, :rows => 10, :class => "textField", :value => @object.send(property_name) %>
? +++++++++++++++++++++++++++++++++++++++
| 2 | 0.25 | 1 | 1 |
ae927b4274dbe85701a141e64b2d9238067b8785 | scripts/script.php | scripts/script.php | <?php
/**
*
*/
class Script
{
protected $helpMessage = '';
protected $matches;
protected $message;
protected $waConnection;
function __construct($message, $matches, $waConnection)
{
$this->matches = $matches;
$this->message = $message;
$this->waConnection = $waConnection;
}
public function help()
{
return $helpMessage;
}
public function run()
{
}
public function send($from, $content, $type = 'text')
{
switch ($type) {
case 'text':
return $this->waConnection->sendMessage($from, $content);
break;
case 'image':
return $this->waConnection->sendMessageImage($from, $content);
break;
case 'audio':
return $this->waConnection->sendMessageAudio($from, $content);
break;
case 'video':
return $this->waConnection->sendMessageVideo($from, $content);
break;
case 'location':
return $this->waConnection->sendMessageLocation($from, $content);
break;
}
}
}
?>
| <?php
/**
*
*/
class Script
{
protected $helpMessage = '';
protected $matches;
protected $message;
protected $waConnection;
function __construct($message, $matches, $waConnection)
{
$this->matches = $matches;
$this->message = $message;
$this->waConnection = $waConnection;
}
function __destruct()
{
}
public function help()
{
return $helpMessage;
}
public function run()
{
}
public function send($from, $content, $type = 'text')
{
switch ($type) {
case 'text':
return $this->waConnection->sendMessage($from, $content);
break;
case 'image':
return $this->waConnection->sendMessageImage($from, $content);
break;
case 'audio':
return $this->waConnection->sendMessageAudio($from, $content);
break;
case 'video':
return $this->waConnection->sendMessageVideo($from, $content);
break;
case 'location':
return $this->waConnection->sendMessageLocation($from, $content);
break;
}
}
}
?>
| Add a method to destruct the classes | Add a method to destruct the classes
| PHP | mit | Detlefff/Bot,Detlefff/Detlefff | php | ## Code Before:
<?php
/**
*
*/
class Script
{
protected $helpMessage = '';
protected $matches;
protected $message;
protected $waConnection;
function __construct($message, $matches, $waConnection)
{
$this->matches = $matches;
$this->message = $message;
$this->waConnection = $waConnection;
}
public function help()
{
return $helpMessage;
}
public function run()
{
}
public function send($from, $content, $type = 'text')
{
switch ($type) {
case 'text':
return $this->waConnection->sendMessage($from, $content);
break;
case 'image':
return $this->waConnection->sendMessageImage($from, $content);
break;
case 'audio':
return $this->waConnection->sendMessageAudio($from, $content);
break;
case 'video':
return $this->waConnection->sendMessageVideo($from, $content);
break;
case 'location':
return $this->waConnection->sendMessageLocation($from, $content);
break;
}
}
}
?>
## Instruction:
Add a method to destruct the classes
## Code After:
<?php
/**
*
*/
class Script
{
protected $helpMessage = '';
protected $matches;
protected $message;
protected $waConnection;
function __construct($message, $matches, $waConnection)
{
$this->matches = $matches;
$this->message = $message;
$this->waConnection = $waConnection;
}
function __destruct()
{
}
public function help()
{
return $helpMessage;
}
public function run()
{
}
public function send($from, $content, $type = 'text')
{
switch ($type) {
case 'text':
return $this->waConnection->sendMessage($from, $content);
break;
case 'image':
return $this->waConnection->sendMessageImage($from, $content);
break;
case 'audio':
return $this->waConnection->sendMessageAudio($from, $content);
break;
case 'video':
return $this->waConnection->sendMessageVideo($from, $content);
break;
case 'location':
return $this->waConnection->sendMessageLocation($from, $content);
break;
}
}
}
?>
| <?php
/**
*
*/
class Script
{
protected $helpMessage = '';
protected $matches;
protected $message;
protected $waConnection;
function __construct($message, $matches, $waConnection)
{
$this->matches = $matches;
$this->message = $message;
$this->waConnection = $waConnection;
+ }
+
+ function __destruct()
+ {
}
public function help()
{
return $helpMessage;
}
public function run()
{
}
public function send($from, $content, $type = 'text')
{
switch ($type) {
case 'text':
return $this->waConnection->sendMessage($from, $content);
break;
case 'image':
return $this->waConnection->sendMessageImage($from, $content);
break;
case 'audio':
return $this->waConnection->sendMessageAudio($from, $content);
break;
case 'video':
return $this->waConnection->sendMessageVideo($from, $content);
break;
case 'location':
return $this->waConnection->sendMessageLocation($from, $content);
break;
}
}
}
?> | 4 | 0.076923 | 4 | 0 |
798c6b98840d23532ea97a62aa3b8acf38a485ca | app/assets/javascripts/voluntary_ranking/routes/arguments/index_route.js.coffee | app/assets/javascripts/voluntary_ranking/routes/arguments/index_route.js.coffee | Volontariat.ArgumentsIndexRoute = Ember.Route.extend
model: (params) ->
@controllerFor('arguments.index').set 'page', parseInt(params.page)
@controllerFor('arguments.index').set 'thingId', @modelFor('thing').id
@store.find 'argument', thing_id: @modelFor('thing').id, page: params.page
setupController: (controller, model) ->
controller.send('goToPageWithoutRedirect', controller.get('page'))
controller.set('model', model)
actions:
openModal: (modalName) ->
@render modalName,
into: "arguments.index"
outlet: "modal"
$('#modal').modal('show')
closeModal: ->
@disconnectOutlet
outlet: "modal"
parentView: "arguments.index"
$('#modal').modal('hide') | Volontariat.ArgumentsIndexRoute = Ember.Route.extend
model: (params) ->
@controllerFor('arguments.index').set 'page', parseInt(params.page)
@controllerFor('arguments.index').set 'thingName', @modelFor('thing')._data.name
@store.find 'argument', thing_id: @modelFor('thing').id, page: params.page
setupController: (controller, model) ->
controller.send('goToPageWithoutRedirect', controller.get('page'))
controller.set('model', model)
actions:
openModal: (modalName) ->
@render modalName,
into: "arguments.index"
outlet: "modal"
$('#modal').modal('show')
$('#modal').removeClass('hide')
closeModal: ->
@disconnectOutlet
outlet: "modal"
parentView: "arguments.index"
$('#modal').modal('hide')
$('#modal').addClass('hide')
$('body').removeClass('modal-open')
$('.modal-backdrop').remove() | Change thing by ID to thing by name route and close new argument modal right. | Change thing by ID to thing by name route and close new argument modal right.
| CoffeeScript | mit | volontariat/voluntary_ranking,volontariat/voluntary_ranking,volontariat/voluntary_ranking | coffeescript | ## Code Before:
Volontariat.ArgumentsIndexRoute = Ember.Route.extend
model: (params) ->
@controllerFor('arguments.index').set 'page', parseInt(params.page)
@controllerFor('arguments.index').set 'thingId', @modelFor('thing').id
@store.find 'argument', thing_id: @modelFor('thing').id, page: params.page
setupController: (controller, model) ->
controller.send('goToPageWithoutRedirect', controller.get('page'))
controller.set('model', model)
actions:
openModal: (modalName) ->
@render modalName,
into: "arguments.index"
outlet: "modal"
$('#modal').modal('show')
closeModal: ->
@disconnectOutlet
outlet: "modal"
parentView: "arguments.index"
$('#modal').modal('hide')
## Instruction:
Change thing by ID to thing by name route and close new argument modal right.
## Code After:
Volontariat.ArgumentsIndexRoute = Ember.Route.extend
model: (params) ->
@controllerFor('arguments.index').set 'page', parseInt(params.page)
@controllerFor('arguments.index').set 'thingName', @modelFor('thing')._data.name
@store.find 'argument', thing_id: @modelFor('thing').id, page: params.page
setupController: (controller, model) ->
controller.send('goToPageWithoutRedirect', controller.get('page'))
controller.set('model', model)
actions:
openModal: (modalName) ->
@render modalName,
into: "arguments.index"
outlet: "modal"
$('#modal').modal('show')
$('#modal').removeClass('hide')
closeModal: ->
@disconnectOutlet
outlet: "modal"
parentView: "arguments.index"
$('#modal').modal('hide')
$('#modal').addClass('hide')
$('body').removeClass('modal-open')
$('.modal-backdrop').remove() | Volontariat.ArgumentsIndexRoute = Ember.Route.extend
model: (params) ->
@controllerFor('arguments.index').set 'page', parseInt(params.page)
- @controllerFor('arguments.index').set 'thingId', @modelFor('thing').id
? ^^ ^
+ @controllerFor('arguments.index').set 'thingName', @modelFor('thing')._data.name
? ^^^^ ^ ++++++++
@store.find 'argument', thing_id: @modelFor('thing').id, page: params.page
setupController: (controller, model) ->
controller.send('goToPageWithoutRedirect', controller.get('page'))
controller.set('model', model)
actions:
openModal: (modalName) ->
@render modalName,
into: "arguments.index"
outlet: "modal"
$('#modal').modal('show')
+ $('#modal').removeClass('hide')
closeModal: ->
@disconnectOutlet
outlet: "modal"
parentView: "arguments.index"
$('#modal').modal('hide')
+ $('#modal').addClass('hide')
+ $('body').removeClass('modal-open')
+ $('.modal-backdrop').remove() | 6 | 0.25 | 5 | 1 |
5bf63f8ea6be0eacc750fee1f109e474955a517d | message-processor/processors/index.js | message-processor/processors/index.js | const fs = require('fs')
const processors = fs.readdirSync(__dirname)
.filter((file) => file !== 'index.js')
.map((file) => {
const {processMessage, order} = require(`./${file}`)
return {
order,
processMessage: processMessage || ((msg) => msg),
}
})
.sort(({order: o1}, {order: o2}) => o1 - o2)
module.exports = {processors}
| const fs = require('fs')
const processors = fs.readdirSync(__dirname)
.filter((file) => file !== 'index.js')
.map((file) => {
const {processMessage, order} = require(`./${file}`)
return {
order,
processMessage: processMessage || ((msg) => msg),
}
})
.sort(({order: o1}, {order: o2}) => o1 - o2)
.map(({processMessage}) => processMessage)
module.exports = {processors}
| Fix message processor pipeline initialization | Fix message processor pipeline initialization
- Was not actually returning an array of functions from
`processors/index.js`
| JavaScript | mit | nirmit/nylas-mail,nylas/nylas-mail,nylas/nylas-mail,nirmit/nylas-mail,nylas/nylas-mail,simonft/nylas-mail,simonft/nylas-mail,nirmit/nylas-mail,nirmit/nylas-mail,simonft/nylas-mail,simonft/nylas-mail,nirmit/nylas-mail,nylas/nylas-mail,nylas/nylas-mail,nylas-mail-lives/nylas-mail,nylas-mail-lives/nylas-mail,nylas-mail-lives/nylas-mail,nylas-mail-lives/nylas-mail,nylas-mail-lives/nylas-mail,simonft/nylas-mail | javascript | ## Code Before:
const fs = require('fs')
const processors = fs.readdirSync(__dirname)
.filter((file) => file !== 'index.js')
.map((file) => {
const {processMessage, order} = require(`./${file}`)
return {
order,
processMessage: processMessage || ((msg) => msg),
}
})
.sort(({order: o1}, {order: o2}) => o1 - o2)
module.exports = {processors}
## Instruction:
Fix message processor pipeline initialization
- Was not actually returning an array of functions from
`processors/index.js`
## Code After:
const fs = require('fs')
const processors = fs.readdirSync(__dirname)
.filter((file) => file !== 'index.js')
.map((file) => {
const {processMessage, order} = require(`./${file}`)
return {
order,
processMessage: processMessage || ((msg) => msg),
}
})
.sort(({order: o1}, {order: o2}) => o1 - o2)
.map(({processMessage}) => processMessage)
module.exports = {processors}
| const fs = require('fs')
const processors = fs.readdirSync(__dirname)
.filter((file) => file !== 'index.js')
.map((file) => {
const {processMessage, order} = require(`./${file}`)
return {
order,
processMessage: processMessage || ((msg) => msg),
}
})
.sort(({order: o1}, {order: o2}) => o1 - o2)
+ .map(({processMessage}) => processMessage)
module.exports = {processors} | 1 | 0.071429 | 1 | 0 |
f93145b58a5f8cd540b24310deef772bccdeeeb1 | lib/index.js | lib/index.js | 'use strict';
var config = require('../config/configuration.js');
function htmlReplace(str) {
return str.replace(/<\/?[^>]+\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
}
module.exports = function(path, document, changes, finalCb) {
if(!document.data.html) {
changes.data.html = document.metadata.text;
}
else if(!document.metadata.text) {
changes.metadata.text = htmlReplace(document.data.html);
}
changes.metadata.text = (changes.metadata.text) ? changes.metadata.text : document.metadata.text;
if(document.data.html) {
config.separators.html.forEach(function(separator) {
var tmpHTML = document.data.html.split(separator)[0];
if(tmpHTML !== document.data.html) {
changes.metadata.text = htmlReplace(tmpHTML);
}
});
}
if(changes.metadata.text) {
config.separators.text.forEach(function(separator) {
var tmpText = changes.metadata.text.split(separator)[0];
if(tmpText !== changes.metadata.text) {
changes.metadata.text = tmpText;
}
});
}
finalCb(null, changes);
};
| 'use strict';
var config = require('../config/configuration.js');
function htmlReplace(str) {
return str.replace(/<\/?[^>]+\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
}
module.exports = function(path, document, changes, finalCb) {
if(!document.data.html) {
changes.data.html = document.metadata.text.replace(/\n/g, '<br/>\n');
}
else if(!document.metadata.text) {
changes.metadata.text = htmlReplace(document.data.html);
}
changes.metadata.text = (changes.metadata.text) ? changes.metadata.text : document.metadata.text;
if(document.data.html) {
config.separators.html.forEach(function(separator) {
var tmpHTML = document.data.html.split(separator)[0];
if(tmpHTML !== document.data.html) {
changes.metadata.text = htmlReplace(tmpHTML);
}
});
}
if(changes.metadata.text) {
config.separators.text.forEach(function(separator) {
var tmpText = changes.metadata.text.split(separator)[0];
if(tmpText !== changes.metadata.text) {
changes.metadata.text = tmpText;
}
});
}
finalCb(null, changes);
};
| Replace \n by <br/> when we use text as html | Replace \n by <br/> when we use text as html
| JavaScript | mit | AnyFetch/embedmail-hydrater.anyfetch.com | javascript | ## Code Before:
'use strict';
var config = require('../config/configuration.js');
function htmlReplace(str) {
return str.replace(/<\/?[^>]+\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
}
module.exports = function(path, document, changes, finalCb) {
if(!document.data.html) {
changes.data.html = document.metadata.text;
}
else if(!document.metadata.text) {
changes.metadata.text = htmlReplace(document.data.html);
}
changes.metadata.text = (changes.metadata.text) ? changes.metadata.text : document.metadata.text;
if(document.data.html) {
config.separators.html.forEach(function(separator) {
var tmpHTML = document.data.html.split(separator)[0];
if(tmpHTML !== document.data.html) {
changes.metadata.text = htmlReplace(tmpHTML);
}
});
}
if(changes.metadata.text) {
config.separators.text.forEach(function(separator) {
var tmpText = changes.metadata.text.split(separator)[0];
if(tmpText !== changes.metadata.text) {
changes.metadata.text = tmpText;
}
});
}
finalCb(null, changes);
};
## Instruction:
Replace \n by <br/> when we use text as html
## Code After:
'use strict';
var config = require('../config/configuration.js');
function htmlReplace(str) {
return str.replace(/<\/?[^>]+\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
}
module.exports = function(path, document, changes, finalCb) {
if(!document.data.html) {
changes.data.html = document.metadata.text.replace(/\n/g, '<br/>\n');
}
else if(!document.metadata.text) {
changes.metadata.text = htmlReplace(document.data.html);
}
changes.metadata.text = (changes.metadata.text) ? changes.metadata.text : document.metadata.text;
if(document.data.html) {
config.separators.html.forEach(function(separator) {
var tmpHTML = document.data.html.split(separator)[0];
if(tmpHTML !== document.data.html) {
changes.metadata.text = htmlReplace(tmpHTML);
}
});
}
if(changes.metadata.text) {
config.separators.text.forEach(function(separator) {
var tmpText = changes.metadata.text.split(separator)[0];
if(tmpText !== changes.metadata.text) {
changes.metadata.text = tmpText;
}
});
}
finalCb(null, changes);
};
| 'use strict';
var config = require('../config/configuration.js');
function htmlReplace(str) {
return str.replace(/<\/?[^>]+\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
}
module.exports = function(path, document, changes, finalCb) {
if(!document.data.html) {
- changes.data.html = document.metadata.text;
+ changes.data.html = document.metadata.text.replace(/\n/g, '<br/>\n');
? ++++++++++++++++++++++++++
}
else if(!document.metadata.text) {
changes.metadata.text = htmlReplace(document.data.html);
}
changes.metadata.text = (changes.metadata.text) ? changes.metadata.text : document.metadata.text;
if(document.data.html) {
config.separators.html.forEach(function(separator) {
var tmpHTML = document.data.html.split(separator)[0];
if(tmpHTML !== document.data.html) {
changes.metadata.text = htmlReplace(tmpHTML);
}
});
}
if(changes.metadata.text) {
config.separators.text.forEach(function(separator) {
var tmpText = changes.metadata.text.split(separator)[0];
if(tmpText !== changes.metadata.text) {
changes.metadata.text = tmpText;
}
});
}
finalCb(null, changes);
}; | 2 | 0.05 | 1 | 1 |
834efd9d4804a497a17068356c5bc100e5e629db | examples/address_book/app/views/home/index.html.erb | examples/address_book/app/views/home/index.html.erb | <h1>Welcome to AddressBook</h1>
<p>A basic Rails application serving as an example of the <i>Respect for Rails</i> plugin</p>
| <h1>Welcome to AddressBook</h1>
<p>A basic Rails application serving as an example of the <i>Respect for Rails</i> plugin.</p>
<%= link_to "REST API documentation", respect.doc_path %>
| Add a link to the documentation on the homepage. | Add a link to the documentation on the homepage.
| HTML+ERB | mit | nicolasdespres/respect-rails,nicolasdespres/respect-rails,nicolasdespres/respect-rails | html+erb | ## Code Before:
<h1>Welcome to AddressBook</h1>
<p>A basic Rails application serving as an example of the <i>Respect for Rails</i> plugin</p>
## Instruction:
Add a link to the documentation on the homepage.
## Code After:
<h1>Welcome to AddressBook</h1>
<p>A basic Rails application serving as an example of the <i>Respect for Rails</i> plugin.</p>
<%= link_to "REST API documentation", respect.doc_path %>
| <h1>Welcome to AddressBook</h1>
- <p>A basic Rails application serving as an example of the <i>Respect for Rails</i> plugin</p>
+ <p>A basic Rails application serving as an example of the <i>Respect for Rails</i> plugin.</p>
? +
+ <%= link_to "REST API documentation", respect.doc_path %> | 3 | 1.5 | 2 | 1 |
94db2b46f8108d0f5e6edc0d65ae20eee40414aa | MdePkg/Include/PiPei.h | MdePkg/Include/PiPei.h | /** @file
Root include file for Mde Package SEC, PEIM, PEI_CORE type modules.
This is the include file for any module of type PEIM. PEIM
modules only use types defined via this include file and can
be ported easily to any environment.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __PI_PEI_H__
#define __PI_PEI_H__
#include <Uefi/UefiBaseType.h>
#include <Pi/PiPeiCis.h>
#include <Uefi/UefiMultiPhase.h>
//
// BUGBUG: The EFI_PEI_STARTUP_DESCRIPTOR definition does not follows PI specification.
// After enabling PI for Nt32Pkg and tools generate correct autogen for PEI_CORE,
// the following structure should be removed at once.
//
typedef struct {
UINTN BootFirmwareVolume;
UINTN SizeOfCacheAsRam;
EFI_PEI_PPI_DESCRIPTOR *DispatchTable;
} EFI_PEI_STARTUP_DESCRIPTOR;
#endif
| /** @file
Root include file for Mde Package SEC, PEIM, PEI_CORE type modules.
This is the include file for any module of type PEIM. PEIM
modules only use types defined via this include file and can
be ported easily to any environment.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __PI_PEI_H__
#define __PI_PEI_H__
#include <Uefi/UefiBaseType.h>
#include <Pi/PiPeiCis.h>
#include <Uefi/UefiMultiPhase.h>
#endif
| Move the EFI_PEI_STARTUP_DESCRIPTOR into IntelFrameworkPkg. | Move the EFI_PEI_STARTUP_DESCRIPTOR into IntelFrameworkPkg.
git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@4120 6f19259b-4bc3-4df7-8a09-765794883524
| C | bsd-2-clause | MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2 | c | ## Code Before:
/** @file
Root include file for Mde Package SEC, PEIM, PEI_CORE type modules.
This is the include file for any module of type PEIM. PEIM
modules only use types defined via this include file and can
be ported easily to any environment.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __PI_PEI_H__
#define __PI_PEI_H__
#include <Uefi/UefiBaseType.h>
#include <Pi/PiPeiCis.h>
#include <Uefi/UefiMultiPhase.h>
//
// BUGBUG: The EFI_PEI_STARTUP_DESCRIPTOR definition does not follows PI specification.
// After enabling PI for Nt32Pkg and tools generate correct autogen for PEI_CORE,
// the following structure should be removed at once.
//
typedef struct {
UINTN BootFirmwareVolume;
UINTN SizeOfCacheAsRam;
EFI_PEI_PPI_DESCRIPTOR *DispatchTable;
} EFI_PEI_STARTUP_DESCRIPTOR;
#endif
## Instruction:
Move the EFI_PEI_STARTUP_DESCRIPTOR into IntelFrameworkPkg.
git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@4120 6f19259b-4bc3-4df7-8a09-765794883524
## Code After:
/** @file
Root include file for Mde Package SEC, PEIM, PEI_CORE type modules.
This is the include file for any module of type PEIM. PEIM
modules only use types defined via this include file and can
be ported easily to any environment.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __PI_PEI_H__
#define __PI_PEI_H__
#include <Uefi/UefiBaseType.h>
#include <Pi/PiPeiCis.h>
#include <Uefi/UefiMultiPhase.h>
#endif
| /** @file
Root include file for Mde Package SEC, PEIM, PEI_CORE type modules.
This is the include file for any module of type PEIM. PEIM
modules only use types defined via this include file and can
be ported easily to any environment.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __PI_PEI_H__
#define __PI_PEI_H__
#include <Uefi/UefiBaseType.h>
#include <Pi/PiPeiCis.h>
#include <Uefi/UefiMultiPhase.h>
- //
- // BUGBUG: The EFI_PEI_STARTUP_DESCRIPTOR definition does not follows PI specification.
- // After enabling PI for Nt32Pkg and tools generate correct autogen for PEI_CORE,
- // the following structure should be removed at once.
- //
- typedef struct {
- UINTN BootFirmwareVolume;
- UINTN SizeOfCacheAsRam;
- EFI_PEI_PPI_DESCRIPTOR *DispatchTable;
- } EFI_PEI_STARTUP_DESCRIPTOR;
#endif
| 10 | 0.25641 | 0 | 10 |
51a60d1158183fec585c1e9ae58fb2d12150e424 | app/controllers/api/sign_ins_controller.rb | app/controllers/api/sign_ins_controller.rb | module Api
class SignInsController < BaseController
skip_before_action :authenticate!
private
def build_resource
@sign_in = Api::SignIn.new(resource_params)
end
def resource
@sign_in
end
def resource_params
params.require(:sign_in).permit(:email, :password, :name, :device, :device_token)
end
end
end
| module Api
class SignInsController < BaseController
skip_before_action :authenticate!
def create
build_resource
resource.save!
end
private
def build_resource
@sign_in = Api::SignIn.new(resource_params)
end
def resource
@sign_in
end
def resource_params
params.require(:sign_in).permit(:email, :password, :name, :device, :device_token)
end
end
end
| Fix api sign ins controller | Fix api sign ins controller
| Ruby | mit | biow0lf/evemonk,biow0lf/evemonk,biow0lf/evemonk | ruby | ## Code Before:
module Api
class SignInsController < BaseController
skip_before_action :authenticate!
private
def build_resource
@sign_in = Api::SignIn.new(resource_params)
end
def resource
@sign_in
end
def resource_params
params.require(:sign_in).permit(:email, :password, :name, :device, :device_token)
end
end
end
## Instruction:
Fix api sign ins controller
## Code After:
module Api
class SignInsController < BaseController
skip_before_action :authenticate!
def create
build_resource
resource.save!
end
private
def build_resource
@sign_in = Api::SignIn.new(resource_params)
end
def resource
@sign_in
end
def resource_params
params.require(:sign_in).permit(:email, :password, :name, :device, :device_token)
end
end
end
| module Api
class SignInsController < BaseController
skip_before_action :authenticate!
+
+ def create
+ build_resource
+
+ resource.save!
+ end
private
def build_resource
@sign_in = Api::SignIn.new(resource_params)
end
def resource
@sign_in
end
def resource_params
params.require(:sign_in).permit(:email, :password, :name, :device, :device_token)
end
end
end | 6 | 0.315789 | 6 | 0 |
526b988a3dc06e92509e6c67910dbded36ba5aec | src/definitions.h | src/definitions.h |
using uint = unsigned int;
using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;
const int CLOCK_RATE = 4194304;
template <typename... T> void unused(T&&...) {}
#define fatal_error() log_error("Fatal error: %s:%d", __FILE__, __LINE__); exit(1);
enum class GBColor {
Color0, /* White */
Color1, /* Light gray */
Color2, /* Dark gray */
Color3, /* Black */
};
enum class Color {
White,
LightGray,
DarkGray,
Black,
};
struct BGPalette {
Color color0 = Color::White;
Color color1 = Color::LightGray;
Color color2 = Color::DarkGray;
Color color3 = Color::Black;
};
struct Noncopyable {
Noncopyable& operator=(const Noncopyable&) = delete;
Noncopyable(const Noncopyable&) = delete;
Noncopyable() = default;
};
|
using uint = unsigned int;
using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
using s16 = uint16_t;
const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;
const int CLOCK_RATE = 4194304;
template <typename... T> void unused(T&&...) {}
#define fatal_error() log_error("Fatal error: %s:%d", __FILE__, __LINE__); exit(1);
enum class GBColor {
Color0, /* White */
Color1, /* Light gray */
Color2, /* Dark gray */
Color3, /* Black */
};
enum class Color {
White,
LightGray,
DarkGray,
Black,
};
struct BGPalette {
Color color0 = Color::White;
Color color1 = Color::LightGray;
Color color2 = Color::DarkGray;
Color color3 = Color::Black;
};
struct Noncopyable {
Noncopyable& operator=(const Noncopyable&) = delete;
Noncopyable(const Noncopyable&) = delete;
Noncopyable() = default;
};
| Add a s16 (signed 16-bit int) for symmetry with u8/u16 | Add a s16 (signed 16-bit int) for symmetry with u8/u16
| C | bsd-3-clause | jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator | c | ## Code Before:
using uint = unsigned int;
using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;
const int CLOCK_RATE = 4194304;
template <typename... T> void unused(T&&...) {}
#define fatal_error() log_error("Fatal error: %s:%d", __FILE__, __LINE__); exit(1);
enum class GBColor {
Color0, /* White */
Color1, /* Light gray */
Color2, /* Dark gray */
Color3, /* Black */
};
enum class Color {
White,
LightGray,
DarkGray,
Black,
};
struct BGPalette {
Color color0 = Color::White;
Color color1 = Color::LightGray;
Color color2 = Color::DarkGray;
Color color3 = Color::Black;
};
struct Noncopyable {
Noncopyable& operator=(const Noncopyable&) = delete;
Noncopyable(const Noncopyable&) = delete;
Noncopyable() = default;
};
## Instruction:
Add a s16 (signed 16-bit int) for symmetry with u8/u16
## Code After:
using uint = unsigned int;
using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
using s16 = uint16_t;
const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;
const int CLOCK_RATE = 4194304;
template <typename... T> void unused(T&&...) {}
#define fatal_error() log_error("Fatal error: %s:%d", __FILE__, __LINE__); exit(1);
enum class GBColor {
Color0, /* White */
Color1, /* Light gray */
Color2, /* Dark gray */
Color3, /* Black */
};
enum class Color {
White,
LightGray,
DarkGray,
Black,
};
struct BGPalette {
Color color0 = Color::White;
Color color1 = Color::LightGray;
Color color2 = Color::DarkGray;
Color color3 = Color::Black;
};
struct Noncopyable {
Noncopyable& operator=(const Noncopyable&) = delete;
Noncopyable(const Noncopyable&) = delete;
Noncopyable() = default;
};
|
using uint = unsigned int;
using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
+ using s16 = uint16_t;
const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;
const int CLOCK_RATE = 4194304;
template <typename... T> void unused(T&&...) {}
#define fatal_error() log_error("Fatal error: %s:%d", __FILE__, __LINE__); exit(1);
enum class GBColor {
Color0, /* White */
Color1, /* Light gray */
Color2, /* Dark gray */
Color3, /* Black */
};
enum class Color {
White,
LightGray,
DarkGray,
Black,
};
struct BGPalette {
Color color0 = Color::White;
Color color1 = Color::LightGray;
Color color2 = Color::DarkGray;
Color color3 = Color::Black;
};
struct Noncopyable {
Noncopyable& operator=(const Noncopyable&) = delete;
Noncopyable(const Noncopyable&) = delete;
Noncopyable() = default;
}; | 1 | 0.02381 | 1 | 0 |
649c57f46cc89f87883993f2eb1af0f18a161cf8 | LICENSE.txt | LICENSE.txt | ==== Framework ====
The -ontop- framework is available under a dual licensing:
* Free Software Foundation’s GNU AGPL v3.0
* Alternative licenses are also available, please contact the authors for
further information.
==== Documentation ====
All documentation is licensed under the Creative Commons license.
==== Contributing to the ontop project ====
Soon we will start accepting code contributions. We are now preparing the
contribution agreement to enable you to do this and still be able to maintain
our dual license scheme.
| ==== Framework ====
The -ontop- framework is available under a dual licensing:
* Free Software Foundation’s GNU AGPL v3.0
* Alternative licenses are also available, please contact the authors for
further information.
==== Documentation ====
All documentation is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike-3.0
(http://creativecommons.org/licenses/by-nc-sa/3.0/) license.
==== Contributing to the ontop project ====
Soon we will start accepting code contributions. We are now preparing the
contribution agreement to enable you to do this and still be able to maintain
our dual license scheme.
| Add the specific Creative Commons license | Add the specific Creative Commons license
The text may have lost the link when it was copied from the website. It is not suitable to just say "the Creative Commons license" in either case though, as there are many very distinct versions of it. | Text | apache-2.0 | clarkparsia/ontop,ontop/ontop,ConstantB/ontop-spatial,ConstantB/ontop-spatial,ConstantB/ontop-spatial,clarkparsia/ontop,ontop/ontop,eschwert/ontop,eschwert/ontop,eschwert/ontop,eschwert/ontop,ghxiao/ontop-spatial,srapisarda/ontop,ontop/ontop,clarkparsia/ontop,ghxiao/ontop-spatial,srapisarda/ontop,ontop/ontop,ConstantB/ontop-spatial,ghxiao/ontop-spatial,srapisarda/ontop,ghxiao/ontop-spatial,ontop/ontop,srapisarda/ontop | text | ## Code Before:
==== Framework ====
The -ontop- framework is available under a dual licensing:
* Free Software Foundation’s GNU AGPL v3.0
* Alternative licenses are also available, please contact the authors for
further information.
==== Documentation ====
All documentation is licensed under the Creative Commons license.
==== Contributing to the ontop project ====
Soon we will start accepting code contributions. We are now preparing the
contribution agreement to enable you to do this and still be able to maintain
our dual license scheme.
## Instruction:
Add the specific Creative Commons license
The text may have lost the link when it was copied from the website. It is not suitable to just say "the Creative Commons license" in either case though, as there are many very distinct versions of it.
## Code After:
==== Framework ====
The -ontop- framework is available under a dual licensing:
* Free Software Foundation’s GNU AGPL v3.0
* Alternative licenses are also available, please contact the authors for
further information.
==== Documentation ====
All documentation is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike-3.0
(http://creativecommons.org/licenses/by-nc-sa/3.0/) license.
==== Contributing to the ontop project ====
Soon we will start accepting code contributions. We are now preparing the
contribution agreement to enable you to do this and still be able to maintain
our dual license scheme.
| ==== Framework ====
The -ontop- framework is available under a dual licensing:
* Free Software Foundation’s GNU AGPL v3.0
* Alternative licenses are also available, please contact the authors for
further information.
==== Documentation ====
- All documentation is licensed under the Creative Commons license.
? ^ ^^^
+ All documentation is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike-3.0
? ++++++++++++++++++++++++++++++++ ^ ^^ +
+ (http://creativecommons.org/licenses/by-nc-sa/3.0/) license.
==== Contributing to the ontop project ====
Soon we will start accepting code contributions. We are now preparing the
contribution agreement to enable you to do this and still be able to maintain
our dual license scheme. | 3 | 0.176471 | 2 | 1 |
f60e52e3f9011fdf7267f8214884edf27267ab86 | config/mongoid.yml | config/mongoid.yml | development:
host: localhost
database: plan_characters_dev
test:
sessions:
default:
database: myapp_test
host: localhost
port: 27017
production:
uri: <%= ENV['MONGOHQ_URL'] %>
| development:
host: localhost
database: plan_characters_dev
test:
sessions:
default:
database: myapp_test
hosts:
- localhost:27017
production:
uri: <%= ENV['MONGOHQ_URL'] %>
| Configure the default test database *correctly* | Configure the default test database *correctly*
| YAML | mit | indentlabs/notebook,indentlabs/notebook,indentlabs/notebook | yaml | ## Code Before:
development:
host: localhost
database: plan_characters_dev
test:
sessions:
default:
database: myapp_test
host: localhost
port: 27017
production:
uri: <%= ENV['MONGOHQ_URL'] %>
## Instruction:
Configure the default test database *correctly*
## Code After:
development:
host: localhost
database: plan_characters_dev
test:
sessions:
default:
database: myapp_test
hosts:
- localhost:27017
production:
uri: <%= ENV['MONGOHQ_URL'] %>
| development:
host: localhost
database: plan_characters_dev
test:
sessions:
default:
database: myapp_test
- host: localhost
- port: 27017
+ hosts:
+ - localhost:27017
production:
uri: <%= ENV['MONGOHQ_URL'] %> | 4 | 0.307692 | 2 | 2 |
f0cdda62c1da25ee6ee306ad6be85620a8cb3aa4 | hosting/src/components/App.js | hosting/src/components/App.js | import React, { Component } from 'react'
import {BrowserRouter as Router, Route, Link} from 'react-router-dom'
import Auth from './Auth'
import Dashboard from './Dashboard'
import Data from './Data'
import Home from './Home'
import LanguageBar from './shared/LanguageBar'
import Footer from './shared/Footer'
import Styles from './Styles'
import Transfer from './Transfer'
export default class App extends Component {
render (){
return (
<Router>
<Styles>
<Data>
{(props) => (
<div>
<LanguageBar>English</LanguageBar>
<Auth user={props.user}>
<div>
<Route exact path="/" render={() => (
<Home {...props}/>
)}/>
<Route exact path="/transfer/:amount/to/:to" render={(routeProps) => (
<Transfer {...routeProps} {...props}/>
)}/>
<Route exact path="/dashboard" component={Dashboard}/>
</div>
</Auth>
<Footer/>
</div>
)}
</Data>
</Styles>
</Router>
)
}
}
| import React, { Component } from 'react'
import {BrowserRouter as Router, Route, Link} from 'react-router-dom'
import Auth from './Auth'
import Dashboard from './Dashboard'
import Data from './Data'
import Home from './Home'
import LanguageBar from './shared/LanguageBar'
import Footer from './shared/Footer'
import Styles from './Styles'
import Transfer from './Transfer'
export default class App extends Component {
render (){
return (
<Router>
<Styles>
<Data>
{(props) => (
<div>
<Route exact path="/dashboard" component={Dashboard}/>
<Route exact path="(/|/transfer.*)" render={() => (
<div>
<LanguageBar>English</LanguageBar>
<Auth user={props.user}>
<div>
<Route exact path="/" render={() => (
<Home {...props}/>
)}/>
<Route exact path="/transfer/:amount/to/:to" render={(routeProps) => (
<Transfer {...routeProps} {...props}/>
)}/>
</div>
</Auth>
<Footer/>
</div>
)}/>
</div>
)}
</Data>
</Styles>
</Router>
)
}
}
| Remove render of header and footer on dashboard | Remove render of header and footer on dashboard
| JavaScript | mit | csrf-demo/csrf-demo,csrf-demo/csrf-demo | javascript | ## Code Before:
import React, { Component } from 'react'
import {BrowserRouter as Router, Route, Link} from 'react-router-dom'
import Auth from './Auth'
import Dashboard from './Dashboard'
import Data from './Data'
import Home from './Home'
import LanguageBar from './shared/LanguageBar'
import Footer from './shared/Footer'
import Styles from './Styles'
import Transfer from './Transfer'
export default class App extends Component {
render (){
return (
<Router>
<Styles>
<Data>
{(props) => (
<div>
<LanguageBar>English</LanguageBar>
<Auth user={props.user}>
<div>
<Route exact path="/" render={() => (
<Home {...props}/>
)}/>
<Route exact path="/transfer/:amount/to/:to" render={(routeProps) => (
<Transfer {...routeProps} {...props}/>
)}/>
<Route exact path="/dashboard" component={Dashboard}/>
</div>
</Auth>
<Footer/>
</div>
)}
</Data>
</Styles>
</Router>
)
}
}
## Instruction:
Remove render of header and footer on dashboard
## Code After:
import React, { Component } from 'react'
import {BrowserRouter as Router, Route, Link} from 'react-router-dom'
import Auth from './Auth'
import Dashboard from './Dashboard'
import Data from './Data'
import Home from './Home'
import LanguageBar from './shared/LanguageBar'
import Footer from './shared/Footer'
import Styles from './Styles'
import Transfer from './Transfer'
export default class App extends Component {
render (){
return (
<Router>
<Styles>
<Data>
{(props) => (
<div>
<Route exact path="/dashboard" component={Dashboard}/>
<Route exact path="(/|/transfer.*)" render={() => (
<div>
<LanguageBar>English</LanguageBar>
<Auth user={props.user}>
<div>
<Route exact path="/" render={() => (
<Home {...props}/>
)}/>
<Route exact path="/transfer/:amount/to/:to" render={(routeProps) => (
<Transfer {...routeProps} {...props}/>
)}/>
</div>
</Auth>
<Footer/>
</div>
)}/>
</div>
)}
</Data>
</Styles>
</Router>
)
}
}
| import React, { Component } from 'react'
import {BrowserRouter as Router, Route, Link} from 'react-router-dom'
import Auth from './Auth'
import Dashboard from './Dashboard'
import Data from './Data'
import Home from './Home'
import LanguageBar from './shared/LanguageBar'
import Footer from './shared/Footer'
import Styles from './Styles'
import Transfer from './Transfer'
export default class App extends Component {
render (){
return (
<Router>
<Styles>
<Data>
{(props) => (
<div>
- <LanguageBar>English</LanguageBar>
- <Auth user={props.user}>
+ <Route exact path="/dashboard" component={Dashboard}/>
+ <Route exact path="(/|/transfer.*)" render={() => (
<div>
+ <LanguageBar>English</LanguageBar>
+ <Auth user={props.user}>
+ <div>
- <Route exact path="/" render={() => (
+ <Route exact path="/" render={() => (
? ++++
- <Home {...props}/>
+ <Home {...props}/>
? ++++
- )}/>
+ )}/>
? ++++
- <Route exact path="/transfer/:amount/to/:to" render={(routeProps) => (
+ <Route exact path="/transfer/:amount/to/:to" render={(routeProps) => (
? ++++ +
- <Transfer {...routeProps} {...props}/>
+ <Transfer {...routeProps} {...props}/>
? ++++
- )}/>
+ )}/>
? ++++
- <Route exact path="/dashboard" component={Dashboard}/>
+ </div>
+ </Auth>
+ <Footer/>
</div>
- </Auth>
? ^ ----
+ )}/>
? ^^
- <Footer/>
</div>
)}
</Data>
</Styles>
</Router>
)
}
} | 26 | 0.65 | 15 | 11 |
4616be4c440eb619395d4732366145d95730d5ce | src/Ojs/JournalBundle/Resources/views/ArticleFile/index.html.twig | src/Ojs/JournalBundle/Resources/views/ArticleFile/index.html.twig | {% extends '::ojsbase.html.twig' %}
{% block title %}{{ 'title.article_files'|trans }} {{ parent() }}{% endblock %}
{% block breadcrumb %}
{% set list = [
{'link': path('dashboard'), 'title': 'dashboard'|trans},
{'title': 'title.article_files'|trans}
] %}
{{ breadcrumb(list) }}
{% endblock %}
{% block body -%}
{% include '::flashbag.html.twig' %}
<ul class="nav nav-tabs">
<li role="presentation"><a href="{{ path('ojs_journal_article_show', {id: article.id}) }}">{{ "Info"|trans }}</a></li>
<li role="presentation" class="active"><a href="{{ path('ojs_journal_article_file_index', {article: article.id}) }}">{{ "Article Files"|trans }}</a></li>
<li role="presentation"><a href="{{ path('ojs_journal_citation_index', {article: article.id}) }}">{{ "title.citations"|trans }}</a></li>
</ul>
<h2>{{ 'title.article_files'|trans }}</h2>
<a href="{{ url('ojs_journal_article_file_new', {article: article.id}) }}" class="btn btn-success">
{{ "c"|trans }}
</a>
<hr>
{{ grid(grid) }}
{% endblock %}
| {% extends '::ojsbase.html.twig' %}
{% block title %}{{ 'title.article_files'|trans }} {{ parent() }}{% endblock %}
{% block breadcrumb %}
{% set list = [
{'link': path('dashboard'), 'title': 'dashboard'|trans},
{'title': 'title.article_files'|trans}
] %}
{{ breadcrumb(list) }}
{% endblock %}
{% block body -%}
{% include '::flashbag.html.twig' %}
<ul class="nav nav-tabs">
<li role="presentation"><a href="{{ path('ojs_journal_article_show', {id: article.id, journalId: article.journal.id}) }}">{{ "Info"|trans }}</a></li>
<li role="presentation" class="active"><a href="{{ path('ojs_journal_article_file_index', {article: article.id}) }}">{{ "Article Files"|trans }}</a></li>
<li role="presentation"><a href="{{ path('ojs_journal_citation_index', {article: article.id}) }}">{{ "title.citations"|trans }}</a></li>
</ul>
<h2>{{ 'title.article_files'|trans }}</h2>
<a href="{{ url('ojs_journal_article_file_new', {article: article.id}) }}" class="btn btn-success">
{{ "c"|trans }}
</a>
<hr>
{{ grid(grid) }}
{% endblock %}
| Fix missing parameter problem once again | Fix missing parameter problem once again
| Twig | mit | zaferkanbur/ojs,zaferkanbur/ojs,zaferkanbur/ojs | twig | ## Code Before:
{% extends '::ojsbase.html.twig' %}
{% block title %}{{ 'title.article_files'|trans }} {{ parent() }}{% endblock %}
{% block breadcrumb %}
{% set list = [
{'link': path('dashboard'), 'title': 'dashboard'|trans},
{'title': 'title.article_files'|trans}
] %}
{{ breadcrumb(list) }}
{% endblock %}
{% block body -%}
{% include '::flashbag.html.twig' %}
<ul class="nav nav-tabs">
<li role="presentation"><a href="{{ path('ojs_journal_article_show', {id: article.id}) }}">{{ "Info"|trans }}</a></li>
<li role="presentation" class="active"><a href="{{ path('ojs_journal_article_file_index', {article: article.id}) }}">{{ "Article Files"|trans }}</a></li>
<li role="presentation"><a href="{{ path('ojs_journal_citation_index', {article: article.id}) }}">{{ "title.citations"|trans }}</a></li>
</ul>
<h2>{{ 'title.article_files'|trans }}</h2>
<a href="{{ url('ojs_journal_article_file_new', {article: article.id}) }}" class="btn btn-success">
{{ "c"|trans }}
</a>
<hr>
{{ grid(grid) }}
{% endblock %}
## Instruction:
Fix missing parameter problem once again
## Code After:
{% extends '::ojsbase.html.twig' %}
{% block title %}{{ 'title.article_files'|trans }} {{ parent() }}{% endblock %}
{% block breadcrumb %}
{% set list = [
{'link': path('dashboard'), 'title': 'dashboard'|trans},
{'title': 'title.article_files'|trans}
] %}
{{ breadcrumb(list) }}
{% endblock %}
{% block body -%}
{% include '::flashbag.html.twig' %}
<ul class="nav nav-tabs">
<li role="presentation"><a href="{{ path('ojs_journal_article_show', {id: article.id, journalId: article.journal.id}) }}">{{ "Info"|trans }}</a></li>
<li role="presentation" class="active"><a href="{{ path('ojs_journal_article_file_index', {article: article.id}) }}">{{ "Article Files"|trans }}</a></li>
<li role="presentation"><a href="{{ path('ojs_journal_citation_index', {article: article.id}) }}">{{ "title.citations"|trans }}</a></li>
</ul>
<h2>{{ 'title.article_files'|trans }}</h2>
<a href="{{ url('ojs_journal_article_file_new', {article: article.id}) }}" class="btn btn-success">
{{ "c"|trans }}
</a>
<hr>
{{ grid(grid) }}
{% endblock %}
| {% extends '::ojsbase.html.twig' %}
{% block title %}{{ 'title.article_files'|trans }} {{ parent() }}{% endblock %}
{% block breadcrumb %}
{% set list = [
{'link': path('dashboard'), 'title': 'dashboard'|trans},
{'title': 'title.article_files'|trans}
] %}
{{ breadcrumb(list) }}
{% endblock %}
{% block body -%}
{% include '::flashbag.html.twig' %}
<ul class="nav nav-tabs">
- <li role="presentation"><a href="{{ path('ojs_journal_article_show', {id: article.id}) }}">{{ "Info"|trans }}</a></li>
+ <li role="presentation"><a href="{{ path('ojs_journal_article_show', {id: article.id, journalId: article.journal.id}) }}">{{ "Info"|trans }}</a></li>
? +++++++++++++++++++++++++++++++
<li role="presentation" class="active"><a href="{{ path('ojs_journal_article_file_index', {article: article.id}) }}">{{ "Article Files"|trans }}</a></li>
<li role="presentation"><a href="{{ path('ojs_journal_citation_index', {article: article.id}) }}">{{ "title.citations"|trans }}</a></li>
</ul>
<h2>{{ 'title.article_files'|trans }}</h2>
<a href="{{ url('ojs_journal_article_file_new', {article: article.id}) }}" class="btn btn-success">
{{ "c"|trans }}
</a>
<hr>
{{ grid(grid) }}
{% endblock %} | 2 | 0.071429 | 1 | 1 |
a4bfead8819da655e78d990680d200fae519cc55 | cmd/kube-dns/dns.go | cmd/kube-dns/dns.go | /*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"github.com/spf13/pflag"
"k8s.io/kubernetes/cmd/kube-dns/app"
"k8s.io/kubernetes/cmd/kube-dns/app/options"
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
"k8s.io/kubernetes/pkg/util/flag"
"k8s.io/kubernetes/pkg/util/logs"
"k8s.io/kubernetes/pkg/version/verflag"
)
func main() {
config := options.NewKubeDNSConfig()
config.AddFlags(pflag.CommandLine)
flag.InitFlags()
logs.InitLogs()
defer logs.FlushLogs()
verflag.PrintAndExitIfRequested()
server := app.NewKubeDNSServerDefault(config)
server.Run()
}
| /*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"github.com/spf13/pflag"
"k8s.io/kubernetes/cmd/kube-dns/app"
"k8s.io/kubernetes/cmd/kube-dns/app/options"
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
"k8s.io/kubernetes/pkg/util/flag"
"k8s.io/kubernetes/pkg/util/logs"
_ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration
"k8s.io/kubernetes/pkg/version/verflag"
)
func main() {
config := options.NewKubeDNSConfig()
config.AddFlags(pflag.CommandLine)
flag.InitFlags()
logs.InitLogs()
defer logs.FlushLogs()
verflag.PrintAndExitIfRequested()
server := app.NewKubeDNSServerDefault(config)
server.Run()
}
| Split the version metric out to its own package | Split the version metric out to its own package
| Go | apache-2.0 | bowei/dns,bowei/dns,cmluciano/dns,kubernetes/dns,corlettb/dns,kubernetes/dns,cmluciano/dns,corlettb/dns,kubernetes/dns | go | ## Code Before:
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"github.com/spf13/pflag"
"k8s.io/kubernetes/cmd/kube-dns/app"
"k8s.io/kubernetes/cmd/kube-dns/app/options"
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
"k8s.io/kubernetes/pkg/util/flag"
"k8s.io/kubernetes/pkg/util/logs"
"k8s.io/kubernetes/pkg/version/verflag"
)
func main() {
config := options.NewKubeDNSConfig()
config.AddFlags(pflag.CommandLine)
flag.InitFlags()
logs.InitLogs()
defer logs.FlushLogs()
verflag.PrintAndExitIfRequested()
server := app.NewKubeDNSServerDefault(config)
server.Run()
}
## Instruction:
Split the version metric out to its own package
## Code After:
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"github.com/spf13/pflag"
"k8s.io/kubernetes/cmd/kube-dns/app"
"k8s.io/kubernetes/cmd/kube-dns/app/options"
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
"k8s.io/kubernetes/pkg/util/flag"
"k8s.io/kubernetes/pkg/util/logs"
_ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration
"k8s.io/kubernetes/pkg/version/verflag"
)
func main() {
config := options.NewKubeDNSConfig()
config.AddFlags(pflag.CommandLine)
flag.InitFlags()
logs.InitLogs()
defer logs.FlushLogs()
verflag.PrintAndExitIfRequested()
server := app.NewKubeDNSServerDefault(config)
server.Run()
}
| /*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"github.com/spf13/pflag"
"k8s.io/kubernetes/cmd/kube-dns/app"
"k8s.io/kubernetes/cmd/kube-dns/app/options"
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
"k8s.io/kubernetes/pkg/util/flag"
"k8s.io/kubernetes/pkg/util/logs"
+ _ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration
"k8s.io/kubernetes/pkg/version/verflag"
)
func main() {
config := options.NewKubeDNSConfig()
config.AddFlags(pflag.CommandLine)
flag.InitFlags()
logs.InitLogs()
defer logs.FlushLogs()
verflag.PrintAndExitIfRequested()
server := app.NewKubeDNSServerDefault(config)
server.Run()
} | 1 | 0.025 | 1 | 0 |
e5171648164a72ea9ae83e5f2bb47dcb5b498fa6 | eg/inc/Hepevt.h | eg/inc/Hepevt.h | /* @(#)root/eg:$Name$:$Id$ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_HepEvt
#define ROOT_HepEvt
extern "C" {
#ifndef __CFORTRAN_LOADED
#include "cfortran.h"
#endif
typedef struct {
Int_t nevhep;
Int_t nhep;
Int_t isthep[2000];
Int_t idhep[2000];
Int_t jmohep[2000][2];
Int_t jdahep[2000][2];
Double_t phep[2000][5];
Double_t vhep[2000][4];
} HEPEVT_DEF;
#define HEPEVT COMMON_BLOCK(HEPEVT,hepevt)
COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT);
HEPEVT_DEF HEPEVT;
}
#endif
| /* @(#)root/eg:$Name: $:$Id: Hepevt.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_HepEvt
#define ROOT_HepEvt
extern "C" {
#ifndef __CFORTRAN_LOADED
#include "cfortran.h"
#endif
typedef struct {
Int_t nevhep;
Int_t nhep;
Int_t isthep[4000];
Int_t idhep[4000];
Int_t jmohep[4000][2];
Int_t jdahep[4000][2];
Double_t phep[4000][5];
Double_t vhep[4000][4];
} HEPEVT_DEF;
#define HEPEVT COMMON_BLOCK(HEPEVT,hepevt)
COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT);
HEPEVT_DEF HEPEVT;
}
#endif
| Change maximum dimension of hepevt from 2000 to 4000 to be consistent between Pythia5 and 6. Note that this change implies a recompilation of jetset.f | Change maximum dimension of hepevt from 2000 to 4000 to be consistent
between Pythia5 and 6. Note that this change implies a recompilation
of jetset.f
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@5072 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | sbinet/cxx-root,krafczyk/root,beniz/root,karies/root,agarciamontoro/root,sbinet/cxx-root,simonpf/root,nilqed/root,Dr15Jones/root,vukasinmilosevic/root,gbitzes/root,omazapa/root,zzxuanyuan/root,buuck/root,lgiommi/root,satyarth934/root,0x0all/ROOT,jrtomps/root,agarciamontoro/root,krafczyk/root,perovic/root,sbinet/cxx-root,cxx-hep/root-cern,thomaskeck/root,georgtroska/root,abhinavmoudgil95/root,gbitzes/root,karies/root,Y--/root,omazapa/root-old,dfunke/root,perovic/root,sawenzel/root,sawenzel/root,agarciamontoro/root,mhuwiler/rootauto,cxx-hep/root-cern,zzxuanyuan/root-compressor-dummy,simonpf/root,sirinath/root,Duraznos/root,krafczyk/root,olifre/root,beniz/root,sirinath/root,simonpf/root,strykejern/TTreeReader,davidlt/root,ffurano/root5,karies/root,simonpf/root,davidlt/root,Duraznos/root,dfunke/root,dfunke/root,evgeny-boger/root,mkret2/root,sirinath/root,jrtomps/root,esakellari/root,esakellari/my_root_for_test,olifre/root,Y--/root,0x0all/ROOT,abhinavmoudgil95/root,satyarth934/root,sawenzel/root,esakellari/my_root_for_test,zzxuanyuan/root-compressor-dummy,davidlt/root,vukasinmilosevic/root,perovic/root,buuck/root,pspe/root,evgeny-boger/root,veprbl/root,nilqed/root,Y--/root,zzxuanyuan/root-compressor-dummy,kirbyherm/root-r-tools,omazapa/root,CristinaCristescu/root,dfunke/root,root-mirror/root,pspe/root,ffurano/root5,esakellari/root,mkret2/root,beniz/root,smarinac/root,simonpf/root,sirinath/root,krafczyk/root,lgiommi/root,abhinavmoudgil95/root,esakellari/my_root_for_test,Y--/root,simonpf/root,root-mirror/root,gganis/root,0x0all/ROOT,thomaskeck/root,karies/root,nilqed/root,zzxuanyuan/root,nilqed/root,strykejern/TTreeReader,mhuwiler/rootauto,jrtomps/root,abhinavmoudgil95/root,gganis/root,BerserkerTroll/root,satyarth934/root,omazapa/root,alexschlueter/cern-root,Duraznos/root,karies/root,perovic/root,Duraznos/root,0x0all/ROOT,sawenzel/root,esakellari/my_root_for_test,mkret2/root,beniz/root,jrtomps/root,georgtroska/root,vukasinmilosevic/root,buuck/root,CristinaCristescu/root,nilqed/root,beniz/root,pspe/root,buuck/root,evgeny-boger/root,root-mirror/root,sirinath/root,alexschlueter/cern-root,CristinaCristescu/root,sirinath/root,mattkretz/root,arch1tect0r/root,Duraznos/root,esakellari/root,davidlt/root,arch1tect0r/root,veprbl/root,arch1tect0r/root,olifre/root,root-mirror/root,tc3t/qoot,Duraznos/root,tc3t/qoot,pspe/root,omazapa/root-old,Dr15Jones/root,perovic/root,Y--/root,CristinaCristescu/root,dfunke/root,jrtomps/root,tc3t/qoot,omazapa/root,georgtroska/root,jrtomps/root,smarinac/root,sirinath/root,Duraznos/root,lgiommi/root,kirbyherm/root-r-tools,esakellari/root,karies/root,CristinaCristescu/root,strykejern/TTreeReader,cxx-hep/root-cern,arch1tect0r/root,veprbl/root,kirbyherm/root-r-tools,zzxuanyuan/root,lgiommi/root,BerserkerTroll/root,CristinaCristescu/root,nilqed/root,gganis/root,evgeny-boger/root,Dr15Jones/root,karies/root,gganis/root,nilqed/root,lgiommi/root,gganis/root,bbockelm/root,lgiommi/root,buuck/root,zzxuanyuan/root-compressor-dummy,vukasinmilosevic/root,root-mirror/root,Dr15Jones/root,mhuwiler/rootauto,nilqed/root,davidlt/root,veprbl/root,pspe/root,gbitzes/root,sirinath/root,esakellari/my_root_for_test,root-mirror/root,veprbl/root,lgiommi/root,agarciamontoro/root,sawenzel/root,0x0all/ROOT,CristinaCristescu/root,zzxuanyuan/root-compressor-dummy,perovic/root,mhuwiler/rootauto,Y--/root,sirinath/root,karies/root,krafczyk/root,mattkretz/root,thomaskeck/root,evgeny-boger/root,davidlt/root,jrtomps/root,vukasinmilosevic/root,krafczyk/root,esakellari/my_root_for_test,perovic/root,gbitzes/root,olifre/root,Dr15Jones/root,alexschlueter/cern-root,esakellari/my_root_for_test,beniz/root,mattkretz/root,karies/root,arch1tect0r/root,CristinaCristescu/root,simonpf/root,pspe/root,jrtomps/root,zzxuanyuan/root-compressor-dummy,mhuwiler/rootauto,alexschlueter/cern-root,vukasinmilosevic/root,bbockelm/root,mattkretz/root,omazapa/root-old,buuck/root,agarciamontoro/root,pspe/root,lgiommi/root,cxx-hep/root-cern,kirbyherm/root-r-tools,Y--/root,omazapa/root,gbitzes/root,jrtomps/root,mattkretz/root,gganis/root,arch1tect0r/root,dfunke/root,gbitzes/root,agarciamontoro/root,gbitzes/root,vukasinmilosevic/root,BerserkerTroll/root,cxx-hep/root-cern,beniz/root,Y--/root,jrtomps/root,gbitzes/root,zzxuanyuan/root,gbitzes/root,georgtroska/root,smarinac/root,CristinaCristescu/root,vukasinmilosevic/root,nilqed/root,sbinet/cxx-root,zzxuanyuan/root-compressor-dummy,vukasinmilosevic/root,mhuwiler/rootauto,bbockelm/root,tc3t/qoot,Y--/root,sbinet/cxx-root,alexschlueter/cern-root,omazapa/root,alexschlueter/cern-root,ffurano/root5,zzxuanyuan/root,thomaskeck/root,kirbyherm/root-r-tools,smarinac/root,sbinet/cxx-root,olifre/root,mkret2/root,omazapa/root-old,kirbyherm/root-r-tools,0x0all/ROOT,arch1tect0r/root,Duraznos/root,agarciamontoro/root,esakellari/my_root_for_test,esakellari/root,thomaskeck/root,omazapa/root-old,mhuwiler/rootauto,Y--/root,Duraznos/root,sawenzel/root,BerserkerTroll/root,abhinavmoudgil95/root,sawenzel/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,omazapa/root,omazapa/root,perovic/root,mkret2/root,root-mirror/root,satyarth934/root,sirinath/root,satyarth934/root,smarinac/root,buuck/root,sbinet/cxx-root,evgeny-boger/root,buuck/root,kirbyherm/root-r-tools,lgiommi/root,omazapa/root-old,tc3t/qoot,veprbl/root,cxx-hep/root-cern,root-mirror/root,georgtroska/root,CristinaCristescu/root,lgiommi/root,arch1tect0r/root,veprbl/root,smarinac/root,ffurano/root5,arch1tect0r/root,zzxuanyuan/root,Y--/root,simonpf/root,sbinet/cxx-root,simonpf/root,pspe/root,omazapa/root,mattkretz/root,ffurano/root5,davidlt/root,zzxuanyuan/root,olifre/root,sbinet/cxx-root,omazapa/root-old,abhinavmoudgil95/root,evgeny-boger/root,tc3t/qoot,mkret2/root,abhinavmoudgil95/root,beniz/root,0x0all/ROOT,georgtroska/root,veprbl/root,thomaskeck/root,buuck/root,BerserkerTroll/root,CristinaCristescu/root,BerserkerTroll/root,sawenzel/root,thomaskeck/root,sawenzel/root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,esakellari/my_root_for_test,thomaskeck/root,thomaskeck/root,buuck/root,sirinath/root,abhinavmoudgil95/root,vukasinmilosevic/root,BerserkerTroll/root,veprbl/root,bbockelm/root,georgtroska/root,agarciamontoro/root,olifre/root,gganis/root,bbockelm/root,omazapa/root-old,omazapa/root-old,esakellari/root,olifre/root,tc3t/qoot,esakellari/root,thomaskeck/root,0x0all/ROOT,abhinavmoudgil95/root,gganis/root,mkret2/root,Duraznos/root,perovic/root,krafczyk/root,ffurano/root5,simonpf/root,georgtroska/root,mhuwiler/rootauto,sbinet/cxx-root,root-mirror/root,georgtroska/root,perovic/root,davidlt/root,beniz/root,smarinac/root,beniz/root,esakellari/root,jrtomps/root,krafczyk/root,tc3t/qoot,karies/root,tc3t/qoot,dfunke/root,krafczyk/root,omazapa/root-old,mattkretz/root,agarciamontoro/root,agarciamontoro/root,beniz/root,zzxuanyuan/root-compressor-dummy,satyarth934/root,BerserkerTroll/root,0x0all/ROOT,mkret2/root,gbitzes/root,smarinac/root,simonpf/root,omazapa/root,gbitzes/root,mhuwiler/rootauto,smarinac/root,bbockelm/root,arch1tect0r/root,strykejern/TTreeReader,dfunke/root,abhinavmoudgil95/root,sawenzel/root,sawenzel/root,Dr15Jones/root,perovic/root,davidlt/root,dfunke/root,pspe/root,BerserkerTroll/root,gganis/root,georgtroska/root,gganis/root,mattkretz/root,BerserkerTroll/root,satyarth934/root,nilqed/root,olifre/root,esakellari/root,olifre/root,evgeny-boger/root,vukasinmilosevic/root,BerserkerTroll/root,krafczyk/root,esakellari/root,bbockelm/root,strykejern/TTreeReader,zzxuanyuan/root,sbinet/cxx-root,mattkretz/root,satyarth934/root,gganis/root,Dr15Jones/root,davidlt/root,satyarth934/root,mkret2/root,zzxuanyuan/root,omazapa/root-old,evgeny-boger/root,evgeny-boger/root,esakellari/my_root_for_test,evgeny-boger/root,zzxuanyuan/root,nilqed/root,zzxuanyuan/root-compressor-dummy,dfunke/root,satyarth934/root,mattkretz/root,dfunke/root,alexschlueter/cern-root,mattkretz/root,karies/root,strykejern/TTreeReader,krafczyk/root,mhuwiler/rootauto,veprbl/root,zzxuanyuan/root,olifre/root,bbockelm/root,tc3t/qoot,omazapa/root,mhuwiler/rootauto,root-mirror/root,smarinac/root,ffurano/root5,georgtroska/root,abhinavmoudgil95/root,bbockelm/root,strykejern/TTreeReader,pspe/root,esakellari/root,agarciamontoro/root,bbockelm/root,Duraznos/root,lgiommi/root,pspe/root,bbockelm/root,cxx-hep/root-cern,cxx-hep/root-cern,root-mirror/root,buuck/root,veprbl/root,mkret2/root,satyarth934/root,davidlt/root,mkret2/root | c | ## Code Before:
/* @(#)root/eg:$Name$:$Id$ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_HepEvt
#define ROOT_HepEvt
extern "C" {
#ifndef __CFORTRAN_LOADED
#include "cfortran.h"
#endif
typedef struct {
Int_t nevhep;
Int_t nhep;
Int_t isthep[2000];
Int_t idhep[2000];
Int_t jmohep[2000][2];
Int_t jdahep[2000][2];
Double_t phep[2000][5];
Double_t vhep[2000][4];
} HEPEVT_DEF;
#define HEPEVT COMMON_BLOCK(HEPEVT,hepevt)
COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT);
HEPEVT_DEF HEPEVT;
}
#endif
## Instruction:
Change maximum dimension of hepevt from 2000 to 4000 to be consistent
between Pythia5 and 6. Note that this change implies a recompilation
of jetset.f
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@5072 27541ba8-7e3a-0410-8455-c3a389f83636
## Code After:
/* @(#)root/eg:$Name: $:$Id: Hepevt.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_HepEvt
#define ROOT_HepEvt
extern "C" {
#ifndef __CFORTRAN_LOADED
#include "cfortran.h"
#endif
typedef struct {
Int_t nevhep;
Int_t nhep;
Int_t isthep[4000];
Int_t idhep[4000];
Int_t jmohep[4000][2];
Int_t jdahep[4000][2];
Double_t phep[4000][5];
Double_t vhep[4000][4];
} HEPEVT_DEF;
#define HEPEVT COMMON_BLOCK(HEPEVT,hepevt)
COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT);
HEPEVT_DEF HEPEVT;
}
#endif
| - /* @(#)root/eg:$Name$:$Id$ */
+ /* @(#)root/eg:$Name: $:$Id: Hepevt.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_HepEvt
#define ROOT_HepEvt
extern "C" {
#ifndef __CFORTRAN_LOADED
#include "cfortran.h"
#endif
typedef struct {
Int_t nevhep;
Int_t nhep;
- Int_t isthep[2000];
? ^
+ Int_t isthep[4000];
? ^
- Int_t idhep[2000];
? ^
+ Int_t idhep[4000];
? ^
- Int_t jmohep[2000][2];
? ^
+ Int_t jmohep[4000][2];
? ^
- Int_t jdahep[2000][2];
? ^
+ Int_t jdahep[4000][2];
? ^
- Double_t phep[2000][5];
? ^
+ Double_t phep[4000][5];
? ^
- Double_t vhep[2000][4];
? ^
+ Double_t vhep[4000][4];
? ^
} HEPEVT_DEF;
#define HEPEVT COMMON_BLOCK(HEPEVT,hepevt)
COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT);
HEPEVT_DEF HEPEVT;
}
#endif | 14 | 0.341463 | 7 | 7 |
40a4997484df48207ed9043fe67eeb65ae2c8b71 | spec/taint_aliases_spec.rb | spec/taint_aliases_spec.rb | require 'spec_helper'
require File.expand_path("../../lib/taint_aliases", __FILE__)
module TaintAliasesSpec
describe "taint should be aliased to grundle and fleshy_fun_bridge" do
before(:each) do
@obj = Object.new
end
TaintAliases::TAINT_ALIASES.each do |a|
it "should be tainted with #{a}" do
@obj.public_send a
@obj.should be_tainted
end
end
end
describe "subclasses should inherit the aliases" do
TaintAliases::TAINT_ALIASES.each do |a|
it "should work on Strings" do
str = "I'm gettin' tainted"
str.public_send a
str.should be_tainted
end
it "should work on Arrays" do
ary = []
ary.public_send a
ary.should be_tainted
end
end
end
end
| require 'spec_helper'
require File.expand_path("../../lib/taint_aliases", __FILE__)
module TaintAliasesSpec
describe "taint should be aliased to grundle and fleshy_fun_bridge" do
before(:each) do
@obj = Object.new
end
TaintAliases::TAINT_ALIASES.each do |a|
suffix = 'aeiou'[a[-1]] ? 'd' : 'ed'
query = a + suffix + "?"
it "should be tainted with #{a}" do
@obj.public_send a
@obj.should be_tainted
end
it "should be untainted with un#{a}" do
@obj.public_send "un" + a
@obj.should_not be_tainted
end
it "should be queryable with #{query}" do
@obj.public_send(query).should be_false
@obj.public_send a
@obj.public_send(query).should be_true
end
end
end
describe "subclasses should inherit the aliases" do
TaintAliases::TAINT_ALIASES.each do |a|
it "should work on Strings" do
str = "I'm gettin' tainted"
str.public_send a
str.should be_tainted
end
it "should work on Arrays" do
ary = []
ary.public_send a
ary.should be_tainted
end
end
end
end
| Add specs for untaints and taint queries | Add specs for untaints and taint queries
They're not particularly thorough, but they sound pretty enterprise. | Ruby | mit | ruby-jokes/taint_aliases | ruby | ## Code Before:
require 'spec_helper'
require File.expand_path("../../lib/taint_aliases", __FILE__)
module TaintAliasesSpec
describe "taint should be aliased to grundle and fleshy_fun_bridge" do
before(:each) do
@obj = Object.new
end
TaintAliases::TAINT_ALIASES.each do |a|
it "should be tainted with #{a}" do
@obj.public_send a
@obj.should be_tainted
end
end
end
describe "subclasses should inherit the aliases" do
TaintAliases::TAINT_ALIASES.each do |a|
it "should work on Strings" do
str = "I'm gettin' tainted"
str.public_send a
str.should be_tainted
end
it "should work on Arrays" do
ary = []
ary.public_send a
ary.should be_tainted
end
end
end
end
## Instruction:
Add specs for untaints and taint queries
They're not particularly thorough, but they sound pretty enterprise.
## Code After:
require 'spec_helper'
require File.expand_path("../../lib/taint_aliases", __FILE__)
module TaintAliasesSpec
describe "taint should be aliased to grundle and fleshy_fun_bridge" do
before(:each) do
@obj = Object.new
end
TaintAliases::TAINT_ALIASES.each do |a|
suffix = 'aeiou'[a[-1]] ? 'd' : 'ed'
query = a + suffix + "?"
it "should be tainted with #{a}" do
@obj.public_send a
@obj.should be_tainted
end
it "should be untainted with un#{a}" do
@obj.public_send "un" + a
@obj.should_not be_tainted
end
it "should be queryable with #{query}" do
@obj.public_send(query).should be_false
@obj.public_send a
@obj.public_send(query).should be_true
end
end
end
describe "subclasses should inherit the aliases" do
TaintAliases::TAINT_ALIASES.each do |a|
it "should work on Strings" do
str = "I'm gettin' tainted"
str.public_send a
str.should be_tainted
end
it "should work on Arrays" do
ary = []
ary.public_send a
ary.should be_tainted
end
end
end
end
| require 'spec_helper'
require File.expand_path("../../lib/taint_aliases", __FILE__)
module TaintAliasesSpec
describe "taint should be aliased to grundle and fleshy_fun_bridge" do
before(:each) do
@obj = Object.new
end
TaintAliases::TAINT_ALIASES.each do |a|
+ suffix = 'aeiou'[a[-1]] ? 'd' : 'ed'
+ query = a + suffix + "?"
+
it "should be tainted with #{a}" do
@obj.public_send a
@obj.should be_tainted
+ end
+
+ it "should be untainted with un#{a}" do
+ @obj.public_send "un" + a
+ @obj.should_not be_tainted
+ end
+
+ it "should be queryable with #{query}" do
+ @obj.public_send(query).should be_false
+ @obj.public_send a
+ @obj.public_send(query).should be_true
end
end
end
describe "subclasses should inherit the aliases" do
TaintAliases::TAINT_ALIASES.each do |a|
it "should work on Strings" do
str = "I'm gettin' tainted"
str.public_send a
str.should be_tainted
end
it "should work on Arrays" do
ary = []
ary.public_send a
ary.should be_tainted
end
end
-
-
-
-
end
end | 18 | 0.45 | 14 | 4 |
abf04939299c04838a403bf6a12d08e8777635c3 | Cargo.toml | Cargo.toml | [package]
name = "dazeus"
version = "0.0.1"
authors = ["Ruben Nijveld <ruben@gewooniets.nl>"]
description = "Dazeus IRC bot bindings for rust"
[lib]
name = "dazeus"
path = "src/lib.rs"
[dependencies.rustc-serialize]
version = "0.3"
[dependencies.promise]
git = "https://github.com/viperscape/rust-promise.git"
[dependencies.unix_socket]
git = "https://github.com/sfackler/rust-unix-socket.git"
| [package]
name = "dazeus"
version = "0.0.1"
authors = ["Ruben Nijveld <ruben@gewooniets.nl>"]
description = "Dazeus IRC bot bindings for rust"
[lib]
name = "dazeus"
path = "src/lib.rs"
[dependencies.rustc-serialize]
version = "0.3"
[dependencies.unix_socket]
git = "https://github.com/sfackler/rust-unix-socket.git"
| Remove Promise library, as it isn't used | Remove Promise library, as it isn't used
| TOML | mit | dazeus/dazeus-rs | toml | ## Code Before:
[package]
name = "dazeus"
version = "0.0.1"
authors = ["Ruben Nijveld <ruben@gewooniets.nl>"]
description = "Dazeus IRC bot bindings for rust"
[lib]
name = "dazeus"
path = "src/lib.rs"
[dependencies.rustc-serialize]
version = "0.3"
[dependencies.promise]
git = "https://github.com/viperscape/rust-promise.git"
[dependencies.unix_socket]
git = "https://github.com/sfackler/rust-unix-socket.git"
## Instruction:
Remove Promise library, as it isn't used
## Code After:
[package]
name = "dazeus"
version = "0.0.1"
authors = ["Ruben Nijveld <ruben@gewooniets.nl>"]
description = "Dazeus IRC bot bindings for rust"
[lib]
name = "dazeus"
path = "src/lib.rs"
[dependencies.rustc-serialize]
version = "0.3"
[dependencies.unix_socket]
git = "https://github.com/sfackler/rust-unix-socket.git"
| [package]
name = "dazeus"
version = "0.0.1"
authors = ["Ruben Nijveld <ruben@gewooniets.nl>"]
description = "Dazeus IRC bot bindings for rust"
[lib]
name = "dazeus"
path = "src/lib.rs"
[dependencies.rustc-serialize]
version = "0.3"
- [dependencies.promise]
- git = "https://github.com/viperscape/rust-promise.git"
-
[dependencies.unix_socket]
git = "https://github.com/sfackler/rust-unix-socket.git" | 3 | 0.166667 | 0 | 3 |
2b23daa13001114c1f60a0a5cd86cb43b2f90955 | extension/keysocket-163.js | extension/keysocket-163.js | function onKeyPress(key) {
if (key === NEXT) {
var nextButton = document.querySelector('.nxt');
simulateClick(nextButton);
} else if (key === PLAY) {
var playPauseButton = document.querySelector('.ply');
simulateClick(playPauseButton);
} else if (key === PREV) {
var backButton = document.querySelector('.prv');
simulateClick(backButton);
}
} | function onKeyPress(key) {
if (key === NEXT) {
var nextButton = document.querySelector('.m-playbar .nxt');
simulateClick(nextButton);
} else if (key === PLAY) {
var playPauseButton = document.querySelector('.m-playbar .ply');
simulateClick(playPauseButton);
} else if (key === PREV) {
var backButton = document.querySelector('.m-playbar .prv');
simulateClick(backButton);
}
} | Update extension for 163 Music | Update extension for 163 Music
Added extension for 163 Music.
Sorry for overlooking.Now rewrite the selector.
| JavaScript | apache-2.0 | feedbee/keysocket,feedbee/keysocket,borismus/keysocket,borismus/keysocket | javascript | ## Code Before:
function onKeyPress(key) {
if (key === NEXT) {
var nextButton = document.querySelector('.nxt');
simulateClick(nextButton);
} else if (key === PLAY) {
var playPauseButton = document.querySelector('.ply');
simulateClick(playPauseButton);
} else if (key === PREV) {
var backButton = document.querySelector('.prv');
simulateClick(backButton);
}
}
## Instruction:
Update extension for 163 Music
Added extension for 163 Music.
Sorry for overlooking.Now rewrite the selector.
## Code After:
function onKeyPress(key) {
if (key === NEXT) {
var nextButton = document.querySelector('.m-playbar .nxt');
simulateClick(nextButton);
} else if (key === PLAY) {
var playPauseButton = document.querySelector('.m-playbar .ply');
simulateClick(playPauseButton);
} else if (key === PREV) {
var backButton = document.querySelector('.m-playbar .prv');
simulateClick(backButton);
}
} | function onKeyPress(key) {
if (key === NEXT) {
- var nextButton = document.querySelector('.nxt');
+ var nextButton = document.querySelector('.m-playbar .nxt');
? +++++++++++
simulateClick(nextButton);
} else if (key === PLAY) {
- var playPauseButton = document.querySelector('.ply');
+ var playPauseButton = document.querySelector('.m-playbar .ply');
? +++++++++++
simulateClick(playPauseButton);
} else if (key === PREV) {
- var backButton = document.querySelector('.prv');
+ var backButton = document.querySelector('.m-playbar .prv');
? +++++++++++
simulateClick(backButton);
}
} | 6 | 0.5 | 3 | 3 |
6056af5b1dcbd9f0978e4584c6faa9522ea4beee | tasks/test.js | tasks/test.js | var gulp = require('gulp');
var config = require('../gulp.config')();
var Server = require('karma').Server;
var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
/**
* Run test once and exit
*/
gulp.task('test', ['clean-report', 'tslint', 'unit-test']);
gulp.task('unit-test', ['tsc'], function (done) {
new Server({
configFile: __dirname + '/../karma.conf.js',
singleRun: true
}, karmaDone).start();
function karmaDone (exitCode) {
console.log('Test Done with exit code: ' + exitCode);
console.log('Remapping coverage to TypeScript format...');
remapCoverage();
console.log('Remapping done! View the result in report/remap/html-report');
if(exitCode === 0) {
done();
} else {
done('Unit test failed.');
}
}
});
function remapCoverage () {
gulp.src(config.report.path + 'report-json/coverage-final.json')
.pipe(remapIstanbul({
reports: {
'lcovonly': config.report.path + 'remap/lcov.info',
'json': config.report.path + 'remap/coverage.json',
'html': config.report.path + 'remap/html-report'
}
}));
} | var gulp = require('gulp');
var config = require('../gulp.config')();
var Server = require('karma').Server;
var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
/**
* Run test once and exit
*/
gulp.task('test', ['clean-report', 'tslint', 'unit-test']);
gulp.task('unit-test', ['tsc'], function (done) {
new Server({
configFile: __dirname + '/../karma.conf.js',
singleRun: true
}, karmaDone).start();
function karmaDone (exitCode) {
console.log('Test Done with exit code: ' + exitCode);
remapCoverage();
if(exitCode === 0) {
done();
} else {
done('Unit test failed.');
}
}
});
function remapCoverage () {
console.log('Remapping coverage to TypeScript format...');
gulp.src(config.report.path + 'report-json/coverage-final.json')
.pipe(remapIstanbul({
reports: {
'lcovonly': config.report.path + 'remap/lcov.info',
'json': config.report.path + 'remap/coverage.json',
'html': config.report.path + 'remap/html-report'
}
}))
.on('finish', function () {
console.log('Remapping done! View the result in report/remap/html-report');
});
} | Add on finish for remap istanbul | Add on finish for remap istanbul
| JavaScript | mit | Michael-xxxx/angular2-starter,antonybudianto/angular2-starter,antonybudianto/angular2-starter,bitcoinZephyr/bitcoinZephyr.github.io,foxjazz/eveview,foxjazz/eveview,westlab/door-front,foxjazz/memberbase,bitcoinZephyr/bitcoinZephyr.github.io,foxjazz/memberbase,Michael-xxxx/angular2-starter,dabcat/myapp-angular2,dabcat/myapp-angular2,jasoncbuehler/mohits_awesome_chat_app,NiallBrickell/angular2-starter,dabcat/myapp-angular2,NiallBrickell/angular2-starter,westlab/door-front,NiallBrickell/angular2-starter,bitcoinZephyr/bitcoinZephyr.github.io,Michael-xxxx/angular2-starter,jasoncbuehler/mohits_awesome_chat_app,foxjazz/memberbase,westlab/door-front,foxjazz/eveview,jasoncbuehler/mohits_awesome_chat_app,antonybudianto/angular2-starter | javascript | ## Code Before:
var gulp = require('gulp');
var config = require('../gulp.config')();
var Server = require('karma').Server;
var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
/**
* Run test once and exit
*/
gulp.task('test', ['clean-report', 'tslint', 'unit-test']);
gulp.task('unit-test', ['tsc'], function (done) {
new Server({
configFile: __dirname + '/../karma.conf.js',
singleRun: true
}, karmaDone).start();
function karmaDone (exitCode) {
console.log('Test Done with exit code: ' + exitCode);
console.log('Remapping coverage to TypeScript format...');
remapCoverage();
console.log('Remapping done! View the result in report/remap/html-report');
if(exitCode === 0) {
done();
} else {
done('Unit test failed.');
}
}
});
function remapCoverage () {
gulp.src(config.report.path + 'report-json/coverage-final.json')
.pipe(remapIstanbul({
reports: {
'lcovonly': config.report.path + 'remap/lcov.info',
'json': config.report.path + 'remap/coverage.json',
'html': config.report.path + 'remap/html-report'
}
}));
}
## Instruction:
Add on finish for remap istanbul
## Code After:
var gulp = require('gulp');
var config = require('../gulp.config')();
var Server = require('karma').Server;
var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
/**
* Run test once and exit
*/
gulp.task('test', ['clean-report', 'tslint', 'unit-test']);
gulp.task('unit-test', ['tsc'], function (done) {
new Server({
configFile: __dirname + '/../karma.conf.js',
singleRun: true
}, karmaDone).start();
function karmaDone (exitCode) {
console.log('Test Done with exit code: ' + exitCode);
remapCoverage();
if(exitCode === 0) {
done();
} else {
done('Unit test failed.');
}
}
});
function remapCoverage () {
console.log('Remapping coverage to TypeScript format...');
gulp.src(config.report.path + 'report-json/coverage-final.json')
.pipe(remapIstanbul({
reports: {
'lcovonly': config.report.path + 'remap/lcov.info',
'json': config.report.path + 'remap/coverage.json',
'html': config.report.path + 'remap/html-report'
}
}))
.on('finish', function () {
console.log('Remapping done! View the result in report/remap/html-report');
});
} | var gulp = require('gulp');
var config = require('../gulp.config')();
var Server = require('karma').Server;
var remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
/**
* Run test once and exit
*/
gulp.task('test', ['clean-report', 'tslint', 'unit-test']);
gulp.task('unit-test', ['tsc'], function (done) {
new Server({
configFile: __dirname + '/../karma.conf.js',
singleRun: true
}, karmaDone).start();
function karmaDone (exitCode) {
console.log('Test Done with exit code: ' + exitCode);
- console.log('Remapping coverage to TypeScript format...');
remapCoverage();
- console.log('Remapping done! View the result in report/remap/html-report');
if(exitCode === 0) {
done();
} else {
done('Unit test failed.');
}
}
});
function remapCoverage () {
+ console.log('Remapping coverage to TypeScript format...');
gulp.src(config.report.path + 'report-json/coverage-final.json')
.pipe(remapIstanbul({
reports: {
'lcovonly': config.report.path + 'remap/lcov.info',
'json': config.report.path + 'remap/coverage.json',
'html': config.report.path + 'remap/html-report'
}
- }));
? -
+ }))
+ .on('finish', function () {
+ console.log('Remapping done! View the result in report/remap/html-report');
+ });
} | 8 | 0.205128 | 5 | 3 |
e3e4334788457ae60d8834862ba0b4aece511be7 | setup.py | setup.py |
from setuptools import setup, find_packages
setup(name='pymks',
version='0.1-dev',
description='Package for Materials Knowledge System (MKS) regression tutorial',
author='Daniel Wheeler',
author_email='daniel.wheeler2@gmail.com',
url='http://wd15.github.com/pymks',
packages=find_packages(),
package_data = {'' : ['tests/*.py']}
)
|
import subprocess
from setuptools import setup, find_packages
import os
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
env[k] = v
# LANGUAGE is used on win32
env['LANGUAGE'] = 'C'
env['LANG'] = 'C'
env['LC_ALL'] = 'C'
out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]
return out
try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
GIT_REVISION = out.strip().decode('ascii')
except OSError:
GIT_REVISION = ""
return GIT_REVISION
def getVersion(version, release=False):
if release:
return version
else:
return version + '-dev' + git_version()[:7]
setup(name='pymks',
version=getVersion('0.1'),
description='Package for the Materials Knowledge System (MKS)',
author='Daniel Wheeler',
author_email='daniel.wheeler2@gmail.com',
url='http://pymks.org',
packages=find_packages(),
package_data = {'' : ['tests/*.py']}
)
| Include git sha in version number | Include git sha in version number
Address #82
Git sha is now in the version number
| Python | mit | awhite40/pymks,davidbrough1/pymks,XinyiGong/pymks,fredhohman/pymks,davidbrough1/pymks | python | ## Code Before:
from setuptools import setup, find_packages
setup(name='pymks',
version='0.1-dev',
description='Package for Materials Knowledge System (MKS) regression tutorial',
author='Daniel Wheeler',
author_email='daniel.wheeler2@gmail.com',
url='http://wd15.github.com/pymks',
packages=find_packages(),
package_data = {'' : ['tests/*.py']}
)
## Instruction:
Include git sha in version number
Address #82
Git sha is now in the version number
## Code After:
import subprocess
from setuptools import setup, find_packages
import os
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
env[k] = v
# LANGUAGE is used on win32
env['LANGUAGE'] = 'C'
env['LANG'] = 'C'
env['LC_ALL'] = 'C'
out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]
return out
try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
GIT_REVISION = out.strip().decode('ascii')
except OSError:
GIT_REVISION = ""
return GIT_REVISION
def getVersion(version, release=False):
if release:
return version
else:
return version + '-dev' + git_version()[:7]
setup(name='pymks',
version=getVersion('0.1'),
description='Package for the Materials Knowledge System (MKS)',
author='Daniel Wheeler',
author_email='daniel.wheeler2@gmail.com',
url='http://pymks.org',
packages=find_packages(),
package_data = {'' : ['tests/*.py']}
)
|
+ import subprocess
from setuptools import setup, find_packages
+ import os
+
+
+ def git_version():
+ def _minimal_ext_cmd(cmd):
+ # construct minimal environment
+ env = {}
+ for k in ['SYSTEMROOT', 'PATH']:
+ v = os.environ.get(k)
+ if v is not None:
+ env[k] = v
+ # LANGUAGE is used on win32
+ env['LANGUAGE'] = 'C'
+ env['LANG'] = 'C'
+ env['LC_ALL'] = 'C'
+ out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]
+ return out
+
+ try:
+ out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
+ GIT_REVISION = out.strip().decode('ascii')
+ except OSError:
+ GIT_REVISION = ""
+
+ return GIT_REVISION
+
+ def getVersion(version, release=False):
+ if release:
+ return version
+ else:
+ return version + '-dev' + git_version()[:7]
+
setup(name='pymks',
- version='0.1-dev',
+ version=getVersion('0.1'),
- description='Package for Materials Knowledge System (MKS) regression tutorial',
? --------------------
+ description='Package for the Materials Knowledge System (MKS)',
? ++++
author='Daniel Wheeler',
author_email='daniel.wheeler2@gmail.com',
- url='http://wd15.github.com/pymks',
+ url='http://pymks.org',
packages=find_packages(),
package_data = {'' : ['tests/*.py']}
) | 39 | 3.545455 | 36 | 3 |
2e48342f47d1c974b3c9d51f5c78b82ffad43dea | src/Faker/Provider/zh_TW/Internet.php | src/Faker/Provider/zh_TW/Internet.php | <?php
namespace Faker\Provider\zh_TW;
class Internet extends \Faker\Provider\Internet
{
public function userName()
{
return \Faker\Factory::create('en_US')->userName();
}
public function domainWord()
{
return \Faker\Factory::create('en_US')->domainWord();
}
public function password()
{
$pool = array(
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
);
return join('', static::randomElements($pool, static::numberBetween(6, 20)));
}
}
| <?php
namespace Faker\Provider\zh_TW;
class Internet extends \Faker\Provider\Internet
{
public function userName()
{
return \Faker\Factory::create('en_US')->userName();
}
public function domainWord()
{
return \Faker\Factory::create('en_US')->domainWord();
}
}
| Remove the redundant password function | Remove the redundant password function
| PHP | mit | pathirana/Faker,luisbrito/Faker,cjaoude/Faker,huang53798584/Faker,shunsuke-takahashi/Faker,bmitch/Faker,brainrepo/Faker,selmonal/Faker,Balamir/Faker,muya/Faker,ivyhjk/Faker,chrismoulton/Faker,xfxf/Faker,oshancsedu/Faker,antonsofyan/Faker,nalekberov/Faker,igorsantos07/Faker,splp/Faker,CodeYellowBV/Faker,stof/Faker,datagit/Faker,jadb/Faker,simonfork/Faker,drakakisgeo/Faker,guillaumewf3/Faker,kevinrodbe/Faker,ravage84/Faker,lasselehtinen/Faker,jeffaustin81/Faker,zeropool/Faker,localheinz/Faker,mousavian/Faker,duchaiweb/Faker-1,vlakoff/Faker,matriphe/Faker,xfxf/Faker-PHP,dongnhut/Faker,kkiernan/Faker,davidyell/Faker,nikmauro/Faker,BePsvPT/Faker,d3trax/Faker,kuldipem/Faker,cenxun/Faker,alexlondon07/Faker,Beanhunter/Faker,mseshachalam/Faker,syj610226/Faker,oswaldderiemaecker/Faker | php | ## Code Before:
<?php
namespace Faker\Provider\zh_TW;
class Internet extends \Faker\Provider\Internet
{
public function userName()
{
return \Faker\Factory::create('en_US')->userName();
}
public function domainWord()
{
return \Faker\Factory::create('en_US')->domainWord();
}
public function password()
{
$pool = array(
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
);
return join('', static::randomElements($pool, static::numberBetween(6, 20)));
}
}
## Instruction:
Remove the redundant password function
## Code After:
<?php
namespace Faker\Provider\zh_TW;
class Internet extends \Faker\Provider\Internet
{
public function userName()
{
return \Faker\Factory::create('en_US')->userName();
}
public function domainWord()
{
return \Faker\Factory::create('en_US')->domainWord();
}
}
| <?php
namespace Faker\Provider\zh_TW;
class Internet extends \Faker\Provider\Internet
{
public function userName()
{
return \Faker\Factory::create('en_US')->userName();
}
public function domainWord()
{
return \Faker\Factory::create('en_US')->domainWord();
}
-
- public function password()
- {
- $pool = array(
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
- 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
- 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
- );
- return join('', static::randomElements($pool, static::numberBetween(6, 20)));
- }
} | 12 | 0.428571 | 0 | 12 |
622dcd5b273764537215af9d90b74abf11a64e49 | app/views/companies/_bookings.html.haml | app/views/companies/_bookings.html.haml | %h2.group-title Bokningar
%table.full.wrap
%thead
%tr
%th Plats
%th Tid
%th
%tbody
- @company.bookings.each do |booking|
%tr
%td= link_to booking.place.name, place_path(booking.place)
%td= date_and_time(booking)
%td.delete= link_to 'Avboka', booking_path(booking, from_company_view: true),
method: :delete, data: { confirm: 'Är du säker på att du vill avboka?' }, class: "btn btn-danger btn-sm"
| %h2.group-title Bokningar
%table.full.wrap
%thead
%tr
%th Plats
%th Tid
%th
%tbody
- @company.bookings.each do |booking|
%tr
%td= link_to booking.place.name, place_path(booking.place)
%td= date_and_time(booking)
%td.delete= button_to 'Avboka', cancel_booking_path(booking, from_company_view: true),
method: :patch, data: { confirm: 'Är du säker på att du vill avboka?' }, class: "btn btn-danger btn-sm"
| Patch booking instead of destroy it on cancel from company views | Patch booking instead of destroy it on cancel from company views
| Haml | agpl-3.0 | malmostad/vagnar,malmostad/vagnar,malmostad/vagnar,malmostad/vagnar | haml | ## Code Before:
%h2.group-title Bokningar
%table.full.wrap
%thead
%tr
%th Plats
%th Tid
%th
%tbody
- @company.bookings.each do |booking|
%tr
%td= link_to booking.place.name, place_path(booking.place)
%td= date_and_time(booking)
%td.delete= link_to 'Avboka', booking_path(booking, from_company_view: true),
method: :delete, data: { confirm: 'Är du säker på att du vill avboka?' }, class: "btn btn-danger btn-sm"
## Instruction:
Patch booking instead of destroy it on cancel from company views
## Code After:
%h2.group-title Bokningar
%table.full.wrap
%thead
%tr
%th Plats
%th Tid
%th
%tbody
- @company.bookings.each do |booking|
%tr
%td= link_to booking.place.name, place_path(booking.place)
%td= date_and_time(booking)
%td.delete= button_to 'Avboka', cancel_booking_path(booking, from_company_view: true),
method: :patch, data: { confirm: 'Är du säker på att du vill avboka?' }, class: "btn btn-danger btn-sm"
| %h2.group-title Bokningar
%table.full.wrap
%thead
%tr
%th Plats
%th Tid
%th
%tbody
- @company.bookings.each do |booking|
%tr
%td= link_to booking.place.name, place_path(booking.place)
%td= date_and_time(booking)
- %td.delete= link_to 'Avboka', booking_path(booking, from_company_view: true),
? ^^ -
+ %td.delete= button_to 'Avboka', cancel_booking_path(booking, from_company_view: true),
? ^^^^^ +++++++
- method: :delete, data: { confirm: 'Är du säker på att du vill avboka?' }, class: "btn btn-danger btn-sm"
? ^^^^ ^
+ method: :patch, data: { confirm: 'Är du säker på att du vill avboka?' }, class: "btn btn-danger btn-sm"
? ^^ ^^
| 4 | 0.285714 | 2 | 2 |
48fa78cf488b227b33355362ee1d7110936a6671 | compiler/modules/CommonMark/src/config.h | compiler/modules/CommonMark/src/config.h | typedef char bool;
# define true 1
# define false 0
#endif
#define CMARK_ATTRIBUTE(list)
#ifndef CHY_HAS_VA_COPY
#define va_copy(dest, src) ((dest) = (src))
#endif
| typedef char bool;
# define true 1
# define false 0
#endif
#define CMARK_ATTRIBUTE(list)
#ifndef CHY_HAS_VA_COPY
#define va_copy(dest, src) ((dest) = (src))
#endif
#define inline CHY_INLINE
| Use CHY_INLINE in CommonMark source | Use CHY_INLINE in CommonMark source
| C | apache-2.0 | rectang/lucy-clownfish,nwellnhof/lucy-clownfish,rectang/lucy-clownfish,rectang/lucy-clownfish,apache/lucy-clownfish,apache/lucy-clownfish,apache/lucy-clownfish,rectang/lucy-clownfish,rectang/lucy-clownfish,nwellnhof/lucy-clownfish,apache/lucy-clownfish,nwellnhof/lucy-clownfish,nwellnhof/lucy-clownfish,rectang/lucy-clownfish,rectang/lucy-clownfish,nwellnhof/lucy-clownfish,apache/lucy-clownfish,rectang/lucy-clownfish,apache/lucy-clownfish,apache/lucy-clownfish,nwellnhof/lucy-clownfish,nwellnhof/lucy-clownfish,rectang/lucy-clownfish,apache/lucy-clownfish,nwellnhof/lucy-clownfish | c | ## Code Before:
typedef char bool;
# define true 1
# define false 0
#endif
#define CMARK_ATTRIBUTE(list)
#ifndef CHY_HAS_VA_COPY
#define va_copy(dest, src) ((dest) = (src))
#endif
## Instruction:
Use CHY_INLINE in CommonMark source
## Code After:
typedef char bool;
# define true 1
# define false 0
#endif
#define CMARK_ATTRIBUTE(list)
#ifndef CHY_HAS_VA_COPY
#define va_copy(dest, src) ((dest) = (src))
#endif
#define inline CHY_INLINE
| typedef char bool;
# define true 1
# define false 0
#endif
#define CMARK_ATTRIBUTE(list)
#ifndef CHY_HAS_VA_COPY
#define va_copy(dest, src) ((dest) = (src))
#endif
+
+ #define inline CHY_INLINE | 2 | 0.2 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.