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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a34049c578fa5ae9c207e92526d6b60cb79cd6c5 | willow-servers/src/main/java/com/nitorcreations/willow/servers/WillowServletContextListener.java | willow-servers/src/main/java/com/nitorcreations/willow/servers/WillowServletContextListener.java | package com.nitorcreations.willow.servers;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import org.apache.shiro.guice.web.ShiroWebModule;
import org.eclipse.sisu.space.SpaceModule;
import org.eclipse.sisu.space.URLClassSpace;
import org.eclipse.sisu.wire.WireModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
public class WillowServletContextListener extends GuiceServletContextListener {
private ServletContext servletContext;
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
this.servletContext = servletContextEvent.getServletContext();
super.contextInitialized(servletContextEvent);
}
@Override
protected Injector getInjector() {
ClassLoader classloader = getClass().getClassLoader();
return Guice.createInjector(
new WireModule(new ApplicationServletModule(),
new WillowShiroModule(servletContext),
ShiroWebModule.guiceFilterModule(),
new SpaceModule(
new URLClassSpace(classloader)
)));
}
}
| package com.nitorcreations.willow.servers;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import org.apache.shiro.guice.web.ShiroWebModule;
import org.eclipse.sisu.space.SpaceModule;
import org.eclipse.sisu.space.URLClassSpace;
import org.eclipse.sisu.wire.WireModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
public class WillowServletContextListener extends GuiceServletContextListener {
private ServletContext servletContext;
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
this.servletContext = servletContextEvent.getServletContext();
super.contextInitialized(servletContextEvent);
}
@Override
protected Injector getInjector() {
ClassLoader classloader = getClass().getClassLoader();
return Guice.createInjector(
new WireModule(new ApplicationServletModule(),
getShiroModule(), ShiroWebModule.guiceFilterModule(),
new SpaceModule(
new URLClassSpace(classloader)
)));
}
protected ShiroWebModule getShiroModule() {
return new WillowShiroModule(servletContext);
}
}
| Put shiro module into an easily overridable function | Put shiro module into an easily overridable function
| Java | apache-2.0 | NitorCreations/willow,NitorCreations/willow,NitorCreations/willow,NitorCreations/willow,NitorCreations/willow | java | ## Code Before:
package com.nitorcreations.willow.servers;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import org.apache.shiro.guice.web.ShiroWebModule;
import org.eclipse.sisu.space.SpaceModule;
import org.eclipse.sisu.space.URLClassSpace;
import org.eclipse.sisu.wire.WireModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
public class WillowServletContextListener extends GuiceServletContextListener {
private ServletContext servletContext;
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
this.servletContext = servletContextEvent.getServletContext();
super.contextInitialized(servletContextEvent);
}
@Override
protected Injector getInjector() {
ClassLoader classloader = getClass().getClassLoader();
return Guice.createInjector(
new WireModule(new ApplicationServletModule(),
new WillowShiroModule(servletContext),
ShiroWebModule.guiceFilterModule(),
new SpaceModule(
new URLClassSpace(classloader)
)));
}
}
## Instruction:
Put shiro module into an easily overridable function
## Code After:
package com.nitorcreations.willow.servers;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import org.apache.shiro.guice.web.ShiroWebModule;
import org.eclipse.sisu.space.SpaceModule;
import org.eclipse.sisu.space.URLClassSpace;
import org.eclipse.sisu.wire.WireModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
public class WillowServletContextListener extends GuiceServletContextListener {
private ServletContext servletContext;
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
this.servletContext = servletContextEvent.getServletContext();
super.contextInitialized(servletContextEvent);
}
@Override
protected Injector getInjector() {
ClassLoader classloader = getClass().getClassLoader();
return Guice.createInjector(
new WireModule(new ApplicationServletModule(),
getShiroModule(), ShiroWebModule.guiceFilterModule(),
new SpaceModule(
new URLClassSpace(classloader)
)));
}
protected ShiroWebModule getShiroModule() {
return new WillowShiroModule(servletContext);
}
}
| package com.nitorcreations.willow.servers;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import org.apache.shiro.guice.web.ShiroWebModule;
import org.eclipse.sisu.space.SpaceModule;
import org.eclipse.sisu.space.URLClassSpace;
import org.eclipse.sisu.wire.WireModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
public class WillowServletContextListener extends GuiceServletContextListener {
private ServletContext servletContext;
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
this.servletContext = servletContextEvent.getServletContext();
super.contextInitialized(servletContextEvent);
}
@Override
protected Injector getInjector() {
ClassLoader classloader = getClass().getClassLoader();
return Guice.createInjector(
new WireModule(new ApplicationServletModule(),
- new WillowShiroModule(servletContext),
- ShiroWebModule.guiceFilterModule(),
+ getShiroModule(), ShiroWebModule.guiceFilterModule(),
? ++++++++++++++++++
new SpaceModule(
new URLClassSpace(classloader)
)));
}
+ protected ShiroWebModule getShiroModule() {
+ return new WillowShiroModule(servletContext);
+ }
} | 6 | 0.171429 | 4 | 2 |
1aa509c2cb69244f64fe2b5657df44cf52368bfa | start.sh | start.sh |
while getopts "e:f" opt; do
case $opt in
e) config="$OPTARG"
;;
f) pidFile="$OPTARG"
esac
done
configs=("development" "production" "staging")
function printConfigs {
for item in ${configs[*]}; do
printf "%s " "$item"
done
}
if [ -z "$config" ]; then
printf "No environment was provided. Provde one with -e. Valid values are "
printConfigs
printf "\n"
exit
fi
if [[ ! " ${configs[@]} " =~ " ${config} " ]]; then
printf "Invalid environment. Valid values are "
printConfigs
printf "\n"
fi
rm "$pidFile"
touch "$pidFile"
vapor run --env="$config" & echo $! > "$pidFile" |
while getopts "e:f:" opt; do
case $opt in
e) config="$OPTARG"
;;
f) pidFile="$OPTARG"
esac
done
configs=("development" "production" "staging")
function printConfigs {
for item in ${configs[*]}; do
printf "%s " "$item"
done
}
if [ -z "$config" ]; then
printf "No environment was provided. Provde one with -e. Valid values are "
printConfigs
printf "\n"
exit
fi
if [ -z "$pidFile" ]; then
printf "No pidFile was provided."
exit
fi
if [[ ! " ${configs[@]} " =~ " ${config} " ]]; then
printf "Invalid environment. Valid values are "
printConfigs
printf "\n"
fi
rm "$pidFile"
touch "$pidFile"
vapor run --env="$config" & echo $! > "$pidFile" | Add missing colon and check for existence of variable | Add missing colon and check for existence of variable
| Shell | mit | instacrate/Subber-api,Subberbox/Subber-api,instacrate/Subber-api,Subberbox/Subber-api | shell | ## Code Before:
while getopts "e:f" opt; do
case $opt in
e) config="$OPTARG"
;;
f) pidFile="$OPTARG"
esac
done
configs=("development" "production" "staging")
function printConfigs {
for item in ${configs[*]}; do
printf "%s " "$item"
done
}
if [ -z "$config" ]; then
printf "No environment was provided. Provde one with -e. Valid values are "
printConfigs
printf "\n"
exit
fi
if [[ ! " ${configs[@]} " =~ " ${config} " ]]; then
printf "Invalid environment. Valid values are "
printConfigs
printf "\n"
fi
rm "$pidFile"
touch "$pidFile"
vapor run --env="$config" & echo $! > "$pidFile"
## Instruction:
Add missing colon and check for existence of variable
## Code After:
while getopts "e:f:" opt; do
case $opt in
e) config="$OPTARG"
;;
f) pidFile="$OPTARG"
esac
done
configs=("development" "production" "staging")
function printConfigs {
for item in ${configs[*]}; do
printf "%s " "$item"
done
}
if [ -z "$config" ]; then
printf "No environment was provided. Provde one with -e. Valid values are "
printConfigs
printf "\n"
exit
fi
if [ -z "$pidFile" ]; then
printf "No pidFile was provided."
exit
fi
if [[ ! " ${configs[@]} " =~ " ${config} " ]]; then
printf "Invalid environment. Valid values are "
printConfigs
printf "\n"
fi
rm "$pidFile"
touch "$pidFile"
vapor run --env="$config" & echo $! > "$pidFile" |
- while getopts "e:f" opt; do
+ while getopts "e:f:" opt; do
? +
case $opt in
e) config="$OPTARG"
;;
f) pidFile="$OPTARG"
esac
done
configs=("development" "production" "staging")
function printConfigs {
for item in ${configs[*]}; do
printf "%s " "$item"
done
}
if [ -z "$config" ]; then
printf "No environment was provided. Provde one with -e. Valid values are "
printConfigs
printf "\n"
exit
fi
+ if [ -z "$pidFile" ]; then
+ printf "No pidFile was provided."
+ exit
+ fi
+
if [[ ! " ${configs[@]} " =~ " ${config} " ]]; then
printf "Invalid environment. Valid values are "
printConfigs
printf "\n"
fi
rm "$pidFile"
touch "$pidFile"
vapor run --env="$config" & echo $! > "$pidFile" | 7 | 0.205882 | 6 | 1 |
08dea674f14363d01ef35b2a23f957e4e97164f6 | composer.json | composer.json | {
"name": "phparsenal/fastforward",
"description": "fast-forward lets you remember, find and open your most used commands and folders.",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Marcel Voigt",
"email": "mv@noch.so"
}
],
"autoload": {
"psr-4": {
"phparsenal\\fastforward\\": "src/"
}
},
"require": {
"nochso/orm": "~1.3",
"league/climate": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "4.7.*"
}
}
| {
"name": "phparsenal/fastforward",
"description": "fast-forward lets you remember, find and open your most used commands and folders.",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Marcel Voigt",
"email": "mv@noch.so"
}
],
"autoload": {
"psr-4": {
"phparsenal\\fastforward\\": "src/"
}
},
"require": {
"nochso/orm": "~1.3",
"league/climate": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "4.7.*",
"fabpot/php-cs-fixer": "^1.9"
}
}
| Add php-cs-fixer as dev requirement | Add php-cs-fixer as dev requirement
| JSON | mit | phparsenal/fast-forward,nochso/fast-forward,nochso/fast-forward,phparsenal/fast-forward,natedrake/fast-forward,natedrake/fast-forward | json | ## Code Before:
{
"name": "phparsenal/fastforward",
"description": "fast-forward lets you remember, find and open your most used commands and folders.",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Marcel Voigt",
"email": "mv@noch.so"
}
],
"autoload": {
"psr-4": {
"phparsenal\\fastforward\\": "src/"
}
},
"require": {
"nochso/orm": "~1.3",
"league/climate": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "4.7.*"
}
}
## Instruction:
Add php-cs-fixer as dev requirement
## Code After:
{
"name": "phparsenal/fastforward",
"description": "fast-forward lets you remember, find and open your most used commands and folders.",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Marcel Voigt",
"email": "mv@noch.so"
}
],
"autoload": {
"psr-4": {
"phparsenal\\fastforward\\": "src/"
}
},
"require": {
"nochso/orm": "~1.3",
"league/climate": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "4.7.*",
"fabpot/php-cs-fixer": "^1.9"
}
}
| {
"name": "phparsenal/fastforward",
"description": "fast-forward lets you remember, find and open your most used commands and folders.",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Marcel Voigt",
"email": "mv@noch.so"
}
],
"autoload": {
"psr-4": {
"phparsenal\\fastforward\\": "src/"
}
},
"require": {
"nochso/orm": "~1.3",
"league/climate": "^3.1"
},
"require-dev": {
- "phpunit/phpunit": "4.7.*"
+ "phpunit/phpunit": "4.7.*",
? +
+ "fabpot/php-cs-fixer": "^1.9"
}
} | 3 | 0.125 | 2 | 1 |
071babf23bc7c752536d6a165e8b2f8c97cf1efa | lib/biz/week_time/abstract.rb | lib/biz/week_time/abstract.rb | module Biz
module WeekTime
class Abstract
include Comparable
extend Forwardable
def self.from_time(time)
new(
time.wday * Time.day_minutes +
time.hour * Time.hour_minutes +
time.min
)
end
attr_reader :week_minute
def initialize(week_minute)
@week_minute = Integer(week_minute)
end
def wday_symbol
day_of_week.symbol
end
delegate wday: :day_of_week
delegate %i[
hour
minute
second
day_minute
day_second
timestamp
] => :day_time
def <=>(other)
return unless other.is_a?(WeekTime::Abstract)
week_minute <=> other.week_minute
end
end
end
end
| module Biz
module WeekTime
class Abstract
extend Forwardable
include Comparable
def self.from_time(time)
new(
time.wday * Time.day_minutes +
time.hour * Time.hour_minutes +
time.min
)
end
attr_reader :week_minute
def initialize(week_minute)
@week_minute = Integer(week_minute)
end
def wday_symbol
day_of_week.symbol
end
delegate wday: :day_of_week
delegate %i[
hour
minute
second
day_minute
day_second
timestamp
] => :day_time
def <=>(other)
return unless other.is_a?(WeekTime::Abstract)
week_minute <=> other.week_minute
end
end
end
end
| Move `Forwardable` reference above `Comparable` | Move `Forwardable` reference above `Comparable`
Since `Forwardable` is adding class methods and `Comparable is adding
instance methods.
| Ruby | apache-2.0 | zendesk/biz,zendesk/biz | ruby | ## Code Before:
module Biz
module WeekTime
class Abstract
include Comparable
extend Forwardable
def self.from_time(time)
new(
time.wday * Time.day_minutes +
time.hour * Time.hour_minutes +
time.min
)
end
attr_reader :week_minute
def initialize(week_minute)
@week_minute = Integer(week_minute)
end
def wday_symbol
day_of_week.symbol
end
delegate wday: :day_of_week
delegate %i[
hour
minute
second
day_minute
day_second
timestamp
] => :day_time
def <=>(other)
return unless other.is_a?(WeekTime::Abstract)
week_minute <=> other.week_minute
end
end
end
end
## Instruction:
Move `Forwardable` reference above `Comparable`
Since `Forwardable` is adding class methods and `Comparable is adding
instance methods.
## Code After:
module Biz
module WeekTime
class Abstract
extend Forwardable
include Comparable
def self.from_time(time)
new(
time.wday * Time.day_minutes +
time.hour * Time.hour_minutes +
time.min
)
end
attr_reader :week_minute
def initialize(week_minute)
@week_minute = Integer(week_minute)
end
def wday_symbol
day_of_week.symbol
end
delegate wday: :day_of_week
delegate %i[
hour
minute
second
day_minute
day_second
timestamp
] => :day_time
def <=>(other)
return unless other.is_a?(WeekTime::Abstract)
week_minute <=> other.week_minute
end
end
end
end
| module Biz
module WeekTime
class Abstract
+ extend Forwardable
+
include Comparable
-
- extend Forwardable
def self.from_time(time)
new(
time.wday * Time.day_minutes +
time.hour * Time.hour_minutes +
time.min
)
end
attr_reader :week_minute
def initialize(week_minute)
@week_minute = Integer(week_minute)
end
def wday_symbol
day_of_week.symbol
end
delegate wday: :day_of_week
delegate %i[
hour
minute
second
day_minute
day_second
timestamp
] => :day_time
def <=>(other)
return unless other.is_a?(WeekTime::Abstract)
week_minute <=> other.week_minute
end
end
end
end | 4 | 0.086957 | 2 | 2 |
dd3ca0adaf1c94ce1b5ce7495e0eae2bfc1dc793 | rubbem/src/main.rs | rubbem/src/main.rs | extern crate gtk;
use gtk::traits::*;
fn main() {
if !gtk::init_check() {
println!("Cannot start because GTK is not working / available");
return;
}
match gtk::Window::new(gtk::WindowType::TopLevel) {
None => println!("Unable to create a GTK window."),
Some(window) => {
window.set_title("Rubbem");
window.set_window_position(gtk::WindowPosition::Center);
window.connect_delete_event(|_, _| {
gtk::main_quit();
gtk::signal::Inhibit(false)
});
window.show_all();
gtk::main();
}
}
}
| extern crate gtk;
use gtk::traits::*;
fn main() {
match gtk::init() {
Err(_) => println!("Cannot start because GTK is not working / available."),
Ok(_) => gtk_main()
}
}
fn gtk_main()
{
match gtk::Window::new(gtk::WindowType::TopLevel) {
None => println!("Unable to create a GTK window."),
Some(window) => gtk_window(window)
}
}
fn gtk_window(window: gtk::Window)
{
window.set_title("Rubbem");
window.set_window_position(gtk::WindowPosition::Center);
window.connect_delete_event(|_, _| {
gtk::main_quit();
gtk::signal::Inhibit(false)
});
window.show_all();
gtk::main();
}
| Use new version of gtk:init() that returns a Result | CG: Use new version of gtk:init() that returns a Result
| Rust | agpl-3.0 | cjgreenaway/rubbem | rust | ## Code Before:
extern crate gtk;
use gtk::traits::*;
fn main() {
if !gtk::init_check() {
println!("Cannot start because GTK is not working / available");
return;
}
match gtk::Window::new(gtk::WindowType::TopLevel) {
None => println!("Unable to create a GTK window."),
Some(window) => {
window.set_title("Rubbem");
window.set_window_position(gtk::WindowPosition::Center);
window.connect_delete_event(|_, _| {
gtk::main_quit();
gtk::signal::Inhibit(false)
});
window.show_all();
gtk::main();
}
}
}
## Instruction:
CG: Use new version of gtk:init() that returns a Result
## Code After:
extern crate gtk;
use gtk::traits::*;
fn main() {
match gtk::init() {
Err(_) => println!("Cannot start because GTK is not working / available."),
Ok(_) => gtk_main()
}
}
fn gtk_main()
{
match gtk::Window::new(gtk::WindowType::TopLevel) {
None => println!("Unable to create a GTK window."),
Some(window) => gtk_window(window)
}
}
fn gtk_window(window: gtk::Window)
{
window.set_title("Rubbem");
window.set_window_position(gtk::WindowPosition::Center);
window.connect_delete_event(|_, _| {
gtk::main_quit();
gtk::signal::Inhibit(false)
});
window.show_all();
gtk::main();
}
| extern crate gtk;
use gtk::traits::*;
fn main() {
- if !gtk::init_check() {
+ match gtk::init() {
- println!("Cannot start because GTK is not working / available");
? ^
+ Err(_) => println!("Cannot start because GTK is not working / available."),
? ++++++++++ + ^
- return;
+ Ok(_) => gtk_main()
}
+ }
+ fn gtk_main()
+ {
match gtk::Window::new(gtk::WindowType::TopLevel) {
None => println!("Unable to create a GTK window."),
+ Some(window) => gtk_window(window)
- Some(window) => {
- window.set_title("Rubbem");
- window.set_window_position(gtk::WindowPosition::Center);
-
- window.connect_delete_event(|_, _| {
- gtk::main_quit();
- gtk::signal::Inhibit(false)
- });
-
- window.show_all();
- gtk::main();
- }
}
}
+
+ fn gtk_window(window: gtk::Window)
+ {
+ window.set_title("Rubbem");
+ window.set_window_position(gtk::WindowPosition::Center);
+
+ window.connect_delete_event(|_, _| {
+ gtk::main_quit();
+ gtk::signal::Inhibit(false)
+ });
+
+ window.show_all();
+ gtk::main();
+ }
+ | 37 | 1.423077 | 22 | 15 |
318d3879949e09446c4902c09245531104342659 | app/questions/how-do-i-connect-to-itunes-store.json | app/questions/how-do-i-connect-to-itunes-store.json | {
"votes": 3,
"title": "How do I connect to iTunes Store?",
"tags": ["computer", "software", "apple"],
"detailed": "I have inherited a heavily customised - hardly documented CRM 2011 instance. There are over 80 in-house managed solutions and one of them contains a ribbon button that isn't working as desired.",
"images": [],
"answers" : [
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225},
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225}
]
}
| {
"id": "this-is-mongo-id",
"posted-epoch-time" : 1382550225,
"votes": 3,
"title": "How do I connect to iTunes Store?",
"tags": ["computer", "software", "apple"],
"detailed": "I have inherited a heavily customised - hardly documented CRM 2011 instance. There are over 80 in-house managed solutions and one of them contains a ribbon button that isn't working as desired.",
"images": [],
"answers" : [
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225},
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225}
]
}
| Update JSON spec for detailed questions. | Update JSON spec for detailed questions.
| JSON | agpl-3.0 | tatsuhirosatou/p2p-app-backend,tatsuhirosatou/p2p-app-backend | json | ## Code Before:
{
"votes": 3,
"title": "How do I connect to iTunes Store?",
"tags": ["computer", "software", "apple"],
"detailed": "I have inherited a heavily customised - hardly documented CRM 2011 instance. There are over 80 in-house managed solutions and one of them contains a ribbon button that isn't working as desired.",
"images": [],
"answers" : [
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225},
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225}
]
}
## Instruction:
Update JSON spec for detailed questions.
## Code After:
{
"id": "this-is-mongo-id",
"posted-epoch-time" : 1382550225,
"votes": 3,
"title": "How do I connect to iTunes Store?",
"tags": ["computer", "software", "apple"],
"detailed": "I have inherited a heavily customised - hardly documented CRM 2011 instance. There are over 80 in-house managed solutions and one of them contains a ribbon button that isn't working as desired.",
"images": [],
"answers" : [
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225},
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225}
]
}
| {
+ "id": "this-is-mongo-id",
+ "posted-epoch-time" : 1382550225,
"votes": 3,
"title": "How do I connect to iTunes Store?",
"tags": ["computer", "software", "apple"],
"detailed": "I have inherited a heavily customised - hardly documented CRM 2011 instance. There are over 80 in-house managed solutions and one of them contains a ribbon button that isn't working as desired.",
"images": [],
"answers" : [
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225},
{"author":"Bob",
"answer": "I don't know",
"votes": 3,
"posted-epoch-time": 1382550225}
]
} | 2 | 0.117647 | 2 | 0 |
34db3ae5f8b90f2b7e47b958d084f88795f6f3fc | docs/README.md | docs/README.md |
To build the documentation:
* Using Fish:
docker run -it -v (pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
* Using Bash
docker run -it -v `pwd`:/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
|
To build the documentation:
* Using Fish:
```
docker run -it -v (pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
```
* Using Bash
```
docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
```
| Use $() syntax instead of backticks | Use $() syntax instead of backticks
Otherwise the command is not properly displayed after Markdown rendering | Markdown | apache-2.0 | cescoffier/vertx-microservices-workshop,cescoffier/vertx-microservices-workshop,cescoffier/vertx-microservices-workshop,cescoffier/vertx-microservices-workshop,cescoffier/vertx-microservices-workshop | markdown | ## Code Before:
To build the documentation:
* Using Fish:
docker run -it -v (pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
* Using Bash
docker run -it -v `pwd`:/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
## Instruction:
Use $() syntax instead of backticks
Otherwise the command is not properly displayed after Markdown rendering
## Code After:
To build the documentation:
* Using Fish:
```
docker run -it -v (pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
```
* Using Bash
```
docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
```
|
To build the documentation:
* Using Fish:
+ ```
- docker run -it -v (pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
? ----
+ docker run -it -v (pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
+ ```
* Using Bash
+ ```
- docker run -it -v `pwd`:/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
? ---- ^ ^
+ docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor "./build.sh" "html"
? ^^ ^
+ ```
| 8 | 0.666667 | 6 | 2 |
f81ddc6297b1372cdba3a5161b4f30d0a42d2f58 | src/factor.py | src/factor.py | from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n == 1:
return Counter()
divisor = 2
while n % divisor != 0:
divisor = Prime.after(divisor)
return Counter({divisor: 1}) + get_prime_factors(n // divisor)
def get_flat_prime_factors(n):
""" Returns a sorted list of n's prime_factor, where each
prime factor is repeated the number of times it divides n
"""
prime_factors = get_prime_factors(n)
return sorted([
x for list_ in (
[factor] * count for
factor, count in prime_factors.items()
) for x in list_
])
def get_divisors(n):
""" Returns a set of all divisors of n
"""
if n < 1:
return set()
flat_factors = get_flat_prime_factors(n)
divisors = set([1, n])
for i in range(len(flat_factors)):
for comb in combinations(flat_factors, i + 1):
divisors.add(reduce(lambda x, y: x * y, comb))
return divisors
def get_proper_divisors(n):
""" Returns a set of all proper divisors of n
"""
return get_divisors(n) - {n}
| from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n < 1:
raise ValueError
if n == 1:
return Counter()
divisor = 2
while n % divisor != 0:
divisor = Prime.after(divisor)
return Counter({divisor: 1}) + get_prime_factors(n // divisor)
def get_flat_prime_factors(n):
""" Returns a sorted list of n's prime_factor, where each
prime factor is repeated the number of times it divides n
"""
prime_factors = get_prime_factors(n)
return sorted([
x for list_ in (
[factor] * count for
factor, count in prime_factors.items()
) for x in list_
])
def get_divisors(n):
""" Returns a set of all divisors of n
"""
if n < 1:
return set()
flat_factors = get_flat_prime_factors(n)
divisors = set([1, n])
for i in range(len(flat_factors)):
for comb in combinations(flat_factors, i + 1):
divisors.add(reduce(lambda x, y: x * y, comb))
return divisors
def get_proper_divisors(n):
""" Returns a set of all proper divisors of n
"""
return get_divisors(n) - {n}
| Raise ValueError if n < 1 | Raise ValueError if n < 1
| Python | mit | mackorone/euler | python | ## Code Before:
from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n == 1:
return Counter()
divisor = 2
while n % divisor != 0:
divisor = Prime.after(divisor)
return Counter({divisor: 1}) + get_prime_factors(n // divisor)
def get_flat_prime_factors(n):
""" Returns a sorted list of n's prime_factor, where each
prime factor is repeated the number of times it divides n
"""
prime_factors = get_prime_factors(n)
return sorted([
x for list_ in (
[factor] * count for
factor, count in prime_factors.items()
) for x in list_
])
def get_divisors(n):
""" Returns a set of all divisors of n
"""
if n < 1:
return set()
flat_factors = get_flat_prime_factors(n)
divisors = set([1, n])
for i in range(len(flat_factors)):
for comb in combinations(flat_factors, i + 1):
divisors.add(reduce(lambda x, y: x * y, comb))
return divisors
def get_proper_divisors(n):
""" Returns a set of all proper divisors of n
"""
return get_divisors(n) - {n}
## Instruction:
Raise ValueError if n < 1
## Code After:
from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
if n < 1:
raise ValueError
if n == 1:
return Counter()
divisor = 2
while n % divisor != 0:
divisor = Prime.after(divisor)
return Counter({divisor: 1}) + get_prime_factors(n // divisor)
def get_flat_prime_factors(n):
""" Returns a sorted list of n's prime_factor, where each
prime factor is repeated the number of times it divides n
"""
prime_factors = get_prime_factors(n)
return sorted([
x for list_ in (
[factor] * count for
factor, count in prime_factors.items()
) for x in list_
])
def get_divisors(n):
""" Returns a set of all divisors of n
"""
if n < 1:
return set()
flat_factors = get_flat_prime_factors(n)
divisors = set([1, n])
for i in range(len(flat_factors)):
for comb in combinations(flat_factors, i + 1):
divisors.add(reduce(lambda x, y: x * y, comb))
return divisors
def get_proper_divisors(n):
""" Returns a set of all proper divisors of n
"""
return get_divisors(n) - {n}
| from collections import Counter
from functools import (
lru_cache,
reduce,
)
from itertools import combinations
from prime import Prime
@lru_cache(maxsize=None)
def get_prime_factors(n):
""" Returns the counts of each prime factor of n
"""
+ if n < 1:
+ raise ValueError
if n == 1:
return Counter()
divisor = 2
while n % divisor != 0:
divisor = Prime.after(divisor)
return Counter({divisor: 1}) + get_prime_factors(n // divisor)
def get_flat_prime_factors(n):
""" Returns a sorted list of n's prime_factor, where each
prime factor is repeated the number of times it divides n
"""
prime_factors = get_prime_factors(n)
return sorted([
x for list_ in (
[factor] * count for
factor, count in prime_factors.items()
) for x in list_
])
def get_divisors(n):
""" Returns a set of all divisors of n
"""
if n < 1:
return set()
flat_factors = get_flat_prime_factors(n)
divisors = set([1, n])
for i in range(len(flat_factors)):
for comb in combinations(flat_factors, i + 1):
divisors.add(reduce(lambda x, y: x * y, comb))
return divisors
def get_proper_divisors(n):
""" Returns a set of all proper divisors of n
"""
return get_divisors(n) - {n} | 2 | 0.039216 | 2 | 0 |
808909906f08729a4916a552b5a7a4d1079e8d3c | roles/desktop/tasks/main.yml | roles/desktop/tasks/main.yml | ---
- meta: flush_handlers
- name: Update apt
apt: update_cache={{ update_apt_cache }}
- name: Install desktop
apt: name={{ desktop_package }} force=yes state=latest
- name: Install additional desktop packages
apt: name={{ item }} force=yes state=latest
with_items: "{{ desktop_additional_packages }}" | ---
- meta: flush_handlers
- name: Update apt
apt: update_cache={{ update_apt_cache }}
- name: Install desktop
apt: name={{ desktop_package }} force=yes state=latest
- name: Install additional desktop packages
apt: name={{ item }} force=yes state=latest
with_items: "{{ desktop_additional_packages }}"
- name: No show HUD hotkey
shell: >-
gsettings set org.compiz.integrated show-hud "['']" | Set show hud hotkey to none | Set show hud hotkey to none
| YAML | apache-2.0 | storax/ansible-storax | yaml | ## Code Before:
---
- meta: flush_handlers
- name: Update apt
apt: update_cache={{ update_apt_cache }}
- name: Install desktop
apt: name={{ desktop_package }} force=yes state=latest
- name: Install additional desktop packages
apt: name={{ item }} force=yes state=latest
with_items: "{{ desktop_additional_packages }}"
## Instruction:
Set show hud hotkey to none
## Code After:
---
- meta: flush_handlers
- name: Update apt
apt: update_cache={{ update_apt_cache }}
- name: Install desktop
apt: name={{ desktop_package }} force=yes state=latest
- name: Install additional desktop packages
apt: name={{ item }} force=yes state=latest
with_items: "{{ desktop_additional_packages }}"
- name: No show HUD hotkey
shell: >-
gsettings set org.compiz.integrated show-hud "['']" | ---
- meta: flush_handlers
- name: Update apt
apt: update_cache={{ update_apt_cache }}
- name: Install desktop
apt: name={{ desktop_package }} force=yes state=latest
- name: Install additional desktop packages
apt: name={{ item }} force=yes state=latest
with_items: "{{ desktop_additional_packages }}"
+
+ - name: No show HUD hotkey
+ shell: >-
+ gsettings set org.compiz.integrated show-hud "['']" | 4 | 0.307692 | 4 | 0 |
e36b9245c3d1e51533bb4ea4b435db2a00173b75 | README.rst | README.rst | Jyven
=========
A utility for importing Maven dependencies for use with Jython.
Usage
=====
Specify a Maven dependency like this::
from jyven import maven
maven('group:artifact:version')
The artifact and its `compile` dependencies will be downloaded with Maven and
appended to `sys.path`.
Quick Install
=============
This package is not on PyPI, so install with::
pip install git+https://github.com/amake/jyven.git
Requirements
============
The Maven executable must be accessible from the path as `mvn`.
Limitations
===========
Maven operations are performed by invoking the Maven executable in a separate
process (and in some cases scraping the output), so it is not very efficient or
robust.
License
=======
Jyven is distributed under the `MIT license <LICENSE.txt>`__.
| Jyven
=========
A utility for importing Maven dependencies for use with Jython.
Usage
=====
Specify a Maven dependency like this::
from jyven import maven
maven('group:artifact:version')
The artifact and its `compile` dependencies will be downloaded from Maven
Central and appended to `sys.path`. To specify a repository other than Maven
Central, use the `repo` kwarg::
maven('group:artifact:version', repo='http://example.com')
There is also a preset for jCenter::
from jyven import jcenter
jcenter('group:artifact:version')
Quick Install
=============
This package is not on PyPI, so install with::
pip install git+https://github.com/amake/jyven.git
Requirements
============
The Maven executable must be accessible from the path as `mvn`.
Limitations
===========
Maven operations are performed by invoking the Maven executable in a separate
process (and in some cases scraping the output), so it is not very efficient or
robust.
License
=======
Jyven is distributed under the `MIT license <LICENSE.txt>`__.
| Add custom repo example, jCenter example to readme | Add custom repo example, jCenter example to readme
| reStructuredText | mit | amake/jyven | restructuredtext | ## Code Before:
Jyven
=========
A utility for importing Maven dependencies for use with Jython.
Usage
=====
Specify a Maven dependency like this::
from jyven import maven
maven('group:artifact:version')
The artifact and its `compile` dependencies will be downloaded with Maven and
appended to `sys.path`.
Quick Install
=============
This package is not on PyPI, so install with::
pip install git+https://github.com/amake/jyven.git
Requirements
============
The Maven executable must be accessible from the path as `mvn`.
Limitations
===========
Maven operations are performed by invoking the Maven executable in a separate
process (and in some cases scraping the output), so it is not very efficient or
robust.
License
=======
Jyven is distributed under the `MIT license <LICENSE.txt>`__.
## Instruction:
Add custom repo example, jCenter example to readme
## Code After:
Jyven
=========
A utility for importing Maven dependencies for use with Jython.
Usage
=====
Specify a Maven dependency like this::
from jyven import maven
maven('group:artifact:version')
The artifact and its `compile` dependencies will be downloaded from Maven
Central and appended to `sys.path`. To specify a repository other than Maven
Central, use the `repo` kwarg::
maven('group:artifact:version', repo='http://example.com')
There is also a preset for jCenter::
from jyven import jcenter
jcenter('group:artifact:version')
Quick Install
=============
This package is not on PyPI, so install with::
pip install git+https://github.com/amake/jyven.git
Requirements
============
The Maven executable must be accessible from the path as `mvn`.
Limitations
===========
Maven operations are performed by invoking the Maven executable in a separate
process (and in some cases scraping the output), so it is not very efficient or
robust.
License
=======
Jyven is distributed under the `MIT license <LICENSE.txt>`__.
| Jyven
=========
A utility for importing Maven dependencies for use with Jython.
Usage
=====
Specify a Maven dependency like this::
from jyven import maven
maven('group:artifact:version')
- The artifact and its `compile` dependencies will be downloaded with Maven and
? ^^^^ ----
+ The artifact and its `compile` dependencies will be downloaded from Maven
? ^^^^
- appended to `sys.path`.
+ Central and appended to `sys.path`. To specify a repository other than Maven
+ Central, use the `repo` kwarg::
+
+ maven('group:artifact:version', repo='http://example.com')
+
+ There is also a preset for jCenter::
+
+ from jyven import jcenter
+ jcenter('group:artifact:version')
Quick Install
=============
This package is not on PyPI, so install with::
pip install git+https://github.com/amake/jyven.git
Requirements
============
The Maven executable must be accessible from the path as `mvn`.
Limitations
===========
Maven operations are performed by invoking the Maven executable in a separate
process (and in some cases scraping the output), so it is not very efficient or
robust.
License
=======
Jyven is distributed under the `MIT license <LICENSE.txt>`__. | 12 | 0.307692 | 10 | 2 |
fa9d3aa3805a01acc707f85df4eea1db418dca96 | manifest.json | manifest.json | {
"name": "Video Speed Controller",
"short_name": "videospeed",
"version": "0.2.6",
"manifest_version": 2,
"description": "Speed up, slow down, advance and rewind any HTML5 video with quick shortcuts.",
"homepage_url": "https://github.com/igrigorik/videospeed",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"permissions": [ "activeTab", "storage" ],
"options_page": "options.html",
"browser_action": {
"default_icon": {
"19": "images/icon19.png",
"38": "images/icon38.png"
},
"default_icon": "icons/icon48.png",
"default_popup": "popup.html"
},
"content_scripts": [{
"all_frames": true,
"matches": [ "http://*/*", "https://*/*", "file:///*"],
"exclude_matches": [
"https://plus.google.com/hangouts/*",
"http://www.lynda.com/*",
"http://www.hitbox.tv/*"
],
"css": [ "inject.css" ],
"js": [ "inject.js" ]
}
],
"web_accessible_resources": [
"inject.css"
]
}
| {
"name": "Video Speed Controller",
"short_name": "videospeed",
"version": "0.2.6",
"manifest_version": 2,
"description": "Speed up, slow down, advance and rewind any HTML5 video with quick shortcuts.",
"homepage_url": "https://github.com/igrigorik/videospeed",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"permissions": [ "activeTab", "storage" ],
"options_page": "options.html",
"browser_action": {
"default_icon": {
"19": "images/icon19.png",
"38": "images/icon38.png"
},
"default_icon": "icons/icon48.png",
"default_popup": "popup.html"
},
"content_scripts": [{
"all_frames": true,
"matches": [ "http://*/*", "https://*/*", "file:///*"],
"exclude_matches": [
"https://plus.google.com/hangouts/*",
"https://hangouts.google.com/hangouts/*",
"http://www.lynda.com/*",
"http://www.hitbox.tv/*"
],
"css": [ "inject.css" ],
"js": [ "inject.js" ]
}
],
"web_accessible_resources": [
"inject.css"
]
}
| Add new hangouts.google.com URL to excluded matches. | Add new hangouts.google.com URL to excluded matches.
Sometimes, but not all the time, I end up at hangouts.google.com instead
of plus.google.com. I think this is part of Google's move to decouple
Google Plus from the Hangouts service.
Resolves #81.
| JSON | mit | piccoloman/videospeed,piccoloman/videospeed | json | ## Code Before:
{
"name": "Video Speed Controller",
"short_name": "videospeed",
"version": "0.2.6",
"manifest_version": 2,
"description": "Speed up, slow down, advance and rewind any HTML5 video with quick shortcuts.",
"homepage_url": "https://github.com/igrigorik/videospeed",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"permissions": [ "activeTab", "storage" ],
"options_page": "options.html",
"browser_action": {
"default_icon": {
"19": "images/icon19.png",
"38": "images/icon38.png"
},
"default_icon": "icons/icon48.png",
"default_popup": "popup.html"
},
"content_scripts": [{
"all_frames": true,
"matches": [ "http://*/*", "https://*/*", "file:///*"],
"exclude_matches": [
"https://plus.google.com/hangouts/*",
"http://www.lynda.com/*",
"http://www.hitbox.tv/*"
],
"css": [ "inject.css" ],
"js": [ "inject.js" ]
}
],
"web_accessible_resources": [
"inject.css"
]
}
## Instruction:
Add new hangouts.google.com URL to excluded matches.
Sometimes, but not all the time, I end up at hangouts.google.com instead
of plus.google.com. I think this is part of Google's move to decouple
Google Plus from the Hangouts service.
Resolves #81.
## Code After:
{
"name": "Video Speed Controller",
"short_name": "videospeed",
"version": "0.2.6",
"manifest_version": 2,
"description": "Speed up, slow down, advance and rewind any HTML5 video with quick shortcuts.",
"homepage_url": "https://github.com/igrigorik/videospeed",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"permissions": [ "activeTab", "storage" ],
"options_page": "options.html",
"browser_action": {
"default_icon": {
"19": "images/icon19.png",
"38": "images/icon38.png"
},
"default_icon": "icons/icon48.png",
"default_popup": "popup.html"
},
"content_scripts": [{
"all_frames": true,
"matches": [ "http://*/*", "https://*/*", "file:///*"],
"exclude_matches": [
"https://plus.google.com/hangouts/*",
"https://hangouts.google.com/hangouts/*",
"http://www.lynda.com/*",
"http://www.hitbox.tv/*"
],
"css": [ "inject.css" ],
"js": [ "inject.js" ]
}
],
"web_accessible_resources": [
"inject.css"
]
}
| {
"name": "Video Speed Controller",
"short_name": "videospeed",
"version": "0.2.6",
"manifest_version": 2,
"description": "Speed up, slow down, advance and rewind any HTML5 video with quick shortcuts.",
"homepage_url": "https://github.com/igrigorik/videospeed",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"permissions": [ "activeTab", "storage" ],
"options_page": "options.html",
"browser_action": {
"default_icon": {
"19": "images/icon19.png",
"38": "images/icon38.png"
},
"default_icon": "icons/icon48.png",
"default_popup": "popup.html"
},
"content_scripts": [{
"all_frames": true,
"matches": [ "http://*/*", "https://*/*", "file:///*"],
"exclude_matches": [
"https://plus.google.com/hangouts/*",
+ "https://hangouts.google.com/hangouts/*",
"http://www.lynda.com/*",
"http://www.hitbox.tv/*"
],
"css": [ "inject.css" ],
"js": [ "inject.js" ]
}
],
"web_accessible_resources": [
"inject.css"
]
} | 1 | 0.026316 | 1 | 0 |
c1c0f0d08b4ef6789266a1155ca4b96f61674a3e | app/templates/errors/applications_closed.html | app/templates/errors/applications_closed.html | {% extends "_base_page.html" %}
{% block pageTitle %}
Applications closed - Digital Marketplace
{% endblock %}
{% block main_content %}
<div class="error-page">
<header class="page-heading-smaller">
<h1>You can no longer apply to {{ framework['name'] }}</h1>
</header>
<div class="dmspeak">
<p class="govuk-body">
The deadline for applying was {{ framework['applicationsCloseAt'] }}.
</p>
{% if following_framework_content %}
<p class="govuk-body">
{{ following_framework_content.name }} is expected to open in {{ following_framework_content.coming }}. <a class="govuk-link" href="{{ url_for('.join_open_framework_notification_mailing_list') }}">Sign up for emails</a> about when you can apply.
</p>
{% endif %}
</div>
<div class="secondary-action-link">
<p class="govuk-body">
<a class="govuk-link" href="{{ url_for('.dashboard') }}">Return to your account</a>.
</p>
</div>
</div>
{% endblock %}
| {% extends "_base_page.html" %}
{% block pageTitle %}
Applications closed - Digital Marketplace
{% endblock %}
{% block main_content %}
<div class="error-page">
<h1 class="govuk-heading-l">You can no longer apply to {{ framework['name'] }}</h1>
<div class="dmspeak">
<p class="govuk-body">
The deadline for applying was {{ framework['applicationsCloseAt'] }}.
</p>
{% if following_framework_content %}
<p class="govuk-body">
{{ following_framework_content.name }} is expected to open in {{ following_framework_content.coming }}. <a class="govuk-link" href="{{ url_for('.join_open_framework_notification_mailing_list') }}">Sign up for emails</a> about when you can apply.
</p>
{% endif %}
</div>
<div class="secondary-action-link">
<p class="govuk-body">
<a class="govuk-link" href="{{ url_for('.dashboard') }}">Return to your account</a>.
</p>
</div>
</div>
{% endblock %}
| Replace page-heading* styles with govuk-heading | Replace page-heading* styles with govuk-heading
| HTML | mit | alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend | html | ## Code Before:
{% extends "_base_page.html" %}
{% block pageTitle %}
Applications closed - Digital Marketplace
{% endblock %}
{% block main_content %}
<div class="error-page">
<header class="page-heading-smaller">
<h1>You can no longer apply to {{ framework['name'] }}</h1>
</header>
<div class="dmspeak">
<p class="govuk-body">
The deadline for applying was {{ framework['applicationsCloseAt'] }}.
</p>
{% if following_framework_content %}
<p class="govuk-body">
{{ following_framework_content.name }} is expected to open in {{ following_framework_content.coming }}. <a class="govuk-link" href="{{ url_for('.join_open_framework_notification_mailing_list') }}">Sign up for emails</a> about when you can apply.
</p>
{% endif %}
</div>
<div class="secondary-action-link">
<p class="govuk-body">
<a class="govuk-link" href="{{ url_for('.dashboard') }}">Return to your account</a>.
</p>
</div>
</div>
{% endblock %}
## Instruction:
Replace page-heading* styles with govuk-heading
## Code After:
{% extends "_base_page.html" %}
{% block pageTitle %}
Applications closed - Digital Marketplace
{% endblock %}
{% block main_content %}
<div class="error-page">
<h1 class="govuk-heading-l">You can no longer apply to {{ framework['name'] }}</h1>
<div class="dmspeak">
<p class="govuk-body">
The deadline for applying was {{ framework['applicationsCloseAt'] }}.
</p>
{% if following_framework_content %}
<p class="govuk-body">
{{ following_framework_content.name }} is expected to open in {{ following_framework_content.coming }}. <a class="govuk-link" href="{{ url_for('.join_open_framework_notification_mailing_list') }}">Sign up for emails</a> about when you can apply.
</p>
{% endif %}
</div>
<div class="secondary-action-link">
<p class="govuk-body">
<a class="govuk-link" href="{{ url_for('.dashboard') }}">Return to your account</a>.
</p>
</div>
</div>
{% endblock %}
| {% extends "_base_page.html" %}
{% block pageTitle %}
Applications closed - Digital Marketplace
{% endblock %}
{% block main_content %}
<div class="error-page">
- <header class="page-heading-smaller">
- <h1>You can no longer apply to {{ framework['name'] }}</h1>
? --
+ <h1 class="govuk-heading-l">You can no longer apply to {{ framework['name'] }}</h1>
? ++++++++++++++++++++++++
- </header>
<div class="dmspeak">
<p class="govuk-body">
The deadline for applying was {{ framework['applicationsCloseAt'] }}.
</p>
{% if following_framework_content %}
<p class="govuk-body">
{{ following_framework_content.name }} is expected to open in {{ following_framework_content.coming }}. <a class="govuk-link" href="{{ url_for('.join_open_framework_notification_mailing_list') }}">Sign up for emails</a> about when you can apply.
</p>
{% endif %}
</div>
<div class="secondary-action-link">
<p class="govuk-body">
<a class="govuk-link" href="{{ url_for('.dashboard') }}">Return to your account</a>.
</p>
</div>
</div>
{% endblock %} | 4 | 0.129032 | 1 | 3 |
f58c1536c4d2017a58af692f31101264c481d768 | src/Omnipay/Gate2shop/Gateway.php | src/Omnipay/Gate2shop/Gateway.php | <?php
namespace Omnipay\Gate2shop;
use Omnipay\Common\AbstractGateway;
use Omnipay\Gate2shop\Message\PurchaseRequest;
use Omnipay\Gate2shop\Message\CompletePurchaseRequest;
/**
* Gate2shop Gateway
*
* @link
*/
class Gateway extends AbstractGateway
{
public function getName()
{
return 'Gate2shop';
}
public function getDefaultParameters()
{
return array(
'merchantSiteId' => '',
'merchantId' => '',
'secretKey' => ''
);
}
public function getMerchantSiteId()
{
return $this->getParameter('merchantSiteId');
}
public function setMerchantSiteId($value)
{
return $this->setParameter('merchantSiteId', $value);
}
public function getMerchantId()
{
return $this->getParameter('merchantId');
}
public function setMerchantId($value)
{
return $this->setParameter('merchantId', $value);
}
public function getSecretKey()
{
return $this->getParameter('secretKey');
}
public function setSecretKey($value)
{
return $this->setParameter('secretKey', $value);
}
public function purchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\Gate2shop\Message\PurchaseRequest', $parameters);
}
public function completePurchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\Gate2shop\Message\CompletePurchaseRequest', $parameters);
}
}
| <?php
namespace Omnipay\Gate2shop;
use Omnipay\Common\AbstractGateway;
use Omnipay\Gate2shop\Message\PurchaseRequest;
/**
* Gate2shop Gateway
*
* @link
*/
class Gateway extends AbstractGateway
{
public function getName()
{
return 'Gate2shop';
}
public function getDefaultParameters()
{
return array(
'merchantSiteId' => '',
'merchantId' => '',
'secretKey' => '',
'customSiteName' => ''
);
}
public function getMerchantSiteId()
{
return $this->getParameter('merchantSiteId');
}
public function setMerchantSiteId($value)
{
return $this->setParameter('merchantSiteId', $value);
}
public function getMerchantId()
{
return $this->getParameter('merchantId');
}
public function setMerchantId($value)
{
return $this->setParameter('merchantId', $value);
}
public function getSecretKey()
{
return $this->getParameter('secretKey');
}
public function setSecretKey($value)
{
return $this->setParameter('secretKey', $value);
}
public function getCustomSiteName()
{
return $this->getParameter('customSiteName');
}
public function setCustomSiteName($value)
{
return $this->setParameter('customSiteName', $value);
}
public function purchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\Gate2shop\Message\PurchaseRequest', $parameters);
}
}
| Support gateway initialisation of the custom site name. Also remove references to the unused (and unnecessary?) CompletePurchaseRequest. | Support gateway initialisation of the custom site name.
Also remove references to the unused (and unnecessary?) CompletePurchaseRequest.
| PHP | mit | twostars/omnipay-gate2shop,pavkatar/omnipay-gate2shop,mfauveau/omnipay-gate2shop | php | ## Code Before:
<?php
namespace Omnipay\Gate2shop;
use Omnipay\Common\AbstractGateway;
use Omnipay\Gate2shop\Message\PurchaseRequest;
use Omnipay\Gate2shop\Message\CompletePurchaseRequest;
/**
* Gate2shop Gateway
*
* @link
*/
class Gateway extends AbstractGateway
{
public function getName()
{
return 'Gate2shop';
}
public function getDefaultParameters()
{
return array(
'merchantSiteId' => '',
'merchantId' => '',
'secretKey' => ''
);
}
public function getMerchantSiteId()
{
return $this->getParameter('merchantSiteId');
}
public function setMerchantSiteId($value)
{
return $this->setParameter('merchantSiteId', $value);
}
public function getMerchantId()
{
return $this->getParameter('merchantId');
}
public function setMerchantId($value)
{
return $this->setParameter('merchantId', $value);
}
public function getSecretKey()
{
return $this->getParameter('secretKey');
}
public function setSecretKey($value)
{
return $this->setParameter('secretKey', $value);
}
public function purchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\Gate2shop\Message\PurchaseRequest', $parameters);
}
public function completePurchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\Gate2shop\Message\CompletePurchaseRequest', $parameters);
}
}
## Instruction:
Support gateway initialisation of the custom site name.
Also remove references to the unused (and unnecessary?) CompletePurchaseRequest.
## Code After:
<?php
namespace Omnipay\Gate2shop;
use Omnipay\Common\AbstractGateway;
use Omnipay\Gate2shop\Message\PurchaseRequest;
/**
* Gate2shop Gateway
*
* @link
*/
class Gateway extends AbstractGateway
{
public function getName()
{
return 'Gate2shop';
}
public function getDefaultParameters()
{
return array(
'merchantSiteId' => '',
'merchantId' => '',
'secretKey' => '',
'customSiteName' => ''
);
}
public function getMerchantSiteId()
{
return $this->getParameter('merchantSiteId');
}
public function setMerchantSiteId($value)
{
return $this->setParameter('merchantSiteId', $value);
}
public function getMerchantId()
{
return $this->getParameter('merchantId');
}
public function setMerchantId($value)
{
return $this->setParameter('merchantId', $value);
}
public function getSecretKey()
{
return $this->getParameter('secretKey');
}
public function setSecretKey($value)
{
return $this->setParameter('secretKey', $value);
}
public function getCustomSiteName()
{
return $this->getParameter('customSiteName');
}
public function setCustomSiteName($value)
{
return $this->setParameter('customSiteName', $value);
}
public function purchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\Gate2shop\Message\PurchaseRequest', $parameters);
}
}
| <?php
namespace Omnipay\Gate2shop;
use Omnipay\Common\AbstractGateway;
use Omnipay\Gate2shop\Message\PurchaseRequest;
- use Omnipay\Gate2shop\Message\CompletePurchaseRequest;
/**
* Gate2shop Gateway
*
* @link
*/
class Gateway extends AbstractGateway
{
public function getName()
{
return 'Gate2shop';
}
public function getDefaultParameters()
{
return array(
'merchantSiteId' => '',
'merchantId' => '',
- 'secretKey' => ''
+ 'secretKey' => '',
? +
+ 'customSiteName' => ''
);
}
public function getMerchantSiteId()
{
return $this->getParameter('merchantSiteId');
}
public function setMerchantSiteId($value)
{
return $this->setParameter('merchantSiteId', $value);
}
public function getMerchantId()
{
return $this->getParameter('merchantId');
}
public function setMerchantId($value)
{
return $this->setParameter('merchantId', $value);
}
public function getSecretKey()
{
return $this->getParameter('secretKey');
}
public function setSecretKey($value)
{
return $this->setParameter('secretKey', $value);
}
+ public function getCustomSiteName()
+ {
+ return $this->getParameter('customSiteName');
+ }
+
+ public function setCustomSiteName($value)
+ {
+ return $this->setParameter('customSiteName', $value);
+ }
+
public function purchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\Gate2shop\Message\PurchaseRequest', $parameters);
}
-
- public function completePurchase(array $parameters = array())
- {
- return $this->createRequest('\Omnipay\Gate2shop\Message\CompletePurchaseRequest', $parameters);
- }
} | 19 | 0.275362 | 12 | 7 |
65eb156f2bb67b07ebda254f4f1a98ef3a020d53 | tasks/main.yml | tasks/main.yml | ---
# Tasks to install docker-registry
- name: install dependencies
apt: name={{ item }} state=present update_cache=yes
with_items:
- build-essential
- libevent-dev
- libssl-dev
- liblzma-dev
- python-dev
- python-pip
- name: install docker registry
pip: name=docker-registry
- name: create required directories
file: dest={{ item }} state=directory
with_items:
- "{{ storage_path }}"
- /var/log/docker-registry
- /etc/docker-registry
- name: set configuration file
template: >
src=config.yml.j2
dest=/etc/docker-registry/config.yml
notify: restart docker-registry
- name: create symlink for config
file: >
src=/etc/docker-registry/config.yml
dest=/usr/local/lib/python2.7/dist-packages/config/config.yml
state=link
- name: install docker-registry init file
template: >
src=docker-registry.init.j2
dest=/etc/init/docker-registry.conf
- name: ensure docker registry is enabled and running
service: name=docker-registry state=running enabled=yes
- include: redis.yml
when: manage_redis
- include: nginx.yml
when: manage_nginx
# Tests
# =====
# Required for uri module
- name: install httplib2 for tests
pip: name=httplib2 state=present
# Ping the Docker registry, API documented here :
# https://docs.docker.com/reference/api/registry_api/
- name: ping docker registry
uri: url=http://localhost:5000/v1/_ping method=GET follow_redirect=all return_content=yes status_code=200 timeout=3
| ---
# Tasks to install docker-registry
- name: install dependencies
apt: name={{ item }} state=present update_cache=yes
with_items:
- build-essential
- libevent-dev
- libssl-dev
- liblzma-dev
- python-dev
- python-pip
- name: install docker registry
pip: name=docker-registry
- name: create required directories
file: dest={{ item }} state=directory
with_items:
- "{{ storage_path }}"
- /var/log/docker-registry
- /etc/docker-registry
- name: set configuration file
template: >
src=config.yml.j2
dest=/etc/docker-registry/config.yml
notify: restart docker-registry
- name: create symlink for config
file: >
src=/etc/docker-registry/config.yml
dest=/usr/local/lib/python2.7/dist-packages/config/config.yml
state=link
- name: install docker-registry init file
template: >
src=docker-registry.init.j2
dest=/etc/init/docker-registry.conf
- name: ensure docker registry is enabled and running
service: name=docker-registry state=running enabled=yes
- include: redis.yml
when: manage_redis
- include: nginx.yml
when: manage_nginx
| Remove ping test from role | Remove ping test from role
| YAML | apache-2.0 | nextrevision/ansible-docker-registry | yaml | ## Code Before:
---
# Tasks to install docker-registry
- name: install dependencies
apt: name={{ item }} state=present update_cache=yes
with_items:
- build-essential
- libevent-dev
- libssl-dev
- liblzma-dev
- python-dev
- python-pip
- name: install docker registry
pip: name=docker-registry
- name: create required directories
file: dest={{ item }} state=directory
with_items:
- "{{ storage_path }}"
- /var/log/docker-registry
- /etc/docker-registry
- name: set configuration file
template: >
src=config.yml.j2
dest=/etc/docker-registry/config.yml
notify: restart docker-registry
- name: create symlink for config
file: >
src=/etc/docker-registry/config.yml
dest=/usr/local/lib/python2.7/dist-packages/config/config.yml
state=link
- name: install docker-registry init file
template: >
src=docker-registry.init.j2
dest=/etc/init/docker-registry.conf
- name: ensure docker registry is enabled and running
service: name=docker-registry state=running enabled=yes
- include: redis.yml
when: manage_redis
- include: nginx.yml
when: manage_nginx
# Tests
# =====
# Required for uri module
- name: install httplib2 for tests
pip: name=httplib2 state=present
# Ping the Docker registry, API documented here :
# https://docs.docker.com/reference/api/registry_api/
- name: ping docker registry
uri: url=http://localhost:5000/v1/_ping method=GET follow_redirect=all return_content=yes status_code=200 timeout=3
## Instruction:
Remove ping test from role
## Code After:
---
# Tasks to install docker-registry
- name: install dependencies
apt: name={{ item }} state=present update_cache=yes
with_items:
- build-essential
- libevent-dev
- libssl-dev
- liblzma-dev
- python-dev
- python-pip
- name: install docker registry
pip: name=docker-registry
- name: create required directories
file: dest={{ item }} state=directory
with_items:
- "{{ storage_path }}"
- /var/log/docker-registry
- /etc/docker-registry
- name: set configuration file
template: >
src=config.yml.j2
dest=/etc/docker-registry/config.yml
notify: restart docker-registry
- name: create symlink for config
file: >
src=/etc/docker-registry/config.yml
dest=/usr/local/lib/python2.7/dist-packages/config/config.yml
state=link
- name: install docker-registry init file
template: >
src=docker-registry.init.j2
dest=/etc/init/docker-registry.conf
- name: ensure docker registry is enabled and running
service: name=docker-registry state=running enabled=yes
- include: redis.yml
when: manage_redis
- include: nginx.yml
when: manage_nginx
| ---
# Tasks to install docker-registry
- name: install dependencies
apt: name={{ item }} state=present update_cache=yes
with_items:
- build-essential
- libevent-dev
- libssl-dev
- liblzma-dev
- python-dev
- python-pip
- name: install docker registry
pip: name=docker-registry
- name: create required directories
file: dest={{ item }} state=directory
with_items:
- "{{ storage_path }}"
- /var/log/docker-registry
- /etc/docker-registry
- name: set configuration file
template: >
src=config.yml.j2
dest=/etc/docker-registry/config.yml
notify: restart docker-registry
- name: create symlink for config
file: >
src=/etc/docker-registry/config.yml
dest=/usr/local/lib/python2.7/dist-packages/config/config.yml
state=link
- name: install docker-registry init file
template: >
src=docker-registry.init.j2
dest=/etc/init/docker-registry.conf
- name: ensure docker registry is enabled and running
service: name=docker-registry state=running enabled=yes
- include: redis.yml
when: manage_redis
- include: nginx.yml
when: manage_nginx
-
- # Tests
- # =====
-
- # Required for uri module
- - name: install httplib2 for tests
- pip: name=httplib2 state=present
-
- # Ping the Docker registry, API documented here :
- # https://docs.docker.com/reference/api/registry_api/
- - name: ping docker registry
- uri: url=http://localhost:5000/v1/_ping method=GET follow_redirect=all return_content=yes status_code=200 timeout=3 | 12 | 0.20339 | 0 | 12 |
601a6d93f11f4749568117e14eea8f19838383a1 | app/controllers/conferences_controller.rb | app/controllers/conferences_controller.rb | class ConferencesController < ApplicationController
before_action :redirect, except: [:index, :show]
def new
end
def redirect
redirect_to orga_conferences_path
end
private
def conferences
@conferences ||= Conference.ordered(sort_params).in_current_season
end
helper_method :conferences
def conference
@conference ||= params[:id] ? Conference.find(params[:id]) : Conference.new(conference_params)
end
helper_method :conference
def conference_params
params[:conference] ? params.require(:conference).permit(
:name, :url, :location, :twitter, :tickets, :flights, :accomodation,
:'starts_on(1i)', :'starts_on(2i)', :'starts_on(3i)', :round,
:'ends_on(1i)', :'ends_on(2i)', :'ends_on(3i)', :lightningtalkslots,
attendances_attributes: [:id, :github_handle, :_destroy]
) : {}
end
def sort_params
{
order: %w(name location starts_on).include?(params[:sort]) ? params[:sort] : nil,
direction: %w(asc desc).include?(params[:direction]) ? params[:direction] : nil
}
end
end
| class ConferencesController < ApplicationController
before_action :redirect, except: [:index, :show]
def new
end
def redirect
redirect_to orga_conferences_path
end
private
def conferences
@conferences ||= Conference.ordered(sort_params).in_current_season
end
helper_method :conferences
def conference
@conference ||= Conference.find(params[:id])
end
helper_method :conference
def sort_params
{
order: %w(name location starts_on).include?(params[:sort]) ? params[:sort] : nil,
direction: %w(asc desc).include?(params[:direction]) ? params[:direction] : nil
}
end
end
| Remove redundant strong params for conferences | Remove redundant strong params for conferences
The permitted params are set in the orga/conferences_controller. In the non-orga controller, they are never called.
| Ruby | mit | michaelem/rgsoc-teams,TeamCheesy/rgsoc-teams,michaelem/rgsoc-teams,rails-girls-summer-of-code/rgsoc-teams,TeamCheesy/rgsoc-teams,TeamCheesy/rgsoc-teams,rails-girls-summer-of-code/rgsoc-teams,rails-girls-summer-of-code/rgsoc-teams,michaelem/rgsoc-teams | ruby | ## Code Before:
class ConferencesController < ApplicationController
before_action :redirect, except: [:index, :show]
def new
end
def redirect
redirect_to orga_conferences_path
end
private
def conferences
@conferences ||= Conference.ordered(sort_params).in_current_season
end
helper_method :conferences
def conference
@conference ||= params[:id] ? Conference.find(params[:id]) : Conference.new(conference_params)
end
helper_method :conference
def conference_params
params[:conference] ? params.require(:conference).permit(
:name, :url, :location, :twitter, :tickets, :flights, :accomodation,
:'starts_on(1i)', :'starts_on(2i)', :'starts_on(3i)', :round,
:'ends_on(1i)', :'ends_on(2i)', :'ends_on(3i)', :lightningtalkslots,
attendances_attributes: [:id, :github_handle, :_destroy]
) : {}
end
def sort_params
{
order: %w(name location starts_on).include?(params[:sort]) ? params[:sort] : nil,
direction: %w(asc desc).include?(params[:direction]) ? params[:direction] : nil
}
end
end
## Instruction:
Remove redundant strong params for conferences
The permitted params are set in the orga/conferences_controller. In the non-orga controller, they are never called.
## Code After:
class ConferencesController < ApplicationController
before_action :redirect, except: [:index, :show]
def new
end
def redirect
redirect_to orga_conferences_path
end
private
def conferences
@conferences ||= Conference.ordered(sort_params).in_current_season
end
helper_method :conferences
def conference
@conference ||= Conference.find(params[:id])
end
helper_method :conference
def sort_params
{
order: %w(name location starts_on).include?(params[:sort]) ? params[:sort] : nil,
direction: %w(asc desc).include?(params[:direction]) ? params[:direction] : nil
}
end
end
| class ConferencesController < ApplicationController
before_action :redirect, except: [:index, :show]
def new
end
def redirect
redirect_to orga_conferences_path
end
private
def conferences
@conferences ||= Conference.ordered(sort_params).in_current_season
end
helper_method :conferences
def conference
- @conference ||= params[:id] ? Conference.find(params[:id]) : Conference.new(conference_params)
+ @conference ||= Conference.find(params[:id])
end
helper_method :conference
-
- def conference_params
- params[:conference] ? params.require(:conference).permit(
- :name, :url, :location, :twitter, :tickets, :flights, :accomodation,
- :'starts_on(1i)', :'starts_on(2i)', :'starts_on(3i)', :round,
- :'ends_on(1i)', :'ends_on(2i)', :'ends_on(3i)', :lightningtalkslots,
- attendances_attributes: [:id, :github_handle, :_destroy]
- ) : {}
- end
def sort_params
{
order: %w(name location starts_on).include?(params[:sort]) ? params[:sort] : nil,
direction: %w(asc desc).include?(params[:direction]) ? params[:direction] : nil
}
end
end | 11 | 0.289474 | 1 | 10 |
2e1f79aadff76c860e4cf49ee2e81e9fc3dfe847 | .travis.yml | .travis.yml | language: ruby
rvm:
- 2.0.0
- 2.1.1
env:
- TEST_DIR=alpha/ruby
script: cd $TEST_DIR && rake | language: ruby
rvm:
- 2.0.0
- 2.1.1
env:
- TEST_DIR=alpha/ruby
script: cd $TEST_DIR && bundle && rake | Fix Travis CI build errors | Fix Travis CI build errors
| YAML | bsd-3-clause | mohnish/planout,rawls238/planout,kkashin/planout,rawls238/planout,rawls238/planout,cudbg/planout,felixonmars/planout,cudbg/planout,etosch/planout,marquisthunder/planout,kkashin/planout,dieface/planout,mohnish/planout,marquisthunder/planout,dieface/planout,mohnish/planout,cudbg/planout,felixonmars/planout,dieface/planout,etosch/planout,marquisthunder/planout,kkashin/planout,felixonmars/planout,mohnish/planout,cudbg/planout,etosch/planout,rawls238/planout,felixonmars/planout,kkashin/planout,etosch/planout,dieface/planout | yaml | ## Code Before:
language: ruby
rvm:
- 2.0.0
- 2.1.1
env:
- TEST_DIR=alpha/ruby
script: cd $TEST_DIR && rake
## Instruction:
Fix Travis CI build errors
## Code After:
language: ruby
rvm:
- 2.0.0
- 2.1.1
env:
- TEST_DIR=alpha/ruby
script: cd $TEST_DIR && bundle && rake | language: ruby
rvm:
- 2.0.0
- 2.1.1
env:
- TEST_DIR=alpha/ruby
- script: cd $TEST_DIR && rake
+ script: cd $TEST_DIR && bundle && rake
? ++++++++++
| 2 | 0.285714 | 1 | 1 |
6a49205376c01c917aa6661d88f49152d71a2a58 | visualizer/load_race_button.js | visualizer/load_race_button.js | goog.provide('monoid.LoadRaceButton');
goog.require('goog.ui.Component');
goog.require('goog.dom.classlist');
goog.scope(function(){
/**
* @constructor
* @extends {goog.ui.Component}
*/
monoid.LoadRaceButton = function() {
goog.base(this);
};
var LoadRaceButton = monoid.LoadRaceButton;
goog.inherits(LoadRaceButton, goog.ui.Component);
/** @override */
LoadRaceButton.prototype.createDom = function() {
goog.base(this, 'createDom');
var element = this.getElement();
var label = this.dom_.createDom('div', 'load-race-button-label');
this.dom_.setTextContent(label, 'Load race data:');
this.dom_.appendChild(element, label);
var button = this.dom_.createDom('input', {type: 'file'});
goog.dom.classlist.add(button, 'load-race-button');
this.dom_.appendChild(element, button);
};
});
| goog.provide('monoid.LoadRaceButton');
goog.require('goog.ui.Component');
goog.require('goog.dom.classlist');
goog.require('goog.fs');
goog.require('goog.fs.FileReader');
goog.scope(function(){
/**
* @constructor
* @extends {goog.ui.Component}
*/
monoid.LoadRaceButton = function() {
goog.base(this);
/** @private {goog.fs.FileReader} */
this.fileReader_ = new goog.fs.FileReader();
this.getHandler().listen(this.fileReader_, goog.fs.FileReader.EventType.LOAD,
this.handleLoad_);
this.registerDisposable(this.fileReader_);
};
var LoadRaceButton = monoid.LoadRaceButton;
goog.inherits(LoadRaceButton, goog.ui.Component);
/** @override */
LoadRaceButton.prototype.createDom = function() {
goog.base(this, 'createDom');
var element = this.getElement();
var label = this.dom_.createDom('div', 'load-race-button-label');
this.dom_.setTextContent(label, 'Load race data:');
this.dom_.appendChild(element, label);
var button = this.dom_.createDom('input', {type: 'file'});
goog.dom.classlist.add(button, 'load-race-button');
this.dom_.appendChild(element, button);
this.getHandler().listen(button, goog.events.EventType.CHANGE, this.handleInputChanged_);
};
/**
* @param {goog.events.BrowserEvent} e
* @private
*/
LoadRaceButton.prototype.handleInputChanged_ = function(e) {
this.fileReader_.readAsText(e.target.files[0]);
};
/**
* @param {goog.fs.ProgressEvent} e
* @private
*/
LoadRaceButton.prototype.handleLoad_ = function(e) {
var test = this.dom_.createElement('div');
this.dom_.setTextContent(test, this.fileReader_.getResult());
this.dom_.appendChild(this.getElement(), test);
};
});
| Add ability to read files. | Add ability to read files.
Currently just dumps the contents into a div.
| JavaScript | apache-2.0 | sundbry/hwo-2014-monoid,sundbry/hwo-2014-monoid | javascript | ## Code Before:
goog.provide('monoid.LoadRaceButton');
goog.require('goog.ui.Component');
goog.require('goog.dom.classlist');
goog.scope(function(){
/**
* @constructor
* @extends {goog.ui.Component}
*/
monoid.LoadRaceButton = function() {
goog.base(this);
};
var LoadRaceButton = monoid.LoadRaceButton;
goog.inherits(LoadRaceButton, goog.ui.Component);
/** @override */
LoadRaceButton.prototype.createDom = function() {
goog.base(this, 'createDom');
var element = this.getElement();
var label = this.dom_.createDom('div', 'load-race-button-label');
this.dom_.setTextContent(label, 'Load race data:');
this.dom_.appendChild(element, label);
var button = this.dom_.createDom('input', {type: 'file'});
goog.dom.classlist.add(button, 'load-race-button');
this.dom_.appendChild(element, button);
};
});
## Instruction:
Add ability to read files.
Currently just dumps the contents into a div.
## Code After:
goog.provide('monoid.LoadRaceButton');
goog.require('goog.ui.Component');
goog.require('goog.dom.classlist');
goog.require('goog.fs');
goog.require('goog.fs.FileReader');
goog.scope(function(){
/**
* @constructor
* @extends {goog.ui.Component}
*/
monoid.LoadRaceButton = function() {
goog.base(this);
/** @private {goog.fs.FileReader} */
this.fileReader_ = new goog.fs.FileReader();
this.getHandler().listen(this.fileReader_, goog.fs.FileReader.EventType.LOAD,
this.handleLoad_);
this.registerDisposable(this.fileReader_);
};
var LoadRaceButton = monoid.LoadRaceButton;
goog.inherits(LoadRaceButton, goog.ui.Component);
/** @override */
LoadRaceButton.prototype.createDom = function() {
goog.base(this, 'createDom');
var element = this.getElement();
var label = this.dom_.createDom('div', 'load-race-button-label');
this.dom_.setTextContent(label, 'Load race data:');
this.dom_.appendChild(element, label);
var button = this.dom_.createDom('input', {type: 'file'});
goog.dom.classlist.add(button, 'load-race-button');
this.dom_.appendChild(element, button);
this.getHandler().listen(button, goog.events.EventType.CHANGE, this.handleInputChanged_);
};
/**
* @param {goog.events.BrowserEvent} e
* @private
*/
LoadRaceButton.prototype.handleInputChanged_ = function(e) {
this.fileReader_.readAsText(e.target.files[0]);
};
/**
* @param {goog.fs.ProgressEvent} e
* @private
*/
LoadRaceButton.prototype.handleLoad_ = function(e) {
var test = this.dom_.createElement('div');
this.dom_.setTextContent(test, this.fileReader_.getResult());
this.dom_.appendChild(this.getElement(), test);
};
});
| goog.provide('monoid.LoadRaceButton');
goog.require('goog.ui.Component');
goog.require('goog.dom.classlist');
+ goog.require('goog.fs');
+ goog.require('goog.fs.FileReader');
goog.scope(function(){
/**
* @constructor
* @extends {goog.ui.Component}
*/
monoid.LoadRaceButton = function() {
goog.base(this);
+
+ /** @private {goog.fs.FileReader} */
+ this.fileReader_ = new goog.fs.FileReader();
+ this.getHandler().listen(this.fileReader_, goog.fs.FileReader.EventType.LOAD,
+ this.handleLoad_);
+ this.registerDisposable(this.fileReader_);
};
var LoadRaceButton = monoid.LoadRaceButton;
goog.inherits(LoadRaceButton, goog.ui.Component);
/** @override */
LoadRaceButton.prototype.createDom = function() {
goog.base(this, 'createDom');
var element = this.getElement();
var label = this.dom_.createDom('div', 'load-race-button-label');
this.dom_.setTextContent(label, 'Load race data:');
this.dom_.appendChild(element, label);
var button = this.dom_.createDom('input', {type: 'file'});
goog.dom.classlist.add(button, 'load-race-button');
this.dom_.appendChild(element, button);
+ this.getHandler().listen(button, goog.events.EventType.CHANGE, this.handleInputChanged_);
+ };
+
+
+ /**
+ * @param {goog.events.BrowserEvent} e
+ * @private
+ */
+ LoadRaceButton.prototype.handleInputChanged_ = function(e) {
+ this.fileReader_.readAsText(e.target.files[0]);
+ };
+
+
+ /**
+ * @param {goog.fs.ProgressEvent} e
+ * @private
+ */
+ LoadRaceButton.prototype.handleLoad_ = function(e) {
+ var test = this.dom_.createElement('div');
+ this.dom_.setTextContent(test, this.fileReader_.getResult());
+ this.dom_.appendChild(this.getElement(), test);
};
}); | 29 | 0.828571 | 29 | 0 |
d0380db930dbf145108a7ef0330dd19475f7fdee | test_arrange_schedule.py | test_arrange_schedule.py | from arrange_schedule import *
def test_read_system_setting():
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in system_setting
return system_setting
def test_crawler_cwb_img(system_setting):
send_msg = {}
send_msg['server_dir'] = system_setting['board_py_dir']
send_msg['user_id'] = 1
receive_msg = crawler_cwb_img(send_msg)
assert receive_msg['result'] == 'success'
if __name__ == "__main__":
system_setting = test_read_system_setting()
test_crawler_cwb_img(system_setting)
print("All test passed")
| from arrange_schedule import *
def test_read_system_setting():
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in system_setting
return system_setting
def test_read_arrange_mode():
keys = ['arrange_sn','arrange_mode','condition']
receive_msg = read_arrange_mode()
for key in keys:
assert key in receive_msg
def test_crawler_cwb_img(system_setting):
send_msg = {}
send_msg['server_dir'] = system_setting['board_py_dir']
send_msg['user_id'] = 1
receive_msg = crawler_cwb_img(send_msg)
assert receive_msg['result'] == 'success'
if __name__ == "__main__":
system_setting = test_read_system_setting()
test_read_arrange_mode()
test_crawler_cwb_img(system_setting)
print("All test passed")
| Add test case for read_arrange_mode() | Add test case for read_arrange_mode()
| Python | apache-2.0 | Billy4195/electronic-blackboard,SWLBot/electronic-blackboard,stvreumi/electronic-blackboard,chenyang14/electronic-blackboard,SWLBot/electronic-blackboard,Billy4195/electronic-blackboard,stvreumi/electronic-blackboard,chenyang14/electronic-blackboard,stvreumi/electronic-blackboard,Billy4195/electronic-blackboard,stvreumi/electronic-blackboard,Billy4195/electronic-blackboard,SWLBot/electronic-blackboard,chenyang14/electronic-blackboard,SWLBot/electronic-blackboard | python | ## Code Before:
from arrange_schedule import *
def test_read_system_setting():
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in system_setting
return system_setting
def test_crawler_cwb_img(system_setting):
send_msg = {}
send_msg['server_dir'] = system_setting['board_py_dir']
send_msg['user_id'] = 1
receive_msg = crawler_cwb_img(send_msg)
assert receive_msg['result'] == 'success'
if __name__ == "__main__":
system_setting = test_read_system_setting()
test_crawler_cwb_img(system_setting)
print("All test passed")
## Instruction:
Add test case for read_arrange_mode()
## Code After:
from arrange_schedule import *
def test_read_system_setting():
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in system_setting
return system_setting
def test_read_arrange_mode():
keys = ['arrange_sn','arrange_mode','condition']
receive_msg = read_arrange_mode()
for key in keys:
assert key in receive_msg
def test_crawler_cwb_img(system_setting):
send_msg = {}
send_msg['server_dir'] = system_setting['board_py_dir']
send_msg['user_id'] = 1
receive_msg = crawler_cwb_img(send_msg)
assert receive_msg['result'] == 'success'
if __name__ == "__main__":
system_setting = test_read_system_setting()
test_read_arrange_mode()
test_crawler_cwb_img(system_setting)
print("All test passed")
| from arrange_schedule import *
def test_read_system_setting():
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in system_setting
return system_setting
+
+ def test_read_arrange_mode():
+ keys = ['arrange_sn','arrange_mode','condition']
+ receive_msg = read_arrange_mode()
+ for key in keys:
+ assert key in receive_msg
def test_crawler_cwb_img(system_setting):
send_msg = {}
send_msg['server_dir'] = system_setting['board_py_dir']
send_msg['user_id'] = 1
receive_msg = crawler_cwb_img(send_msg)
assert receive_msg['result'] == 'success'
if __name__ == "__main__":
system_setting = test_read_system_setting()
+ test_read_arrange_mode()
test_crawler_cwb_img(system_setting)
print("All test passed") | 7 | 0.318182 | 7 | 0 |
f253feac7a4c53bd17958b0c74adbec528ae2e17 | rethinkdb/setup-rethinkdb.py | rethinkdb/setup-rethinkdb.py | import rethinkdb as r
import argparse
parser = argparse.ArgumentParser(description='Set up RethinkDB locally')
args = parser.parse_args()
conn = r.connect()
r.db_create('muzhack').run(conn)
r.db('muzhack').table_create('users').run(conn)
r.db('muzhack').table_create('projects').run(conn)
r.db('muzhack').table_create('resetPasswordTokens').run(conn)
| import rethinkdb as r
import argparse
parser = argparse.ArgumentParser(description='Set up RethinkDB')
parser.add_argument('-H', '--host', default='localhost', help='Specify host')
args = parser.parse_args()
conn = r.connect(host=args.host)
r.db_create('muzhack').run(conn)
r.db('muzhack').table_create('users').run(conn)
r.db('muzhack').table_create('projects').run(conn)
r.db('muzhack').table_create('resetPasswordTokens').run(conn)
| Allow setting up rethinkdb remotely | Allow setting up rethinkdb remotely
| Python | mit | muzhack/musitechhub,muzhack/musitechhub,muzhack/musitechhub,muzhack/muzhack,muzhack/muzhack,muzhack/musitechhub,muzhack/muzhack,muzhack/muzhack | python | ## Code Before:
import rethinkdb as r
import argparse
parser = argparse.ArgumentParser(description='Set up RethinkDB locally')
args = parser.parse_args()
conn = r.connect()
r.db_create('muzhack').run(conn)
r.db('muzhack').table_create('users').run(conn)
r.db('muzhack').table_create('projects').run(conn)
r.db('muzhack').table_create('resetPasswordTokens').run(conn)
## Instruction:
Allow setting up rethinkdb remotely
## Code After:
import rethinkdb as r
import argparse
parser = argparse.ArgumentParser(description='Set up RethinkDB')
parser.add_argument('-H', '--host', default='localhost', help='Specify host')
args = parser.parse_args()
conn = r.connect(host=args.host)
r.db_create('muzhack').run(conn)
r.db('muzhack').table_create('users').run(conn)
r.db('muzhack').table_create('projects').run(conn)
r.db('muzhack').table_create('resetPasswordTokens').run(conn)
| import rethinkdb as r
import argparse
- parser = argparse.ArgumentParser(description='Set up RethinkDB locally')
? --------
+ parser = argparse.ArgumentParser(description='Set up RethinkDB')
+ parser.add_argument('-H', '--host', default='localhost', help='Specify host')
args = parser.parse_args()
- conn = r.connect()
+ conn = r.connect(host=args.host)
r.db_create('muzhack').run(conn)
r.db('muzhack').table_create('users').run(conn)
r.db('muzhack').table_create('projects').run(conn)
r.db('muzhack').table_create('resetPasswordTokens').run(conn) | 5 | 0.416667 | 3 | 2 |
6b9989e017f254f062737bf42b3df0fd452cc773 | README.md | README.md |
Normalize filenames, in particular focusing on shifting/adding dates to make
them more useful. Run `normalize-filename --help` for more information on
usage.
Project hosted at https://github.com/andrewferrier/normalize-filename.
## Installation on OS X
* `pip3 install coloredlogs pexpect`
|
Normalize filenames, in particular focusing on shifting/adding dates to make
them more useful. Run `normalize-filename --help` for more information on
usage.
Project hosted at https://github.com/andrewferrier/normalize-filename.
## Installation on OS X
* `pip3 install coloredlogs freezegun pexpect`
| Add freezegun to dependency list. | Add freezegun to dependency list.
| Markdown | mit | andrewferrier/normalize-filename,andrewferrier/normalize-filename | markdown | ## Code Before:
Normalize filenames, in particular focusing on shifting/adding dates to make
them more useful. Run `normalize-filename --help` for more information on
usage.
Project hosted at https://github.com/andrewferrier/normalize-filename.
## Installation on OS X
* `pip3 install coloredlogs pexpect`
## Instruction:
Add freezegun to dependency list.
## Code After:
Normalize filenames, in particular focusing on shifting/adding dates to make
them more useful. Run `normalize-filename --help` for more information on
usage.
Project hosted at https://github.com/andrewferrier/normalize-filename.
## Installation on OS X
* `pip3 install coloredlogs freezegun pexpect`
|
Normalize filenames, in particular focusing on shifting/adding dates to make
them more useful. Run `normalize-filename --help` for more information on
usage.
Project hosted at https://github.com/andrewferrier/normalize-filename.
## Installation on OS X
- * `pip3 install coloredlogs pexpect`
+ * `pip3 install coloredlogs freezegun pexpect`
? ++++++++++
| 2 | 0.2 | 1 | 1 |
140b72300baa1fbf4b2b991be62995d286baa677 | infrastructure/prod-deploy/decrypt-prod-secrets.sh | infrastructure/prod-deploy/decrypt-prod-secrets.sh | openssl aes-256-cbc -K "${encrypted_adab45d1d2ed_key}" -iv "${encrypted_adab45d1d2ed_iv}" -in ./infrastructure/prod-deploy/prod-deploy-secrets.tar.enc -out prod-deploy-secrets.tar -d
# Unzip the decrypted secret archive.
tar -C ./dthm4kaiako/dthm4kaiako/ -xf prod-deploy-secrets.tar
| openssl aes-256-cbc -K "${encrypted_adab45d1d2ed_key}" -iv "${encrypted_adab45d1d2ed_iv}" -in ./infrastructure/prod-deploy/prod-deploy-secrets.tar.enc -out ./dthm4kaiako/prod-deploy-secrets.tar -d
# Unzip the decrypted secret archive.
tar -C ./dthm4kaiako/ -xf prod-deploy-secrets.tar
| Correct path for decrypting secrets | Correct path for decrypting secrets
| Shell | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | shell | ## Code Before:
openssl aes-256-cbc -K "${encrypted_adab45d1d2ed_key}" -iv "${encrypted_adab45d1d2ed_iv}" -in ./infrastructure/prod-deploy/prod-deploy-secrets.tar.enc -out prod-deploy-secrets.tar -d
# Unzip the decrypted secret archive.
tar -C ./dthm4kaiako/dthm4kaiako/ -xf prod-deploy-secrets.tar
## Instruction:
Correct path for decrypting secrets
## Code After:
openssl aes-256-cbc -K "${encrypted_adab45d1d2ed_key}" -iv "${encrypted_adab45d1d2ed_iv}" -in ./infrastructure/prod-deploy/prod-deploy-secrets.tar.enc -out ./dthm4kaiako/prod-deploy-secrets.tar -d
# Unzip the decrypted secret archive.
tar -C ./dthm4kaiako/ -xf prod-deploy-secrets.tar
| - openssl aes-256-cbc -K "${encrypted_adab45d1d2ed_key}" -iv "${encrypted_adab45d1d2ed_iv}" -in ./infrastructure/prod-deploy/prod-deploy-secrets.tar.enc -out prod-deploy-secrets.tar -d
+ openssl aes-256-cbc -K "${encrypted_adab45d1d2ed_key}" -iv "${encrypted_adab45d1d2ed_iv}" -in ./infrastructure/prod-deploy/prod-deploy-secrets.tar.enc -out ./dthm4kaiako/prod-deploy-secrets.tar -d
? ++++++++++++++
# Unzip the decrypted secret archive.
- tar -C ./dthm4kaiako/dthm4kaiako/ -xf prod-deploy-secrets.tar
? ------------
+ tar -C ./dthm4kaiako/ -xf prod-deploy-secrets.tar | 4 | 1 | 2 | 2 |
1084db5fd038969673cb1cd9056df58ff2f63556 | lib/aerosol/cli.rb | lib/aerosol/cli.rb | require 'rubygems'
require 'slugger_deploys'
require 'clamp'
class SluggerDeploys::AbstractCommand < Clamp::Command
option ['-f', '--file'], 'FILE', 'deploys file to read', :default => 'deploys.rb', :attribute_name => :file
def execute
if File.exist?(file)
SluggerDeploys.load_file = file
else
raise 'Could not find a deploys file!'
end
end
end
class SluggerDeploys::SshCommand < SluggerDeploys::AbstractCommand
option ['-r', '--run'], :flag, 'run first ssh command', :attribute_name => :run_first
parameter 'DEPLOY', 'the deploy to list commands for', :attribute_name => :deploy_name
def execute
super
if deploy = SluggerDeploys.deploy(deploy_name.to_sym)
ssh_commands = deploy.generate_ssh_commands
raise 'No instances to ssh too!' if ssh_commands.empty?
ssh_commands.each do |ssh_command|
puts ssh_command
end
if run_first?
system(ssh_commands.first)
end
end
end
end
class SluggerDeploys::AutoScalingCommand < SluggerDeploys::AbstractCommand
parameter 'AUTOSCALING_GROUP', 'the auto scaling group to create', :attribute_name => :autoscaling_name
def execute
super
if autoscaling = SluggerDeploys.auto_scaling(autoscaling_name.to_sym)
autoscaling.create
end
end
end
class SluggerDeploys::Cli < SluggerDeploys::AbstractCommand
subcommand ['ssh', 's'], 'Print ssh commands for latest running instances', SluggerDeploys::SshCommand
subcommand ['autoscaling', 'as'], 'Create autoscaling group', SluggerDeploys::AutoScalingCommand
end
| require 'rubygems'
require 'aerosol'
require 'clamp'
class Aerosol::AbstractCommand < Clamp::Command
option ['-f', '--file'], 'FILE', 'aerosol file to read', :default => 'aerosol.rb', :attribute_name => :file
def execute
if File.exist?(file)
Aerosol.load_file = file
else
raise 'Could not find an aerosol file!'
end
end
end
class Aerosol::SshCommand < Aerosol::AbstractCommand
option ['-r', '--run'], :flag, 'run first ssh command', :attribute_name => :run_first
parameter 'DEPLOY', 'the deploy to list commands for', :attribute_name => :deploy_name
def execute
super
if deploy = Aerosol.deploy(deploy_name.to_sym)
ssh_commands = deploy.generate_ssh_commands
raise 'No instances to ssh too!' if ssh_commands.empty?
ssh_commands.each do |ssh_command|
puts ssh_command
end
if run_first?
system(ssh_commands.first)
end
end
end
end
class Aerosol::Cli < Aerosol::AbstractCommand
subcommand ['ssh', 's'], 'Print ssh commands for latest running instances', Aerosol::SshCommand
end
| Switch to Aerosol. Make just SSH for now | Switch to Aerosol. Make just SSH for now
| Ruby | mit | swipely/aerosol | ruby | ## Code Before:
require 'rubygems'
require 'slugger_deploys'
require 'clamp'
class SluggerDeploys::AbstractCommand < Clamp::Command
option ['-f', '--file'], 'FILE', 'deploys file to read', :default => 'deploys.rb', :attribute_name => :file
def execute
if File.exist?(file)
SluggerDeploys.load_file = file
else
raise 'Could not find a deploys file!'
end
end
end
class SluggerDeploys::SshCommand < SluggerDeploys::AbstractCommand
option ['-r', '--run'], :flag, 'run first ssh command', :attribute_name => :run_first
parameter 'DEPLOY', 'the deploy to list commands for', :attribute_name => :deploy_name
def execute
super
if deploy = SluggerDeploys.deploy(deploy_name.to_sym)
ssh_commands = deploy.generate_ssh_commands
raise 'No instances to ssh too!' if ssh_commands.empty?
ssh_commands.each do |ssh_command|
puts ssh_command
end
if run_first?
system(ssh_commands.first)
end
end
end
end
class SluggerDeploys::AutoScalingCommand < SluggerDeploys::AbstractCommand
parameter 'AUTOSCALING_GROUP', 'the auto scaling group to create', :attribute_name => :autoscaling_name
def execute
super
if autoscaling = SluggerDeploys.auto_scaling(autoscaling_name.to_sym)
autoscaling.create
end
end
end
class SluggerDeploys::Cli < SluggerDeploys::AbstractCommand
subcommand ['ssh', 's'], 'Print ssh commands for latest running instances', SluggerDeploys::SshCommand
subcommand ['autoscaling', 'as'], 'Create autoscaling group', SluggerDeploys::AutoScalingCommand
end
## Instruction:
Switch to Aerosol. Make just SSH for now
## Code After:
require 'rubygems'
require 'aerosol'
require 'clamp'
class Aerosol::AbstractCommand < Clamp::Command
option ['-f', '--file'], 'FILE', 'aerosol file to read', :default => 'aerosol.rb', :attribute_name => :file
def execute
if File.exist?(file)
Aerosol.load_file = file
else
raise 'Could not find an aerosol file!'
end
end
end
class Aerosol::SshCommand < Aerosol::AbstractCommand
option ['-r', '--run'], :flag, 'run first ssh command', :attribute_name => :run_first
parameter 'DEPLOY', 'the deploy to list commands for', :attribute_name => :deploy_name
def execute
super
if deploy = Aerosol.deploy(deploy_name.to_sym)
ssh_commands = deploy.generate_ssh_commands
raise 'No instances to ssh too!' if ssh_commands.empty?
ssh_commands.each do |ssh_command|
puts ssh_command
end
if run_first?
system(ssh_commands.first)
end
end
end
end
class Aerosol::Cli < Aerosol::AbstractCommand
subcommand ['ssh', 's'], 'Print ssh commands for latest running instances', Aerosol::SshCommand
end
| require 'rubygems'
- require 'slugger_deploys'
+ require 'aerosol'
require 'clamp'
- class SluggerDeploys::AbstractCommand < Clamp::Command
? ^^^^^ ^^^ ---
+ class Aerosol::AbstractCommand < Clamp::Command
? ^ ^^^
- option ['-f', '--file'], 'FILE', 'deploys file to read', :default => 'deploys.rb', :attribute_name => :file
? ^ ^ --- ^ ^ ---
+ option ['-f', '--file'], 'FILE', 'aerosol file to read', :default => 'aerosol.rb', :attribute_name => :file
? ^ ^^^^ ^ ^^^^
def execute
if File.exist?(file)
- SluggerDeploys.load_file = file
? ^^^^^ ^^^ ---
+ Aerosol.load_file = file
? ^ ^^^
else
- raise 'Could not find a deploys file!'
? ^ ^ ---
+ raise 'Could not find an aerosol file!'
? + ^ ^^^^
end
end
end
- class SluggerDeploys::SshCommand < SluggerDeploys::AbstractCommand
+ class Aerosol::SshCommand < Aerosol::AbstractCommand
option ['-r', '--run'], :flag, 'run first ssh command', :attribute_name => :run_first
parameter 'DEPLOY', 'the deploy to list commands for', :attribute_name => :deploy_name
def execute
super
- if deploy = SluggerDeploys.deploy(deploy_name.to_sym)
? ^^^^^ ^^^ ---
+ if deploy = Aerosol.deploy(deploy_name.to_sym)
? ^ ^^^
ssh_commands = deploy.generate_ssh_commands
raise 'No instances to ssh too!' if ssh_commands.empty?
ssh_commands.each do |ssh_command|
puts ssh_command
end
if run_first?
system(ssh_commands.first)
end
end
end
end
+ class Aerosol::Cli < Aerosol::AbstractCommand
+ subcommand ['ssh', 's'], 'Print ssh commands for latest running instances', Aerosol::SshCommand
- class SluggerDeploys::AutoScalingCommand < SluggerDeploys::AbstractCommand
- parameter 'AUTOSCALING_GROUP', 'the auto scaling group to create', :attribute_name => :autoscaling_name
-
- def execute
- super
- if autoscaling = SluggerDeploys.auto_scaling(autoscaling_name.to_sym)
- autoscaling.create
- end
- end
end
- class SluggerDeploys::Cli < SluggerDeploys::AbstractCommand
- subcommand ['ssh', 's'], 'Print ssh commands for latest running instances', SluggerDeploys::SshCommand
- subcommand ['autoscaling', 'as'], 'Create autoscaling group', SluggerDeploys::AutoScalingCommand
- end
- | 30 | 0.566038 | 9 | 21 |
396680a5f6418d8591d7191a730f0ac070e28edb | modules/mod_admin/templates/admin_logon.tpl | modules/mod_admin/templates/admin_logon.tpl | {% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page="/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
| {% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page=page|default:"/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
| Fix redirect to admin page when using admin logon form | mod_admin: Fix redirect to admin page when using admin logon form
Using the new admin logon form overwrote the "page" argument always to
redirect to /admin. This patch fixes that.
Fixes #488
| Smarty | apache-2.0 | erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta,erlanger-ru/erlanger-ru.meta | smarty | ## Code Before:
{% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page="/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
## Instruction:
mod_admin: Fix redirect to admin page when using admin logon form
Using the new admin logon form overwrote the "page" argument always to
redirect to /admin. This patch fixes that.
Fixes #488
## Code After:
{% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
{% include "_logon_form.tpl" page=page|default:"/admin" hide_title %}
</div>
</div>
</div>
{% endblock %}
| {% extends "admin_base.tpl" %}
{% block title %}
{_ Admin log on _}
{% endblock %}
{% block bodyclass %}noframe{% endblock %}
{% block navigation %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://{{ m.site.hostname }}" title="{_ visit site _}"><img alt="zotonic logo" src="/lib/images/admin_zotonic.png" width="106" height="20"></a>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="widget admin-logon">
<h3 class="widget-header">{_ Log on to _} {{ m.config.site.title.value|default:"Zotonic" }}</h3>
<div class="widget-content">
<div id="logon_error"></div>
- {% include "_logon_form.tpl" page="/admin" hide_title %}
+ {% include "_logon_form.tpl" page=page|default:"/admin" hide_title %}
? +++++++++++++
</div>
</div>
</div>
{% endblock %} | 2 | 0.071429 | 1 | 1 |
001fe9dec0519b52d24b576a4b2ae1eaee1d6346 | .travis.yml | .travis.yml | language: ruby
rvm:
- 2.4.0
addons:
postgresql: "9.4"
service:
- postgresql
before_install:
- gem install bundler
install:
- bundle install
before_script:
- RAILS_ENV=test bundle exec rails db:create
- RAILS_ENV=test bundle exec rails db:migrate
script:
- bundle exec rspec
| branches:
only:
- master
language: ruby
rvm:
- 2.4.0
addons:
postgresql: "9.4"
service:
- postgresql
before_install:
- gem install bundler
install:
- bundle install
before_script:
- RAILS_ENV=test bundle exec rails db:create
- RAILS_ENV=test bundle exec rails db:migrate
script:
- bundle exec rspec
| Build only on master branch | Build only on master branch
| YAML | mit | dylanninin/tower-events,dylanninin/tower-events,dylanninin/tower-events | yaml | ## Code Before:
language: ruby
rvm:
- 2.4.0
addons:
postgresql: "9.4"
service:
- postgresql
before_install:
- gem install bundler
install:
- bundle install
before_script:
- RAILS_ENV=test bundle exec rails db:create
- RAILS_ENV=test bundle exec rails db:migrate
script:
- bundle exec rspec
## Instruction:
Build only on master branch
## Code After:
branches:
only:
- master
language: ruby
rvm:
- 2.4.0
addons:
postgresql: "9.4"
service:
- postgresql
before_install:
- gem install bundler
install:
- bundle install
before_script:
- RAILS_ENV=test bundle exec rails db:create
- RAILS_ENV=test bundle exec rails db:migrate
script:
- bundle exec rspec
| + branches:
+ only:
+ - master
+
language: ruby
rvm:
- 2.4.0
addons:
postgresql: "9.4"
service:
- postgresql
before_install:
- gem install bundler
install:
- bundle install
before_script:
- RAILS_ENV=test bundle exec rails db:create
- RAILS_ENV=test bundle exec rails db:migrate
script:
- bundle exec rspec | 4 | 0.173913 | 4 | 0 |
36ae6fd11aefa68cc66487e71135bc92ec17cff7 | src/components/pages/not-found-page.jsx | src/components/pages/not-found-page.jsx | /*
OpenFisca -- A versatile microsimulation software
By: OpenFisca Team <contact@openfisca.fr>
Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
https://github.com/openfisca
This file is part of OpenFisca.
OpenFisca is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
OpenFisca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import DocumentTitle from "react-document-title";
import React from "react";
var NotFoundPage = React.createClass({
render() {
return (
<DocumentTitle title="Page non trouvée">
<h1>Page non trouvée</h1>
</DocumentTitle>
);
},
});
export default NotFoundPage;
| /*
OpenFisca -- A versatile microsimulation software
By: OpenFisca Team <contact@openfisca.fr>
Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
https://github.com/openfisca
This file is part of OpenFisca.
OpenFisca is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
OpenFisca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import DocumentTitle from "react-document-title";
import React from "react";
var NotFoundPage = React.createClass({
render() {
return (
<DocumentTitle title="Page non trouvée - Explorateur de la légisation">
<h1>Page non trouvée</h1>
</DocumentTitle>
);
},
});
export default NotFoundPage;
| Enhance not found page title | Enhance not found page title
| JSX | agpl-3.0 | openfisca/legislation-explorer | jsx | ## Code Before:
/*
OpenFisca -- A versatile microsimulation software
By: OpenFisca Team <contact@openfisca.fr>
Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
https://github.com/openfisca
This file is part of OpenFisca.
OpenFisca is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
OpenFisca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import DocumentTitle from "react-document-title";
import React from "react";
var NotFoundPage = React.createClass({
render() {
return (
<DocumentTitle title="Page non trouvée">
<h1>Page non trouvée</h1>
</DocumentTitle>
);
},
});
export default NotFoundPage;
## Instruction:
Enhance not found page title
## Code After:
/*
OpenFisca -- A versatile microsimulation software
By: OpenFisca Team <contact@openfisca.fr>
Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
https://github.com/openfisca
This file is part of OpenFisca.
OpenFisca is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
OpenFisca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import DocumentTitle from "react-document-title";
import React from "react";
var NotFoundPage = React.createClass({
render() {
return (
<DocumentTitle title="Page non trouvée - Explorateur de la légisation">
<h1>Page non trouvée</h1>
</DocumentTitle>
);
},
});
export default NotFoundPage;
| /*
OpenFisca -- A versatile microsimulation software
By: OpenFisca Team <contact@openfisca.fr>
Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
https://github.com/openfisca
This file is part of OpenFisca.
OpenFisca is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
OpenFisca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import DocumentTitle from "react-document-title";
import React from "react";
var NotFoundPage = React.createClass({
render() {
return (
- <DocumentTitle title="Page non trouvée">
+ <DocumentTitle title="Page non trouvée - Explorateur de la légisation">
<h1>Page non trouvée</h1>
</DocumentTitle>
);
},
});
export default NotFoundPage; | 2 | 0.04878 | 1 | 1 |
c8581cd1c4af091b3453c339a08179f297b87d75 | pages/templates/admin/pages/page/change_list_table.html | pages/templates/admin/pages/page/change_list_table.html | {% load i18n pages_tags %}
<table cellspacing="0" id="page-table-dnd">
<thead>
<tr>
<th>
<input id="action-toggle" type="checkbox" style="display: inline;"/>
</th>
<th class="title-cell">{% trans "title" %}</th>
<th class="language-cell">{% trans "languages" %}</th>
<th class="last-modification-cell">{% trans "last modification" %}</th>
<th class="publish-cell">{% trans "published" %}</th>
<th class="template-cell">{% trans "template" %}</th>
<th class="author-cell">{% trans "author" %}</th>
</tr>
</thead>
<tbody>
{% for page in pages %}
{% pages_admin_menu page %}
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
| {% load i18n pages_tags %}
<table cellspacing="0" id="page-table-dnd">
<thead>
<tr>
<th>
<div class="text"><span><input id="action-toggle" type="checkbox" style="display: inline-block;" /></span></div>
</th>
<th class="title-cell"><div class="text"><span>{% trans "title" %}</span></div></th>
<th class="language-cell">{<div class="text"><span>% trans "languages" %}</span></div></th>
<th class="last-modification-cell"><div class="text"><span>{% trans "last modification" %}</span></div></th>
<th class="publish-cell"><div class="text"><span>{% trans "published" %}</span></div></th>
<th class="template-cell"><div class="text"><span>{% trans "template" %}</span></div></th>
<th class="author-cell"><div class="text"><span>{% trans "author" %}</span></div></th>
</tr>
</thead>
<tbody>
{% for page in pages %}
{% pages_admin_menu page %}
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
| Update the admin template for Django 1.4 | Update the admin template for Django 1.4
| HTML | bsd-3-clause | remik/django-page-cms,remik/django-page-cms,pombredanne/django-page-cms-1,batiste/django-page-cms,akaihola/django-page-cms,batiste/django-page-cms,pombredanne/django-page-cms-1,batiste/django-page-cms,akaihola/django-page-cms,akaihola/django-page-cms,remik/django-page-cms,pombredanne/django-page-cms-1,remik/django-page-cms | html | ## Code Before:
{% load i18n pages_tags %}
<table cellspacing="0" id="page-table-dnd">
<thead>
<tr>
<th>
<input id="action-toggle" type="checkbox" style="display: inline;"/>
</th>
<th class="title-cell">{% trans "title" %}</th>
<th class="language-cell">{% trans "languages" %}</th>
<th class="last-modification-cell">{% trans "last modification" %}</th>
<th class="publish-cell">{% trans "published" %}</th>
<th class="template-cell">{% trans "template" %}</th>
<th class="author-cell">{% trans "author" %}</th>
</tr>
</thead>
<tbody>
{% for page in pages %}
{% pages_admin_menu page %}
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
## Instruction:
Update the admin template for Django 1.4
## Code After:
{% load i18n pages_tags %}
<table cellspacing="0" id="page-table-dnd">
<thead>
<tr>
<th>
<div class="text"><span><input id="action-toggle" type="checkbox" style="display: inline-block;" /></span></div>
</th>
<th class="title-cell"><div class="text"><span>{% trans "title" %}</span></div></th>
<th class="language-cell">{<div class="text"><span>% trans "languages" %}</span></div></th>
<th class="last-modification-cell"><div class="text"><span>{% trans "last modification" %}</span></div></th>
<th class="publish-cell"><div class="text"><span>{% trans "published" %}</span></div></th>
<th class="template-cell"><div class="text"><span>{% trans "template" %}</span></div></th>
<th class="author-cell"><div class="text"><span>{% trans "author" %}</span></div></th>
</tr>
</thead>
<tbody>
{% for page in pages %}
{% pages_admin_menu page %}
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
| {% load i18n pages_tags %}
<table cellspacing="0" id="page-table-dnd">
<thead>
<tr>
<th>
- <input id="action-toggle" type="checkbox" style="display: inline;"/>
+ <div class="text"><span><input id="action-toggle" type="checkbox" style="display: inline-block;" /></span></div>
? ++++++++++++++++++++++++ ++++++ + +++++++++++++
</th>
- <th class="title-cell">{% trans "title" %}</th>
+ <th class="title-cell"><div class="text"><span>{% trans "title" %}</span></div></th>
? ++++++++++++++++++++++++ +++++++++++++
- <th class="language-cell">{% trans "languages" %}</th>
+ <th class="language-cell">{<div class="text"><span>% trans "languages" %}</span></div></th>
? ++++++++++++++++++++++++ +++++++++++++
- <th class="last-modification-cell">{% trans "last modification" %}</th>
+ <th class="last-modification-cell"><div class="text"><span>{% trans "last modification" %}</span></div></th>
? ++++++++++++++++++++++++ +++++++++++++
- <th class="publish-cell">{% trans "published" %}</th>
+ <th class="publish-cell"><div class="text"><span>{% trans "published" %}</span></div></th>
? ++++++++++++++++++++++++ +++++++++++++
- <th class="template-cell">{% trans "template" %}</th>
+ <th class="template-cell"><div class="text"><span>{% trans "template" %}</span></div></th>
? ++++++++++++++++++++++++ +++++++++++++
- <th class="author-cell">{% trans "author" %}</th>
+ <th class="author-cell"><div class="text"><span>{% trans "author" %}</span></div></th>
? ++++++++++++++++++++++++ +++++++++++++
</tr>
</thead>
<tbody>
{% for page in pages %}
{% pages_admin_menu page %}
{% endfor %}
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
});
</script> | 14 | 0.5 | 7 | 7 |
a3357cd4bb0859f480fa91f50604a2f129431096 | eduid_signup/vccs.py | eduid_signup/vccs.py | from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password. The password is returned so that it can be conveyed to the user.
:param settings: settings dict
:param credential_id: VCCS credential_id as string
:param email: user e-mail address as string
:return: (password, salt) both strings
"""
password = pwgen(settings.get('password_length'), no_symbols = True)
factor = vccs_client.VCCSPasswordFactor(password,
credential_id = credential_id)
vccs = vccs_client.VCCSClient(base_url = settings.get('vccs_url'))
vccs.add_credentials(email, [factor])
return (_human_readable(password), factor.salt)
def _human_readable(password):
"""
Format a random password more readable to humans (groups of four characters).
:param password: string
:return: readable password as string
:rtype: string
"""
regexp = '.{,4}'
parts = findall(regexp, password)
return ' '.join(parts)
| from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password. The password is returned so that it can be conveyed to the user.
:param settings: settings dict
:param credential_id: VCCS credential_id as string
:param email: user e-mail address as string
:return: (password, salt) both strings
"""
password = pwgen(settings.get('password_length'), no_capitalize = True, no_symbols = True)
factor = vccs_client.VCCSPasswordFactor(password,
credential_id = credential_id)
vccs = vccs_client.VCCSClient(base_url = settings.get('vccs_url'))
vccs.add_credentials(email, [factor])
return (_human_readable(password), factor.salt)
def _human_readable(password):
"""
Format a random password more readable to humans (groups of four characters).
:param password: string
:return: readable password as string
:rtype: string
"""
regexp = '.{,4}'
parts = findall(regexp, password)
return ' '.join(parts)
| Exclude upper case letters from generated passwords. | Exclude upper case letters from generated passwords.
12 character passwords from the set a-z0-9 have more bits of
entropy (62) than 10 character passwords from the set
a-zA-Z0-9 (60), and are probably perceived as nicer by the
users too (less ambiguity, easier to type on smartphones and
the like).
| Python | bsd-3-clause | SUNET/eduid-signup,SUNET/eduid-signup,SUNET/eduid-signup | python | ## Code Before:
from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password. The password is returned so that it can be conveyed to the user.
:param settings: settings dict
:param credential_id: VCCS credential_id as string
:param email: user e-mail address as string
:return: (password, salt) both strings
"""
password = pwgen(settings.get('password_length'), no_symbols = True)
factor = vccs_client.VCCSPasswordFactor(password,
credential_id = credential_id)
vccs = vccs_client.VCCSClient(base_url = settings.get('vccs_url'))
vccs.add_credentials(email, [factor])
return (_human_readable(password), factor.salt)
def _human_readable(password):
"""
Format a random password more readable to humans (groups of four characters).
:param password: string
:return: readable password as string
:rtype: string
"""
regexp = '.{,4}'
parts = findall(regexp, password)
return ' '.join(parts)
## Instruction:
Exclude upper case letters from generated passwords.
12 character passwords from the set a-z0-9 have more bits of
entropy (62) than 10 character passwords from the set
a-zA-Z0-9 (60), and are probably perceived as nicer by the
users too (less ambiguity, easier to type on smartphones and
the like).
## Code After:
from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password. The password is returned so that it can be conveyed to the user.
:param settings: settings dict
:param credential_id: VCCS credential_id as string
:param email: user e-mail address as string
:return: (password, salt) both strings
"""
password = pwgen(settings.get('password_length'), no_capitalize = True, no_symbols = True)
factor = vccs_client.VCCSPasswordFactor(password,
credential_id = credential_id)
vccs = vccs_client.VCCSClient(base_url = settings.get('vccs_url'))
vccs.add_credentials(email, [factor])
return (_human_readable(password), factor.salt)
def _human_readable(password):
"""
Format a random password more readable to humans (groups of four characters).
:param password: string
:return: readable password as string
:rtype: string
"""
regexp = '.{,4}'
parts = findall(regexp, password)
return ' '.join(parts)
| from pwgen import pwgen
from re import findall
import vccs_client
def generate_password(settings, credential_id, email):
"""
Generate a new password credential and add it to the VCCS authentication backend.
The salt returned needs to be saved for use in subsequent authentications using
this password. The password is returned so that it can be conveyed to the user.
:param settings: settings dict
:param credential_id: VCCS credential_id as string
:param email: user e-mail address as string
:return: (password, salt) both strings
"""
- password = pwgen(settings.get('password_length'), no_symbols = True)
+ password = pwgen(settings.get('password_length'), no_capitalize = True, no_symbols = True)
? ++++++++++++++++++++++
factor = vccs_client.VCCSPasswordFactor(password,
credential_id = credential_id)
vccs = vccs_client.VCCSClient(base_url = settings.get('vccs_url'))
vccs.add_credentials(email, [factor])
return (_human_readable(password), factor.salt)
def _human_readable(password):
"""
Format a random password more readable to humans (groups of four characters).
:param password: string
:return: readable password as string
:rtype: string
"""
regexp = '.{,4}'
parts = findall(regexp, password)
return ' '.join(parts) | 2 | 0.052632 | 1 | 1 |
db14ed2c23b3838796e648faade2c73b786d61ff | tartpy/eventloop.py | tartpy/eventloop.py |
import queue
import sys
import threading
import time
import traceback
from .singleton import Singleton
def _format_exception(exc_info):
"""Create a message with details on the exception."""
exc_type, exc_value, exc_tb = exc_info
return {'exception': {'type': exc_type,
'value': exc_value,
'traceback': exc_tb},
'traceback': traceback.format_exception(*exc_info)}
class EventLoop(object, metaclass=Singleton):
"""A generic event loop object."""
def __init__(self):
self.queue = queue.Queue()
def schedule(self, event):
"""Schedule an event.
The events have the form::
(event, error)
where `event` is a thunk and `error` is called with an
exception message (output of `_format_exception`) if there is
an error when executing `event`.
"""
self.queue.put(event)
def stop(self):
"""Stop the loop."""
pass
def run_step(self, block=True):
"""Process one event."""
ev, error = self.queue.get(block=block)
try:
ev()
except Exception as exc:
error(_format_exception(sys.exc_info()))
def run(self):
"""Process all events in the queue."""
try:
while True:
self.run_step(block=False)
except queue.Empty:
return
|
import queue
import sys
import threading
import time
import traceback
from .singleton import Singleton
def exception_message():
"""Create a message with details on the exception."""
exc_type, exc_value, exc_tb = exc_info = sys.exc_info()
return {'exception': {'type': exc_type,
'value': exc_value,
'traceback': exc_tb},
'traceback': traceback.format_exception(*exc_info)}
class EventLoop(object, metaclass=Singleton):
"""A generic event loop object."""
def __init__(self):
self.queue = queue.Queue()
def schedule(self, event):
"""Schedule an event.
The events have the form::
(event, error)
where `event` is a thunk and `error` is called with an
exception message (output of `exception_message`) if there is
an error when executing `event`.
"""
self.queue.put(event)
def stop(self):
"""Stop the loop."""
pass
def run_step(self, block=True):
"""Process one event."""
ev, error = self.queue.get(block=block)
try:
ev()
except Exception as exc:
error(exception_message())
def run(self):
"""Process all events in the queue."""
try:
while True:
self.run_step(block=False)
except queue.Empty:
return
| Make exception message builder a nicer function | Make exception message builder a nicer function
It is used by clients in other modules. | Python | mit | waltermoreira/tartpy | python | ## Code Before:
import queue
import sys
import threading
import time
import traceback
from .singleton import Singleton
def _format_exception(exc_info):
"""Create a message with details on the exception."""
exc_type, exc_value, exc_tb = exc_info
return {'exception': {'type': exc_type,
'value': exc_value,
'traceback': exc_tb},
'traceback': traceback.format_exception(*exc_info)}
class EventLoop(object, metaclass=Singleton):
"""A generic event loop object."""
def __init__(self):
self.queue = queue.Queue()
def schedule(self, event):
"""Schedule an event.
The events have the form::
(event, error)
where `event` is a thunk and `error` is called with an
exception message (output of `_format_exception`) if there is
an error when executing `event`.
"""
self.queue.put(event)
def stop(self):
"""Stop the loop."""
pass
def run_step(self, block=True):
"""Process one event."""
ev, error = self.queue.get(block=block)
try:
ev()
except Exception as exc:
error(_format_exception(sys.exc_info()))
def run(self):
"""Process all events in the queue."""
try:
while True:
self.run_step(block=False)
except queue.Empty:
return
## Instruction:
Make exception message builder a nicer function
It is used by clients in other modules.
## Code After:
import queue
import sys
import threading
import time
import traceback
from .singleton import Singleton
def exception_message():
"""Create a message with details on the exception."""
exc_type, exc_value, exc_tb = exc_info = sys.exc_info()
return {'exception': {'type': exc_type,
'value': exc_value,
'traceback': exc_tb},
'traceback': traceback.format_exception(*exc_info)}
class EventLoop(object, metaclass=Singleton):
"""A generic event loop object."""
def __init__(self):
self.queue = queue.Queue()
def schedule(self, event):
"""Schedule an event.
The events have the form::
(event, error)
where `event` is a thunk and `error` is called with an
exception message (output of `exception_message`) if there is
an error when executing `event`.
"""
self.queue.put(event)
def stop(self):
"""Stop the loop."""
pass
def run_step(self, block=True):
"""Process one event."""
ev, error = self.queue.get(block=block)
try:
ev()
except Exception as exc:
error(exception_message())
def run(self):
"""Process all events in the queue."""
try:
while True:
self.run_step(block=False)
except queue.Empty:
return
|
import queue
import sys
import threading
import time
import traceback
from .singleton import Singleton
- def _format_exception(exc_info):
+ def exception_message():
"""Create a message with details on the exception."""
- exc_type, exc_value, exc_tb = exc_info
+ exc_type, exc_value, exc_tb = exc_info = sys.exc_info()
? +++++++++++++++++
return {'exception': {'type': exc_type,
'value': exc_value,
'traceback': exc_tb},
'traceback': traceback.format_exception(*exc_info)}
class EventLoop(object, metaclass=Singleton):
"""A generic event loop object."""
def __init__(self):
self.queue = queue.Queue()
def schedule(self, event):
"""Schedule an event.
The events have the form::
(event, error)
where `event` is a thunk and `error` is called with an
- exception message (output of `_format_exception`) if there is
? --------
+ exception message (output of `exception_message`) if there is
? ++++++++
an error when executing `event`.
"""
self.queue.put(event)
def stop(self):
"""Stop the loop."""
pass
def run_step(self, block=True):
"""Process one event."""
ev, error = self.queue.get(block=block)
try:
ev()
except Exception as exc:
- error(_format_exception(sys.exc_info()))
+ error(exception_message())
def run(self):
"""Process all events in the queue."""
try:
while True:
self.run_step(block=False)
except queue.Empty:
return
| 8 | 0.133333 | 4 | 4 |
92e73bf990a4bacf99fdfec4011f43895aba43f6 | Cargo.toml | Cargo.toml | [package]
name = "snes-apu"
version = "0.1.10"
authors = ["ferris <jake@fusetools.com>"]
description = "A Super Nintendo audio unit emulator."
homepage = "https://github.com/emu-rs/snes-apu"
repository = "https://github.com/emu-rs/snes-apu"
keywords = ["snes", "super", "nintendo", "spc", "emulator"]
license = "BSD-2-Clause"
[dependencies]
emu = "0.1.1"
spc = "0.1.0" | [package]
name = "snes-apu"
version = "0.1.10"
authors = ["ferris <jake@fusetools.com>"]
description = "A Super Nintendo audio unit emulator."
homepage = "https://github.com/emu-rs/snes-apu"
repository = "https://github.com/emu-rs/snes-apu"
keywords = ["snes", "super", "nintendo", "spc", "emulator"]
license = "BSD-2-Clause"
[dependencies]
spc = "0.1.0"
[dev-dependencies]
emu = "0.1.1" | Make emu a dev-dependency while it only supports OS X | Make emu a dev-dependency while it only supports OS X
| TOML | bsd-2-clause | emu-rs/snes-apu,yupferris/samurai-pizza-cats,yupferris/samurai_pizza_cats | toml | ## Code Before:
[package]
name = "snes-apu"
version = "0.1.10"
authors = ["ferris <jake@fusetools.com>"]
description = "A Super Nintendo audio unit emulator."
homepage = "https://github.com/emu-rs/snes-apu"
repository = "https://github.com/emu-rs/snes-apu"
keywords = ["snes", "super", "nintendo", "spc", "emulator"]
license = "BSD-2-Clause"
[dependencies]
emu = "0.1.1"
spc = "0.1.0"
## Instruction:
Make emu a dev-dependency while it only supports OS X
## Code After:
[package]
name = "snes-apu"
version = "0.1.10"
authors = ["ferris <jake@fusetools.com>"]
description = "A Super Nintendo audio unit emulator."
homepage = "https://github.com/emu-rs/snes-apu"
repository = "https://github.com/emu-rs/snes-apu"
keywords = ["snes", "super", "nintendo", "spc", "emulator"]
license = "BSD-2-Clause"
[dependencies]
spc = "0.1.0"
[dev-dependencies]
emu = "0.1.1" | [package]
name = "snes-apu"
version = "0.1.10"
authors = ["ferris <jake@fusetools.com>"]
description = "A Super Nintendo audio unit emulator."
homepage = "https://github.com/emu-rs/snes-apu"
repository = "https://github.com/emu-rs/snes-apu"
keywords = ["snes", "super", "nintendo", "spc", "emulator"]
license = "BSD-2-Clause"
[dependencies]
+ spc = "0.1.0"
+
+ [dev-dependencies]
emu = "0.1.1"
- spc = "0.1.0" | 4 | 0.307692 | 3 | 1 |
5f6a831bdae5eb1042e24ff033ade63a6af03afb | src/Illuminate/Database/Connectors/SQLiteConnector.php | src/Illuminate/Database/Connectors/SQLiteConnector.php | <?php namespace Illuminate\Database\Connectors;
class SQLiteConnector extends Connector implements ConnectorInterface {
/**
* Establish a database connection.
*
* @param array $options
* @return PDO
*/
public function connect(array $config)
{
$options = $this->getOptions($config);
// SQLite supports "in-memory" databases that only last as long as the owning
// connection does. These are useful for tests or for short lifetime store
// querying. In-memory databases may only have a single open connection.
if ($config['database'] == ':memory:')
{
return $this->createConnection('sqlite::memory:', $config, $options);
}
$path = realpath($config['database']);
return $this->createConnection("sqlite:{$path}", $config, $options);
}
} | <?php namespace Illuminate\Database\Connectors;
class SQLiteConnector extends Connector implements ConnectorInterface {
/**
* Establish a database connection.
*
* @param array $options
* @return PDO
*/
public function connect(array $config)
{
$options = $this->getOptions($config);
// SQLite supports "in-memory" databases that only last as long as the owning
// connection does. These are useful for tests or for short lifetime store
// querying. In-memory databases may only have a single open connection.
if ($config['database'] == ':memory:')
{
return $this->createConnection('sqlite::memory:', $config, $options);
}
$path = realpath($config['database']);
// Here we'll verify that the SQLite database exists before we gooing further
// as the developer probably wants to know if the database exists and this
// SQLite driver will not throw any exception if it does not by default.
if ($path === false)
{
throw new \InvalidArgumentException("Database does not exist.");
}
return $this->createConnection("sqlite:{$path}", $config, $options);
}
} | Throw exception if SQLite database doesn't exist. | Throw exception if SQLite database doesn't exist.
| PHP | mit | lguima/framework,michael-repka/framework,Nikita240/framework,sileence/laravel-framework,kevindoole/framework,nhowell/laravel-framework,Wellington475/framework,lucasmichot/framework,antonioribeiro/framework,n7olkachev/framework,crazycodr/framework,maddhatter/framework,jmarcher/framework,hosmelq/framework,anomalylabs/framework,bdsoha/framework,rodrigopedra/framework,titiushko/framework,AllysonSilva/LaravelKernel,KhaledSMQ/framework,sileence/framework,branall1/framework,genvideo/framework,aeryaguzov/framework,proshanto/framework,mateusjatenee/framework,Nikita240/framework,Feijs/framework,piokom123/framework,proshanto/framework,BePsvPT/framework,Loravel/framework,AndreasHeiberg/framework,sileence/framework,vlakoff/framework,tuupke/framework,mlantz/framework,mul14/laravel-framework,scrubmx/framework,rodrigopedra/framework,thomasruiz/laravel-framework,timfeid/framework-1,john-main-croud/framework,franzliedke/framework,tadejkan/framework,kelixlabs/laravel-framework,likerRr/framework,neva-dev/laravel-framework,shandy05/framework,xiphiaz/framework,mul14/laravel-framework,mortenhauberg/framework,SelimSalihovic/framework,joko-wandiro/framework,rkgrep/framework,filipeaclima/framework,RobvH/framework,RatkoR/framework,jerguslejko/framework,alepeino/framework,jchamberlain/framework,cybercog/framework,harrygr/framework,srenauld/framework,peterpan666/framework,tillkruss/framework,patrickcarlohickman/framework,avi123/framework,tomcastleman/framework,djtarazona/laravel-framework,garygreen/framework,colindecarlo/framework,ncaneldiee/laravel-framework,jarnovanleeuwen/framework,mickaelandrieu/framework,aeryaguzov/framework,KhaledSMQ/framework,antonioribeiro/framework,ironxu/framework,andersonef/framework,lucasmichot/laravel--framework,kevinsimard/framework,alnutile/framework,nahid/framework,brti/framework,euoia/framework,behzadsh/framework,chungth/laravel-framework,leo108/laravel_framework,bancur/framework,mul14/laravel-framework,tills13/framework,JosephSilber/framework,cviebrock/framework,usm4n/laravel-patch,windevalley/framework,claar/framework,moura137/framework,jerguslejko/framework,martinssipenko/framework,adamwathan/framework,olsgreen/framework,ExpoTV/framework,halaei/framework,tomzx/laravex,djtarazona/laravel-framework,CurosMJ/framework,max-kovpak/framework,Elandril/framework,litvinchuk/framework,jtgrimes/framework,stidges/framework,hafezdivandari/framework,pakogn/framework,jack-webster/framework,joecohens/framework,antonybudianto/framework,mxaddict/framework,samuel-cloete/framework,ExpoTV/framework,n7olkachev/framework,keripix/laravel42x,srmkliveforks/framework,rentalhost/framework,jwdeitch/framework,simensen/laravel-framework,j42/framework,Wellington475/framework,orrd/framework,pouya-parsa/framework,nelson6e65/framework,JesusContributions/laravel-framework,simensen/laravel-framework,Zenbu-Social/framework,JosephSilber/framework,FooBarQuaxx/framework,pakogn/framework,phroggyy/framework,titiushko/framework,MedAhamada/framework,rentalhost/framework,TheGIBSON/framework,isiryder/framework,anteriovieira/framework,lucasmichot/laravel--framework,Modelizer/framework,shandy05/framework,christoffertyrefors/framework,jwdeitch/framework,stidges/framework,hpolthof/framework,noikiy/framework-1,samlev/framework,EspadaV8/framework,alnutile/framework,JesusContributions/laravel-framework,fisharebest/framework,rsanchez/laravel-framework,mcgrogan91/framework,atorscho/framework,loduis/laravel-framework,rogue780/framework,HipsterJazzbo/framework,andersonef/framework,Talean-dev/framework,moura137/framework,mmauri04/framework,joel-james/framework,patrickcarlohickman/framework,fragglebob/framework,jarektkaczyk/framework,garygreen/framework,jadz/laravel-framework-4.2.18-php7,ameliaikeda/framework,SebastianBerc/framework,rafaelbeckel/framework,bastiaan89/framework,laracasts/framework,jtgrimes/framework,lvht/framework,texnikru/laravel-framework-4,srenauld/framework,usm4n/laravel-patch,cmazx/framework,lukasgeiter/laravel-framework,antonioribeiro/framework,tomzx/framework,PantherDD/laravel-framework,devsalman/framework,cjaoude/framework,kamazee/laravel-framework,dbpolito/framework,irfanevrens/framework,captbrogers/framework,deefour/framework,jaimz22/framework,zhenkondrat/framework,lucasmichot/framework,willrowe/laravel-framework,rocketpastsix/framework,spyric/framework,keripix/laravel42x,GreenLightt/laravel-framework,anomalylabs/framework,Talean-dev/framework,djtarazona/laravel-framework,RyansForks/laravel-framework,markhemstead/framework,genvideo/framework,bdsoha/framework,EspadaV8/framework,amenk/framework,GiantCowFilms/framework,5outh/framework,fungku/framework,laravel/framework,djae138/framework,markhemstead/framework,kelixlabs/laravel-framework,Luceos/framework,ameliaikeda/framework,rodrigopedra/framework,david-ridgeonnet/framework,rogue780/framework,texnikru/laravel-framework-4,osiux/framework,cjaoude/framework,DougSisk/framework,MladenJanjetovic/framework,osiux/framework,maddhatter/framework,mbernson/framework,tills13/framework,garygreen/framework,tamnil/framework,sileence/laravel-framework,CurosMJ/framework,kamazee/laravel-framework,ps92/framework,hosmelq/framework,captbrogers/framework,hutushen222/framework,nhowell/laravel-framework,adamgoose/framework,JamesForks/framework,martinbean/laravel-framework,SelimSalihovic/framework,dan-har/framework,barryvdh/framework,Loravel/framework,fragglebob/framework,martinssipenko/framework,nelson6e65/framework,ruuter/laravel-framework,laracasts/framework,euoia/framework,yadakhov/framework,tjbp/framework,freejavaster/framework,fisharebest/framework,maxbublik/framework,arturock/framework,stevebauman/framework,joel-james/framework,Hugome/framework,n7olkachev/framework,jorgemurta/framework,bancur/framework,MarkRedeman/framework,rkgrep/framework,maxverbeek/framework,anteriovieira/framework,windevalley/framework,ps92/framework,wujingke/framework,gaaarfild/framework,ChristopheB/framework,alexhackney/framework,blazeworx/framework,valeryq/framework,wiltosoft/laravel,simensen/laravel-framework,stidges/framework,cviebrock/framework,jerguslejko/framework,joko-wandiro/framework,spyric/framework,Fenzland/laravel,reinink/framework,driesvints/framework,scrubmx/framework,mul14/laravel-framework,vlakoff/framework,MarkRedeman/framework,cviebrock/framework,jrean/framework,driesvints/framework,alexhackney/framework,kevinsimard/framework,TheGIBSON/framework,omar-dev/framework,Garbee/framework,thomasruiz/laravel-framework,maddhatter/framework,djae138/framework,danilobrinu/framework,harrygr/framework,jaimz22/framework,billmn/framework,Evertt/framework,renekoch/framework,srmkliveforks/framework,mightydes/framework,katcountiss/framework,alexgalletti/framework,cillosis/framework,SecureCloud-biz/framework,drbyte/framework,shandy05/framework,xiphiaz/framework,jaimz22/framework,rodrigopedra/framework,thbourlove/framework,smb/framework,Wellington475/framework,rap2hpoutre/framework,rap2hpoutre/framework,neva-dev/laravel-framework,ncusoho/framework,usm4n/laravel-patch,guanhui07/framework,greabock/framework,morrislaptop/framework,nahid/framework,timfeid/framework-1,freejavaster/framework,notebowl/laravel-framework,kcalliauw/framework,jmarcher/framework,halaei/framework,antonybudianto/framework,herberk/framework,pakogn/framework,smb/framework,billmn/framework,proshanto/framework,adamgoose/framework,rap2hpoutre/framework,RyansForks/laravel-framework,windevalley/framework,vlakoff/framework,loduis/laravel-framework,ImaginationSydney/Laravel,ChristopheB/framework,RobvH/framework,cjaoude/framework,maxverbeek/framework,guanhui07/framework,ezeql/framework,DougSisk/framework,mbernson/framework,alepeino/framework,hutushen222/framework,gms8994/framework,anteriovieira/framework,piokom123/framework,phanan/framework,thomasruiz/laravel-framework,zhenkondrat/framework,KhaledSMQ/framework,alexgalletti/framework,maxbublik/framework,srmkliveforks/framework,FireEngineRed/framework,wujingke/framework,vetruvet/framework,aeryaguzov/framework,tadejkan/framework,ironxu/framework,gaaarfild/framework,pouya-parsa/framework,adamwathan/framework,hpolthof/framework,rocketpastsix/framework,bytestream/framework,adamgoose/framework,deefour/framework,mateusjatenee/framework,rleger/framework,jadz/laravel-framework-4.2.18-php7,renekoch/framework,hailwood/framework,likerRr/framework,Belphemur/framework,crazycodr/framework,herberk/framework,jchamberlain/framework,colindecarlo/framework,isiryder/framework,Belphemur/framework,brti/framework,david-ridgeonnet/framework,Hugome/framework,j42/framework,MladenJanjetovic/framework,RatkoR/framework,bancur/framework,tjbp/framework,max-kovpak/framework,Evertt/framework,xiphiaz/framework,sileence/framework,RyansForks/laravel-framework,reinink/framework,tomschlick/framework,zcwilt/framework,numa-engineering/framework,tadejkan/framework,samuel-cloete/framework,halaei/framework,gms8994/framework,jarektkaczyk/framework,lguima/framework,noikiy/framework-1,bytestream/framework,behzadsh/framework,ameliaikeda/framework,rleger/framework,CurosMJ/framework,hosmelq/framework,Garbee/framework,ps92/framework,omar-dev/framework,bmitch/framework,mwain/framework,david-ridgeonnet/framework,mickaelandrieu/framework,guiwoda/framework,bobbybouwmann/framework,sebastiaanluca/framework,mlantz/framework,guiwoda/framework,laracasts/framework,bobbybouwmann/framework,tomcastleman/framework,acasar/framework,jerguslejko/framework,lucasmichot/laravel--framework,jarnovanleeuwen/framework,Fenzland/laravel,drbyte/framework,yesdevnull/framework,5outh/framework,SebastianBerc/framework,jrean/framework,dwightwatson/framework,jackson-dean/framework,JesusContributions/laravel-framework,maxbublik/framework,maxverbeek/framework,Luceos/framework,BePsvPT-Fork/framework,BePsvPT/framework,egekhter/framework,irfanevrens/framework,mcgrogan91/framework,mightydes/framework,ncusoho/framework,SecureCloud-biz/framework,HipsterJazzbo/framework,gaaarfild/framework,lvht/framework,cmazx/framework,BePsvPT-Fork/framework,ncusoho/framework,samuel-cloete/framework,laravel/framework,Modelizer/framework,crynobone/framework,BePsvPT/framework,Belphemur/framework,titiushko/framework,yesdevnull/framework,Garbee/framework,greabock/framework,tjbp/framework,tamnil/framework,litvinchuk/framework,MedAhamada/framework,ezeql/framework,lukasgeiter/laravel-framework,colindecarlo/framework,dwightwatson/framework,rsanchez/laravel-framework,phanan/framework,notebowl/laravel-framework,atorscho/framework,deefour/framework,bdsoha/framework,kamazee/laravel-framework,piokom123/framework,jack-webster/framework,nerijunior/framework,dbpolito/framework,bobbybouwmann/framework,valeryq/framework,SecureCloud-biz/framework,herberk/framework,jackson-dean/framework,cwt137/laravel-framework,bastiaan89/framework,fisharebest/framework,drbyte/framework,DougSisk/framework,sileence/laravel-framework,cybercog/framework,j42/framework,guiwoda/framework,filipeaclima/framework,genvideo/framework,phroggyy/framework,rogue780/framework,blazeworx/framework,OzanKurt/framework,tillkruss/framework,arrilot/framework,likerRr/framework,kcalliauw/framework,KluVerKamp/framework,alexgalletti/framework,ruuter/laravel-framework,tillkruss/framework,SebastianBerc/framework,Nikita240/framework,BePsvPT-Fork/framework,stidges/framework,srenauld/framework,bmitch/framework,FooBarQuaxx/framework,mwain/framework,willrowe/laravel-framework,ImaginationSydney/Laravel,AllysonSilva/LaravelKernel,blazeworx/framework,jarektkaczyk/framework,RobvH/framework,JamesForks/framework,jarnovanleeuwen/framework,christoffertyrefors/framework,GiantCowFilms/framework,bastiaan89/framework,ruuter/laravel-framework,SelimSalihovic/framework,numa-engineering/framework,crynobone/framework,cybercog/framework,freejavaster/framework,mwain/framework,tomschlick/framework,andersonef/framework,OzanKurt/framework,MedAhamada/framework,Feijs/framework,kevindoole/framework,mcgrogan91/framework,renekoch/framework,tomzx/laravex,jrean/framework,branall1/framework,dan-har/framework,litvinchuk/framework,amenk/framework,wiltosoft/laravel,miclf/framework,TheGIBSON/framework,AndreasHeiberg/framework,michael-repka/framework,acasar/framework,thecrypticace/framework,jack-webster/framework,AllysonSilva/LaravelKernel,AndreasHeiberg/framework,franzliedke/framework,martinssipenko/framework,chrispassas/framework,dan-har/framework,valeryq/framework,Hugome/framework,Zenbu-Social/framework,KluVerKamp/framework,tamnil/framework,christoffertyrefors/framework,jwdeitch/framework,djae138/framework,orrd/framework,hafezdivandari/framework,danilobrinu/framework,osiux/framework,GiantCowFilms/framework,RatkoR/framework,joel-james/framework,jmarcher/framework,Denniskevin/framework,vetruvet/framework,mmauri04/framework,barryvdh/framework,john-main-croud/framework,arturock/framework,martinbean/laravel-framework,numa-engineering/framework,chungth/laravel-framework,hpolthof/framework,yadakhov/framework,ExpoTV/framework,irfanevrens/framework,Modelizer/framework,HipsterJazzbo/framework,PantherDD/laravel-framework,tuupke/framework,0xMatt/framework,phanan/framework,texnikru/laravel-framework-4,claar/framework,stevebauman/framework,ironxu/framework,tomcastleman/framework,jtgrimes/framework,gms8994/framework,bmitch/framework,yesdevnull/framework,zhenkondrat/framework,ImaginationSydney/Laravel,jadz/laravel-framework-4.2.18-php7,nhowell/laravel-framework,cwt137/laravel-framework,cillosis/framework,smb/framework,kevinsimard/framework,euoia/framework,jorgemurta/framework,atorscho/framework,Talean-dev/framework,arturock/framework,willrowe/laravel-framework,neva-dev/laravel-framework,katcountiss/framework,thecrypticace/framework,moura137/framework,omar-dev/framework,ChristopheB/framework,FireEngineRed/framework,PantherDD/laravel-framework,jimrubenstein/laravel-framework,OzanKurt/framework,mmauri04/framework,tills13/framework,mickaelandrieu/framework,Evertt/framework,tomschlick/framework,jackson-dean/framework,Feijs/framework,jchamberlain/framework,samlev/framework,mbernson/framework,vetruvet/framework,katcountiss/framework,FireEngineRed/framework,miclf/framework,scrubmx/framework,timfeid/framework-1,jimrubenstein/laravel-framework,0xMatt/framework,rsanchez/laravel-framework,greabock/framework,Fenzland/laravel,morrislaptop/framework,lvht/framework,mxaddict/framework,fragglebob/framework,Denniskevin/framework,filipeaclima/framework,brti/framework,cviebrock/framework,mxaddict/framework,tomzx/framework,zcwilt/framework,kcalliauw/framework,ncaneldiee/laravel-framework,fungku/framework,nelson6e65/framework,Elandril/framework,alepeino/framework,egekhter/framework,peterpan666/framework,cmazx/framework,michael-repka/framework,thbourlove/framework,mortenhauberg/framework,spyric/framework,jorgemurta/framework,branall1/framework,ncaneldiee/laravel-framework,egekhter/framework,acasar/framework,Zenbu-Social/framework,peterpan666/framework,joecohens/framework,hutushen222/framework,noikiy/framework-1,behzadsh/framework,claar/framework,amenk/framework,srmkliveforks/framework,nerijunior/framework,EspadaV8/framework,tuupke/framework,olsgreen/framework,chrispassas/framework,KluVerKamp/framework,guanhui07/framework,rafaelbeckel/framework,keripix/laravel42x,mightydes/framework,max-kovpak/framework,5outh/framework,cillosis/framework,zcwilt/framework,BePsvPT-Fork/framework,harrygr/framework,Elandril/framework,kevindoole/framework,gms8994/framework,john-main-croud/framework,captbrogers/framework,phroggyy/framework,wujingke/framework,barryvdh/framework,loduis/laravel-framework,FooBarQuaxx/framework,devsalman/framework,pouya-parsa/framework,rkgrep/framework,MladenJanjetovic/framework,arrilot/framework,reinink/framework,lukasgeiter/laravel-framework,Denniskevin/framework,kelixlabs/laravel-framework,devsalman/framework,yadakhov/framework,mateusjatenee/framework,joecohens/framework,avi123/framework,nahid/framework,rentalhost/framework,hailwood/framework,jimrubenstein/laravel-framework,GreenLightt/laravel-framework,fungku/framework,nerijunior/framework,barryvdh/framework,rleger/framework,billmn/framework,mortenhauberg/framework,lguima/framework,Loravel/framework,MarkRedeman/framework,thecrypticace/framework,rafaelbeckel/framework,olsgreen/framework,alnutile/framework,ezeql/framework,Luceos/framework,GreenLightt/laravel-framework,mlantz/framework,patrickcarlohickman/framework,wiltosoft/laravel,leo108/laravel_framework,antonybudianto/framework,isiryder/framework,franzliedke/framework,danilobrinu/framework,cwt137/laravel-framework,sebastiaanluca/framework,miclf/framework,martinbean/laravel-framework | php | ## Code Before:
<?php namespace Illuminate\Database\Connectors;
class SQLiteConnector extends Connector implements ConnectorInterface {
/**
* Establish a database connection.
*
* @param array $options
* @return PDO
*/
public function connect(array $config)
{
$options = $this->getOptions($config);
// SQLite supports "in-memory" databases that only last as long as the owning
// connection does. These are useful for tests or for short lifetime store
// querying. In-memory databases may only have a single open connection.
if ($config['database'] == ':memory:')
{
return $this->createConnection('sqlite::memory:', $config, $options);
}
$path = realpath($config['database']);
return $this->createConnection("sqlite:{$path}", $config, $options);
}
}
## Instruction:
Throw exception if SQLite database doesn't exist.
## Code After:
<?php namespace Illuminate\Database\Connectors;
class SQLiteConnector extends Connector implements ConnectorInterface {
/**
* Establish a database connection.
*
* @param array $options
* @return PDO
*/
public function connect(array $config)
{
$options = $this->getOptions($config);
// SQLite supports "in-memory" databases that only last as long as the owning
// connection does. These are useful for tests or for short lifetime store
// querying. In-memory databases may only have a single open connection.
if ($config['database'] == ':memory:')
{
return $this->createConnection('sqlite::memory:', $config, $options);
}
$path = realpath($config['database']);
// Here we'll verify that the SQLite database exists before we gooing further
// as the developer probably wants to know if the database exists and this
// SQLite driver will not throw any exception if it does not by default.
if ($path === false)
{
throw new \InvalidArgumentException("Database does not exist.");
}
return $this->createConnection("sqlite:{$path}", $config, $options);
}
} | <?php namespace Illuminate\Database\Connectors;
class SQLiteConnector extends Connector implements ConnectorInterface {
/**
* Establish a database connection.
*
* @param array $options
* @return PDO
*/
public function connect(array $config)
{
$options = $this->getOptions($config);
// SQLite supports "in-memory" databases that only last as long as the owning
// connection does. These are useful for tests or for short lifetime store
// querying. In-memory databases may only have a single open connection.
if ($config['database'] == ':memory:')
{
return $this->createConnection('sqlite::memory:', $config, $options);
}
$path = realpath($config['database']);
+ // Here we'll verify that the SQLite database exists before we gooing further
+ // as the developer probably wants to know if the database exists and this
+ // SQLite driver will not throw any exception if it does not by default.
+ if ($path === false)
+ {
+ throw new \InvalidArgumentException("Database does not exist.");
+ }
+
return $this->createConnection("sqlite:{$path}", $config, $options);
}
} | 8 | 0.285714 | 8 | 0 |
00f97d4befb6a6fd3d19ed2c5cae2026d4914cd9 | config/application.rb | config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Expense
class Application < Rails::Application
config.encoding = 'utf-8'
config.time_zone = 'Eastern Time (US & Canada)'
config.filter_parameters += [:password, :password_confirmation]
end
end
| require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Expense
class Application < Rails::Application
config.encoding = 'UTF-8'
config.time_zone = 'UTC'
config.filter_parameters += [:password, :password_confirmation]
end
end
| Use UTC instead of Eastern Time. | Use UTC instead of Eastern Time.
| Ruby | mit | Stackato-Apps/expense,tristandunn/expense,Stackato-Apps/expense | ruby | ## Code Before:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Expense
class Application < Rails::Application
config.encoding = 'utf-8'
config.time_zone = 'Eastern Time (US & Canada)'
config.filter_parameters += [:password, :password_confirmation]
end
end
## Instruction:
Use UTC instead of Eastern Time.
## Code After:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Expense
class Application < Rails::Application
config.encoding = 'UTF-8'
config.time_zone = 'UTC'
config.filter_parameters += [:password, :password_confirmation]
end
end
| require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Expense
class Application < Rails::Application
- config.encoding = 'utf-8'
? ^^^
+ config.encoding = 'UTF-8'
? ^^^
- config.time_zone = 'Eastern Time (US & Canada)'
+ config.time_zone = 'UTC'
config.filter_parameters += [:password, :password_confirmation]
end
end | 4 | 0.307692 | 2 | 2 |
c17de155ac79273e553750a5cb95a2101b79e081 | lib/chef/knife/solo_bootstrap.rb | lib/chef/knife/solo_bootstrap.rb | require 'chef/knife'
require 'chef/knife/solo_cook'
require 'chef/knife/solo_prepare'
class Chef
class Knife
class SoloBootstrap < Knife
deps do
SoloPrepare.load_deps
SoloCook.load_deps
end
banner "knife solo bootstrap [USER@]HOSTNAME [JSON] (options)"
# Use (some) options from prepare and cook commands
self.options = SoloPrepare.options
[:sync_only, :why_run].each { |opt| option opt, SoloCook.options[opt] }
def run
prepare = command_with_same_args(SoloPrepare)
prepare.run
cook = command_with_same_args(SoloCook)
cook.config[:skip_chef_check] = true
cook.run
end
def command_with_same_args(klass)
cmd = klass.new
cmd.ui = ui
cmd.name_args = @name_args
cmd.config = config
cmd
end
end
end
end
| require 'chef/knife'
require 'chef/knife/solo_cook'
require 'chef/knife/solo_prepare'
require 'knife-solo/kitchen_command'
require 'knife-solo/ssh_command'
class Chef
class Knife
class SoloBootstrap < Knife
include KnifeSolo::KitchenCommand
include KnifeSolo::SshCommand
deps do
KnifeSolo::SshCommand.load_deps
SoloPrepare.load_deps
SoloCook.load_deps
end
banner "knife solo bootstrap [USER@]HOSTNAME [JSON] (options)"
# Use (some) options from prepare and cook commands
self.options = SoloPrepare.options
[:sync_only, :why_run].each { |opt| option opt, SoloCook.options[opt] }
def run
validate!
prepare = command_with_same_args(SoloPrepare)
prepare.run
cook = command_with_same_args(SoloCook)
cook.config[:skip_chef_check] = true
cook.run
end
def validate!
validate_first_cli_arg_is_a_hostname!
validate_kitchen!
end
def command_with_same_args(klass)
cmd = klass.new
cmd.ui = ui
cmd.name_args = @name_args
cmd.config = config
cmd
end
end
end
end
| Add validation to solo bootstrap class | Add validation to solo bootstrap class
Otherwise the error message will display help message for an underlying
subcommand.
| Ruby | mit | coletivoEITA/knife-solo,a2ikm/knife-solo,leonid-shevtsov/knife-solo,a2ikm/knife-solo,matschaffer/knife-solo,matschaffer/knife-solo,matschaffer/knife-solo,a2ikm/knife-solo,coletivoEITA/knife-solo,coletivoEITA/knife-solo,analog-analytics/knife-solo,leonid-shevtsov/knife-solo,chadzilla2080/knife-solo,analog-analytics/knife-solo,chadzilla2080/knife-solo,chadzilla2080/knife-solo,leonid-shevtsov/knife-solo,analog-analytics/knife-solo | ruby | ## Code Before:
require 'chef/knife'
require 'chef/knife/solo_cook'
require 'chef/knife/solo_prepare'
class Chef
class Knife
class SoloBootstrap < Knife
deps do
SoloPrepare.load_deps
SoloCook.load_deps
end
banner "knife solo bootstrap [USER@]HOSTNAME [JSON] (options)"
# Use (some) options from prepare and cook commands
self.options = SoloPrepare.options
[:sync_only, :why_run].each { |opt| option opt, SoloCook.options[opt] }
def run
prepare = command_with_same_args(SoloPrepare)
prepare.run
cook = command_with_same_args(SoloCook)
cook.config[:skip_chef_check] = true
cook.run
end
def command_with_same_args(klass)
cmd = klass.new
cmd.ui = ui
cmd.name_args = @name_args
cmd.config = config
cmd
end
end
end
end
## Instruction:
Add validation to solo bootstrap class
Otherwise the error message will display help message for an underlying
subcommand.
## Code After:
require 'chef/knife'
require 'chef/knife/solo_cook'
require 'chef/knife/solo_prepare'
require 'knife-solo/kitchen_command'
require 'knife-solo/ssh_command'
class Chef
class Knife
class SoloBootstrap < Knife
include KnifeSolo::KitchenCommand
include KnifeSolo::SshCommand
deps do
KnifeSolo::SshCommand.load_deps
SoloPrepare.load_deps
SoloCook.load_deps
end
banner "knife solo bootstrap [USER@]HOSTNAME [JSON] (options)"
# Use (some) options from prepare and cook commands
self.options = SoloPrepare.options
[:sync_only, :why_run].each { |opt| option opt, SoloCook.options[opt] }
def run
validate!
prepare = command_with_same_args(SoloPrepare)
prepare.run
cook = command_with_same_args(SoloCook)
cook.config[:skip_chef_check] = true
cook.run
end
def validate!
validate_first_cli_arg_is_a_hostname!
validate_kitchen!
end
def command_with_same_args(klass)
cmd = klass.new
cmd.ui = ui
cmd.name_args = @name_args
cmd.config = config
cmd
end
end
end
end
| require 'chef/knife'
require 'chef/knife/solo_cook'
require 'chef/knife/solo_prepare'
+ require 'knife-solo/kitchen_command'
+ require 'knife-solo/ssh_command'
+
class Chef
class Knife
class SoloBootstrap < Knife
+ include KnifeSolo::KitchenCommand
+ include KnifeSolo::SshCommand
+
deps do
+ KnifeSolo::SshCommand.load_deps
SoloPrepare.load_deps
SoloCook.load_deps
end
banner "knife solo bootstrap [USER@]HOSTNAME [JSON] (options)"
# Use (some) options from prepare and cook commands
self.options = SoloPrepare.options
[:sync_only, :why_run].each { |opt| option opt, SoloCook.options[opt] }
def run
+ validate!
+
prepare = command_with_same_args(SoloPrepare)
prepare.run
cook = command_with_same_args(SoloCook)
cook.config[:skip_chef_check] = true
cook.run
+ end
+
+ def validate!
+ validate_first_cli_arg_is_a_hostname!
+ validate_kitchen!
end
def command_with_same_args(klass)
cmd = klass.new
cmd.ui = ui
cmd.name_args = @name_args
cmd.config = config
cmd
end
end
end
end | 14 | 0.378378 | 14 | 0 |
b3ca4aacbc8c1d7b52e7635b84efea2e82601efd | Sources/Events.swift | Sources/Events.swift | /*
| _ ____ ____ _
| | |‾| ⚈ |-| ⚈ |‾| |
| | | ‾‾‾‾| |‾‾‾‾ | |
| ‾ ‾ ‾
*/
import Foundation
import Reactor
import CloudKit
public struct Updated<T>: Reactor.Event {
public var payload: T
public init(_ payload: T) {
self.payload = payload
}
}
public protocol CloudKitErrorEvent: Reactor.Event {
var error: Error { get }
}
public protocol CloudKitDataEvent: Reactor.Event { }
public struct CloudKitRecordError<T: CloudKitSyncable>: CloudKitErrorEvent {
public var error: Error
public var record: CKRecord
public init(_ error: Error, for record: CKRecord) {
self.error = error
self.record = record
}
}
public enum CloudKitOperationType {
case save
case fetch
case delete
}
public enum CloudKitOperationStatus {
case started
case completed([CloudKitSyncable])
case errored(Error)
}
public struct CloudKitOperationUpdated<T: CloudKitSyncable>: CloudKitDataEvent {
public var status: CloudKitOperationStatus
public var type: CloudKitOperationType
public init(status: CloudKitOperationStatus, type: CloudKitOperationType) {
self.status = status
self.type = type
}
}
| /*
| _ ____ ____ _
| | |‾| ⚈ |-| ⚈ |‾| |
| | | ‾‾‾‾| |‾‾‾‾ | |
| ‾ ‾ ‾
*/
import Foundation
import Reactor
import CloudKit
public struct Updated<T>: Reactor.Event {
public var payload: T
public init(_ payload: T) {
self.payload = payload
}
}
public protocol CloudKitErrorEvent: Reactor.Event {
var error: Error { get }
}
public protocol CloudKitDataEvent: Reactor.Event { }
public struct CloudKitRecordError<T: CloudKitSyncable>: CloudKitErrorEvent {
public var error: Error
public var record: CKRecord
public init(_ error: Error, for record: CKRecord) {
self.error = error
self.record = record
}
}
public enum CloudKitOperationType {
case save
case fetch
case delete
}
public enum CloudKitOperationStatus<T: CloudKitSyncable> {
case started
case completed([T])
case errored(Error)
}
public struct CloudKitOperationUpdated<T: CloudKitSyncable>: CloudKitDataEvent {
public var status: CloudKitOperationStatus<T>
public var type: CloudKitOperationType
public init(status: CloudKitOperationStatus<T>, type: CloudKitOperationType) {
self.status = status
self.type = type
}
}
| Use generic parameter for objects in updated event | Use generic parameter for objects in updated event
| Swift | mit | benjaminsnorris/CloudKitReactor | swift | ## Code Before:
/*
| _ ____ ____ _
| | |‾| ⚈ |-| ⚈ |‾| |
| | | ‾‾‾‾| |‾‾‾‾ | |
| ‾ ‾ ‾
*/
import Foundation
import Reactor
import CloudKit
public struct Updated<T>: Reactor.Event {
public var payload: T
public init(_ payload: T) {
self.payload = payload
}
}
public protocol CloudKitErrorEvent: Reactor.Event {
var error: Error { get }
}
public protocol CloudKitDataEvent: Reactor.Event { }
public struct CloudKitRecordError<T: CloudKitSyncable>: CloudKitErrorEvent {
public var error: Error
public var record: CKRecord
public init(_ error: Error, for record: CKRecord) {
self.error = error
self.record = record
}
}
public enum CloudKitOperationType {
case save
case fetch
case delete
}
public enum CloudKitOperationStatus {
case started
case completed([CloudKitSyncable])
case errored(Error)
}
public struct CloudKitOperationUpdated<T: CloudKitSyncable>: CloudKitDataEvent {
public var status: CloudKitOperationStatus
public var type: CloudKitOperationType
public init(status: CloudKitOperationStatus, type: CloudKitOperationType) {
self.status = status
self.type = type
}
}
## Instruction:
Use generic parameter for objects in updated event
## Code After:
/*
| _ ____ ____ _
| | |‾| ⚈ |-| ⚈ |‾| |
| | | ‾‾‾‾| |‾‾‾‾ | |
| ‾ ‾ ‾
*/
import Foundation
import Reactor
import CloudKit
public struct Updated<T>: Reactor.Event {
public var payload: T
public init(_ payload: T) {
self.payload = payload
}
}
public protocol CloudKitErrorEvent: Reactor.Event {
var error: Error { get }
}
public protocol CloudKitDataEvent: Reactor.Event { }
public struct CloudKitRecordError<T: CloudKitSyncable>: CloudKitErrorEvent {
public var error: Error
public var record: CKRecord
public init(_ error: Error, for record: CKRecord) {
self.error = error
self.record = record
}
}
public enum CloudKitOperationType {
case save
case fetch
case delete
}
public enum CloudKitOperationStatus<T: CloudKitSyncable> {
case started
case completed([T])
case errored(Error)
}
public struct CloudKitOperationUpdated<T: CloudKitSyncable>: CloudKitDataEvent {
public var status: CloudKitOperationStatus<T>
public var type: CloudKitOperationType
public init(status: CloudKitOperationStatus<T>, type: CloudKitOperationType) {
self.status = status
self.type = type
}
}
| /*
| _ ____ ____ _
| | |‾| ⚈ |-| ⚈ |‾| |
| | | ‾‾‾‾| |‾‾‾‾ | |
| ‾ ‾ ‾
*/
import Foundation
import Reactor
import CloudKit
public struct Updated<T>: Reactor.Event {
public var payload: T
public init(_ payload: T) {
self.payload = payload
}
}
public protocol CloudKitErrorEvent: Reactor.Event {
var error: Error { get }
}
public protocol CloudKitDataEvent: Reactor.Event { }
public struct CloudKitRecordError<T: CloudKitSyncable>: CloudKitErrorEvent {
public var error: Error
public var record: CKRecord
public init(_ error: Error, for record: CKRecord) {
self.error = error
self.record = record
}
}
public enum CloudKitOperationType {
case save
case fetch
case delete
}
- public enum CloudKitOperationStatus {
+ public enum CloudKitOperationStatus<T: CloudKitSyncable> {
? +++++++++++++++++++++
case started
- case completed([CloudKitSyncable])
+ case completed([T])
case errored(Error)
}
public struct CloudKitOperationUpdated<T: CloudKitSyncable>: CloudKitDataEvent {
- public var status: CloudKitOperationStatus
+ public var status: CloudKitOperationStatus<T>
? +++
public var type: CloudKitOperationType
- public init(status: CloudKitOperationStatus, type: CloudKitOperationType) {
+ public init(status: CloudKitOperationStatus<T>, type: CloudKitOperationType) {
? +++
self.status = status
self.type = type
}
} | 8 | 0.145455 | 4 | 4 |
52a7126e845406c18fa70a2d1d429c6fc1cc7918 | README.markdown | README.markdown |
Fabrication is an object generation framework for Ruby.
## Compatibility
Fabrication is tested against Ruby 1.9.2, 1.9.3, and Rubinius.
[](http://travis-ci.org/paulelliott/fabrication)
## Documentation
Please see the Fabrication website for up-to-date documentation: http://fabricationgem.org
You can also view the raw documentation without all the awesome: https://github.com/paulelliott/fabrication-site/blob/master/views/_content.markdown
Get help from the mailing list: https://groups.google.com/group/fabricationgem
|
Fabrication is an object generation framework for Ruby.
## Compatibility
Fabrication is tested against Ruby 1.9.2, 1.9.3, and Rubinius.
[](http://travis-ci.org/paulelliott/fabrication)
[](https://codeclimate.com/github/paulelliott/fabrication)
## Documentation
Please see the Fabrication website for up-to-date documentation: http://fabricationgem.org
You can also view the raw documentation without all the awesome: https://github.com/paulelliott/fabrication-site/blob/master/views/_content.markdown
Get help from the mailing list: https://groups.google.com/group/fabricationgem
| Add code climate badge to readme | Add code climate badge to readme
| Markdown | mit | gregburek/fabrication,supremebeing7/fabrication,gregburek/fabrication,supremebeing7/fabrication,paulelliott/fabrication,damsonn/fabrication,paulelliott/fabrication,damsonn/fabrication | markdown | ## Code Before:
Fabrication is an object generation framework for Ruby.
## Compatibility
Fabrication is tested against Ruby 1.9.2, 1.9.3, and Rubinius.
[](http://travis-ci.org/paulelliott/fabrication)
## Documentation
Please see the Fabrication website for up-to-date documentation: http://fabricationgem.org
You can also view the raw documentation without all the awesome: https://github.com/paulelliott/fabrication-site/blob/master/views/_content.markdown
Get help from the mailing list: https://groups.google.com/group/fabricationgem
## Instruction:
Add code climate badge to readme
## Code After:
Fabrication is an object generation framework for Ruby.
## Compatibility
Fabrication is tested against Ruby 1.9.2, 1.9.3, and Rubinius.
[](http://travis-ci.org/paulelliott/fabrication)
[](https://codeclimate.com/github/paulelliott/fabrication)
## Documentation
Please see the Fabrication website for up-to-date documentation: http://fabricationgem.org
You can also view the raw documentation without all the awesome: https://github.com/paulelliott/fabrication-site/blob/master/views/_content.markdown
Get help from the mailing list: https://groups.google.com/group/fabricationgem
|
Fabrication is an object generation framework for Ruby.
## Compatibility
Fabrication is tested against Ruby 1.9.2, 1.9.3, and Rubinius.
[](http://travis-ci.org/paulelliott/fabrication)
+ [](https://codeclimate.com/github/paulelliott/fabrication)
## Documentation
Please see the Fabrication website for up-to-date documentation: http://fabricationgem.org
You can also view the raw documentation without all the awesome: https://github.com/paulelliott/fabrication-site/blob/master/views/_content.markdown
Get help from the mailing list: https://groups.google.com/group/fabricationgem | 1 | 0.0625 | 1 | 0 |
244972428997801c6ee5395201a967ee2cb5bf1e | recipes.md | recipes.md | Thanks [@mblakele](https://github.com/mblakele) for writing this out.
First install both libraries:
```bash
npm install highcharts-release --save
npm install react-highcharts --save
```
Now use them together:
```jsx
var React = require('react');
// With webpack you may wish to alias this as 'highcharts-release'
var Highcharts = require('highcharts-release/highcharts.src.js');
// Expects that Highcharts was loaded in the code.
var ReactHighcharts = require('react-highcharts');
var config = {
/* HighchartsConfig */
};
React.render(<Highcharts config = {config}></Highcharts>, document.body);
```
## Rendering react-highcharts on node.
There is no simple way to render Highcharts in node, so contributions are welcome to this section.
At this point the simplest solution would be to have a node specific `Highcharts` version which would do nothing but
return an empty `div` when rendered.
```javascript
// In the browser Highcharts comes from the outside. In node we load fake highcharts.
if(!Highcharts){
global.highcharts = require('react-highcharts/src/fakeHighcharts.js');
}
```
Browser will have real Highcharts instead, and would rerender the chart on top of it.
| Thanks [@mblakele](https://github.com/mblakele) for writing this out.
First install both libraries:
```bash
npm install highcharts-release --save
npm install react-highcharts --save
```
Now use them together:
```jsx
var React = require('react');
// With webpack you may wish to alias this as 'highcharts-release'
var Highcharts = require('highcharts-release/highcharts.src.js');
// Expects that Highcharts was loaded in the code.
var ReactHighcharts = require('react-highcharts');
var config = {
/* HighchartsConfig */
};
React.render(<Highcharts config = {config}></Highcharts>, document.body);
```
## Rendering react-highcharts on node.
There is no simple way to render Highcharts in node, so contributions are welcome to this section.
At this point the simplest solution would be to have a node-specific `Highcharts`
[version](https://github.com/kirjs/react-highcharts/blob/master/src/fakeHighcharts.js)
which would do nothing but return an empty `div` when rendered.
```javascript
// In the browser Highcharts comes from the outside. In node we load fake highcharts.
if(!Highcharts){
global.highcharts = require('react-highcharts/src/fakeHighcharts.js');
}
```
Browser will have real Highcharts instead, and would rerender the chart on top of it.
| Add a link to fakeHighcharts | Add a link to fakeHighcharts
| Markdown | mit | kirjs/react-highcharts,kirjs/react-highcharts | markdown | ## Code Before:
Thanks [@mblakele](https://github.com/mblakele) for writing this out.
First install both libraries:
```bash
npm install highcharts-release --save
npm install react-highcharts --save
```
Now use them together:
```jsx
var React = require('react');
// With webpack you may wish to alias this as 'highcharts-release'
var Highcharts = require('highcharts-release/highcharts.src.js');
// Expects that Highcharts was loaded in the code.
var ReactHighcharts = require('react-highcharts');
var config = {
/* HighchartsConfig */
};
React.render(<Highcharts config = {config}></Highcharts>, document.body);
```
## Rendering react-highcharts on node.
There is no simple way to render Highcharts in node, so contributions are welcome to this section.
At this point the simplest solution would be to have a node specific `Highcharts` version which would do nothing but
return an empty `div` when rendered.
```javascript
// In the browser Highcharts comes from the outside. In node we load fake highcharts.
if(!Highcharts){
global.highcharts = require('react-highcharts/src/fakeHighcharts.js');
}
```
Browser will have real Highcharts instead, and would rerender the chart on top of it.
## Instruction:
Add a link to fakeHighcharts
## Code After:
Thanks [@mblakele](https://github.com/mblakele) for writing this out.
First install both libraries:
```bash
npm install highcharts-release --save
npm install react-highcharts --save
```
Now use them together:
```jsx
var React = require('react');
// With webpack you may wish to alias this as 'highcharts-release'
var Highcharts = require('highcharts-release/highcharts.src.js');
// Expects that Highcharts was loaded in the code.
var ReactHighcharts = require('react-highcharts');
var config = {
/* HighchartsConfig */
};
React.render(<Highcharts config = {config}></Highcharts>, document.body);
```
## Rendering react-highcharts on node.
There is no simple way to render Highcharts in node, so contributions are welcome to this section.
At this point the simplest solution would be to have a node-specific `Highcharts`
[version](https://github.com/kirjs/react-highcharts/blob/master/src/fakeHighcharts.js)
which would do nothing but return an empty `div` when rendered.
```javascript
// In the browser Highcharts comes from the outside. In node we load fake highcharts.
if(!Highcharts){
global.highcharts = require('react-highcharts/src/fakeHighcharts.js');
}
```
Browser will have real Highcharts instead, and would rerender the chart on top of it.
| Thanks [@mblakele](https://github.com/mblakele) for writing this out.
First install both libraries:
```bash
npm install highcharts-release --save
npm install react-highcharts --save
```
Now use them together:
```jsx
var React = require('react');
// With webpack you may wish to alias this as 'highcharts-release'
var Highcharts = require('highcharts-release/highcharts.src.js');
// Expects that Highcharts was loaded in the code.
var ReactHighcharts = require('react-highcharts');
var config = {
/* HighchartsConfig */
};
React.render(<Highcharts config = {config}></Highcharts>, document.body);
```
## Rendering react-highcharts on node.
There is no simple way to render Highcharts in node, so contributions are welcome to this section.
- At this point the simplest solution would be to have a node specific `Highcharts` version which would do nothing but
? ^ ------------------------------------
+ At this point the simplest solution would be to have a node-specific `Highcharts`
? ^
- return an empty `div` when rendered.
+ [version](https://github.com/kirjs/react-highcharts/blob/master/src/fakeHighcharts.js)
+ which would do nothing but return an empty `div` when rendered.
```javascript
// In the browser Highcharts comes from the outside. In node we load fake highcharts.
if(!Highcharts){
global.highcharts = require('react-highcharts/src/fakeHighcharts.js');
}
```
Browser will have real Highcharts instead, and would rerender the chart on top of it.
| 5 | 0.125 | 3 | 2 |
0e71c8ef6bb7fbe6bb515e8662ac421df981168b | config/application.rb | config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module SplitsIO
class Application < Rails::Application
config.autoload_paths += Dir["#{config.root}/lib/**/"]
config.action_controller.allow_forgery_protection = false
# how often should encountering a run cause a background refresh-from-file job to be queued up for it?
config.run_refresh_chance = 0.1
end
end
WillPaginate.per_page = 20
| require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module SplitsIO
class Application < Rails::Application
config.autoload_paths += Dir["#{config.root}/lib/**/"]
config.action_controller.allow_forgery_protection = false
config.active_job.queue_adapter = :delayed_job
# how often should encountering a run cause a background refresh-from-file job to be queued up for it?
config.run_refresh_chance = 0.1
end
end
WillPaginate.per_page = 20
| Fix delayed_job for Rails 4.2 | Fix delayed_job for Rails 4.2
| Ruby | agpl-3.0 | BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,glacials/splits-io,glacials/splits-io,glacials/splits-io,BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io | ruby | ## Code Before:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module SplitsIO
class Application < Rails::Application
config.autoload_paths += Dir["#{config.root}/lib/**/"]
config.action_controller.allow_forgery_protection = false
# how often should encountering a run cause a background refresh-from-file job to be queued up for it?
config.run_refresh_chance = 0.1
end
end
WillPaginate.per_page = 20
## Instruction:
Fix delayed_job for Rails 4.2
## Code After:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module SplitsIO
class Application < Rails::Application
config.autoload_paths += Dir["#{config.root}/lib/**/"]
config.action_controller.allow_forgery_protection = false
config.active_job.queue_adapter = :delayed_job
# how often should encountering a run cause a background refresh-from-file job to be queued up for it?
config.run_refresh_chance = 0.1
end
end
WillPaginate.per_page = 20
| require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env)
module SplitsIO
class Application < Rails::Application
config.autoload_paths += Dir["#{config.root}/lib/**/"]
config.action_controller.allow_forgery_protection = false
+ config.active_job.queue_adapter = :delayed_job
# how often should encountering a run cause a background refresh-from-file job to be queued up for it?
config.run_refresh_chance = 0.1
end
end
WillPaginate.per_page = 20 | 1 | 0.058824 | 1 | 0 |
2c98ad7967f7277b4b6520ab15e0d18d80e8934b | ci/templates/ci/event_table.html | ci/templates/ci/event_table.html | <div class="table-responsive">
<table id="event_table" class="table table-bordered table-condensed table-sm">
<tbody>
{% for ev in events %}
<tr id="event_{{ev.id}}" data-date="{{ev.sort_time}}_9999">
<td id="event_status_{{ev.id}}" title="Created: {{ev.created}}" class="job_status_{{ev.status}}">
{% autoescape off %}
{{ ev.description }}
{% endautoescape %}
</td>
{% for job_group in ev.job_groups %}
{% for job in job_group %}
<td id="job_{{job.id}}" class="job_status_{{job.status}}" title="Created: {{job.created}}">
{% autoescape off %}
{{job.description}}
{% endautoescape %}
</td>
{% endfor %}
{% if not forloop.last %}
<td class="depends"><span class="glyphicon glyphicon-arrow-right"></span></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
| <div class="table-responsive">
<table id="event_table" class="table table-bordered table-condensed table-sm">
<tbody>
{% for ev in events %}
<tr id="event_{{ev.id}}" data-date="{{ev.sort_time}}_9999">
<td id="event_status_{{ev.id}}" class="job_status_{{ev.status}}">
{% autoescape off %}
{{ ev.description }}
{% endautoescape %}
</td>
{% for job_group in ev.job_groups %}
{% for job in job_group %}
<td id="job_{{job.id}}" class="job_status_{{job.status}}">
{% autoescape off %}
{{job.description}}
{% endautoescape %}
</td>
{% endfor %}
{% if not forloop.last %}
<td class="depends"><span class="glyphicon glyphicon-arrow-right"></span></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
| Remove title on event table boxes | Remove title on event table boxes
| HTML | apache-2.0 | brianmoose/civet,idaholab/civet,brianmoose/civet,brianmoose/civet,idaholab/civet,idaholab/civet,idaholab/civet,brianmoose/civet | html | ## Code Before:
<div class="table-responsive">
<table id="event_table" class="table table-bordered table-condensed table-sm">
<tbody>
{% for ev in events %}
<tr id="event_{{ev.id}}" data-date="{{ev.sort_time}}_9999">
<td id="event_status_{{ev.id}}" title="Created: {{ev.created}}" class="job_status_{{ev.status}}">
{% autoescape off %}
{{ ev.description }}
{% endautoescape %}
</td>
{% for job_group in ev.job_groups %}
{% for job in job_group %}
<td id="job_{{job.id}}" class="job_status_{{job.status}}" title="Created: {{job.created}}">
{% autoescape off %}
{{job.description}}
{% endautoescape %}
</td>
{% endfor %}
{% if not forloop.last %}
<td class="depends"><span class="glyphicon glyphicon-arrow-right"></span></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
## Instruction:
Remove title on event table boxes
## Code After:
<div class="table-responsive">
<table id="event_table" class="table table-bordered table-condensed table-sm">
<tbody>
{% for ev in events %}
<tr id="event_{{ev.id}}" data-date="{{ev.sort_time}}_9999">
<td id="event_status_{{ev.id}}" class="job_status_{{ev.status}}">
{% autoescape off %}
{{ ev.description }}
{% endautoescape %}
</td>
{% for job_group in ev.job_groups %}
{% for job in job_group %}
<td id="job_{{job.id}}" class="job_status_{{job.status}}">
{% autoescape off %}
{{job.description}}
{% endautoescape %}
</td>
{% endfor %}
{% if not forloop.last %}
<td class="depends"><span class="glyphicon glyphicon-arrow-right"></span></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
| <div class="table-responsive">
<table id="event_table" class="table table-bordered table-condensed table-sm">
<tbody>
{% for ev in events %}
<tr id="event_{{ev.id}}" data-date="{{ev.sort_time}}_9999">
- <td id="event_status_{{ev.id}}" title="Created: {{ev.created}}" class="job_status_{{ev.status}}">
? --------------------------------
+ <td id="event_status_{{ev.id}}" class="job_status_{{ev.status}}">
{% autoescape off %}
{{ ev.description }}
{% endautoescape %}
</td>
{% for job_group in ev.job_groups %}
{% for job in job_group %}
- <td id="job_{{job.id}}" class="job_status_{{job.status}}" title="Created: {{job.created}}">
? ---------------------------------
+ <td id="job_{{job.id}}" class="job_status_{{job.status}}">
{% autoescape off %}
{{job.description}}
{% endautoescape %}
</td>
{% endfor %}
{% if not forloop.last %}
<td class="depends"><span class="glyphicon glyphicon-arrow-right"></span></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div> | 4 | 0.148148 | 2 | 2 |
cc19d0af1c22c9677960f406ced425aa48da54c1 | src/sentry/migrations/0063_remove_bad_groupedmessage_index.py | src/sentry/migrations/0063_remove_bad_groupedmessage_index.py | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
try:
db.delete_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
except Exception:
db.rollback_transaction()
def backwards(self, orm):
# Adding unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.create_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
| import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.delete_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
def backwards(self, orm):
# Adding unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.create_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
| Revert "Dont error if 0063 index was already cleaned up" | Revert "Dont error if 0063 index was already cleaned up"
This reverts commit b3a51fa482fc949de75d962ddd9fe3464fa70e58.
| Python | bsd-3-clause | felixbuenemann/sentry,JackDanger/sentry,zenefits/sentry,korealerts1/sentry,fuziontech/sentry,daevaorn/sentry,argonemyth/sentry,beeftornado/sentry,vperron/sentry,mvaled/sentry,rdio/sentry,gg7/sentry,hongliang5623/sentry,felixbuenemann/sentry,jokey2k/sentry,pauloschilling/sentry,beni55/sentry,rdio/sentry,BayanGroup/sentry,ngonzalvez/sentry,gencer/sentry,mitsuhiko/sentry,Natim/sentry,gg7/sentry,boneyao/sentry,argonemyth/sentry,NickPresta/sentry,llonchj/sentry,SilentCircle/sentry,looker/sentry,Kryz/sentry,ngonzalvez/sentry,daevaorn/sentry,jokey2k/sentry,alexm92/sentry,BuildingLink/sentry,JamesMura/sentry,pauloschilling/sentry,drcapulet/sentry,beni55/sentry,camilonova/sentry,looker/sentry,vperron/sentry,JamesMura/sentry,mvaled/sentry,songyi199111/sentry,fotinakis/sentry,1tush/sentry,gencer/sentry,jean/sentry,wujuguang/sentry,ifduyue/sentry,JTCunning/sentry,fuziontech/sentry,vperron/sentry,mvaled/sentry,fuziontech/sentry,beeftornado/sentry,Kryz/sentry,camilonova/sentry,ewdurbin/sentry,kevinastone/sentry,llonchj/sentry,gencer/sentry,nicholasserra/sentry,jean/sentry,TedaLIEz/sentry,drcapulet/sentry,mvaled/sentry,looker/sentry,imankulov/sentry,gg7/sentry,NickPresta/sentry,songyi199111/sentry,mvaled/sentry,SilentCircle/sentry,JamesMura/sentry,BuildingLink/sentry,kevinlondon/sentry,Natim/sentry,hongliang5623/sentry,wujuguang/sentry,felixbuenemann/sentry,kevinastone/sentry,gencer/sentry,daevaorn/sentry,JamesMura/sentry,korealerts1/sentry,korealerts1/sentry,alexm92/sentry,BuildingLink/sentry,ifduyue/sentry,looker/sentry,beeftornado/sentry,JackDanger/sentry,BayanGroup/sentry,gencer/sentry,fotinakis/sentry,songyi199111/sentry,beni55/sentry,nicholasserra/sentry,Natim/sentry,zenefits/sentry,hongliang5623/sentry,1tush/sentry,argonemyth/sentry,llonchj/sentry,alexm92/sentry,zenefits/sentry,JackDanger/sentry,ifduyue/sentry,1tush/sentry,boneyao/sentry,JamesMura/sentry,SilentCircle/sentry,pauloschilling/sentry,ewdurbin/sentry,zenefits/sentry,mvaled/sentry,imankulov/sentry,mitsuhiko/sentry,Kryz/sentry,looker/sentry,kevinastone/sentry,kevinlondon/sentry,zenefits/sentry,ifduyue/sentry,NickPresta/sentry,wong2/sentry,ngonzalvez/sentry,rdio/sentry,fotinakis/sentry,jokey2k/sentry,SilentCircle/sentry,TedaLIEz/sentry,fotinakis/sentry,nicholasserra/sentry,daevaorn/sentry,TedaLIEz/sentry,camilonova/sentry,wong2/sentry,BuildingLink/sentry,jean/sentry,JTCunning/sentry,imankulov/sentry,jean/sentry,ifduyue/sentry,JTCunning/sentry,NickPresta/sentry,kevinlondon/sentry,drcapulet/sentry,rdio/sentry,wujuguang/sentry,jean/sentry,BayanGroup/sentry,boneyao/sentry,ewdurbin/sentry,wong2/sentry,BuildingLink/sentry | python | ## Code Before:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
try:
db.delete_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
except Exception:
db.rollback_transaction()
def backwards(self, orm):
# Adding unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.create_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
## Instruction:
Revert "Dont error if 0063 index was already cleaned up"
This reverts commit b3a51fa482fc949de75d962ddd9fe3464fa70e58.
## Code After:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.delete_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
def backwards(self, orm):
# Adding unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.create_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
| import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
- try:
- db.delete_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
? ----
+ db.delete_unique('sentry_groupedmessage', ['logger', 'view', 'checksum'])
- except Exception:
- db.rollback_transaction()
-
def backwards(self, orm):
# Adding unique constraint on 'GroupedMessage', fields ['logger', 'view', 'checksum']
db.create_unique('sentry_groupedmessage', ['logger', 'view', 'checksum']) | 6 | 0.333333 | 1 | 5 |
fa292539b0ff8974c85fcac0f20ff9330574a8ca | themes/learn/views/home/_project_info.html.haml | themes/learn/views/home/_project_info.html.haml | - content_for(:project_info) do
%p
Molecular Workbench is already one of the most versatile ways to experience the science of atoms and molecules. Now thanks to Google's generosity and the power of HTML5, we're bringing it to Web browsers everywhere.
%p
= link_to "Try out the activities to see for yourself.", search_url
%p
%strong
Why register?
When you register as a teacher, you can assign activities to your students, follow their progress and get reports of their responses to questions embedded throughout the activities. (If students don’t register, you can still ask them to print out reports of their work from the final page of each activity.)
| - content_for(:project_info) do
%p
Since 1994, the Concord Consortium has been developing deeply digital tools and learning activities that capture
the power of curiosity and create revolutionary new approaches to science, math and engineering education.
This new portal is being developed as a central repository for our simulations and activities,
giving teachers and students access to open educational resources across our projects, past and present.
The portal currently offers a limited number of research-based activities. We’re actively working on adding
new resources, so check back often!
%p
= link_to "Preview the activities.", search_url
%p
%strong
Why sign up?
When you register as a teacher, you can browse activities, create classes, assign activities to your students, follow their progress, and view reports of their work.
%p
Looking for more? Our
= link_to "STEM Resource Finder", "https://concord.org/stem-resources"
includes hundreds of other models and activities.
| Fix About text on Learn portal | Fix About text on Learn portal
[#107521950]
| Haml | mit | concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse,concord-consortium/rigse | haml | ## Code Before:
- content_for(:project_info) do
%p
Molecular Workbench is already one of the most versatile ways to experience the science of atoms and molecules. Now thanks to Google's generosity and the power of HTML5, we're bringing it to Web browsers everywhere.
%p
= link_to "Try out the activities to see for yourself.", search_url
%p
%strong
Why register?
When you register as a teacher, you can assign activities to your students, follow their progress and get reports of their responses to questions embedded throughout the activities. (If students don’t register, you can still ask them to print out reports of their work from the final page of each activity.)
## Instruction:
Fix About text on Learn portal
[#107521950]
## Code After:
- content_for(:project_info) do
%p
Since 1994, the Concord Consortium has been developing deeply digital tools and learning activities that capture
the power of curiosity and create revolutionary new approaches to science, math and engineering education.
This new portal is being developed as a central repository for our simulations and activities,
giving teachers and students access to open educational resources across our projects, past and present.
The portal currently offers a limited number of research-based activities. We’re actively working on adding
new resources, so check back often!
%p
= link_to "Preview the activities.", search_url
%p
%strong
Why sign up?
When you register as a teacher, you can browse activities, create classes, assign activities to your students, follow their progress, and view reports of their work.
%p
Looking for more? Our
= link_to "STEM Resource Finder", "https://concord.org/stem-resources"
includes hundreds of other models and activities.
| - content_for(:project_info) do
%p
- Molecular Workbench is already one of the most versatile ways to experience the science of atoms and molecules. Now thanks to Google's generosity and the power of HTML5, we're bringing it to Web browsers everywhere.
+ Since 1994, the Concord Consortium has been developing deeply digital tools and learning activities that capture
+ the power of curiosity and create revolutionary new approaches to science, math and engineering education.
+ This new portal is being developed as a central repository for our simulations and activities,
+ giving teachers and students access to open educational resources across our projects, past and present.
+ The portal currently offers a limited number of research-based activities. We’re actively working on adding
+ new resources, so check back often!
%p
- = link_to "Try out the activities to see for yourself.", search_url
+ = link_to "Preview the activities.", search_url
%p
%strong
- Why register?
- When you register as a teacher, you can assign activities to your students, follow their progress and get reports of their responses to questions embedded throughout the activities. (If students don’t register, you can still ask them to print out reports of their work from the final page of each activity.)
+ Why sign up?
+ When you register as a teacher, you can browse activities, create classes, assign activities to your students, follow their progress, and view reports of their work.
+ %p
+ Looking for more? Our
+ = link_to "STEM Resource Finder", "https://concord.org/stem-resources"
+ includes hundreds of other models and activities. | 17 | 1.888889 | 13 | 4 |
1f9499b3bd0c13b6afbdc098e1d1aae7c91cad7c | addon/utils/load-relationship.js | addon/utils/load-relationship.js | import Ember from 'ember';
export default function loadAll(model, relationship, dest, options = {}) {
var page = options.page || 1;
var query = {
'page[size]': 10,
page: page
};
query = Ember.merge(query, options || {});
return model.query(relationship, query).then(results => {
dest.pushObjects(results.toArray());
var total = results.meta.pagination.total;
var pageSize = results.meta.pagination.per_page;
var remaining = total - (page * pageSize);
if (remaining > 0) {
return loadAll(model, relationship, dest, {
'page[size]': pageSize,
page: page + 1
});
}
});
}
| import Ember from 'ember';
export default function loadAll(model, relationship, dest, options = {}) {
var page = options.page || 1;
var query = {
'page[size]': 10,
page: page
};
query = Ember.merge(query, options || {});
return model.query(relationship, query).then(results => {
dest.pushObjects(results.toArray());
var total = results.meta.pagination.total;
var pageSize = results.meta.pagination.per_page;
var remaining = total - (page * pageSize);
if (remaining > 0) {
query.page = page + 1;
query['page[size]'] = pageSize;
return loadAll(model, relationship, dest, query);
}
});
}
| Fix initial query params not getting passed into recursive calls. | Fix initial query params not getting passed into recursive calls.
| JavaScript | apache-2.0 | chrisseto/ember-osf,binoculars/ember-osf,chrisseto/ember-osf,baylee-d/ember-osf,baylee-d/ember-osf,crcresearch/ember-osf,crcresearch/ember-osf,CenterForOpenScience/ember-osf,CenterForOpenScience/ember-osf,pattisdr/ember-osf,pattisdr/ember-osf,jamescdavis/ember-osf,hmoco/ember-osf,jamescdavis/ember-osf,hmoco/ember-osf,binoculars/ember-osf | javascript | ## Code Before:
import Ember from 'ember';
export default function loadAll(model, relationship, dest, options = {}) {
var page = options.page || 1;
var query = {
'page[size]': 10,
page: page
};
query = Ember.merge(query, options || {});
return model.query(relationship, query).then(results => {
dest.pushObjects(results.toArray());
var total = results.meta.pagination.total;
var pageSize = results.meta.pagination.per_page;
var remaining = total - (page * pageSize);
if (remaining > 0) {
return loadAll(model, relationship, dest, {
'page[size]': pageSize,
page: page + 1
});
}
});
}
## Instruction:
Fix initial query params not getting passed into recursive calls.
## Code After:
import Ember from 'ember';
export default function loadAll(model, relationship, dest, options = {}) {
var page = options.page || 1;
var query = {
'page[size]': 10,
page: page
};
query = Ember.merge(query, options || {});
return model.query(relationship, query).then(results => {
dest.pushObjects(results.toArray());
var total = results.meta.pagination.total;
var pageSize = results.meta.pagination.per_page;
var remaining = total - (page * pageSize);
if (remaining > 0) {
query.page = page + 1;
query['page[size]'] = pageSize;
return loadAll(model, relationship, dest, query);
}
});
}
| import Ember from 'ember';
export default function loadAll(model, relationship, dest, options = {}) {
var page = options.page || 1;
var query = {
'page[size]': 10,
page: page
};
query = Ember.merge(query, options || {});
return model.query(relationship, query).then(results => {
dest.pushObjects(results.toArray());
var total = results.meta.pagination.total;
var pageSize = results.meta.pagination.per_page;
var remaining = total - (page * pageSize);
if (remaining > 0) {
+ query.page = page + 1;
+ query['page[size]'] = pageSize;
- return loadAll(model, relationship, dest, {
? ^
+ return loadAll(model, relationship, dest, query);
? ^^^^^^^
- 'page[size]': pageSize,
- page: page + 1
- });
}
});
} | 7 | 0.291667 | 3 | 4 |
0469ba477eb4395fc0ee0ec799effbb8291e7a3e | js/script.js | js/script.js | /*global WebWorker:false */
(function () {
'use strict';
var worker = null,
$output = null;
$output = $('#worker-output');
/**
worker = new Worker('/js/example-worker.js');
worker.addEventListener('message', function (event) {
$output.text(event.data);
return;
})
//worker.postMessage();
/**/
worker = new WebWorker('/js/example-worker.js');
worker.on('message', function (event) {
$output.text(event.data);
return;
});
worker.load().on(WebWorker.Event.WORKER_LOADED, function () {
console.log('has loaded');
worker.start();
return;
});
return;
})();
| /*global WebWorker:false */
(function () {
'use strict';
var worker = null,
$output = null;
$output = $('#worker-output');
/**
worker = new Worker('/js/example-worker.js');
worker.addEventListener('message', function (event) {
$output.text(event.data);
return;
})
//worker.postMessage();
/**/
worker = new WebWorker('/js/example-worker.js');
window.worker = worker;
worker.on('message', function (event) {
$output.text(event.data);
return;
});
worker.on(WebWorker.Event.WORKER_LOADING, function () {
console.log('worker loading');
return;
});
worker.on(WebWorker.Event.WORKER_LOADED, function () {
console.log('has loaded');
worker.start();
return;
});
worker.on(WebWorker.Event.WORKER_STARTING, function () {
console.log('worker starting');
return;
});
worker.on(WebWorker.Event.WORKER_STARTED, function () {
console.log('worker started');
return;
});
worker.load();
return;
})();
| Add event listeners for better tracking of worker. | Add event listeners for better tracking of worker.
| JavaScript | mit | tanzeelkazi/webworker,tanzeelkazi/web-worker,tanzeelkazi/webworker,tanzeelkazi/web-worker,tanzeelkazi/webworker,tanzeelkazi/web-worker | javascript | ## Code Before:
/*global WebWorker:false */
(function () {
'use strict';
var worker = null,
$output = null;
$output = $('#worker-output');
/**
worker = new Worker('/js/example-worker.js');
worker.addEventListener('message', function (event) {
$output.text(event.data);
return;
})
//worker.postMessage();
/**/
worker = new WebWorker('/js/example-worker.js');
worker.on('message', function (event) {
$output.text(event.data);
return;
});
worker.load().on(WebWorker.Event.WORKER_LOADED, function () {
console.log('has loaded');
worker.start();
return;
});
return;
})();
## Instruction:
Add event listeners for better tracking of worker.
## Code After:
/*global WebWorker:false */
(function () {
'use strict';
var worker = null,
$output = null;
$output = $('#worker-output');
/**
worker = new Worker('/js/example-worker.js');
worker.addEventListener('message', function (event) {
$output.text(event.data);
return;
})
//worker.postMessage();
/**/
worker = new WebWorker('/js/example-worker.js');
window.worker = worker;
worker.on('message', function (event) {
$output.text(event.data);
return;
});
worker.on(WebWorker.Event.WORKER_LOADING, function () {
console.log('worker loading');
return;
});
worker.on(WebWorker.Event.WORKER_LOADED, function () {
console.log('has loaded');
worker.start();
return;
});
worker.on(WebWorker.Event.WORKER_STARTING, function () {
console.log('worker starting');
return;
});
worker.on(WebWorker.Event.WORKER_STARTED, function () {
console.log('worker started');
return;
});
worker.load();
return;
})();
| /*global WebWorker:false */
(function () {
'use strict';
var worker = null,
$output = null;
$output = $('#worker-output');
/**
worker = new Worker('/js/example-worker.js');
worker.addEventListener('message', function (event) {
$output.text(event.data);
return;
})
//worker.postMessage();
/**/
worker = new WebWorker('/js/example-worker.js');
+ window.worker = worker;
worker.on('message', function (event) {
$output.text(event.data);
return;
});
+
+ worker.on(WebWorker.Event.WORKER_LOADING, function () {
+ console.log('worker loading');
+ return;
+ });
+
- worker.load().on(WebWorker.Event.WORKER_LOADED, function () {
? -------
+ worker.on(WebWorker.Event.WORKER_LOADED, function () {
console.log('has loaded');
worker.start();
return;
});
+ worker.on(WebWorker.Event.WORKER_STARTING, function () {
+ console.log('worker starting');
+ return;
+ });
+
+ worker.on(WebWorker.Event.WORKER_STARTED, function () {
+ console.log('worker started');
+ return;
+ });
+
+ worker.load();
+
return;
})(); | 21 | 0.6 | 20 | 1 |
66e880f6a7aaa25881d30429f11e2dd4f54955c7 | app/components/Profile/Profile.js | app/components/Profile/Profile.js | import React, { Component } from 'react'
import { DrawerLabel } from '..'
import Avatar from 'material-ui/Avatar'
import styles from './Profile.css'
const avatarStyles = {
width: 200,
height: 200,
marginLeft: 88,
marginTop: 32,
marginRight: 88,
marginBottom: 6
}
class Profile extends Component {
render () {
const { avatar, details } = this.props
return (
<div style={{ overflowY: 'auto', height: '100%' }}>
{ avatar ? <Avatar src={avatar} style={avatarStyles} /> : null}
{
details.map((e, i) => (
<DrawerLabel key={i} name={e.name} value={e.value} />
))
}
</div>
)
}
}
export default Profile | import React, { Component } from 'react'
import { DrawerLabel } from '..'
import Avatar from 'material-ui/Avatar'
import RaisedButton from 'material-ui/RaisedButton'
import styles from './Profile.css'
const avatarStyles = {
width: 200,
height: 200,
marginLeft: 88,
marginTop: 32,
marginRight: 88,
marginBottom: 6
}
class Profile extends Component {
render () {
const { avatar, details, actions } = this.props
return (
<div style={{ overflowY: 'auto', height: '100%' }}>
{ avatar ? <Avatar src={avatar} style={avatarStyles} /> : null}
{
details.map((e, i) => (
<DrawerLabel key={i} name={e.name} value={e.value} />
))
}
{
actions ? actions.map((a, i) => (
<RaisedButton key={i} {...a} style={{ marginTop: 26 }} fullWidth={true} />
)) : null
}
</div>
)
}
}
export default Profile | Support for actions in profile | Support for actions in profile
| JavaScript | mit | danielzy95/oaa-chat,danielzy95/oaa-chat | javascript | ## Code Before:
import React, { Component } from 'react'
import { DrawerLabel } from '..'
import Avatar from 'material-ui/Avatar'
import styles from './Profile.css'
const avatarStyles = {
width: 200,
height: 200,
marginLeft: 88,
marginTop: 32,
marginRight: 88,
marginBottom: 6
}
class Profile extends Component {
render () {
const { avatar, details } = this.props
return (
<div style={{ overflowY: 'auto', height: '100%' }}>
{ avatar ? <Avatar src={avatar} style={avatarStyles} /> : null}
{
details.map((e, i) => (
<DrawerLabel key={i} name={e.name} value={e.value} />
))
}
</div>
)
}
}
export default Profile
## Instruction:
Support for actions in profile
## Code After:
import React, { Component } from 'react'
import { DrawerLabel } from '..'
import Avatar from 'material-ui/Avatar'
import RaisedButton from 'material-ui/RaisedButton'
import styles from './Profile.css'
const avatarStyles = {
width: 200,
height: 200,
marginLeft: 88,
marginTop: 32,
marginRight: 88,
marginBottom: 6
}
class Profile extends Component {
render () {
const { avatar, details, actions } = this.props
return (
<div style={{ overflowY: 'auto', height: '100%' }}>
{ avatar ? <Avatar src={avatar} style={avatarStyles} /> : null}
{
details.map((e, i) => (
<DrawerLabel key={i} name={e.name} value={e.value} />
))
}
{
actions ? actions.map((a, i) => (
<RaisedButton key={i} {...a} style={{ marginTop: 26 }} fullWidth={true} />
)) : null
}
</div>
)
}
}
export default Profile | import React, { Component } from 'react'
import { DrawerLabel } from '..'
import Avatar from 'material-ui/Avatar'
+ import RaisedButton from 'material-ui/RaisedButton'
import styles from './Profile.css'
const avatarStyles = {
width: 200,
height: 200,
marginLeft: 88,
marginTop: 32,
marginRight: 88,
marginBottom: 6
}
class Profile extends Component {
render () {
- const { avatar, details } = this.props
+ const { avatar, details, actions } = this.props
? +++++++++
return (
<div style={{ overflowY: 'auto', height: '100%' }}>
{ avatar ? <Avatar src={avatar} style={avatarStyles} /> : null}
{
details.map((e, i) => (
<DrawerLabel key={i} name={e.name} value={e.value} />
))
}
+ {
+ actions ? actions.map((a, i) => (
+ <RaisedButton key={i} {...a} style={{ marginTop: 26 }} fullWidth={true} />
+ )) : null
+ }
</div>
)
}
}
export default Profile | 8 | 0.258065 | 7 | 1 |
caf9222b61f3048fe205d1543ef894bfd10bd9a5 | Bindings/tcl/example.tcl | Bindings/tcl/example.tcl | package require growl
growl register ExampleTclApp "warning error" pwrdLogo75.gif
growl post warning "TclGrowl launched" "Hi there!"
after 10000
growl post error "TclGrowl quitting" "Bye!" ../../images/icons/growl-icon-(png).png
| package require growl
set curdir [file dirname [info script]]
growl register ExampleTclApp "warning error" ${curdir}/pwrdLogo75.gif
growl post warning "TclGrowl launched" "Hi there!"
after 10000
growl post error "TclGrowl quitting" "Bye!" ${curdir}/../../images/icons/growl-icon-(png).png
| Make this work regardless of cwd. | Make this work regardless of cwd.
| Tcl | bsd-3-clause | nagyistoce/growl,chashion/growl,an0nym0u5/growl,ylian/growl,coltonfisher/coltonfisher-growl,CarlosCD/growl,morganestes/morganestes-growl,chashion/growl,nagyistoce/growl,SalrJupiter/growl,chashion/growl,morganestes/morganestes-growl,CarlosCD/growl,xhruso00/growl,nkhorman/archive-growl,CarlosCD/growl,xhruso00/growl,Shalaco/shalzers-growl,coltonfisher/coltonfisher-growl,chashion/growl,SalrJupiter/growl,doshinirav/doshinirav-myversion,morganestes/morganestes-growl,xhruso00/growl,nochkin/growl,doshinirav/doshinirav-myversion,morganestes/morganestes-growl,CarlosCD/growl,nkhorman/archive-growl,tectronics/growl,Shalaco/shalzers-growl,coltonfisher/coltonfisher-growl,morganestes/morganestes-growl,tectronics/growl,SalrJupiter/growl,morganestes/morganestes-growl,doshinirav/doshinirav-myversion,CarlosCD/growl,xhruso00/growl,nochkin/growl,nochkin/growl,Shalaco/shalzers-growl,nkhorman/archive-growl,coltonfisher/coltonfisher-growl,SalrJupiter/growl,ylian/growl,nochkin/growl,tectronics/growl,CarlosCD/growl,timbck2/growl,SalrJupiter/growl,xhruso00/growl,ylian/growl,an0nym0u5/growl,doshinirav/doshinirav-myversion,nagyistoce/growl,an0nym0u5/growl,coltonfisher/coltonfisher-growl,tectronics/growl,doshinirav/doshinirav-myversion,nochkin/growl,ylian/growl,coltonfisher/coltonfisher-growl,xhruso00/growl,timbck2/growl,timbck2/growl,chashion/growl,nagyistoce/growl,Shalaco/shalzers-growl,ylian/growl,SalrJupiter/growl,chashion/growl,doshinirav/doshinirav-myversion,timbck2/growl,Shalaco/shalzers-growl,Shalaco/shalzers-growl,timbck2/growl,tectronics/growl,Shalaco/shalzers-growl,nagyistoce/growl,doshinirav/doshinirav-myversion,Shalaco/shalzers-growl,tectronics/growl,nagyistoce/growl,nochkin/growl,coltonfisher/coltonfisher-growl,Shalaco/shalzers-growl,Shalaco/shalzers-growl,nkhorman/archive-growl,ylian/growl,an0nym0u5/growl,CarlosCD/growl,Shalaco/shalzers-growl,nkhorman/archive-growl,an0nym0u5/growl,timbck2/growl,an0nym0u5/growl,nkhorman/archive-growl | tcl | ## Code Before:
package require growl
growl register ExampleTclApp "warning error" pwrdLogo75.gif
growl post warning "TclGrowl launched" "Hi there!"
after 10000
growl post error "TclGrowl quitting" "Bye!" ../../images/icons/growl-icon-(png).png
## Instruction:
Make this work regardless of cwd.
## Code After:
package require growl
set curdir [file dirname [info script]]
growl register ExampleTclApp "warning error" ${curdir}/pwrdLogo75.gif
growl post warning "TclGrowl launched" "Hi there!"
after 10000
growl post error "TclGrowl quitting" "Bye!" ${curdir}/../../images/icons/growl-icon-(png).png
| package require growl
+ set curdir [file dirname [info script]]
- growl register ExampleTclApp "warning error" pwrdLogo75.gif
+ growl register ExampleTclApp "warning error" ${curdir}/pwrdLogo75.gif
? ++++++++++
growl post warning "TclGrowl launched" "Hi there!"
after 10000
- growl post error "TclGrowl quitting" "Bye!" ../../images/icons/growl-icon-(png).png
+ growl post error "TclGrowl quitting" "Bye!" ${curdir}/../../images/icons/growl-icon-(png).png
? ++++++++++
| 5 | 0.833333 | 3 | 2 |
2029405007656c38bb5641e8e1d7d55d42753cba | spec/license_spec.rb | spec/license_spec.rb | require 'spec_helper'
licenses.each do |license|
describe "The #{license["title"]} license" do
it "should have a title" do
expect(license["title"]).to_not be_nil
end
it "should have a description" do
expect(license["description"]).to_not be_nil
end
describe "SPDX compliance" do
# "No license" isn't really a license, so no need to test
unless license["id"] == "no-license"
it "#{license["id"]} should be a valid SPDX ID" do
expect(find_spdx(license["id"])).to_not be_nil
end
it "should be the proper SPDX name" do
spdx = find_spdx(license["id"])
expect(spdx[1]["name"].gsub(/ only$/,"")).to eql(license["title"])
end
end
end
["permitted", "required", "forbidden"].each do |group|
describe "#{group} properties" do
it "should list the properties" do
expect(license[group]).to_not be_nil
end
license[group].to_a.each do |tag|
describe "#{tag} tag" do
it "should be a valid tag" do
expect(rule?(tag,group)).to be(true)
end
end
end
end
end
end
end
| require 'spec_helper'
licenses.each do |license|
describe "The #{license["title"]} license" do
it "should have a title" do
expect(license["title"]).to_not be_nil
end
it "should have a description" do
expect(license["description"]).to_not be_nil
end
describe "SPDX compliance" do
# "No license" isn't really a license, so no need to test
unless license["id"] == "no-license"
it "#{license["id"]} should be a valid SPDX ID" do
expect(find_spdx(license["id"])).to_not be_nil
end
it "should be the proper SPDX name" do
spdx = find_spdx(license["id"])
expect(spdx[1]["name"].gsub(/ only$/,"")).to eql(license["title"])
end
# CC0 and Unlicense are not OSI approved, but that's okay
unless license["id"] == "unlicense" || license["id"] == "cc0-1.0"
it "should be OSI approved" do
spdx = find_spdx(license["id"])
expect(spdx[1]["osiApproved"]).to eql(true)
end
end
end
end
["permitted", "required", "forbidden"].each do |group|
describe "#{group} properties" do
it "should list the properties" do
expect(license[group]).to_not be_nil
end
license[group].to_a.each do |tag|
describe "#{tag} tag" do
it "should be a valid tag" do
expect(rule?(tag,group)).to be(true)
end
end
end
end
end
end
end
| Revert "remove OSI appoval requirement" | Revert "remove OSI appoval requirement"
This reverts commit 4b536ab4174a542dbfac7ee180d17349bf84d25d.
| Ruby | mit | waldyrious/choosealicense.com,drewwyatt/choosealicense.com,sieversMartin/choosealicense.com,matt40k/choosealicense.com,JTechMe/choosealicense.com,cirosantilli/choosealicense.com,JTechMe/choosealicense.com,cirosantilli/choosealicense.com,julianromera/choosealicense.com,sieversMartin/choosealicense.com,eogas/choosealicense.com,sieversMartin/choosealicense.com,github/choosealicense.com,eogas/choosealicense.com,christianbundy/choosealicense.com,julianromera/choosealicense.com,drewwyatt/choosealicense.com,waldyrious/choosealicense.com,julianromera/choosealicense.com,shalomb/choosealicense.com,drewwyatt/choosealicense.com,matt40k/choosealicense.com,christianbundy/choosealicense.com,eogas/choosealicense.com,matt40k/choosealicense.com,cirosantilli/choosealicense.com,christianbundy/choosealicense.com,github/choosealicense.com,JTechMe/choosealicense.com,waldyrious/choosealicense.com,shalomb/choosealicense.com,shalomb/choosealicense.com,github/choosealicense.com | ruby | ## Code Before:
require 'spec_helper'
licenses.each do |license|
describe "The #{license["title"]} license" do
it "should have a title" do
expect(license["title"]).to_not be_nil
end
it "should have a description" do
expect(license["description"]).to_not be_nil
end
describe "SPDX compliance" do
# "No license" isn't really a license, so no need to test
unless license["id"] == "no-license"
it "#{license["id"]} should be a valid SPDX ID" do
expect(find_spdx(license["id"])).to_not be_nil
end
it "should be the proper SPDX name" do
spdx = find_spdx(license["id"])
expect(spdx[1]["name"].gsub(/ only$/,"")).to eql(license["title"])
end
end
end
["permitted", "required", "forbidden"].each do |group|
describe "#{group} properties" do
it "should list the properties" do
expect(license[group]).to_not be_nil
end
license[group].to_a.each do |tag|
describe "#{tag} tag" do
it "should be a valid tag" do
expect(rule?(tag,group)).to be(true)
end
end
end
end
end
end
end
## Instruction:
Revert "remove OSI appoval requirement"
This reverts commit 4b536ab4174a542dbfac7ee180d17349bf84d25d.
## Code After:
require 'spec_helper'
licenses.each do |license|
describe "The #{license["title"]} license" do
it "should have a title" do
expect(license["title"]).to_not be_nil
end
it "should have a description" do
expect(license["description"]).to_not be_nil
end
describe "SPDX compliance" do
# "No license" isn't really a license, so no need to test
unless license["id"] == "no-license"
it "#{license["id"]} should be a valid SPDX ID" do
expect(find_spdx(license["id"])).to_not be_nil
end
it "should be the proper SPDX name" do
spdx = find_spdx(license["id"])
expect(spdx[1]["name"].gsub(/ only$/,"")).to eql(license["title"])
end
# CC0 and Unlicense are not OSI approved, but that's okay
unless license["id"] == "unlicense" || license["id"] == "cc0-1.0"
it "should be OSI approved" do
spdx = find_spdx(license["id"])
expect(spdx[1]["osiApproved"]).to eql(true)
end
end
end
end
["permitted", "required", "forbidden"].each do |group|
describe "#{group} properties" do
it "should list the properties" do
expect(license[group]).to_not be_nil
end
license[group].to_a.each do |tag|
describe "#{tag} tag" do
it "should be a valid tag" do
expect(rule?(tag,group)).to be(true)
end
end
end
end
end
end
end
| require 'spec_helper'
licenses.each do |license|
describe "The #{license["title"]} license" do
it "should have a title" do
expect(license["title"]).to_not be_nil
end
it "should have a description" do
expect(license["description"]).to_not be_nil
end
describe "SPDX compliance" do
# "No license" isn't really a license, so no need to test
unless license["id"] == "no-license"
it "#{license["id"]} should be a valid SPDX ID" do
expect(find_spdx(license["id"])).to_not be_nil
end
it "should be the proper SPDX name" do
spdx = find_spdx(license["id"])
expect(spdx[1]["name"].gsub(/ only$/,"")).to eql(license["title"])
end
+
+ # CC0 and Unlicense are not OSI approved, but that's okay
+ unless license["id"] == "unlicense" || license["id"] == "cc0-1.0"
+ it "should be OSI approved" do
+ spdx = find_spdx(license["id"])
+ expect(spdx[1]["osiApproved"]).to eql(true)
+ end
+ end
end
end
["permitted", "required", "forbidden"].each do |group|
describe "#{group} properties" do
it "should list the properties" do
expect(license[group]).to_not be_nil
end
license[group].to_a.each do |tag|
describe "#{tag} tag" do
it "should be a valid tag" do
expect(rule?(tag,group)).to be(true)
end
end
end
end
end
end
end | 8 | 0.186047 | 8 | 0 |
e9a5eb535dbe22263ac2871b6d87609ecff8d9db | packages/sy/sydtest-discover.yaml | packages/sy/sydtest-discover.yaml | homepage: https://github.com/NorfairKing/sydtest#readme
changelog-type: markdown
hash: c2fd2ceca6c47e15e0da065991150254719499a63d09b55abdf0727282009a1b
test-bench-deps: {}
maintainer: syd@cs-syd.eu
synopsis: Automatic test suite discovery for sydtest
changelog: |
# [0.0.0.1] 2021-11-12
## Changed
* Made the export list of the generated module explicit.
# [0.0.0.0] Initial version
basic-deps:
path: -any
base: '>=4.7 && <5'
filepath: -any
sydtest-discover: -any
optparse-applicative: -any
path-io: -any
all-versions:
- 0.0.0.0
- 0.0.0.1
author: Tom Sydney Kerckhove
latest: 0.0.0.1
description-type: haddock
description: ''
license-name: LicenseRef-OtherLicense
| homepage: https://github.com/NorfairKing/sydtest#readme
changelog-type: markdown
hash: 627c9c322a1ef61513948aa5b1880111543d2554d9d1cae7ebcd06a27449af5b
test-bench-deps: {}
maintainer: syd@cs-syd.eu
synopsis: Automatic test suite discovery for sydtest
changelog: |
# Changelog
## [0.0.0.2] - 2022-08-05
### Changed
* Use local warnings in generated code
## [0.0.0.1] - 2021-11-12
### Changed
* Made the export list of the generated module explicit.
## [0.0.0.0] - Initial version
basic-deps:
path: -any
base: '>=4.7 && <5'
filepath: -any
sydtest-discover: -any
optparse-applicative: -any
path-io: -any
all-versions:
- 0.0.0.0
- 0.0.0.1
- 0.0.0.2
author: Tom Sydney Kerckhove
latest: 0.0.0.2
description-type: haddock
description: ''
license-name: LicenseRef-OtherLicense
| Update from Hackage at 2022-09-05T16:34:06Z | Update from Hackage at 2022-09-05T16:34:06Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/NorfairKing/sydtest#readme
changelog-type: markdown
hash: c2fd2ceca6c47e15e0da065991150254719499a63d09b55abdf0727282009a1b
test-bench-deps: {}
maintainer: syd@cs-syd.eu
synopsis: Automatic test suite discovery for sydtest
changelog: |
# [0.0.0.1] 2021-11-12
## Changed
* Made the export list of the generated module explicit.
# [0.0.0.0] Initial version
basic-deps:
path: -any
base: '>=4.7 && <5'
filepath: -any
sydtest-discover: -any
optparse-applicative: -any
path-io: -any
all-versions:
- 0.0.0.0
- 0.0.0.1
author: Tom Sydney Kerckhove
latest: 0.0.0.1
description-type: haddock
description: ''
license-name: LicenseRef-OtherLicense
## Instruction:
Update from Hackage at 2022-09-05T16:34:06Z
## Code After:
homepage: https://github.com/NorfairKing/sydtest#readme
changelog-type: markdown
hash: 627c9c322a1ef61513948aa5b1880111543d2554d9d1cae7ebcd06a27449af5b
test-bench-deps: {}
maintainer: syd@cs-syd.eu
synopsis: Automatic test suite discovery for sydtest
changelog: |
# Changelog
## [0.0.0.2] - 2022-08-05
### Changed
* Use local warnings in generated code
## [0.0.0.1] - 2021-11-12
### Changed
* Made the export list of the generated module explicit.
## [0.0.0.0] - Initial version
basic-deps:
path: -any
base: '>=4.7 && <5'
filepath: -any
sydtest-discover: -any
optparse-applicative: -any
path-io: -any
all-versions:
- 0.0.0.0
- 0.0.0.1
- 0.0.0.2
author: Tom Sydney Kerckhove
latest: 0.0.0.2
description-type: haddock
description: ''
license-name: LicenseRef-OtherLicense
| homepage: https://github.com/NorfairKing/sydtest#readme
changelog-type: markdown
- hash: c2fd2ceca6c47e15e0da065991150254719499a63d09b55abdf0727282009a1b
+ hash: 627c9c322a1ef61513948aa5b1880111543d2554d9d1cae7ebcd06a27449af5b
test-bench-deps: {}
maintainer: syd@cs-syd.eu
synopsis: Automatic test suite discovery for sydtest
changelog: |
- # [0.0.0.1] 2021-11-12
+ # Changelog
+ ## [0.0.0.2] - 2022-08-05
+
- ## Changed
+ ### Changed
? +
+
+ * Use local warnings in generated code
+
+ ## [0.0.0.1] - 2021-11-12
+
+ ### Changed
* Made the export list of the generated module explicit.
- # [0.0.0.0] Initial version
+ ## [0.0.0.0] - Initial version
? + ++
basic-deps:
path: -any
base: '>=4.7 && <5'
filepath: -any
sydtest-discover: -any
optparse-applicative: -any
path-io: -any
all-versions:
- 0.0.0.0
- 0.0.0.1
+ - 0.0.0.2
author: Tom Sydney Kerckhove
- latest: 0.0.0.1
? ^
+ latest: 0.0.0.2
? ^
description-type: haddock
description: ''
license-name: LicenseRef-OtherLicense | 19 | 0.655172 | 14 | 5 |
95297cc7a9f4b8ce9ea15bd7a6486226a3aa08f5 | brew/packages.txt | brew/packages.txt | android-sdk
ansible
asciinema
awscli --HEAD
batik
binutils
cabal-install
chisel
chrome-cli
clib
clisp
cloc
ctags
ctags-objc-ja --HEAD --enable-japanese-support
curl --with-ssl --with-libssh2
direnv
elasticsearch
elixir
envchain
eot-utils
fontconfig
fontforge
freetype
fswatch
gcutil
gdb
gdbm
gettext
ghc
ghostscript
git
git-flow
git-ftp
git-lfs
go
gpg
graphviz
hicolor-icon-theme
httpie
hub
imagemagick
irssi --with-perl=yes --with-proxy --with-socks
jbig2dec
jpeg
jq
libepoxy
libpcap
lua
luajit
luarocks
macvim --HEAD --with-luajit
mdp
memcached
mercurial
mongodb
mysql
neovim --HEAD
ngrep
nkf
opencv
optipng
osquery
packer
parallel
pcre
phantomjs
php55
plantuml
postgresql
pstree
python3
q
r # require xquartz to be installed
ranger
redis
rsense
ruby-build
sbt
scala
sqlite
the_silver_searcher
tig
tmux
tree
typesafe-activator
vim --HEAD --disable-nls --override-system-vi --with-luajit
w3m
webkit2png
wget --enable-iri
xctool
zsh
| android-sdk
ansible
asciinema
awscli --HEAD
batik
binutils
cabal-install
chisel
chrome-cli
clib
clisp
cloc
ctags
ctags-objc-ja --HEAD --enable-japanese-support
curl --with-ssl --with-libssh2
direnv
elasticsearch
elixir
envchain
eot-utils
fontconfig
fontforge
freetype
fswatch
gcutil
gdb
gdbm
gettext
ghc
ghostscript
git
git-flow
git-ftp
git-lfs
go
gpg
graphviz
hicolor-icon-theme
httpie
hub
imagemagick
irssi --with-perl=yes --with-proxy --with-socks
jbig2dec
jpeg
jq
libepoxy
libiconv
libpcap
libxml2
libxslt
lua
luajit
luarocks
macvim --HEAD --with-luajit
mdp
memcached
mercurial
mongodb
mysql
neovim --HEAD
ngrep
nkf
opencv
optipng
osquery
packer
parallel
pcre
phantomjs
php55
plantuml
postgresql
pstree
python3
q
r # require xquartz to be installed
ranger
redis
rsense
ruby-build
sbt
scala
sqlite
the_silver_searcher
tig
tmux
tree
typesafe-activator
vim --HEAD --disable-nls --override-system-vi --with-luajit
w3m
webkit2png
wget --enable-iri
xctool
zsh
| Install libxml2, libxslt, and libiconv | Install libxml2, libxslt, and libiconv
| Text | mit | creasty/dotfiles,creasty/dotfiles,creasty/dotfiles,creasty/dotfiles,creasty/dotfiles,creasty/dotfiles,creasty/dotfiles,creasty/dotfiles | text | ## Code Before:
android-sdk
ansible
asciinema
awscli --HEAD
batik
binutils
cabal-install
chisel
chrome-cli
clib
clisp
cloc
ctags
ctags-objc-ja --HEAD --enable-japanese-support
curl --with-ssl --with-libssh2
direnv
elasticsearch
elixir
envchain
eot-utils
fontconfig
fontforge
freetype
fswatch
gcutil
gdb
gdbm
gettext
ghc
ghostscript
git
git-flow
git-ftp
git-lfs
go
gpg
graphviz
hicolor-icon-theme
httpie
hub
imagemagick
irssi --with-perl=yes --with-proxy --with-socks
jbig2dec
jpeg
jq
libepoxy
libpcap
lua
luajit
luarocks
macvim --HEAD --with-luajit
mdp
memcached
mercurial
mongodb
mysql
neovim --HEAD
ngrep
nkf
opencv
optipng
osquery
packer
parallel
pcre
phantomjs
php55
plantuml
postgresql
pstree
python3
q
r # require xquartz to be installed
ranger
redis
rsense
ruby-build
sbt
scala
sqlite
the_silver_searcher
tig
tmux
tree
typesafe-activator
vim --HEAD --disable-nls --override-system-vi --with-luajit
w3m
webkit2png
wget --enable-iri
xctool
zsh
## Instruction:
Install libxml2, libxslt, and libiconv
## Code After:
android-sdk
ansible
asciinema
awscli --HEAD
batik
binutils
cabal-install
chisel
chrome-cli
clib
clisp
cloc
ctags
ctags-objc-ja --HEAD --enable-japanese-support
curl --with-ssl --with-libssh2
direnv
elasticsearch
elixir
envchain
eot-utils
fontconfig
fontforge
freetype
fswatch
gcutil
gdb
gdbm
gettext
ghc
ghostscript
git
git-flow
git-ftp
git-lfs
go
gpg
graphviz
hicolor-icon-theme
httpie
hub
imagemagick
irssi --with-perl=yes --with-proxy --with-socks
jbig2dec
jpeg
jq
libepoxy
libiconv
libpcap
libxml2
libxslt
lua
luajit
luarocks
macvim --HEAD --with-luajit
mdp
memcached
mercurial
mongodb
mysql
neovim --HEAD
ngrep
nkf
opencv
optipng
osquery
packer
parallel
pcre
phantomjs
php55
plantuml
postgresql
pstree
python3
q
r # require xquartz to be installed
ranger
redis
rsense
ruby-build
sbt
scala
sqlite
the_silver_searcher
tig
tmux
tree
typesafe-activator
vim --HEAD --disable-nls --override-system-vi --with-luajit
w3m
webkit2png
wget --enable-iri
xctool
zsh
| android-sdk
ansible
asciinema
awscli --HEAD
batik
binutils
cabal-install
chisel
chrome-cli
clib
clisp
cloc
ctags
ctags-objc-ja --HEAD --enable-japanese-support
curl --with-ssl --with-libssh2
direnv
elasticsearch
elixir
envchain
eot-utils
fontconfig
fontforge
freetype
fswatch
gcutil
gdb
gdbm
gettext
ghc
ghostscript
git
git-flow
git-ftp
git-lfs
go
gpg
graphviz
hicolor-icon-theme
httpie
hub
imagemagick
irssi --with-perl=yes --with-proxy --with-socks
jbig2dec
jpeg
jq
libepoxy
+ libiconv
libpcap
+ libxml2
+ libxslt
lua
luajit
luarocks
macvim --HEAD --with-luajit
mdp
memcached
mercurial
mongodb
mysql
neovim --HEAD
ngrep
nkf
opencv
optipng
osquery
packer
parallel
pcre
phantomjs
php55
plantuml
postgresql
pstree
python3
q
r # require xquartz to be installed
ranger
redis
rsense
ruby-build
sbt
scala
sqlite
the_silver_searcher
tig
tmux
tree
typesafe-activator
vim --HEAD --disable-nls --override-system-vi --with-luajit
w3m
webkit2png
wget --enable-iri
xctool
zsh | 3 | 0.032967 | 3 | 0 |
424bc13c7feb28110f462d4b1e7d11f76885a9b9 | app/helpers/spree/admin/navigation_helper_decorator.rb | app/helpers/spree/admin/navigation_helper_decorator.rb | Spree::Admin::NavigationHelper.module_eval do
def tab_with_legacy_return_authorizations(*args)
if args.first == :orders
options = args.pop if args.last.is_a?(Hash)
args << :legacy_return_authorizations
args << options
end
tab_without_legacy_return_authorizations(*args)
end
alias_method_chain :tab, :legacy_return_authorizations
end
| Spree::Admin::NavigationHelper.module_eval do
def tab_with_legacy_return_authorizations(*args, &block)
if args.first == :orders
options = args.pop if args.last.is_a?(Hash)
args << :legacy_return_authorizations
args << options
end
tab_without_legacy_return_authorizations(*args, &block)
end
alias_method_chain :tab, :legacy_return_authorizations
end
| Fix method override to include block | Fix method override to include block
Compatibility with upcoming navigation changes.
| Ruby | bsd-3-clause | solidusio/solidus_legacy_return_authorizations,solidusio/solidus_legacy_return_authorizations,solidusio/solidus_legacy_return_authorizations | ruby | ## Code Before:
Spree::Admin::NavigationHelper.module_eval do
def tab_with_legacy_return_authorizations(*args)
if args.first == :orders
options = args.pop if args.last.is_a?(Hash)
args << :legacy_return_authorizations
args << options
end
tab_without_legacy_return_authorizations(*args)
end
alias_method_chain :tab, :legacy_return_authorizations
end
## Instruction:
Fix method override to include block
Compatibility with upcoming navigation changes.
## Code After:
Spree::Admin::NavigationHelper.module_eval do
def tab_with_legacy_return_authorizations(*args, &block)
if args.first == :orders
options = args.pop if args.last.is_a?(Hash)
args << :legacy_return_authorizations
args << options
end
tab_without_legacy_return_authorizations(*args, &block)
end
alias_method_chain :tab, :legacy_return_authorizations
end
| Spree::Admin::NavigationHelper.module_eval do
- def tab_with_legacy_return_authorizations(*args)
+ def tab_with_legacy_return_authorizations(*args, &block)
? ++++++++
if args.first == :orders
options = args.pop if args.last.is_a?(Hash)
args << :legacy_return_authorizations
args << options
end
- tab_without_legacy_return_authorizations(*args)
+ tab_without_legacy_return_authorizations(*args, &block)
? ++++++++
end
alias_method_chain :tab, :legacy_return_authorizations
end | 4 | 0.333333 | 2 | 2 |
8e603d219c632fe00b843d8cfd609801ff63e3a0 | VideoLocker/src/main/java/org/edx/mobile/view/FindCoursesActivity.java | VideoLocker/src/main/java/org/edx/mobile/view/FindCoursesActivity.java | package org.edx.mobile.view;
import android.os.Bundle;
import android.webkit.WebView;
import org.edx.mobile.R;
import org.edx.mobile.base.FindCoursesBaseActivity;
import org.edx.mobile.util.Config;
public class FindCoursesActivity extends FindCoursesBaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_find_courses);
super.onCreate(savedInstanceState);
// configure slider layout. This should be called only once and
// hence is shifted to onCreate() function
configureDrawer();
try{
segIO.screenViewsTracking(getString(R.string.find_courses_title));
}catch(Exception e){
logger.error(e);
}
}
@Override
protected void onStart() {
super.onStart();
String url = Config.getInstance().getEnrollmentConfig().getCourseSearchUrl();
WebView webview = (WebView) findViewById(R.id.webview);
webview.loadUrl(url);
}
}
| package org.edx.mobile.view;
import android.os.Bundle;
import android.webkit.WebView;
import org.edx.mobile.R;
import org.edx.mobile.base.FindCoursesBaseActivity;
import org.edx.mobile.util.Config;
public class FindCoursesActivity extends FindCoursesBaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_find_courses);
super.onCreate(savedInstanceState);
// configure slider layout. This should be called only once and
// hence is shifted to onCreate() function
configureDrawer();
try{
segIO.screenViewsTracking(getString(R.string.find_courses_title));
}catch(Exception e){
logger.error(e);
}
String url = Config.getInstance().getEnrollmentConfig().getCourseSearchUrl();
WebView webview = (WebView) findViewById(R.id.webview);
webview.loadUrl(url);
}
}
| Stop webview reloading in Find Courses | Stop webview reloading in Find Courses
| Java | apache-2.0 | ariestiyansyah/indonesiax-android,edx/edx-app-android,adoosii/edx-app-android,KirillMakarov/edx-app-android,ahmedaljazzar/edx-app-android,miptliot/edx-app-android,edx/edx-app-android,ahmedaljazzar/edx-app-android,IndonesiaX/edx-app-android,ariestiyansyah/indonesiax-android,ariestiyansyah/indonesiax-android,edx/edx-app-android,Rawneed/edx-app-android,IndonesiaX/edx-app-android,Rawneed/edx-app-android,adoosii/edx-app-android,edx/edx-app-android,miptliot/edx-app-android,Rawneed/edx-app-android,KirillMakarov/edx-app-android,adoosii/edx-app-android,miptliot/edx-app-android,knehez/edx-app-android,knehez/edx-app-android,KirillMakarov/edx-app-android,edx/edx-app-android,edx/edx-app-android,IndonesiaX/edx-app-android,knehez/edx-app-android | java | ## Code Before:
package org.edx.mobile.view;
import android.os.Bundle;
import android.webkit.WebView;
import org.edx.mobile.R;
import org.edx.mobile.base.FindCoursesBaseActivity;
import org.edx.mobile.util.Config;
public class FindCoursesActivity extends FindCoursesBaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_find_courses);
super.onCreate(savedInstanceState);
// configure slider layout. This should be called only once and
// hence is shifted to onCreate() function
configureDrawer();
try{
segIO.screenViewsTracking(getString(R.string.find_courses_title));
}catch(Exception e){
logger.error(e);
}
}
@Override
protected void onStart() {
super.onStart();
String url = Config.getInstance().getEnrollmentConfig().getCourseSearchUrl();
WebView webview = (WebView) findViewById(R.id.webview);
webview.loadUrl(url);
}
}
## Instruction:
Stop webview reloading in Find Courses
## Code After:
package org.edx.mobile.view;
import android.os.Bundle;
import android.webkit.WebView;
import org.edx.mobile.R;
import org.edx.mobile.base.FindCoursesBaseActivity;
import org.edx.mobile.util.Config;
public class FindCoursesActivity extends FindCoursesBaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_find_courses);
super.onCreate(savedInstanceState);
// configure slider layout. This should be called only once and
// hence is shifted to onCreate() function
configureDrawer();
try{
segIO.screenViewsTracking(getString(R.string.find_courses_title));
}catch(Exception e){
logger.error(e);
}
String url = Config.getInstance().getEnrollmentConfig().getCourseSearchUrl();
WebView webview = (WebView) findViewById(R.id.webview);
webview.loadUrl(url);
}
}
| package org.edx.mobile.view;
import android.os.Bundle;
import android.webkit.WebView;
import org.edx.mobile.R;
import org.edx.mobile.base.FindCoursesBaseActivity;
import org.edx.mobile.util.Config;
public class FindCoursesActivity extends FindCoursesBaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_find_courses);
super.onCreate(savedInstanceState);
// configure slider layout. This should be called only once and
// hence is shifted to onCreate() function
configureDrawer();
try{
segIO.screenViewsTracking(getString(R.string.find_courses_title));
}catch(Exception e){
logger.error(e);
}
- }
-
- @Override
- protected void onStart() {
- super.onStart();
-
String url = Config.getInstance().getEnrollmentConfig().getCourseSearchUrl();
WebView webview = (WebView) findViewById(R.id.webview);
webview.loadUrl(url);
}
+
} | 7 | 0.194444 | 1 | 6 |
1e27cbdf1758b63c8a605f78f419a136c0ac279b | requirements.txt | requirements.txt | six==1.10.0
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
configargparse==0.10.0
click==6.6
itsdangerous==0.24
peewee==2.8.1
wsgiref==0.1.2
geopy==1.11.0
s2sphere==0.2.4
PyMySQL==0.7.5
flask-cors==2.1.2
flask-compress==1.3.0
LatLon==1.0.1
git+https://github.com/pogodevorg/pgoapi.git@49e958b3b30b3d7e1baa6944964100e73ca90d7f#egg=pgoapi
xxhash
sphinx==1.4.5
sphinx-autobuild==0.6.0
recommonmark==0.4.0
sphinx_rtd_theme==0.1.9
requests==2.13.0
requests-futures==0.9.7
PySocks==1.5.6
git+https://github.com/maddhatter/Flask-CacheBust.git@38d940cc4f18b5fcb5687746294e0360640a107e#egg=flask_cachebust
cachetools==2.0.0
| six==1.10.0
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
configargparse==0.10.0
click==6.6
itsdangerous==0.24
peewee==2.8.1
wsgiref==0.1.2
geopy==1.11.0
s2sphere==0.2.4
PyMySQL==0.7.5
flask-cors==2.1.2
flask-compress==1.3.0
LatLon==1.0.1
git+https://github.com/pogodevorg/pgoapi.git@829e302b5710460a9d8bb299ce6bb0556048a0ad#egg=pgoapi
xxhash
sphinx==1.4.5
sphinx-autobuild==0.6.0
recommonmark==0.4.0
sphinx_rtd_theme==0.1.9
requests==2.13.0
requests-futures==0.9.7
PySocks==1.5.6
git+https://github.com/maddhatter/Flask-CacheBust.git@38d940cc4f18b5fcb5687746294e0360640a107e#egg=flask_cachebust
cachetools==2.0.0
| Update pgoapi to latest develop | Update pgoapi to latest develop
| Text | agpl-3.0 | tomballgithub/RocketMap,Alderon86/RocketMap,pkgta1/shuffle,rpotpogo/PokemonGo-Map,mpw1337/RocketMap,voxx/RocketMap,houkop/PokemonGo-Map,Alderon86/RocketMap,voxx/RocketMap,ultrafunkamsterdam/PokemonGo-Map,mpw1337/RocketMap,sebastienvercammen/RocketMap,tomballgithub/RocketMap,birdstream/RocketMap,pkgta1/shuffle,JapuDCret/RocketMap-Do,rpotpogo/PokemonGo-Map,HowDoesExcelWork/RocketMap,tomballgithub/RocketMap,AEtHeLsYn/RocketMap,pkgta1/shuffle,neskk/RocketMap,djfye/RocketMap,neskk/PokemonGo-Map,RocketMap/RocketMap,boby361/RocketMap,KoertJanssens/MasterBall.be,sclo012/PokemonGo-Map,ultrafunkamsterdam/PokemonGo-Map,ultrafunkamsterdam/PokemonGo-Map-V2,AEtHeLsYn/RocketMap,pgandev/RocketMap,houkop/PokemonGo-Map,rpotpogo/PokemonGo-Map,AEtHeLsYn/RocketMap,ultrafunkamsterdam/PokemonGo-Map-V2,sebastienvercammen/RocketMap,sclo012/PokemonGo-Map,RocketMap/RocketMap,birdstream/RocketMap,voxx/RocketMap,neskk/PokemonGo-Map,neskk/RocketMap,neskk/RocketMap,AEtHeLsYn/RocketMap,ultrafunkamsterdam/PokemonGo-Map-V2,sclo012/PokemonGo-Map,boby361/RocketMap,djfye/PokemonGo-Map,houkop/PokemonGo-Map,rpotpogo/PokemonGo-Map,pkgta1/shuffle,boby361/RocketMap,birdstream/RocketMap,JapuDCret/RocketMap-Do,djfye/PokemonGo-Map,hubertokf/RocketMap,ultrafunkamsterdam/PokemonGo-Map-V2,houkop/PokemonGo-Map,HowDoesExcelWork/RocketMap,Alderon86/RocketMap,RocketMap/RocketMap,Alderon86/RocketMap,hubertokf/RocketMap,boby361/RocketMap,neskk/PokemonGo-Map,ultrafunkamsterdam/PokemonGo-Map,voxx/RocketMap,sebastienvercammen/RocketMap,sebastienvercammen/RocketMap,pgandev/RocketMap,djfye/PokemonGo-Map,mpw1337/RocketMap,sclo012/PokemonGo-Map,tomballgithub/RocketMap,KoertJanssens/MasterBall.be,KoertJanssens/MasterBall.be,JapuDCret/RocketMap-Do,djfye/RocketMap,hubertokf/RocketMap,HowDoesExcelWork/RocketMap,birdstream/RocketMap,ultrafunkamsterdam/PokemonGo-Map,mpw1337/RocketMap,RocketMap/RocketMap,hubertokf/RocketMap,HowDoesExcelWork/RocketMap,neskk/PokemonGo-Map,neskk/RocketMap,JapuDCret/RocketMap-Do,pgandev/RocketMap,djfye/PokemonGo-Map,KoertJanssens/MasterBall.be,djfye/RocketMap,pgandev/RocketMap,djfye/RocketMap | text | ## Code Before:
six==1.10.0
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
configargparse==0.10.0
click==6.6
itsdangerous==0.24
peewee==2.8.1
wsgiref==0.1.2
geopy==1.11.0
s2sphere==0.2.4
PyMySQL==0.7.5
flask-cors==2.1.2
flask-compress==1.3.0
LatLon==1.0.1
git+https://github.com/pogodevorg/pgoapi.git@49e958b3b30b3d7e1baa6944964100e73ca90d7f#egg=pgoapi
xxhash
sphinx==1.4.5
sphinx-autobuild==0.6.0
recommonmark==0.4.0
sphinx_rtd_theme==0.1.9
requests==2.13.0
requests-futures==0.9.7
PySocks==1.5.6
git+https://github.com/maddhatter/Flask-CacheBust.git@38d940cc4f18b5fcb5687746294e0360640a107e#egg=flask_cachebust
cachetools==2.0.0
## Instruction:
Update pgoapi to latest develop
## Code After:
six==1.10.0
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
configargparse==0.10.0
click==6.6
itsdangerous==0.24
peewee==2.8.1
wsgiref==0.1.2
geopy==1.11.0
s2sphere==0.2.4
PyMySQL==0.7.5
flask-cors==2.1.2
flask-compress==1.3.0
LatLon==1.0.1
git+https://github.com/pogodevorg/pgoapi.git@829e302b5710460a9d8bb299ce6bb0556048a0ad#egg=pgoapi
xxhash
sphinx==1.4.5
sphinx-autobuild==0.6.0
recommonmark==0.4.0
sphinx_rtd_theme==0.1.9
requests==2.13.0
requests-futures==0.9.7
PySocks==1.5.6
git+https://github.com/maddhatter/Flask-CacheBust.git@38d940cc4f18b5fcb5687746294e0360640a107e#egg=flask_cachebust
cachetools==2.0.0
| six==1.10.0
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
configargparse==0.10.0
click==6.6
itsdangerous==0.24
peewee==2.8.1
wsgiref==0.1.2
geopy==1.11.0
s2sphere==0.2.4
PyMySQL==0.7.5
flask-cors==2.1.2
flask-compress==1.3.0
LatLon==1.0.1
- git+https://github.com/pogodevorg/pgoapi.git@49e958b3b30b3d7e1baa6944964100e73ca90d7f#egg=pgoapi
+ git+https://github.com/pogodevorg/pgoapi.git@829e302b5710460a9d8bb299ce6bb0556048a0ad#egg=pgoapi
xxhash
sphinx==1.4.5
sphinx-autobuild==0.6.0
recommonmark==0.4.0
sphinx_rtd_theme==0.1.9
requests==2.13.0
requests-futures==0.9.7
PySocks==1.5.6
git+https://github.com/maddhatter/Flask-CacheBust.git@38d940cc4f18b5fcb5687746294e0360640a107e#egg=flask_cachebust
cachetools==2.0.0 | 2 | 0.074074 | 1 | 1 |
0d460b7be4d98114e0b9058c2e715df3257050f9 | app/views/answers/_form.html.erb | app/views/answers/_form.html.erb | <%= form_for [@question, answer, @comment] do |f| %>
<%= f.hidden_field :commentable_type, :value => "Answer" %>
<%= f.label :content %>
<%= f.text_field :content %>
<%= f.submit %>
<% end %>
| <%= form_for [@question, answer, @comment] do |f| %>
<%= f.hidden_field :commentable_type, :value => "Answer" %>
<%= f.hidden_field :commentable_id, :value => @question.id %>
<%= f.label :content %>
<%= f.text_field :content %>
<%= f.submit %>
<% end %>
| Clean up new answer form | Clean up new answer form
| HTML+ERB | mit | daviddeneroff/shaq-overflow,daviddeneroff/shaq-overflow,daviddeneroff/shaq-overflow | html+erb | ## Code Before:
<%= form_for [@question, answer, @comment] do |f| %>
<%= f.hidden_field :commentable_type, :value => "Answer" %>
<%= f.label :content %>
<%= f.text_field :content %>
<%= f.submit %>
<% end %>
## Instruction:
Clean up new answer form
## Code After:
<%= form_for [@question, answer, @comment] do |f| %>
<%= f.hidden_field :commentable_type, :value => "Answer" %>
<%= f.hidden_field :commentable_id, :value => @question.id %>
<%= f.label :content %>
<%= f.text_field :content %>
<%= f.submit %>
<% end %>
| <%= form_for [@question, answer, @comment] do |f| %>
<%= f.hidden_field :commentable_type, :value => "Answer" %>
+ <%= f.hidden_field :commentable_id, :value => @question.id %>
<%= f.label :content %>
<%= f.text_field :content %>
-
<%= f.submit %>
<% end %> | 2 | 0.25 | 1 | 1 |
66430033b9c4508c9f90640731e73f55ca273b00 | ci/save-credentials.sh | ci/save-credentials.sh |
set -e
TOKEN=${GH_TOKEN:?'GH_TOKEN not set!'}
touch ${HOME}/.netrc
chmod 0600 ${HOME}/.netrc
echo "Writing OAuth token to .netrc."
echo "machine github.com login $TOKEN password x-oauth-basic" >> ${HOME}/.netrc
echo "HOME looks like:"
ls -la ${HOME}
echo ".netrc contains:"
grep -o -E "^machine[[:space:]]+[^[:space:]]+[[:space:]]+login" ~/.netrc
echo "trying clone:"
git clone --verbose https://github.com/davisp/ghp-import
|
set -e
TOKEN=${GH_TOKEN:?'GH_TOKEN not set!'}
REPO=${TRAVIS_REPO_SLUG:?'TRAVIS_REPO_SLUG not set!'}
echo "Writing OAuth token to .netrc."
touch ${HOME}/.netrc
chmod 0600 ${HOME}/.netrc
echo "machine github.com login $TOKEN password x-oauth-basic" >> ${HOME}/.netrc
echo "Setting origin to use HTTPS for pushing"
git remote set-url --push origin "https://github.com/${REPO}"
| Deploy docs via HTTPS. Cleanup debugging while here. | Deploy docs via HTTPS. Cleanup debugging while here.
| Shell | apache-2.0 | Rufflewind/rsmpi,Rufflewind/rsmpi,Rufflewind/rsmpi | shell | ## Code Before:
set -e
TOKEN=${GH_TOKEN:?'GH_TOKEN not set!'}
touch ${HOME}/.netrc
chmod 0600 ${HOME}/.netrc
echo "Writing OAuth token to .netrc."
echo "machine github.com login $TOKEN password x-oauth-basic" >> ${HOME}/.netrc
echo "HOME looks like:"
ls -la ${HOME}
echo ".netrc contains:"
grep -o -E "^machine[[:space:]]+[^[:space:]]+[[:space:]]+login" ~/.netrc
echo "trying clone:"
git clone --verbose https://github.com/davisp/ghp-import
## Instruction:
Deploy docs via HTTPS. Cleanup debugging while here.
## Code After:
set -e
TOKEN=${GH_TOKEN:?'GH_TOKEN not set!'}
REPO=${TRAVIS_REPO_SLUG:?'TRAVIS_REPO_SLUG not set!'}
echo "Writing OAuth token to .netrc."
touch ${HOME}/.netrc
chmod 0600 ${HOME}/.netrc
echo "machine github.com login $TOKEN password x-oauth-basic" >> ${HOME}/.netrc
echo "Setting origin to use HTTPS for pushing"
git remote set-url --push origin "https://github.com/${REPO}"
|
set -e
TOKEN=${GH_TOKEN:?'GH_TOKEN not set!'}
+ REPO=${TRAVIS_REPO_SLUG:?'TRAVIS_REPO_SLUG not set!'}
+ echo "Writing OAuth token to .netrc."
touch ${HOME}/.netrc
chmod 0600 ${HOME}/.netrc
- echo "Writing OAuth token to .netrc."
echo "machine github.com login $TOKEN password x-oauth-basic" >> ${HOME}/.netrc
+ echo "Setting origin to use HTTPS for pushing"
+ git remote set-url --push origin "https://github.com/${REPO}"
- echo "HOME looks like:"
- ls -la ${HOME}
-
- echo ".netrc contains:"
- grep -o -E "^machine[[:space:]]+[^[:space:]]+[[:space:]]+login" ~/.netrc
-
- echo "trying clone:"
- git clone --verbose https://github.com/davisp/ghp-import | 13 | 0.722222 | 4 | 9 |
74a8f69a07dffada2bd21c549ddedec4fe1e248a | www/base.html | www/base.html | <!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, minimal-ui">
<link rel="apple-touch-icon-precomposed" href="/trained-to-thrill/static/imgs/icon.png">
<link rel="icon" href="/trained-to-thrill/static/imgs/icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="Trained To Thrill" />
<link rel="stylesheet" href="/trained-to-thrill/static/css/all.css">
{% block head %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<script src="/trained-to-thrill/static/js/page.js"></script>
{% block bodyEnd %}{% endblock %}
</body>
</html> | <!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, minimal-ui">
<link rel="apple-touch-icon-precomposed" href="/trained-to-thrill/static/imgs/icon.png">
<link rel="icon" href="/trained-to-thrill/static/imgs/icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="Trained To Thrill">
<link rel="stylesheet" href="/trained-to-thrill/static/css/all.css">
{% block head %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<script src="/trained-to-thrill/static/js/page.js"></script>
{% block bodyEnd %}{% endblock %}
</body>
</html>
| Fix garbled text for some environments | Fix garbled text for some environments
The new train update thingy and the console message are garbled on my
Japanese Windows machine. Adding charset encoding should fix the issue.
Also, removed a trailing slash.
| HTML | apache-2.0 | jakearchibald/trained-to-thrill,jiagang/trained-to-thrill,jiagang/trained-to-thrill,jakearchibald/trained-to-thrill | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, minimal-ui">
<link rel="apple-touch-icon-precomposed" href="/trained-to-thrill/static/imgs/icon.png">
<link rel="icon" href="/trained-to-thrill/static/imgs/icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="Trained To Thrill" />
<link rel="stylesheet" href="/trained-to-thrill/static/css/all.css">
{% block head %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<script src="/trained-to-thrill/static/js/page.js"></script>
{% block bodyEnd %}{% endblock %}
</body>
</html>
## Instruction:
Fix garbled text for some environments
The new train update thingy and the console message are garbled on my
Japanese Windows machine. Adding charset encoding should fix the issue.
Also, removed a trailing slash.
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, minimal-ui">
<link rel="apple-touch-icon-precomposed" href="/trained-to-thrill/static/imgs/icon.png">
<link rel="icon" href="/trained-to-thrill/static/imgs/icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="Trained To Thrill">
<link rel="stylesheet" href="/trained-to-thrill/static/css/all.css">
{% block head %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<script src="/trained-to-thrill/static/js/page.js"></script>
{% block bodyEnd %}{% endblock %}
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
+ <meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, minimal-ui">
<link rel="apple-touch-icon-precomposed" href="/trained-to-thrill/static/imgs/icon.png">
<link rel="icon" href="/trained-to-thrill/static/imgs/icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="application-name" content="Trained To Thrill" />
? --
+ <meta name="application-name" content="Trained To Thrill">
<link rel="stylesheet" href="/trained-to-thrill/static/css/all.css">
{% block head %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<script src="/trained-to-thrill/static/js/page.js"></script>
{% block bodyEnd %}{% endblock %}
</body>
</html> | 3 | 0.166667 | 2 | 1 |
bec04fe312d58402f7d64851712da9b0c59949e5 | index.md | index.md | ---
layout: home
permalink: /
image:
feature: fur-1600x800.jpg
---
<div class="tiles">
<div class="tile">
<h2 class="post-title">Built for Jekyll 2</h2>
<p class="post-excerpt">Takes advantage of native Sass support and data files to make customizing your site easier.</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Content First</h2>
<p class="post-excerpt">Designed to put the focus on you and your writing. Headers, navigation, sidebars, and footers have been purposely deemphasized.</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Customizable</h2>
<p class="post-excerpt">Packed with layouts and modules. Include Disqus comments, social sharing buttons, and table of contents on one or all pages.</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Extensible</h2>
<p class="post-excerpt">Compatible with popular libraries like <a href="http://bourbon.io">Bourbon</a>, <a href="http://neat.bourbon.io/">Neat</a>, and <a href="http://github.com/octopress/octopress">Octopress</a> to help build and deploy your site with ease.</p>
</div><!-- /.tile -->
</div><!-- /.tiles -->
| ---
layout: home
permalink: /
image:
feature: fur-1600x800.jpg
---
<div class="tiles">
<div class="tile">
<h2 class="post-title">Sensory Potential</h2>
<p class="post-excerpt">When was the last time you took your sensorium for a thorough test drive?</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Technological Challenges</h2>
<p class="post-excerpt">What problems stand in the way of exploring unique sensual experiences, and how can we engineer around them?</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Social Context</h2>
<p class="post-excerpt">Why do we push some of our buttons often, and others rarely or never?</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Imagination</h2>
<p class="post-excerpt">What experiences might we invent if we let go of practicality or even possibility?</p>
</div><!-- /.tile -->
</div><!-- /.tiles -->
| Remove placeholder content from home page | Remove placeholder content from home page
| Markdown | mit | hedonismlab/hedonismlab.com,hedonismlab/hedonismlab.com,hedonismlab/hedonismlab.com | markdown | ## Code Before:
---
layout: home
permalink: /
image:
feature: fur-1600x800.jpg
---
<div class="tiles">
<div class="tile">
<h2 class="post-title">Built for Jekyll 2</h2>
<p class="post-excerpt">Takes advantage of native Sass support and data files to make customizing your site easier.</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Content First</h2>
<p class="post-excerpt">Designed to put the focus on you and your writing. Headers, navigation, sidebars, and footers have been purposely deemphasized.</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Customizable</h2>
<p class="post-excerpt">Packed with layouts and modules. Include Disqus comments, social sharing buttons, and table of contents on one or all pages.</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Extensible</h2>
<p class="post-excerpt">Compatible with popular libraries like <a href="http://bourbon.io">Bourbon</a>, <a href="http://neat.bourbon.io/">Neat</a>, and <a href="http://github.com/octopress/octopress">Octopress</a> to help build and deploy your site with ease.</p>
</div><!-- /.tile -->
</div><!-- /.tiles -->
## Instruction:
Remove placeholder content from home page
## Code After:
---
layout: home
permalink: /
image:
feature: fur-1600x800.jpg
---
<div class="tiles">
<div class="tile">
<h2 class="post-title">Sensory Potential</h2>
<p class="post-excerpt">When was the last time you took your sensorium for a thorough test drive?</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Technological Challenges</h2>
<p class="post-excerpt">What problems stand in the way of exploring unique sensual experiences, and how can we engineer around them?</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Social Context</h2>
<p class="post-excerpt">Why do we push some of our buttons often, and others rarely or never?</p>
</div><!-- /.tile -->
<div class="tile">
<h2 class="post-title">Imagination</h2>
<p class="post-excerpt">What experiences might we invent if we let go of practicality or even possibility?</p>
</div><!-- /.tile -->
</div><!-- /.tiles -->
| ---
layout: home
permalink: /
image:
feature: fur-1600x800.jpg
---
<div class="tiles">
<div class="tile">
- <h2 class="post-title">Built for Jekyll 2</h2>
- <p class="post-excerpt">Takes advantage of native Sass support and data files to make customizing your site easier.</p>
+ <h2 class="post-title">Sensory Potential</h2>
+ <p class="post-excerpt">When was the last time you took your sensorium for a thorough test drive?</p>
</div><!-- /.tile -->
<div class="tile">
- <h2 class="post-title">Content First</h2>
- <p class="post-excerpt">Designed to put the focus on you and your writing. Headers, navigation, sidebars, and footers have been purposely deemphasized.</p>
+ <h2 class="post-title">Technological Challenges</h2>
+ <p class="post-excerpt">What problems stand in the way of exploring unique sensual experiences, and how can we engineer around them?</p>
</div><!-- /.tile -->
<div class="tile">
- <h2 class="post-title">Customizable</h2>
? ^^ -------
+ <h2 class="post-title">Social Context</h2>
? +++++++ ^^ ++
- <p class="post-excerpt">Packed with layouts and modules. Include Disqus comments, social sharing buttons, and table of contents on one or all pages.</p>
+ <p class="post-excerpt">Why do we push some of our buttons often, and others rarely or never?</p>
</div><!-- /.tile -->
<div class="tile">
- <h2 class="post-title">Extensible</h2>
? ^^ ^ -----
+ <h2 class="post-title">Imagination</h2>
? ^^^^^^^ ^^
- <p class="post-excerpt">Compatible with popular libraries like <a href="http://bourbon.io">Bourbon</a>, <a href="http://neat.bourbon.io/">Neat</a>, and <a href="http://github.com/octopress/octopress">Octopress</a> to help build and deploy your site with ease.</p>
+ <p class="post-excerpt">What experiences might we invent if we let go of practicality or even possibility?</p>
</div><!-- /.tile -->
</div><!-- /.tiles --> | 16 | 0.533333 | 8 | 8 |
9b95eab01d70a3e662dbb95810a304fe34918f49 | app/models/spree/digital.rb | app/models/spree/digital.rb | module Spree
class Digital < ActiveRecord::Base
belongs_to :variant
has_many :digital_links, :dependent => :destroy
has_attached_file :attachment, :path => ":rails_root/private/digitals/:id/:basename.:extension"
if Paperclip::Attachment.default_options[:storage] == :s3
attachment_definitions[:attachment][:s3_permissions] = :private
attachment_definitions[:attachment][:s3_headers] = { :content_disposition => 'attachment' }
end
end
end | module Spree
class Digital < ActiveRecord::Base
belongs_to :variant
has_many :digital_links, :dependent => :destroy
has_attached_file :attachment, :path => ":rails_root/private/digitals/:id/:basename.:extension"
validates_attachment_content_type :attachment, :content_type => %w(audio/mpeg application/x-mobipocket-ebook application/epub+zip application/pdf application/zip image/jpeg)
if Paperclip::Attachment.default_options[:storage] == :s3
attachment_definitions[:attachment][:s3_permissions] = :private
attachment_definitions[:attachment][:s3_headers] = { :content_disposition => 'attachment' }
end
end
end
| Validate attachment content type in accordance with Paperclip 4 security rules | Validate attachment content type in accordance with Paperclip 4 security rules
| Ruby | mit | AnnArborTees/spree_digital,AnnArborTees/spree_digital,AnnArborTees/spree_digital | ruby | ## Code Before:
module Spree
class Digital < ActiveRecord::Base
belongs_to :variant
has_many :digital_links, :dependent => :destroy
has_attached_file :attachment, :path => ":rails_root/private/digitals/:id/:basename.:extension"
if Paperclip::Attachment.default_options[:storage] == :s3
attachment_definitions[:attachment][:s3_permissions] = :private
attachment_definitions[:attachment][:s3_headers] = { :content_disposition => 'attachment' }
end
end
end
## Instruction:
Validate attachment content type in accordance with Paperclip 4 security rules
## Code After:
module Spree
class Digital < ActiveRecord::Base
belongs_to :variant
has_many :digital_links, :dependent => :destroy
has_attached_file :attachment, :path => ":rails_root/private/digitals/:id/:basename.:extension"
validates_attachment_content_type :attachment, :content_type => %w(audio/mpeg application/x-mobipocket-ebook application/epub+zip application/pdf application/zip image/jpeg)
if Paperclip::Attachment.default_options[:storage] == :s3
attachment_definitions[:attachment][:s3_permissions] = :private
attachment_definitions[:attachment][:s3_headers] = { :content_disposition => 'attachment' }
end
end
end
| module Spree
class Digital < ActiveRecord::Base
belongs_to :variant
has_many :digital_links, :dependent => :destroy
has_attached_file :attachment, :path => ":rails_root/private/digitals/:id/:basename.:extension"
+ validates_attachment_content_type :attachment, :content_type => %w(audio/mpeg application/x-mobipocket-ebook application/epub+zip application/pdf application/zip image/jpeg)
if Paperclip::Attachment.default_options[:storage] == :s3
attachment_definitions[:attachment][:s3_permissions] = :private
attachment_definitions[:attachment][:s3_headers] = { :content_disposition => 'attachment' }
end
end
end | 1 | 0.076923 | 1 | 0 |
082de97026c5a1a1c344ffc9bac23fad15b4d750 | Brokerages/InteractiveBrokers/IB-symbol-map.json | Brokerages/InteractiveBrokers/IB-symbol-map.json | /* This is a manually created file that contains mappings from IB own naming to original symbols defined by respective exchanges. */
{
"GBP": "6B",
"CAD": "6C",
"JPY": "6J",
"CHF": "6S",
"EUR": "6E",
"AUD": "6A",
"NZD": "6N",
"VIX": "VX",
"AIGCI": "AW",
"AC": "EH",
"BRE": "6L",
"MXP": "6M",
"RUR": "6R",
"ZAR": "6Z",
"BRR": "BTC",
"SB": "YO"
}
| /* This is a manually created file that contains mappings from IB own naming to original symbols defined by respective exchanges. */
{
"GBP": "6B",
"CAD": "6C",
"JPY": "6J",
"CHF": "6S",
"EUR": "6E",
"AUD": "6A",
"NZD": "6N",
"VIX": "VX",
"AIGCI": "AW",
"AC": "EH",
"BRE": "6L",
"MXP": "6M",
"RUR": "6R",
"ZAR": "6Z",
"BRR": "BTC"
}
| Remove incorrect IB mapping for Sugar Future N.11 | Remove incorrect IB mapping for Sugar Future N.11
- IB supports the SB symbol on ICE/NYBOT
- IB does not support the YO symbol on CME/NYMEX
| JSON | apache-2.0 | QuantConnect/Lean,AlexCatarino/Lean,AlexCatarino/Lean,StefanoRaggi/Lean,jameschch/Lean,QuantConnect/Lean,JKarathiya/Lean,StefanoRaggi/Lean,QuantConnect/Lean,jameschch/Lean,StefanoRaggi/Lean,jameschch/Lean,StefanoRaggi/Lean,JKarathiya/Lean,jameschch/Lean,JKarathiya/Lean,QuantConnect/Lean,AlexCatarino/Lean,AlexCatarino/Lean,JKarathiya/Lean,jameschch/Lean,StefanoRaggi/Lean | json | ## Code Before:
/* This is a manually created file that contains mappings from IB own naming to original symbols defined by respective exchanges. */
{
"GBP": "6B",
"CAD": "6C",
"JPY": "6J",
"CHF": "6S",
"EUR": "6E",
"AUD": "6A",
"NZD": "6N",
"VIX": "VX",
"AIGCI": "AW",
"AC": "EH",
"BRE": "6L",
"MXP": "6M",
"RUR": "6R",
"ZAR": "6Z",
"BRR": "BTC",
"SB": "YO"
}
## Instruction:
Remove incorrect IB mapping for Sugar Future N.11
- IB supports the SB symbol on ICE/NYBOT
- IB does not support the YO symbol on CME/NYMEX
## Code After:
/* This is a manually created file that contains mappings from IB own naming to original symbols defined by respective exchanges. */
{
"GBP": "6B",
"CAD": "6C",
"JPY": "6J",
"CHF": "6S",
"EUR": "6E",
"AUD": "6A",
"NZD": "6N",
"VIX": "VX",
"AIGCI": "AW",
"AC": "EH",
"BRE": "6L",
"MXP": "6M",
"RUR": "6R",
"ZAR": "6Z",
"BRR": "BTC"
}
| /* This is a manually created file that contains mappings from IB own naming to original symbols defined by respective exchanges. */
{
"GBP": "6B",
"CAD": "6C",
"JPY": "6J",
"CHF": "6S",
"EUR": "6E",
"AUD": "6A",
"NZD": "6N",
"VIX": "VX",
"AIGCI": "AW",
"AC": "EH",
"BRE": "6L",
"MXP": "6M",
"RUR": "6R",
"ZAR": "6Z",
- "BRR": "BTC",
? -
+ "BRR": "BTC"
- "SB": "YO"
} | 3 | 0.157895 | 1 | 2 |
49812129df15a8877e0c4ae98b2079a3bfebcc8e | .eslintrc.json | .eslintrc.json | {
"eslintignore": ["node_modules"],
"env": {
"es6": true,
"node": true
},
"extends": ["eslint:recommended"],
"rules": {
"no-console": 0,
"indent": ["error", "tab"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"curly": ["error", "multi-line"],
"no-unused-vars": "warn"
}
}
| {
"env": {
"browser": true,
"es6": true
},
"eslintignore": ["node_modules"],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": ["react"],
"rules": {
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"comma-dangle": ["warn", "never"],
"curly": ["error", "multi-line"],
"indent": ["error", "tab", { "SwitchCase": 1 }],
"react/jsx-indent": ["error", "tab"],
"linebreak-style": ["error", "unix"],
"no-console": 0,
"no-unused-vars": "warn",
"no-var": "error",
"quotes": ["error", "single"],
"jsx-quotes": ["error", "prefer-single"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }]
}
}
| Update ESLint configuration, and switch to babel-eslint parser in order to support most recent syntax | Update ESLint configuration, and switch to babel-eslint parser in order to support most recent syntax
| JSON | apache-2.0 | Kitanotori/react-webpack-babel-hotreload-example,Kitanotori/react-webpack-babel-hotreload-example | json | ## Code Before:
{
"eslintignore": ["node_modules"],
"env": {
"es6": true,
"node": true
},
"extends": ["eslint:recommended"],
"rules": {
"no-console": 0,
"indent": ["error", "tab"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"curly": ["error", "multi-line"],
"no-unused-vars": "warn"
}
}
## Instruction:
Update ESLint configuration, and switch to babel-eslint parser in order to support most recent syntax
## Code After:
{
"env": {
"browser": true,
"es6": true
},
"eslintignore": ["node_modules"],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": ["react"],
"rules": {
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"comma-dangle": ["warn", "never"],
"curly": ["error", "multi-line"],
"indent": ["error", "tab", { "SwitchCase": 1 }],
"react/jsx-indent": ["error", "tab"],
"linebreak-style": ["error", "unix"],
"no-console": 0,
"no-unused-vars": "warn",
"no-var": "error",
"quotes": ["error", "single"],
"jsx-quotes": ["error", "prefer-single"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }]
}
}
| {
+ "env": {
+ "browser": true,
+ "es6": true
+ },
"eslintignore": ["node_modules"],
- "env": {
+ "extends": ["eslint:recommended", "plugin:react/recommended"],
+ "parser": "babel-eslint",
+ "parserOptions": {
+ "ecmaFeatures": {
+ "experimentalObjectRestSpread": true,
- "es6": true,
? ^ ^ -
+ "jsx": true
? + ^ ^
- "node": true
+ },
+ "sourceType": "module"
},
- "extends": ["eslint:recommended"],
+ "plugins": ["react"],
"rules": {
+ "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
+ "comma-dangle": ["warn", "never"],
+ "curly": ["error", "multi-line"],
+ "indent": ["error", "tab", { "SwitchCase": 1 }],
+ "react/jsx-indent": ["error", "tab"],
+ "linebreak-style": ["error", "unix"],
"no-console": 0,
- "indent": ["error", "tab"],
+ "no-unused-vars": "warn",
+ "no-var": "error",
"quotes": ["error", "single"],
+ "jsx-quotes": ["error", "prefer-single"],
"semi": ["error", "always"],
+ "space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }]
- "curly": ["error", "multi-line"],
- "no-unused-vars": "warn"
}
} | 30 | 1.875 | 23 | 7 |
9d2b00c2a793110d377a138ebd9f1b0b8864e2c0 | components/widgets/datetime/index.js | components/widgets/datetime/index.js | import { Component } from 'react'
import tinytime from 'tinytime'
export default class DateTime extends Component {
static defaultProps = {
interval: 10000
}
state = {
date: new Date()
}
componentDidMount () {
this.interval = setInterval(() => this.setState({ date: new Date() }), this.props.interval)
}
componentWillUnmount () {
clearInterval(this.interval)
}
render () {
return (
<div>
<div>{tinytime('{H}:{mm}').render(this.state.date)}</div>
<div>{tinytime('{DD}.{Mo}.{YYYY}').render(this.state.date)}</div>
</div>
)
}
}
| import { Component } from 'react'
import tinytime from 'tinytime'
import styled from 'styled-components'
import Paper from 'material-ui/Paper'
const Circle = styled(Paper)`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 10em;
width: 10em;
`
export default class DateTime extends Component {
static defaultProps = {
interval: 10000
}
state = {
date: new Date()
}
componentDidMount () {
const { interval } = this.props
this.interval = setInterval(() => this.setState({ date: new Date() }), interval)
}
componentWillUnmount () {
clearInterval(this.interval)
}
render () {
const { date } = this.state
return (
<Circle circle>
<h1>{tinytime('{H}:{mm}').render(date)}</h1>
<span>{tinytime('{DD}.{Mo}.{YYYY}').render(date)}</span>
</Circle>
)
}
}
| Refactor and style datetime widget | Refactor and style datetime widget
| JavaScript | mit | danielbayerlein/dashboard,danielbayerlein/dashboard | javascript | ## Code Before:
import { Component } from 'react'
import tinytime from 'tinytime'
export default class DateTime extends Component {
static defaultProps = {
interval: 10000
}
state = {
date: new Date()
}
componentDidMount () {
this.interval = setInterval(() => this.setState({ date: new Date() }), this.props.interval)
}
componentWillUnmount () {
clearInterval(this.interval)
}
render () {
return (
<div>
<div>{tinytime('{H}:{mm}').render(this.state.date)}</div>
<div>{tinytime('{DD}.{Mo}.{YYYY}').render(this.state.date)}</div>
</div>
)
}
}
## Instruction:
Refactor and style datetime widget
## Code After:
import { Component } from 'react'
import tinytime from 'tinytime'
import styled from 'styled-components'
import Paper from 'material-ui/Paper'
const Circle = styled(Paper)`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 10em;
width: 10em;
`
export default class DateTime extends Component {
static defaultProps = {
interval: 10000
}
state = {
date: new Date()
}
componentDidMount () {
const { interval } = this.props
this.interval = setInterval(() => this.setState({ date: new Date() }), interval)
}
componentWillUnmount () {
clearInterval(this.interval)
}
render () {
const { date } = this.state
return (
<Circle circle>
<h1>{tinytime('{H}:{mm}').render(date)}</h1>
<span>{tinytime('{DD}.{Mo}.{YYYY}').render(date)}</span>
</Circle>
)
}
}
| import { Component } from 'react'
import tinytime from 'tinytime'
+ import styled from 'styled-components'
+ import Paper from 'material-ui/Paper'
+
+ const Circle = styled(Paper)`
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 10em;
+ width: 10em;
+ `
export default class DateTime extends Component {
static defaultProps = {
interval: 10000
}
state = {
date: new Date()
}
componentDidMount () {
+ const { interval } = this.props
- this.interval = setInterval(() => this.setState({ date: new Date() }), this.props.interval)
? -----------
+ this.interval = setInterval(() => this.setState({ date: new Date() }), interval)
}
componentWillUnmount () {
clearInterval(this.interval)
}
render () {
+ const { date } = this.state
+
return (
- <div>
+ <Circle circle>
- <div>{tinytime('{H}:{mm}').render(this.state.date)}</div>
? ^^^ ----------- ^^^
+ <h1>{tinytime('{H}:{mm}').render(date)}</h1>
? ^^ ^^
- <div>{tinytime('{DD}.{Mo}.{YYYY}').render(this.state.date)}</div>
? ^^^ ----------- ^^^
+ <span>{tinytime('{DD}.{Mo}.{YYYY}').render(date)}</span>
? ^^^^ ^^^^
- </div>
+ </Circle>
)
}
} | 24 | 0.827586 | 19 | 5 |
d9435ec60b7ca5d21356202bc900ce765cb9e3f5 | .github/workflows/phpunit.yml | .github/workflows/phpunit.yml | name: Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/setup-php@2.1.3
with:
php-version: '7.4'
tools: phpunit, composer
- name: Install dependencies
run: composer install --prefer-source --no-interaction --dev
- name: Run test
run: vendor/bin/phpunit
- name: Report test results
run: |
CODECLIMATE_REPO_TOKEN="c8a07ee2759b229cb3bee66fb112ef1ce95494c" vendor/bin/test-reporter
- name: Report test coverage
run: bash <(curl -s https://codecov.io/bash)
| name: Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/setup-php@2.1.3
with:
php-version: '7.4'
tools: phpunit, composer
- name: Install dependencies
run: composer install --prefer-source --no-interaction --dev
- name: Setup codeclimate test reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run test
run: vendor/bin/phpunit
- name: Send report to codeclimate
env:
CC_TEST_REPORTER_ID: c8a07ee2759b229cb3bee66fb112ef1ce95494c
run: ./cc-test-reporter after-build -t clover
- name: Report test coverage
run: bash <(curl -s https://codecov.io/bash)
| Use the new codeclimate test reporter | Use the new codeclimate test reporter | YAML | mit | hendrikmaus/drafter-php | yaml | ## Code Before:
name: Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/setup-php@2.1.3
with:
php-version: '7.4'
tools: phpunit, composer
- name: Install dependencies
run: composer install --prefer-source --no-interaction --dev
- name: Run test
run: vendor/bin/phpunit
- name: Report test results
run: |
CODECLIMATE_REPO_TOKEN="c8a07ee2759b229cb3bee66fb112ef1ce95494c" vendor/bin/test-reporter
- name: Report test coverage
run: bash <(curl -s https://codecov.io/bash)
## Instruction:
Use the new codeclimate test reporter
## Code After:
name: Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/setup-php@2.1.3
with:
php-version: '7.4'
tools: phpunit, composer
- name: Install dependencies
run: composer install --prefer-source --no-interaction --dev
- name: Setup codeclimate test reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run test
run: vendor/bin/phpunit
- name: Send report to codeclimate
env:
CC_TEST_REPORTER_ID: c8a07ee2759b229cb3bee66fb112ef1ce95494c
run: ./cc-test-reporter after-build -t clover
- name: Report test coverage
run: bash <(curl -s https://codecov.io/bash)
| name: Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/setup-php@2.1.3
with:
php-version: '7.4'
tools: phpunit, composer
- name: Install dependencies
run: composer install --prefer-source --no-interaction --dev
+
+ - name: Setup codeclimate test reporter
+ run: |
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
+ chmod +x ./cc-test-reporter
+ ./cc-test-reporter before-build
-
+
? ++
- name: Run test
run: vendor/bin/phpunit
-
+
? ++
- - name: Report test results
- run: |
- CODECLIMATE_REPO_TOKEN="c8a07ee2759b229cb3bee66fb112ef1ce95494c" vendor/bin/test-reporter
+ - name: Send report to codeclimate
+ env:
+ CC_TEST_REPORTER_ID: c8a07ee2759b229cb3bee66fb112ef1ce95494c
+ run: ./cc-test-reporter after-build -t clover
-
+
? ++
- name: Report test coverage
run: bash <(curl -s https://codecov.io/bash) | 19 | 0.575758 | 13 | 6 |
f365ae3e26a5b03de490c82e18a2a6e03a1dd954 | src/Settings.php | src/Settings.php | <?php
namespace ProcessWire\GraphQL;
class Settings {
public static function module()
{
return \Processwire\wire('modules')->get('ProcessGraphQL');
}
public static function getLegalTemplates()
{
$legalTemplates = self::module()->legalTemplates;
$templates = \ProcessWire\wire('templates')->find("name=" . implode('|', $legalTemplates));
$user = \ProcessWire\wire('user');
foreach ($templates as $template) {
if (!$user->hasPermission('page-view', $template)) {
$templates->remove($template);
}
}
return $templates;
}
public static function getLegalFields()
{
$legalFields = self::module()->legalFields;
$fields = \ProcessWire\wire('fields')->find("name=" . implode('|', $legalFields));
return $fields;
}
} | <?php
namespace ProcessWire\GraphQL;
class Settings {
public static function module()
{
return \Processwire\wire('modules')->get('ProcessGraphQL');
}
public static function getLegalTemplates()
{
$legalTemplates = self::module()->legalTemplates;
$templates = \ProcessWire\wire('templates')->find("name=" . implode('|', $legalTemplates));
$user = \ProcessWire\wire('user');
// Wierd behavior with ProcessWire. $user->hasPermission() does not
// work if you do not load the required roles beforehand.
\ProcessWire\wire('roles')->find("");
foreach ($templates as $template) {
// we serve templates with access control disabled
if (!$template->useRoles) continue;
// if enabled we serve only those that user has permission to view
if (!$user->hasTemplatePermission('page-view', $template)) {
$templates->remove($template);
}
}
return $templates;
}
public static function getLegalFields()
{
$legalFields = self::module()->legalFields;
$fields = \ProcessWire\wire('fields')->find("name=" . implode('|', $legalFields));
return $fields;
}
} | Fix the template permissions bug. | Fix the template permissions bug.
| PHP | mit | dadish/ProcessGraphQL,dadish/ProcessGraphQL | php | ## Code Before:
<?php
namespace ProcessWire\GraphQL;
class Settings {
public static function module()
{
return \Processwire\wire('modules')->get('ProcessGraphQL');
}
public static function getLegalTemplates()
{
$legalTemplates = self::module()->legalTemplates;
$templates = \ProcessWire\wire('templates')->find("name=" . implode('|', $legalTemplates));
$user = \ProcessWire\wire('user');
foreach ($templates as $template) {
if (!$user->hasPermission('page-view', $template)) {
$templates->remove($template);
}
}
return $templates;
}
public static function getLegalFields()
{
$legalFields = self::module()->legalFields;
$fields = \ProcessWire\wire('fields')->find("name=" . implode('|', $legalFields));
return $fields;
}
}
## Instruction:
Fix the template permissions bug.
## Code After:
<?php
namespace ProcessWire\GraphQL;
class Settings {
public static function module()
{
return \Processwire\wire('modules')->get('ProcessGraphQL');
}
public static function getLegalTemplates()
{
$legalTemplates = self::module()->legalTemplates;
$templates = \ProcessWire\wire('templates')->find("name=" . implode('|', $legalTemplates));
$user = \ProcessWire\wire('user');
// Wierd behavior with ProcessWire. $user->hasPermission() does not
// work if you do not load the required roles beforehand.
\ProcessWire\wire('roles')->find("");
foreach ($templates as $template) {
// we serve templates with access control disabled
if (!$template->useRoles) continue;
// if enabled we serve only those that user has permission to view
if (!$user->hasTemplatePermission('page-view', $template)) {
$templates->remove($template);
}
}
return $templates;
}
public static function getLegalFields()
{
$legalFields = self::module()->legalFields;
$fields = \ProcessWire\wire('fields')->find("name=" . implode('|', $legalFields));
return $fields;
}
} | <?php
namespace ProcessWire\GraphQL;
class Settings {
public static function module()
{
return \Processwire\wire('modules')->get('ProcessGraphQL');
}
public static function getLegalTemplates()
{
-
$legalTemplates = self::module()->legalTemplates;
$templates = \ProcessWire\wire('templates')->find("name=" . implode('|', $legalTemplates));
-
$user = \ProcessWire\wire('user');
+
+ // Wierd behavior with ProcessWire. $user->hasPermission() does not
+ // work if you do not load the required roles beforehand.
+ \ProcessWire\wire('roles')->find("");
foreach ($templates as $template) {
+ // we serve templates with access control disabled
+ if (!$template->useRoles) continue;
+
+ // if enabled we serve only those that user has permission to view
- if (!$user->hasPermission('page-view', $template)) {
+ if (!$user->hasTemplatePermission('page-view', $template)) {
? ++++++++
$templates->remove($template);
}
}
return $templates;
}
public static function getLegalFields()
{
$legalFields = self::module()->legalFields;
$fields = \ProcessWire\wire('fields')->find("name=" . implode('|', $legalFields));
return $fields;
}
} | 12 | 0.333333 | 9 | 3 |
483d5ad5440adaf909b44860366de2f042167fa0 | vendor/plugins/somatics_generator/init.rb | vendor/plugins/somatics_generator/init.rb | require 'somatic_link_renderer' | raise "You Should install will_paginate gems or plugin" unless defined?(WillPaginate)
require 'somatic_link_renderer'
| Raise Error when Will Paginate Gems not installed. | Raise Error when Will Paginate Gems not installed.
| Ruby | mit | railsant/somatics | ruby | ## Code Before:
require 'somatic_link_renderer'
## Instruction:
Raise Error when Will Paginate Gems not installed.
## Code After:
raise "You Should install will_paginate gems or plugin" unless defined?(WillPaginate)
require 'somatic_link_renderer'
| + raise "You Should install will_paginate gems or plugin" unless defined?(WillPaginate)
require 'somatic_link_renderer' | 1 | 1 | 1 | 0 |
d44684ee50bd773b87b733be977222b6d5f93d4c | features/steps/eventbrite_steps.rb | features/steps/eventbrite_steps.rb | Given /^there is an event in Eventbrite$/ do
end
When /^I sign up to that event and ask to be invoiced$/ do
# Set up some user details
end
Then /^I should be marked as wanting an invoice$/ do
# Mock response from eventbrite API
# https://www.eventbrite.co.uk/myevent?eid=5441375300
# Poll eventbrite API for details
# Find the relevant user and check the order type field
pending # express the regexp above with the code you wish you had
end | Given /^there is an event in Eventbrite$/ do
end
When /^I sign up to that event and ask to be invoiced$/ do
# Set up some user details
end
Then /^I should be marked as wanting an invoice$/ do
# Mock response from eventbrite API
# https://www.eventbrite.co.uk/myevent?eid=5441375300
# Poll eventbrite API for details
# Find the relevant user and check the order type field
pending # express the regexp above with the code you wish you had
end
Given /^I have asked to be invoiced$/ do
pending # express the regexp above with the code you wish you had
end
Then /^an invoice should be raised in Xero$/ do
pending # express the regexp above with the code you wish you had
end
| Add missing steps as pending | Add missing steps as pending
0:05
| Ruby | mit | theodi/services-manager,theodi/odi-metrics-tasks,theodi/services-manager,theodi/open-orgn-services | ruby | ## Code Before:
Given /^there is an event in Eventbrite$/ do
end
When /^I sign up to that event and ask to be invoiced$/ do
# Set up some user details
end
Then /^I should be marked as wanting an invoice$/ do
# Mock response from eventbrite API
# https://www.eventbrite.co.uk/myevent?eid=5441375300
# Poll eventbrite API for details
# Find the relevant user and check the order type field
pending # express the regexp above with the code you wish you had
end
## Instruction:
Add missing steps as pending
0:05
## Code After:
Given /^there is an event in Eventbrite$/ do
end
When /^I sign up to that event and ask to be invoiced$/ do
# Set up some user details
end
Then /^I should be marked as wanting an invoice$/ do
# Mock response from eventbrite API
# https://www.eventbrite.co.uk/myevent?eid=5441375300
# Poll eventbrite API for details
# Find the relevant user and check the order type field
pending # express the regexp above with the code you wish you had
end
Given /^I have asked to be invoiced$/ do
pending # express the regexp above with the code you wish you had
end
Then /^an invoice should be raised in Xero$/ do
pending # express the regexp above with the code you wish you had
end
| Given /^there is an event in Eventbrite$/ do
end
When /^I sign up to that event and ask to be invoiced$/ do
# Set up some user details
end
Then /^I should be marked as wanting an invoice$/ do
# Mock response from eventbrite API
# https://www.eventbrite.co.uk/myevent?eid=5441375300
# Poll eventbrite API for details
# Find the relevant user and check the order type field
pending # express the regexp above with the code you wish you had
end
+
+ Given /^I have asked to be invoiced$/ do
+ pending # express the regexp above with the code you wish you had
+ end
+
+ Then /^an invoice should be raised in Xero$/ do
+ pending # express the regexp above with the code you wish you had
+ end | 8 | 0.571429 | 8 | 0 |
fbc35ab03ea26ccd49d477c3231ed0413a43dc30 | packages/knapsack-plugin-no-emit-errors/index.js | packages/knapsack-plugin-no-emit-errors/index.js | const webpack = require('webpack');
module.exports = {
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
],
};
| const webpack = require('webpack');
module.exports = {
plugins: [
// This plugin does not swallow errors. Instead, it just prevents
// Webpack from printing out compile time stats to the console.
new webpack.NoEmitOnErrorsPlugin(),
],
};
| Add notes to no emit error plugin | Add notes to no emit error plugin
| JavaScript | mit | brandonjpierce/knapsack | javascript | ## Code Before:
const webpack = require('webpack');
module.exports = {
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
],
};
## Instruction:
Add notes to no emit error plugin
## Code After:
const webpack = require('webpack');
module.exports = {
plugins: [
// This plugin does not swallow errors. Instead, it just prevents
// Webpack from printing out compile time stats to the console.
new webpack.NoEmitOnErrorsPlugin(),
],
};
| const webpack = require('webpack');
module.exports = {
plugins: [
+ // This plugin does not swallow errors. Instead, it just prevents
+ // Webpack from printing out compile time stats to the console.
new webpack.NoEmitOnErrorsPlugin(),
],
}; | 2 | 0.285714 | 2 | 0 |
c379a9922b8e26c90034d02b3d13c6f8ab5c63ee | src/main/java/be/yildiz/shared/entity/EntityCreator.java | src/main/java/be/yildiz/shared/entity/EntityCreator.java | /*
* This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)
*
* Copyright (c) 2017 Grégory Van den Borre
*
* More infos available: https://www.yildiz-games.be
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
* OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package be.yildiz.shared.entity;
/**
* @author Grégory Van den Borre
*/
public interface EntityCreator<T extends Entity> {
T create(EntityToCreate e);
}
| /*
* This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)
*
* Copyright (c) 2017 Grégory Van den Borre
*
* More infos available: https://www.yildiz-games.be
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
* OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package be.yildiz.shared.entity;
/**
* @author Grégory Van den Borre
*/
@FunctionalInterface
public interface EntityCreator<T extends Entity> {
T create(EntityToCreate e);
}
| Fix sonar: add functional interface. | [YIL-83] Fix sonar: add functional interface.
| Java | mit | yildiz-online/engine-shared | java | ## Code Before:
/*
* This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)
*
* Copyright (c) 2017 Grégory Van den Borre
*
* More infos available: https://www.yildiz-games.be
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
* OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package be.yildiz.shared.entity;
/**
* @author Grégory Van den Borre
*/
public interface EntityCreator<T extends Entity> {
T create(EntityToCreate e);
}
## Instruction:
[YIL-83] Fix sonar: add functional interface.
## Code After:
/*
* This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)
*
* Copyright (c) 2017 Grégory Van den Borre
*
* More infos available: https://www.yildiz-games.be
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
* OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package be.yildiz.shared.entity;
/**
* @author Grégory Van den Borre
*/
@FunctionalInterface
public interface EntityCreator<T extends Entity> {
T create(EntityToCreate e);
}
| /*
* This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)
*
* Copyright (c) 2017 Grégory Van den Borre
*
* More infos available: https://www.yildiz-games.be
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
* OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package be.yildiz.shared.entity;
/**
* @author Grégory Van den Borre
*/
+ @FunctionalInterface
public interface EntityCreator<T extends Entity> {
T create(EntityToCreate e);
} | 1 | 0.03125 | 1 | 0 |
edcb6d39240336d20700c574304c9ecc977c80e1 | setup.cfg | setup.cfg | [nosetests]
where = tangled
with-coverage = true
cover-package = tangled.travisty
| [nosetests]
where = tangled/travisty
with-coverage = true
cover-package = tangled.travisty
with-doctest = true
doctest-options = +ELLIPSIS
| Add nose doctest options back with more precise --where | Add nose doctest options back with more precise --where
| INI | mit | TangledWeb/tangled.travisty | ini | ## Code Before:
[nosetests]
where = tangled
with-coverage = true
cover-package = tangled.travisty
## Instruction:
Add nose doctest options back with more precise --where
## Code After:
[nosetests]
where = tangled/travisty
with-coverage = true
cover-package = tangled.travisty
with-doctest = true
doctest-options = +ELLIPSIS
| [nosetests]
- where = tangled
+ where = tangled/travisty
? +++++++++
with-coverage = true
cover-package = tangled.travisty
+ with-doctest = true
+ doctest-options = +ELLIPSIS | 4 | 1 | 3 | 1 |
c5fdace13ce15258a2387dbb115a1034d0e8ecca | src/sample/home/home.js | src/sample/home/home.js | angular.module( 'sample.home', [
'auth0'
])
.controller( 'HomeCtrl', function HomeController( $scope, auth, $http, $location, store ) {
$scope.auth = auth;
$scope.callApi = function() {
// Just call the API as you'd do using $http
$http({
url: 'http://localhost:3001/secured/ping',
method: 'GET'
}).then(function() {
alert("We got the secured data successfully");
}, function(response) {
if (response.status == -1) {
alert("Please download the API seed so that you can call it.");
}
else {
alert(response.data);
}
});
}
$scope.logout = function() {
auth.signout();
store.remove('profile');
store.remove('token');
$location.path('/login');
}
});
| angular.module('sample.home', [
'auth0'
])
.controller('HomeCtrl', function HomeController($scope, auth, $http,
$location, store) {
$scope.auth = auth;
$scope.callApi = function() {
// Just call the API as you'd do using $http
$http({
url: '/secured/ping',
method: 'GET'
}).then(function() {
alert("We got the secured data successfully");
}, function(response) {
if (response.status == -1) {
alert("Please download the API seed so that you can call it.");
} else {
alert(response.data);
}
});
}
$scope.logout = function() {
auth.signout();
store.remove('profile');
store.remove('token');
$location.path('/login');
}
});
| Format and update the secure ping url | Format and update the secure ping url
| JavaScript | mit | MrHen/hen-auth,MrHen/hen-auth,MrHen/hen-auth | javascript | ## Code Before:
angular.module( 'sample.home', [
'auth0'
])
.controller( 'HomeCtrl', function HomeController( $scope, auth, $http, $location, store ) {
$scope.auth = auth;
$scope.callApi = function() {
// Just call the API as you'd do using $http
$http({
url: 'http://localhost:3001/secured/ping',
method: 'GET'
}).then(function() {
alert("We got the secured data successfully");
}, function(response) {
if (response.status == -1) {
alert("Please download the API seed so that you can call it.");
}
else {
alert(response.data);
}
});
}
$scope.logout = function() {
auth.signout();
store.remove('profile');
store.remove('token');
$location.path('/login');
}
});
## Instruction:
Format and update the secure ping url
## Code After:
angular.module('sample.home', [
'auth0'
])
.controller('HomeCtrl', function HomeController($scope, auth, $http,
$location, store) {
$scope.auth = auth;
$scope.callApi = function() {
// Just call the API as you'd do using $http
$http({
url: '/secured/ping',
method: 'GET'
}).then(function() {
alert("We got the secured data successfully");
}, function(response) {
if (response.status == -1) {
alert("Please download the API seed so that you can call it.");
} else {
alert(response.data);
}
});
}
$scope.logout = function() {
auth.signout();
store.remove('profile');
store.remove('token');
$location.path('/login');
}
});
| - angular.module( 'sample.home', [
? -
+ angular.module('sample.home', [
- 'auth0'
+ 'auth0'
? ++++
- ])
+ ])
- .controller( 'HomeCtrl', function HomeController( $scope, auth, $http, $location, store ) {
? - - ---------------------
+ .controller('HomeCtrl', function HomeController($scope, auth, $http,
? ++
+ $location, store) {
- $scope.auth = auth;
+ $scope.auth = auth;
? ++
- $scope.callApi = function() {
+ $scope.callApi = function() {
? ++
- // Just call the API as you'd do using $http
+ // Just call the API as you'd do using $http
? ++
- $http({
+ $http({
? ++
- url: 'http://localhost:3001/secured/ping',
+ url: '/secured/ping',
- method: 'GET'
+ method: 'GET'
? ++
- }).then(function() {
+ }).then(function() {
? ++
- alert("We got the secured data successfully");
+ alert("We got the secured data successfully");
? ++
- }, function(response) {
+ }, function(response) {
? ++
- if (response.status == -1) {
+ if (response.status == -1) {
? ++
- alert("Please download the API seed so that you can call it.");
+ alert("Please download the API seed so that you can call it.");
? ++
- }
- else {
+ } else {
? ++++
- alert(response.data);
+ alert(response.data);
? ++
- }
+ }
? ++
- });
+ });
? ++
- }
+ }
? ++
- $scope.logout = function() {
+ $scope.logout = function() {
? ++
- auth.signout();
+ auth.signout();
? ++
- store.remove('profile');
+ store.remove('profile');
? ++
- store.remove('token');
+ store.remove('token');
? ++
- $location.path('/login');
+ $location.path('/login');
? ++
- }
+ }
? ++
- });
+ });
? ++
| 56 | 1.75 | 28 | 28 |
f3f6838f285f86954aded2aff28a7bc118a6f3ca | server/users/auth/logout.js | server/users/auth/logout.js | // Do logout
'use strict';
module.exports = function (N, apiPath) {
N.validate(apiPath, {});
N.wire.on(apiPath, function logout(env, callback) {
if (!env.session_id) {
callback();
return;
}
// Delete session from redis first, because otherwise in case of failure
// users can still log in using this session even if a mongo token is gone
//
N.redis.del('sess:' + env.session_id, function (err) {
if (err) {
callback(err);
return;
}
N.models.users.TokenLogin.remove({ session_id: env.session_id }, function (err) {
if (err) {
callback(err);
return;
}
// If there are no errors, we can finally set session to null,
// so core could reset user cookie
//
env.session = null;
callback();
});
});
});
};
| // Do logout
'use strict';
module.exports = function (N, apiPath) {
N.validate(apiPath, {});
N.wire.on(apiPath, function logout(env, callback) {
if (!env.session_id) {
callback();
return;
}
// Delete session from redis first, because otherwise in case of failure
// users can still log in using this session even if a mongo token is gone
// (and clearing all tokens in mongo afterwards won't affect this session).
//
N.redis.del('sess:' + env.session_id, function (err) {
if (err) {
callback(err);
return;
}
N.models.users.TokenLogin.remove({ session_id: env.session_id }, function (err) {
if (err) {
callback(err);
return;
}
// Repeat session deletion, because session might be restored in the time
// between redis and mongo calls above (e.g. race condition with a parallel
// request).
//
N.redis.del('sess:' + env.session_id, function (err) {
if (err) {
callback(err);
return;
}
// If there are no errors, we can finally set session to null,
// so core could reset user cookie
//
env.session = null;
callback();
});
});
});
});
};
| Remove redis session after mongo token | Remove redis session after mongo token
| JavaScript | mit | nodeca/nodeca.users | javascript | ## Code Before:
// Do logout
'use strict';
module.exports = function (N, apiPath) {
N.validate(apiPath, {});
N.wire.on(apiPath, function logout(env, callback) {
if (!env.session_id) {
callback();
return;
}
// Delete session from redis first, because otherwise in case of failure
// users can still log in using this session even if a mongo token is gone
//
N.redis.del('sess:' + env.session_id, function (err) {
if (err) {
callback(err);
return;
}
N.models.users.TokenLogin.remove({ session_id: env.session_id }, function (err) {
if (err) {
callback(err);
return;
}
// If there are no errors, we can finally set session to null,
// so core could reset user cookie
//
env.session = null;
callback();
});
});
});
};
## Instruction:
Remove redis session after mongo token
## Code After:
// Do logout
'use strict';
module.exports = function (N, apiPath) {
N.validate(apiPath, {});
N.wire.on(apiPath, function logout(env, callback) {
if (!env.session_id) {
callback();
return;
}
// Delete session from redis first, because otherwise in case of failure
// users can still log in using this session even if a mongo token is gone
// (and clearing all tokens in mongo afterwards won't affect this session).
//
N.redis.del('sess:' + env.session_id, function (err) {
if (err) {
callback(err);
return;
}
N.models.users.TokenLogin.remove({ session_id: env.session_id }, function (err) {
if (err) {
callback(err);
return;
}
// Repeat session deletion, because session might be restored in the time
// between redis and mongo calls above (e.g. race condition with a parallel
// request).
//
N.redis.del('sess:' + env.session_id, function (err) {
if (err) {
callback(err);
return;
}
// If there are no errors, we can finally set session to null,
// so core could reset user cookie
//
env.session = null;
callback();
});
});
});
});
};
| // Do logout
'use strict';
module.exports = function (N, apiPath) {
N.validate(apiPath, {});
N.wire.on(apiPath, function logout(env, callback) {
if (!env.session_id) {
callback();
return;
}
// Delete session from redis first, because otherwise in case of failure
// users can still log in using this session even if a mongo token is gone
+ // (and clearing all tokens in mongo afterwards won't affect this session).
//
N.redis.del('sess:' + env.session_id, function (err) {
if (err) {
callback(err);
return;
}
N.models.users.TokenLogin.remove({ session_id: env.session_id }, function (err) {
if (err) {
callback(err);
return;
}
- // If there are no errors, we can finally set session to null,
- // so core could reset user cookie
+ // Repeat session deletion, because session might be restored in the time
+ // between redis and mongo calls above (e.g. race condition with a parallel
+ // request).
//
- env.session = null;
+ N.redis.del('sess:' + env.session_id, function (err) {
+ if (err) {
+ callback(err);
+ return;
+ }
+ // If there are no errors, we can finally set session to null,
+ // so core could reset user cookie
+ //
+ env.session = null;
+
- callback();
+ callback();
? ++
+ });
});
});
});
}; | 20 | 0.5 | 16 | 4 |
f531cfa07ba6e6e0d36ba768dbeb4706ae7cd259 | tlslite/utils/pycrypto_rsakey.py | tlslite/utils/pycrypto_rsakey.py |
"""PyCrypto RSA implementation."""
from .cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
if pycryptoLoaded:
from Crypto.PublicKey import RSA
class PyCrypto_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if not d:
self.rsa = RSA.construct( (n, e) )
else:
self.rsa = RSA.construct( (n, e, d, p, q) )
def __getattr__(self, name):
return getattr(self.rsa, name)
def hasPrivateKey(self):
return self.rsa.has_private()
def _rawPrivateKeyOp(self, m):
s = numberToString(m, numBytes(self.n))
c = stringToNumber(self.rsa.decrypt((s,)))
return c
def _rawPublicKeyOp(self, c):
s = numberToString(c, numBytes(self.n))
m = stringToNumber(self.rsa.encrypt(s, None)[0])
return m
def generate(bits):
key = PyCrypto_RSAKey()
def f(numBytes):
return bytes(getRandomBytes(numBytes))
key.rsa = RSA.generate(bits, f)
return key
generate = staticmethod(generate)
|
"""PyCrypto RSA implementation."""
from cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
if pycryptoLoaded:
from Crypto.PublicKey import RSA
class PyCrypto_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if not d:
self.rsa = RSA.construct( (long(n), long(e)) )
else:
self.rsa = RSA.construct( (long(n), long(e), long(d), long(p), long(q)) )
def __getattr__(self, name):
return getattr(self.rsa, name)
def hasPrivateKey(self):
return self.rsa.has_private()
def _rawPrivateKeyOp(self, m):
c = self.rsa.decrypt((m,))
return c
def _rawPublicKeyOp(self, c):
m = self.rsa.encrypt(c, None)[0]
return m
def generate(bits):
key = PyCrypto_RSAKey()
def f(numBytes):
return bytes(getRandomBytes(numBytes))
key.rsa = RSA.generate(bits, f)
return key
generate = staticmethod(generate)
| Remove numberToString/stringToNumber in pycrypto support package and add some int to long conversions so it can happily pass the tests (I bet this is enough to get it working) | Remove numberToString/stringToNumber in pycrypto support package and add some int to long conversions so it can happily pass the tests (I bet this is enough to get it working)
| Python | lgpl-2.1 | ioef/tlslite-ng,ioef/tlslite-ng,ioef/tlslite-ng | python | ## Code Before:
"""PyCrypto RSA implementation."""
from .cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
if pycryptoLoaded:
from Crypto.PublicKey import RSA
class PyCrypto_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if not d:
self.rsa = RSA.construct( (n, e) )
else:
self.rsa = RSA.construct( (n, e, d, p, q) )
def __getattr__(self, name):
return getattr(self.rsa, name)
def hasPrivateKey(self):
return self.rsa.has_private()
def _rawPrivateKeyOp(self, m):
s = numberToString(m, numBytes(self.n))
c = stringToNumber(self.rsa.decrypt((s,)))
return c
def _rawPublicKeyOp(self, c):
s = numberToString(c, numBytes(self.n))
m = stringToNumber(self.rsa.encrypt(s, None)[0])
return m
def generate(bits):
key = PyCrypto_RSAKey()
def f(numBytes):
return bytes(getRandomBytes(numBytes))
key.rsa = RSA.generate(bits, f)
return key
generate = staticmethod(generate)
## Instruction:
Remove numberToString/stringToNumber in pycrypto support package and add some int to long conversions so it can happily pass the tests (I bet this is enough to get it working)
## Code After:
"""PyCrypto RSA implementation."""
from cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
if pycryptoLoaded:
from Crypto.PublicKey import RSA
class PyCrypto_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if not d:
self.rsa = RSA.construct( (long(n), long(e)) )
else:
self.rsa = RSA.construct( (long(n), long(e), long(d), long(p), long(q)) )
def __getattr__(self, name):
return getattr(self.rsa, name)
def hasPrivateKey(self):
return self.rsa.has_private()
def _rawPrivateKeyOp(self, m):
c = self.rsa.decrypt((m,))
return c
def _rawPublicKeyOp(self, c):
m = self.rsa.encrypt(c, None)[0]
return m
def generate(bits):
key = PyCrypto_RSAKey()
def f(numBytes):
return bytes(getRandomBytes(numBytes))
key.rsa = RSA.generate(bits, f)
return key
generate = staticmethod(generate)
|
"""PyCrypto RSA implementation."""
- from .cryptomath import *
? -
+ from cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
if pycryptoLoaded:
from Crypto.PublicKey import RSA
class PyCrypto_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if not d:
- self.rsa = RSA.construct( (n, e) )
+ self.rsa = RSA.construct( (long(n), long(e)) )
? ++ ++++ +++++ +
else:
- self.rsa = RSA.construct( (n, e, d, p, q) )
+ self.rsa = RSA.construct( (long(n), long(e), long(d), long(p), long(q)) )
? ++ ++++ +++++ + +++++ + +++++ + +++++ +
def __getattr__(self, name):
return getattr(self.rsa, name)
def hasPrivateKey(self):
return self.rsa.has_private()
def _rawPrivateKeyOp(self, m):
- s = numberToString(m, numBytes(self.n))
- c = stringToNumber(self.rsa.decrypt((s,)))
? --------------- ^ -
+ c = self.rsa.decrypt((m,))
? ^
return c
def _rawPublicKeyOp(self, c):
- s = numberToString(c, numBytes(self.n))
- m = stringToNumber(self.rsa.encrypt(s, None)[0])
? --------------- ^ -
+ m = self.rsa.encrypt(c, None)[0]
? ^
return m
def generate(bits):
key = PyCrypto_RSAKey()
def f(numBytes):
return bytes(getRandomBytes(numBytes))
key.rsa = RSA.generate(bits, f)
return key
generate = staticmethod(generate) | 12 | 0.285714 | 5 | 7 |
9143d75d1c33663beecf994aa9caf4f40ffbfc75 | app/views/layouts/body/_title.html.erb | app/views/layouts/body/_title.html.erb | <div class="container">
<%= link_to home_path do %>
<h1>
<% if I18n.exists?("general.project_name", locale) %>
<span id="maintitle"><%= t "general.project_name" %></span>
<% end %>
<% if I18n.exists?("general.project_subtitle", locale) %>
<span class="small"><%= t "general.project_subtitle" %></span>
<% end %>
</h1>
<% end %>
</div>
| <div class="container">
<%= link_to home_path do %>
<h1>
<% if I18n.exists?("general.project_name", locale) %>
<span class="site-title"><%= t "general.project_name" %></span>
<% end %>
<% if I18n.exists?("general.project_subtitle", locale) %>
<small class="site-subtitle"><%= t "general.project_subtitle" %></small>
<% end %>
</h1>
<% end %>
</div>
| Update title / subtitle markup | Update title / subtitle markup
Switch main title's selector to a class, as this markup change will
require reviewing before merging with existing sites anyway
Switch subtitle wrapping element to small and add site-subtitle class
- Expect site-subtitle should be more unique to only style this element
| HTML+ERB | mit | CDRH/orchid,CDRH/orchid,CDRH/orchid | html+erb | ## Code Before:
<div class="container">
<%= link_to home_path do %>
<h1>
<% if I18n.exists?("general.project_name", locale) %>
<span id="maintitle"><%= t "general.project_name" %></span>
<% end %>
<% if I18n.exists?("general.project_subtitle", locale) %>
<span class="small"><%= t "general.project_subtitle" %></span>
<% end %>
</h1>
<% end %>
</div>
## Instruction:
Update title / subtitle markup
Switch main title's selector to a class, as this markup change will
require reviewing before merging with existing sites anyway
Switch subtitle wrapping element to small and add site-subtitle class
- Expect site-subtitle should be more unique to only style this element
## Code After:
<div class="container">
<%= link_to home_path do %>
<h1>
<% if I18n.exists?("general.project_name", locale) %>
<span class="site-title"><%= t "general.project_name" %></span>
<% end %>
<% if I18n.exists?("general.project_subtitle", locale) %>
<small class="site-subtitle"><%= t "general.project_subtitle" %></small>
<% end %>
</h1>
<% end %>
</div>
| <div class="container">
<%= link_to home_path do %>
<h1>
<% if I18n.exists?("general.project_name", locale) %>
- <span id="maintitle"><%= t "general.project_name" %></span>
? ^^ ^^ ^
+ <span class="site-title"><%= t "general.project_name" %></span>
? ^^^^^ ^ ^^^
<% end %>
<% if I18n.exists?("general.project_subtitle", locale) %>
- <span class="small"><%= t "general.project_subtitle" %></span>
? ^ ^ ^^ ^ ^ ^
+ <small class="site-subtitle"><%= t "general.project_subtitle" %></small>
? ^ ^^ ^^^^^^^^^^ ^ ^ ^^
<% end %>
</h1>
<% end %>
</div> | 4 | 0.333333 | 2 | 2 |
309c52b2d0d66d7c36ebcd8209613d413feaea12 | requirements.txt | requirements.txt | Django==1.5.2
Markdown==2.3.1
argparse==1.2.1
dj-database-url==0.2.2
dj-static==0.0.5
django-filter==0.7
django-oauth2-provider==0.2.6
django-toolbelt==0.0.1
djangorestframework==2.3.10
gunicorn==18.0
psycopg2==2.5.1
shortuuid==0.4
static==0.4
wsgiref==0.1.2
| Django==1.5.2
Markdown==2.3.1
South==0.8.4
argparse==1.2.1
dj-database-url==0.2.2
dj-static==0.0.5
django-filter==0.7
django-oauth2-provider==0.2.6
django-toolbelt==0.0.1
djangorestframework==2.3.10
gunicorn==18.0
psycopg2==2.5.1
shortuuid==0.4
static==0.4
wsgiref==0.1.2
| Fix missing dependency on South | Fix missing dependency on South
| Text | mit | MatteoNardi/dyanote-server,MatteoNardi/dyanote-server | text | ## Code Before:
Django==1.5.2
Markdown==2.3.1
argparse==1.2.1
dj-database-url==0.2.2
dj-static==0.0.5
django-filter==0.7
django-oauth2-provider==0.2.6
django-toolbelt==0.0.1
djangorestframework==2.3.10
gunicorn==18.0
psycopg2==2.5.1
shortuuid==0.4
static==0.4
wsgiref==0.1.2
## Instruction:
Fix missing dependency on South
## Code After:
Django==1.5.2
Markdown==2.3.1
South==0.8.4
argparse==1.2.1
dj-database-url==0.2.2
dj-static==0.0.5
django-filter==0.7
django-oauth2-provider==0.2.6
django-toolbelt==0.0.1
djangorestframework==2.3.10
gunicorn==18.0
psycopg2==2.5.1
shortuuid==0.4
static==0.4
wsgiref==0.1.2
| Django==1.5.2
Markdown==2.3.1
+ South==0.8.4
argparse==1.2.1
dj-database-url==0.2.2
dj-static==0.0.5
django-filter==0.7
django-oauth2-provider==0.2.6
django-toolbelt==0.0.1
djangorestframework==2.3.10
gunicorn==18.0
psycopg2==2.5.1
shortuuid==0.4
static==0.4
wsgiref==0.1.2 | 1 | 0.071429 | 1 | 0 |
44a5cfe185ac0ce2d8d642c1d16de1532ae17a48 | bower.json | bower.json | {
"name": "bem",
"version": "1.0.0",
"main": "_bem.scss",
"description": "Collection of BEM Mixins & Helpers",
"authors": [
"zgabievi <zura.gabievi@gmail.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"package.json",
"test",
"tests"
]
}
| {
"name": "bem",
"version": "1.0.1",
"main": "_bem.scss",
"description": "Collection of BEM Mixins & Helpers",
"authors": [
"zgabievi <zura.gabievi@gmail.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"package.json",
"test",
"tests"
]
}
| Upgrade to 1.0.1 for reasons | Upgrade to 1.0.1 for reasons
| JSON | mit | zgabievi/sass-bem | json | ## Code Before:
{
"name": "bem",
"version": "1.0.0",
"main": "_bem.scss",
"description": "Collection of BEM Mixins & Helpers",
"authors": [
"zgabievi <zura.gabievi@gmail.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"package.json",
"test",
"tests"
]
}
## Instruction:
Upgrade to 1.0.1 for reasons
## Code After:
{
"name": "bem",
"version": "1.0.1",
"main": "_bem.scss",
"description": "Collection of BEM Mixins & Helpers",
"authors": [
"zgabievi <zura.gabievi@gmail.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"package.json",
"test",
"tests"
]
}
| {
- "name": "bem",
? ^
+ "name": "bem",
? ^^
- "version": "1.0.0",
? ^ ^
+ "version": "1.0.1",
? ^^ ^
- "main": "_bem.scss",
? ^
+ "main": "_bem.scss",
? ^^
- "description": "Collection of BEM Mixins & Helpers",
? ^
+ "description": "Collection of BEM Mixins & Helpers",
? ^^
- "authors": [
? ^
+ "authors": [
? ^^
- "zgabievi <zura.gabievi@gmail.com>"
? ^^
+ "zgabievi <zura.gabievi@gmail.com>"
? ^^^^
- ],
+ ],
- "license": "MIT",
? ^
+ "license": "MIT",
? ^^
- "ignore": [
? ^
+ "ignore": [
? ^^
- "**/.*",
+ "**/.*",
- "node_modules",
? ^^
+ "node_modules",
? ^^^^
- "bower_components",
? ^^
+ "bower_components",
? ^^^^
- "package.json",
? ^^
+ "package.json",
? ^^^^
- "test",
- "tests"
- ]
+ "test",
+ "tests"
+ ]
} | 32 | 1.777778 | 16 | 16 |
8d63ace7ab69ca7575d00c5aa9bf2644e2f7797b | app/views/taxonomy/health_warnings/index.html.erb | app/views/taxonomy/health_warnings/index.html.erb | <%= display_header title: "Taxonomy Health Warnings",
breadcrumbs: ["Taxonomy Health Warnings"] %>
<div class="tagged-content">
<table class="table queries-list table-bordered table-striped"
data-module="filterable-table">
<thead>
<tr class="table-header">
<th style='width: 100px;'>Date</th>
<th>Taxon</th>
<th>Warning message</th>
</tr>
<%= render partial: 'shared/table_filter' %>
</thead>
<tbody>
<% @taxonomy_health_warnings.each do |taxonomy_health_warning| %>
<tr>
<td><%= time_ago_in_words(taxonomy_health_warning.created_at) %></td>
<td><%= link_to taxonomy_health_warning.internal_name,
taxon_path(taxonomy_health_warning.content_id) %>
<br>
<span class="text-muted"><%= taxonomy_health_warning.path %></span>
</td>
<td><%= taxonomy_health_warning.message %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
| <%= display_header title: "Taxonomy Health Warnings",
breadcrumbs: ["Taxonomy Health Warnings"] %>
<div class="tagged-content">
<table class="table queries-list table-bordered table-striped"
data-module="filterable-table">
<thead>
<tr class="table-header">
<th style='width: 100px;'>Date</th>
<th>Taxon</th>
<th>Warning message</th>
</tr>
<%= render partial: 'shared/table_filter' %>
</thead>
<tbody>
<% @taxonomy_health_warnings.order(value: :desc).each do |taxonomy_health_warning| %>
<tr>
<td><%= time_ago_in_words(taxonomy_health_warning.created_at) %></td>
<td><%= link_to taxonomy_health_warning.internal_name,
taxon_path(taxonomy_health_warning.content_id) %>
<br>
<span class="text-muted"><%= taxonomy_health_warning.path %></span>
</td>
<td><%= taxonomy_health_warning.message %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
| Sort the health warnings in the table | Sort the health warnings in the table
In descending order, as with the current metrics, this means the more
extreme issues come out towards the top.
| HTML+ERB | mit | alphagov/content-tagger,alphagov/content-tagger,alphagov/content-tagger | html+erb | ## Code Before:
<%= display_header title: "Taxonomy Health Warnings",
breadcrumbs: ["Taxonomy Health Warnings"] %>
<div class="tagged-content">
<table class="table queries-list table-bordered table-striped"
data-module="filterable-table">
<thead>
<tr class="table-header">
<th style='width: 100px;'>Date</th>
<th>Taxon</th>
<th>Warning message</th>
</tr>
<%= render partial: 'shared/table_filter' %>
</thead>
<tbody>
<% @taxonomy_health_warnings.each do |taxonomy_health_warning| %>
<tr>
<td><%= time_ago_in_words(taxonomy_health_warning.created_at) %></td>
<td><%= link_to taxonomy_health_warning.internal_name,
taxon_path(taxonomy_health_warning.content_id) %>
<br>
<span class="text-muted"><%= taxonomy_health_warning.path %></span>
</td>
<td><%= taxonomy_health_warning.message %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
## Instruction:
Sort the health warnings in the table
In descending order, as with the current metrics, this means the more
extreme issues come out towards the top.
## Code After:
<%= display_header title: "Taxonomy Health Warnings",
breadcrumbs: ["Taxonomy Health Warnings"] %>
<div class="tagged-content">
<table class="table queries-list table-bordered table-striped"
data-module="filterable-table">
<thead>
<tr class="table-header">
<th style='width: 100px;'>Date</th>
<th>Taxon</th>
<th>Warning message</th>
</tr>
<%= render partial: 'shared/table_filter' %>
</thead>
<tbody>
<% @taxonomy_health_warnings.order(value: :desc).each do |taxonomy_health_warning| %>
<tr>
<td><%= time_ago_in_words(taxonomy_health_warning.created_at) %></td>
<td><%= link_to taxonomy_health_warning.internal_name,
taxon_path(taxonomy_health_warning.content_id) %>
<br>
<span class="text-muted"><%= taxonomy_health_warning.path %></span>
</td>
<td><%= taxonomy_health_warning.message %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
| <%= display_header title: "Taxonomy Health Warnings",
breadcrumbs: ["Taxonomy Health Warnings"] %>
<div class="tagged-content">
<table class="table queries-list table-bordered table-striped"
data-module="filterable-table">
<thead>
<tr class="table-header">
<th style='width: 100px;'>Date</th>
<th>Taxon</th>
<th>Warning message</th>
</tr>
<%= render partial: 'shared/table_filter' %>
</thead>
<tbody>
- <% @taxonomy_health_warnings.each do |taxonomy_health_warning| %>
+ <% @taxonomy_health_warnings.order(value: :desc).each do |taxonomy_health_warning| %>
? ++++++++++++++++++++
<tr>
<td><%= time_ago_in_words(taxonomy_health_warning.created_at) %></td>
<td><%= link_to taxonomy_health_warning.internal_name,
taxon_path(taxonomy_health_warning.content_id) %>
<br>
<span class="text-muted"><%= taxonomy_health_warning.path %></span>
</td>
<td><%= taxonomy_health_warning.message %></td>
</tr>
<% end %>
</tbody>
</table>
</div> | 2 | 0.064516 | 1 | 1 |
19ea0268ff55d0c35e78af1ef9f849f9e1235690 | doc/collaboration/code/code.rst | doc/collaboration/code/code.rst | .. _contributing_code:
Contributing Code
#################
This section contains details regarding the coding style, the acceptable licenses, the naming
conventions, the code submission infrastructure, the review process and the code documentation.
Ensure that you have read and understood the information before submitting any code changes.
.. toctree::
:maxdepth: 1
coding_style
naming_conventions
gerrit
changes
maintainers
doxygen/doxygen | .. _contributing_code:
Contributing Code
#################
This section contains details regarding the coding style, the acceptable licenses, the naming
conventions, the code submission infrastructure, the review process and the code documentation.
Ensure that you have read and understood the information before submitting any code changes.
.. toctree::
:maxdepth: 1
coding_style
naming_conventions
gerrit
gerrit_practices
changes
maintainers
doxygen/doxygen | Add gerrit recommended practices to the appropriate toc tree. | Doc: Add gerrit recommended practices to the appropriate
toc tree.
In order to gerrit include the recommended practices
guidelines it need to appear in the toc tree.
Change-Id: Ib985fa2238bfd03e780dce2fda4242997f43eb06
Signed-off-by: Gerardo A. Aceves <06d9fe6dad6a09d03e12b6c1fedd6a238297f7ac@intel.com>
| reStructuredText | apache-2.0 | fbsder/zephyr,aceofall/zephyr-iotos,finikorg/zephyr,bboozzoo/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,bigdinotech/zephyr,mbolivar/zephyr,rsalveti/zephyr,32bitmicro/zephyr,zephyrproject-rtos/zephyr,fbsder/zephyr,mirzak/zephyr-os,punitvara/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,holtmann/zephyr,32bitmicro/zephyr,erwango/zephyr,holtmann/zephyr,fractalclone/zephyr-riscv,mirzak/zephyr-os,aceofall/zephyr-iotos,runchip/zephyr-cc3200,fractalclone/zephyr-riscv,finikorg/zephyr,galak/zephyr,jamesonwilliams/zephyr-kernel,fractalclone/zephyr-riscv,punitvara/zephyr,nashif/zephyr,Vudentz/zephyr,jamesonwilliams/zephyr-kernel,bigdinotech/zephyr,fbsder/zephyr,runchip/zephyr-cc3220,runchip/zephyr-cc3200,pklazy/zephyr,jamesonwilliams/zephyr-kernel,runchip/zephyr-cc3200,kraj/zephyr,fbsder/zephyr,32bitmicro/zephyr,aceofall/zephyr-iotos,ldts/zephyr,holtmann/zephyr,coldnew/zephyr-project-fork,32bitmicro/zephyr,explora26/zephyr,holtmann/zephyr,aceofall/zephyr-iotos,zephyrproject-rtos/zephyr,rsalveti/zephyr,bigdinotech/zephyr,coldnew/zephyr-project-fork,fbsder/zephyr,punitvara/zephyr,tidyjiang8/zephyr-doc,rsalveti/zephyr,holtmann/zephyr,tidyjiang8/zephyr-doc,runchip/zephyr-cc3200,32bitmicro/zephyr,mbolivar/zephyr,mbolivar/zephyr,punitvara/zephyr,sharronliu/zephyr,galak/zephyr,galak/zephyr,bigdinotech/zephyr,kraj/zephyr,explora26/zephyr,sharronliu/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,zephyriot/zephyr,explora26/zephyr,bigdinotech/zephyr,punitvara/zephyr,pklazy/zephyr,runchip/zephyr-cc3220,jamesonwilliams/zephyr-kernel,kraj/zephyr,zephyriot/zephyr,explora26/zephyr,kraj/zephyr,sharronliu/zephyr,runchip/zephyr-cc3220,nashif/zephyr,bboozzoo/zephyr,tidyjiang8/zephyr-doc,fractalclone/zephyr-riscv,erwango/zephyr,jamesonwilliams/zephyr-kernel,explora26/zephyr,sharronliu/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,pklazy/zephyr,nashif/zephyr,sharronliu/zephyr,Vudentz/zephyr,Vudentz/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,rsalveti/zephyr,erwango/zephyr,GiulianoFranchetto/zephyr,runchip/zephyr-cc3220,galak/zephyr,tidyjiang8/zephyr-doc,bboozzoo/zephyr,runchip/zephyr-cc3200,ldts/zephyr,ldts/zephyr,bboozzoo/zephyr,coldnew/zephyr-project-fork,pklazy/zephyr,Vudentz/zephyr,mirzak/zephyr-os,zephyriot/zephyr,zephyriot/zephyr,runchip/zephyr-cc3220,erwango/zephyr,coldnew/zephyr-project-fork,zephyriot/zephyr,mirzak/zephyr-os,erwango/zephyr,mbolivar/zephyr,rsalveti/zephyr,mirzak/zephyr-os,nashif/zephyr,Vudentz/zephyr,kraj/zephyr,aceofall/zephyr-iotos,GiulianoFranchetto/zephyr,mbolivar/zephyr,tidyjiang8/zephyr-doc,finikorg/zephyr,nashif/zephyr,fractalclone/zephyr-riscv,Vudentz/zephyr,zephyrproject-rtos/zephyr,pklazy/zephyr,bboozzoo/zephyr,coldnew/zephyr-project-fork | restructuredtext | ## Code Before:
.. _contributing_code:
Contributing Code
#################
This section contains details regarding the coding style, the acceptable licenses, the naming
conventions, the code submission infrastructure, the review process and the code documentation.
Ensure that you have read and understood the information before submitting any code changes.
.. toctree::
:maxdepth: 1
coding_style
naming_conventions
gerrit
changes
maintainers
doxygen/doxygen
## Instruction:
Doc: Add gerrit recommended practices to the appropriate
toc tree.
In order to gerrit include the recommended practices
guidelines it need to appear in the toc tree.
Change-Id: Ib985fa2238bfd03e780dce2fda4242997f43eb06
Signed-off-by: Gerardo A. Aceves <06d9fe6dad6a09d03e12b6c1fedd6a238297f7ac@intel.com>
## Code After:
.. _contributing_code:
Contributing Code
#################
This section contains details regarding the coding style, the acceptable licenses, the naming
conventions, the code submission infrastructure, the review process and the code documentation.
Ensure that you have read and understood the information before submitting any code changes.
.. toctree::
:maxdepth: 1
coding_style
naming_conventions
gerrit
gerrit_practices
changes
maintainers
doxygen/doxygen | .. _contributing_code:
Contributing Code
#################
This section contains details regarding the coding style, the acceptable licenses, the naming
conventions, the code submission infrastructure, the review process and the code documentation.
Ensure that you have read and understood the information before submitting any code changes.
.. toctree::
:maxdepth: 1
coding_style
naming_conventions
gerrit
+ gerrit_practices
changes
maintainers
doxygen/doxygen | 1 | 0.055556 | 1 | 0 |
c9e2c70e05ade220e5aa6a4790ee2a9b720cc46e | sorting_test.py | sorting_test.py | import mergesort.merge_sort
import quicksort.quicksort
import sys
import time
from random import randint
def main(max_len):
for n in [2**(n+1) for n in range(max_len)]:
print 'Array size: %d' % n
arr = [randint(0, 2**max_len) for n in range(n)]
current_time = time.time()
quicksort.quicksort.check(mergesort.merge_sort.sort(arr))
print 'Merge sort: %f' % (time.time() - current_time)
current_time = time.time()
quicksort.quicksort.check(quicksort.quicksort.sort(arr, 0, len(arr)))
print 'Quicksort: %f' % (time.time() - current_time)
print '-----------------'
if __name__ == '__main__':
try:
max_len = int(sys.argv[1])
except (IndexError, ValueError):
print 'Format: python sorting_test.py <log(max input)>'
main(max_len) | import mergesort.merge_sort
import quicksort.quicksort
import sys
import time
from random import randint
def multi_size(max_len):
for n in [2**(n+1) for n in range(max_len)]:
print 'Array size: %d' % n
arr = [randint(0, 2**max_len) for n in range(n)]
current_time = time.time()
quicksort.quicksort.check(mergesort.merge_sort.sort(arr), n+1)
print 'Merge sort: %f' % (time.time() - current_time)
current_time = time.time()
quicksort.quicksort.check(quicksort.quicksort.sort(arr, 0, n+1), n+1)
print 'Quicksort: %f' % (time.time() - current_time)
print '-----------------'
def fixed_time(sec, length):
count = 0
start = time.time()
end = start + sec
while time.time() < end:
arr = [randint(0, length) for n in range(length)]
mergesort.merge_sort.sort(arr)
count += 1
print 'Merge sort: %d %d-element arrays in %d seconds' % (count, length, sec)
count = 0
start = time.time()
end = start + sec
while time.time() < end:
arr = [randint(0, length) for n in range(length)]
quicksort.quicksort.sort(arr, 0, length)
count += 1
print 'Quicksort: %d %d-element arrays in %d seconds' % (count, length, sec)
if __name__ == '__main__':
if len(sys.argv) > 2:
fixed_time(int(sys.argv[1]), int(sys.argv[2]))
else:
multi_size(int(sys.argv[1])) | Allow comparison within a fixed time period | Allow comparison within a fixed time period
To get an idea of average run-time, I wanted to be able to test
mergesort and quicksort with the same inputs many times over;
now by specifying a time limit and array length, the script will
run each algorithm on as many times as possible on random arrays
and report how many arrays were sorted within the time period.
| Python | mit | timpel/stanford-algs,timpel/stanford-algs | python | ## Code Before:
import mergesort.merge_sort
import quicksort.quicksort
import sys
import time
from random import randint
def main(max_len):
for n in [2**(n+1) for n in range(max_len)]:
print 'Array size: %d' % n
arr = [randint(0, 2**max_len) for n in range(n)]
current_time = time.time()
quicksort.quicksort.check(mergesort.merge_sort.sort(arr))
print 'Merge sort: %f' % (time.time() - current_time)
current_time = time.time()
quicksort.quicksort.check(quicksort.quicksort.sort(arr, 0, len(arr)))
print 'Quicksort: %f' % (time.time() - current_time)
print '-----------------'
if __name__ == '__main__':
try:
max_len = int(sys.argv[1])
except (IndexError, ValueError):
print 'Format: python sorting_test.py <log(max input)>'
main(max_len)
## Instruction:
Allow comparison within a fixed time period
To get an idea of average run-time, I wanted to be able to test
mergesort and quicksort with the same inputs many times over;
now by specifying a time limit and array length, the script will
run each algorithm on as many times as possible on random arrays
and report how many arrays were sorted within the time period.
## Code After:
import mergesort.merge_sort
import quicksort.quicksort
import sys
import time
from random import randint
def multi_size(max_len):
for n in [2**(n+1) for n in range(max_len)]:
print 'Array size: %d' % n
arr = [randint(0, 2**max_len) for n in range(n)]
current_time = time.time()
quicksort.quicksort.check(mergesort.merge_sort.sort(arr), n+1)
print 'Merge sort: %f' % (time.time() - current_time)
current_time = time.time()
quicksort.quicksort.check(quicksort.quicksort.sort(arr, 0, n+1), n+1)
print 'Quicksort: %f' % (time.time() - current_time)
print '-----------------'
def fixed_time(sec, length):
count = 0
start = time.time()
end = start + sec
while time.time() < end:
arr = [randint(0, length) for n in range(length)]
mergesort.merge_sort.sort(arr)
count += 1
print 'Merge sort: %d %d-element arrays in %d seconds' % (count, length, sec)
count = 0
start = time.time()
end = start + sec
while time.time() < end:
arr = [randint(0, length) for n in range(length)]
quicksort.quicksort.sort(arr, 0, length)
count += 1
print 'Quicksort: %d %d-element arrays in %d seconds' % (count, length, sec)
if __name__ == '__main__':
if len(sys.argv) > 2:
fixed_time(int(sys.argv[1]), int(sys.argv[2]))
else:
multi_size(int(sys.argv[1])) | import mergesort.merge_sort
import quicksort.quicksort
import sys
import time
from random import randint
- def main(max_len):
? ^ ^
+ def multi_size(max_len):
? ^^^ ^^^^^
for n in [2**(n+1) for n in range(max_len)]:
print 'Array size: %d' % n
arr = [randint(0, 2**max_len) for n in range(n)]
current_time = time.time()
- quicksort.quicksort.check(mergesort.merge_sort.sort(arr))
+ quicksort.quicksort.check(mergesort.merge_sort.sort(arr), n+1)
? +++++
print 'Merge sort: %f' % (time.time() - current_time)
current_time = time.time()
- quicksort.quicksort.check(quicksort.quicksort.sort(arr, 0, len(arr)))
? -- ^^^^ -
+ quicksort.quicksort.check(quicksort.quicksort.sort(arr, 0, n+1), n+1)
? ^^ +++++
print 'Quicksort: %f' % (time.time() - current_time)
print '-----------------'
+ def fixed_time(sec, length):
+
+ count = 0
+ start = time.time()
+ end = start + sec
+
+ while time.time() < end:
+ arr = [randint(0, length) for n in range(length)]
+ mergesort.merge_sort.sort(arr)
+ count += 1
+
+ print 'Merge sort: %d %d-element arrays in %d seconds' % (count, length, sec)
+
+
+ count = 0
+ start = time.time()
+ end = start + sec
+
+ while time.time() < end:
+ arr = [randint(0, length) for n in range(length)]
+ quicksort.quicksort.sort(arr, 0, length)
+ count += 1
+
+ print 'Quicksort: %d %d-element arrays in %d seconds' % (count, length, sec)
+
+
if __name__ == '__main__':
+ if len(sys.argv) > 2:
+ fixed_time(int(sys.argv[1]), int(sys.argv[2]))
+ else:
+ multi_size(int(sys.argv[1]))
- try:
- max_len = int(sys.argv[1])
- except (IndexError, ValueError):
- print 'Format: python sorting_test.py <log(max input)>'
-
- main(max_len) | 42 | 1.448276 | 33 | 9 |
850fba4b07e4c444aa8640c6f4c3816f8a3259ea | website_medical_patient_species/controllers/main.py | website_medical_patient_species/controllers/main.py |
from openerp import http
from openerp.http import request
from openerp.addons.website_medical.controllers.main import (
WebsiteMedical
)
class WebsiteMedical(WebsiteMedical):
def _inject_medical_detail_vals(self, patient_id=0, **kwargs):
vals = super(WebsiteMedical, self)._inject_medical_detail_vals(
patient_id,
**kwargs
)
species_ids = request.env['medical.patient.species'].search([])
vals.update({
'species': species_ids,
})
return vals
|
from openerp.http import request
from openerp.addons.website_medical.controllers.main import (
WebsiteMedical
)
class WebsiteMedical(WebsiteMedical):
def _inject_medical_detail_vals(self, patient_id=0, **kwargs):
vals = super(WebsiteMedical, self)._inject_medical_detail_vals(
patient_id,
**kwargs
)
species_ids = request.env['medical.patient.species'].search([])
vals.update({
'species': species_ids,
})
return vals
| Fix lint * Remove stray import to fix lint | [FIX] website_medical_patient_species: Fix lint
* Remove stray import to fix lint
| Python | agpl-3.0 | laslabs/vertical-medical,laslabs/vertical-medical | python | ## Code Before:
from openerp import http
from openerp.http import request
from openerp.addons.website_medical.controllers.main import (
WebsiteMedical
)
class WebsiteMedical(WebsiteMedical):
def _inject_medical_detail_vals(self, patient_id=0, **kwargs):
vals = super(WebsiteMedical, self)._inject_medical_detail_vals(
patient_id,
**kwargs
)
species_ids = request.env['medical.patient.species'].search([])
vals.update({
'species': species_ids,
})
return vals
## Instruction:
[FIX] website_medical_patient_species: Fix lint
* Remove stray import to fix lint
## Code After:
from openerp.http import request
from openerp.addons.website_medical.controllers.main import (
WebsiteMedical
)
class WebsiteMedical(WebsiteMedical):
def _inject_medical_detail_vals(self, patient_id=0, **kwargs):
vals = super(WebsiteMedical, self)._inject_medical_detail_vals(
patient_id,
**kwargs
)
species_ids = request.env['medical.patient.species'].search([])
vals.update({
'species': species_ids,
})
return vals
|
- from openerp import http
from openerp.http import request
from openerp.addons.website_medical.controllers.main import (
WebsiteMedical
)
class WebsiteMedical(WebsiteMedical):
def _inject_medical_detail_vals(self, patient_id=0, **kwargs):
vals = super(WebsiteMedical, self)._inject_medical_detail_vals(
patient_id,
**kwargs
)
species_ids = request.env['medical.patient.species'].search([])
vals.update({
'species': species_ids,
})
return vals | 1 | 0.047619 | 0 | 1 |
348de40de0bf24fb2749555e47e3af5be327c2e1 | invoice_condition_template/account_invoice_view.xml | invoice_condition_template/account_invoice_view.xml | <openerp>
<data>
<record model="ir.ui.view" id="invoice_form_add_condition">
<field name="name">account.invoice.form.condition</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line']" position="before">
<label for="note1"/>
<field name="note1" colspan="4"/>
<group>
<div>Use template
<field name="condition_template1_id"
nolabel="1"
class='oe_inline'
domain="[('position','=','before_lines')]"/>
</div>
</group>
</xpath>
<xpath expr="//field[@name='comment']" position="replace">
<field name="comment" colspan="4"/>
<label for="note2"/>
<field name="note2" colspan="4"/>
<group>
<div>Use template
<field name="condition_template2_id"
nolabel="1"
class='oe_inline'
domain="[('position','=','after_lines')]"/>
</div>
</group>
</xpath>
</field>
</record>
</data>
</openerp>
| <openerp>
<data>
<record model="ir.ui.view" id="invoice_form_add_condition">
<field name="name">account.invoice.form.condition</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page[3]" position="after">
<page string="Comments" name="comments">
<label string="The comments will be displayed on the printed document. You can load a predefined template, write your own text or load a template and then modify it only for this document." colspan="2"/>
<group string="Top Comments">
<field name="condition_template1_id"
string="Load a template"
domain="[('position','=','before_lines')]"
context="{'default_position': 'before_lines'}"/>
<field name="note1" nolabel="1" colspan="2"/>
</group>
<group string="Bottom Comments">
<field name="condition_template2_id"
string="Load a template"
context="{'default_position': 'after_lines'}"
domain="[('position','=','after_lines')]"/>
<field name="note2" nolabel="1" colspan="2"/>
</group>
</page>
</xpath>
</field>
</record>
</data>
</openerp>
| Move the comments fields in a page | Move the comments fields in a page
They take too much place in the first page of the notebook. Improved the
layout of these fields (use the same layout than sale_condition_template)
| XML | agpl-3.0 | Endika/account-invoice-reporting,massot/account-invoice-reporting,Eficent/account-invoice-reporting,charbeljc/account-invoice-reporting,hurrinico/account-invoice-reporting,amoya-dx/account-invoice-reporting,raycarnes/account-invoice-reporting,vrenaville/account-invoice-reporting,damdam-s/account-invoice-reporting | xml | ## Code Before:
<openerp>
<data>
<record model="ir.ui.view" id="invoice_form_add_condition">
<field name="name">account.invoice.form.condition</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line']" position="before">
<label for="note1"/>
<field name="note1" colspan="4"/>
<group>
<div>Use template
<field name="condition_template1_id"
nolabel="1"
class='oe_inline'
domain="[('position','=','before_lines')]"/>
</div>
</group>
</xpath>
<xpath expr="//field[@name='comment']" position="replace">
<field name="comment" colspan="4"/>
<label for="note2"/>
<field name="note2" colspan="4"/>
<group>
<div>Use template
<field name="condition_template2_id"
nolabel="1"
class='oe_inline'
domain="[('position','=','after_lines')]"/>
</div>
</group>
</xpath>
</field>
</record>
</data>
</openerp>
## Instruction:
Move the comments fields in a page
They take too much place in the first page of the notebook. Improved the
layout of these fields (use the same layout than sale_condition_template)
## Code After:
<openerp>
<data>
<record model="ir.ui.view" id="invoice_form_add_condition">
<field name="name">account.invoice.form.condition</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page[3]" position="after">
<page string="Comments" name="comments">
<label string="The comments will be displayed on the printed document. You can load a predefined template, write your own text or load a template and then modify it only for this document." colspan="2"/>
<group string="Top Comments">
<field name="condition_template1_id"
string="Load a template"
domain="[('position','=','before_lines')]"
context="{'default_position': 'before_lines'}"/>
<field name="note1" nolabel="1" colspan="2"/>
</group>
<group string="Bottom Comments">
<field name="condition_template2_id"
string="Load a template"
context="{'default_position': 'after_lines'}"
domain="[('position','=','after_lines')]"/>
<field name="note2" nolabel="1" colspan="2"/>
</group>
</page>
</xpath>
</field>
</record>
</data>
</openerp>
| <openerp>
- <data>
? --
+ <data>
- <record model="ir.ui.view" id="invoice_form_add_condition">
? ----
+ <record model="ir.ui.view" id="invoice_form_add_condition">
- <field name="name">account.invoice.form.condition</field>
? ------
+ <field name="name">account.invoice.form.condition</field>
- <field name="model">account.invoice</field>
? ------
+ <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_form"/>
? ------
+ <field name="inherit_id" ref="account.invoice_form"/>
- <field name="arch" type="xml">
? ------
+ <field name="arch" type="xml">
+ <xpath expr="/form/sheet/notebook/page[3]" position="after">
+ <page string="Comments" name="comments">
+ <label string="The comments will be displayed on the printed document. You can load a predefined template, write your own text or load a template and then modify it only for this document." colspan="2"/>
+ <group string="Top Comments">
- <xpath expr="//field[@name='invoice_line']" position="before">
- <label for="note1"/>
- <field name="note1" colspan="4"/>
- <group>
- <div>Use template
- <field name="condition_template1_id"
? --------------
+ <field name="condition_template1_id"
+ string="Load a template"
- nolabel="1"
- class='oe_inline'
- domain="[('position','=','before_lines')]"/>
? ---------------- --
+ domain="[('position','=','before_lines')]"
- </div>
+ context="{'default_position': 'before_lines'}"/>
+ <field name="note1" nolabel="1" colspan="2"/>
- </group>
? --------
+ </group>
+ <group string="Bottom Comments">
+ <field name="condition_template2_id"
+ string="Load a template"
+ context="{'default_position': 'after_lines'}"
+ domain="[('position','=','after_lines')]"/>
+ <field name="note2" nolabel="1" colspan="2"/>
+ </group>
+ </page>
- </xpath>
? --------
+ </xpath>
- <xpath expr="//field[@name='comment']" position="replace">
- <field name="comment" colspan="4"/>
- <label for="note2"/>
- <field name="note2" colspan="4"/>
- <group>
- <div>Use template
- <field name="condition_template2_id"
- nolabel="1"
- class='oe_inline'
- domain="[('position','=','after_lines')]"/>
- </div>
- </group>
- </xpath>
-
- </field>
? ------
+ </field>
- </record>
? ----
+ </record>
- </data>
? --
+ </data>
</openerp> | 63 | 1.615385 | 28 | 35 |
579c9764063ae79cd8c7bad593d3fda84defe77e | app/partials/volume.jade | app/partials/volume.jade | extends ../layout/partial
include include/accordion-heading-mixin
block billboard
| {{ image.parent.session.subject.collection | capitalize }}
| Patient {{ image.parent.session.subject.number }}
| Session {{ image.parent.session.number }}
| {{ image.parent | imageContainerTitle }}
| Time Point {{ image.timePoint }}
block content
// The modeling parameter overlay select.
include include/image-overlay-select
// The image display.
qi-image.qi-panel.qi-image
// The opacity, axis and threshold image controls.
include include/image-controls
block help-text
// The nested quote ensures evaluation to a string rather than
// a scope variable.
.qi-help-text(ng-include="'/partials/help/volume.html'")
| extends ../layout/partial
include include/accordion-heading-mixin
block billboard
| {{ volume.container.session.subject.collection | capitalize }}
| Patient {{ volume.container.session.subject.number }}
| Session {{ volume.container.session.number }}
| {{ volume.container._cls }}
| Volume {{ volume.number }}
block content
// The modeling parameter overlay select.
include include/image-overlay-select
// The image display.
qi-image.qi-panel.qi-image
// The opacity, axis and threshold image controls.
include include/image-controls
block help-text
// The nested quote ensures evaluation to a string rather than
// a scope variable.
.qi-help-text(ng-include="'/partials/help/volume.html'")
| Change Time Point to Volume in title. | Change Time Point to Volume in title.
| Jade | bsd-2-clause | ohsu-qin/qiprofile,ohsu-qin/qiprofile,ohsu-qin/qiprofile,ohsu-qin/qiprofile | jade | ## Code Before:
extends ../layout/partial
include include/accordion-heading-mixin
block billboard
| {{ image.parent.session.subject.collection | capitalize }}
| Patient {{ image.parent.session.subject.number }}
| Session {{ image.parent.session.number }}
| {{ image.parent | imageContainerTitle }}
| Time Point {{ image.timePoint }}
block content
// The modeling parameter overlay select.
include include/image-overlay-select
// The image display.
qi-image.qi-panel.qi-image
// The opacity, axis and threshold image controls.
include include/image-controls
block help-text
// The nested quote ensures evaluation to a string rather than
// a scope variable.
.qi-help-text(ng-include="'/partials/help/volume.html'")
## Instruction:
Change Time Point to Volume in title.
## Code After:
extends ../layout/partial
include include/accordion-heading-mixin
block billboard
| {{ volume.container.session.subject.collection | capitalize }}
| Patient {{ volume.container.session.subject.number }}
| Session {{ volume.container.session.number }}
| {{ volume.container._cls }}
| Volume {{ volume.number }}
block content
// The modeling parameter overlay select.
include include/image-overlay-select
// The image display.
qi-image.qi-panel.qi-image
// The opacity, axis and threshold image controls.
include include/image-controls
block help-text
// The nested quote ensures evaluation to a string rather than
// a scope variable.
.qi-help-text(ng-include="'/partials/help/volume.html'")
| extends ../layout/partial
include include/accordion-heading-mixin
block billboard
- | {{ image.parent.session.subject.collection | capitalize }}
? ^ -- ^^^^
+ | {{ volume.container.session.subject.collection | capitalize }}
? ^^^^ ^^ +++++
- | Patient {{ image.parent.session.subject.number }}
? ^ -- ^^^^
+ | Patient {{ volume.container.session.subject.number }}
? ^^^^ ^^ +++++
- | Session {{ image.parent.session.number }}
? ^ -- ^^^^
+ | Session {{ volume.container.session.number }}
? ^^^^ ^^ +++++
- | {{ image.parent | imageContainerTitle }}
- | Time Point {{ image.timePoint }}
+ | {{ volume.container._cls }}
+ | Volume {{ volume.number }}
block content
// The modeling parameter overlay select.
include include/image-overlay-select
// The image display.
qi-image.qi-panel.qi-image
// The opacity, axis and threshold image controls.
include include/image-controls
block help-text
// The nested quote ensures evaluation to a string rather than
// a scope variable.
.qi-help-text(ng-include="'/partials/help/volume.html'") | 10 | 0.434783 | 5 | 5 |
3ccf5afba6637a4df3237176581b3757c0a7545a | app/src/ui/confirm-dialog.tsx | app/src/ui/confirm-dialog.tsx | import * as React from 'react'
import { Dispatcher } from '../lib/dispatcher'
import { ButtonGroup } from '../ui/lib/button-group'
import { Button } from '../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../ui/dialog'
interface IConfirmDialogProps {
readonly dispatcher: Dispatcher
readonly title: string
readonly message: string
readonly onConfirmation: () => void
}
export class ConfirmDialog extends React.Component<IConfirmDialogProps, void> {
public constructor(props: IConfirmDialogProps) {
super(props)
}
private cancel = () => {
this.props.dispatcher.closePopup()
}
private onConfirmed = () => {
this.props.onConfirmation()
this.props.dispatcher.closePopup()
}
public render() {
return (
<Dialog
title={this.props.title}
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
{this.props.message}
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
| import * as React from 'react'
import { ButtonGroup } from '../ui/lib/button-group'
import { Button } from '../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../ui/dialog'
interface IConfirmDialogProps {
readonly title: string
readonly message: string
readonly onConfirmation: () => void
readonly onDismissed: () => void
}
export class ConfirmDialog extends React.Component<IConfirmDialogProps, void> {
public constructor(props: IConfirmDialogProps) {
super(props)
}
private cancel = () => {
this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation()
this.props.onDismissed()
}
public render() {
return (
<Dialog
title={this.props.title}
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
{this.props.message}
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
| Remove dependency on dispatcher in favor of event handler | Remove dependency on dispatcher in favor of event handler
| TypeScript | mit | BugTesterTest/desktops,say25/desktop,j-f1/forked-desktop,BugTesterTest/desktops,BugTesterTest/desktops,artivilla/desktop,kactus-io/kactus,gengjiawen/desktop,gengjiawen/desktop,shiftkey/desktop,shiftkey/desktop,hjobrien/desktop,hjobrien/desktop,say25/desktop,shiftkey/desktop,artivilla/desktop,BugTesterTest/desktops,desktop/desktop,desktop/desktop,artivilla/desktop,say25/desktop,kactus-io/kactus,kactus-io/kactus,desktop/desktop,say25/desktop,gengjiawen/desktop,hjobrien/desktop,gengjiawen/desktop,desktop/desktop,j-f1/forked-desktop,kactus-io/kactus,shiftkey/desktop,artivilla/desktop,hjobrien/desktop,j-f1/forked-desktop,j-f1/forked-desktop | typescript | ## Code Before:
import * as React from 'react'
import { Dispatcher } from '../lib/dispatcher'
import { ButtonGroup } from '../ui/lib/button-group'
import { Button } from '../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../ui/dialog'
interface IConfirmDialogProps {
readonly dispatcher: Dispatcher
readonly title: string
readonly message: string
readonly onConfirmation: () => void
}
export class ConfirmDialog extends React.Component<IConfirmDialogProps, void> {
public constructor(props: IConfirmDialogProps) {
super(props)
}
private cancel = () => {
this.props.dispatcher.closePopup()
}
private onConfirmed = () => {
this.props.onConfirmation()
this.props.dispatcher.closePopup()
}
public render() {
return (
<Dialog
title={this.props.title}
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
{this.props.message}
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
## Instruction:
Remove dependency on dispatcher in favor of event handler
## Code After:
import * as React from 'react'
import { ButtonGroup } from '../ui/lib/button-group'
import { Button } from '../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../ui/dialog'
interface IConfirmDialogProps {
readonly title: string
readonly message: string
readonly onConfirmation: () => void
readonly onDismissed: () => void
}
export class ConfirmDialog extends React.Component<IConfirmDialogProps, void> {
public constructor(props: IConfirmDialogProps) {
super(props)
}
private cancel = () => {
this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation()
this.props.onDismissed()
}
public render() {
return (
<Dialog
title={this.props.title}
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
{this.props.message}
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
| import * as React from 'react'
- import { Dispatcher } from '../lib/dispatcher'
import { ButtonGroup } from '../ui/lib/button-group'
import { Button } from '../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../ui/dialog'
interface IConfirmDialogProps {
- readonly dispatcher: Dispatcher
readonly title: string
readonly message: string
readonly onConfirmation: () => void
+ readonly onDismissed: () => void
}
export class ConfirmDialog extends React.Component<IConfirmDialogProps, void> {
public constructor(props: IConfirmDialogProps) {
super(props)
}
private cancel = () => {
- this.props.dispatcher.closePopup()
+ this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation()
- this.props.dispatcher.closePopup()
+ this.props.onDismissed()
}
public render() {
return (
<Dialog
title={this.props.title}
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
{this.props.message}
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
} | 7 | 0.148936 | 3 | 4 |
a9b3f6f5260b17cad1a86a8aacea687817a54a4c | src/AppBundle/Tests/Controller/ApiControllerTest.php | src/AppBundle/Tests/Controller/ApiControllerTest.php | <?php
namespace AppBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());
}
}
| <?php
namespace AppBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ApiControllerTest extends WebTestCase
{
public function testGame()
{
$id = $this->doTestNewGame();
$this->doTestGuess($id);
}
public function doTestNewGame()
{
$client = static::createClient();
$container = $client->getContainer();
$route = $container->get('router')->generate('game');
// POST to /game
$client->request('POST', $route);
// Expect a 201 CREATED status code
$this->assertEquals(201, $client->getResponse()->getStatusCode());
$content = $client->getResponse()->getContent();
// Should not contain an error, but should contain at least data and id
$this->assertNotContains('error', $content);
$this->assertContains('data', $content);
$this->assertContains('id', $content);
// Get the new game ID
$data = json_decode($content, true);
return $data['data']['id'];
}
public function doTestGuess($id)
{
$client = static::createClient();
$container = $client->getContainer();
$route = $container->get('router')->generate('guess', ['id' => $id]);
// PUT to /game/{id} with a JSON body containing a letter
$client->request(
'PUT',
$route,
[],
[],
['CONTENT_TYPE' => 'application/json'],
'{ "letter": "a" }'
);
// Expect a 200 OK status code
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = $client->getResponse()->getContent();
// Should not contain an error, but should contain at least data, word, tries_left and status
$this->assertNotContains('error', $content);
$this->assertContains('data', $content);
$this->assertContains('word', $content);
$this->assertContains('tries_left', $content);
$this->assertContains('status', $content);
}
}
| Add functional tests for the API controller | Add functional tests for the API controller
| PHP | mit | damonjones/hangman,damonjones/hangman | php | ## Code Before:
<?php
namespace AppBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());
}
}
## Instruction:
Add functional tests for the API controller
## Code After:
<?php
namespace AppBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ApiControllerTest extends WebTestCase
{
public function testGame()
{
$id = $this->doTestNewGame();
$this->doTestGuess($id);
}
public function doTestNewGame()
{
$client = static::createClient();
$container = $client->getContainer();
$route = $container->get('router')->generate('game');
// POST to /game
$client->request('POST', $route);
// Expect a 201 CREATED status code
$this->assertEquals(201, $client->getResponse()->getStatusCode());
$content = $client->getResponse()->getContent();
// Should not contain an error, but should contain at least data and id
$this->assertNotContains('error', $content);
$this->assertContains('data', $content);
$this->assertContains('id', $content);
// Get the new game ID
$data = json_decode($content, true);
return $data['data']['id'];
}
public function doTestGuess($id)
{
$client = static::createClient();
$container = $client->getContainer();
$route = $container->get('router')->generate('guess', ['id' => $id]);
// PUT to /game/{id} with a JSON body containing a letter
$client->request(
'PUT',
$route,
[],
[],
['CONTENT_TYPE' => 'application/json'],
'{ "letter": "a" }'
);
// Expect a 200 OK status code
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = $client->getResponse()->getContent();
// Should not contain an error, but should contain at least data, word, tries_left and status
$this->assertNotContains('error', $content);
$this->assertContains('data', $content);
$this->assertContains('word', $content);
$this->assertContains('tries_left', $content);
$this->assertContains('status', $content);
}
}
| <?php
namespace AppBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
- class DefaultControllerTest extends WebTestCase
? ^^^^^^^
+ class ApiControllerTest extends WebTestCase
? ^^^
{
- public function testIndex()
? ^^^ -
+ public function testGame()
? ^^^
+ {
+ $id = $this->doTestNewGame();
+ $this->doTestGuess($id);
+ }
+
+ public function doTestNewGame()
{
$client = static::createClient();
- $crawler = $client->request('GET', '/');
+ $container = $client->getContainer();
+ $route = $container->get('router')->generate('game');
+ // POST to /game
+ $client->request('POST', $route);
+
+ // Expect a 201 CREATED status code
+ $this->assertEquals(201, $client->getResponse()->getStatusCode());
+
+ $content = $client->getResponse()->getContent();
+ // Should not contain an error, but should contain at least data and id
+ $this->assertNotContains('error', $content);
+ $this->assertContains('data', $content);
+ $this->assertContains('id', $content);
+
+ // Get the new game ID
+ $data = json_decode($content, true);
+
+ return $data['data']['id'];
+ }
+
+ public function doTestGuess($id)
+ {
+ $client = static::createClient();
+
+ $container = $client->getContainer();
+ $route = $container->get('router')->generate('guess', ['id' => $id]);
+
+ // PUT to /game/{id} with a JSON body containing a letter
+ $client->request(
+ 'PUT',
+ $route,
+ [],
+ [],
+ ['CONTENT_TYPE' => 'application/json'],
+ '{ "letter": "a" }'
+ );
+
+ // Expect a 200 OK status code
$this->assertEquals(200, $client->getResponse()->getStatusCode());
- $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());
+
+ $content = $client->getResponse()->getContent();
+ // Should not contain an error, but should contain at least data, word, tries_left and status
+ $this->assertNotContains('error', $content);
+ $this->assertContains('data', $content);
+ $this->assertContains('word', $content);
+ $this->assertContains('tries_left', $content);
+ $this->assertContains('status', $content);
}
} | 58 | 3.222222 | 54 | 4 |
888261e1b0e36d1451e66c49927d0eebd146baf9 | atom.cson | atom.cson | "*":
editor:
fontFamily: "Fira Mono OT"
showIndentGuide: true
tabLength: 2
softWrap: true
invisibles: {}
zoomFontWhenCtrlScrolling: false
core:
disabledPackages: [
"language-objective-c"
"archive-view"
"autosave"
"bookmarks"
"language-clojure"
"language-perl"
"language-php"
"language-toml"
"snippets"
"welcome"
"spell-check"
"deprecation-cop"
]
themes: [
"seti-ui"
"seti-syntax"
]
projectHome: "/home/ai/Dev"
autoHideMenuBar: true
"exception-reporting":
userId: "51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71"
welcome:
showOnStartup: false
"markdown-preview":
breakOnSingleNewline: true
"spell-check": {}
".html.source":
editor:
tabLength: 4
".css.source":
editor:
tabLength: 4
".js.source":
editor:
tabLength: 4
| "*":
editor:
fontFamily: "Fira Mono OT"
showIndentGuide: true
tabLength: 2
softWrap: true
invisibles: {}
zoomFontWhenCtrlScrolling: false
nonWordCharacters: "^*\"`'/|\\?!;:,.%#@(){}[]<>=+~_"
core:
disabledPackages: [
"language-objective-c"
"archive-view"
"autosave"
"bookmarks"
"language-clojure"
"language-perl"
"language-php"
"language-toml"
"snippets"
"welcome"
"spell-check"
"deprecation-cop"
"timecop"
"styleguide"
]
themes: [
"seti-ui"
"seti-syntax"
]
projectHome: "/home/ai/Dev"
autoHideMenuBar: true
"exception-reporting":
userId: "51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71"
welcome:
showOnStartup: false
"markdown-preview":
breakOnSingleNewline: true
"spell-check": {}
".html.source":
editor:
tabLength: 4
".css.source":
editor:
tabLength: 4
".js.source":
editor:
tabLength: 4
| Fix word selection in Atom | Fix word selection in Atom
| CoffeeScript | mit | ai/environment,ai/environment | coffeescript | ## Code Before:
"*":
editor:
fontFamily: "Fira Mono OT"
showIndentGuide: true
tabLength: 2
softWrap: true
invisibles: {}
zoomFontWhenCtrlScrolling: false
core:
disabledPackages: [
"language-objective-c"
"archive-view"
"autosave"
"bookmarks"
"language-clojure"
"language-perl"
"language-php"
"language-toml"
"snippets"
"welcome"
"spell-check"
"deprecation-cop"
]
themes: [
"seti-ui"
"seti-syntax"
]
projectHome: "/home/ai/Dev"
autoHideMenuBar: true
"exception-reporting":
userId: "51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71"
welcome:
showOnStartup: false
"markdown-preview":
breakOnSingleNewline: true
"spell-check": {}
".html.source":
editor:
tabLength: 4
".css.source":
editor:
tabLength: 4
".js.source":
editor:
tabLength: 4
## Instruction:
Fix word selection in Atom
## Code After:
"*":
editor:
fontFamily: "Fira Mono OT"
showIndentGuide: true
tabLength: 2
softWrap: true
invisibles: {}
zoomFontWhenCtrlScrolling: false
nonWordCharacters: "^*\"`'/|\\?!;:,.%#@(){}[]<>=+~_"
core:
disabledPackages: [
"language-objective-c"
"archive-view"
"autosave"
"bookmarks"
"language-clojure"
"language-perl"
"language-php"
"language-toml"
"snippets"
"welcome"
"spell-check"
"deprecation-cop"
"timecop"
"styleguide"
]
themes: [
"seti-ui"
"seti-syntax"
]
projectHome: "/home/ai/Dev"
autoHideMenuBar: true
"exception-reporting":
userId: "51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71"
welcome:
showOnStartup: false
"markdown-preview":
breakOnSingleNewline: true
"spell-check": {}
".html.source":
editor:
tabLength: 4
".css.source":
editor:
tabLength: 4
".js.source":
editor:
tabLength: 4
| "*":
editor:
fontFamily: "Fira Mono OT"
showIndentGuide: true
tabLength: 2
softWrap: true
invisibles: {}
zoomFontWhenCtrlScrolling: false
+ nonWordCharacters: "^*\"`'/|\\?!;:,.%#@(){}[]<>=+~_"
core:
disabledPackages: [
"language-objective-c"
"archive-view"
"autosave"
"bookmarks"
"language-clojure"
"language-perl"
"language-php"
"language-toml"
"snippets"
"welcome"
"spell-check"
"deprecation-cop"
+ "timecop"
+ "styleguide"
]
themes: [
"seti-ui"
"seti-syntax"
]
projectHome: "/home/ai/Dev"
autoHideMenuBar: true
"exception-reporting":
userId: "51ccaaae-04bc-1ed3-3445-f9bd1a2f3a71"
welcome:
showOnStartup: false
"markdown-preview":
breakOnSingleNewline: true
"spell-check": {}
".html.source":
editor:
tabLength: 4
".css.source":
editor:
tabLength: 4
".js.source":
editor:
tabLength: 4 | 3 | 0.066667 | 3 | 0 |
76be4d016ca309053f229731a8ad3a7e7cceafaf | bot_modules/gifme.js | bot_modules/gifme.js | // $ GifMe
// $ Authors: victorgama
// $ Created on: Mon Mar 14 15:29:14 BRT 2016
// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada
// no giphy.com e retorna um resultado aleatório.
var Base = require('../src/base_module');
var GifMe = function(bot) {
Base.call(this, bot);
this.respond(/gif( me)? ([\w\??| ]+)$/i, (response) => {
var tag = response.match[2];
this.http({
uri: 'http://api.gifme.io/v1/search',
qs: {
sfw: 'true',
key: 'rX7kbMzkGu7WJwvG',
query: tag
},
json: true
})
.then(d => {
console.log(d);
if(d.status !== 200) {
response.reply('Não consegui pesquisar o termo. Talvez a internet esteja quebrada. :stuck_out_tongue:');
} else {
if(!d.data.length) {
response.reply('Não conheço essa reação... :disappointed:');
} else {
response.reply(this.random(d.data.filter(i => !i.nsfw)).link);
}
}
});
});
};
Base.setup(GifMe);
module.exports = GifMe;
| // $ GifMe
// $ Authors: victorgama
// $ Created on: Mon Mar 14 15:29:14 BRT 2016
// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada
// no giphy.com e retorna um resultado aleatório.
var Base = require('../src/base_module');
var GifMe = function(bot) {
Base.call(this, bot);
this.respond(/gif( me)? ([\w\??| ]+)$/i, (response) => {
var tag = response.match[2];
this.http({
uri: 'http://api.gifme.io/v1/search',
qs: {
sfw: 'true',
key: 'rX7kbMzkGu7WJwvG',
query: tag
},
json: true
})
.then(d => {
if(d.status !== 200) {
response.reply('Não consegui pesquisar o termo. Talvez a internet esteja quebrada. :stuck_out_tongue:');
} else {
if(!d.data.length) {
response.reply('Não conheço essa reação... :disappointed:');
} else {
response.reply(this.random(d.data.filter(i => !i.nsfw)).link);
}
}
});
});
};
Base.setup(GifMe);
module.exports = GifMe;
| Remove console.log from GifMe module | Remove console.log from GifMe module
| JavaScript | mit | victorgama/Giskard,victorgama/Giskard,victorgama/Giskard | javascript | ## Code Before:
// $ GifMe
// $ Authors: victorgama
// $ Created on: Mon Mar 14 15:29:14 BRT 2016
// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada
// no giphy.com e retorna um resultado aleatório.
var Base = require('../src/base_module');
var GifMe = function(bot) {
Base.call(this, bot);
this.respond(/gif( me)? ([\w\??| ]+)$/i, (response) => {
var tag = response.match[2];
this.http({
uri: 'http://api.gifme.io/v1/search',
qs: {
sfw: 'true',
key: 'rX7kbMzkGu7WJwvG',
query: tag
},
json: true
})
.then(d => {
console.log(d);
if(d.status !== 200) {
response.reply('Não consegui pesquisar o termo. Talvez a internet esteja quebrada. :stuck_out_tongue:');
} else {
if(!d.data.length) {
response.reply('Não conheço essa reação... :disappointed:');
} else {
response.reply(this.random(d.data.filter(i => !i.nsfw)).link);
}
}
});
});
};
Base.setup(GifMe);
module.exports = GifMe;
## Instruction:
Remove console.log from GifMe module
## Code After:
// $ GifMe
// $ Authors: victorgama
// $ Created on: Mon Mar 14 15:29:14 BRT 2016
// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada
// no giphy.com e retorna um resultado aleatório.
var Base = require('../src/base_module');
var GifMe = function(bot) {
Base.call(this, bot);
this.respond(/gif( me)? ([\w\??| ]+)$/i, (response) => {
var tag = response.match[2];
this.http({
uri: 'http://api.gifme.io/v1/search',
qs: {
sfw: 'true',
key: 'rX7kbMzkGu7WJwvG',
query: tag
},
json: true
})
.then(d => {
if(d.status !== 200) {
response.reply('Não consegui pesquisar o termo. Talvez a internet esteja quebrada. :stuck_out_tongue:');
} else {
if(!d.data.length) {
response.reply('Não conheço essa reação... :disappointed:');
} else {
response.reply(this.random(d.data.filter(i => !i.nsfw)).link);
}
}
});
});
};
Base.setup(GifMe);
module.exports = GifMe;
| // $ GifMe
// $ Authors: victorgama
// $ Created on: Mon Mar 14 15:29:14 BRT 2016
// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada
// no giphy.com e retorna um resultado aleatório.
var Base = require('../src/base_module');
var GifMe = function(bot) {
Base.call(this, bot);
this.respond(/gif( me)? ([\w\??| ]+)$/i, (response) => {
var tag = response.match[2];
this.http({
uri: 'http://api.gifme.io/v1/search',
qs: {
sfw: 'true',
key: 'rX7kbMzkGu7WJwvG',
query: tag
},
json: true
})
.then(d => {
- console.log(d);
if(d.status !== 200) {
response.reply('Não consegui pesquisar o termo. Talvez a internet esteja quebrada. :stuck_out_tongue:');
} else {
if(!d.data.length) {
response.reply('Não conheço essa reação... :disappointed:');
} else {
response.reply(this.random(d.data.filter(i => !i.nsfw)).link);
}
}
});
});
};
Base.setup(GifMe);
module.exports = GifMe; | 1 | 0.026316 | 0 | 1 |
7c9ca7333acca5dab1e01fa282758038cf62b843 | tools/cgfx2json/stdafx.h | tools/cgfx2json/stdafx.h | // Copyright (c) 2009-2011 Turbulenz Limited
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifdef _MSC_VER
#pragma once
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#ifndef BOOST_DISABLE_THREADS
#define BOOST_DISABLE_THREADS
#endif
#include <boost/xpressive/xpressive.hpp>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <map>
#include <set>
#include <Cg/cg.h>
#include <Cg/cgGL.h>
| // Copyright (c) 2009-2011 Turbulenz Limited
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifdef _MSC_VER
#pragma once
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#ifndef BOOST_DISABLE_THREADS
#define BOOST_DISABLE_THREADS
#endif
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4458)
# pragma warning(disable:4459)
# pragma warning(disable:4456)
#endif
#include <boost/xpressive/xpressive.hpp>
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <map>
#include <set>
#include <Cg/cg.h>
#include <Cg/cgGL.h>
| Disable some compiler warnings on the boost library. | Disable some compiler warnings on the boost library.
| C | mit | sanyaade-teachings/turbulenz_engine,turbulenz/turbulenz_engine,changemypath/turbulenz_engine,turbulenz/turbulenz_engine,supriyantomaftuh/turbulenz_engine,tianyutingxy/turbulenz_engine,supriyantomaftuh/turbulenz_engine,turbulenz/turbulenz_engine,tianyutingxy/turbulenz_engine,sanyaade-teachings/turbulenz_engine,supriyantomaftuh/turbulenz_engine,turbulenz/turbulenz_engine,turbulenz/turbulenz_engine,changemypath/turbulenz_engine,tianyutingxy/turbulenz_engine,changemypath/turbulenz_engine,tianyutingxy/turbulenz_engine,supriyantomaftuh/turbulenz_engine,sanyaade-teachings/turbulenz_engine,changemypath/turbulenz_engine,sanyaade-teachings/turbulenz_engine,tianyutingxy/turbulenz_engine,changemypath/turbulenz_engine,sanyaade-teachings/turbulenz_engine,supriyantomaftuh/turbulenz_engine | c | ## Code Before:
// Copyright (c) 2009-2011 Turbulenz Limited
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifdef _MSC_VER
#pragma once
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#ifndef BOOST_DISABLE_THREADS
#define BOOST_DISABLE_THREADS
#endif
#include <boost/xpressive/xpressive.hpp>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <map>
#include <set>
#include <Cg/cg.h>
#include <Cg/cgGL.h>
## Instruction:
Disable some compiler warnings on the boost library.
## Code After:
// Copyright (c) 2009-2011 Turbulenz Limited
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifdef _MSC_VER
#pragma once
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#ifndef BOOST_DISABLE_THREADS
#define BOOST_DISABLE_THREADS
#endif
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4458)
# pragma warning(disable:4459)
# pragma warning(disable:4456)
#endif
#include <boost/xpressive/xpressive.hpp>
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <map>
#include <set>
#include <Cg/cg.h>
#include <Cg/cgGL.h>
| // Copyright (c) 2009-2011 Turbulenz Limited
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifdef _MSC_VER
#pragma once
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#ifndef BOOST_DISABLE_THREADS
#define BOOST_DISABLE_THREADS
#endif
+ #ifdef _MSC_VER
+ # pragma warning(push)
+ # pragma warning(disable:4458)
+ # pragma warning(disable:4459)
+ # pragma warning(disable:4456)
+ #endif
+
#include <boost/xpressive/xpressive.hpp>
+
+ #ifdef _MSC_VER
+ # pragma warning(pop)
+ #endif
+
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <map>
#include <set>
#include <Cg/cg.h>
#include <Cg/cgGL.h> | 12 | 0.292683 | 12 | 0 |
3690fff3f528cd6e28a2f6eaf19a893ccb2f79db | html.jsx | html.jsx | import React from 'react'
import DocumentTitle from 'react-document-title'
import { link } from 'gatsby-helpers'
import { TypographyStyle } from 'utils/typography'
module.exports = React.createClass({
propTypes () {
return {
title: React.PropTypes.string,
}
},
render () {
let title = DocumentTitle.rewind()
if (this.props.title) {
title = this.props.title
}
return (
<html lang="en">
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0 maximum-scale=1.0"
/>
<title>{title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
<TypographyStyle/>
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
<script src={link('/bundle.js')}/>
</body>
</html>
)
},
})
| import React from 'react'
import DocumentTitle from 'react-document-title'
import { link } from 'gatsby-helpers'
import { TypographyStyle } from 'utils/typography'
module.exports = React.createClass({
propTypes () {
return {
title: React.PropTypes.string,
}
},
render () {
let title = DocumentTitle.rewind()
if (this.props.title) {
title = this.props.title
}
let cssLink
if (process.env.NODE_ENV === 'production') {
cssLink = <link rel="stylesheet" href={link('/styles.css')} />
}
return (
<html lang="en">
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0 maximum-scale=1.0"
/>
<title>{title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
<TypographyStyle/>
{cssLink}
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
<script src={link('/bundle.js')}/>
</body>
</html>
)
},
})
| Add link to styles.css on production builds | Add link to styles.css on production builds
| JSX | mit | ni-tta/irc,dearwish/gatsby-starter-clean,kepatopoc/gatsby-starter-clean,TasGuerciMaia/tasguercimaia.github.io,MeganKeesee/personal-site,peterqiu1997/irc,InnoD-WebTier/irc,roslaneshellanoo/gatsby-starter-clean,jmcorona/jmcorona-netlify,jmcorona/jmcorona-netlify,benruehl/gatsby-kruemelkiste,sarahxy/irc,MeganKeesee/personal-site,byronnewmedia/deanpower,peterqiu1997/irc,karolklp/slonecznikowe2,ivygong/irc,InnoD-WebTier/irc,sarahxy/irc,futuregerald/NetlifyApp,immato/website,ivygong/irc,karolklp/slonecznikowe2,futuregerald/NetlifyApp,ni-tta/irc | jsx | ## Code Before:
import React from 'react'
import DocumentTitle from 'react-document-title'
import { link } from 'gatsby-helpers'
import { TypographyStyle } from 'utils/typography'
module.exports = React.createClass({
propTypes () {
return {
title: React.PropTypes.string,
}
},
render () {
let title = DocumentTitle.rewind()
if (this.props.title) {
title = this.props.title
}
return (
<html lang="en">
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0 maximum-scale=1.0"
/>
<title>{title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
<TypographyStyle/>
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
<script src={link('/bundle.js')}/>
</body>
</html>
)
},
})
## Instruction:
Add link to styles.css on production builds
## Code After:
import React from 'react'
import DocumentTitle from 'react-document-title'
import { link } from 'gatsby-helpers'
import { TypographyStyle } from 'utils/typography'
module.exports = React.createClass({
propTypes () {
return {
title: React.PropTypes.string,
}
},
render () {
let title = DocumentTitle.rewind()
if (this.props.title) {
title = this.props.title
}
let cssLink
if (process.env.NODE_ENV === 'production') {
cssLink = <link rel="stylesheet" href={link('/styles.css')} />
}
return (
<html lang="en">
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0 maximum-scale=1.0"
/>
<title>{title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
<TypographyStyle/>
{cssLink}
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
<script src={link('/bundle.js')}/>
</body>
</html>
)
},
})
| import React from 'react'
import DocumentTitle from 'react-document-title'
import { link } from 'gatsby-helpers'
import { TypographyStyle } from 'utils/typography'
module.exports = React.createClass({
propTypes () {
return {
title: React.PropTypes.string,
}
},
render () {
let title = DocumentTitle.rewind()
if (this.props.title) {
title = this.props.title
}
+ let cssLink
+ if (process.env.NODE_ENV === 'production') {
+ cssLink = <link rel="stylesheet" href={link('/styles.css')} />
+ }
+
return (
<html lang="en">
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0 maximum-scale=1.0"
/>
<title>{title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
<TypographyStyle/>
+ {cssLink}
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
<script src={link('/bundle.js')}/>
</body>
</html>
)
},
}) | 6 | 0.15 | 6 | 0 |
8009e9b01e6024de61da56c129a155731022daed | client/components/interface/Navbar.js | client/components/interface/Navbar.js | import React, { PureComponent, PropTypes } from 'react'
import { Link } from 'react-router'
import { Menu, Button, Header, Icon } from 'semantic-ui-react'
class Navbar extends PureComponent {
static propTypes = {
currentUser: PropTypes.object,
signedIn: PropTypes.bool.isRequired,
signOut: PropTypes.func.isRequired
}
render() {
const { signedIn, signOut } = this.props
return(
<Menu stackable borderless>
<Menu.Item as={Link} to='/'><Header color='grey'>SlimPoll</Header></Menu.Item>
{ signedIn &&
<Menu.Item>
<Button basic animated='vertical' color='orange' as={Link} to='/create-poll'>
<Button.Content visible>Create a poll</Button.Content>
<Button.Content hidden>Easy as 1. 2. 3.</Button.Content>
</Button>
</Menu.Item>
}
<Menu.Menu position='right'>
{ signedIn &&
<Menu.Item onClick={signOut}>Sign out</Menu.Item>
}
{ !signedIn &&
<Menu.Item as={Link} to='sign-in'>Sign in</Menu.Item>
}
</Menu.Menu>
</Menu>
)
}
}
export default Navbar
| import React, { PureComponent, PropTypes } from 'react'
import { Link } from 'react-router'
import { Menu, Button, Header, Dropdown } from 'semantic-ui-react'
class Navbar extends PureComponent {
static propTypes = {
currentUser: PropTypes.object,
signedIn: PropTypes.bool.isRequired,
signOut: PropTypes.func.isRequired
}
render() {
const { signedIn, signOut, currentUser } = this.props
return(
<Menu stackable borderless>
<Menu.Item as={Link} to='/'><Header color='grey'>SlimPoll</Header></Menu.Item>
{ signedIn &&
<Menu.Item>
<Button basic animated='vertical' color='orange' as={Link} to='/create-poll'>
<Button.Content visible>Create a poll</Button.Content>
<Button.Content hidden>Easy as 1. 2. 3.</Button.Content>
</Button>
</Menu.Item>
}
<Menu.Menu position='right'>
{ signedIn &&
<Dropdown item closeOnBlur text={ currentUser.name }>
<Dropdown.Menu>
<Dropdown.Item as={Link} to='/create-poll'>Create a poll</Dropdown.Item>
<Dropdown.Item>Your polls</Dropdown.Item>
<Dropdown.Item>Polls you voted on</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item onClick={signOut}>Sign out</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
}
{ !signedIn &&
<Menu.Item as={Link} to='sign-in'>Sign in</Menu.Item>
}
</Menu.Menu>
</Menu>
)
}
}
export default Navbar
| Add dropdown menu to navbar | Add dropdown menu to navbar
| JavaScript | mit | SanderSijbrandij/slimpoll,SanderSijbrandij/slimpoll | javascript | ## Code Before:
import React, { PureComponent, PropTypes } from 'react'
import { Link } from 'react-router'
import { Menu, Button, Header, Icon } from 'semantic-ui-react'
class Navbar extends PureComponent {
static propTypes = {
currentUser: PropTypes.object,
signedIn: PropTypes.bool.isRequired,
signOut: PropTypes.func.isRequired
}
render() {
const { signedIn, signOut } = this.props
return(
<Menu stackable borderless>
<Menu.Item as={Link} to='/'><Header color='grey'>SlimPoll</Header></Menu.Item>
{ signedIn &&
<Menu.Item>
<Button basic animated='vertical' color='orange' as={Link} to='/create-poll'>
<Button.Content visible>Create a poll</Button.Content>
<Button.Content hidden>Easy as 1. 2. 3.</Button.Content>
</Button>
</Menu.Item>
}
<Menu.Menu position='right'>
{ signedIn &&
<Menu.Item onClick={signOut}>Sign out</Menu.Item>
}
{ !signedIn &&
<Menu.Item as={Link} to='sign-in'>Sign in</Menu.Item>
}
</Menu.Menu>
</Menu>
)
}
}
export default Navbar
## Instruction:
Add dropdown menu to navbar
## Code After:
import React, { PureComponent, PropTypes } from 'react'
import { Link } from 'react-router'
import { Menu, Button, Header, Dropdown } from 'semantic-ui-react'
class Navbar extends PureComponent {
static propTypes = {
currentUser: PropTypes.object,
signedIn: PropTypes.bool.isRequired,
signOut: PropTypes.func.isRequired
}
render() {
const { signedIn, signOut, currentUser } = this.props
return(
<Menu stackable borderless>
<Menu.Item as={Link} to='/'><Header color='grey'>SlimPoll</Header></Menu.Item>
{ signedIn &&
<Menu.Item>
<Button basic animated='vertical' color='orange' as={Link} to='/create-poll'>
<Button.Content visible>Create a poll</Button.Content>
<Button.Content hidden>Easy as 1. 2. 3.</Button.Content>
</Button>
</Menu.Item>
}
<Menu.Menu position='right'>
{ signedIn &&
<Dropdown item closeOnBlur text={ currentUser.name }>
<Dropdown.Menu>
<Dropdown.Item as={Link} to='/create-poll'>Create a poll</Dropdown.Item>
<Dropdown.Item>Your polls</Dropdown.Item>
<Dropdown.Item>Polls you voted on</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item onClick={signOut}>Sign out</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
}
{ !signedIn &&
<Menu.Item as={Link} to='sign-in'>Sign in</Menu.Item>
}
</Menu.Menu>
</Menu>
)
}
}
export default Navbar
| import React, { PureComponent, PropTypes } from 'react'
import { Link } from 'react-router'
- import { Menu, Button, Header, Icon } from 'semantic-ui-react'
? ^^
+ import { Menu, Button, Header, Dropdown } from 'semantic-ui-react'
? ^^ ++++
class Navbar extends PureComponent {
static propTypes = {
currentUser: PropTypes.object,
signedIn: PropTypes.bool.isRequired,
signOut: PropTypes.func.isRequired
}
render() {
- const { signedIn, signOut } = this.props
+ const { signedIn, signOut, currentUser } = this.props
? +++++++++++++
return(
<Menu stackable borderless>
<Menu.Item as={Link} to='/'><Header color='grey'>SlimPoll</Header></Menu.Item>
{ signedIn &&
<Menu.Item>
<Button basic animated='vertical' color='orange' as={Link} to='/create-poll'>
<Button.Content visible>Create a poll</Button.Content>
<Button.Content hidden>Easy as 1. 2. 3.</Button.Content>
</Button>
</Menu.Item>
}
<Menu.Menu position='right'>
{ signedIn &&
+ <Dropdown item closeOnBlur text={ currentUser.name }>
+ <Dropdown.Menu>
+ <Dropdown.Item as={Link} to='/create-poll'>Create a poll</Dropdown.Item>
+ <Dropdown.Item>Your polls</Dropdown.Item>
+ <Dropdown.Item>Polls you voted on</Dropdown.Item>
+ <Dropdown.Divider />
- <Menu.Item onClick={signOut}>Sign out</Menu.Item>
? ^^ - ^^ -
+ <Dropdown.Item onClick={signOut}>Sign out</Dropdown.Item>
? ++++ ^^^^^^^ ^^^^^^^
+ </Dropdown.Menu>
+ </Dropdown>
}
{ !signedIn &&
<Menu.Item as={Link} to='sign-in'>Sign in</Menu.Item>
}
</Menu.Menu>
</Menu>
)
}
}
export default Navbar | 14 | 0.368421 | 11 | 3 |
3754d10ee856e6575b27ee2bfa43b96b8f3489c5 | project/build/SbtIdeaProject.scala | project/build/SbtIdeaProject.scala | /**
* Copyright (C) 2010, Mikko Peltonen, Jon-Anders Teigen
* Licensed under the new BSD License.
* See the LICENSE file for details.
*/
import sbt._
class SbtIdeaProject(info:ProjectInfo) extends ParentProject(info) with IdeaProject {
override def managedStyle = ManagedStyle.Maven
lazy val publishTo = Resolver.file("GitHub Pages", new java.io.File("../mpeltonen.github.com/maven/"))
lazy val core = project("sbt-idea-core", "sbt-idea-core", new Core(_))
lazy val plugin = project("sbt-idea-plugin", "sbt-idea-plugin", new PluginProject(_) with IdeaProject, core)
lazy val processor = project("sbt-idea-processor", "sbt-idea-processor", new ProcessorProject(_) with IdeaProject, core)
lazy val scripted = project("scripted-tests", "scripted-tests", new ScriptedTests(_), plugin)
class Core(info:ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath
}
class ScriptedTests(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted {
override def scriptedSbt = "0.7.4"
}
}
| /**
* Copyright (C) 2010, Mikko Peltonen, Jon-Anders Teigen
* Licensed under the new BSD License.
* See the LICENSE file for details.
*/
import sbt._
class SbtIdeaProject(info:ProjectInfo) extends ParentProject(info) with IdeaProject {
override def managedStyle = ManagedStyle.Maven
lazy val publishTo = Resolver.file("GitHub Pages", new java.io.File("../mpeltonen.github.com/maven/"))
lazy val core = project("sbt-idea-core", "sbt-idea-core", new Core(_))
lazy val plugin = project("sbt-idea-plugin", "sbt-idea-plugin", new PluginProject(_) with IdeaProject, core)
lazy val processor = project("sbt-idea-processor", "sbt-idea-processor", new ProcessorProject(_) with IdeaProject, core)
lazy val scripted = project("scripted-tests", "scripted-tests", new ScriptedTests(_), plugin)
class Core(info:ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath
}
class ScriptedTests(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted with IdeaProject {
override def scriptedSbt = "0.7.4"
}
}
| Add IdeaProject mixin to scripted-tests project | Add IdeaProject mixin to scripted-tests project
| Scala | bsd-3-clause | mpeltonen/sbt-idea | scala | ## Code Before:
/**
* Copyright (C) 2010, Mikko Peltonen, Jon-Anders Teigen
* Licensed under the new BSD License.
* See the LICENSE file for details.
*/
import sbt._
class SbtIdeaProject(info:ProjectInfo) extends ParentProject(info) with IdeaProject {
override def managedStyle = ManagedStyle.Maven
lazy val publishTo = Resolver.file("GitHub Pages", new java.io.File("../mpeltonen.github.com/maven/"))
lazy val core = project("sbt-idea-core", "sbt-idea-core", new Core(_))
lazy val plugin = project("sbt-idea-plugin", "sbt-idea-plugin", new PluginProject(_) with IdeaProject, core)
lazy val processor = project("sbt-idea-processor", "sbt-idea-processor", new ProcessorProject(_) with IdeaProject, core)
lazy val scripted = project("scripted-tests", "scripted-tests", new ScriptedTests(_), plugin)
class Core(info:ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath
}
class ScriptedTests(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted {
override def scriptedSbt = "0.7.4"
}
}
## Instruction:
Add IdeaProject mixin to scripted-tests project
## Code After:
/**
* Copyright (C) 2010, Mikko Peltonen, Jon-Anders Teigen
* Licensed under the new BSD License.
* See the LICENSE file for details.
*/
import sbt._
class SbtIdeaProject(info:ProjectInfo) extends ParentProject(info) with IdeaProject {
override def managedStyle = ManagedStyle.Maven
lazy val publishTo = Resolver.file("GitHub Pages", new java.io.File("../mpeltonen.github.com/maven/"))
lazy val core = project("sbt-idea-core", "sbt-idea-core", new Core(_))
lazy val plugin = project("sbt-idea-plugin", "sbt-idea-plugin", new PluginProject(_) with IdeaProject, core)
lazy val processor = project("sbt-idea-processor", "sbt-idea-processor", new ProcessorProject(_) with IdeaProject, core)
lazy val scripted = project("scripted-tests", "scripted-tests", new ScriptedTests(_), plugin)
class Core(info:ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath
}
class ScriptedTests(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted with IdeaProject {
override def scriptedSbt = "0.7.4"
}
}
| /**
* Copyright (C) 2010, Mikko Peltonen, Jon-Anders Teigen
* Licensed under the new BSD License.
* See the LICENSE file for details.
*/
import sbt._
class SbtIdeaProject(info:ProjectInfo) extends ParentProject(info) with IdeaProject {
override def managedStyle = ManagedStyle.Maven
lazy val publishTo = Resolver.file("GitHub Pages", new java.io.File("../mpeltonen.github.com/maven/"))
lazy val core = project("sbt-idea-core", "sbt-idea-core", new Core(_))
lazy val plugin = project("sbt-idea-plugin", "sbt-idea-plugin", new PluginProject(_) with IdeaProject, core)
lazy val processor = project("sbt-idea-processor", "sbt-idea-processor", new ProcessorProject(_) with IdeaProject, core)
lazy val scripted = project("scripted-tests", "scripted-tests", new ScriptedTests(_), plugin)
class Core(info:ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath
}
- class ScriptedTests(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted {
+ class ScriptedTests(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted with IdeaProject {
? +++++++++++++++++
override def scriptedSbt = "0.7.4"
}
} | 2 | 0.08 | 1 | 1 |
f2e95de52433c25b7b79d79748f346299254d0e9 | .forestry/front_matter/templates/default-post.yml | .forestry/front_matter/templates/default-post.yml | ---
label: Default Post
hide_body: false
fields:
- name: author_profile
type: boolean
label: Author Profile
default: true
- name: read_time
type: boolean
label: Read Time
default: true
- name: comments
type: boolean
label: Comments
default: true
- name: share
type: boolean
label: Share
default: true
- name: related
type: boolean
label: Related
default: true
- name: layout
type: text
config:
required: false
label: Layout
default: single
- name: header
type: field_group
config: {}
fields:
- name: teaser
type: file
config:
maxSize: 250
label: Teaser
label: Header
pages:
- _posts/Second Post.md
- _posts/2019-05-08-First Post.md
| ---
label: Default Post
hide_body: false
fields:
- name: author_profile
type: boolean
label: Author Profile
default: true
- name: read_time
type: boolean
label: Read Time
default: true
- name: comments
type: boolean
label: Comments
default: true
- name: share
type: boolean
label: Share
default: true
- name: related
type: boolean
label: Related
default: true
- name: layout
type: text
config:
required: false
label: Layout
default: single
- name: header
type: field_group
config: {}
fields:
- name: teaser
type: file
config:
maxSize: 250
label: Teaser
- name: image
type: file
config:
maxSize: 250
label: Image
label: Header
pages:
- _posts/Second Post.md
- _posts/2019-05-08-First Post.md
| Update from Forestry.io - Updated Forestry configuration | Update from Forestry.io - Updated Forestry configuration
| YAML | mit | JesseWaas/jessewaas.github.io,JesseWaas/jessewaas.github.io,JesseWaas/jessewaas.github.io | yaml | ## Code Before:
---
label: Default Post
hide_body: false
fields:
- name: author_profile
type: boolean
label: Author Profile
default: true
- name: read_time
type: boolean
label: Read Time
default: true
- name: comments
type: boolean
label: Comments
default: true
- name: share
type: boolean
label: Share
default: true
- name: related
type: boolean
label: Related
default: true
- name: layout
type: text
config:
required: false
label: Layout
default: single
- name: header
type: field_group
config: {}
fields:
- name: teaser
type: file
config:
maxSize: 250
label: Teaser
label: Header
pages:
- _posts/Second Post.md
- _posts/2019-05-08-First Post.md
## Instruction:
Update from Forestry.io - Updated Forestry configuration
## Code After:
---
label: Default Post
hide_body: false
fields:
- name: author_profile
type: boolean
label: Author Profile
default: true
- name: read_time
type: boolean
label: Read Time
default: true
- name: comments
type: boolean
label: Comments
default: true
- name: share
type: boolean
label: Share
default: true
- name: related
type: boolean
label: Related
default: true
- name: layout
type: text
config:
required: false
label: Layout
default: single
- name: header
type: field_group
config: {}
fields:
- name: teaser
type: file
config:
maxSize: 250
label: Teaser
- name: image
type: file
config:
maxSize: 250
label: Image
label: Header
pages:
- _posts/Second Post.md
- _posts/2019-05-08-First Post.md
| ---
label: Default Post
hide_body: false
fields:
- name: author_profile
type: boolean
label: Author Profile
default: true
- name: read_time
type: boolean
label: Read Time
default: true
- name: comments
type: boolean
label: Comments
default: true
- name: share
type: boolean
label: Share
default: true
- name: related
type: boolean
label: Related
default: true
- name: layout
type: text
config:
required: false
label: Layout
default: single
- name: header
type: field_group
config: {}
fields:
- name: teaser
type: file
config:
maxSize: 250
label: Teaser
+ - name: image
+ type: file
+ config:
+ maxSize: 250
+ label: Image
label: Header
pages:
- _posts/Second Post.md
- _posts/2019-05-08-First Post.md | 5 | 0.116279 | 5 | 0 |
f872c9fc43837492c460e53578a5acab83ac84fa | test/Runner.js | test/Runner.js | /* global describe, it */
import assert from 'assert'
import child_process from 'child_process'
import sinon from 'sinon'
import Runner from '../src/Runner'
const configPath = './test/fixtures/config.json'
describe('Runner', () => {
it('is a class', done => {
const runner = new Runner('update', configPath)
assert.strictEqual(typeof Runner, 'function')
assert.strictEqual(runner.constructor, Runner)
done()
})
it('requires a hook', done => {
assert.throws(() => {
return new Runner()
}, /Missing required/)
done()
})
it('validates its hook', done => {
['precommit', 'pre_commit', 'Commit'].map(hook => {
assert.throws(() => {
return new Runner(hook, configPath)
}, /not valid hook name/)
})
done()
})
describe('#hook', () => {
it('holds the target hook script name', done => {
const runner = new Runner('commit-msg', configPath)
assert.strictEqual(runner.hook, 'commit-msg')
done()
})
})
describe('#run', () => {
it('calls child_process.spawn once', done => {
const stub = sinon.stub(child_process, 'spawn')
const runner = new Runner('update', configPath)
runner.run()
assert(stub.calledOnce)
done()
})
})
})
| /* global describe, it */
import assert from 'assert'
import child_process from 'child_process'
import sinon from 'sinon'
import Runner from '../src/Runner'
const configPath = './test/fixtures/config.json'
describe('Runner', () => {
it('is a class', done => {
const runner = new Runner('update', configPath)
assert.strictEqual(typeof Runner, 'function')
assert.strictEqual(runner.constructor, Runner)
done()
})
it('requires a hook', done => {
assert.throws(() => {
return new Runner()
}, /Missing required/)
done()
})
it('validates its hook', done => {
['precommit', 'pre_commit', 'Commit'].map(hook => {
assert.throws(() => {
return new Runner(hook, configPath)
}, /not valid hook name/)
})
done()
})
it('validates its config when provided', done => {
assert.throws(() => {
return new Runner('pre-commit', 'does-not-exist.json')
}, /no such file/)
assert.throws(() => {
return new Runner('pre-commit', './test/Runner.js')
}, SyntaxError)
done()
})
describe('#hook', () => {
it('holds the target hook script name', done => {
const runner = new Runner('commit-msg', configPath)
assert.strictEqual(runner.hook, 'commit-msg')
done()
})
})
describe('#run', () => {
it('calls child_process.spawn once', done => {
const stub = sinon.stub(child_process, 'spawn')
const runner = new Runner('update', configPath)
runner.run()
assert(stub.calledOnce)
done()
})
})
})
| Test that config passed to constructor is valid | Test that config passed to constructor is valid
Runner must receive a string representing the relative filepath to a config that
is exists, is valid JSON, and is formatted correctly with the expected keys.
| JavaScript | mit | mmwtsn/hook-script-runner,mmwtsn/hook-script-manager | javascript | ## Code Before:
/* global describe, it */
import assert from 'assert'
import child_process from 'child_process'
import sinon from 'sinon'
import Runner from '../src/Runner'
const configPath = './test/fixtures/config.json'
describe('Runner', () => {
it('is a class', done => {
const runner = new Runner('update', configPath)
assert.strictEqual(typeof Runner, 'function')
assert.strictEqual(runner.constructor, Runner)
done()
})
it('requires a hook', done => {
assert.throws(() => {
return new Runner()
}, /Missing required/)
done()
})
it('validates its hook', done => {
['precommit', 'pre_commit', 'Commit'].map(hook => {
assert.throws(() => {
return new Runner(hook, configPath)
}, /not valid hook name/)
})
done()
})
describe('#hook', () => {
it('holds the target hook script name', done => {
const runner = new Runner('commit-msg', configPath)
assert.strictEqual(runner.hook, 'commit-msg')
done()
})
})
describe('#run', () => {
it('calls child_process.spawn once', done => {
const stub = sinon.stub(child_process, 'spawn')
const runner = new Runner('update', configPath)
runner.run()
assert(stub.calledOnce)
done()
})
})
})
## Instruction:
Test that config passed to constructor is valid
Runner must receive a string representing the relative filepath to a config that
is exists, is valid JSON, and is formatted correctly with the expected keys.
## Code After:
/* global describe, it */
import assert from 'assert'
import child_process from 'child_process'
import sinon from 'sinon'
import Runner from '../src/Runner'
const configPath = './test/fixtures/config.json'
describe('Runner', () => {
it('is a class', done => {
const runner = new Runner('update', configPath)
assert.strictEqual(typeof Runner, 'function')
assert.strictEqual(runner.constructor, Runner)
done()
})
it('requires a hook', done => {
assert.throws(() => {
return new Runner()
}, /Missing required/)
done()
})
it('validates its hook', done => {
['precommit', 'pre_commit', 'Commit'].map(hook => {
assert.throws(() => {
return new Runner(hook, configPath)
}, /not valid hook name/)
})
done()
})
it('validates its config when provided', done => {
assert.throws(() => {
return new Runner('pre-commit', 'does-not-exist.json')
}, /no such file/)
assert.throws(() => {
return new Runner('pre-commit', './test/Runner.js')
}, SyntaxError)
done()
})
describe('#hook', () => {
it('holds the target hook script name', done => {
const runner = new Runner('commit-msg', configPath)
assert.strictEqual(runner.hook, 'commit-msg')
done()
})
})
describe('#run', () => {
it('calls child_process.spawn once', done => {
const stub = sinon.stub(child_process, 'spawn')
const runner = new Runner('update', configPath)
runner.run()
assert(stub.calledOnce)
done()
})
})
})
| /* global describe, it */
import assert from 'assert'
import child_process from 'child_process'
import sinon from 'sinon'
import Runner from '../src/Runner'
const configPath = './test/fixtures/config.json'
describe('Runner', () => {
it('is a class', done => {
const runner = new Runner('update', configPath)
assert.strictEqual(typeof Runner, 'function')
assert.strictEqual(runner.constructor, Runner)
done()
})
it('requires a hook', done => {
assert.throws(() => {
return new Runner()
}, /Missing required/)
done()
})
it('validates its hook', done => {
['precommit', 'pre_commit', 'Commit'].map(hook => {
assert.throws(() => {
return new Runner(hook, configPath)
}, /not valid hook name/)
})
done()
})
+ it('validates its config when provided', done => {
+ assert.throws(() => {
+ return new Runner('pre-commit', 'does-not-exist.json')
+ }, /no such file/)
+
+ assert.throws(() => {
+ return new Runner('pre-commit', './test/Runner.js')
+ }, SyntaxError)
+
+ done()
+ })
+
describe('#hook', () => {
it('holds the target hook script name', done => {
const runner = new Runner('commit-msg', configPath)
assert.strictEqual(runner.hook, 'commit-msg')
done()
})
})
describe('#run', () => {
it('calls child_process.spawn once', done => {
const stub = sinon.stub(child_process, 'spawn')
const runner = new Runner('update', configPath)
runner.run()
assert(stub.calledOnce)
done()
})
})
}) | 12 | 0.20339 | 12 | 0 |
3a4bd89325921182edc3b29380095b3529d51cf0 | requirements.txt | requirements.txt | nose==1.1.2
python-termstyle==0.1.10
rednose==0.3.3
| nose==1.1.2
nosy==1.1.2
python-termstyle==0.1.10
rednose==0.3.3
| Update with Nosy, continious integration | Update with Nosy, continious integration
| Text | apache-2.0 | looplab/skal | text | ## Code Before:
nose==1.1.2
python-termstyle==0.1.10
rednose==0.3.3
## Instruction:
Update with Nosy, continious integration
## Code After:
nose==1.1.2
nosy==1.1.2
python-termstyle==0.1.10
rednose==0.3.3
| nose==1.1.2
+ nosy==1.1.2
python-termstyle==0.1.10
rednose==0.3.3 | 1 | 0.333333 | 1 | 0 |
e8ca2e017166178469ae81cd9b1303c6005492fb | readme.md | readme.md |
This is a web app that lets high school teachers plan dates for their tests and quizzes. Check it out at [quizical.io](quizical.io)
Note: this is not complete, as there are some features that need to be completed. The "forgot your password" links do not work.
## Test Credentials
To test out quizical, use the folliwng credentials:
* School ID: 1
* School password: test
* User 1 email: test@example.com
* User 1 password: test
* User 2 email: test2@example.com
* User 2 password: test
## Acknowledgements
Thanks to [Ben Zweig](tfzweig.com) for the name.
### Code
* [Laravel](laravel.com)
* [Bootstrap](getbootstrap.com)
* [Laravel Calendar](https://github.com/makzumi/laravel-calendar) by makzumi
* The `getOldGET()` function was modified slightly for calendar filters
* [Select To Autocomplete: Redesigned Country Selector](http://baymard.com/labs/country-selector) |
This is a web app that lets high school teachers plan dates for their tests and quizzes. Check it out at [quizical.io](quizical.io)
Note: this is not complete, as there are some features that need to be completed. The "forgot your password" links do not work.
## Test Credentials
To test out quizical, use the followng credentials:
* School ID: 1
* School password: test
* User 1 email: test@example.com
* User 1 password: test
* User 2 email: test2@example.com
* User 2 password: test
## Acknowledgements
Thanks to [Ben Zweig](tfzweig.com) for the name.
### Code
* [Laravel](laravel.com)
* [Bootstrap](getbootstrap.com)
* [Laravel Calendar](https://github.com/makzumi/laravel-calendar) by makzumi
* The `getOldGET()` function was modified slightly for calendar filters
* [Select To Autocomplete: Redesigned Country Selector](http://baymard.com/labs/country-selector)
## To Do
* Allow users to reset their passwords if they forgot them
* Notifications for messages
* Let schools login to view the calendar and update their info
* Suggest dates that don't have many assessments when a teacher is creating a new one
* For schools with block rotations, show dates that a block meets on when a teacher is creating an assessment
* Feedback form | Add to do section to README | Add to do section to README
| Markdown | mit | alisha/quizical,alisha/quizical | markdown | ## Code Before:
This is a web app that lets high school teachers plan dates for their tests and quizzes. Check it out at [quizical.io](quizical.io)
Note: this is not complete, as there are some features that need to be completed. The "forgot your password" links do not work.
## Test Credentials
To test out quizical, use the folliwng credentials:
* School ID: 1
* School password: test
* User 1 email: test@example.com
* User 1 password: test
* User 2 email: test2@example.com
* User 2 password: test
## Acknowledgements
Thanks to [Ben Zweig](tfzweig.com) for the name.
### Code
* [Laravel](laravel.com)
* [Bootstrap](getbootstrap.com)
* [Laravel Calendar](https://github.com/makzumi/laravel-calendar) by makzumi
* The `getOldGET()` function was modified slightly for calendar filters
* [Select To Autocomplete: Redesigned Country Selector](http://baymard.com/labs/country-selector)
## Instruction:
Add to do section to README
## Code After:
This is a web app that lets high school teachers plan dates for their tests and quizzes. Check it out at [quizical.io](quizical.io)
Note: this is not complete, as there are some features that need to be completed. The "forgot your password" links do not work.
## Test Credentials
To test out quizical, use the followng credentials:
* School ID: 1
* School password: test
* User 1 email: test@example.com
* User 1 password: test
* User 2 email: test2@example.com
* User 2 password: test
## Acknowledgements
Thanks to [Ben Zweig](tfzweig.com) for the name.
### Code
* [Laravel](laravel.com)
* [Bootstrap](getbootstrap.com)
* [Laravel Calendar](https://github.com/makzumi/laravel-calendar) by makzumi
* The `getOldGET()` function was modified slightly for calendar filters
* [Select To Autocomplete: Redesigned Country Selector](http://baymard.com/labs/country-selector)
## To Do
* Allow users to reset their passwords if they forgot them
* Notifications for messages
* Let schools login to view the calendar and update their info
* Suggest dates that don't have many assessments when a teacher is creating a new one
* For schools with block rotations, show dates that a block meets on when a teacher is creating an assessment
* Feedback form |
This is a web app that lets high school teachers plan dates for their tests and quizzes. Check it out at [quizical.io](quizical.io)
Note: this is not complete, as there are some features that need to be completed. The "forgot your password" links do not work.
## Test Credentials
- To test out quizical, use the folliwng credentials:
? ^
+ To test out quizical, use the followng credentials:
? ^
* School ID: 1
* School password: test
* User 1 email: test@example.com
* User 1 password: test
* User 2 email: test2@example.com
* User 2 password: test
## Acknowledgements
Thanks to [Ben Zweig](tfzweig.com) for the name.
### Code
* [Laravel](laravel.com)
* [Bootstrap](getbootstrap.com)
* [Laravel Calendar](https://github.com/makzumi/laravel-calendar) by makzumi
* The `getOldGET()` function was modified slightly for calendar filters
* [Select To Autocomplete: Redesigned Country Selector](http://baymard.com/labs/country-selector)
+
+ ## To Do
+
+ * Allow users to reset their passwords if they forgot them
+ * Notifications for messages
+ * Let schools login to view the calendar and update their info
+ * Suggest dates that don't have many assessments when a teacher is creating a new one
+ * For schools with block rotations, show dates that a block meets on when a teacher is creating an assessment
+ * Feedback form | 11 | 0.407407 | 10 | 1 |
4d9272c96016d4235b6d1dfc47354add338982d2 | frontend/package.json | frontend/package.json | {
"name": "javascript",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.8.5"
},
"dependencies": {
"babel-polyfill": "^6.20.0",
"immutable": "^3.8.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"rebass": "^0.3.3",
"redux": "^3.6.0",
"redux-saga": "^0.14.3",
"redux-saga-router": "^1.1.0",
"reflexbox": "^2.2.3",
"sockjs-client": "latest",
"webstomp-client": "^1.0.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"proxy": "ws://localhost:8080"
}
| {
"name": "javascript",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.8.5",
"babel-polyfill": "^6.20.0"
},
"dependencies": {
"immutable": "^3.8.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"rebass": "^0.3.3",
"redux": "^3.6.0",
"redux-saga": "^0.14.3",
"redux-saga-router": "^1.1.0",
"reflexbox": "^2.2.3",
"sockjs-client": "latest",
"webstomp-client": "^1.0.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"proxy": "ws://localhost:8080"
}
| Move babel polyfill to dev dependencies | Move babel polyfill to dev dependencies
| JSON | mit | luxons/seven-wonders,luxons/seven-wonders,luxons/seven-wonders | json | ## Code Before:
{
"name": "javascript",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.8.5"
},
"dependencies": {
"babel-polyfill": "^6.20.0",
"immutable": "^3.8.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"rebass": "^0.3.3",
"redux": "^3.6.0",
"redux-saga": "^0.14.3",
"redux-saga-router": "^1.1.0",
"reflexbox": "^2.2.3",
"sockjs-client": "latest",
"webstomp-client": "^1.0.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"proxy": "ws://localhost:8080"
}
## Instruction:
Move babel polyfill to dev dependencies
## Code After:
{
"name": "javascript",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.8.5",
"babel-polyfill": "^6.20.0"
},
"dependencies": {
"immutable": "^3.8.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"rebass": "^0.3.3",
"redux": "^3.6.0",
"redux-saga": "^0.14.3",
"redux-saga-router": "^1.1.0",
"reflexbox": "^2.2.3",
"sockjs-client": "latest",
"webstomp-client": "^1.0.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"proxy": "ws://localhost:8080"
}
| {
"name": "javascript",
"version": "0.1.0",
"private": true,
"devDependencies": {
- "react-scripts": "0.8.5"
+ "react-scripts": "0.8.5",
? +
+ "babel-polyfill": "^6.20.0"
},
"dependencies": {
- "babel-polyfill": "^6.20.0",
"immutable": "^3.8.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"rebass": "^0.3.3",
"redux": "^3.6.0",
"redux-saga": "^0.14.3",
"redux-saga-router": "^1.1.0",
"reflexbox": "^2.2.3",
"sockjs-client": "latest",
"webstomp-client": "^1.0.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"proxy": "ws://localhost:8080"
} | 4 | 0.117647 | 2 | 2 |
e4533abb791dc6085a8a1c8fe8d8d43baa91686b | doc/user/res/stylesheet.css | doc/user/res/stylesheet.css | a {
color: rgb(54, 96, 146);
}
a:visited {
color: rgb(54, 96, 146);
}
a:hover {
background-color: rgba(54, 96, 146, 0.05);
color: rgb(54, 96, 146);
border: 1px solid rgba(54, 96, 146, 0.13);
}
div.header {
background: rgb(54, 96, 146);
}
div.section {
color: rgb(54, 96, 146);
}
span.opencor {
display: none;
}
p.center {
text-align: center;
}
pre {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
code {
color: rgb(54, 96, 146);
}
img.centerLink:hover {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
table.toolbarButtons th {
padding: 0px 13px 0px 13px;
}
| a {
color: rgb(54, 96, 146);
}
a:visited {
color: rgb(54, 96, 146);
}
a:hover {
background-color: rgba(54, 96, 146, 0.05);
color: rgb(54, 96, 146);
border: 1px solid rgba(54, 96, 146, 0.13);
}
div.header {
background: rgb(54, 96, 146);
}
div.section {
color: rgb(54, 96, 146);
}
span.opencor {
display: none;
}
p.center {
text-align: center;
}
pre {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
code {
color: rgb(54, 96, 146);
}
img.centerLink {
border: none;
}
img.centerLink:hover {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
table.toolbarButtons th {
padding: 0px 13px 0px 13px;
}
| Revert "Revert "Minor CSS fix for our user documentation (for Internet Explorer 10)."" | Revert "Revert "Minor CSS fix for our user documentation (for Internet Explorer 10).""
This reverts commit e67a849b61fec3ec653a406dc1ebe9eafabe973c.
| CSS | apache-2.0 | mirams/opencor,mirams/opencor,Fairly/opencor,Fairly/opencor,Fairly/opencor,mirams/opencor,mirams/opencor,Fairly/opencor,mirams/opencor,Fairly/opencor | css | ## Code Before:
a {
color: rgb(54, 96, 146);
}
a:visited {
color: rgb(54, 96, 146);
}
a:hover {
background-color: rgba(54, 96, 146, 0.05);
color: rgb(54, 96, 146);
border: 1px solid rgba(54, 96, 146, 0.13);
}
div.header {
background: rgb(54, 96, 146);
}
div.section {
color: rgb(54, 96, 146);
}
span.opencor {
display: none;
}
p.center {
text-align: center;
}
pre {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
code {
color: rgb(54, 96, 146);
}
img.centerLink:hover {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
table.toolbarButtons th {
padding: 0px 13px 0px 13px;
}
## Instruction:
Revert "Revert "Minor CSS fix for our user documentation (for Internet Explorer 10).""
This reverts commit e67a849b61fec3ec653a406dc1ebe9eafabe973c.
## Code After:
a {
color: rgb(54, 96, 146);
}
a:visited {
color: rgb(54, 96, 146);
}
a:hover {
background-color: rgba(54, 96, 146, 0.05);
color: rgb(54, 96, 146);
border: 1px solid rgba(54, 96, 146, 0.13);
}
div.header {
background: rgb(54, 96, 146);
}
div.section {
color: rgb(54, 96, 146);
}
span.opencor {
display: none;
}
p.center {
text-align: center;
}
pre {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
code {
color: rgb(54, 96, 146);
}
img.centerLink {
border: none;
}
img.centerLink:hover {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
table.toolbarButtons th {
padding: 0px 13px 0px 13px;
}
| a {
color: rgb(54, 96, 146);
}
a:visited {
color: rgb(54, 96, 146);
}
a:hover {
background-color: rgba(54, 96, 146, 0.05);
color: rgb(54, 96, 146);
border: 1px solid rgba(54, 96, 146, 0.13);
}
div.header {
background: rgb(54, 96, 146);
}
div.section {
color: rgb(54, 96, 146);
}
span.opencor {
display: none;
}
p.center {
text-align: center;
}
pre {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
code {
color: rgb(54, 96, 146);
}
+ img.centerLink {
+ border: none;
+ }
+
img.centerLink:hover {
background: rgba(54, 96, 146, 0.05);
border: 1px solid rgba(54, 96, 146, 0.13);
}
table.toolbarButtons th {
padding: 0px 13px 0px 13px;
} | 4 | 0.085106 | 4 | 0 |
d9b6819b9fd0bc4321307ce67b8fd8d9d8427fb2 | config.ru | config.ru | require "#{File.dirname(__FILE__)}/lib/dolphy"
app = DolphyApplication.app do
get '/hello' do
haml :index, :body => "hello"
end
get '/wat' do
erb :what, :body => "WAT"
end
end
run app
| $LOAD_PATH.unshift(File.dirname(__FILE__))
require "lib/dolphy"
app = DolphyApplication.app do
get '/hello' do
haml :index, :body => "hello"
end
get '/wat' do
erb :what, :body => "wat"
end
get '/' do
haml :index, :body => "index"
end
end
run app
| Set a page for the root. | Set a page for the root.
| Ruby | mit | majjoha/dolphy | ruby | ## Code Before:
require "#{File.dirname(__FILE__)}/lib/dolphy"
app = DolphyApplication.app do
get '/hello' do
haml :index, :body => "hello"
end
get '/wat' do
erb :what, :body => "WAT"
end
end
run app
## Instruction:
Set a page for the root.
## Code After:
$LOAD_PATH.unshift(File.dirname(__FILE__))
require "lib/dolphy"
app = DolphyApplication.app do
get '/hello' do
haml :index, :body => "hello"
end
get '/wat' do
erb :what, :body => "wat"
end
get '/' do
haml :index, :body => "index"
end
end
run app
| - require "#{File.dirname(__FILE__)}/lib/dolphy"
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
+ require "lib/dolphy"
app = DolphyApplication.app do
get '/hello' do
haml :index, :body => "hello"
end
get '/wat' do
- erb :what, :body => "WAT"
? ^^^
+ erb :what, :body => "wat"
? ^^^
+ end
+
+ get '/' do
+ haml :index, :body => "index"
end
end
run app | 9 | 0.692308 | 7 | 2 |
b84014b69b502097bf684d6d006abd4a19a84103 | .travis.yml | .travis.yml | language: python
addons:
postgresql: "9.3"
sudo: false
services:
- mongodb
before_script:
- psql -c 'create database blitzdb_test;' -U postgres
- sleep 3
env:
BLITZDB_SQLALCHEMY_URL: "postgres://postgres@localhost/blitzdb_test"
python:
- "2.7"
- "3.3"
# does not have headers provided, please ask https://launchpad.net/~pypy/+archive/ppa
# maintainers to fix their pypy-dev package.
- "pypy"
# command to install dependencies
install:
- pip install .
- pip install -r requirements.txt
- pip install -r requirements-travis.txt
# command to run tests
script: py.test
| language: python
addons:
postgresql: "9.3"
sudo: false
services:
- mongodb
before_script:
- psql -c 'create database blitzdb_test;' -U postgres
- sleep 3
env:
BLITZDB_SQLALCHEMY_URL: "postgres://postgres@localhost/blitzdb_test"
python:
- "2.7"
- "3.3"
# does not have headers provided, please ask https://launchpad.net/~pypy/+archive/ppa
# maintainers to fix their pypy-dev package.
- "pypy"
# command to install dependencies
install:
- pip install .
- pip install -r requirements.txt
- pip install -r requirements-travis.txt
- echo $BLITZDB_SQLALCHEMY_URL
# command to run tests
script: py.test
| Check if env variable is set. | Check if env variable is set.
| YAML | mit | adewes/blitzdb,cwoebker/blitzdb | yaml | ## Code Before:
language: python
addons:
postgresql: "9.3"
sudo: false
services:
- mongodb
before_script:
- psql -c 'create database blitzdb_test;' -U postgres
- sleep 3
env:
BLITZDB_SQLALCHEMY_URL: "postgres://postgres@localhost/blitzdb_test"
python:
- "2.7"
- "3.3"
# does not have headers provided, please ask https://launchpad.net/~pypy/+archive/ppa
# maintainers to fix their pypy-dev package.
- "pypy"
# command to install dependencies
install:
- pip install .
- pip install -r requirements.txt
- pip install -r requirements-travis.txt
# command to run tests
script: py.test
## Instruction:
Check if env variable is set.
## Code After:
language: python
addons:
postgresql: "9.3"
sudo: false
services:
- mongodb
before_script:
- psql -c 'create database blitzdb_test;' -U postgres
- sleep 3
env:
BLITZDB_SQLALCHEMY_URL: "postgres://postgres@localhost/blitzdb_test"
python:
- "2.7"
- "3.3"
# does not have headers provided, please ask https://launchpad.net/~pypy/+archive/ppa
# maintainers to fix their pypy-dev package.
- "pypy"
# command to install dependencies
install:
- pip install .
- pip install -r requirements.txt
- pip install -r requirements-travis.txt
- echo $BLITZDB_SQLALCHEMY_URL
# command to run tests
script: py.test
| language: python
addons:
postgresql: "9.3"
sudo: false
services:
- mongodb
before_script:
- psql -c 'create database blitzdb_test;' -U postgres
- sleep 3
env:
BLITZDB_SQLALCHEMY_URL: "postgres://postgres@localhost/blitzdb_test"
python:
- "2.7"
- "3.3"
# does not have headers provided, please ask https://launchpad.net/~pypy/+archive/ppa
# maintainers to fix their pypy-dev package.
- "pypy"
# command to install dependencies
install:
- pip install .
- pip install -r requirements.txt
- pip install -r requirements-travis.txt
+ - echo $BLITZDB_SQLALCHEMY_URL
# command to run tests
script: py.test | 1 | 0.041667 | 1 | 0 |
b222d03c6898d05cbb8670d645e4452a0315f9da | README.md | README.md | angular-router-exception-handler
================================
[](https://travis-ci.org/bendrucker/angular-router-exception-handler)
Delegate route/state change errors to Angular's $exceptionHandler. For ngRoute and UI-Router.
| angular-router-exception-handler
================================
[](https://travis-ci.org/bendrucker/angular-router-exception-handler)
Delegate route/state change errors to Angular's $exceptionHandler. For [ngRoute](https://docs.angularjs.org/api/ngRoute) and [UI-Router](https://github.com/angular-ui/ui-router).
## Overview
The most common source of routing errors are `resolve` methods which return rejected promises. Routing libraries broadcast an event when this happens and so errors can be difficult to track down. This adds event listeners that forward routing errors to [`$exceptionHandler`](https://docs.angularjs.org/api/ng/service/$exceptionHandler), the service that receives thrown errors in Angular code.
## Installing
```bash
$ npm install angular-router-exception-handler
```
```js
angular.module('myApp', [
require('angular-router-exception-handler')
]);
| Add overview of use case | Add overview of use case | Markdown | mit | bendrucker/angular-router-exception-handler | markdown | ## Code Before:
angular-router-exception-handler
================================
[](https://travis-ci.org/bendrucker/angular-router-exception-handler)
Delegate route/state change errors to Angular's $exceptionHandler. For ngRoute and UI-Router.
## Instruction:
Add overview of use case
## Code After:
angular-router-exception-handler
================================
[](https://travis-ci.org/bendrucker/angular-router-exception-handler)
Delegate route/state change errors to Angular's $exceptionHandler. For [ngRoute](https://docs.angularjs.org/api/ngRoute) and [UI-Router](https://github.com/angular-ui/ui-router).
## Overview
The most common source of routing errors are `resolve` methods which return rejected promises. Routing libraries broadcast an event when this happens and so errors can be difficult to track down. This adds event listeners that forward routing errors to [`$exceptionHandler`](https://docs.angularjs.org/api/ng/service/$exceptionHandler), the service that receives thrown errors in Angular code.
## Installing
```bash
$ npm install angular-router-exception-handler
```
```js
angular.module('myApp', [
require('angular-router-exception-handler')
]);
| angular-router-exception-handler
================================
[](https://travis-ci.org/bendrucker/angular-router-exception-handler)
- Delegate route/state change errors to Angular's $exceptionHandler. For ngRoute and UI-Router.
+ Delegate route/state change errors to Angular's $exceptionHandler. For [ngRoute](https://docs.angularjs.org/api/ngRoute) and [UI-Router](https://github.com/angular-ui/ui-router).
+
+ ## Overview
+
+ The most common source of routing errors are `resolve` methods which return rejected promises. Routing libraries broadcast an event when this happens and so errors can be difficult to track down. This adds event listeners that forward routing errors to [`$exceptionHandler`](https://docs.angularjs.org/api/ng/service/$exceptionHandler), the service that receives thrown errors in Angular code.
+
+ ## Installing
+
+ ```bash
+ $ npm install angular-router-exception-handler
+ ```
+
+ ```js
+ angular.module('myApp', [
+ require('angular-router-exception-handler')
+ ]); | 17 | 3.4 | 16 | 1 |
904ab72c66784112d7b7ab84146773f007fa263c | html/display.html | html/display.html | <div id='content'>
<h2>Description</h2>
<p><?php echo $experiment->getDescription(); ?></p>
<h2>Location</h2>
<p><?php echo $experiment->getLocation(); ?></p>
<h2>Requirements</h2>
<ul><?php $experiment->printRequirements(); ?></ul>
<h2>Contact details</h2>
<p>Experimenter: <?php echo $user->getName(); ?><br />
Email: <a href='mailto:<?php echo $user->getEmail(); ?>'><?php echo $user->getEmail(); ?></a><br />
Phone: <?php echo $user->getPhone(); ?></p>
<form name='signup' action='index.php' method='POST'>
<input type='hidden' name='page' value='signup' />
<input type='hidden' name='own' value='<?php echo $experiment->owner; ?>' />
<input type='hidden' name='exp' value='<?php echo $experiment->id; ?>' />
<p><input type='submit' id='button' name='signup' value='Sign up for this experiment' /></p>
</form>
</div>
| <div id='content'>
<h2>Description</h2>
<p><?php echo $experiment->getDescription(); ?></p>
<h2>Location</h2>
<p><?php echo $experiment->getLocation(); ?></p>
<h2>Requirements</h2>
<ul><?php $experiment->printRequirements(); ?></ul>
<h2>Contact details</h2>
<p>Experimenter: <?php echo $user->getName(); ?><br />
Email: <a href='mailto:<?php echo $user->getEmail(); ?>'><?php echo $user->getEmail(); ?></a><br />
Phone: <?php echo $user->getPhone(); ?></p>
<?php
if ($experiment->getStatus() == 'open') {
echo "
<form name='signup' action='index.php' method='POST'>
<input type='hidden' name='page' value='signup' />
<input type='hidden' name='own' value='{$experiment->owner}' />
<p><input type='submit' id='button' name='signup' value='Sign up for this experiment' /></p>
</form>
";
}
else {
echo "<div id='status-closed'>CLOSED</div>";
}
?>
</div>
| Hide Sign Up button when experiment is closed | Hide Sign Up button when experiment is closed
If the status of an experiment has been set to closed, closed a red
closed symbol rather than the sign up button.
| HTML | mit | jwcarr/SimpleSignUp,jwcarr/SimpleSignUp,jwcarr/SimpleSignUp | html | ## Code Before:
<div id='content'>
<h2>Description</h2>
<p><?php echo $experiment->getDescription(); ?></p>
<h2>Location</h2>
<p><?php echo $experiment->getLocation(); ?></p>
<h2>Requirements</h2>
<ul><?php $experiment->printRequirements(); ?></ul>
<h2>Contact details</h2>
<p>Experimenter: <?php echo $user->getName(); ?><br />
Email: <a href='mailto:<?php echo $user->getEmail(); ?>'><?php echo $user->getEmail(); ?></a><br />
Phone: <?php echo $user->getPhone(); ?></p>
<form name='signup' action='index.php' method='POST'>
<input type='hidden' name='page' value='signup' />
<input type='hidden' name='own' value='<?php echo $experiment->owner; ?>' />
<input type='hidden' name='exp' value='<?php echo $experiment->id; ?>' />
<p><input type='submit' id='button' name='signup' value='Sign up for this experiment' /></p>
</form>
</div>
## Instruction:
Hide Sign Up button when experiment is closed
If the status of an experiment has been set to closed, closed a red
closed symbol rather than the sign up button.
## Code After:
<div id='content'>
<h2>Description</h2>
<p><?php echo $experiment->getDescription(); ?></p>
<h2>Location</h2>
<p><?php echo $experiment->getLocation(); ?></p>
<h2>Requirements</h2>
<ul><?php $experiment->printRequirements(); ?></ul>
<h2>Contact details</h2>
<p>Experimenter: <?php echo $user->getName(); ?><br />
Email: <a href='mailto:<?php echo $user->getEmail(); ?>'><?php echo $user->getEmail(); ?></a><br />
Phone: <?php echo $user->getPhone(); ?></p>
<?php
if ($experiment->getStatus() == 'open') {
echo "
<form name='signup' action='index.php' method='POST'>
<input type='hidden' name='page' value='signup' />
<input type='hidden' name='own' value='{$experiment->owner}' />
<p><input type='submit' id='button' name='signup' value='Sign up for this experiment' /></p>
</form>
";
}
else {
echo "<div id='status-closed'>CLOSED</div>";
}
?>
</div>
| <div id='content'>
<h2>Description</h2>
<p><?php echo $experiment->getDescription(); ?></p>
<h2>Location</h2>
<p><?php echo $experiment->getLocation(); ?></p>
<h2>Requirements</h2>
<ul><?php $experiment->printRequirements(); ?></ul>
<h2>Contact details</h2>
<p>Experimenter: <?php echo $user->getName(); ?><br />
Email: <a href='mailto:<?php echo $user->getEmail(); ?>'><?php echo $user->getEmail(); ?></a><br />
Phone: <?php echo $user->getPhone(); ?></p>
+ <?php
+ if ($experiment->getStatus() == 'open') {
+ echo "
<form name='signup' action='index.php' method='POST'>
<input type='hidden' name='page' value='signup' />
- <input type='hidden' name='own' value='<?php echo $experiment->owner; ?>' />
? ^^^^^^^^^^^ ^^^^
+ <input type='hidden' name='own' value='{$experiment->owner}' />
? ^ ^
- <input type='hidden' name='exp' value='<?php echo $experiment->id; ?>' />
<p><input type='submit' id='button' name='signup' value='Sign up for this experiment' /></p>
</form>
+ ";
+ }
+ else {
+ echo "<div id='status-closed'>CLOSED</div>";
+ }
+ ?>
</div> | 12 | 0.5 | 10 | 2 |
f57e10beb9fb312facbcf9f35b375c8abebf7f57 | .travis.yml | .travis.yml | language: c
# On Ubuntu, run in Travis Container
sudo: false
# Use Ubuntu 16.04 Xenial (for Clang 7)
dist: xenial
# helps to use actual GCC on OSX (not Clang!) and Clang version 6
osx_image: xcode10
# build matrix with both OSes and Compilers
os:
- linux
- osx
compiler:
- clang
- gcc
cache:
- ccache
addons:
apt:
packages:
- check
# branches safelist
branches:
only:
- master
- develop
- /^test\/.*$/
- /^feature\/.*$/
before_install:
# fix for homebrew failling on Travis-CI
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then brew update; fi
install:
# install gcc-5 and check on OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then brew install gcc5 check; fi
before_script:
# override $CC to use gcc-5 on OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then export CC="gcc-5"; fi
- cmake .
script:
- make -j -k
- ctest -V
| language: c
# On Ubuntu, run in Travis Container
sudo: false
# Use Ubuntu 16.04 Xenial (for Clang 7)
dist: xenial
# helps to use actual GCC on OSX (not Clang!) and Clang version 6
osx_image: xcode10
# build matrix with both OSes and Compilers
os:
- linux
- osx
compiler:
- clang
- gcc
cache:
- ccache
addons:
apt:
packages:
- check
homebrew:
packages:
- gcc5
- check
# branches safelist
branches:
only:
- master
- develop
- /^test\/.*$/
- /^feature\/.*$/
before_script:
# override $CC to use gcc-5 on OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then export CC="gcc-5"; fi
- cmake .
script:
- make -j -k
- ctest -V
| Change OSX package installation to use addons feature | Change OSX package installation to use addons feature
| YAML | agpl-3.0 | saxbophone/libsaxbospiral | yaml | ## Code Before:
language: c
# On Ubuntu, run in Travis Container
sudo: false
# Use Ubuntu 16.04 Xenial (for Clang 7)
dist: xenial
# helps to use actual GCC on OSX (not Clang!) and Clang version 6
osx_image: xcode10
# build matrix with both OSes and Compilers
os:
- linux
- osx
compiler:
- clang
- gcc
cache:
- ccache
addons:
apt:
packages:
- check
# branches safelist
branches:
only:
- master
- develop
- /^test\/.*$/
- /^feature\/.*$/
before_install:
# fix for homebrew failling on Travis-CI
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then brew update; fi
install:
# install gcc-5 and check on OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then brew install gcc5 check; fi
before_script:
# override $CC to use gcc-5 on OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then export CC="gcc-5"; fi
- cmake .
script:
- make -j -k
- ctest -V
## Instruction:
Change OSX package installation to use addons feature
## Code After:
language: c
# On Ubuntu, run in Travis Container
sudo: false
# Use Ubuntu 16.04 Xenial (for Clang 7)
dist: xenial
# helps to use actual GCC on OSX (not Clang!) and Clang version 6
osx_image: xcode10
# build matrix with both OSes and Compilers
os:
- linux
- osx
compiler:
- clang
- gcc
cache:
- ccache
addons:
apt:
packages:
- check
homebrew:
packages:
- gcc5
- check
# branches safelist
branches:
only:
- master
- develop
- /^test\/.*$/
- /^feature\/.*$/
before_script:
# override $CC to use gcc-5 on OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then export CC="gcc-5"; fi
- cmake .
script:
- make -j -k
- ctest -V
| language: c
# On Ubuntu, run in Travis Container
sudo: false
# Use Ubuntu 16.04 Xenial (for Clang 7)
dist: xenial
# helps to use actual GCC on OSX (not Clang!) and Clang version 6
osx_image: xcode10
# build matrix with both OSes and Compilers
os:
- linux
- osx
compiler:
- clang
- gcc
cache:
- ccache
addons:
apt:
packages:
- check
+ homebrew:
+ packages:
+ - gcc5
+ - check
# branches safelist
branches:
only:
- master
- develop
- /^test\/.*$/
- /^feature\/.*$/
- before_install:
- # fix for homebrew failling on Travis-CI
- - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then brew update; fi
- install:
- # install gcc-5 and check on OSX
- - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then brew install gcc5 check; fi
before_script:
# override $CC to use gcc-5 on OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then export CC="gcc-5"; fi
- cmake .
script:
- make -j -k
- ctest -V | 10 | 0.25 | 4 | 6 |
7d41e9300245a527827f07b75a71e51c571a5f50 | .readthedocs.yml | .readthedocs.yml |
version: 2
python:
version: 3.6
system_packages: true
install:
- requirements: .rtd-environment.yml
- method: setuptools
path: stsci.tools
|
version: 2
python:
version: 3.6
system_packages: true
install:
- requirements: .rtd-environment.yml
- method: setuptools
path: .
| Fix RTD install directive | Fix RTD install directive [ci skip] | YAML | bsd-3-clause | spacetelescope/stsci.tools | yaml | ## Code Before:
version: 2
python:
version: 3.6
system_packages: true
install:
- requirements: .rtd-environment.yml
- method: setuptools
path: stsci.tools
## Instruction:
Fix RTD install directive [ci skip]
## Code After:
version: 2
python:
version: 3.6
system_packages: true
install:
- requirements: .rtd-environment.yml
- method: setuptools
path: .
|
version: 2
python:
version: 3.6
system_packages: true
install:
- requirements: .rtd-environment.yml
- method: setuptools
- path: stsci.tools
+ path: . | 2 | 0.2 | 1 | 1 |
a5303ca89785f9327ac27ddf6eb1b2ad0c29cd73 | CHANGELOG.md | CHANGELOG.md |
* Hand new arguments to callbacks, namely method name and return value (for after). New Order of block arguments for before is: `arguments, method_name, object`, for after it is: `arguments, method_name, return_value, object`. To migrate to this version you need to change blocks that either use `*args` and then access `args` or calls that do `arg_1, arg_2, object` as the third argument is now the method name. You can change them to `arg_1, arg_2, *, object`.
## 0.3.1 (March 27th, 2014)
* improve error reporting
* run warning free with -w
## 0.3.0 (January 19th, 2014)
* Work properly with inheritance (callbacks are just called if `super` is really invoked)
* Work properly with modules (callbacks on module methods are executed when the methods are called)
|
* Hand new arguments to callbacks, namely method name and return value (for after). New Order of block arguments for before is: `arguments, method_name, object`, for after it is: `arguments, method_name, return_value, object`. To migrate to this version you need to change blocks that either use `*args` and then access `args` or calls that do `arg_1, arg_2, object` as the third argument is now the method name. You can change them to `arg_1, arg_2, *, object`.
* Dropped explicit rubinius support, it should work but dropped testing. If you need it please get in touch.
## 0.3.1 (March 27th, 2014)
* improve error reporting
* run warning free with -w
## 0.3.0 (January 19th, 2014)
* Work properly with inheritance (callbacks are just called if `super` is really invoked)
* Work properly with modules (callbacks on module methods are executed when the methods are called)
| Add rubinius drop to changelog | Add rubinius drop to changelog
| Markdown | mit | PragTob/after_do | markdown | ## Code Before:
* Hand new arguments to callbacks, namely method name and return value (for after). New Order of block arguments for before is: `arguments, method_name, object`, for after it is: `arguments, method_name, return_value, object`. To migrate to this version you need to change blocks that either use `*args` and then access `args` or calls that do `arg_1, arg_2, object` as the third argument is now the method name. You can change them to `arg_1, arg_2, *, object`.
## 0.3.1 (March 27th, 2014)
* improve error reporting
* run warning free with -w
## 0.3.0 (January 19th, 2014)
* Work properly with inheritance (callbacks are just called if `super` is really invoked)
* Work properly with modules (callbacks on module methods are executed when the methods are called)
## Instruction:
Add rubinius drop to changelog
## Code After:
* Hand new arguments to callbacks, namely method name and return value (for after). New Order of block arguments for before is: `arguments, method_name, object`, for after it is: `arguments, method_name, return_value, object`. To migrate to this version you need to change blocks that either use `*args` and then access `args` or calls that do `arg_1, arg_2, object` as the third argument is now the method name. You can change them to `arg_1, arg_2, *, object`.
* Dropped explicit rubinius support, it should work but dropped testing. If you need it please get in touch.
## 0.3.1 (March 27th, 2014)
* improve error reporting
* run warning free with -w
## 0.3.0 (January 19th, 2014)
* Work properly with inheritance (callbacks are just called if `super` is really invoked)
* Work properly with modules (callbacks on module methods are executed when the methods are called)
|
* Hand new arguments to callbacks, namely method name and return value (for after). New Order of block arguments for before is: `arguments, method_name, object`, for after it is: `arguments, method_name, return_value, object`. To migrate to this version you need to change blocks that either use `*args` and then access `args` or calls that do `arg_1, arg_2, object` as the third argument is now the method name. You can change them to `arg_1, arg_2, *, object`.
+ * Dropped explicit rubinius support, it should work but dropped testing. If you need it please get in touch.
## 0.3.1 (March 27th, 2014)
* improve error reporting
* run warning free with -w
## 0.3.0 (January 19th, 2014)
* Work properly with inheritance (callbacks are just called if `super` is really invoked)
* Work properly with modules (callbacks on module methods are executed when the methods are called) | 1 | 0.083333 | 1 | 0 |
e9cbc477abcfa6f6a564c9246d7b0d77570148cc | .travis.yml | .travis.yml | language: ruby
install: ./script/bootstrap
script: ./script/cibuild
rvm:
- 1.9.3
- 2.0.0
- 2.1.1
- 2.2
notifications:
email: false
| language: ruby
sudo: false
install: ./script/bootstrap
script: ./script/cibuild
rvm:
- 1.9.3
- 2.0
- 2.1
- 2.2
notifications:
email: false
| Update Travis yml config file. | Update Travis yml config file.
- sudo: false
More RAM, dedicated cpu cores, awesome network performance, fantastic
VM boot times.
> Using our new container-based stack only requires one additional line
in your .travis.yml:
> `sudo: false`
Source:
http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-
infrastructure/
- Test against latest 2.0 and 2.1.
| YAML | mit | github/task_list,codydaig/task_list,deckar01/task_list,krayinc/task_list,codydaig/task_list,krayinc/task_list,github/task_list,deckar01/task_list,krayinc/task_list,github/task_list,deckar01/task_list,codydaig/task_list,deckar01/task_list | yaml | ## Code Before:
language: ruby
install: ./script/bootstrap
script: ./script/cibuild
rvm:
- 1.9.3
- 2.0.0
- 2.1.1
- 2.2
notifications:
email: false
## Instruction:
Update Travis yml config file.
- sudo: false
More RAM, dedicated cpu cores, awesome network performance, fantastic
VM boot times.
> Using our new container-based stack only requires one additional line
in your .travis.yml:
> `sudo: false`
Source:
http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-
infrastructure/
- Test against latest 2.0 and 2.1.
## Code After:
language: ruby
sudo: false
install: ./script/bootstrap
script: ./script/cibuild
rvm:
- 1.9.3
- 2.0
- 2.1
- 2.2
notifications:
email: false
| language: ruby
+ sudo: false
install: ./script/bootstrap
script: ./script/cibuild
rvm:
- 1.9.3
- - 2.0.0
? --
+ - 2.0
- - 2.1.1
? --
+ - 2.1
- 2.2
notifications:
email: false | 5 | 0.5 | 3 | 2 |
0d45e2b10d1cc0ff57cfde35fdee1a8ccca4fbae | t/metaclass/validate.t | t/metaclass/validate.t | use strict;
use warnings;
use Test::More;
use Test::Moose::More;
use aliased 'MooseX::TraitFor::Meta::Class::BetterAnonClassNames'
=> 'MetaTrait';
use aliased 'MooseX::Util::Meta::Class'
=> 'MetaClass';
validate_class MetaClass, (
isa => [ qw{ Moose::Meta::Class } ],
does => [ MetaTrait ],
attributes => [
is_anon => {
-isa => [ qw{ Moose::Meta::Attribute } ],
reader => 'is_anon',
init_arg => 'is_anon',
isa => 'Bool',
default => 0,
},
],
);
done_testing;
| use strict;
use warnings;
use Test::More;
use Test::Moose::More;
use aliased 'MooseX::TraitFor::Meta::Class::BetterAnonClassNames'
=> 'MetaTrait';
use aliased 'MooseX::Util::Meta::Class'
=> 'MetaClass';
validate_class MetaClass, (
isa => [ qw{ Moose::Meta::Class } ],
does => [ MetaTrait ],
attributes => [
is_anon => {
reader => 'is_anon',
init_arg => 'is_anon',
isa => 'Bool',
default => 0,
},
],
);
done_testing;
| Drop -- somewhat pointless -- failing test | Drop -- somewhat pointless -- failing test
| Perl | lgpl-2.1 | RsrchBoy/moosex-util,RsrchBoy/moosex-util | perl | ## Code Before:
use strict;
use warnings;
use Test::More;
use Test::Moose::More;
use aliased 'MooseX::TraitFor::Meta::Class::BetterAnonClassNames'
=> 'MetaTrait';
use aliased 'MooseX::Util::Meta::Class'
=> 'MetaClass';
validate_class MetaClass, (
isa => [ qw{ Moose::Meta::Class } ],
does => [ MetaTrait ],
attributes => [
is_anon => {
-isa => [ qw{ Moose::Meta::Attribute } ],
reader => 'is_anon',
init_arg => 'is_anon',
isa => 'Bool',
default => 0,
},
],
);
done_testing;
## Instruction:
Drop -- somewhat pointless -- failing test
## Code After:
use strict;
use warnings;
use Test::More;
use Test::Moose::More;
use aliased 'MooseX::TraitFor::Meta::Class::BetterAnonClassNames'
=> 'MetaTrait';
use aliased 'MooseX::Util::Meta::Class'
=> 'MetaClass';
validate_class MetaClass, (
isa => [ qw{ Moose::Meta::Class } ],
does => [ MetaTrait ],
attributes => [
is_anon => {
reader => 'is_anon',
init_arg => 'is_anon',
isa => 'Bool',
default => 0,
},
],
);
done_testing;
| use strict;
use warnings;
use Test::More;
use Test::Moose::More;
use aliased 'MooseX::TraitFor::Meta::Class::BetterAnonClassNames'
=> 'MetaTrait';
use aliased 'MooseX::Util::Meta::Class'
=> 'MetaClass';
validate_class MetaClass, (
isa => [ qw{ Moose::Meta::Class } ],
does => [ MetaTrait ],
attributes => [
is_anon => {
- -isa => [ qw{ Moose::Meta::Attribute } ],
reader => 'is_anon',
init_arg => 'is_anon',
isa => 'Bool',
default => 0,
},
],
);
done_testing; | 1 | 0.038462 | 0 | 1 |
10446942e45b39ea2f22fd5a32c7e4bfa8f5bbdc | features/read_api/cache_control.feature | features/read_api/cache_control.feature | @use_http_client
Feature: the read api should provide cache control headers
Scenario: _status is not cacheable
when I go to "/_status"
then the "Cache-Control" header should be "no-cache"
Scenario: query returns an etag
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
when I go to "/foo"
then the "ETag" header should be ""7c7cec78f75fa9f30428778f2b6da9b42bd104d0""
Scenario: response is Not Modified when etag matches
Given "licensing.json" is in "foo" data_set
when I go to "/foo"
and I send another request to "/foo" with the received etag
then I should get back a status of "304"
| @use_http_client
Feature: the read api should provide cache control headers
Scenario: _status is not cacheable
when I go to "/_status"
then the "Cache-Control" header should be "no-cache"
Scenario: query returns an etag
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
when I go to "/foo"
then the "ETag" header should be ""7c7cec78f75fa9f30428778f2b6da9b42bd104d0""
Scenario: response is Not Modified when etag matches
Given "licensing.json" is in "foo" data_set
when I go to "/foo"
and I send another request to "/foo" with the received etag
then I should get back a status of "304"
Scenario: non-realtime data sets have a 30 minute cache header
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
| realtime | false |
| published | true |
when I go to "/foo"
then the "Cache-Control" header should be "max-age=1800, must-revalidate"
Scenario: realtime data sets have a 2 minute cache header
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
| realtime | true |
| published | true |
when I go to "/foo"
then the "Cache-Control" header should be "max-age=120, must-revalidate"
| Add feature tests for read API cache header times | Add feature tests for read API cache header times
As Alex,
I would like to have confidence in my refactor,
So that I don't break an application I haven't worked on in months.
| Cucumber | mit | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | cucumber | ## Code Before:
@use_http_client
Feature: the read api should provide cache control headers
Scenario: _status is not cacheable
when I go to "/_status"
then the "Cache-Control" header should be "no-cache"
Scenario: query returns an etag
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
when I go to "/foo"
then the "ETag" header should be ""7c7cec78f75fa9f30428778f2b6da9b42bd104d0""
Scenario: response is Not Modified when etag matches
Given "licensing.json" is in "foo" data_set
when I go to "/foo"
and I send another request to "/foo" with the received etag
then I should get back a status of "304"
## Instruction:
Add feature tests for read API cache header times
As Alex,
I would like to have confidence in my refactor,
So that I don't break an application I haven't worked on in months.
## Code After:
@use_http_client
Feature: the read api should provide cache control headers
Scenario: _status is not cacheable
when I go to "/_status"
then the "Cache-Control" header should be "no-cache"
Scenario: query returns an etag
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
when I go to "/foo"
then the "ETag" header should be ""7c7cec78f75fa9f30428778f2b6da9b42bd104d0""
Scenario: response is Not Modified when etag matches
Given "licensing.json" is in "foo" data_set
when I go to "/foo"
and I send another request to "/foo" with the received etag
then I should get back a status of "304"
Scenario: non-realtime data sets have a 30 minute cache header
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
| realtime | false |
| published | true |
when I go to "/foo"
then the "Cache-Control" header should be "max-age=1800, must-revalidate"
Scenario: realtime data sets have a 2 minute cache header
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
| realtime | true |
| published | true |
when I go to "/foo"
then the "Cache-Control" header should be "max-age=120, must-revalidate"
| @use_http_client
Feature: the read api should provide cache control headers
Scenario: _status is not cacheable
when I go to "/_status"
then the "Cache-Control" header should be "no-cache"
Scenario: query returns an etag
Given "licensing.json" is in "foo" data_set with settings
| key | value |
| raw_queries_allowed | true |
when I go to "/foo"
then the "ETag" header should be ""7c7cec78f75fa9f30428778f2b6da9b42bd104d0""
Scenario: response is Not Modified when etag matches
Given "licensing.json" is in "foo" data_set
when I go to "/foo"
and I send another request to "/foo" with the received etag
then I should get back a status of "304"
+
+ Scenario: non-realtime data sets have a 30 minute cache header
+ Given "licensing.json" is in "foo" data_set with settings
+ | key | value |
+ | raw_queries_allowed | true |
+ | realtime | false |
+ | published | true |
+ when I go to "/foo"
+ then the "Cache-Control" header should be "max-age=1800, must-revalidate"
+
+ Scenario: realtime data sets have a 2 minute cache header
+ Given "licensing.json" is in "foo" data_set with settings
+ | key | value |
+ | raw_queries_allowed | true |
+ | realtime | true |
+ | published | true |
+ when I go to "/foo"
+ then the "Cache-Control" header should be "max-age=120, must-revalidate" | 18 | 1 | 18 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.